/* ============================================================
   SHFMU "Migjeni" — site stylesheet

   Collegiate and editorial: oxblood and antique gold on ivory
   paper, EB Garamond for display type, Libre Franklin for text
   and interface. Flat surfaces, hairline rules, square corners.

   The admin and teacher panels style themselves mostly inline
   through the old variable names (--primary-blue, --link-blue…),
   so those names stay defined as aliases of the palette below.
   ============================================================ */

:root {
    /* Palette */
    --paper: #FAF7F0;
    --paper-deep: #F2ECE1;
    --paper-edge: #E2D8C6;
    --surface: #FFFFFF;
    --ink: #211C18;
    --ink-soft: #4A423B;
    --muted: #786D62;
    --crimson: #7B1F2C;
    --crimson-deep: #5E1621;
    --crimson-ink: #45111A;
    --gold: #A9823F;
    --gold-light: #D8BD86;
    --field-edge: #D4C8B4;

    /* Type */
    --font-display: 'EB Garamond', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
    --font-text: 'Libre Franklin', 'Segoe UI', system-ui, -apple-system, sans-serif;

    /* Layout */
    --wrap: 1200px;
    --gutter: clamp(1.25rem, 4vw, 2.5rem);
    --masthead-h: 88px;
    --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
    --transition: color 0.2s var(--ease), background-color 0.2s var(--ease), border-color 0.2s var(--ease);

    /* Legacy names used by inline styles in the admin/teacher panels */
    --primary-blue: var(--crimson);
    --secondary-blue: var(--crimson-deep);
    --accent-blue: var(--crimson-ink);
    --light-blue: var(--paper-deep);
    --link-blue: #B8873A;
    --white: var(--paper);
    --off-white: var(--paper);
    --text-white: var(--paper);
    --gray-100: var(--paper-deep);
    --gray-400: #A99E91;
    --gray-500: #7E7368;
    --gray-600: #5B5249;
    --gray-800: var(--ink);
    --bg-light: var(--paper);
    --text-dark: var(--ink);
    --text-muted: var(--muted);
    --text-gray: var(--ink-soft);
    --text-secondary: var(--muted);
    --gradient-blue: linear-gradient(var(--crimson), var(--crimson));
    --gradient-hero: linear-gradient(rgba(69, 17, 26, 0.8), rgba(69, 17, 26, 0.8));
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
    --shadow-xl: none;
    --shadow-2xl: none;
}

/* ============================================================
   Base
   ============================================================ */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border: 0 solid var(--paper-edge);
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--masthead-h) + 1rem);
}

body {
    font-family: var(--font-text);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--ink);
    background: var(--paper);
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 500;
    line-height: 1.12;
    color: var(--ink);
    text-wrap: balance;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 3.4vw, 2.85rem); }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.3rem; font-weight: 600; }
h5 { font-size: 1.1rem; font-weight: 600; }
h6 { font-size: 1rem; font-weight: 600; }

p {
    text-wrap: pretty;
}

a {
    color: var(--crimson);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--crimson-deep);
}

img {
    max-width: 100%;
}

/* crest.png has a 1px grey frame baked into its edge; trim it off */
.brand__crest,
.footer-seal img,
.auth__crest {
    clip-path: inset(2px);
}

hr {
    border-top: 1px solid var(--paper-edge);
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}

::selection {
    background: var(--crimson);
    color: var(--paper);
}

.wrap,
.container,
.section-container {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.section {
    padding-block: clamp(4rem, 8vw, 6.5rem);
}

.section--tint {
    background: var(--paper-deep);
}

.text-center {
    text-align: center;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ============================================================
   Typographic pieces
   ============================================================ */

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.1rem;
    font-family: var(--font-text);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--crimson);
}

.eyebrow::before {
    content: '';
    width: 2rem;
    height: 1px;
    background: var(--gold);
}

.section-head {
    max-width: 44rem;
    margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
}

.section-head h2 {
    margin-bottom: 1rem;
}

.section-head p:not(.eyebrow) {
    font-size: 1.125rem;
    color: var(--ink-soft);
}

.ornament {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    max-width: 20rem;
    margin: 1.75rem auto;
    color: var(--gold);
}

.ornament::before,
.ornament::after {
    content: '';
    flex: 1;
    height: 1px;
    background: currentColor;
}

.ornament span {
    width: 7px;
    height: 7px;
    background: currentColor;
    transform: rotate(45deg);
}

.prose {
    font-family: var(--font-display);
    font-size: 1.3rem;
    line-height: 1.65;
    color: var(--ink);
}

