/* ---------------------------------------------------------------
   The Altshuller Institute for TRIZ Studies — board prototype
   Palette and type are taken from the live aitriz.org template:
   charcoal header (#312f38), royal blue (#2f4291), khaki accent
   (#e8e0b2), Raleway headings, Lato body.
   --------------------------------------------------------------- */
:root {
  --charcoal: #312f38;
  --charcoal-deep: #25232b;
  --blue: #2f4291;
  --blue-deep: #23306a;
  --blue-tint: #e9edf8;
  --khaki: #e8e0b2;
  --khaki-light: #f4efdc;
  --cream: #faf8f2;
  --white: #ffffff;
  --ink: #2b2a31;
  --muted: #605e69;
  --line: #e2ddcf;
  --gold: #c9a84c;
  --radius: 6px;
  --shadow: 0 10px 30px rgba(35, 48, 106, 0.08);
  --shadow-lg: 0 18px 50px rgba(35, 48, 106, 0.16);
  --font-head: "Raleway", "Segoe UI", Helvetica, Arial, sans-serif;
  --font-body: "Lato", "Segoe UI", Helvetica, Arial, sans-serif;
  --header-sticky: 6rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  font-size: 1.0625rem;
}
img { max-width: 100%; display: block; }
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--blue-deep);
  line-height: 1.18;
  margin: 0 0 0.6rem;
  letter-spacing: -0.005em;
}
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.6rem, 2.6vw, 2.15rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }
p { margin: 0 0 1rem; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--blue-deep); }
ul, ol { padding-left: 1.3rem; }
li { margin-bottom: 0.35rem; }
blockquote {
  margin: 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--khaki);
  background: var(--white);
  font-style: italic;
  color: var(--ink);
}
blockquote cite { display: block; font-style: normal; font-size: 0.9rem; color: var(--muted); margin-top: 0.5rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
table { border-collapse: collapse; width: 100%; background: var(--white); font-size: 0.97rem; }
th, td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--blue-deep); color: var(--white); font-family: var(--font-head); font-weight: 600; font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

.wrap { width: min(1180px, calc(100% - 2.5rem)); margin: 0 auto; }
.wrap-narrow { width: min(820px, calc(100% - 2.5rem)); margin: 0 auto; }

.kicker {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 0.6rem;
}
.lede { font-size: 1.2rem; color: var(--muted); max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.ext::after { content: " \2197"; font-size: 0.8em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons ------------------------------------------------------ */
.btn {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius);
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--blue); color: var(--white); border-color: var(--blue); }
.btn-primary:hover { background: var(--blue-deep); color: var(--white); }
.btn-accent { background: var(--khaki); color: var(--charcoal); border-color: var(--khaki); }
.btn-accent:hover { background: #f0e9c2; color: var(--charcoal); }
.btn-ghost { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn-ghost:hover { background: var(--blue-tint); }
.btn-light { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.7); }
.btn-light:hover { background: rgba(255,255,255,0.12); color: var(--white); }
button.btn {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}
button.btn:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}
.actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.6rem; }

/* Utility bar + header ----------------------------------------- */
.utility {
  background: var(--khaki);
  color: var(--charcoal);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}
.utility .wrap { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 2rem; }
.utility a { color: var(--charcoal); text-decoration: none; }
.utility a:hover { text-decoration: underline; }
.utility .proto {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--charcoal);
  color: var(--khaki);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}

.site-header {
  background: var(--charcoal);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
/* The lockup never shrinks or wraps; the nav is sized (below) to fit beside
   it at every width down to the mobile breakpoint, and if it ever cannot,
   it wraps to its own row instead of overflowing the viewport. */
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 2rem; min-height: 6rem; padding: 0.6rem 0; }
.brand { display: flex; align-items: center; gap: 1.1rem; text-decoration: none; color: var(--white); flex-shrink: 0; white-space: nowrap; }
/* The lamp mark is a 96px source, so 72px keeps it crisp while reading as the focal point. */
.brand img {
  width: 72px; height: 72px; flex-shrink: 0;
  background: var(--white); border-radius: 50%; padding: 5px;
  box-shadow: 0 0 0 3px rgba(232,224,178,0.28), 0 6px 18px rgba(0,0,0,0.35);
}
.brand-text { font-family: var(--font-head); font-weight: 800; font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase; line-height: 1.25; }
.brand-text small { display: block; font-weight: 600; color: var(--khaki); letter-spacing: 0.14em; font-size: 0.68rem; }
.brand .brand-text { font-size: 1.15rem; line-height: 1.2; }
.brand .brand-text small { font-size: 0.8rem; letter-spacing: 0.18em; margin-top: 0.2rem; }

.nav-toggle { display: none; }
.nav-toggle-label {
  display: none;
  cursor: pointer;
  width: 2.4rem; height: 2.4rem;
  position: relative;
}
.nav-toggle-label span, .nav-toggle-label span::before, .nav-toggle-label span::after {
  content: ""; position: absolute; left: 0.4rem; width: 1.6rem; height: 2px; background: var(--white); transition: transform 0.2s ease;
}
.nav-toggle-label span { top: 50%; }
.nav-toggle-label span::before { top: -7px; left: 0; }
.nav-toggle-label span::after { top: 7px; left: 0; }

.nav { display: flex; gap: 0.25rem; align-items: center; margin-left: auto; }
.nav a,
.nav button.nav-cta {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius);
  position: relative;
}
.nav button.nav-cta { border: 0; cursor: pointer; color: var(--white); }
.nav a:hover { color: var(--white); background: rgba(255,255,255,0.08); }
.nav a[aria-current="page"] { color: var(--khaki); }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0.8rem; right: 0.8rem; bottom: 0.3rem; height: 2px; background: var(--khaki);
}
.nav .nav-cta { margin-left: 0.5rem; background: var(--blue); color: var(--white); }
.nav .nav-cta:hover { background: var(--blue-deep); }
.nav a.nav-cta[aria-current="page"] { color: var(--white); background: var(--blue); }
.nav a.nav-cta[aria-current="page"]::after { content: none; }
.nav a.nav-cta[aria-current="page"]:hover { color: var(--white); background: var(--blue-deep); }
.nav [hidden] { display: none !important; }
.nav a.cart-link {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: 0.35rem;
  padding: 0;
  text-transform: none;
  letter-spacing: 0;
  color: var(--white);
  flex: 0 0 auto;
}
html[data-cart-count]:not([data-cart-count="0"]) .nav a.cart-link {
  display: inline-flex;
}
.nav a.cart-link[aria-current="page"]::after { content: none; }
.cart-icon { display: block; }
.cart-count {
  display: none;
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 0.2rem;
  border-radius: 999px;
  background: var(--khaki);
  color: var(--charcoal);
  font-family: var(--font-head);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.05rem;
  text-align: center;
}
html[data-cart-count]:not([data-cart-count="0"]) .cart-count { display: inline-block; }
html[data-cart-count]:not([data-cart-count="0"]) .cart-count::before { content: var(--cart-count); }

