/* Instruct-Online design system — used by redesigned pages.
   Legacy pages and CGI output get iol-legacy.css instead (injected by Apache). */

:root {
  --ink: #16324a;        /* headings, header, primary text */
  --text: #24384a;       /* body copy */
  --muted: #4d6275;      /* secondary copy */
  --sky: #78afd8;        /* heritage masthead blue */
  --sky-wash: #e8f1f8;   /* tinted panels */
  --brand: #3b82f6;      /* accent blue (was the globe logo; kept for buttons and header rule) */
  --go: #3b82f6;         /* primary action: the globe blue from the logo */
  --go-dark: #2563eb;    /* hover: a shade darker */
  /* White on #3b82f6 is 3.68:1, which passes WCAG AA only for large text,
     so button labels are kept at 19px bold or larger. */
  --canvas: #f4f6f8;     /* page background */
  --paper: #ffffff;      /* surfaces */
  --line: #d5dee6;

  --font: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --measure: 68ch;
  --radius-s: 6px;
  --radius-l: 14px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font: 1.0625rem/1.6 var(--font);
}

img { max-width: 100%; height: auto; }

a { color: #1d5a8c; text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }

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

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--paper); padding: .6rem 1rem; z-index: 10;
}
.skip:focus { left: 1rem; top: 1rem; }

.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }

/* ---------- Header ---------- */
.site-header {
  background: var(--paper);
  border-bottom: 4px solid var(--brand);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: .6rem;
  flex-wrap: wrap;
}
.brand { display: block; line-height: 0; }
.brand img { height: 92px; width: auto; }
.site-header nav { margin-left: auto; }
.site-nav ul {
  display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.1rem;
  list-style: none; margin: 0; padding: 0;
}
.site-nav a {
  display: block;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: .98rem;
  padding: .3rem 0; border-bottom: 2px solid transparent;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { border-bottom-color: var(--brand); }
/* Catalog menu: a <details> disclosure, works without JavaScript */
.menu { position: relative; }
.menu summary {
  list-style: none; cursor: pointer;
  color: var(--ink); font-weight: 700; font-size: .98rem; line-height: inherit;
  padding: .3rem 0; border-bottom: 2px solid transparent;
  display: flex; align-items: center; gap: .4rem;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after {
  content: ""; width: .45rem; height: .45rem; margin-top: -.2rem;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}
.menu[open] summary::after { transform: rotate(-135deg); margin-top: .2rem; }
.menu summary:hover, .menu[open] summary { border-bottom-color: var(--brand); }
.site-nav .submenu {
  position: absolute; top: calc(100% + .6rem); left: -1rem; z-index: 20;
  display: block; min-width: 15rem; padding: .4rem 0;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-s);
  box-shadow: 0 12px 28px -16px rgba(22, 50, 74, .45);
}
.site-nav .submenu a {
  display: grid; padding: .55rem 1rem; border-bottom: 0;
}
.site-nav .submenu a span { font-weight: 400; color: var(--muted); font-size: .9rem; }
.site-nav .submenu a:hover { background: var(--sky-wash); }

.header-phone {
  margin: 0; padding: .3rem 0; border-bottom: 2px solid transparent;  /* same box as the nav links, so the row lines up */
  color: var(--muted); font-size: .98rem; white-space: nowrap;
}
.header-phone a { color: var(--ink); font-weight: 700; text-decoration: none; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.hero .wrap {
  display: grid; gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center;
}
.hero h1 {
  color: var(--ink);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1.08; letter-spacing: -0.02em;
  margin: 0 0 1.1rem;
  max-width: 16ch;
}
.hero .lede { font-size: 1.2rem; color: var(--muted); max-width: 46ch; margin: 0 0 1.5rem; }
.hero .org-line { margin: 0; max-width: 52ch; }

/* ---------- The admission ticket (the one bold element) ---------- */
.ticket {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px rgba(22, 50, 74, .45);
}
.ticket-top { padding: 1.75rem 1.75rem 1.5rem; }
.ticket-top h2 { color: var(--ink); font-size: 1.6rem; line-height: 1.2; margin: 0 0 .5rem; }
.ticket-top p { margin: 0 0 1.4rem; color: var(--muted); }

.ticket-tear {
  position: relative; height: 0;
  border-top: 2px dashed var(--line);
  margin-inline: 1.1rem;
}
.ticket-tear::before, .ticket-tear::after {
  content: ""; position: absolute; top: -13px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--canvas); border: 1px solid var(--line);
}
.ticket-tear::before { left: calc(-1.1rem - 13px); clip-path: inset(0 0 0 50%); }
.ticket-tear::after { right: calc(-1.1rem - 13px); clip-path: inset(0 50% 0 0); }

.ticket-stub {
  padding: 1.1rem 1.75rem 1.4rem;
  background: var(--sky-wash);
  border-radius: 0 0 var(--radius-l) var(--radius-l);
  font-size: .98rem;
}
.ticket-stub p { margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem; min-height: 3rem;
  padding: .75rem 1.5rem;
  font: 700 1.1875rem/1.2 var(--font);  /* 19px bold = WCAG large text */
  border-radius: var(--radius-s);
  text-decoration: none; cursor: pointer;
  border: 2px solid transparent;
}
.btn-go { background: var(--go); color: #fff; width: 100%; }
.btn-go:hover { background: var(--go-dark); color: #fff; }
.btn-quiet { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn-quiet:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- Sections ---------- */
.band { padding-block: clamp(2.5rem, 5vw, 3.75rem); }
.band-paper { background: var(--paper); border-block: 1px solid var(--line); }

.band h2 { color: var(--ink); font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.2; margin: 0 0 .75rem; letter-spacing: -0.01em; }
.band .intro { max-width: var(--measure); color: var(--muted); margin: 0 0 2rem; }

.split { display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }

.link-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.link-list li { border-bottom: 1px solid var(--line); }
.link-list a {
  display: grid; gap: .15rem;
  padding: 1rem .25rem; text-decoration: none; color: var(--ink);
}
.link-list a strong { font-size: 1.1rem; }
.link-list a span { color: var(--muted); font-size: .98rem; }
.link-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); column-gap: 2rem; border-top: 0; }
.link-cols li { border-top: 1px solid var(--line); }
.link-list a:hover strong { text-decoration: underline; text-underline-offset: .18em; }

.contact-card {
  background: var(--sky-wash);
  border-left: 4px solid var(--sky);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  padding: 1.5rem 1.6rem;
}
.contact-card h3 { margin: 0 0 .5rem; color: var(--ink); font-size: 1.25rem; }
.contact-card p { margin: 0 0 .9rem; max-width: 52ch; }
.contact-card h3 a { color: inherit; text-decoration: none; }
.contact-card h3 a:hover { text-decoration: underline; text-underline-offset: .18em; }
.contact-card .contact-phone { margin: 1rem 0 0; color: var(--muted); }
.contact-card .contact-phone a { color: var(--ink); font-weight: 700; }

/* ---------- Contact page ---------- */
.page-head { padding-block: clamp(2rem, 5vw, 3rem) 0; }
.page-head h1 { color: var(--ink); font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 .6rem; }
.page-head p { color: var(--muted); max-width: 56ch; margin: 0; font-size: 1.1rem; }
.contact-layout {
  display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: start;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  padding-block: 2rem clamp(2.5rem, 5vw, 4rem);
}
.form-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-l); padding: clamp(1.25rem, 3vw, 2rem); }
.field { display: grid; gap: .35rem; margin-bottom: 1.15rem; }
.field label { font-weight: 700; color: var(--ink); }
.field .hint { font-weight: 400; color: var(--muted); }
.field input, .field textarea {
  font: inherit; color: var(--text); background: #fff;
  border: 1px solid #8fa3b5; border-radius: var(--radius-s);
  padding: .65rem .75rem; width: 100%;
}
.field textarea { min-height: 9rem; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 3px solid var(--sky); outline-offset: 1px; border-color: var(--ink); }
.field-row { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-card .btn-go { width: auto; }
.notice { border-radius: var(--radius-s); padding: 1rem 1.1rem; margin-bottom: 1.25rem; }
.notice-error { background: #fdecea; border: 1px solid #e5a29b; color: #7a1d14; }
.notice-ok { background: #eaf2fe; border: 1px solid #a9c8fb; color: #1e3a8a; }
.notice p { margin: 0; }
.notice p + p { margin-top: .4rem; }
.office h2 { color: var(--ink); font-size: 1.25rem; margin: 0 0 .5rem; }
.office section + section { margin-top: 1.6rem; }
.office p { margin: 0; }
.office p + p { margin-top: .7rem; }
.office address { font-style: normal; }
@media (max-width: 860px) { .contact-layout { grid-template-columns: 1fr; } }

/* ---------- Sign-in page ---------- */
.notice-warn { background: #fff7e6; border: 1px solid #f0c674; color: #5c3d00; }
.notice-warn a { color: #5c3d00; font-weight: 700; }
.button-guide { display: grid; grid-template-columns: auto 1fr; gap: .45rem .9rem; margin: .6rem 0 0; }
.button-guide dt { font-weight: 700; color: var(--ink); }
.button-guide dd { margin: 0; }

/* ---------- About page ---------- */
.prose h2 { color: var(--ink); font-size: 1.35rem; line-height: 1.25; margin: 0 0 .6rem; }
.prose h2:not(:first-child) { margin-top: 1.8rem; }
.prose p { margin: 0 0 .9rem; max-width: var(--measure); }
.expertise { margin: 0 0 .5rem; padding: 0; list-style: none; display: grid; gap: .45rem; }
.expertise li { padding-left: 1.4rem; position: relative; }
.expertise li::before {
  content: ""; position: absolute; left: .2rem; top: .5em;
  width: .55rem; height: .55rem; border-radius: 50%;
  border: 2px solid var(--brand);
}
.about-next { margin-top: 1.6rem; }
.office .contact-card p { margin: 0 0 .9rem; }        /* .office p would otherwise zero the card's spacing */
.office .contact-card .contact-phone { margin: 1rem 0 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #cfdbe6; padding-block: 2rem; font-size: .95rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; list-style: none; margin: 0; padding: 0; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer p { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero h1 { max-width: none; }
  .ticket { order: -1; }   /* test-takers on phones see sign-in first */
}
@media (max-width: 560px) {
  .site-nav .submenu { position: static; box-shadow: none; margin-top: .4rem; }
  .site-header .wrap { flex-direction: column; align-items: flex-start; }
  .site-header nav { margin-left: 0; }
  .brand img { height: 68px; }
  .ticket-top, .ticket-stub { padding-inline: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
