/* ========================================
   Faculty public page — typography + layout
   Manrope / Literata / Noto Sans — KZ · RU · EN (cyrillic-ext)
   ======================================== */

:root {
    --fac-font-sans: 'Manrope', 'Noto Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --fac-font-display: 'Literata', 'Noto Sans', Georgia, 'Times New Roman', serif;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--fac-font-sans);
    font-size: 1rem;
    line-height: 1.65;
    letter-spacing: 0.01em;
    font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6,
.metro-hero__title,
.metro-tile__title,
.faculty-about__title,
.faculty-section__badge,
.faculty-card__title,
.faculty-teacher__name,
.display-3 {
    font-family: var(--fac-font-display);
    font-feature-settings: 'kern' 1, 'liga' 1;
    letter-spacing: -0.015em;
}

.metro-hero__uni,
.metro-lang-btn,
.metro-tile__label,
.metro-tile__stats,
.faculty-card__date,
.faculty-card__link,
.faculty-btn,
.metro-burger,
.metro-close {
    font-family: var(--fac-font-sans);
}

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

.footer-zero-kz--faculty {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem auto 1.5rem;
    max-width: min(100% - 2rem, 1200px);
    padding: 16px;
    background: rgba(26, 61, 43, 0.06);
    border: 1px solid rgba(5, 97, 42, 0.12);
    border-radius: 12px;
    min-height: 48px;
}

/* ---- HERO ---- */
.metro-hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.metro-hero__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.metro-hero__bg--placeholder {
    background: linear-gradient(135deg, #0a140f 0%, #1a4a2e 100%);
}

.metro-hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(135deg, rgba(10, 20, 15, 0.78) 0%, rgba(15, 35, 24, 0.62) 100%);
}

.metro-hero__top {
    position: relative;
    z-index: 3;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(16px, 3vw, 28px) clamp(20px, 4vw, 48px);
    gap: 12px;
}

.metro-hero__right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.metro-lang-switch {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.metro-lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 14px;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 700;
    font-size: 0.78rem;
    text-decoration: none;
    letter-spacing: 0.06em;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(6px);
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.metro-lang-btn:hover {
    color: #fff;
    border-color: rgba(46, 204, 113, 0.6);
    background: rgba(46, 204, 113, 0.15);
}

.metro-lang-btn.active {
    color: #fff;
    border-color: #2ecc71;
    background: rgba(46, 204, 113, 0.2);
}

.metro-hero__logo img {
    height: clamp(36px, 5vw, 50px);
    filter: brightness(0) invert(1);
    transition: opacity 0.2s ease;
}

.metro-hero__logo:hover img {
    opacity: 0.85;
}

/* Burger → X (no rotation on close button) */
.metro-burger {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
}

.metro-burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.2s ease, width 0.2s ease;
    transform-origin: center;
}

.metro-burger:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.22);
}

.metro-burger:hover span {
    background: #2ecc71;
}

.metro-burger.is-active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.metro-burger.is-active span:nth-child(2) {
    opacity: 0;
    width: 0;
}

.metro-burger.is-active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.metro-hero__content {
    position: relative;
    z-index: 3;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 clamp(20px, 4vw, 48px) clamp(48px, 8vw, 80px);
    max-width: 900px;
}

.metro-hero__uni {
    color: rgba(255, 255, 255, 0.5);
    font-size: clamp(0.68rem, 2vw, 0.85rem);
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0 0 16px;
}

.metro-hero__title {
    color: #fff;
    font-size: clamp(1.75rem, 6vw, 4.5rem);
    font-weight: 700;
    line-height: 1.08;
    margin: 0;
    letter-spacing: -0.02em;
    text-shadow: 0 4px 40px rgba(0, 0, 0, 0.4);
}

/* ---- OVERLAY MENU ---- */
.metro-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.metro-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.metro-overlay__bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #0a140f 0%, #0f1814 50%, #132e1d 100%);
}

.metro-close {
    position: absolute;
    top: clamp(16px, 3vw, 28px);
    right: clamp(20px, 4vw, 48px);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    z-index: 10;
}

.metro-close:hover,
.metro-close:focus-visible {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(46, 204, 113, 0.45);
    color: #2ecc71;
    outline: none;
}

