/* Shared layout constraints for every page. Loaded after page styles. */
:root {
    --transition-smooth: transform .25s ease, box-shadow .25s ease, background-color .25s ease, color .25s ease;
}
html { scroll-padding-top: calc(var(--header-height) + 1rem); }
img, video { max-width: 100%; }
main, section, .hero-content, .header-container,
.contacts-column, .news-content { min-width: 0; }
h1, h2, h3 { overflow-wrap: break-word; }
p, a { overflow-wrap: anywhere; }
header { backdrop-filter: none; }
.hero { height: auto; min-height: calc(100svh - var(--header-height)); background-attachment: scroll; }
.hero-content { width: 100%; }
.faculty-text { backdrop-filter: none; background: rgba(35, 35, 35, .88); }
.contacts-columns { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.partners-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.partners-grid img { object-fit: contain; }
.news-carousel { justify-content: flex-start; align-items: stretch; }
.news-carousel .news-card { margin: 0; max-width: none; }
.news-carousel-next { left: auto; }
:focus-visible { outline: 3px solid #6495ed; outline-offset: 4px; }
@media (max-width: 1400px) {
    .nav-toggle { display: block; min-width: 44px; min-height: 44px; }
    .nav-wrapper {
        position: fixed; top: var(--header-height); left: 0; width: 100%;
        height: calc(100dvh - var(--header-height)); background: var(--color-header-bg);
        padding: 1rem; overflow-y: auto; overscroll-behavior: contain;
        transform: translateX(-100%); visibility: hidden;
        transition: transform .25s ease, visibility .25s;
    }
    .nav-wrapper.visible { transform: translateX(0); visibility: visible; }
    nav ul { flex-direction: column; align-items: stretch; gap: .5rem; }
    nav ul li a { justify-content: center; min-height: 44px; font-size: 1.1rem; }
}
@media (max-width: 768px) {
    :root { --header-height: 5rem; }
    .header-container { max-width: 100%; gap: 1rem; }
    .logo { min-width: 0; }
    .logo img { height: auto; max-height: 3.5rem; max-width: min(65vw, 260px); margin: 0; object-fit: contain; }
    section, body.page-main section { padding: 3rem 1rem; }
    .hero { height: auto; padding: 2.5rem 1rem; min-height: calc(100svh - var(--header-height)); }
    .hero h1 { font-size: clamp(1.35rem, 6.5vw, 3rem); line-height: 1.2; }
    .hero-content { padding: 0; }
    .section-title { margin-bottom: 2rem; }
    footer { padding: 3rem 1rem 1.5rem; }
    .footer-contacts { padding: 1.25rem; }
    .contacts-column p { flex-wrap: wrap; }
    .modern-columns, .campus-grid, .dorm-grid, .realization-grid { grid-template-columns: minmax(0, 1fr); }
    .news-carousel .news-card { width: 100%; height: auto; min-height: 430px; }
    .news-carousel-container { padding: 1rem .5rem; }
    .news-modal, .full-news-modal, .gallery-modal, .gallery-viewer-modal { padding: .75rem; }
    .news-modal-content, .full-news-modal-content, .gallery-modal-content, .gallery-viewer-modal-content {
        width: 100%; padding: 3.5rem 1rem 1rem; max-height: calc(100dvh - 1.5rem); overflow-y: auto;
    }
    .modal-news-grid, .gallery-modal-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .animated-item { opacity: 1; transform: none; }
}
/* Native lazy portraits retain the established cover layout. */
img.faculty-photo { object-fit: cover; object-position: center; }
