/* Kents Hill School · Communications site
   Tokens mirror DESIGN.md. Use the variables, not raw values. */

:root {
  color-scheme: light;

  /* Color */
  --kh-red: #A6192E;
  --kh-red-dark: #7F1223;
  --kh-red-deep: #560B17;
  --kh-red-tint: #F8ECEE;
  --ink: #101820;
  --text: #373737;
  --muted: #5F6261;
  --paper: #F6F2ED;
  --line: #E2DCD5;
  --white: #FFFFFF;
  --gold: #C9A24A;
  --ph-bg: #FBF1DC;
  --ph-text: #6B4E16;
  --sky: #2C6FB4; /* hero background while the photo loads */

  /* Type */
  --font: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --fs-display: clamp(38px, 5vw, 68px);
  --fs-h1: clamp(32px, 3.6vw, 48px);
  --fs-h2: clamp(26px, 2.4vw, 34px);
  --fs-h3: 21px;
  --fs-lead: clamp(19px, 1.7vw, 23px);
  --fs-body: 17px;
  --fs-small: 15px;
  --fs-eyebrow: 13px;
  --measure: 68ch;

  /* Space */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;
  --wrap: 1200px;
  --gutter: 20px;
  --section: var(--s-8);

  /* Shape */
  --radius: 2px;
  --rule: 4px;
}
@media (min-width: 768px) {
  :root { --gutter: 32px; --section: var(--s-9); }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--white);
  color: var(--text);
  font: 400 var(--fs-body)/1.7 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { color: var(--ink); margin: 0; font-weight: 700; }
p { margin: 0 0 var(--s-4); }
a { color: var(--kh-red); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--kh-red-dark); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--kh-red); outline-offset: 3px; }
.on-red :focus-visible, .hero :focus-visible { outline-color: var(--white); }
[id] { scroll-margin-top: var(--s-5); }

.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--s-4); top: -100px; z-index: 50;
  background: var(--white); color: var(--kh-red); font-weight: 700;
  padding: var(--s-3) var(--s-4); border: 2px solid var(--kh-red);
}
.skip-link:focus { top: var(--s-4); }

/* Placeholder: content still to come. Remove the class once real text is in. */
.ph { background: var(--ph-bg); color: var(--ph-text); padding: 0 .25em; border-radius: var(--radius); box-decoration-break: clone; -webkit-box-decoration-break: clone; }

.eyebrow {
  display: block;
  font-size: var(--fs-eyebrow); line-height: 1.2; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--kh-red);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-3);
  min-height: 48px; padding: 0 var(--s-5);
  font: 700 14px/1 var(--font); letter-spacing: .06em; text-transform: uppercase;
  text-decoration: none; border-radius: var(--radius); border: 2px solid var(--kh-red);
  background: var(--kh-red); color: var(--white); cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--kh-red-dark); border-color: var(--kh-red-dark); color: var(--white); text-decoration: none; }
.btn--secondary { background: transparent; color: var(--kh-red); }
.btn--secondary:hover { background: var(--kh-red); border-color: var(--kh-red); color: var(--white); }
.btn--small { min-height: 40px; padding: 0 var(--s-4); font-size: 12px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }

