/* notary.css - Стили для страницы "О нотариусе" */

/* ===== Общие стили ===== */

.notary-page {
    padding: 40px 0 80px;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 25px;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: #8B5A01;
    margin-bottom: 40px;
    line-height: 1.2;
}

/* ===== Блок с текстом и фото ===== */
.notary-content {
    margin-bottom: 80px;
    position: relative;
}

.notary-text {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #333;
    text-align: justify;
    hyphens: auto;
}

.notary-text p {
    margin-bottom: 25px;
}

.notary-text p:last-child {
    margin-bottom: 40px;
}

.notary-photo {
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    background: #F9F2DE;
}

.notary-photo img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.onNotary {
    width: 55%;
}
.onNotary100 {
    margin-top: 10px !important;
    width: 80% !important;
}

.persona {
    font-size: 1.2rem;
    line-height: 1.7;
    color: #333;
    hyphens: auto;
}


/* ===== Десктопная версия (>992px) ===== */
@media (min-width: 993px) {
    .notary-text {
        width: 60%;
        float: left;
        padding-right: 40px;
        box-sizing: border-box;
    }

    .notary-photo {
        width: 35%;
        float: right;
        margin-left: 5%;
        shape-outside: margin-box;
    }
}

/* ===== Мобильная версия (≤992px) ===== */
@media (max-width: 992px) {
    .notary-content {
        display: flex;
        flex-direction: column;
    }

    .notary-text {
        width: 100%;
        padding-right: 0;
        float: none;
    }

    .notary-photo {
        width: 100%;
        max-width: 499px;
        margin: 40px auto 0;
        float: none;
    }

    .page-title {
        font-size: 2.2rem;
    }

    .onNotary {
        width: 100%;
    }

}

/* ===== Галерея сертификатов ===== */
.certificates-section {
    margin: 100px 0 40px !important; /* Увеличили верхний отступ со 80px до 100px */
    padding: 0 25px;
    clear: both;
}

.section-title {
    font-size: 2rem;
    color: #8B5A01;
    text-align: center;
    margin-bottom: 30px;
}

.certificates-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.gallery-item {
    position: relative;
    background: #f5f5f5;
    padding-top: 75%; /* 4:3 соотношение */
    overflow: hidden;
    border-radius: 8px;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.gallery-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

.gallery-thumb:hover {
    opacity: 0.9;
}

.no-certificates-message {
    text-align: center;
    padding: 40px;
    font-size: 1.1rem;
    color: #666;
    background: #f9f9f9;
    border-radius: 8px;
    grid-column: 1 / -1;
}

/* ===== Lightbox стили ===== */
.lightbox .lb-image {
    border-radius: 4px;
    border: 5px solid #fff;
}

.lightbox .lb-nav a.lb-prev,
.lightbox .lb-nav a.lb-next {
    opacity: 0.9;
    transition: opacity 0.2s;
}

.lightbox .lb-nav a.lb-prev:hover,
.lightbox .lb-nav a.lb-next:hover {
    opacity: 1;
}

.lightbox .lb-data .lb-caption {
    font-size: 1rem;
    line-height: 1.4;
    color: #fff;
}

.lightbox .lb-data .lb-close {
    opacity: 0.8;
    transition: opacity 0.2s;
}

.lightbox .lb-data .lb-close:hover {
    opacity: 1;
}

/* ===== Адаптация для маленьких экранов ===== */
@media (max-width: 768px) {
    .page-title {
        font-size: 2rem;
    }

    .notary-text {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .certificates-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .gallery-thumb {
        height: 150px;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }

    .certificates-gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .gallery-thumb {
        height: 120px;
    }
}

/* Галерея сертификатов */
.certificates-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.gallery-item {
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    background: #f5f5f5; /* Простой фон вместо анимации */
    cursor: pointer;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}


.gallery-item:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.gallery-thumb {
    width: 100%;
    height: 250px; /* Фиксированная высота */
    object-fit: cover; /* Обрезает изображение, сохраняя пропорции */
    display: block;
    transition: all 0.3s;
    border-radius: 6px;
}

.gallery-thumb.loaded {
    background: transparent;
}


.gallery-thumb:hover {
    opacity: 0.9;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    overflow: auto;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

.modal-content {
    display: block;
    max-width: 90%;
    max-height: 90vh;
    width: auto;
    height: auto;
    margin: auto;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    object-fit: contain;
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from {transform: scale(0.9);}
    to {transform: scale(1);}
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    user-select: none;
    touch-action: manipulation;
}

.modal-close:hover {
    color: #8B5A01;
}

.modal-caption {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: #fff;
    font-family: 'IBM Plex Serif', serif;
    font-size: 1.1rem;
    padding: 10px 20px;
    background: rgba(0,0,0,0.7);
    max-width: 80%;
    margin: 0 auto;
    border-radius: 4px;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .certificates-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .gallery-thumb {
        height: 150px;
    }

    .modal-content {
        max-width: 95%;
        max-height: 70vh;
    }
}

/* Для мобильных устройств */
@media (hover: none) {
    .gallery-item:hover {
        transform: none !important;
    }
}