.prose p + p {
    margin-top: 1rem;
}

.prose a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

.empty-note {
    padding: 2rem 0;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-style: italic;
    color: var(--muted);
}

/* ============================================================
   Buttons and links
   ============================================================ */

.btn,
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.95rem 1.75rem;
    font-family: var(--font-text);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: center;
    border: 1px solid transparent;
    border-radius: 2px;
    cursor: pointer;
    transition: var(--transition);
}

.btn--solid,
.btn-primary {
    background: var(--crimson);
    border-color: var(--crimson);
    color: var(--paper);
}

.btn--solid:hover,
.btn-primary:hover {
    background: var(--crimson-deep);
    border-color: var(--crimson-deep);
    color: var(--paper);
}

.btn--line,
.btn-secondary {
    background: transparent;
    border-color: var(--crimson);
    color: var(--crimson);
}

.btn--line:hover,
.btn-secondary:hover {
    background: var(--crimson);
    color: var(--paper);
}

.btn--light {
    background: transparent;
    border-color: rgba(250, 247, 240, 0.55);
    color: var(--paper);
}

.btn--light:hover {
    background: var(--paper);
    border-color: var(--paper);
    color: var(--crimson);
}

.btn--block {
    width: 100%;
}

.link-arrow,
.card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 2px;
    font-family: var(--font-text);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--crimson);
    border-bottom: 1px solid transparent;
}

.link-arrow::after {
    content: '\2192';
    transition: transform 0.2s var(--ease);
}

.link-arrow:hover,
.card-link:hover {
    border-bottom-color: currentColor;
}

.link-arrow:hover::after {
    transform: translateX(3px);
}

.link-arrow--light {
    color: var(--gold-light);
}

.link-arrow--light:hover {
    color: var(--paper);
}

/* ============================================================
   Header
   ============================================================ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--paper);
}

.masthead {
    background: var(--paper);
    border-bottom: 1px solid var(--paper-edge);
}

.masthead__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    min-height: var(--masthead-h);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    color: var(--ink);
}

.brand:hover {
    color: var(--ink);
}

.brand__crest {
    width: 58px;
    height: 58px;
    flex-shrink: 0;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.brand__text {
    display: flex;
    flex-direction: column;
    padding-left: 0.9rem;
    border-left: 1px solid var(--paper-edge);
    line-height: 1;
}

.brand__kicker {
    margin-bottom: 0.35rem;
    font-size: 0.63rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--crimson);
}

.brand__name {
    font-family: var(--font-display);
    font-size: 1.85rem;
    font-weight: 500;
    line-height: 1;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 1.9rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.6rem;
    list-style: none;
}

.nav-links a {
    display: block;
    padding: 0.4rem 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ink-soft);
    text-decoration: underline 2px transparent;
    text-underline-offset: 0.55em;
    transition: var(--transition), text-decoration-color 0.2s var(--ease);
}

.nav-links a:hover {
    color: var(--crimson);
}

.nav-links a.active {
    color: var(--crimson);
    text-decoration-color: var(--gold);
}

.nav-cta {
    padding: 0.75rem 1.2rem;
    background: var(--crimson);
    border-radius: 2px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--paper);
}

.nav-cta:hover {
    background: var(--crimson-deep);
    color: var(--paper);
}

/* Shown only inside the mobile menu; the footer carries it on desktop */
.nav-extra {
    display: none;
}

.menu-toggle {
    display: none;
    position: relative;
    z-index: 1002;
    width: 44px;
    height: 44px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: transparent;
    cursor: pointer;
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--ink);
    transition: transform 0.3s var(--ease), opacity 0.2s;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(33, 28, 24, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease);
}

.nav-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
    padding: clamp(3.5rem, 7vw, 5rem) 0 2rem;
    background: var(--crimson-ink);
    color: rgba(250, 247, 240, 0.75);
    font-size: 0.95rem;
}

.site-footer a {
    color: rgba(250, 247, 240, 0.75);
}

.site-footer a:hover {
    color: var(--gold-light);
}

.footer-top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid rgba(216, 189, 134, 0.25);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.footer-seal {
    width: 84px;
    height: 84px;
    flex-shrink: 0;
    padding: 6px;
    background: var(--paper);
    border: 1px solid var(--gold-light);
}

.footer-seal img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.footer-brand__kicker {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold-light);
}

.footer-brand__name {
    font-family: var(--font-display);
    font-size: 2.25rem;
    line-height: 1.15;
    color: var(--paper);
}