/* ---------- Header ---------- */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s-5); min-height: 84px; }
.site-header__brand { display: inline-flex; flex-shrink: 0; }
.site-header__brand img { width: 150px; height: auto; }
.site-nav ul { display: flex; align-items: center; gap: var(--s-6); list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink); text-decoration: none;
}
.site-nav a:hover { color: var(--kh-red); }
.site-nav a[aria-current] { color: var(--kh-red); box-shadow: inset 0 -2px 0 var(--kh-red); }
.site-nav .site-nav__ext { color: var(--muted); }
.menu-toggle {
  display: none; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-3);
  font: 700 13px/1 var(--font); letter-spacing: .1em; text-transform: uppercase;
  color: var(--kh-red); background: none; border: 2px solid var(--kh-red); border-radius: var(--radius); cursor: pointer;
}
.menu-toggle__icon { width: 16px; height: 2px; background: currentColor; position: relative; }
.menu-toggle__icon::before, .menu-toggle__icon::after { content: ""; position: absolute; left: 0; width: 16px; height: 2px; background: currentColor; }
.menu-toggle__icon::before { top: -5px; } .menu-toggle__icon::after { top: 5px; }
.menu-toggle[aria-expanded="true"] .menu-toggle__icon { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle__icon::before { top: 0; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__icon::after { top: 0; transform: rotate(-45deg); }

@media (max-width: 759px) {
  .site-header__inner { min-height: 72px; }
  .site-header__brand img { width: 128px; }
  .js .menu-toggle { display: inline-flex; }
  .js .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--white); border-bottom: 1px solid var(--line); }
  .js .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: var(--s-2) var(--gutter) var(--s-4); }
  .site-nav li + li { border-top: 1px solid var(--line); }
  .site-nav a { width: 100%; min-height: 52px; }
  .site-nav a[aria-current] { box-shadow: none; }
  html:not(.js) .site-nav ul { flex-direction: row; flex-wrap: wrap; gap: var(--s-4); padding: 0; }
}

/* ---------- Home banner ----------
   The original drone photo of the Bearce Hall cupola with "Kents Hill School" and "Closure
   Information" built into the image, shown whole at its 16:9 shape. Very wide screens trim a
   little sky and trees; the 30% anchor keeps the words in view at every width. */
.hero { position: relative; background: var(--sky); overflow: hidden; }
.hero__banner { width: 100%; height: auto; max-height: min(78vh, 780px); object-fit: cover; object-position: 50% 30%; }

/* ---------- Home body: updates across the full page width ---------- */
.body { padding-block: var(--s-7); }

/* ---------- Resources + Contact: two boxes side by side, just above About ---------- */
.info { padding-block: var(--s-6) var(--section); }
.info__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6); align-items: stretch; }
.info__grid .resources-box, .info__grid .contact-box { height: 100%; }
/* Shallower boxes on the home page: tighter red header, links in a 2 × 2 grid on wide screens. */
.info__grid .resources-box__head, .info__grid .contact-box__head { padding: var(--s-4) var(--s-5); }
@media (min-width: 1000px) {
  .info__grid .resources-box { display: flex; flex-direction: column; }
  .info__grid .resources-box ul { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0; }
  .info__grid .resources-box li { display: flex; }
  .info__grid .resources-box li a { flex: 1; }
  .info__grid .resources-box li + li { border-top: 0; }
  .info__grid .resources-box li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .info__grid .resources-box li:nth-child(odd) { border-right: 1px solid var(--line); }
  .info__grid .resources-box li a { min-height: 60px; }
  /* An odd link out (3 links while Alumni & Friends is hidden) spans the full row. */
  .info__grid .resources-box li:last-child:nth-child(odd) { grid-column: 1 / -1; border-right: 0; }
}
@media (max-width: 759px) {
  /* Phones: Resources box, then Contact box underneath. */
  .info__grid { grid-template-columns: minmax(0, 1fr); gap: var(--s-5); }
}

.section-head { margin-bottom: var(--s-6); }
.section-head h2 { font-size: var(--fs-h2); line-height: 1.2; margin-top: var(--s-3); }

