/* ================= СЕКЦИЯ ОБРАЗОВАНИЯ ================= */
/* ================= СЕКЦИЯ ОБРАЗОВАНИЯ ================= */
.edu-section {
    background: #fff;
    padding: 100px 0;
}

.edu-header-container {
    margin-bottom: 52px;
}

.edu-eyebrow {
    font-family: 'Golos Text', sans-serif;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #8B7355;
    margin-bottom: 16px;
}

.edu-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(28px, 3.5vw, 52px);
    font-weight: 400;
    color: #1B2538;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0;
}

.edu-grid {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #D8D4CE; /* Замыкающая линия снизу */
}

.edu-row {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 20px;
    padding: clamp(16px, 2.5vw, 26px) 0;
    border-top: 1px solid #D8D4CE;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.edu-year {
    font-family: 'Playfair Display', serif;
    font-size: clamp(16px, 1.5vw, 20px);
    color: #1B2538;
    line-height: 1.3;
}

.edu-desc {
    font-family: 'Golos Text', sans-serif;
    font-size: clamp(13px, 1.2vw, 15px);
    color: #1A1A1A;
    line-height: 1.65;
}

/* Стили для анимации при появлении */
.edu-row.hidden {
    opacity: 0;
    transform: translateY(14px);
}

.edu-row.visible {
    opacity: 1;
    transform: none;
}

/* ================= СЕЛЕКТОР СЕРТИФИКАТОВ ================= */
.cert-layout {
    display: grid;
    /* Уменьшаем колонку с кнопками до 320px, а карточке отдаем весь остаток */
    grid-template-columns: 1fr 1fr;
    gap: 80px; /* Увеличил отступ для «воздуха» */
    margin-top: 80px;
    align-items: center; /* Центрируем по вертикали, чтобы превью было в фокусе */
}

.cert-drum-viewport {
    height: 570px;
    border: 1px solid #8B7355;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(to bottom, transparent 0%, black 12%, black 88%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 12%, black 88%, transparent 100%);
}

.cert-drum-track {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 175px;
    transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.cert-pill {
    all: unset;
    box-sizing: border-box;
    width: 90%;
    display: flex;
    align-items: center;
    padding: 0 24px;
    background: #F7F5F2;
    border: 1px solid #E0DCD6;
    border-radius: 50px;
    cursor: pointer;
    height: 46px;
    margin-bottom: 14px;
    transition: all 0.4s ease;
}

.cert-pill--active { background: #8B7355; border-color: #8B7355; color: #fff; scale: 1.05; }
.cert-pill-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.cert-pill-tag { display: none; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; }

.cert-active-label { display: none; }

.cert-drum-wrapper { display: contents; }

.cert-card-area {
    position: relative;
    width: 100%;
    max-width: 500px; /* Ограничиваем, чтобы не было гигантизма */
    max-height: 80vh;
    aspect-ratio: 2 / 3;
    background: #1B2538;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0,0,0,0.25); /* Сделали тень чуть глубже для объема */
    border-radius: 4px;
}

.cert-card {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 36px;
    transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.card-bg {
    position: absolute; inset: 0; z-index: 0; opacity: 1;
}

.card-img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    z-index: 1; opacity: 1; object-fit: cover; border: none; pointer-events: none;
}

.card-overlay {
    position: absolute; inset: 0; z-index: 2; pointer-events: none;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.15) 45%, transparent 70%);
}

.card-placeholder {
    position: absolute; inset: 0; z-index: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 16px; opacity: 0.5; pointer-events: none;
}

.placeholder-icon { opacity: 0.7; }

.placeholder-tag {
    font-size: 10px; font-weight: 700; letter-spacing: 2px;
    text-transform: uppercase; color: rgba(255,255,255,0.6);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 3px 10px; border-radius: 2px;
}

.placeholder-label {
    font-family: 'Playfair Display', serif; font-style: italic;
    font-size: 14px; color: rgba(255,255,255,0.5);
    text-align: center; padding: 0 24px; line-height: 1.4;
}

