/* ===== Reset ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: #1a2b52; /* тёмно-синий как в макете */
    color: #f0f2f8;
    line-height: 1.6;
    font-size: 16px;
}
img { max-width: 100%; display: block; }
a { color: #8ec5ff; text-decoration: none; transition: color .3s; }
a:hover { color: #ffd54f; }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 25px;
}

/* ===== Header ===== */
.header {
    padding: 25px 0 30px;
    background: linear-gradient(180deg, #1a2b52 0%, #22366a 100%);
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.header__inner {
    display: flex;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}
.header__logo img {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: #fff;
    padding: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.nav {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    margin-left: auto;
}
.nav__link {
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 15px;
    letter-spacing: 1px;
    border-bottom: 2px solid transparent;
    padding-bottom: 4px;
    transition: border-color .3s, color .3s;
}
.nav__link:hover {
    color: #ffd54f;
    border-color: #ffd54f;
}
.header__title {
    font-size: 44px;
    text-align: center;
    margin-top: 30px;
    letter-spacing: 2px;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,.3);
    opacity: 0;
    transform: translateY(-15px);
    animation: fadeDown 1s ease .2s forwards;
}

/* ===== Sections ===== */
.section { padding: 40px 0; }
.lead {
    font-size: 18px;
    margin-bottom: 12px;
}
.subtitle {
    font-size: 22px;
    margin: 25px 0 20px;
    color: #fff;
    font-weight: 700;
}
.divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,.25);
    margin: 40px 0;
}

/* ===== Directions list ===== */
.directions {
    list-style: none;
}
.directions li {
    padding: 10px 0 10px 20px;
    position: relative;
    text-align: justify;
    border-bottom: 1px dashed rgba(255,255,255,.1);
}
.directions li:last-child { border: none; }

/* ===== Block ===== */
.block { margin-bottom: 30px; }
.block__title {
    font-size: 20px;
    color: #fff;
    margin-bottom: 15px;
    font-weight: 700;
}
.link {
    color: #ffd54f;
    text-decoration: underline;
}
.link:hover { color: #fff; }

.org {
    margin: 15px 0 25px;
    font-size: 15px;
    color: #d0dbf0;
}

/* ===== Poster ===== */
.poster-wrap {
    margin: 25px 0;
    display: flex;
    justify-content: center;
}
.poster {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
    transition: transform .4s;
}
.poster:hover { transform: scale(1.02); }

/* ===== Gallery ===== */
.gallery {
    display: grid;
    gap: 15px;
    margin-top: 20px;
}
.gallery--3 { grid-template-columns: repeat(3, 1fr); }
.gallery--4 { grid-template-columns: repeat(4, 1fr); }
.gallery--5 { grid-template-columns: repeat(5, 1fr); }

.gallery img,
.gallery figure img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,.3);
    transition: transform .4s, box-shadow .4s;
    cursor: pointer;
}
.gallery img:hover,
.gallery figure img:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 8px 20px rgba(0,0,0,.5);
}
.gallery figure { text-align: center; }
.gallery figcaption {
    margin-top: 8px;
    font-size: 13px;
    color: #d0dbf0;
}

/* Картинка без обрезки (логотип "Искусство куклы") */
.gallery img.no-crop {
    object-fit: contain;
    background: #1a2b52; /* тон в тон с фоном сайта */
    padding: 8px;
    box-shadow: none;
}

/* ===== Board list ===== */
.board-list {
    list-style: none;
    margin: 20px 0 30px;
}
.board-list li {
    padding: 8px 0;
    border-bottom: 1px dashed rgba(255,255,255,.1);
    font-size: 16px;
}

/* ===== Footer ===== */
.footer {
    background: #0f1c3a;
    padding: 30px 0;
    margin-top: 40px;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,.1);
}
.footer__label {
    font-size: 14px;
    opacity: .8;
    margin-bottom: 5px;
}
.footer__link {
    color: #ffd54f;
    font-weight: 700;
    font-size: 17px;
}
.footer__copy {
    margin-top: 15px;
    font-size: 13px;
    opacity: .6;
}

/* ===== Animations ===== */
@keyframes fadeDown {
    to { opacity: 1; transform: translateY(0); }
}
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity .8s ease, transform .8s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Modal (лайтбокс) ===== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: zoom-out;
    padding: 20px;
}
.modal.active { display: flex; }
.modal img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,.6);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .gallery--4, .gallery--5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
    .header__inner { justify-content: center; }
    .nav { margin-left: 0; justify-content: center; gap: 20px; }
    .nav__link { font-size: 13px; }
    .header__title { font-size: 28px; }
    .subtitle { font-size: 19px; }
    .block__title { font-size: 17px; }
    .gallery--3, .gallery--4, .gallery--5 { grid-template-columns: repeat(2, 1fr); }
    .gallery img, .gallery figure img { height: 140px; }
}
@media (max-width: 420px) {
    .gallery--3, .gallery--4, .gallery--5 { grid-template-columns: 1fr; }
    .gallery img, .gallery figure img { height: 220px; }
}

/* Специально для галереи с фотографиями правления */
/* ============================================ */
/*           ГАЛЕРЕЯ ПРАВЛЕНИЯ                   */
/* ============================================ */

.gallery--5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

.gallery--5 figure {
    margin: 0;
    text-align: center;
}

.gallery--5 img {
    width: 100%;
    height: auto; /* главное: автоматическая высота */
    display: block;
    background-color: #f5f5f5;
    border-radius: 8px;
}

.gallery--5 figcaption {
    margin-top: 5px;
    font-size: 14px;
}

/* ============================================ */
/*           МОБИЛЬНАЯ ВЕРСИЯ                    */
/* ============================================ */

@media (max-width: 768px) {
    .gallery--5 {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .gallery--5 img {
        height: auto; /* всё ещё auto */
    }
    
    .gallery--5 figcaption {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .gallery--5 {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .gallery--5 figcaption {
        font-size: 10px;
    }
}