.updates { border-top: 3px solid var(--kh-red); }
.update { padding: var(--s-6) 0 var(--s-6); border-bottom: 1px solid var(--line); }
.update__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); margin-bottom: var(--s-3); }
.update__meta time { font-size: var(--fs-eyebrow); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--kh-red); }
.update__tag { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-left: var(--s-4); border-left: 1px solid var(--line); }
.update__new { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--white); background: var(--kh-red); padding: 3px 8px; border-radius: var(--radius); }
.update h3 { font-size: var(--fs-h3); line-height: 1.35; font-weight: 700; margin-bottom: var(--s-4); }
.update__body p:last-child { margin-bottom: 0; }
.update__body ul, .qa__answer ul { margin: 0 0 var(--s-4); padding-left: var(--s-5); }
.update__body li, .qa__answer li { margin-bottom: var(--s-3); }
.update__body blockquote { margin: 0 0 var(--s-4); padding-left: var(--s-5); border-left: 3px solid var(--kh-red); }
.update__body blockquote p { font-style: italic; }
.update__body li::marker, .qa__answer li::marker { color: var(--kh-red); }
.qa__answer ul:last-child { margin-bottom: 0; }
.update__sign { margin-top: var(--s-5); font-weight: 600; color: var(--ink); }
.update__sign-title { display: block; font-weight: 400; color: var(--muted); font-size: var(--fs-small); }
.update details { margin-top: var(--s-4); }
.update summary {
  display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; cursor: pointer; list-style: none;
  font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--kh-red);
}
.update summary::-webkit-details-marker { display: none; }
.update summary::after { content: "↓"; transition: transform .15s; }
.update details[open] summary::after { transform: rotate(180deg); }
.update details[open] summary .more-label::before { content: "Hide"; }
.update details[open] summary .more-text { display: none; }
.update details > div { padding-top: var(--s-3); }
.updates-note { margin: var(--s-4) 0 0; font-size: var(--fs-small); color: var(--muted); }

/* Resources box (home, left box above About + group pages sidebar) */
.resources-box { border: 1px solid var(--line); background: var(--white); }
.resources-box__head { background: var(--kh-red); color: var(--white); padding: var(--s-5) var(--s-5) var(--s-4); }
.resources-box__head h2 { color: var(--white); font-size: 22px; line-height: 1.25; }
.resources-box ul { list-style: none; margin: 0; padding: var(--s-2) 0; }
.resources-box li + li { border-top: 1px solid var(--line); }
.resources-box li a {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  min-height: 56px; padding: var(--s-3) var(--s-5);
  font-weight: 600; color: var(--ink); text-decoration: none;
}
.resources-box li a::after { content: "→"; color: var(--kh-red); font-weight: 700; transition: transform .15s; }
.resources-box li a:hover { background: var(--kh-red-tint); color: var(--kh-red-dark); }
.resources-box li a:hover::after { transform: translateX(3px); }
.resources-box li a[aria-current="page"] { background: var(--kh-red-tint); color: var(--kh-red); box-shadow: inset 4px 0 0 var(--kh-red); }
.resources-box li a[aria-current="page"]::after { content: "•"; }
.resources-box__foot { border-top: 1px solid var(--line); padding: var(--s-4) var(--s-5); font-size: 14px; }
.resources-box__foot a { font-weight: 700; }

/* Contact box (home, right-hand box next to Resources): same frame and red header as the Resources box */
.contact-box { border: 1px solid var(--line); background: var(--white); }
.contact-box__head { background: var(--kh-red); color: var(--white); padding: var(--s-5) var(--s-5) var(--s-4); }
.contact-box__head h2 { color: var(--white); font-size: 22px; line-height: 1.25; }
.contact-box__body { padding: var(--s-4) var(--s-5); font-size: 16px; line-height: 1.65; }
.contact-box__body p { margin: 0; }
.contact-box__body a, .contact-box__body .ph { white-space: nowrap; }
.contact-box__body a { font-weight: 600; }

/* ---------- Memories (switched off until the school is ready) ---------- */
.memories { background: var(--paper); padding-block: var(--section); border-top: 1px solid var(--line); }
.memories[hidden] { display: none; }
.memories__grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: var(--s-8); align-items: center; }
.memories__img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; }
.memories h2 { font-size: var(--fs-h2); line-height: 1.2; margin: var(--s-3) 0 var(--s-4); }
.memories p { max-width: 46ch; }
.memories .btn { margin-top: var(--s-3); }
.preview-flag { display: inline-block; margin-bottom: var(--s-4); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ph-text); background: var(--ph-bg); padding: 4px 10px; }
@media (max-width: 859px) { .memories__grid { grid-template-columns: 1fr; gap: var(--s-6); } }