.metro-tiles {
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    grid-auto-rows: minmax(160px, auto);
    gap: 8px;
    padding: clamp(72px, 12vw, 100px) clamp(16px, 4vw, 48px) clamp(24px, 4vw, 48px);
    max-height: 100vh;
    max-height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
    align-content: start;
}

.metro-tile {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    text-decoration: none !important;
    transition: box-shadow 0.25s ease;
    opacity: 0;
    transform: translateY(12px);
    min-height: 140px;
}

.metro-overlay.open .metro-tile {
    animation: metroTileIn 0.45s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
}

@keyframes metroTileIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.metro-tile:nth-child(1) { animation-delay: 0.04s; }
.metro-tile:nth-child(2) { animation-delay: 0.08s; }
.metro-tile:nth-child(3) { animation-delay: 0.12s; }
.metro-tile:nth-child(4) { animation-delay: 0.16s; }
.metro-tile:nth-child(5) { animation-delay: 0.2s; }
.metro-tile:nth-child(6) { animation-delay: 0.24s; }

@media (hover: hover) {
    .metro-tile:hover {
        box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
    }
}

.metro-tile--large { grid-column: span 2; grid-row: span 2; }
.metro-tile--wide { grid-column: span 2; }
.metro-tile--tall { grid-row: span 2; }

