:root {
  --purple: #5d5aa7;
  --purple-dark: #4a4889;
  --blue: #4176a8;
  --teal: #198fab;
  --mint: #36b7b2;
  --ink: #2f3038;
  --muted: #6b6c75;
  --line: #e2e2ec;
  --bg: #f4f4f8;
  --card: #ffffff;
  --tint: #f0f0f7;
  --good: #1f8a5b;
  --warn: #c2632a;
  --accent: var(--purple);
  --radius: 12px;
  --maxw: 1040px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  margin: 0;
  line-height: 1.6;
}

a { color: var(--purple); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Header ------------------------------------------------------------ */
.site-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.1rem 1.25rem;
}
.brand { font-weight: 800; font-size: 1.2rem; color: var(--purple-dark); letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.site-nav { display: flex; gap: 1.1rem; margin-left: 1.25rem; }
.site-nav a { color: var(--ink); font-weight: 700; font-size: 0.95rem; }
.site-nav a:hover { color: var(--purple); text-decoration: none; }
.header-tools { display: flex; align-items: center; gap: 0.6rem; margin-left: auto; }

.sponsor-pill {
  font-size: 0.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--purple), var(--teal));
  color: #fff;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  letter-spacing: 0.01em;
}
.sponsor-pill:hover { text-decoration: none; filter: brightness(1.05); }

/* ---- Buttons & chips --------------------------------------------------- */
.ghost-btn, .primary-btn, .link-btn {
  font-size: 0.9rem; font-weight: 700; border-radius: 8px; cursor: pointer;
  padding: 0.45rem 0.85rem; border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-family: inherit; display: inline-block;
}
.ghost-btn:hover { text-decoration: none; border-color: var(--purple); color: var(--purple); }
.primary-btn {
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: #fff; border: none; font-weight: 800;
}
.primary-btn:hover { text-decoration: none; filter: brightness(1.06); }
.link-btn { border: none; background: none; color: var(--muted); padding: 0 0.3rem; }

/* ---- Switchers (chip-style dropdowns) ---------------------------------- */
.switch { position: relative; }
.switch > summary {
  list-style: none; cursor: pointer; font-weight: 800; font-size: 0.8rem;
  padding: 0.45rem 0.8rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--tint); color: var(--purple-dark);
}
.switch > summary::-webkit-details-marker { display: none; }
.switch > summary:hover { border-color: var(--purple); }
.switch ul {
  position: absolute; right: 0; margin: 0.4rem 0 0; padding: 0.4rem; list-style: none;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; min-width: 190px;
  box-shadow: 0 12px 30px rgba(47,48,56,0.14); z-index: 20;
}
.switch ul a { display: block; padding: 0.4rem 0.55rem; border-radius: 7px; color: var(--ink); font-weight: 600; }
.switch ul a:hover { background: var(--tint); text-decoration: none; }
.switch ul a[aria-current] { color: var(--purple); font-weight: 800; }

/* ---- Messages ---------------------------------------------------------- */
.messages { max-width: var(--maxw); margin: 0.5rem auto 0; padding: 0 1.25rem; list-style: none; }
.msg { padding: 0.7rem 1rem; border-radius: 10px; margin-bottom: 0.5rem; font-weight: 600; }
.msg.success { background: #e6f5ee; color: var(--good); }
.msg.error { background: #fbeae1; color: var(--warn); }

/* ---- Layout ------------------------------------------------------------ */
.site-main { max-width: var(--maxw); margin: 0 auto; padding: 1rem 1.25rem 4rem; }

.hero { padding: 2.25rem 0 1.5rem; }
.hero.compact { padding: 1.25rem 0; }
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.78rem;
  font-weight: 800; color: var(--purple); margin: 0 0 0.5rem;
}
h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); line-height: 1.12; margin: 0 0 0.75rem; color: var(--purple-dark); }
h2, h3 { color: var(--purple-dark); }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 52ch; }

/* ---- Cards / grids ----------------------------------------------------- */
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin: 2rem 0; }
.pillar {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.25rem; color: inherit;
  border-top: 3px solid var(--purple);
}
.pillar:hover { text-decoration: none; box-shadow: 0 10px 26px rgba(47,48,56,0.08); transform: translateY(-2px); transition: all .15s ease; }
.pillar h2 { margin: 0 0 0.4rem; font-size: 1.15rem; }
.pillar p { margin: 0; color: var(--muted); }