/* Heroes ------------------------------------------------------- */
.hero {
  position: relative;
  color: var(--white);
  background: var(--charcoal) center / cover no-repeat;
  min-height: min(78vh, 680px);
  display: flex;
  align-items: center;
  isolation: isolate;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, rgba(37,35,43,0.92) 0%, rgba(35,48,106,0.82) 45%, rgba(35,48,106,0.35) 100%);
}
.hero .wrap { padding: 5rem 0 4.5rem; }
.hero .kicker { color: var(--khaki); }
.hero h1 { color: var(--white); font-size: clamp(2.3rem, 5vw, 3.9rem); max-width: 17ch; font-weight: 800; margin-bottom: 1rem; }
.hero h1 em { font-style: normal; color: var(--khaki); }
.hero .lede { color: rgba(255,255,255,0.88); font-size: clamp(1.05rem, 1.5vw, 1.3rem); max-width: 52ch; }
.hero-meta { display: flex; gap: 2rem; flex-wrap: wrap; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.25); font-size: 0.9rem; color: rgba(255,255,255,0.8); }
.hero-meta strong { display: block; font-family: var(--font-head); font-size: 1.35rem; color: var(--white); }

.page-hero {
  position: relative;
  color: var(--white);
  background: var(--charcoal) center / cover no-repeat;
  isolation: isolate;
}
.page-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(95deg, rgba(37,35,43,0.94) 0%, rgba(35,48,106,0.86) 55%, rgba(35,48,106,0.55) 100%);
}
.page-hero .wrap { padding: 3.8rem 0 3.2rem; }
.page-hero .kicker { color: var(--khaki); }
.page-hero h1 { color: var(--white); margin-bottom: 0.6rem; }
.page-hero .lede { color: rgba(255,255,255,0.88); }
.crumbs { font-size: 0.85rem; color: rgba(255,255,255,0.7); margin: 0 0 1.2rem; }
.crumbs a { color: rgba(255,255,255,0.85); text-decoration: none; }
.crumbs a:hover { color: var(--white); text-decoration: underline; }

/* In-page section nav ------------------------------------------ */
.subnav { background: var(--white); border-bottom: 1px solid var(--line); }
.subnav .wrap { display: flex; gap: 0.2rem; overflow-x: auto; scrollbar-width: thin; }
.subnav a {
  font-family: var(--font-head); font-weight: 600; font-size: 0.82rem; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; padding: 0.95rem 0.9rem; white-space: nowrap; border-bottom: 3px solid transparent;
}
.subnav a:hover { color: var(--blue); border-bottom-color: var(--khaki); }

/* Sections ----------------------------------------------------- */
.section { padding: 4.2rem 0; }
.section-tight { padding: 2.8rem 0; }
.section-alt { background: var(--khaki-light); }
.section-white { background: var(--white); }
.section-dark { background: var(--charcoal); color: rgba(255,255,255,0.9); }
.section-dark h2, .section-dark h3 { color: var(--white); }
.section-dark .kicker { color: var(--khaki); }
.section-dark a { color: var(--khaki); }
.section-dark .btn-accent, .section-blue .btn-accent { color: var(--charcoal); }
.section-blue { background: linear-gradient(135deg, var(--blue-deep), var(--blue)); color: var(--white); }
.section-blue h2, .section-blue h3 { color: var(--white); }
.section-blue .kicker { color: var(--khaki); }
.section-blue a { color: var(--white); }
.section-head { max-width: 62ch; margin-bottom: 2.2rem; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head p { color: var(--muted); font-size: 1.1rem; }
.section-dark .section-head p, .section-blue .section-head p { color: rgba(255,255,255,0.8); }

/* Grids and cards ---------------------------------------------- */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-top: 4px solid var(--khaki);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.card-body { padding: 1.3rem 1.4rem 1.5rem; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { margin-bottom: 0.4rem; }
.card-body p { color: var(--muted); margin: 0 0 0.9rem; font-size: 0.98rem; }
.card-body .more { margin-top: auto; font-family: var(--font-head); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--blue); }
.card-body .more::after { content: " \2192"; }
.card-plain { border-top-color: var(--blue); }

/* Image tiles with overlaid text (echoes the live "cube" banners) */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.tile {
  position: relative; min-height: 260px; border-radius: var(--radius); overflow: hidden;
  background: var(--charcoal) center / cover no-repeat; color: var(--white); text-decoration: none;
  display: flex; align-items: flex-end; box-shadow: var(--shadow);
  isolation: isolate;
}
.tile::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(37,35,43,0.05) 25%, rgba(37,35,43,0.9) 100%); transition: background 0.2s ease; }
.tile:hover::before { background: linear-gradient(180deg, rgba(35,48,106,0.35) 0%, rgba(35,48,106,0.95) 100%); }
.tile-body { padding: 1.5rem; }
.tile-body .kicker { color: var(--khaki); margin-bottom: 0.3rem; }
.tile-body h3 { color: var(--white); margin: 0 0 0.3rem; font-size: 1.3rem; }
.tile-body p { margin: 0; color: rgba(255,255,255,0.85); font-size: 0.95rem; }

/* Split (text + image) ----------------------------------------- */
.split { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 3rem; align-items: center; }
.split.reverse > :first-child { order: 2; }
.split img { border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; object-fit: cover; }
.split figure { margin: 0; }
.split figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.6rem; }
.portrait { max-width: 320px; margin: 0 auto; }
.portrait img { aspect-ratio: 3 / 4; object-fit: cover; }