.metro-tile--gradient-dark {
    background: linear-gradient(135deg, #0a1f14 0%, #1a4a2e 50%, #0f2d1c 100%);
    color: #fff;
}

.metro-tile--ocean { background: linear-gradient(135deg, #1e3a8a, #2563eb); color: #fff; }
.metro-tile--mint { background: linear-gradient(135deg, #059669, #10b981); color: #fff; }
.metro-tile--forest { background: linear-gradient(135deg, #064e3b, #047857); color: #fff; }
.metro-tile--gold { background: linear-gradient(135deg, #92400e, #d97706); color: #fff; }
.metro-tile--royal { background: linear-gradient(135deg, #581c87, #7c3aed); color: #fff; }

.metro-tile__title {
    color: #fff;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 700;
    margin: 0 0 12px;
    line-height: 1.2;
}

.metro-tile__label {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.metro-tile__count {
    color: rgba(255, 255, 255, 0.65);
    font-size: clamp(1.6rem, 4vw, 2.5rem);
    font-weight: 800;
    margin-bottom: 6px;
}

.metro-tile__icon {
    font-size: 1.75rem;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 8px;
}

.metro-tile__stats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 0;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50px;
}

.metro-tile__stats span {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.72rem;
    padding: 0 8px;
}

.metro-tile__stats strong {
    color: #2ecc71;
    font-weight: 800;
    margin-right: 3px;
}

.metro-tile__dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
}

/* ---- SECTIONS ---- */
.faculty-section {
    padding: clamp(2.5rem, 6vw, 4rem) 0;
}

.faculty-section--muted {
    background: #f5f7f6;
}

.faculty-section--green {
    background: #eef7f0;
}

.faculty-section__head {
    text-align: center;
    margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.faculty-section__badge {
    display: inline-block;
    background: linear-gradient(135deg, #1a3d2b, #247a42);
    color: #fff;
    padding: 12px 32px;
    border-radius: 12px;
    font-size: clamp(0.8rem, 2vw, 1rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    box-shadow: 0 6px 24px rgba(26, 61, 43, 0.2);
}

.faculty-about__title {
    color: #1a3d2b;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    margin-bottom: 1.25rem;
}

.faculty-about__list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
}

.faculty-about__list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #1a3d2b;
    margin-bottom: 0.65rem;
    line-height: 1.55;
    font-size: clamp(0.92rem, 2vw, 1rem);
}

.faculty-about__list li i {
    color: #2ecc71;
    margin-top: 4px;
    flex-shrink: 0;
}

.faculty-about__img {
    width: 100%;
    height: clamp(220px, 40vw, 350px);
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(26, 61, 43, 0.12);
}

.faculty-about__img-wrap {
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, #e8f0eb, #d4e8dc);
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.faculty-about__img-wrap i {
    font-size: 3rem;
    color: rgba(26, 61, 43, 0.25);
}

.faculty-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #1a3d2b, #247a42);
    color: #fff !important;
    border: none;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 16px rgba(26, 61, 43, 0.25);
}

.faculty-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(46, 204, 113, 0.3);
    background: linear-gradient(135deg, #247a42, #2ecc71);
}

/* Cards grid (departments, news, achievements) */
.faculty-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: clamp(16px, 3vw, 24px);
}

.faculty-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(26, 61, 43, 0.08);
    box-shadow: 0 4px 20px rgba(26, 61, 43, 0.06);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

@media (hover: hover) {
    .faculty-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 16px 40px rgba(26, 61, 43, 0.12);
    }
}

.faculty-card__media {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, #e8f0eb, #dceee3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.faculty-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

@media (hover: hover) {
    .faculty-card:hover .faculty-card__media img {
        transform: scale(1.04);
    }
}

.faculty-card__media--placeholder i {
    font-size: 2rem;
    color: rgba(26, 61, 43, 0.25);
}

.faculty-card__body {
    padding: 1.1rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
}

.faculty-card__date {
    font-size: 0.75rem;
    color: #2ecc71;
    font-weight: 600;
}

.faculty-card__title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a3d2b;
    line-height: 1.45;
    margin: 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.faculty-card__link {
    align-self: flex-start;
    color: #1a3d2b;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    border-bottom: 2px solid #2ecc71;
    padding-bottom: 2px;
    transition: color 0.2s ease;
}

.faculty-card__link:hover {
    color: #2ecc71;
}

/* Teachers */
.faculty-teachers {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: clamp(16px, 3vw, 24px);
}

.faculty-teacher {
    background: #fff;
    border-radius: 20px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid rgba(26, 61, 43, 0.08);
    box-shadow: 0 4px 20px rgba(26, 61, 43, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    height: 100%;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

@media (hover: hover) {
    .faculty-teacher:hover {
        transform: translateY(-6px);
        box-shadow: 0 16px 40px rgba(26, 61, 43, 0.1);
    }
}

.faculty-teacher__photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #1a3d2b;
    box-shadow: 0 8px 24px rgba(26, 61, 43, 0.15);
}

.faculty-teacher__photo--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8f0eb, #dceee3);
    color: rgba(26, 61, 43, 0.3);
    font-size: 2.5rem;
}

.faculty-teacher__name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a3d2b;
    margin: 0;
    line-height: 1.35;
}

.faculty-teacher__role {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

.faculty-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #64748b;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 16px;
    border: 1px dashed rgba(26, 61, 43, 0.15);
}

.faculty-empty i {
    font-size: 2rem;
    color: rgba(26, 61, 43, 0.25);
    margin-bottom: 0.75rem;
    display: block;
}

/* Back to top */
.back-to-top {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    width: 48px !important;
    height: 48px !important;
    background: #1a3d2b !important;
    border-radius: 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease, background 0.2s ease !important;
    z-index: 9990 !important;
    box-shadow: 0 6px 20px rgba(26, 61, 43, 0.3);
    border: none !important;
    text-decoration: none !important;
}

.back-to-top.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

.back-to-top:hover {
    background: #2ecc71 !important;
}

.back-to-top i {
    color: #fff !important;
    font-size: 18px !important;
}

/* Responsive overlay grid */
@media (max-width: 768px) {
    .metro-tile--large,
    .metro-tile--wide,
    .metro-tile--tall {
        grid-column: span 1;
        grid-row: span 1;
    }

    .metro-lang-switch {
        display: none;
    }

    .faculty-about .row {
        text-align: center;
    }

    .faculty-about__list li {
        text-align: left;
    }
}

@media (max-width: 576px) {
    .metro-burger,
    .metro-close {
        width: 42px;
        height: 42px;
    }

    .faculty-teacher__photo {
        width: 120px;
        height: 120px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .metro-tile,
    .metro-overlay,
    .metro-burger span,
    .faculty-card,
    .faculty-teacher,
    .back-to-top {
        animation: none !important;
        transition: none !important;
    }

    .metro-overlay.open .metro-tile {
        opacity: 1;
        transform: none;
    }
}