.footer-brand__place {
    font-size: 0.85rem;
}

.footer-motto {
    max-width: 24rem;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-style: italic;
    line-height: 1.45;
    text-align: right;
    color: rgba(250, 247, 240, 0.88);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.5rem;
    padding: 2.5rem 0;
}

.footer-col h3 {
    margin-bottom: 1.1rem;
    font-family: var(--font-text);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold-light);
}

.footer-col p,
.footer-col a {
    display: block;
    margin-bottom: 0.55rem;
}

.footer-col p a {
    display: inline;
    margin-bottom: 0;
}

.footer-col strong {
    font-weight: 600;
    color: var(--paper);
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(216, 189, 134, 0.25);
    font-size: 0.8rem;
    color: rgba(250, 247, 240, 0.6);
}

/* ============================================================
   Home — hero and facts
   The school photo is the backdrop: its sky dissolves into the
   paper so the heading sits in it, and the facts bar overlaps
   the bottom edge to tie the picture into the page.
   ============================================================ */

.hero {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: clamp(600px, 54vw, 820px);
}

.hero__media {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.hero__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 45% 0%;
    filter: sepia(0.12) saturate(0.95);
}

/* Laptops: nudge the photo up a little so a bit more of the school shows,
   less on narrower laptops where the roofline sits closer to the buttons */
@media (min-width: 1280px) {
    .hero__media img {
        object-position: 45% 30%;
    }
}

@media (min-width: 1366px) {
    .hero__media img {
        object-position: 45% 50%;
    }
}

.hero__media::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 70% at 18% 22%, rgba(250, 247, 240, 0.9) 0%, rgba(250, 247, 240, 0.55) 45%, rgba(250, 247, 240, 0) 75%),
        linear-gradient(180deg, var(--paper) 0%, rgba(250, 247, 240, 0.6) 22%, rgba(250, 247, 240, 0) 50%),
        linear-gradient(0deg, var(--paper) 0%, rgba(250, 247, 240, 0) 22%);
}

.hero__content {
    padding-top: clamp(2.25rem, 4vw, 3.75rem);
    padding-bottom: 3rem;
}

.hero__title {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.4rem;
}

.hero__kicker {
    font-family: var(--font-text);
    font-size: clamp(0.72rem, 1.2vw, 0.85rem);
    font-weight: 600;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--crimson);
}

.hero__name {
    font-size: clamp(3.4rem, 7vw, 6.25rem);
    font-weight: 500;
    line-height: 0.95;
    letter-spacing: -0.01em;
}

.hero__name .q {
    color: var(--gold);
}

.hero__lead {
    max-width: 44rem;
    margin-bottom: 1.75rem;
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 1.9vw, 1.5rem);
    font-style: italic;
    line-height: 1.45;
    color: var(--ink-soft);
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
}

.hero .btn--line {
    background: rgba(250, 247, 240, 0.7);
}

.hero .btn--line:hover {
    background: var(--crimson);
}

.hero__facts .facts__row {
    background: var(--paper);
    border-top: 3px solid var(--crimson);
}

.facts__row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-bottom: 1px solid var(--paper-edge);
}

.fact {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 1.6rem 1.5rem;
    border-left: 1px solid var(--paper-edge);
}

.fact:first-child {
    border-left: 0;
}

.fact__num {
    font-family: var(--font-display);
    font-size: clamp(2.25rem, 4vw, 3rem);
    line-height: 1;
    color: var(--crimson);
}

.fact__label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ============================================================
   Home — pillars, news, namesake, portals, closing
   ============================================================ */

.pillars {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(1.5rem, 4vw, 3rem);
}

.pillars--four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pillar {
    padding-top: 1.5rem;
    border-top: 2px solid var(--ink);
}

.pillar__num {
    display: block;
    margin-bottom: 0.75rem;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-style: italic;
    color: var(--gold);
}

.pillar h3 {
    margin-bottom: 0.75rem;
}

.pillar p {
    color: var(--ink-soft);
}

.news-layout {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(2rem, 6vw, 5rem);
    align-items: start;
}

.news-layout__head {
    position: sticky;
    top: calc(var(--masthead-h) + 2rem);
}

.news-layout__head .link-arrow {
    margin-top: 1.5rem;
}

.news-list {
    border-top: 2px solid var(--ink);
}

.news-list--page {
    max-width: 52rem;
}

.news-item {
    display: grid;
    gap: 1.5rem;
    padding: 2rem 0;
    border-bottom: 1px solid var(--paper-edge);
}