.card-info { position: relative; z-index: 3; color: #fff; }
.card-tag { display: inline-block; padding: 4px 12px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.3); border-radius: 2px; font-size: 10px; font-weight: 700; margin-bottom: 20px; }
.card-title { font-family: 'Playfair Display', serif; font-size: 32px; margin-bottom: 15px; font-style: italic; }
.card-hint { font-size: 11px; text-transform: uppercase; letter-spacing: 2px; opacity: 0.7; display: flex; align-items: center; gap: 10px; }
.card-hint::after { content: ''; width: 30px; height: 1px; background: #fff; opacity: 0.5; }

/* ================= ОБНОВЛЕННОЕ КОМПАКТНОЕ ОКНО ================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modalFadeIn 0.3s ease forwards;
}

.modal-container-box {
    background: #fff;
    width: 95%;
    max-width: 1100px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 40px 100px rgba(0,0,0,0.3);
    border-radius: 12px;
    overflow: hidden;
    animation: modalSlideUp 0.4s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.modal-header {
    height: 90px;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #E0DCD6;
    flex-shrink: 0;
}

.modal-header-left .modal-eyebrow {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #999;
    margin-bottom: 6px;
    font-weight: 700;
}

.modal-header-left .modal-title-main {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    color: #2A2A2A;
    margin: 0;
    font-weight: 400;
}

.modal-close-btn {
    all: unset;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border: 1px solid #E0DCD6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: all 0.2s;
}
.modal-close-btn:hover { background: #F7F5F2; border-color: #8B7355; color: #8B7355; }

.modal-main-layout {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 320px;
    overflow: hidden;
}

.modal-viewer-area {
    background: #F0EDE8;
    padding: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modal-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
    box-shadow: 0 8px 40px rgba(0,0,0,0.15);
    display: block;
}

.modal-sidebar {
    border-left: 1px solid #E0DCD6;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    background: #fff;
    overflow-y: auto;
}

.sidebar-info-block label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #999;
    margin-bottom: 8px;
    font-weight: 700;
}

.sidebar-info-block p { font-size: 15px; line-height: 1.5; color: #2A2A2A; margin: 0; }

.modal-footer-minimal {
    height: 60px;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #E0DCD6;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    flex-shrink: 0;
}

.footer-link { color: #2A2A2A; text-decoration: none; border-bottom: 1px solid #2A2A2A; padding-bottom: 2px; }

@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalSlideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---- Большие экраны (> Full HD) ---- */
@media (min-width: 1921px) {
  .edu-section   { padding: clamp(100px, 8vw, 180px) 0; }
  .edu-desc      { font-size: clamp(15px, 1.1vw, 22px); }
  .edu-year      { font-size: clamp(18px, 1.4vw, 28px); }
  .edu-row       { grid-template-columns: 140px 1fr; }
  .cert-card-area { max-width: 640px; }
  .cert-drum-viewport { height: 720px; }
  .cert-drum-track    { padding-top: 225px; }
  .cert-layout   { gap: 100px; }
  .card-title    { font-size: 40px; }
}

@media (min-width: 2561px) {
  .edu-section   { padding: clamp(120px, 8vw, 220px) 0; }
  .edu-desc      { font-size: clamp(17px, 1.1vw, 28px); }
  .edu-year      { font-size: clamp(22px, 1.4vw, 36px); }
  .edu-row       { grid-template-columns: 180px 1fr; }
  .cert-card-area { max-width: 800px; }
  .cert-drum-viewport { height: 900px; }
  .cert-drum-track    { padding-top: 280px; }
  .cert-layout   { gap: 120px; }
  .card-title    { font-size: 52px; }
}

@media (max-width: 1024px) {
    .cert-layout { grid-template-columns: 1fr; gap: 40px; }

    .cert-drum-viewport {
        width: 100%;
        min-width: 0;
        height: auto;
        border: none;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 8px 0 12px;
        /* Угасание справа — намекает на скролл */
        -webkit-mask-image: linear-gradient(to right, black 75%, transparent 100%);
        mask-image: linear-gradient(to right, black 75%, transparent 100%);
        scrollbar-width: none;
    }
    .cert-drum-viewport::-webkit-scrollbar { display: none; }

    .cert-drum-track {
        flex-direction: row;
        flex-wrap: nowrap;
        padding-top: 0;
        padding-left: 2px;   /* первая пилюля не обрезается слева */
        padding-right: 48px; /* место до правого угасания */
        transform: none !important;
        width: max-content;
        gap: 8px;
    }

    /* Пилюли на мобильном — компактные чипы с коротким тегом */
    .cert-pill {
        width: auto;
        height: 32px;
        padding: 0 14px;
        margin: 0;
        border-radius: 6px;
        white-space: nowrap;
    }
    .cert-pill-label { display: none; }
    .cert-pill-tag { display: inline; }

    /* Подпись с полным названием под треком пилюль */
    .cert-drum-wrapper { display: flex; flex-direction: column; gap: 12px; min-width: 0; width: 100%; }
    .cert-active-label { display: none; }

    .cert-card-area { max-width: 320px; margin: 0 auto; }
    .modal-container-box { width: 100%; height: 100vh; border-radius: 0; }
    .modal-main-layout { grid-template-columns: 1fr; }
    .modal-sidebar { display: none; }
}