.grid-section { margin: 2.25rem 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; }
.section-head h2 { font-size: 1.4rem; margin: 0; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(265px, 1fr)); gap: 1.1rem; margin-top: 1.1rem; }
.card {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.2rem; color: inherit;
}
.card:hover { text-decoration: none; border-color: var(--purple); box-shadow: 0 10px 26px rgba(47,48,56,0.07); }
.card h3 { margin: 0 0 0.4rem; font-size: 1.12rem; }
.card .muted { color: var(--muted); }
.meta { font-size: 0.85rem; color: var(--muted); }
.tag {
  font-size: 0.7rem; font-weight: 800; background: var(--tint); color: var(--purple-dark);
  padding: 0.12rem 0.5rem; border-radius: 999px; margin-left: 0.4rem;
}

/* ---- Content / prose --------------------------------------------------- */
.narrow { max-width: 660px; }
.guide { max-width: 760px; }
.guide-head .eyebrow { color: var(--purple); }
.guide-actions { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin: 1.2rem 0; }
.hero-img { width: 100%; border-radius: var(--radius); margin: 1rem 0; border: 1px solid var(--line); }

.prose { font-size: 1.07rem; color: var(--ink); }
.prose h2 { margin-top: 2rem; font-size: 1.5rem; padding-bottom: 0.3rem; border-bottom: 2px solid var(--tint); }
.prose h3 { margin-top: 1.5rem; font-size: 1.18rem; color: var(--purple); }
.prose a { color: var(--purple); font-weight: 600; text-decoration: underline; text-decoration-color: var(--line); }
.prose a:hover { text-decoration-color: var(--purple); }
.prose img { max-width: 100%; border-radius: 10px; }
.prose blockquote {
  margin: 1.4rem 0; padding: 1rem 1.25rem; background: var(--tint);
  border-left: 4px solid var(--purple); border-radius: 0 10px 10px 0;
  color: var(--ink); font-size: 1.06rem;
}
.prose blockquote p { margin: 0; }
.prose figure { margin: 1.6rem 0; }
.prose figure img { width: 100%; display: block; border: 1px solid var(--line); border-radius: var(--radius); }
.prose figcaption { margin-top: 0.5rem; font-size: 0.85rem; color: var(--muted); text-align: center; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin: 0.3rem 0; }
.embed { margin: 1rem 0; }
.embed iframe { max-width: 100%; border-radius: 10px; }