.news-item--media {
    grid-template-columns: minmax(0, 13rem) minmax(0, 1fr);
}

.news-item__media img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.news-item__date {
    margin-bottom: 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--crimson);
}

.news-item__title {
    margin-bottom: 0.6rem;
    font-size: 1.75rem;
}

.news-item__title a {
    color: var(--ink);
}

.news-item__title a:hover {
    color: var(--crimson);
}

.news-item__excerpt {
    margin-bottom: 1rem;
    color: var(--ink-soft);
}

.namesake {
    padding: clamp(4rem, 9vw, 7rem) 0;
    background: var(--crimson);
    color: var(--paper);
}

.namesake__grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(2rem, 6vw, 5rem);
    align-items: center;
}

.namesake .eyebrow {
    color: var(--gold-light);
}

.namesake .eyebrow::before {
    background: var(--gold-light);
}

.namesake__name {
    font-family: var(--font-display);
    font-size: clamp(4.5rem, 11vw, 8.5rem);
    font-style: italic;
    line-height: 0.9;
}

.namesake__years {
    margin-top: 1.1rem;
    font-family: var(--font-display);
    font-size: 1.4rem;
    letter-spacing: 0.08em;
    color: var(--gold-light);
}

.namesake__text h2 {
    margin-bottom: 1.25rem;
    color: var(--paper);
}

.namesake__text .prose {
    margin-bottom: 1.75rem;
    color: rgba(250, 247, 240, 0.9);
}

.portals {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.portal {
    display: flex;
    flex-direction: column;
    padding: 2rem 1.75rem 1.75rem;
    background: var(--surface);
    border: 1px solid var(--paper-edge);
    border-top: 3px solid var(--crimson);
    color: var(--ink);
}

.portal:hover {
    border-color: var(--crimson);
    color: var(--ink);
}

.portal h3 {
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
}

.portal p {
    flex: 1;
    margin-bottom: 1.5rem;
    color: var(--ink-soft);
}

.portal__go {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--crimson);
}

.closing {
    padding: clamp(3rem, 6vw, 4.5rem) 0;
    background: var(--paper-deep);
    border-top: 1px solid var(--paper-edge);
}

.closing__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.closing h2 {
    margin-bottom: 0.5rem;
}

.closing p:not(.eyebrow) {
    color: var(--ink-soft);
}

/* ============================================================
   Subpages
   ============================================================ */

.page-head {
    padding: clamp(3rem, 7vw, 5rem) 0 clamp(2.5rem, 5vw, 3.5rem);
    border-bottom: 3px double var(--gold);
}

.crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

.crumbs a {
    color: var(--crimson);
}

.page-head h1 {
    max-width: 20ch;
    font-size: clamp(2.6rem, 6vw, 4.5rem);
}

.page-head__lead {
    max-width: 40rem;
    margin-top: 1.25rem;
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2vw, 1.45rem);
    font-style: italic;
    color: var(--ink-soft);
}

/* Page head with a school photo beside the title, mounted like a print */

.page-head__grid {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
}

.page-head__photo {
    padding: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--paper-edge);
}

.page-head__photo img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.page-head__photo figcaption {
    padding: 0.55rem 0.2rem 0.1rem;
    font-family: var(--font-display);
    font-size: 1rem;
    font-style: italic;
    color: var(--muted);
}

.prose-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(2rem, 6vw, 5rem);
}

.prose-block h2 {
    margin-bottom: 1rem;
}

/* History: a dated chronicle beside the source document */

.chronicle {
    display: grid;
    grid-template-columns: minmax(0, 8fr) minmax(0, 3fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: start;
}

.timeline {
    list-style: none;
    border-bottom: 1px solid var(--paper-edge);
}

.timeline__item {
    display: grid;
    grid-template-columns: minmax(0, 9rem) minmax(0, 1fr);
    gap: clamp(1.25rem, 3vw, 2.5rem);
    padding: clamp(1.75rem, 3vw, 2.5rem) 0;
    border-top: 1px solid var(--paper-edge);
}

.timeline__year {
    font-family: var(--font-display);
    font-size: clamp(2.6rem, 4.6vw, 3.5rem);
    line-height: 1;
    color: var(--crimson);
}

.timeline__year span {
    display: block;
    margin-top: 0.4rem;
    font-size: 1.15rem;
    letter-spacing: 0.06em;
    color: var(--gold);
}

.timeline__body h3 {
    margin-bottom: 0.75rem;
    font-size: 1.75rem;
}

.timeline__body .prose {
    font-size: 1.2rem;
}

.timeline__body .link-arrow {
    margin-top: 1rem;
}

.document {
    position: sticky;
    top: calc(var(--masthead-h) + 2rem);
}

.document a {
    display: block;
    padding: 0.6rem;
    background: var(--surface);
    border: 1px solid var(--paper-edge);
    cursor: zoom-in;
}

.document img {
    display: block;
    width: 100%;
    height: auto;
}

.document figcaption {
    margin-top: 0.9rem;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--muted);
}

