/* =========================================================
   CSEAS — Centre for Southeast Asian Studies, Nālandā University
   Stylesheet for home.html

   Contents
   1. Theme tokens (edit colours / fonts / spacing here)
   2. Base
   3. Shared components (buttons, section heads, cards)
   4. Header & navigation
   5. Sections: Home, Announcement, About, Academic, Research,
      Publications, Events, Gallery, Contact Us
   6. Footer
   7. Utilities (reveal animation, back-to-top)
   8. Responsive breakpoints
   ========================================================= */

/* ---------- 1. Theme tokens ---------- */
:root {
  /* Brand colours — sampled from the CSEAS logos */
  --navy: #00273d;
  --navy-700: #0b3a57;
  --navy-100: #e6edf2;
  --red: #a62428;
  --red-700: #861b1f;
  --red-100: #f7e7e7;

  /* Neutrals */
  --white: #ffffff;
  --tint: #f6f8fa;          /* light band behind alternate sections */
  --line: #e2e7ec;
  --ink: #1f2a33;           /* body text */
  --muted: #5a6670;

  /* Type */
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-caps: "Cinzel", Georgia, serif;
  --font-body: "Open Sans", "Segoe UI", Arial, sans-serif;

  /* Layout */
  --container: 1360px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-y: clamp(48px, 6.5vw, 80px);
  --radius: 10px;
  --header-h: 112px;        /* height of the sticky header */
  --logo-h: 88px;           /* main logo height in the header */
  --shadow: 0 10px 30px rgba(0, 39, 61, 0.08);
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-700); }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; color: var(--navy); }
p { margin: 0 0 1rem; }

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

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute; left: -9999px; top: 8px;
  background: var(--red); color: var(--white); padding: 8px 14px; z-index: 200;
}
.skip-link:focus { left: 8px; color: var(--white); }

/* ---------- 3. Shared components ---------- */
.eyebrow {
  font-family: var(--font-caps);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 0 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: "";
  width: 28px; height: 2px;
  background: currentColor;
}

.section { padding: var(--section-y) 0; }
.section-tint { background: var(--tint); }

.section-head { max-width: 760px; margin-bottom: clamp(24px, 3.5vw, 40px); }
.section-head.split {
  max-width: none;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  line-height: 1.15;
  margin-bottom: 1rem;
}
.section-title em { font-style: italic; color: var(--red); }
.section-intro { color: var(--muted); font-size: 1.05rem; margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 26px;
  border-radius: 999px;
  font-weight: 600; font-size: 0.95rem;
  border: 2px solid transparent;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: var(--red-700); color: var(--white); }