/* ---------- About band ---------- */
.about { background: var(--kh-red); color: var(--white); padding-block: var(--section); }
/* Stacked like the updates above: title, then the boilerplate and mission box across the full width. */
.about__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
/* Title matches the Resources / Contact Us box titles. */
.about h2 { color: var(--white); font-size: 22px; line-height: 1.25; }
.about__text p { font-size: 18px; line-height: 1.7; font-weight: 400; }
.about__text p:last-child { margin-bottom: 0; }
.about .ph { background: rgba(255, 255, 255, .14); color: var(--white); }
.about a { color: var(--white); }

/* Mission statement: the same small box it was under the banner, now under the boilerplate. */
.mission__box { margin-top: var(--s-6); background: var(--kh-red-dark); border: 1px solid rgba(255, 255, 255, .22); padding: var(--s-4) var(--s-5); font-size: var(--fs-small); line-height: 1.7; color: rgba(255, 255, 255, .9); }
.mission__box p { margin: 0; }
.mission__box .mission__label { font-size: var(--fs-small); line-height: 1.7; font-weight: 400; color: var(--white); margin-bottom: var(--s-1); }
.mission__box strong { font-weight: 700; color: var(--white); }

/* ---------- Footer ---------- */
.site-footer { background: var(--kh-red-deep); color: rgba(255, 255, 255, .85); padding-block: var(--s-5); font-size: 14px; }
.site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s-3) var(--s-6); }
.site-footer p { margin: 0; }
.site-footer a { color: var(--white); font-weight: 600; display: inline-flex; align-items: center; min-height: 44px; }
.site-footer__draft { color: rgba(255, 255, 255, .7); font-size: 13px; }

/* ---------- Group pages ---------- */
.page-head { display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); background: var(--kh-red); color: var(--white); min-height: 380px; }
.page-head__copy { display: flex; flex-direction: column; justify-content: center; padding: var(--s-8) var(--s-8) var(--s-8) max(var(--gutter), calc((100vw - var(--wrap)) / 2)); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: var(--s-2); list-style: none; margin: 0 0 var(--s-5); padding: 0; font-size: 13px; font-weight: 600; letter-spacing: .04em; }
.breadcrumb li + li::before { content: "/"; margin-right: var(--s-2); color: rgba(255, 255, 255, .6); }
.breadcrumb a { color: var(--white); }
.breadcrumb [aria-current] { color: rgba(255, 255, 255, .85); }
.page-head h1 { color: var(--white); font-size: var(--fs-h1); line-height: 1.12; letter-spacing: -.01em; }
.page-head__rule { width: 48px; height: 3px; background: var(--gold); margin: var(--s-5) 0; }
.page-head__intro { margin: 0; font-size: var(--fs-lead); line-height: 1.55; font-weight: 500; max-width: 38ch; }
.page-head .ph { background: rgba(255, 255, 255, .14); color: var(--white); }
.page-head__media { position: relative; min-height: 260px; background: var(--kh-red-deep); }
.page-head__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 859px) {
  .page-head { grid-template-columns: 1fr; min-height: 0; }
  .page-head__media { order: -1; min-height: 0; aspect-ratio: 16 / 9; }
  .page-head__copy { padding: var(--s-7) var(--gutter); }
}

.qa-layout { padding-block: var(--section); }
.qa-layout__grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s-8); align-items: start; }
.qa-layout__aside { position: sticky; top: var(--s-5); display: grid; gap: var(--s-5); }
@media (max-width: 959px) {
  .qa-layout__grid { grid-template-columns: minmax(0, 1fr); gap: var(--s-7); }
  .qa-layout__aside { position: static; }
}
/* Share bar: each group page's own address, ready to paste into letters and emails. */
.share {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4);
  margin-bottom: var(--s-6); padding: var(--s-4) var(--s-5);
  background: var(--paper); border-left: 3px solid var(--kh-red);
}
.share .eyebrow { flex-basis: 100%; }
.share__url { font-weight: 600; display: inline-block; padding-block: var(--s-1); }
.share__url span { white-space: nowrap; }
.share__buttons { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-left: auto; }
.share__buttons .btn { min-height: 44px; }
@media (max-width: 559px) { .share__buttons { margin-left: 0; } }
.page-updated { font-size: var(--fs-small); color: var(--muted); margin-bottom: var(--s-5); }
.page-intro { max-width: var(--measure); margin-bottom: var(--s-7); }
.qa-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: var(--s-4); padding-bottom: var(--s-4); border-bottom: 3px solid var(--kh-red); }
.qa-head h2 { font-size: var(--fs-h2); line-height: 1.2; }