/* Gallery mosaic: a 4-column grid; feature tiles span 2×2, tall ones 1×2 */

.mosaic {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: clamp(150px, 17vw, 215px);
    grid-auto-flow: dense;
    gap: 0.75rem;
}

.mosaic__item {
    position: relative;
    display: block;
    overflow: hidden;
    background: var(--paper-edge);
    cursor: zoom-in;
}

.mosaic__item--feature {
    grid-column: span 2;
    grid-row: span 2;
}

.mosaic__item--tall {
    grid-row: span 2;
}

.mosaic__item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease);
}

.mosaic__item:hover img {
    transform: scale(1.03);
}

.mosaic__caption {
    position: absolute;
    inset: auto 0 0;
    padding: 2.75rem 1rem 0.85rem;
    background: linear-gradient(0deg, rgba(33, 28, 24, 0.8), rgba(33, 28, 24, 0));
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-style: italic;
    line-height: 1.3;
    color: var(--paper);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.mosaic__item:hover .mosaic__caption,
.mosaic__item:focus-visible .mosaic__caption {
    opacity: 1;
    transform: none;
}

/* Touch screens have no hover, so captions stay visible */
@media (hover: none) {
    .mosaic__caption {
        opacity: 1;
        transform: none;
    }
}

/* Homepage photo strip, sharing the mosaic's tiles */

.section-head--split {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 2rem;
    max-width: none;
}

.section-head--split h2 {
    margin-bottom: 0;
}

.photo-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.photo-strip .mosaic__item {
    aspect-ratio: 4 / 5;
}

/* Staff list, in sections by role */

.staff-group + .staff-group {
    margin-top: clamp(3.5rem, 7vw, 5rem);
}

.staff-group__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--paper-edge);
}

.staff-group__head h2 {
    font-size: clamp(1.9rem, 3vw, 2.4rem);
}

.staff-group__count {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.staff-source {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 1.25rem;
    margin-top: clamp(3rem, 6vw, 4rem);
    padding-top: 1.5rem;
    border-top: 1px solid var(--paper-edge);
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-style: italic;
    color: var(--muted);
}

.staff-source .link-arrow {
    font-style: normal;
}

/* Photo viewer opened from the gallery, the staff photo and the history page */

.viewer {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: clamp(1rem, 4vw, 3rem) clamp(1rem, 6vw, 5rem);
    background: transparent;
    color: var(--paper);
}

.viewer[open] {
    display: grid;
    place-items: center;
}

.viewer::backdrop {
    background: rgba(21, 17, 14, 0.95);
}

.viewer__figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    max-width: 100%;
}

.viewer__img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 9rem);
    max-height: calc(100dvh - 9rem);
    background: var(--paper-deep);
}

.viewer__caption {
    max-width: 46rem;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-style: italic;
    text-align: center;
    color: rgba(250, 247, 240, 0.9);
}

.viewer__btn {
    position: fixed;
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    background: rgba(250, 247, 240, 0.08);
    border: 1px solid rgba(250, 247, 240, 0.28);
    font-size: 1.9rem;
    line-height: 1;
    color: var(--paper);
    cursor: pointer;
    transition: var(--transition);
}

.viewer__btn:hover {
    background: rgba(250, 247, 240, 0.18);
}

.viewer__btn[hidden] {
    display: none;
}

.viewer__close {
    top: 1rem;
    right: 1rem;
}

.viewer__prev,
.viewer__next {
    top: 50%;
    transform: translateY(-50%);
}

.viewer__prev {
    left: 1rem;
}

.viewer__next {
    right: 1rem;
}

/* Faculty */

.faculty {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 2.5rem 1.75rem;
}

/* The directorate: fewer people, larger portraits */
.faculty--lead {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    max-width: 52rem;
}

.portrait {
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 5;
    margin-bottom: 1.1rem;
    overflow: hidden;
    background: var(--paper-deep);
    border: 1px solid var(--paper-edge);
    outline: 1px solid var(--paper-edge);
    outline-offset: -9px;
}

.portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Heads sit near the top of the portraits; trim from the bottom */
    object-position: 50% 0;
}

.monogram {
    font-family: var(--font-display);
    font-size: 4rem;
    letter-spacing: 0.04em;
    color: var(--crimson);
}

.faculty__name {
    margin-bottom: 0.3rem;
    font-size: 1.45rem;
}

.faculty__name a {
    color: var(--ink);
}

.faculty__name a:hover {
    color: var(--crimson);
}

.faculty__bio {
    margin-bottom: 0.9rem;
    font-size: 0.95rem;
    color: var(--ink-soft);
}

.faculty__role {
    margin-bottom: 0.9rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.profile {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: clamp(2rem, 6vw, 5rem);
    align-items: start;
}

.profile__aside {
    max-width: 18rem;
}

.profile__main h2 {
    margin-bottom: 1rem;
    font-size: 1.9rem;
}

.profile__main .prose {
    margin-bottom: 2.5rem;
}

.details {
    margin-bottom: 2.5rem;
    border-top: 1px solid var(--paper-edge);
}

.details div {
    display: grid;
    grid-template-columns: minmax(0, 11rem) minmax(0, 1fr);
    gap: 1rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--paper-edge);
}

.details dt {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    padding-top: 0.2rem;
}

.details dd {
    color: var(--ink);
}

/* Articles */

.article {
    max-width: 46rem;
    margin-inline: auto;
}

.article__figure {
    margin-bottom: 2.5rem;
}

.article__figure img {
    display: block;
    width: 100%;
}

.article .prose {
    margin-bottom: 3rem;
}

.gallery-title {
    margin-bottom: 1.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--paper-edge);
    font-size: 1.9rem;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 3rem;
}

.gallery img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

/* Contact */

.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr);
    gap: clamp(2rem, 4vw, 3rem);
}

.contact-block h2 {
    margin-bottom: 1.25rem;
    font-size: 1.6rem;
}

.contact-block .details div {
    grid-template-columns: 1fr;
    gap: 0.2rem;
}

.map-container {
    position: relative;
    z-index: 1;
    height: 280px;
    border: 1px solid var(--paper-edge);
}

.form-panel {
    max-width: 48rem;
}

/* ============================================================
   Forms
   ============================================================ */

.field {
    margin-bottom: 1.35rem;
}

.field label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--field-edge);
    border-radius: 2px;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--crimson);
    box-shadow: 0 0 0 3px rgba(123, 31, 44, 0.14);
}

.form-textarea {
    min-height: 9rem;
    resize: vertical;
}

.responsive-form-grid,
.field-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1.25rem;
}

.alert {
    margin-bottom: 1.5rem;
    padding: 0.9rem 1rem;
    border: 1px solid;
    border-left-width: 3px;
    font-size: 0.92rem;
}

.alert--error {
    background: #FBEDEC;
    border-color: #B3261E;
    color: #8C1D18;
}

.alert--info {
    background: var(--paper);
    border-color: var(--gold);
    color: var(--ink-soft);
}

/* ============================================================
   AI Studenti chat
   ============================================================ */

.ai-chat-container {
    max-width: 52rem;
    margin-inline: auto;
    background: var(--surface);
    border: 1px solid var(--paper-edge);
}

.ai-chat-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    padding: 1.4rem 1.75rem;
    background: var(--crimson);
}

.ai-chat-header h2 {
    font-size: 1.6rem;
    color: var(--paper);
}

.ai-chat-header p {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold-light);
}

.ai-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 460px;
    padding: 1.75rem;
    overflow-y: auto;
    background: var(--paper);
}

.message {
    max-width: 80%;
    padding: 0.9rem 1.15rem;
    border-radius: 3px;
    font-size: 1rem;
    line-height: 1.6;
    animation: message-in 0.2s var(--ease);
}

@keyframes message-in {
    from {
        opacity: 0;
    }
}

.message.user {
    align-self: flex-end;
    background: var(--crimson);
    color: var(--paper);
}

.message.assistant {
    align-self: flex-start;
    background: var(--surface);
    border: 1px solid var(--paper-edge);
    color: var(--ink);
}

.ai-chat-input-area {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--surface);
    border-top: 1px solid var(--paper-edge);
}

.ai-chat-input-area .form-input {
    flex: 1;
}

.loading-dots {
    display: flex;
    gap: 4px;
    padding: 10px 0;
}