.btn-outline { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-caps { text-transform: uppercase; letter-spacing: .12em; font-size: .82rem; padding: 14px 28px; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card h3 {
  font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 700; line-height: 1.2;
  margin-bottom: .6rem;
}
.card p { color: var(--muted); margin: 0; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.card-grid.three { grid-template-columns: repeat(3, 1fr); }

.card-link { display: flex; flex-direction: column; border-top: 3px solid var(--red); }
.card-link:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-num {
  font-family: var(--font-caps); font-weight: 700;
  color: var(--red); font-size: .9rem; letter-spacing: .1em;
  margin-bottom: 14px;
}
.card-link .more { margin-top: auto; padding-top: 18px; font-weight: 600; font-size: .9rem; }

.icon {
  width: 40px; height: 40px;
  fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- 4. Header & navigation ---------- */
.topbar { background: var(--red); color: var(--white); font-size: .82rem; }
.topbar-inner { display: flex; justify-content: space-between; gap: 12px; padding-top: 6px; padding-bottom: 6px; }
.topbar a { color: var(--white); }
.topbar a:hover { text-decoration: underline; }
.topbar-mail { display: inline-flex; align-items: center; gap: 6px; }
.topbar-mail .bi { font-size: .95rem; line-height: 1; }

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--navy);        /* matches logo background so it blends */
  border-bottom: 3px solid var(--red);
  transition: box-shadow .25s;
}
.site-header.scrolled { box-shadow: 0 6px 20px rgba(0, 0, 0, .18); }

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  min-height: var(--header-h);
}

.brand { display: block; flex-shrink: 1; min-width: 0; }
.brand img {
  height: var(--logo-h); width: auto; max-width: 100%;
  object-fit: contain;
  clip-path: inset(3px);          /* hides the thin border baked into the logo file */
}

.main-nav ul { display: flex; gap: 2px; }
.main-nav a {
  position: relative;
  display: block;
  padding: 10px 12px;
  color: var(--white);
  font-weight: 600; font-size: .92rem;
  letter-spacing: .02em;
  white-space: nowrap;
}
.main-nav a::after {
  content: "";
  position: absolute; left: 12px; right: 12px; bottom: 4px;
  height: 2px; background: var(--red);
  transform: scaleX(0); transform-origin: left;
  transition: transform .25s;
}
.main-nav a:hover, .main-nav a.active { color: var(--white); }
.main-nav a:hover::after, .main-nav a.active::after { transform: scaleX(1); }

/* Dropdown (e.g. Publications → Newsletter): opens on hover or keyboard focus */
.has-sub { position: relative; }
.has-sub > a .bi { font-size: .7rem; margin-left: 2px; vertical-align: 1px; }
.main-nav .sub-menu {
  display: block;
  position: absolute; top: 100%; left: 0; min-width: 190px;
  padding: 6px 0;
  background: var(--red);
  border-radius: 0 0 6px 6px; box-shadow: 0 10px 24px rgba(0, 0, 0, .25);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.has-sub:hover > .sub-menu, .has-sub:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.main-nav .sub-menu a {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 10px 18px; font-weight: 500; white-space: nowrap;
  transition: background .2s;
}
.main-nav .sub-menu a::after {
  content: "→"; position: static; height: auto; background: none;
  transform: translateX(-4px); opacity: 0;
  transition: opacity .2s, transform .2s;
}
.main-nav .sub-menu a:hover { background: var(--red-700); }
.main-nav .sub-menu a:hover::after { opacity: 1; transform: none; }

.menu-toggle {
  display: none;
  align-items: center; gap: 10px;
  height: 44px; padding: 0;
  background: transparent; border: 0; cursor: pointer;
  color: var(--white); font: 600 .9rem var(--font-body);
  letter-spacing: .12em; text-transform: uppercase;
}
.menu-toggle .bars { display: block; width: 24px; }
.menu-toggle .bars span {
  display: block; height: 2px; background: var(--white);
  margin: 5px 0; transition: transform .25s, opacity .25s;
}
.menu-toggle[aria-expanded="true"] .bars span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .bars span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .bars span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 5. Sections ---------- */

/* Home / hero */
.hero { padding: clamp(36px, 5vw, 64px) 0 0; }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 3.4vw, 3.1rem);   /* sized to keep the headline on one line on desktop */
  line-height: 1.1;
  margin-bottom: 1.4rem;
}
.hero h1 em { color: var(--red); }
.hero .eyebrow { font-size: 1.05rem; }
.hero-sub { font-size: 1.12rem; color: var(--muted); margin-bottom: 2rem; }
.hero-body { color: var(--ink); text-align: justify; hyphens: auto; margin-bottom: 0; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }


/* Key jumbotron (announcement) */
.announcement-section { padding-top: clamp(24px, 3vw, 36px); padding-bottom: clamp(40px, 5vw, 56px); }   /* gap before the tinted Intro band */
.announcement {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 48px);
  align-items: stretch;
  background: var(--navy-100);
  border-left: 5px solid var(--red);
  border-radius: var(--radius);
  padding: clamp(20px, 3.5vw, 40px);
}
.announcement-photo { margin: 0; position: relative; }
/* Caption sits on the photo in a dark navy band at 80% opacity */
.announcement-photo figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 12px 16px;
  background: rgba(0, 39, 61, .8);     /* --navy at 80% */
  border-left: 4px solid var(--red);
  border-radius: 0 0 6px 6px;
  color: var(--white); font-size: .9rem; font-weight: 600; line-height: 1.4;
}
.announcement-photo img {
  border-radius: 6px; width: 100%; height: 100%; min-height: 280px; object-fit: cover;
  object-position: center top;     /* keeps the face in frame when cropped */
}
.announcement h2 {
  font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.3rem);
  line-height: 1.2; margin-bottom: 1.1rem;
}
.announcement-body p:not(.tag) { color: var(--ink); text-align: justify; hyphens: auto; }
.announcement-body p:last-child { margin: 0; }
.announcement-date { color: var(--red); }
.tag {
  display: inline-block;
  font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--red); margin-bottom: .6rem;
}