/* Feature: event ----------------------------------------------- */
.event-feature {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg);
}
.event-feature .event-media { background: var(--white); display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 2.5rem; border-right: 1px solid var(--line); gap: 1.2rem; text-align: center; }
.event-feature .event-media img { max-width: min(420px, 100%); }
.grid > *, .split > *, .two-col > *, .event-feature > *, .letter > *, .cta-band .wrap > * { min-width: 0; }
.event-feature .event-body { padding: 2.5rem 2.5rem 2.2rem; }
.event-body h2 { margin-top: 0; }
.facts { list-style: none; padding: 0; margin: 1.2rem 0 1.5rem; display: grid; gap: 0.6rem; }
.facts li { display: grid; grid-template-columns: 110px 1fr; gap: 0.8rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--line); }
.facts li span:first-child { font-family: var(--font-head); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding-top: 0.15rem; }

/* Letter from the Executive Director --------------------------- */
.letter { display: grid; grid-template-columns: 300px 1fr; gap: 3rem; align-items: start; }
.letter img { border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.letter .signature { font-family: var(--font-head); font-weight: 700; color: var(--blue-deep); margin-top: 1.5rem; }
.letter .signature small { display: block; font-family: var(--font-body); font-weight: 400; color: var(--muted); }
.pull { font-family: var(--font-head); font-size: 1.35rem; font-weight: 600; line-height: 1.4; color: var(--blue-deep); border-left: 4px solid var(--khaki); padding-left: 1.2rem; margin: 0 0 1.4rem; }

/* Chips -------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 0.55rem; padding: 0; margin: 0; list-style: none; }
.chips li { background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 0.35rem 0.9rem; font-size: 0.92rem; margin: 0; }
.section-dark .chips li { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15); color: var(--white); }

/* Checklist ---------------------------------------------------- */
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.7rem; }
.checks li { padding-left: 1.9rem; position: relative; margin: 0; }
.checks li::before { content: ""; position: absolute; left: 0; top: 0.35em; width: 1.05rem; height: 1.05rem; border-radius: 50%; background: var(--khaki); }
.checks li::after { content: ""; position: absolute; left: 0.36rem; top: 0.5em; width: 0.3rem; height: 0.55rem; border: solid var(--charcoal); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.checks-2 { grid-template-columns: repeat(2, 1fr); }

/* Stats -------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.stat { background: var(--white); border-radius: var(--radius); padding: 1.4rem 1.5rem; box-shadow: var(--shadow); border-left: 4px solid var(--blue); }
.stat strong { display: block; font-family: var(--font-head); font-size: 2rem; color: var(--blue-deep); line-height: 1.1; }
.stat span { color: var(--muted); font-size: 0.95rem; }

/* Pricing plans ------------------------------------------------ */
.plans { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.2rem; align-items: stretch; }
.plan { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.6rem 1.4rem; display: flex; flex-direction: column; border-top: 4px solid var(--line); }
.plan.featured { border-top-color: var(--blue); box-shadow: var(--shadow-lg); }
.plan h3 { font-size: 1.1rem; margin-bottom: 0.2rem; }
.plan .price { font-family: var(--font-head); font-weight: 800; font-size: 1.9rem; color: var(--blue-deep); margin: 0.4rem 0 0.1rem; }
.plan .price small { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.plan .price.is-pending { font-size: 1.05rem; font-weight: 700; line-height: 1.35; color: var(--muted); }
.stat strong.is-pending { font-size: 1.35rem; line-height: 1.25; }
.plan .term { color: var(--muted); font-size: 0.85rem; margin-bottom: 1rem; }
.plan .plan-options { margin-bottom: 1rem; }
.plan .plan-options .term { margin-bottom: 0; }
.plan .plan-or { color: var(--muted); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin: 0.5rem 0 0; }
.plan ul { padding-left: 1.1rem; font-size: 0.93rem; margin: 0 0 1.2rem; flex: 1; }
.plan .btn { align-self: flex-start; }
.plan-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: auto;
}
.plan-actions .checkout-status,
.checkout-status {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.checkout-status.is-error {
  color: #6e2e18;
  font-weight: 700;
  background: var(--khaki-light);
  border: 1px solid var(--khaki);
  border-radius: var(--radius);
  padding: 0.65rem 0.8rem;
}

/* Numbered principles grid ------------------------------------- */
.principles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.7rem; list-style: none; padding: 0; margin: 0; counter-reset: p; }
.principles li { counter-increment: p; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.7rem 0.9rem 0.7rem 3rem; position: relative; font-size: 0.95rem; margin: 0; }
.principles li::before { content: counter(p); position: absolute; left: 0.85rem; top: 0.65rem; font-family: var(--font-head); font-weight: 800; color: var(--gold); font-size: 0.95rem; width: 1.6rem; }

/* Archive / timeline list -------------------------------------- */
.archive { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.8rem; }
.archive li { display: grid; grid-template-columns: 90px 1fr auto; gap: 1.2rem; align-items: center; background: var(--white); border-radius: var(--radius); padding: 1rem 1.3rem; box-shadow: var(--shadow); margin: 0; }
.archive .year { font-family: var(--font-head); font-weight: 800; font-size: 1.35rem; color: var(--blue-deep); }
.archive .where { color: var(--muted); font-size: 0.95rem; }
.archive .where strong { color: var(--ink); display: block; font-family: var(--font-head); }
.archive a.small { white-space: nowrap; }

/* Event / training listing ------------------------------------- */
.listing { display: grid; gap: 1rem; }
.listing-item { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.3rem 1.5rem; display: grid; grid-template-columns: 130px 1fr auto; gap: 1.5rem; align-items: start; }
.listing-item .when { font-family: var(--font-head); font-weight: 700; color: var(--blue-deep); line-height: 1.3; }
.listing-item .when small { display: block; font-family: var(--font-body); font-weight: 400; color: var(--muted); font-size: 0.85rem; margin-top: 0.2rem; }
.listing-item h3 { font-size: 1.1rem; margin-bottom: 0.25rem; }
.listing-item p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.listing-item .tag { font-family: var(--font-head); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--blue); background: var(--blue-tint); padding: 0.25rem 0.6rem; border-radius: 999px; white-space: nowrap; }