.loading-dots div {
    width: 7px;
    height: 7px;
    background: var(--crimson);
    border-radius: 50%;
    animation: dots 1.4s infinite ease-in-out both;
}

.loading-dots div:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots div:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes dots {
    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* ============================================================
   Sign-in pages (admin and teacher)
   ============================================================ */

.auth-page {
    min-height: 100vh;
    border-top: 6px solid var(--crimson);
}

.auth {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 6px);
    padding: 3rem 1.25rem;
}

.auth__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--ink);
}

.auth__brand:hover {
    color: var(--ink);
}

.auth__crest {
    width: 92px;
    height: 92px;
    margin-bottom: 1rem;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.auth__kicker {
    margin-bottom: 0.4rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--crimson);
}

.auth__name {
    font-family: var(--font-display);
    font-size: 2.6rem;
    line-height: 1;
}

.auth__card {
    width: 100%;
    max-width: 26rem;
    padding: 2.5rem 2.25rem 2rem;
    background: var(--surface);
    border: 1px solid var(--paper-edge);
    border-top: 3px solid var(--crimson);
}

.auth__title {
    margin-bottom: 0.4rem;
    font-size: 1.9rem;
    text-align: center;
}

.auth__sub {
    margin-bottom: 2rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-align: center;
    color: var(--muted);
}

.auth__back {
    display: block;
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--paper-edge);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: center;
}

.auth__legal {
    margin-top: 2rem;
    font-size: 0.75rem;
    color: var(--muted);
    text-align: center;
}

/* ============================================================
   Legacy classes (admin/teacher panels and unlinked old pages)
   Kept flat: the old slants and negative overlaps are gone.
   ============================================================ */

.subpage-hero {
    padding: clamp(3.5rem, 7vw, 5rem) var(--gutter);
    background: var(--crimson-deep);
    color: var(--paper);
    text-align: center;
}

.subpage-hero h1 {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    color: var(--paper);
}

.slant-container {
    position: relative;
    isolation: isolate;
    margin-top: 0 !important;
    padding: clamp(3.5rem, 7vw, 5.5rem) 0;
}

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

.slant-bg.white {
    background: var(--paper);
}

.slant-bg.blue {
    background: var(--crimson-deep);
}

.slant-bg.blue ~ .slant-content {
    color: var(--paper);
}

.slant-bg.blue ~ .slant-content :is(h1, h2, h3, h4, .card-title) {
    color: var(--paper);
}

.slant-bg.blue ~ .slant-content .card-text {
    color: rgba(250, 247, 240, 0.78);
}

.slant-content {
    position: relative;
    z-index: 1;
}

.section-header {
    margin-bottom: 3rem;
    text-align: center;
}

.section-header h2 {
    margin-bottom: 0.75rem;
    font-size: clamp(2rem, 4vw, 2.75rem);
}