/* Intro */
#intro .section-head, #about .section-head { max-width: none; }
.intro-body p { text-align: justify; hyphens: auto; }
.intro-body .lead {
  padding-left: 22px; border-left: 4px solid var(--red);
  font-size: clamp(1.25rem, 2vw, 1.5rem); margin: 0 0 clamp(20px, 3vw, 32px);
}
.intro-columns p { margin: 0 0 1rem; color: var(--ink); }
/* Collapsed: only the first paragraph shows until "See more" is clicked */
.intro-columns.collapsed p:nth-child(n + 2) { display: none; }
.intro-toggle { display: none; }
.js .intro-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 16px; border: 1px solid var(--red); border-radius: 999px;
  background: transparent; color: var(--red); cursor: pointer;
  font: inherit; font-size: .85rem; font-weight: 600;
  transition: background .2s, color .2s;
}
.intro-toggle:hover { background: var(--red); color: var(--white); }
.intro-toggle span { display: inline-block; transition: transform .2s; }
.intro-toggle[aria-expanded="true"] span { transform: rotate(180deg); }

/* About */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(28px, 5vw, 56px); }
.about-text p { text-align: justify; hyphens: auto; }
.lead {
  font-family: var(--font-display);
  font-size: 1.5rem; line-height: 1.4; color: var(--navy); font-weight: 600;
}
.about-cards { display: grid; gap: 20px; align-content: start; }
.about-cards .card { border-left: 4px solid var(--red); }

/* Messages (Vice Chancellor / Director) */
.message-grid {
  margin-top: 32px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.message-card {
  display: flex; gap: 24px;
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--line); border-top: 3px solid var(--red);
  border-radius: var(--radius);
  transition: box-shadow .25s;
}
.message-card:hover { box-shadow: var(--shadow); }
.message-photo {
  flex: 0 0 140px; width: 140px; height: 170px;
  border-radius: 6px; object-fit: cover; object-position: center top;
}
.message-photo-empty {
  display: grid; place-items: center;
  background: var(--navy-100); color: var(--navy);
}
.message-photo-empty svg { width: 56px; height: 56px; fill: none; stroke: currentColor; stroke-width: 1.4; opacity: .5; }
.message-card-body { display: flex; flex-direction: column; min-width: 0; }
.message-excerpt {
  color: var(--muted); margin: 0 0 14px;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.message-sign { margin: 0; display: grid; font-size: .9rem; color: var(--muted); }
.message-sign strong { font-family: var(--font-display); font-size: 1.2rem; color: var(--navy); }
.message-more {
  align-self: flex-start; margin-top: auto; padding: 16px 0 0;
  border: 0; background: none; cursor: pointer;
  font: inherit; font-weight: 600; font-size: .9rem; color: var(--red);
}
.message-more span { display: inline-block; transition: transform .2s; }
.message-more:hover span { transform: translateX(4px); }

.message-dialog {
  width: min(92vw, 820px); max-height: 90vh;
  padding: clamp(24px, 4vw, 48px);
  border: 0; border-top: 5px solid var(--red); border-radius: var(--radius);
  color: var(--ink);
}
.message-dialog::backdrop { background: rgba(0, 20, 32, .75); }
body:has(.message-dialog[open]) { overflow: hidden; }
.message-dialog-head {
  display: flex; align-items: center; gap: 24px;
  padding-bottom: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--line);
}
.message-dialog-head .message-photo { flex-basis: 120px; width: 120px; height: 146px; }
.message-dialog h2 { font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.2; }
.message-text p { margin: 0 0 1.1rem; text-align: justify; hyphens: auto; }
.message-text p:first-child { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; color: var(--navy); }
.message-dialog > .message-sign { padding-top: 8px; }
.message-close {
  position: sticky; top: 0; float: right; margin: -8px -8px 0 12px; z-index: 1;
  width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: var(--red); color: var(--white);
  font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.message-close:hover { background: var(--red-700); }

/* Faculty */
.faculty-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.faculty-card {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px;
  background: var(--white);
  border: 1px solid var(--line); border-left: 4px solid var(--red);
  border-radius: var(--radius);
}
.faculty-photo {
  flex: 0 0 80px; width: 80px; height: 96px;
  border-radius: 6px; object-fit: cover; object-position: center top;
}
.faculty-body { min-width: 0; }
.faculty-role {
  margin: 0 0 2px;
  font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--red);
}
.faculty-card h3 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; line-height: 1.2; }