/* Article list ------------------------------------------------- */
.articles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.article { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem 1.5rem 1.4rem; display: flex; flex-direction: column; border-top: 4px solid var(--blue); }
.article .series { font-family: var(--font-head); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); margin-bottom: 0.5rem; }
.article h3 { font-size: 1.15rem; }
.article .byline { color: var(--muted); font-size: 0.88rem; margin: 0 0 0.8rem; }
.article p { font-size: 0.97rem; color: var(--ink); }
.article .more { margin-top: auto; font-family: var(--font-head); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.05em; text-transform: uppercase; }

/* People ------------------------------------------------------- */
.people { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.person { background: var(--white); border-radius: var(--radius); padding: 1.3rem 1.3rem 1.2rem; box-shadow: var(--shadow); border-top: 4px solid var(--khaki); }
.person .role { font-family: var(--font-head); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue); }
.person strong { display: block; font-family: var(--font-head); font-size: 1.1rem; color: var(--blue-deep); margin: 0.3rem 0 0.2rem; }
.person span { color: var(--muted); font-size: 0.9rem; }

/* Dark-section variants ---------------------------------------- */
.section-dark .contact-list li { border-color: rgba(255,255,255,0.15); }
.section-dark .contact-list li span:first-child { color: rgba(255,255,255,0.6); }
.section-dark .placeholder { background: rgba(255,255,255,0.06); border-color: rgba(232,224,178,0.6); color: rgba(255,255,255,0.8); }
.section-dark .placeholder strong { color: var(--khaki); }
.section-dark .checks li::before { background: var(--khaki); }
.section-dark .aside-box { color: var(--ink); }
.section-dark .aside-box a { color: var(--blue); }

/* Callouts / placeholders -------------------------------------- */
.callout { background: var(--white); border-left: 4px solid var(--blue); border-radius: var(--radius); padding: 1.3rem 1.5rem; box-shadow: var(--shadow); }
.callout h3 { margin-top: 0; }
.placeholder {
  border: 2px dashed var(--gold);
  background: rgba(201,168,76,0.08);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  font-size: 0.92rem;
  color: var(--muted);
}
.placeholder strong { color: var(--charcoal); font-family: var(--font-head); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; display: block; margin-bottom: 0.2rem; }

/* CTA band ----------------------------------------------------- */
.cta-band { background: var(--khaki); color: var(--charcoal); }
.cta-band .wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2.5rem; align-items: center; padding: 3.5rem 0; }
.cta-band h2 { color: var(--charcoal); }
.cta-band .kicker { color: var(--blue-deep); }
.cta-band .checks li::before { background: var(--charcoal); }
.cta-band .checks li::after { border-color: var(--khaki); }

/* Sponsors row ------------------------------------------------- */
.sponsors { display: flex; flex-wrap: wrap; gap: 1.2rem 2rem; align-items: center; justify-content: center; }
.sponsors img { height: 44px; width: auto; background: var(--white); padding: 4px 8px; border-radius: 4px; }

/* Footer ------------------------------------------------------- */
.site-footer { background: var(--charcoal); color: rgba(255,255,255,0.82); font-size: 0.95rem; }
.site-footer a { color: var(--khaki); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: var(--white); }
.footer-main { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 2.5rem; padding: 3.5rem 0 2.5rem; }
.footer-main h4 { color: var(--white); font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 0.9rem; }
.footer-main ul { list-style: none; padding: 0; margin: 0; }
.footer-main li { margin-bottom: 0.45rem; }
.footer-brand { display: flex; gap: 0.9rem; align-items: center; margin-bottom: 1rem; }
.footer-brand img { width: 52px; height: 52px; background: var(--white); border-radius: 50%; padding: 4px; }
.footer-brand .brand-text { color: var(--white); }
.footer-main p { color: rgba(255,255,255,0.72); font-size: 0.93rem; }
.footer-sponsors { border-top: 1px solid rgba(255,255,255,0.12); padding: 1.8rem 0; }
.footer-sponsors .kicker { text-align: center; color: rgba(255,255,255,0.55); margin-bottom: 1.1rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); padding: 1.2rem 0; font-size: 0.85rem; color: rgba(255,255,255,0.6); }
.footer-bottom .wrap,
.wrap.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-bottom .footer-credit {
  display: block;
  width: 100%;
  flex: 1 0 100%;
  margin: 0.2rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.12);
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.5;
  letter-spacing: 0.012em;
}
.site-footer .footer-credit a {
  color: var(--khaki);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-thickness: 1px;
}
.site-footer .footer-credit a:hover { color: var(--white); }
.site-footer .footer-credit a:focus-visible {
  outline: 2px solid var(--khaki);
  outline-offset: 3px;
}

/* Recognition (About) ------------------------------------------ */
.recognition-section { scroll-margin-top: var(--header-sticky); }
.recognition {
  width: min(42rem, 100%);
  margin: 0 auto;
}
.recognition h2 { margin-bottom: 0.45rem; }
.recognition-name {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.28rem;
  line-height: 1.35;
  color: var(--charcoal);
  margin: 0 0 1.5rem;
}
.recognition-intro {
  margin: 0 0 2.15rem;
  padding: 0.1rem 0 0.1rem 1.15rem;
  border-left: 2px solid var(--blue);
  font-size: 1.15rem;
  line-height: 1.7;
  text-wrap: pretty;
}
.recognition-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.recognition-list li {
  position: relative;
  margin: 0;
  padding-left: 1.05em;
  line-height: 1.65;
  text-wrap: pretty;
}
.recognition-list li + li { margin-top: 0.95rem; }
.recognition-list li::before {
  content: "";
  position: absolute;
  left: 0;
  width: 0.36em;
  height: 0.36em;
  background: var(--blue);
  /* Center the square on the first line's x-height. The 0.16em
     offset is Lato's baseline sitting below the line-box center. */
  top: calc(0.5lh - 0.5ex + 0.16em);
}