.section-header p {
    max-width: 40rem;
    margin: 0 auto;
    color: var(--muted);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.card {
    position: relative;
    background: transparent;
}

.card-content {
    padding: 1.5rem 0;
}

.card-title {
    margin-bottom: 0.6rem;
    font-size: 1.5rem;
    color: inherit;
}

.card-text {
    margin-bottom: 1.25rem;
    color: var(--ink-soft);
}

.card-image {
    display: block;
    width: 100%;
    height: 240px;
    object-fit: cover;
}

.card-meta {
    font-size: 0.85rem;
    color: var(--muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

.stat-item {
    padding: 1.5rem;
    text-align: center;
}

.stat-number {
    margin-bottom: 0.4rem;
    font-family: var(--font-display);
    font-size: 3rem;
    line-height: 1;
    color: var(--crimson);
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.orb,
.hero-canvas {
    display: none;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(69, 17, 26, 0.94);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.loader {
    width: 56px;
    height: 56px;
    margin-bottom: 1.5rem;
    border: 3px solid rgba(250, 247, 240, 0.15);
    border-top-color: var(--gold-light);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--paper);
}

.loading-subtext {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--gray-400);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1240px) {
    .main-nav {
        gap: 1.4rem;
    }

    .nav-links {
        gap: 1.2rem;
    }
}

@media (max-width: 1120px) {
    .menu-toggle {
        display: inline-flex;
    }

    .main-nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 1001;
        width: min(340px, 86vw);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 5.5rem 1.75rem 2rem;
        overflow-y: auto;
        background: var(--paper);
        border-left: 1px solid var(--paper-edge);
        transform: translateX(100%);
        visibility: hidden;
        transition: transform 0.35s var(--ease), visibility 0s linear 0.35s;
    }

    .main-nav.active {
        transform: none;
        visibility: visible;
        transition: transform 0.35s var(--ease);
    }

    .nav-links {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin-bottom: 1.75rem;
    }

    .nav-links a {
        padding: 0.95rem 0;
        border-bottom: 1px solid var(--paper-edge);
        font-family: var(--font-display);
        font-size: 1.35rem;
        color: var(--ink);
        text-decoration: none;
    }

    .nav-links a.active {
        color: var(--crimson);
    }

    .nav-cta {
        padding: 1rem;
        text-align: center;
    }

    .nav-extra {
        display: block;
        margin-top: 1rem;
        padding: 0.95rem;
        border: 1px solid var(--crimson);
        border-radius: 2px;
        font-size: 0.75rem;
        font-weight: 600;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        text-align: center;
    }
}

@media (max-width: 960px) {
    .news-layout,
    .namesake__grid,
    .prose-grid,
    .chronicle,
    .page-head__grid,
    .profile {
        grid-template-columns: minmax(0, 1fr);
    }

    .page-head__photo {
        max-width: 40rem;
    }

    .page-head__photo img {
        aspect-ratio: 16 / 9;
    }

    /* The source page becomes a small thumbnail beside its caption */
    .document {
        position: static;
        display: flex;
        align-items: center;
        gap: 1.25rem;
        max-width: 32rem;
    }

    .document a {
        flex: 0 0 7rem;
        padding: 0.35rem;
    }

    .document figcaption {
        margin-top: 0;
    }

    .news-layout__head {
        position: static;
    }

    .pillars,
    .portals,
    .pillars--four {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contact-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contact-block--map {
        grid-column: 1 / -1;
    }

    .footer-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-motto {
        text-align: left;
    }
}

@media (max-width: 720px) {
    :root {
        --masthead-h: 72px;
    }

    body {
        font-size: 1rem;
    }

    .brand__crest {
        width: 46px;
        height: 46px;
    }

    .brand__text {
        padding-left: 0.75rem;
    }

    .brand__kicker {
        font-size: 0.55rem;
        letter-spacing: 0.14em;
    }

    .brand__name {
        font-size: 1.5rem;
    }

    .facts__row {
        grid-template-columns: minmax(0, 1fr);
    }

    .fact {
        padding: 1.1rem 0.25rem;
        border-left: 0;
        border-top: 1px solid var(--paper-edge);
    }

    .fact:first-child {
        border-top: 0;
    }

    .pillars,
    .portals,
    .pillars--four,
    .contact-grid,
    .footer-grid,
    .responsive-form-grid,
    .field-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .news-item--media {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Phones: heading first on paper, then the photo fading up into it */
    .hero {
        min-height: 0;
    }

    .hero__content {
        order: 1;
        padding-top: 2.5rem;
        padding-bottom: 0.5rem;
    }

    .hero__media {
        position: relative;
        order: 2;
        z-index: 0;
        height: 300px;
    }

    .hero__media img {
        object-position: 42% 60%;
    }

    .hero__media::after {
        background:
            linear-gradient(180deg, var(--paper) 0%, rgba(250, 247, 240, 0) 40%),
            linear-gradient(0deg, var(--paper) 0%, rgba(250, 247, 240, 0) 25%);
    }

    .hero__facts {
        order: 3;
        position: relative;
        margin-top: -2.5rem;
    }

    .hero__actions .btn {
        flex: 1 1 100%;
    }

    .details div {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.2rem;
    }

    .timeline__item {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.75rem;
    }

    .timeline__year span {
        display: inline;
        margin-left: 0.4rem;
    }

    .mosaic {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: 36vw;
        gap: 0.5rem;
    }

    .mosaic__caption {
        padding: 2rem 0.7rem 0.6rem;
        font-size: 0.95rem;
    }

    .photo-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .faculty,
    .faculty--lead {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2rem 1rem;
    }

    .faculty__name {
        font-size: 1.2rem;
    }

    .viewer__prev,
    .viewer__next {
        top: auto;
        bottom: 1rem;
        transform: none;
    }

    .viewer__img {
        max-height: calc(100vh - 11rem);
        max-height: calc(100dvh - 11rem);
    }

    .message {
        max-width: 92%;
    }

    .ai-chat-messages {
        height: 380px;
        padding: 1.25rem;
    }

    .auth__card {
        padding: 2rem 1.4rem 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