/* ---- Lists ------------------------------------------------------------- */
.link-list { list-style: none; padding: 0; }
.link-list > li { padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.link-list a { font-weight: 700; }

/* ---- Forms ------------------------------------------------------------- */
.stack-form { display: flex; flex-direction: column; gap: 0.55rem; max-width: 480px; margin: 1.3rem 0; }
.stack-form label { font-weight: 700; font-size: 0.92rem; }
.stack-form input[type=email], .stack-form input[type=text], .stack-form textarea {
  padding: 0.6rem 0.7rem; border: 1px solid var(--line); border-radius: 8px;
  font-size: 1rem; font-family: inherit; color: var(--ink);
}
.stack-form input:focus, .stack-form textarea:focus { outline: 2px solid var(--purple); border-color: var(--purple); }
.stack-form .checkbox { font-weight: 400; display: flex; gap: 0.5rem; align-items: flex-start; }
.inline-form { display: inline; }
.small { font-size: 0.85rem; }
.sponsor-block { margin: 1.6rem 0; padding-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
.sponsor-note { color: var(--muted); }

/* ---- Footer ------------------------------------------------------------ */
.site-footer {
  max-width: var(--maxw); margin: 0 auto; padding: 2rem 1.25rem 3rem;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 0.95rem;
}
.muted { color: var(--muted); }

/* ---- Audio callout (Everything Tutor) ---------------------------------- */
.audio-callout {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  background: linear-gradient(135deg, var(--tint), #eafaf7);
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  margin: 1.25rem 0 1.5rem;
}
.audio-callout-icon { font-size: 1.6rem; line-height: 1; }
.audio-callout-text { flex: 1 1 240px; font-size: 0.98rem; color: var(--ink); }
.audio-callout .primary-btn { white-space: nowrap; }

/* ---- Header layout + CSS-only mobile hamburger ------------------------- */
.site-header { flex-wrap: wrap; }
.brand { order: 1; margin-right: 1rem; }
.sponsor-pill { order: 5; }
.nav-toggle-cb { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.nav-toggle { order: 4; display: none; }
.nav-collapse { order: 3; display: flex; flex: 1; align-items: center; gap: 1rem; }
.nav-collapse .site-nav { display: flex; gap: 1.1rem; margin-left: 0; }
.nav-collapse .header-tools { display: flex; align-items: center; gap: 0.6rem; margin-left: auto; }

@media (max-width: 760px) {
  .site-header { padding: 0.75rem 1rem; gap: 0.5rem 0.6rem; }
  .brand { font-size: 1.05rem; margin-right: 0; }
  /* Top bar: brand (left), then sponsor pill + hamburger (right) */
  .sponsor-pill { order: 2; margin-left: auto; font-size: 0.7rem; padding: 0.35rem 0.6rem; }
  .nav-toggle {
    order: 3; display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px;
    background: #fff; color: var(--purple-dark); font-size: 1.2rem; cursor: pointer;
  }
  .nav-toggle::after { content: "\2630"; }                              /* hamburger */
  .nav-toggle-cb:checked ~ .nav-toggle::after { content: "\2715"; }     /* close (x) */
  /* Collapsible panel below, hidden until toggled */
  .nav-collapse {
    order: 4; flex: 0 0 100%; display: none; flex-direction: column;
    align-items: stretch; gap: 0.3rem; padding-top: 0.5rem;
  }
  .nav-toggle-cb:checked ~ .nav-collapse { display: flex; }
  .nav-collapse .site-nav { flex-direction: column; gap: 0; margin-left: 0; }
  .nav-collapse .site-nav a { padding: 0.65rem 0.2rem; font-size: 1.05rem; border-bottom: 1px solid var(--line); }
  .nav-collapse .header-tools { margin-left: 0; gap: 0.6rem; padding-top: 0.55rem; flex-wrap: wrap; }
}

/* ---- Search + categories/tags ------------------------------------------ */
.header-search { display: flex; }
.header-search input {
  border: 1px solid var(--line); border-radius: 999px; padding: 0.4rem 0.85rem;
  font-size: 0.9rem; font-family: inherit; min-width: 140px; background: #fff; color: var(--ink);
}
.header-search input:focus { outline: 2px solid var(--purple); border-color: var(--purple); }

.search-form-lg { display: flex; gap: 0.5rem; margin: 1rem 0 1.5rem; max-width: 560px; }
.search-form-lg input {
  flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 0.8rem;
  font-size: 1rem; font-family: inherit;
}
.search-form-lg input:focus { outline: 2px solid var(--purple); border-color: var(--purple); }

.topic-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.5rem 0 1.5rem; }
.topic-chips-label { font-size: 0.85rem; color: var(--muted); font-weight: 700; }
.chip-link {
  display: inline-block; font-size: 0.85rem; font-weight: 700; color: var(--purple-dark);
  background: var(--tint); border: 1px solid var(--line); border-radius: 999px; padding: 0.3rem 0.75rem;
}
.chip-link:hover { text-decoration: none; border-color: var(--purple); }
.chip-tag {
  display: inline-block; font-size: 0.68rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--purple); margin-bottom: 0.4rem;
}
.guide-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1.5rem 0; }
.eyebrow a { color: inherit; }

@media (max-width: 760px) {
  .nav-collapse .header-search { width: 100%; }
  .nav-collapse .header-search input { width: 100%; min-width: 0; }
}

/* ---- Card images ------------------------------------------------------- */
.guide-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.card-img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block;
  background: var(--tint); border-bottom: 1px solid var(--line);
}
.guide-card .card-body { padding: 1.05rem 1.15rem; }
.guide-card:hover .card-img { filter: brightness(0.97); }

/* ---- Hubbub brand assets ----------------------------------------------- */
.sponsor-pill {
  background: #fff; color: var(--ink);
  border: 1px solid var(--line);
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.7rem;
}
.sponsor-pill:hover { filter: none; border-color: var(--purple); }
.sponsor-pill-label { font-size: 0.7rem; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; }
.hubbub-logo { height: 16px; width: auto; display: block; }
.footer-sponsor { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.hubbub-logo-footer { height: 22px; width: auto; vertical-align: middle; }
.hubbub-logo-lg { height: 52px; width: auto; margin-bottom: 0.4rem; }

/* ---- Enquiry form select ----------------------------------------------- */
.stack-form select {
  padding: 0.6rem 0.7rem; border: 1px solid var(--line); border-radius: 8px;
  font-size: 1rem; font-family: inherit; color: var(--ink); background: #fff;
}
.stack-form select:focus { outline: 2px solid var(--purple); border-color: var(--purple); }

/* ---- Smooth anchor scrolling (e.g. Get involved cards) ----------------- */
html { scroll-behavior: smooth; }
.sponsor-block[id] { scroll-margin-top: 1.5rem; }