/* Content pages ------------------------------------------------ */
.prose h2 { margin-top: 2.4rem; }
.prose h3 { margin-top: 1.8rem; }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose ul, .prose ol { margin: 0 0 1rem; padding-left: 1.3rem; }
.prose li { margin: 0.25rem 0; }
.prose li > ul, .prose li > ol { margin-top: 0.25rem; }
.prose blockquote { margin: 1rem 0 1.2rem; padding-left: 1rem; border-left: 3px solid var(--khaki); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.article-doc h1 { margin-bottom: 0.35rem; }
.article-doc .article-kicker { margin: 0 0 1.4rem; color: var(--muted); }
.prose img.article-media { height: auto; margin: 1.25rem auto; }
.prose p img.article-media, .prose li img.article-media, .prose h2 img.article-media, .prose h3 img.article-media {
  display: inline-block;
  vertical-align: middle;
  width: auto;
  max-width: min(100%, 280px);
  margin: 0.15rem 0.35rem;
}
.prose img.article-media[hidden] { display: none !important; }
.prose img.float-right { float: right; margin: 0.3rem 0 1rem 1.6rem; width: 220px; border-radius: var(--radius); box-shadow: var(--shadow); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.aside-box { background: var(--white); border-radius: var(--radius); padding: 1.5rem 1.6rem; box-shadow: var(--shadow); border-top: 4px solid var(--khaki); }
.aside-box h3 { margin-top: 0; font-size: 1.1rem; }
.aside-box ul { padding-left: 1.1rem; margin: 0; font-size: 0.95rem; }
.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li { display: grid; grid-template-columns: 90px 1fr; gap: 0.8rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line); margin: 0; }
.contact-list li span:first-child { font-family: var(--font-head); font-weight: 700; font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding-top: 0.2rem; }

/* Responsive --------------------------------------------------- */
@media (max-width: 1024px) {
  .finder-topic .finder-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4, .stats, .people, .principles { grid-template-columns: repeat(2, 1fr); }
  .grid-4.store-grid { grid-template-columns: repeat(3, 1fr); }
  .plans { grid-template-columns: repeat(3, 1fr); }
  .articles, .grid-3, .tiles { grid-template-columns: repeat(2, 1fr); }
  .footer-main { grid-template-columns: 1fr 1fr; }
  .letter { grid-template-columns: 240px 1fr; gap: 2rem; }
}
/* Nav is still a single row here, so step the lockup and the link spacing
   down together to keep eight links beside the brand on one line. */
@media (max-width: 1280px) {
  .site-header .wrap { gap: 0.5rem 1.5rem; }
  .nav a,
  .nav button.nav-cta { padding: 0.55rem 0.7rem; }
  .nav a[aria-current="page"]::after { left: 0.7rem; right: 0.7rem; }
}
@media (max-width: 1100px) {
  :root { --header-sticky: 5.5rem; }
  .site-header .wrap { min-height: 5.5rem; gap: 0.5rem 1.25rem; }
  .brand { gap: 0.9rem; }
  .brand img { width: 62px; height: 62px; padding: 4px; }
  .brand .brand-text { font-size: 1rem; }
  .brand .brand-text small { font-size: 0.72rem; }
  .nav a,
  .nav button.nav-cta { padding: 0.55rem 0.55rem; letter-spacing: 0.05em; }
  .nav a[aria-current="page"]::after { left: 0.55rem; right: 0.55rem; }
  .nav .nav-cta { margin-left: 0.3rem; }
}
@media (max-width: 1000px) {
  :root { --header-sticky: 5.25rem; }
  .site-header .wrap { min-height: 5.25rem; gap: 0.5rem 1rem; }
  .brand { gap: 0.75rem; }
  .brand img { width: 56px; height: 56px; }
  .brand .brand-text { font-size: 0.92rem; }
  .brand .brand-text small { font-size: 0.68rem; }
  .nav { gap: 0.1rem; }
  .nav a,
  .nav button.nav-cta { font-size: 0.78rem; letter-spacing: 0.04em; padding: 0.5rem 0.42rem; }
  .nav a[aria-current="page"]::after { left: 0.42rem; right: 0.42rem; }
  .nav .nav-cta { margin-left: 0.2rem; }
}
/* Header collapses to the menu button here; page layout changes at 860px below.
   The header keeps the sticky positioning it has on desktop, so the menu
   button stays reachable after scrolling; the open menu hangs from it and
   scrolls inside itself when it is taller than the viewport. */
@media (max-width: 900px) {
  /* In-page targets land below the stuck header. Set on the targets, not as
     scroll-padding on the root: root scroll-padding makes Chrome scroll the
     page when the menu checkbox inside the sticky header takes focus. */
  main [id] { scroll-margin-top: 5.25rem; }
  .nav-toggle-label { display: block; flex-shrink: 0; }
  /* Visually hidden rather than display:none so the checkbox stays in the
     tab order and the menu can be opened from a keyboard. */
  .nav-toggle {
    display: block; position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
    overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; opacity: 0;
  }
  .nav-toggle:focus-visible ~ .nav-toggle-label { outline: 2px solid var(--khaki); outline-offset: 2px; border-radius: var(--radius); }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--charcoal-deep);
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 0.5rem 0 0.9rem;
    display: none;
    box-shadow: 0 12px 24px rgba(0,0,0,0.3);
    max-height: calc(100vh - 100%);
    max-height: calc(100dvh - 100%);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .nav a { font-size: 0.85rem; letter-spacing: 0.06em; padding: 0.85rem 1.4rem; border-radius: 0; flex-shrink: 0; }
  .nav button.nav-cta { font-size: 0.85rem; letter-spacing: 0.06em; padding: 0.85rem 1.4rem; flex-shrink: 0; }
  .nav a[aria-current="page"]::after { display: none; }
  .nav a[aria-current="page"] { background: rgba(255,255,255,0.06); }
  .nav .nav-cta { margin: 0.6rem 1.4rem 0; text-align: center; border-radius: var(--radius); }
  .nav-toggle:checked ~ .nav { display: flex; }
  .nav-toggle:checked ~ .nav-toggle-label span { background: transparent; }
  .nav-toggle:checked ~ .nav-toggle-label span::before { transform: translateY(7px) rotate(45deg); }
  .nav-toggle:checked ~ .nav-toggle-label span::after { transform: translateY(-7px) rotate(-45deg); }
  .site-header .wrap { position: static; min-height: 5.25rem; flex-wrap: nowrap; }
  .brand { flex-shrink: 1; white-space: normal; }
  .brand img { width: 60px; height: 60px; }
  .brand .brand-text { font-size: 0.95rem; }
  .utility .wrap { font-size: 0.75rem; }
  .utility .utility-contact { display: none; }
}
@media (max-width: 860px) {
  body { font-size: 1rem; }
  .hero { min-height: 0; }
  .hero .wrap { padding: 3.5rem 0 3rem; }
  .hero::before { background: linear-gradient(180deg, rgba(37,35,43,0.9) 0%, rgba(35,48,106,0.85) 100%); }
  .page-hero::before { background: linear-gradient(180deg, rgba(37,35,43,0.92) 0%, rgba(35,48,106,0.88) 100%); }
  .hero-meta { gap: 1.2rem; }
  .section { padding: 3rem 0; }
  .split, .split.reverse { grid-template-columns: 1fr; gap: 1.8rem; }
  .split.reverse > :first-child { order: 0; }
  .tiles, .grid-2, .grid-3, .articles, .two-col, .checks-2, .store-notes { grid-template-columns: 1fr; }
  .grid-4.store-grid { grid-template-columns: repeat(2, 1fr); }
  .event-feature { grid-template-columns: 1fr; }
  .event-feature .event-media { border-right: 0; border-bottom: 1px solid var(--line); padding: 1.8rem; }
  .event-feature .event-body { padding: 1.8rem 1.5rem; }
  .letter { grid-template-columns: 1fr; }
  .letter img { max-width: 240px; }
  .cta-band .wrap { grid-template-columns: 1fr; padding: 2.8rem 0; }
  .plans { grid-template-columns: 1fr 1fr; }
  .archive li { grid-template-columns: 70px 1fr; }
  .archive a.small { grid-column: 2; }
  .listing-item { grid-template-columns: 1fr; gap: 0.6rem; }
  .listing-item .tag { justify-self: start; }
  .footer-main { grid-template-columns: 1fr; gap: 2rem; padding: 2.5rem 0 1.5rem; }
  .facts li { grid-template-columns: 90px 1fr; }
  .prose img.float-right { float: none; width: 180px; margin: 0 0 1rem; }
}
@media (max-width: 560px) {
  :root { --header-sticky: 4.75rem; }
  main [id] { scroll-margin-top: 4.75rem; }
  .wrap, .wrap-narrow { width: calc(100% - 2rem); }
  .brand-text { font-size: 0.72rem; }
  .site-header .wrap { min-height: 4.75rem; gap: 1rem; }
  .brand { gap: 0.75rem; }
  .brand img { width: 54px; height: 54px; padding: 4px; box-shadow: 0 0 0 2px rgba(232,224,178,0.28), 0 4px 12px rgba(0,0,0,0.35); }
  .brand .brand-text { font-size: 0.86rem; }
  .brand .brand-text small { font-size: 0.68rem; letter-spacing: 0.14em; }
  .grid-4, .grid-4.store-grid, .stats, .people, .principles, .plans { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.1rem; }
  .btn { width: 100%; text-align: center; }
  .actions { flex-direction: column; }
  .utility .wrap { justify-content: center; }
}
/* General Store (PayPal buttons) ------------------------------- */
.store-banner {
  background: var(--khaki-light);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  margin: 0 0 1.4rem;
  color: var(--charcoal);
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: 0.02em;
}
.store-notes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.store-notes p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.store-notes strong { display: block; color: var(--blue-deep); font-family: var(--font-head); font-size: 0.95rem; margin-bottom: 0.15rem; }
.store-grid { align-items: stretch; }
.store-grid .aside-box { align-self: start; }
/* Product images come straight from the Institute's store catalog in mixed
   sizes and aspect ratios, so they sit uncropped in a fixed frame. */