/* Research (navy band) */
.section-navy { background: var(--navy); color: var(--white); }
.section-navy .section-title { color: var(--white); }
.section-navy .section-title em { color: #e2777a; }
.section-navy .section-intro { color: rgba(255, 255, 255, .75); }
.section-navy .eyebrow { color: #e2777a; }
.card-dark {
  background: var(--navy-700);
  border-color: rgba(255, 255, 255, .12);
}
.card-dark .icon { color: #e2777a; margin-bottom: 18px; }
.card-dark h3 { color: var(--white); }
.card-dark p { color: rgba(255, 255, 255, .78); }
.card-dark:hover { transform: translateY(-4px); border-color: var(--red); }

/* Publications */
.pub-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 28px; align-items: start; }
.pub-feature { margin: 0; }
.pub-feature img { border-radius: var(--radius); width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.pub-list li + li { border-top: 1px solid var(--line); }
.pub-list a { display: block; padding: 16px 4px; color: var(--ink); transition: padding .2s; }
.pub-list a:hover { padding-left: 14px; }
.pub-type { display: block; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--red); }
.pub-title { display: block; font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; color: var(--navy); line-height: 1.25; margin: 4px 0; }
.pub-meta { font-size: .88rem; color: var(--muted); }
/* "Coming soon" placeholders: same spacing as a real entry, not clickable */
.pub-soon { padding: 16px 4px; }
.pub-soon .pub-title, .newsletter-card .soon { font-style: italic; color: var(--muted); font-weight: 500; }

/* Newsletter (inside Publications) */
.newsletter { margin-top: clamp(32px, 5vw, 48px); padding-top: clamp(24px, 4vw, 36px); border-top: 1px solid var(--line); }
.sub-title { font-family: var(--font-display); font-size: clamp(1.5rem, 2.5vw, 1.9rem); font-weight: 700; margin-bottom: 18px; }
.newsletter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 340px)); gap: 16px; }
.newsletter-card {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 18px 20px;
  background: var(--white);
  border: 1px solid var(--line); border-left: 4px solid var(--red);
  border-radius: var(--radius);
  transition: box-shadow .25s;
}
.newsletter-card:hover { box-shadow: var(--shadow); }
.newsletter-card .bi { font-size: 1.8rem; line-height: 1; color: var(--red); }
.newsletter-card h4 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; line-height: 1.2; }
.newsletter-card p { margin: 2px 0 8px; font-size: .88rem; color: var(--muted); }
.newsletter-card .more { font-weight: 600; font-size: .9rem; }

