/* === Базовые настройки === */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    color: #3E2E23;
    min-height: 100vh;
    position: relative;
    background: radial-gradient(ellipse at 50% 50%, rgba(0,0,0,0) 60%, rgba(0,0,0,0.15) 100%);
    background-color: #F5F0E1;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(139,119,90,0.05) 2px, rgba(139,119,90,0.05) 4px),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)' opacity='0.08'/%3E%3C/svg%3E");
    padding-left: 240px;
    cursor: url("data:image/svg+xml,%3Csvg width='26' height='26' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolygon points='50,5 61,35 93,35 67,55 76,93 50,70 24,93 33,55 7,35 39,35' fill='%23B13E3E' stroke='%23C9A96E' stroke-width='3'/%3E%3C/svg%3E") 13 13, auto;
}

/* ===== Боковая панель (усиленное стекло) ===== */
.sidebar {
    width: 240px;
    background: rgba(255, 248, 236, 0.4);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-right: 1px solid rgba(201, 169, 110, 0.6);
    padding: 35px 0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    box-shadow:
        inset 0 0 60px rgba(255,255,255,0.6),
        6px 0 40px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.sidebar::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -30%;
    width: 200px;
    height: 200%;
    background: linear-gradient(120deg, rgba(255,255,255,0.6) 0%, transparent 60%);
    transform: rotate(20deg);
    pointer-events: none;
}

.sidebar-header {
    padding: 0 25px 25px;
    border-bottom: 1px solid rgba(201, 169, 110, 0.8);
    margin-bottom: 25px;
}

.sidebar-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #4A3B2F;
    letter-spacing: 1px;
    text-shadow: 0 1px 4px rgba(255,255,255,0.7);
}

.sidebar-nav { list-style: none; padding: 0 20px; flex-grow: 1; }
.sidebar-nav li { margin-bottom: 8px; }

.sidebar-nav a {
    display: block;
    padding: 12px 18px;
    color: #4A3B2F;
    text-decoration: none;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 400;
    background: rgba(255,255,255,0.25);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.4);
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.sidebar-nav a:hover {
    background: rgba(201,169,110,0.3);
    color: #B13E3E;
    border-color: rgba(201,169,110,0.8);
    box-shadow: 0 6px 15px rgba(177,62,62,0.2);
}

.sidebar-nav a.active {
    background: rgba(201,169,110,0.4);
    color: #9A3232;
    border-color: #C9A96E;
    box-shadow: inset 0 2px 8px rgba(255,255,255,0.8), 0 8px 20px rgba(177,62,62,0.3);
    font-weight: 500;
}

.sidebar-nav a.active::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px; height: 26px;
    background: linear-gradient(180deg, #C9A96E, #B13E3E);
    border-radius: 4px;
    box-shadow: 0 0 12px rgba(177,62,62,0.6);
}

/* ===== Кнопка-звезда (мобильная) ===== */
.menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    left: auto;
    z-index: 200;
    background: rgba(245,240,225,0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(201,169,110,0.6);
    border-radius: 50%;
    width: 58px; height: 58px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15), inset 0 2px 10px white;
    animation: breathe 3s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.menu-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

@keyframes breathe {
    0%, 100% { transform: scale(1); box-shadow: 0 8px 20px rgba(0,0,0,0.1), inset 0 2px 8px white; }
    50% { transform: scale(1.06); box-shadow: 0 14px 30px rgba(177,62,62,0.25), inset 0 2px 14px white; }
}

/* ===== Основной контент ===== */
.content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 55px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.intro { text-align: center; margin-bottom: 70px; width: 100%; position: relative; }
.intro h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 3.5rem;
    font-weight: 600;
    color: #4A3B2F;
    letter-spacing: 3px;
    margin-bottom: 0.2em;
    text-shadow: 0 2px 8px rgba(255,255,255,0.7);
}
.intro h1::after {
    content: '';
    display: block;
    width: 100px;
    height: 4px;
    margin: 15px auto 0;
    background: linear-gradient(90deg, transparent, #C9A96E, transparent);
    border-radius: 2px;
}

.subtitle {
    font-size: 1.1rem;
    color: #5C4B3A;
    letter-spacing: 1px;
    margin-bottom: 2rem;
}
.intro-text {
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.8;
    font-weight: 300;
    position: relative;
}
.intro-text::first-letter {
    font-family: 'Cormorant Garamond', serif;
    font-size: 3.5rem;
    float: left;
    line-height: 0.8;
    margin-right: 8px;
    color: #B13E3E;
    font-weight: 600;
}

/* Поиск */
.search { margin-bottom: 50px; width: 100%; display: flex; justify-content: center; }
.search-row {
    display: flex; gap: 15px; flex-wrap: wrap; justify-content: center; align-items: center;
    background: rgba(255,248,236,0.75);
    backdrop-filter: blur(20px);
    padding: 10px 30px;
    border-radius: 50px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.08), inset 0 1px 10px white;
    border: 1px solid rgba(201,169,110,0.5);
}