.store-media {
  aspect-ratio: 4 / 3;
  background: var(--khaki-light);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.store-media img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 6px 14px rgba(35,48,106,0.18)); }
.store-media img.is-small { max-width: 45%; max-height: 45%; filter: none; }
.store-card.is-soldout .store-media img { filter: grayscale(0.4); }
.section-dark .store-media { background: var(--khaki-light); }
.store-card .card-body { padding: 1.2rem 1.25rem 1.3rem; }
.store-card h3 { font-size: 1.1rem; }
.store-card .store-kind {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 0.45rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem;
}
.store-tag {
  display: inline-block;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--blue-tint);
  color: var(--blue-deep);
}
.store-tag-new { background: var(--khaki); color: var(--charcoal); }
.store-tag-youth { background: #e3f1ec; color: #1f5c47; }
.store-tag-sale { background: #fbe9e3; color: #8a3a1f; }
.store-tag-soldout { background: var(--charcoal); color: var(--white); }
.store-card .store-price {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1.15;
  color: var(--blue-deep);
  margin: auto 0 0.9rem;
  padding-top: 0.4rem;
}
.store-card .store-price small { font-family: var(--font-body); font-weight: 400; font-size: 0.85rem; color: var(--muted); }
.store-card .store-was { font-size: 0.9rem; font-weight: 600; color: var(--muted); }
.store-card .store-save { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #8a3a1f; vertical-align: middle; }
.store-card .card-body p { flex: 0 0 auto; }
.store-buy { margin-top: 0; }
.store-card.is-soldout { opacity: 0.78; border-top-color: var(--line); }
.store-card.is-soldout .store-price { color: var(--muted); }
.store-card .store-unavailable {
  margin: 0;
  min-height: 48px;
  display: flex; align-items: center; justify-content: center;
  border: 2px dashed var(--line);
  border-radius: 4px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  padding: 0.5rem 0.75rem;
}
.section-dark .store-card { border-top-color: var(--khaki); }
.section-dark .store-card h3 { color: var(--blue-deep); }
.section-dark .store-card .card-body p { color: var(--muted); }
.section-dark .store-card .store-price { color: var(--blue-deep); }
.section-dark .store-card .store-kind { color: var(--blue); }
/* PayPal gold with dark label. Color is set on the control itself so
   it stays readable without hover (site gold-on-khaki buttons did not). */
.paypal-buy {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 0.75rem 1rem;
  border: 0;
  border-radius: 4px;
  background: #ffc439;
  color: #111111;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: 0.01em;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.paypal-buy:hover,
.paypal-buy:focus {
  background: #f2ba36;
  color: #111111;
}
.paypal-slot { min-height: 45px; }
.store-card .store-checkout-status {
  margin: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}
.store-card .store-checkout-status[hidden] { display: none; }
.store-buy .btn { width: 100%; text-align: center; }
.store-actions { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.35rem; }
.qty-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.qty-input {
  width: 4.2rem;
  font: inherit;
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: none;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
}
.cart-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.8rem; max-width: 40rem; }
.cart-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 1rem;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.9rem 1rem;
}
.cart-title { margin: 0; font-family: var(--font-head); font-weight: 800; color: var(--blue-deep); }
.cart-price { margin: 0; color: var(--muted); font-size: 0.92rem; }
.cart-line .qty-label { grid-column: 1; }
.cart-line .btn { grid-column: 2; grid-row: 1 / span 3; }
.cart-actions { margin-top: 1.2rem; }
#cart-status { min-height: 1.4rem; }

@media (max-width: 360px) {
  .brand { gap: 0.6rem; }
  .brand img { width: 50px; height: 50px; }
  .brand .brand-text { font-size: 0.76rem; }
  .brand .brand-text small { font-size: 0.62rem; }
}

/* Member sign-in ------------------------------------------------ */
.account-slot { display: flex; align-items: center; flex-shrink: 0; }
.account-slot form { display: inline-flex; margin: 0; align-items: center; }
/* Signed-in header. Photo from /api/me, or the member's initial. */
.nav a.nav-profile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: 0.35rem;
  padding: 0;
  border-radius: 50%;
  overflow: hidden;
  background: var(--khaki);
  color: var(--charcoal);
  font-weight: 800;
  font-size: 1.1rem;
  line-height: 1;
  flex: 0 0 auto;
  text-transform: none;
  letter-spacing: 0;
}
.nav a.nav-profile img {
  width: 44px;
  height: 44px;
  max-width: 44px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
}
.nav a.nav-profile .nav-initial {
  display: block;
  line-height: 1;
}
.nav a.nav-profile:hover,
.nav a.nav-profile:focus-visible {
  color: var(--charcoal);
  background: var(--khaki);
  box-shadow: 0 0 0 2px var(--blue);
}

.nav { order: 2; }
.nav-toggle-label { order: 4; }
.brand { order: 1; }
.nav .nav-cta:focus-visible,
.nav a.nav-profile:focus-visible,
.finder-search input:focus-visible,
.library-search input:focus-visible,
.library-tile:focus-visible,
.finder-chip:focus-visible,
.finder-card:focus-visible,
.finder-controls select:focus-visible,
.finder-clear:focus-visible,
.finder-see:focus-visible,
.finder-page:focus-visible {
  outline: 3px solid var(--khaki);
  outline-offset: 2px;
}
.finder-search input:focus-visible,
.library-search input:focus-visible,
.library-tile:focus-visible,
.finder-chip:focus-visible,
.finder-card:focus-visible,
.finder-controls select:focus-visible,
.finder-clear:focus-visible,
.finder-see:focus-visible,
.finder-page:focus-visible { outline-color: var(--blue); }

/* Article finder ----------------------------------------------- */
.finder-section { padding-top: 0.5rem; padding-bottom: 2.5rem; }
#finder { scroll-margin-top: calc(var(--header-sticky) + 4.5rem); }
.finder-toolbar {
  position: static;
  background: transparent;
  padding: 0.2rem 0 0.75rem;
  margin-bottom: 0.85rem;
  border-bottom: 0;
}
.finder-search label {
  display: block;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
  color: var(--blue-deep);
  margin-bottom: 0.7rem;
}
.finder-search input {
  width: 100%;
  font: inherit;
  font-size: 1.25rem;
  padding: 0.9rem 1rem;
  min-height: 3.4rem;
  border: 2px solid var(--blue);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
}
.finder-topics, .finder-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0 0;
  padding: 0;
}
.finder-toolbar .finder-topics {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 0.15rem;
}
.finder-toolbar .finder-chip { flex: 0 0 auto; }
.finder-chip {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  min-height: 44px;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--white);
  color: var(--blue-deep);
  cursor: pointer;
}
.finder-chip[aria-pressed="true"] {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}
.finder-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
  margin-top: 1rem;
}
.finder-controls label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.finder-controls select {
  font: inherit;
  font-size: 1rem;
  min-height: 48px;
  min-width: 9rem;
  padding: 0.4rem 0.7rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
}
.finder-clear {
  font-family: var(--font-head);
  font-weight: 700;
  min-height: 48px;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: 2px solid var(--blue);
  background: transparent;
  color: var(--blue);
  cursor: pointer;
}
.finder-toolbar .finder-count {
  margin: 0.85rem 0 0;
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--muted);
}
.finder-topic-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.4rem 0 0.65rem;
}
.finder-topic-head h2 { margin: 0; font-size: 1.35rem; }
.finder-see {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1rem;
  color: var(--blue);
  background: transparent;
  border: 0;
  padding: 0.35rem 0;
  min-height: 44px;
  cursor: pointer;
  text-decoration: underline;
  white-space: nowrap;
}
.finder-topic .finder-results { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.finder-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin: 1.1rem 0 0.2rem;
}
.finder-page {
  font-family: var(--font-head);
  font-weight: 800;
  min-width: 44px;
  min-height: 44px;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  border: 2px solid var(--line);
  background: var(--white);
  color: var(--blue-deep);
  cursor: pointer;
}
.finder-page[aria-current="page"] {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}
.finder-page:disabled { opacity: 0.45; cursor: default; }
.finder-ellipsis { color: var(--muted); padding: 0 0.15rem; font-weight: 800; }
.finder-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.8rem;
}
.finder-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.1rem 0.9rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  min-height: 44px;
}
.finder-card:hover { border-color: var(--blue); }
.finder-card h3 { margin-bottom: 0.2rem; font-size: 1.2rem; }
.finder-author {
  margin: 0 0 0.35rem;
  font-weight: 800;
  color: var(--blue-deep);
  font-size: 1.02rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.finder-teaser {
  margin: 0 0 0.45rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.finder-card mark {
  background: var(--khaki);
  color: inherit;
  font-weight: 800;
  padding: 0 0.12em;
  border-radius: 0.15em;
}
.finder-meta { margin: 0; color: var(--muted); font-size: 0.88rem; font-weight: 600; }
.finder-suggest { margin: 0.15rem 0 0.7rem; }
.finder-suggest button {
  font: inherit;
  font-weight: 800;
  color: var(--blue);
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}
.lock-badge {
  float: right;
  margin-left: 0.8rem;
  background: var(--khaki);
  color: var(--charcoal);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
}
.finder-empty {
  background: var(--white);
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 1.2rem 1.1rem;
}
.finder-empty h3 { margin-bottom: 0.4rem; }

/* Library home ------------------------------------------------- */
main.library-page > .section { padding: 1.35rem 0 0.4rem; }
main.library-page > #store,
main.library-page > #contribute { padding: 4.2rem 0; }
.library-searchbar {
  position: sticky;
  top: var(--header-sticky);
  z-index: 40;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0;
}
.library-search-line { position: relative; }
.library-search input {
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  min-height: 48px;
  padding: 0.45rem 3.2rem 0.45rem 1rem;
  border: 2px solid var(--blue);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
}
.library-slash {
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  min-width: 1.7rem;
  text-align: center;
  line-height: 1.5;
  pointer-events: none;
  background: var(--white);
}
.library-search-line:focus-within .library-slash { visibility: hidden; }
.library-sections h1 { margin-bottom: 0.25rem; }
.library-lede { margin-bottom: 1.1rem; }
.library-crumbs { font-size: 0.85rem; color: var(--muted); margin: 0 0 0.7rem; }
.library-crumbs a { color: var(--blue); text-decoration: none; }
.library-crumbs a:hover { text-decoration: underline; }
.library-sections h2,
#topics h2,
.library-member h2 { margin-bottom: 0.8rem; }
#search { scroll-margin-top: var(--header-sticky); }
.library-tiles {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.85rem;
}
.library-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  width: 100%;
  min-height: 9.5rem;
  padding: 1rem 1rem 0.95rem;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.library-tile:hover { border-color: var(--blue); }
.library-tile[aria-pressed="true"] {
  border-color: var(--blue);
  background: var(--blue-tint);
}
.library-tile-icon {
  display: flex;
  color: var(--blue);
  margin-bottom: 0.15rem;
}
.library-tile-title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--blue-deep);
  line-height: 1.2;
}
.library-tile-desc {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.35;
}
.library-tile-count {
  margin-top: auto;
  font-family: var(--font-head);
  font-weight: 800;
  color: var(--blue);
}
.library-row {
  display: flex;
  gap: 0.8rem;
  overflow-x: auto;
  list-style: none;
  margin: 0 0 1.1rem;
  padding: 0.1rem 0 0.55rem;
  scroll-snap-type: x mandatory;
}
.library-row > li {
  flex: 0 0 min(19rem, 82vw);
  scroll-snap-align: start;
}
.library-row .finder-card { height: 100%; }
.finder-intro { margin-bottom: 0.8rem; max-width: 65ch; }
.finder-intro .kicker { margin-bottom: 0.25rem; }
.finder-intro-copy { margin: 0; color: var(--muted); }
#sections, #topics, #for-members, #store, #contribute {
  scroll-margin-top: calc(var(--header-sticky) + 4.5rem);
}
@media (max-width: 1100px) {
  .library-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .library-tiles { grid-template-columns: 1fr; }
  .library-tile { min-height: 7.25rem; }
}