/* Events */
.event-list { display: grid; gap: 16px; }
.event {
  display: flex; align-items: center; gap: 24px;
  background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 24px;
  color: var(--ink);
  transition: box-shadow .25s, transform .25s;
}
.event:hover { box-shadow: var(--shadow); transform: translateY(-2px); color: var(--ink); }
.event-date {
  flex: 0 0 76px; height: 76px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--navy); color: var(--white); border-radius: 8px;
  line-height: 1;
}
.event-date .d { font-family: var(--font-display); font-size: 2rem; font-weight: 700; }
.event-date .m { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; margin-top: 4px; color: #f2b8ba; }
.event-body { flex: 1; min-width: 0; }
.event-type { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--red); }
.event-body h3 { font-family: var(--font-display); font-size: 1.45rem; font-weight: 700; line-height: 1.2; }
.event-meta { margin: 2px 0 0; font-size: .9rem; color: var(--muted); }
/* "Coming soon" event placeholders: calendar icon instead of a date, not clickable */
.event-soon:hover { box-shadow: none; transform: none; }
.event-soon .event-date .bi { font-size: 1.6rem; line-height: 1; }
.event-soon h3 { font-style: italic; font-weight: 500; color: var(--muted); }
.chev { font-size: 1.4rem; color: var(--red); transition: transform .2s; }
.event:hover .chev { transform: translateX(4px); }

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 220px;
  gap: 16px;
}
.gallery-item {
  padding: 0; border: 0; cursor: zoom-in;
  border-radius: var(--radius); overflow: hidden; background: var(--navy-100);
}
.gallery-item:first-child { grid-column: span 2; grid-row: span 2; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gallery-item:hover img { transform: scale(1.05); }

.lightbox {
  border: 0; padding: 0; background: transparent;
  max-width: min(92vw, 1100px); max-height: 92vh;
}
.lightbox::backdrop { background: rgba(0, 20, 32, .88); }
.lightbox img { max-height: 82vh; width: auto; margin: 0 auto; border-radius: 6px; }
.lightbox-caption { color: var(--white); text-align: center; margin: 12px 0 0; }
.lightbox-close {
  position: fixed; top: 16px; right: 20px;
  width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: var(--red); color: var(--white);
  font-size: 1.6rem; line-height: 1; cursor: pointer;
}

/* Contacts */
.contact-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(28px, 5vw, 56px); }
.contact-info { display: grid; gap: 26px; align-content: start; }
.contact-item { display: flex; gap: 18px; }
.contact-item .icon {
  flex: 0 0 52px; width: 52px; height: 52px; padding: 12px;
  background: var(--red-100); color: var(--red); border-radius: 50%;
}
.contact-item h3 { font-size: 1rem; font-family: var(--font-body); margin-bottom: 2px; }
.contact-item p { margin: 0; color: var(--muted); }

/* Contact details as a row of cards (used while the form is hidden) */
.contact-cards { grid-template-columns: repeat(3, 1fr); gap: 20px; }
.contact-cards .contact-item {
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--line); border-top: 3px solid var(--red);
  border-radius: var(--radius);
}
.contact-cards .contact-item p { overflow-wrap: anywhere; }

.contact-form {
  background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(22px, 4vw, 36px);
  display: grid; gap: 18px;
  box-shadow: var(--shadow);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.contact-form label { display: grid; gap: 6px; font-size: .88rem; font-weight: 600; color: var(--navy); }
.contact-form input, .contact-form textarea {
  font: inherit; font-weight: 400; color: var(--ink);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 12px 14px; background: var(--white);
  transition: border-color .2s, box-shadow .2s;
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-100);
}
.contact-form textarea { resize: vertical; }
.contact-form .btn { justify-self: start; }

/* ---------- 6. Footer ---------- */
.site-footer { background: var(--navy-100); border-top: 4px solid var(--red); }
.footer-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1.2fr; gap: 24px;
  padding-top: 32px; padding-bottom: 28px;
}
.footer-brand img { width: 140px; height: auto; }
.footer-col h4 {
  font-family: var(--font-caps); font-size: .9rem; letter-spacing: .12em;
  text-transform: uppercase; margin-bottom: 10px;
}
.footer-col li { margin-bottom: 4px; }
.footer-col a { color: var(--ink); }
.footer-col a:hover { color: var(--red); }
.footer-col p { color: var(--muted); margin: 0 0 8px; }

.footer-bottom { background: var(--navy); color: rgba(255, 255, 255, .8); font-size: .85rem; }
.footer-bottom-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }

