/* sections.css — направления, документы, медиа, карточки и табличные блоки */

/* ── Общие отступы секций ── */
.section { padding: 80px 0; }
.section-head { margin-bottom: 44px; }

/* ── HUD-скобка вокруг метки секции ── */
.bracket-label {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 8px 22px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--brand-primary);
    margin-bottom: 16px;
    gap: 8px;
}
/* Угловые скобки через псевдоэлементы */
.bracket-label::before,
.bracket-label::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 10px;
    border: 1.5px solid var(--brand-primary);
    opacity: 0.65;
}
.bracket-label::before { left: 0; border-right: none; }
.bracket-label::after  { right: 0; border-left:  none; }

/* Инвертированный вариант (тёмный фон) */
.bracket-label--light {
    color: var(--brand-teal);
}
.bracket-label--light::before,
.bracket-label--light::after {
    border-color: var(--brand-teal);
}

/* ── Пунктирный горизонтальный разделитель «Высотная линия» ── */
.altitude-rule {
    height: 1px;
    background: repeating-linear-gradient(
        90deg,
        var(--color-border) 0 6px,
        transparent 6px 12px
    );
    margin: 0 0 44px;
    position: relative;
}
.altitude-rule::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 32px;
    height: 3px;
    background: var(--brand-teal);
    transform: translateY(-50%);
    border-radius: 2px;
}

/* ── Карточки направлений ── */
.programs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.program-card {
    background: var(--surface-card);
    border: 1px solid var(--color-border);
    border-top: 3px solid var(--brand-primary);
    padding: 28px 26px 26px;
    position: relative;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.25s ease,
                border-color 0.2s ease;
    overflow: hidden;
}
/* Декоративный угловой треугольник */
.program-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 36px 36px 0;
    border-color: transparent var(--brand-light) transparent transparent;
    transition: border-color 0.2s ease;
}
.program-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 32px rgba(0, 108, 118, 0.14);
    border-color: var(--brand-primary);
}
.program-card:hover::after {
    border-right-color: rgba(0, 108, 118, 0.12);
}
.program-card .num {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--brand-teal);
    letter-spacing: 0.10em;
    text-transform: uppercase;
    opacity: 0.9;
    margin-bottom: 14px;
}
.program-card h3 {
    margin: 0 0 12px;
    color: var(--brand-primary);
    font-size: 18px;
    line-height: 1.3;
}
.program-card p {
    font-size: 14.5px;
    color: var(--brand-gray);
    line-height: 1.6;
    margin: 0;
}

/* ── Документы ── */
.doc-list {
    background: var(--surface-card);
    border: 1px solid var(--color-border);
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}
.doc-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.15s ease;
    position: relative;
}
.doc-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--brand-primary);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.doc-row:hover { background-color: rgba(224, 239, 243, 0.55); }
.doc-row:hover::before { opacity: 1; }
.doc-row:last-child { border-bottom: none; }

.doc-ext {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.06em;
    background: var(--brand-primary);
    color: var(--on-dark);
    padding: 4px 8px;
    flex-shrink: 0;
    border-radius: 2px;
    min-width: 44px;
    text-align: center;
    text-transform: uppercase;
}
.doc-row .name {
    flex: 1;
    font-size: 15px;
    color: var(--brand-gray);
    font-weight: 500;
    line-height: 1.4;
}
.doc-row .date {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--brand-gray);
    opacity: 0.7;
    flex-shrink: 0;
}
.doc-row .dl {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--brand-primary);
    flex-shrink: 0;
    border: 1px solid var(--brand-primary);
    padding: 6px 14px;
    border-radius: 2px;
    transition: background-color 0.2s ease, color 0.2s ease;
    text-decoration: none;
    text-transform: uppercase;
}
.doc-row .dl:hover {
    background-color: var(--brand-primary);
    color: var(--on-dark);
}

/* ── Медиагалерея ── */
.media-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
.media-item {
    aspect-ratio: 1;
    background: var(--brand-light);
    border: 1px solid var(--color-border);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
    border-radius: 2px;
}
.media-item:hover {
    border-color: var(--brand-primary);
    transform: scale(1.03);
    box-shadow: 0 8px 24px rgba(0, 108, 118, 0.15);
    z-index: 1;
}
.media-item span {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--brand-gray);
    opacity: 0.6;
}
.media-item.video::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--media-video-overlay);
}
.media-item.video::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 18px;
    border-color: transparent transparent transparent var(--on-dark);
}