/* Article reader ------------------------------------------------ */
.teaser-fade { position: relative; max-height: 7.6rem; overflow: hidden; }
.teaser-fade::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3.5rem;
  background: linear-gradient(transparent, var(--cream));
}
.article-open .teaser-fade { max-height: none; overflow: visible; }
.article-open .teaser-fade::after { content: none; }
.members-only {
  margin-top: 0.5rem;
  background: var(--white);
  border: 2px solid var(--khaki);
  border-radius: 10px;
  padding: 1.2rem 1.2rem 1.3rem;
  box-shadow: var(--shadow);
}
.members-only h2 { font-size: 1.45rem; }
.article-full {
  margin-top: 1.2rem;
  background: var(--white);
  border-radius: 10px;
  padding: 1.2rem 1.2rem 0.4rem;
  border: 1px solid var(--line);
}
.account-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.3rem 1.3rem 1.4rem;
  box-shadow: var(--shadow);
  max-width: 36rem;
}
.account-card dt {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.9rem;
}
.account-card dd { margin: 0.15rem 0 0; font-size: 1.15rem; }
.account-card .btn[disabled],
.account-card button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.signin-providers {
  list-style: none;
  margin: 1.4rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  max-width: 22rem;
}
.signin-providers .btn { display: flex; align-items: center; justify-content: center; min-height: 48px; }