/* ---------- 7. Utilities ---------- */
.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.visible { opacity: 1; transform: none; }

.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--red); color: var(--white); font-size: 1.2rem;
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { color: var(--white); background: var(--red-700); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- 8. Responsive ---------- */

/* Tablet landscape: collapse nav into hamburger */
@media (max-width: 1240px) {
  :root { --logo-h: 80px; --header-h: 100px; }
  .menu-toggle { display: inline-flex; }

  .main-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--navy);
    border-top: 1px solid rgba(255, 255, 255, .12);
    max-height: 0; overflow: hidden;
    transition: max-height .35s ease;
  }
  .main-nav.open { max-height: 80vh; overflow-y: auto; }
  .main-nav ul { flex-direction: column; gap: 0; padding: 8px var(--gutter) 16px; }
  .main-nav a { padding: 14px 4px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
  .main-nav a::after { left: 4px; right: auto; width: 32px; bottom: 8px; }
  /* Sub-menu items show indented under their parent in the mobile menu */
  .main-nav .sub-menu {
    position: static; min-width: 0; padding: 0 0 0 16px;
    background: none; border: 0; box-shadow: none;
    opacity: 1; visibility: visible; transform: none;
  }
  .main-nav .sub-menu a { padding: 12px 4px; font-size: .88rem; color: rgba(255, 255, 255, .8); }
  .main-nav .sub-menu a:hover { background: none; color: var(--white); }
  .main-nav .sub-menu a::after { display: none; }
  .has-sub > a .bi { display: none; }

  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .message-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* Tablet portrait */
@media (max-width: 860px) {
  .about-grid, .pub-grid, .contact-grid { grid-template-columns: 1fr; }
  .contact-cards { grid-template-columns: 1fr; }

  .announcement { grid-template-columns: 1fr; gap: 20px; }
  .announcement-photo { max-width: 420px; }   /* keeps the overlay caption the same width as the photo */
  .announcement-photo img { height: auto; min-height: 0; aspect-ratio: 1 / 1; max-width: 420px; }
  :root { --logo-h: 64px; --header-h: 84px; }
  .card-grid.three { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 180px; }
}

/* Mobile */
@media (max-width: 560px) {
  .topbar-inner span { display: none; }
  .topbar-inner { justify-content: center; }
  :root { --logo-h: 54px; --header-h: 74px; }

  .card-grid { grid-template-columns: 1fr; }
  .message-card { flex-direction: column; gap: 16px; padding: 20px; }
  .message-card .message-photo { width: 140px; height: 166px; flex-basis: auto; }
  .message-dialog-head { flex-direction: column; align-items: flex-start; }
  .field-row { grid-template-columns: 1fr; }
  .contact-form .btn { justify-self: stretch; }

  .event { gap: 16px; padding: 16px; }
  .event-date { flex-basis: 62px; height: 62px; }
  .event-date .d { font-size: 1.6rem; }
  .chev { display: none; }

  .gallery-grid { grid-auto-rows: 140px; gap: 10px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom-inner { flex-direction: column; text-align: center; }
}

/* ---------- Print (Ctrl+P / PDF) ---------- */
/* Shows everything: animations off, Intro expanded, full VC/Director messages inline */
@media print {
  @page { size: A4; margin: 12mm; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .site-header { position: static; box-shadow: none; }
  .menu-toggle, .to-top, .skip-link, .intro-toggle, .message-more, .message-close, .lightbox { display: none !important; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .intro-columns.collapsed p { display: block; }
  .message-dialog {
    display: block; position: static; width: auto; max-height: none;
    margin: 24px 0 0; padding: 24px; border: 1px solid var(--line); border-top: 5px solid var(--red);
  }
  .message-excerpt { -webkit-line-clamp: unset; }
  .card, .faculty-card, .message-card, .newsletter-card, .contact-item, .event, .pub-list li, .gallery-item, .announcement { break-inside: avoid; }
  h2, h3, .section-head { break-after: avoid; }
  a { text-decoration: none; }
}