.qa-search { padding-top: var(--s-5); }
.qa-search__label { display: block; font-size: var(--fs-small); font-weight: 600; color: var(--ink); margin-bottom: var(--s-2); }
.qa-search__input { width: 100%; min-height: 52px; padding: 0 var(--s-4); font: inherit; font-size: 17px; color: var(--ink); background: var(--white); border: 1px solid var(--muted); border-radius: 0; -webkit-appearance: none; appearance: none; }
.qa-search__input::placeholder { color: var(--muted); }
.qa-search__input:focus { outline: 3px solid var(--kh-red); outline-offset: 0; border-color: var(--kh-red); }
.qa-search__status { margin: var(--s-2) 0 0; min-height: 1.6em; font-size: var(--fs-small); color: var(--muted); }
.qa-search__empty { margin: var(--s-4) 0 0; padding: var(--s-4) var(--s-5); background: var(--paper); }
.qa mark { background: var(--kh-red-tint); color: inherit; box-shadow: inset 0 -2px 0 var(--kh-red); }
.qa-group {font-size: var(--fs-eyebrow); line-height: 1.2; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--kh-red); padding: var(--s-6) 0 var(--s-3); border-bottom: 1px solid var(--line); }
/* Two-level FAQs (Alumni & Friends): a section title above the small red group headings, same size as update titles. */
.qa-section { font-size: var(--fs-h3); line-height: 1.35; font-weight: 600; color: var(--ink); padding: var(--s-7) 0 var(--s-3); border-bottom: 1px solid var(--line); }
.qa-section + .qa-block > .qa-group:first-child { padding-top: var(--s-5); }
.qa-group + .qa-note { margin: var(--s-4) 0 var(--s-2); }
.qa { border-bottom: 1px solid var(--line); }
.qa summary {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-5);
  padding: var(--s-5) 0; cursor: pointer; list-style: none;
  font-size: 18px; line-height: 1.45; font-weight: 600; color: var(--ink);
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary:hover { color: var(--kh-red); }
.qa__icon { position: relative; flex: 0 0 28px; height: 28px; border: 2px solid var(--kh-red); border-radius: 50%; margin-top: -1px; }
.qa__icon::before, .qa__icon::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 2px; background: var(--kh-red); transform: translate(-50%, -50%); transition: transform .15s; }
.qa__icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.qa[open] summary { color: var(--kh-red); }
.qa[open] .qa__icon { background: var(--kh-red); }
.qa[open] .qa__icon::before, .qa[open] .qa__icon::after { background: var(--white); }
.qa[open] .qa__icon::after { transform: translate(-50%, -50%) rotate(0deg); }
.qa__answer { padding: 0 calc(28px + var(--s-5)) var(--s-5) 0; max-width: calc(var(--measure) + 60px); }
.qa__answer p:last-child { margin-bottom: 0; }
.qa-note { margin: var(--s-5) 0 0; font-style: italic; max-width: calc(var(--measure) + 60px); }

.help-box { border: 1px solid var(--line); border-top: var(--rule) solid var(--kh-red); padding: var(--s-5); }
.help-box h2 { font-size: 20px; line-height: 1.3; margin: var(--s-2) 0 var(--s-3); }
.help-box p { font-size: var(--fs-small); margin-bottom: var(--s-4); }

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

@media print {
  .site-header nav, .menu-toggle, .info__resources, .qa-layout__aside, .site-footer, [data-expand-all], .qa-search { display: none !important; }
}
