/* Shared neutral surfaces; blue is reserved for interactive accents. */
:root {
    --color-bg-medium: #f8f8f8;
    --shadow-soft: 0 12px 32px rgba(0, 0, 0, .05);
    --shadow-medium: 0 18px 44px rgba(0, 0, 0, .10);
    --border-radius-main: 1.25rem;
    --header-height: 5rem;
}
body { background: #f7f7f7; }
header { background: rgba(0,0,0,.88); border-bottom: 1px solid rgba(255,255,255,.12); }
.header-container { max-width: 1440px; gap: 1.5rem; }
.logo { display: flex; align-items: center; flex-shrink: 0; }
.logo img { display: block; width: 170px; height: auto; max-height: 46px; margin: 0; object-fit: contain; }
nav ul li a { padding: .6rem .75rem; font-size: .94rem; }
.hero-content { max-width: 1000px; }
.hero-cta { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.35); box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 12px 30px rgba(0,0,0,.12); }
.department-name { display: inline-block; white-space: nowrap; font-size: clamp(1.25rem, 5.1vw, 3.65rem); }
.section-title h2 { letter-spacing: -.035em; line-height: 1.2; }
.section-title::after { content: ''; display: block; width: 48px; height: 4px; margin: 1.25rem auto 0; border-radius: 99px; background: #222; }
main > section:not(.hero) { background: #fff; }
main > section:nth-child(odd):not(.hero) { background-color: #fafafa; }
.campus-item, .dorm-item, .modern-columns > .column, .benefit-item, .benefit-info,
.program-card, .direction-card, .step-item, .testimonials-container {
    background: #fff;
    border: 1px solid rgba(255,255,255,.9);
    border-radius: var(--border-radius-main);
    box-shadow: inset 0 1px 0 #fff, var(--shadow-soft);
}
@media (hover: hover) {
    .campus-item:hover, .dorm-item:hover, .modern-columns > .column:hover {
        background: var(--color-accent);
        border-color: var(--color-accent); color: white; transform: translateY(-4px);
    }
    .campus-item:hover :is(h3,p,li,h4), .dorm-item:hover :is(h3,p,li,h4), .modern-columns > .column:hover :is(h3,p,li) { color: white; }
}
.faculty .campus-item { background: #fff; }
.faculty-text { background: rgba(255,255,255,.96); border: 1px solid #eee; }
.tab-buttons, .benefit-tabs, .testimonials-tabs { border: 1px solid #ddd; background: #eee; box-shadow: inset 0 1px 0 rgba(255,255,255,.9); }
.footer-contacts { background: #111; border: 1px solid rgba(255,255,255,.12); }
footer { background: #000; }
.modal-content, .news-modal-content, .full-news-modal-content, .gallery-modal-content { background: #fff; border: 1px solid rgba(255,255,255,.8); }
/* News: a native grid, no clipped tracks, fixed heights or resize calculations. */
.news-carousel-container { max-width: 1240px; padding: 0; overflow: visible; background: none; box-shadow: none; }
.news-carousel { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1.5rem; transform: none; align-items: stretch; }
.news-carousel .news-card, .modal-news-card {
    width: 100%; max-width: none; height: auto; min-height: 0; margin: 0;
    background: #fff; border: 1px solid white; box-shadow: var(--shadow-soft);
}
.news-card img, .modal-news-card img { height: auto; aspect-ratio: 16 / 10; object-fit: cover; flex-shrink: 0; }
.news-content { padding: 1.4rem; gap: .85rem; }
.news-card h3, .modal-news-card h3 { margin: 0; font-size: 1.25rem; line-height: 1.35; letter-spacing: -.02em; }
.news-card p, .modal-news-card p { margin: 0; }
.news-card .news-date { order: -1; font-size: .8rem; letter-spacing: .06em; color: #666; }
.news-card .news-short-text { display: block; overflow: visible; font-size: .95rem !important; line-height: 1.65; flex: 1; }
.news-read-more { margin: auto 0 0; padding: .75rem 1.1rem; font-size: .9rem; background: var(--color-accent); min-height: 44px; }
.news-actions { margin-top: 2rem; }
.news-all-button { background: rgba(26,60,110,.06); color: #1a3c6e; border: 1px solid rgba(26,60,110,.18); box-shadow: none; }
.news-modal-close, .full-news-modal-close { border: 0; width: 44px; height: 44px; background: #eee; line-height: 1; border-radius: 50%; }
.full-news-modal-content { max-width: 860px; text-align: left; overflow: visible; }
.full-news-image { display: block; max-height: 45svh; width: 100%; object-fit: contain; background: #eee; }
.full-news-text { max-height: none; overflow: visible; padding: 0; }
.full-news-text p + p { margin-top: 1rem; }
.full-news-modal, .news-modal { overscroll-behavior: contain; }
@media (max-width: 1100px) {
    .news-carousel { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 768px) {
    :root { --header-height: 4.5rem; }
    .logo img { width: 145px; max-width: 50vw; max-height: 40px; }
    .news-carousel { grid-template-columns: minmax(0,1fr); gap: 1.25rem; }
    .news-content { padding: 1.25rem; }
    .news-card h3 { font-size: 1.2rem; }
    .full-news-modal-content { max-height: none; overflow: visible; }
}
.about-content, .quote-content, .info-card, .step, .cutoff-item, .bottom-cutoff-item, .preparatory-item, .curriculum-item {
    background: #fff;
    border: 1px solid rgba(255,255,255,.95); box-shadow: inset 0 1px 0 #fff,var(--shadow-soft);
}
.hero-content {
    padding: clamp(1.25rem,4vw,3rem); border-radius: 2rem;
    background: rgba(255,255,255,.91);
    color: #222;
    border: 1px solid rgba(255,255,255,.8); box-shadow: 0 16px 45px rgba(0,0,0,.08);
}
@supports (backdrop-filter: blur(8px)) {
    .hero-cta, .testimonial-tag { backdrop-filter: blur(8px); }
}
@media (max-width: 768px) {
    .hero-content { padding: 1.5rem .65rem; border-radius: 1.25rem; }
    .department-name { font-size: clamp(1rem,5.6vw,2.5rem); }
    .about-content, .quote-content, .testimonials-container { padding: 1.5rem; }
}
.hero h1 { line-height: 1.15; margin: 1.25rem 0; letter-spacing: -.035em; }
@supports (backdrop-filter: blur(8px)) {
    .hero-content { backdrop-filter: blur(8px); }
}
@media (max-width: 768px) {
    .hero-content { backdrop-filter: none; }
}


/* Local video cover remains useful when the external VK player is unavailable. */
.lab-video { position: relative; aspect-ratio: 16 / 9; height: 100%; background: #000; isolation: isolate; }
.lab-video > img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 1; }
.lab-video-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 1; border: 1px solid rgba(255,255,255,.6); border-radius: 999px; padding: 1rem 1.5rem; background: #1a3c6e; color: #fff; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.lab-video iframe { position: absolute; inset: 0 0 3rem; width: 100%; height: calc(100% - 3rem); border: 0; z-index: 2; background: #000; }
.lab-video-link { position: absolute; bottom: .5rem; left: 1rem; right: 1rem; z-index: 3; text-align: center; color: white; font-size: .85rem; padding: .4rem; border-radius: .5rem; background: rgba(0,0,0,.9); }
.gallery-slide:has(.lab-video) .gallery-caption { top: 0; bottom: auto; padding: 1rem; background: rgba(0,0,0,.5); pointer-events: none; transform: none; }
.gallery-viewer-media .lab-video { height: auto; }
@media (max-width: 480px) { .lab-video-play { padding: .6rem 1rem; font-size: .85rem; } .lab-video-link { font-size: .7rem; bottom: .25rem; } }

/* Neutral text and remaining page-specific surfaces. */
main :is(h2,h3,h4) { color: #222; }
.hero :is(h1,h2,h3,p), .faculty-text :is(h1,h3,p), .testimonial-card :is(h3,p) { color: #222; }
.testimonial-card { background: #fff; color: #222; border: 1px solid #e8e8e8; }
.testimonial-card::before { background: none; }
.testimonial-avatar { background: #eee; color: #222; }
.testimonials-container { background: #fff; }
.tabs-container { background: #eee; border-color: #ddd; }
/* Blue accents on neutral surfaces. */
.section-title::after { background: var(--color-accent); }
:is(.news-card,.modal-news-card,.campus-item,.dorm-item,.info-card,.cutoff-item,.bottom-cutoff-item,.preparatory-item,.curriculum-item) :is(h3,h4),
.full-news-title, .info-value, .testimonials-label { color: var(--color-accent); }
.faculty-text :is(h1,h3,p) { color: #222; }
@media (hover: hover) {
    :is(.campus-item,.dorm-item,.column,.info-card,.step,.cutoff-item,.bottom-cutoff-item,.preparatory-item,.curriculum-item,.benefit-item,.benefit-info,.news-card,.modal-news-card):hover {
        background: var(--color-accent); color: #fff; border-color: var(--color-accent);
    }
    :is(.campus-item,.dorm-item,.column,.info-card,.step,.cutoff-item,.bottom-cutoff-item,.preparatory-item,.curriculum-item,.benefit-item,.benefit-info,.news-card,.modal-news-card):hover :is(h3,h4,p,li,.info-value,.info-note) { color: #fff; }
    .faculty .campus-item:hover .faculty-text { background: var(--color-accent); }
    :is(.news-card,.modal-news-card):hover .news-read-more { background: #fff; color: var(--color-accent); }
}
/* News proposals are sent privately to the editor, never added to the news grid. */
.news-actions { flex-wrap: wrap; align-items: center; gap: .75rem; }
.submit-news-button { border: 1px solid var(--color-accent); background: var(--color-accent); color: #fff; border-radius: 999px; padding: .9rem 1.5rem; min-height: 44px; font: inherit; font-weight: 600; cursor: pointer; }
.submit-news-button:hover { background: #254f89; }
.news-submission-dialog { position: fixed; inset: 0; margin: auto; width: min(760px,calc(100% - 2rem)); max-height: calc(100dvh - 2rem); padding: 0; border: 1px solid #ddd; border-radius: 1.25rem; color: #222; background: #fff; overflow-y: auto; overscroll-behavior: contain; box-shadow: 0 24px 80px rgba(0,0,0,.25); }
.news-submission-dialog::backdrop { background: rgba(0,0,0,.7); }
.news-submission-panel { position: relative; padding: 2.5rem; }
.submission-close { position: absolute; top: .75rem; right: .75rem; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #eee; font-size: 1.75rem; cursor: pointer; }
.submission-label { color: var(--color-accent); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.news-submission-panel h2 { font-size: clamp(1.5rem,4vw,2rem); margin: .4rem 0; line-height: 1.25; }
.submission-intro { color: #666; margin-bottom: 1.5rem; }
#news-submission-form { display: grid; gap: 1.2rem; }
#news-submission-form label { display: grid; gap: .4rem; font-size: .95rem; font-weight: 600; }
#news-submission-form input:not([type="hidden"]), #news-submission-form textarea { width: 100%; min-width: 0; border: 1px solid #ccc; border-radius: .65rem; background: #fafafa; color: #222; font: inherit; padding: .75rem; }
#news-submission-form textarea { resize: vertical; min-height: 150px; }
.submission-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.submission-media { min-width: 0; border: 1px solid #ddd; border-radius: .8rem; padding: 1rem; display: grid; gap: .8rem; }
.submission-media legend { padding: 0 .4rem; font-weight: 700; }
.submission-media p, .submission-privacy, .submission-footnote { color: #666; font-size: .85rem; line-height: 1.6; }
.submission-file-list { list-style: none; color: #555; font-size: .85rem; overflow-wrap: anywhere; }
.submission-status { color: #a32424; font-size: .9rem; }
#news-submission-form .submission-honeypot { display: none; }
#news-submission-form > .submit-news-button { justify-self: start; }
@media (max-width: 600px) { .news-submission-panel { padding: 3.5rem 1.25rem 1.25rem; } .submission-fields { grid-template-columns: minmax(0,1fr); } .news-submission-dialog { width: calc(100% - 1rem); max-height: calc(100dvh - 1rem); } }

/* Light content surfaces with blue interactive accents. */
.hero-cta { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.hero-cta:hover { background: #254f89; color: #fff; }
.testimonial-tag { background: #f5f5f5; color: #444; border-color: #ddd; }
.testimonial-icon { color: var(--color-accent); }
.faculty-text h1 { background: #f5f5f5; border-color: #ddd; }
@media (hover: hover) {
    .faculty .campus-item:hover .faculty-text :is(h1,h3,p) { color: #fff; }
    .faculty .campus-item:hover .faculty-text h1 { background: transparent; border-color: rgba(255,255,255,.6); }
}

.gallery-caption, .gallery-slide:has(.lab-video) .gallery-caption { background: rgba(255,255,255,.92); color: #222; }
.lab-video-link { background: rgba(255,255,255,.95); color: #333; }