/* ── Публичные таблицы ── */
table.site-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    background: var(--surface-card);
    border: 1px solid var(--color-border);
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
table.site-table th {
    background-color: var(--brand-light);
    color: var(--brand-primary);
    font-family: var(--font-head);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 12px;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 2px solid rgba(0, 108, 118, 0.20);
}
table.site-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    color: var(--brand-gray);
    font-size: 14.5px;
}
table.site-table tr:last-child td { border-bottom: none; }
table.site-table tr:hover td {
    background-color: rgba(224, 239, 243, 0.45);
}

/* ── Страница ошибки ── */
.error-page {
    text-align: center;
    padding: 80px 0;
    min-height: calc(100vh - var(--header-height));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.error-page__code {
    font-family: var(--font-head);
    font-size: clamp(72px, 12vw, 140px);
    color: var(--brand-primary);
    line-height: 1;
    margin: 16px 0 8px;
    letter-spacing: -0.02em;
    opacity: 0.15;
    position: absolute;
}
.error-page__eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brand-teal);
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}
.error-page__msg {
    color: var(--brand-gray);
    max-width: 540px;
    margin: 0 auto 32px;
    font-size: 17px;
    line-height: 1.55;
    position: relative;
    z-index: 1;
}
.error-page__inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ── Секция новостей на слайде — светлый вариант ── */
.news-section { background: transparent !important; }
.news-section .section-head h2 { color: var(--brand-primary); }

/* ── Статистика / цифры секций ── */
.stats-row {
    display: flex;
    gap: 48px;
    flex-wrap: wrap;
    margin-top: 36px;
}
.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.stat-value {
    font-family: var(--font-head);
    font-size: 36px;
    font-weight: 700;
    color: var(--brand-primary);
    line-height: 1.1;
    letter-spacing: -0.01em;
}
.stat-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--brand-gray);
    opacity: 0.7;
}

/* Инвертированный вариант (на тёмном фоне) */
.stat-value--light { color: var(--brand-teal); }
.stat-label--light { color: rgba(255,255,255,0.55); }

/* ── Медиакарточки (слайд media на главной) ── */
.media-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.25s ease,
                border-color 0.25s ease;
}
.media-card-link:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
    border-color: var(--brand-teal);
}
.media-card-thumb {
    width: 100%;
    height: 130px;
    overflow: hidden;
    background: rgba(0,108,118,0.25);
    position: relative;
}
.media-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}
.media-card-link:hover .media-card-thumb img { transform: scale(1.06); }

.media-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.4);
}
.media-card-placeholder--video::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,108,118,0.3);
}

.media-card-title {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,0.80);
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-top: 1px solid rgba(255,255,255,0.08);
}

/* ── Сетка и карточки папок документов ── */
.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
    margin-bottom: 50px;
}

.folder-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--surface-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 25px;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease-in-out, border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.folder-card:hover,
.folder-card:focus-visible {
    transform: translateY(-3px);
    border-color: var(--brand-primary);
    box-shadow: 0 8px 20px rgba(0, 108, 118, 0.12);
    outline: none;
}

.folder-card__icon {
    margin-bottom: 15px;
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
}

.folder-card:hover .folder-card__icon {
    color: var(--brand-teal);
}

.folder-card__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-heading);
    line-height: 1.4;
}

.folder-card__footer {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--color-border);
    padding-top: 15px;
}

.folder-card__count {
    font-size: 0.85rem;
    color: var(--brand-gray);
    font-weight: 500;
}

.folder-card__count strong {
    color: var(--brand-primary);
}

.folder-card__action {
    font-size: 0.85rem;
    color: var(--brand-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.2s ease;
}

.folder-card:hover .folder-card__action {
    color: var(--brand-teal);
}

.doc-back-link {
    font-size: 0.95rem;
    color: var(--brand-primary);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.15s ease;
}

.doc-back-link:hover,
.doc-back-link:focus-visible {
    color: var(--brand-teal);
    outline: none;
}

.doc-empty-state {
    background: var(--color-background-soft);
    border: 1px dashed var(--color-border);
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    color: var(--brand-gray);
    font-style: italic;
}