.search-row input {
    padding: 14px 24px;
    border: 1px solid rgba(177,62,62,0.25);
    border-radius: 30px;
    background: rgba(255,255,245,0.8);
    backdrop-filter: blur(5px);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    width: 200px;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.05);
    transition: all 0.2s;
}
.search-row input:focus {
    border-color: #B13E3E;
    box-shadow: 0 0 18px rgba(177,62,62,0.3), inset 0 2px 6px rgba(0,0,0,0.05);
    background: #fffef5;
}

.search-row button {
    padding: 14px 32px;
    background: linear-gradient(180deg, #D28A8A 0%, #A13E3E 100%);
    color: #FFF8EC;
    border: 1px solid rgba(177,62,62,0.7);
    border-radius: 30px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(177,62,62,0.4), inset 0 1px 0 rgba(255,255,255,0.5);
    position: relative;
    overflow: hidden;
    transition: all 0.2s;
}
.search-row button::after {
    content: '';
    position: absolute;
    top: -30%;
    left: -40%;
    width: 80px;
    height: 150%;
    background: rgba(255,255,255,0.3);
    transform: rotate(30deg);
    transition: left 0.5s;
}
.search-row button:hover::after {
    left: 120%;
}
.search-row button:hover {
    background: linear-gradient(180deg, #E39A9A 0%, #B14A4A 100%);
    box-shadow: 0 12px 25px rgba(177,62,62,0.6), inset 0 1px 0 rgba(255,255,255,0.6);
}

/* Сетка карточек */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    width: 100%;
    margin-bottom: 60px;
}

/* Карточка (суперстекло) */
.card {
    background: rgba(255,248,236,0.55);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(201,169,110,0.6);
    box-shadow:
        0 25px 45px rgba(0,0,0,0.1),
        inset 0 1px 15px rgba(255,255,255,0.8);
    transition: all 0.35s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.card.visible {
    opacity: 1;
    transform: translateY(0);
}
.card::before {
    content: '';
    position: absolute;
    top: -40%;
    left: -50%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(255,255,255,0.7) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.35s;
    pointer-events: none;
}
.card:hover::before {
    opacity: 0.5;
}
.card:hover {
    transform: translateY(-12px);
    box-shadow:
        0 35px 55px rgba(177,62,62,0.25),
        inset 0 2px 25px rgba(255,255,255,0.9);
    border-color: #C9A96E;
    background: rgba(255,252,245,0.7);
}

.card-image { width: 100%; height: 210px; overflow: hidden; background: #E2D7C1; }

/* Общие стили для всех картинок внутри карточек */
.card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #E2D7C1;
    padding: 20px;
    transition: transform 0.4s;
}

/* Георгиевская лента — дополнительная гарантия */
.lenta-placeholder {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #E2D7C1;
    padding: 20px;
}

.card:hover .card-image img { transform: scale(1.05); }

.no-photo {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #D3C7A6, #C2B28A);
    color: #5C4B3A;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

.card-info { padding: 20px 18px; }

/* Ученик теперь нейтральный */
.card-student-name {
    font-size: 0.8rem;
    color: #7A6A5A;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
    margin-bottom: 6px;
}
/* Подпись «ученик —» */
.card-student-name::before {
    content: 'ученик — ';
    font-weight: 600;
    color: #7A6A5A;
}

/* Ветеран — красный акцент */
.card-veteran-name {
    font-size: 1.3rem;
    color: #B13E3E;
    font-weight: 600;
    font-family: 'Cormorant Garamond', serif;
    margin-bottom: 5px;
}

.card-years { font-size: 0.9rem; color: #7A6A5A; }

/* Модальное окно */
.modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.45); backdrop-filter: blur(15px);
    z-index: 1000; justify-content: center; align-items: center;
}
.modal.active { display: flex; }

.modal-content {
    background: rgba(255,248,236,0.9);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(201,169,110,0.8);
    border-radius: 30px;
    padding: 40px;
    max-width: 650px; width: 90%;
    max-height: 85vh; overflow-y: auto;
    box-shadow:
        0 45px 70px rgba(0,0,0,0.35),
        inset 0 2px 25px rgba(255,255,255,0.7);
    position: relative;
}
.modal-close { position: absolute; top: 15px; right: 22px; font-size: 36px; cursor: pointer; color: #7A6A5A; transition: color 0.2s; }
.modal-close:hover { color: #B13E3E; }
.modal-photo { width: 100%; max-height: 300px; object-fit: contain; border-radius: 20px; margin-bottom: 25px; box-shadow: 0 15px 30px rgba(0,0,0,0.2); }
.modal-content h2 { color: #7A6A5A; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; }
.modal-content h3 { font-family: 'Cormorant Garamond', serif; font-size: 2rem; margin-bottom: 12px; color: #B13E3E; }
.modal-content p { line-height: 1.8; margin-top: 18px; color: #4A3B2F; }

/* Мероприятия */
.events-feed { display: flex; flex-direction: column; gap: 30px; width: 100%; max-width: 850px; }
.event-card {
    background: rgba(255,248,236,0.7);
    backdrop-filter: blur(22px);
    border: 1px solid rgba(201,169,110,0.6);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 20px 35px rgba(0,0,0,0.1), inset 0 1px 12px white;
    transition: transform 0.3s;
}
.event-card:hover { transform: translateY(-8px); }
.event-img { width: 100%; height: 220px; object-fit: cover; display: block; }
.event-placeholder { background: #D3C7A6; display: flex; align-items: center; justify-content: center; color: #5C4B3A; }
.event-info { padding: 25px; }
.event-date { color: #B13E3E; font-size: 0.9rem; font-weight: 500; letter-spacing: 0.5px; margin-bottom: 8px; }
.event-info h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8rem;
    margin: 8px 0;
    color: #4A3B2F;
    position: relative;
}
.event-info h3::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: #C9A96E;
    margin-top: 8px;
    border-radius: 2px;
}

/* Письма */
.letters-container { width: 100%; max-width: 750px; display: flex; flex-direction: column; gap: 35px; }
.letter-form {
    display: flex; flex-direction: column; gap: 16px;
    background: rgba(255,248,236,0.75);
    backdrop-filter: blur(22px);
    padding: 30px;
    border-radius: 28px;
    box-shadow: 0 18px 35px rgba(0,0,0,0.08), inset 0 1px 14px white;
    border: 1px solid rgba(201,169,110,0.5);
}
.letter-form input, .letter-form textarea {
    padding: 14px 20px;
    border-radius: 18px;
    border: 1px solid rgba(177,62,62,0.3);
    background: rgba(255,255,245,0.8);
    backdrop-filter: blur(8px);
    font-family: inherit;
    font-size: 1rem;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.05);
    transition: all 0.2s;
}
.letter-form input:focus, .letter-form textarea:focus {
    border-color: #B13E3E;
    box-shadow: 0 0 15px rgba(177,62,62,0.2), inset 0 2px 6px rgba(0,0,0,0.05);
}
.btn-submit {
    padding: 16px;
    background: linear-gradient(180deg, #D28A8A, #A13E3E);
    color: #FFF8EC;
    border: 1px solid rgba(177,62,62,0.6);
    border-radius: 32px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
    box-shadow: 0 10px 20px rgba(177,62,62,0.4), inset 0 1px 0 rgba(255,255,255,0.5);
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.btn-submit::after {
    content: '';
    position: absolute;
    top: -20%;
    left: -40%;
    width: 60px;
    height: 140%;
    background: rgba(255,255,255,0.3);
    transform: rotate(30deg);
    transition: left 0.5s;
}
.btn-submit:hover::after { left: 120%; }
.btn-submit:hover {
    background: linear-gradient(180deg, #E39A9A, #B14A4A);
    box-shadow: 0 14px 28px rgba(177,62,62,0.6), inset 0 1px 0 rgba(255,255,255,0.6);
}

.published-letters { display: flex; flex-wrap: wrap; gap: 18px; }
.letter-bubble {
    background: rgba(255,248,236,0.8);
    backdrop-filter: blur(16px);
    padding: 18px 22px;
    border-radius: 24px;
    max-width: 350px;
    box-shadow: 0 12px 25px rgba(0,0,0,0.08), inset 0 1px 10px white;
    border: 1px solid rgba(201,169,110,0.4);
}
.letter-author { font-weight: 600; color: #B13E3E; margin-bottom: 4px; }

/* Контакты */
.contacts-block {
    background: rgba(255,248,236,0.75);
    backdrop-filter: blur(22px);
    padding: 40px;
    border-radius: 32px;
    max-width: 550px; width: 100%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1), inset 0 1px 15px white;
    border: 1px solid rgba(201,169,110,0.6);
    text-align: center;
}
.contacts-block p { margin-bottom: 14px; font-size: 1.05rem; }
.contacts-block a { color: #B13E3E; text-decoration: none; border-bottom: 1px dotted #B13E3E; }

/* Футер */
.footer {
    background: rgba(235,221,189,0.8);
    backdrop-filter: blur(20px);
    text-align: center;
    padding: 35px;
    color: #5C4B3A;
    font-size: 0.95rem;
    border-top: 1px solid rgba(201,169,110,0.6);
    box-shadow: inset 0 2px 15px rgba(255,255,255,0.7);
    width: 100%;
}
.footer a { color: #B13E3E; text-decoration: none; border-bottom: 1px dotted #B13E3E; }
.footer .small { font-size: 0.8rem; margin-top: 8px; opacity: 0.8; }

/* ========== Адаптивность ========== */
@media (max-width: 768px) {
    body {
        padding-left: 0;
        cursor: auto;
    }

    .sidebar {
        left: -280px;
        transition: left 0.35s;
    }
    .sidebar.open { left: 0; }

    .menu-toggle {
        display: flex;
    }

    .content {
        padding: 30px 20px;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .search-row {
        flex-direction: column;
        align-items: stretch;
    }
    .search-row input {
        width: 100%;
    }

    .intro h1 {
        font-size: 2.5rem;
    }
    .intro-text::first-letter {
        font-size: 2.8rem;
    }
}