@media (max-width: 900px) {
  .nav .account-slot {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin: 0;
  }
  .nav .account-slot form { display: block; }
  .nav .account-slot > a.nav-cta,
  .nav .account-slot button.nav-cta { display: block; }
  .nav a.cart-link {
    align-self: center;
    width: 44px;
    height: 44px;
    margin: 0.7rem auto 0;
    padding: 0;
  }
  .nav .account-slot > a.nav-profile,
  html[data-auth="in"] .auth-hold,
  html[data-auth="unknown"] .auth-hold {
    align-self: center;
    width: 44px;
    height: 44px;
    margin: 0.7rem auto 0;
    padding: 0;
  }
}

/* Cached /api/me is applied in the head, before this header paints.
   unknown is a neutral circle. in hides Join and Sign In. */
.auth-hold { display: none; }
html[data-auth="unknown"] .nav > a.nav-cta,
html[data-auth="in"] .nav > a.nav-cta,
html[data-auth="unknown"] .account-slot > a.nav-cta,
html[data-auth="in"] .account-slot > a.nav-cta,
html[data-auth="unknown"] #account-signed-out,
html[data-auth="in"] #account-signed-out { display: none; }
html[data-auth="unknown"] .auth-hold,
html[data-auth="in"] .auth-hold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: 0.35rem;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  color: var(--charcoal);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.1rem;
  line-height: 1;
  flex: 0 0 auto;
}
html[data-auth="in"] .auth-hold {
  background-color: var(--khaki);
  background-image: var(--member-photo);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}
html[data-auth="in"]:not([data-picture]) .auth-hold::before {
  content: var(--member-initial, "");
}
@media (max-width: 560px) {
  .finder-controls label,
  .finder-controls select,
  .finder-clear { width: 100%; }
}
