/* ============================================================
   YummyMath — shared theme (design tokens + chrome)
   ------------------------------------------------------------
   Consolidated from the redesign mockups' inline <style> blocks
   (Developer handoff.md item 4). Holds the design tokens, the
   Source Sans 3 + Lora font import, and the shared nav/footer
   chrome CSS so every page pulls from one source instead of
   duplicating it inline. Page-specific CSS stays with each page.

   Font loading note: a <link rel="preconnect"> + <link rel="stylesheet">
   in the document <head> is faster than @import and is the preferred
   production hook. The @import below keeps this stylesheet self-contained
   for partials/pages that do not yet inject the <link> themselves.

   NAMING: redesign classes below use a `ym-` prefix (`.ym-nav`, `.ym-btn`)
   specifically where the un-prefixed name would collide with a
   bootstrap.min.css component/utility class of the same name (`.nav` is
   Bootstrap's nav/tabs/pills component; `.btn` is Bootstrap's button
   component) — both stylesheets load on every page (legacy admin pages
   still need Bootstrap's own `.nav`/`.btn`), so an un-prefixed redesign
   class silently inherited Bootstrap's layout/sizing. Plain BEM element/
   modifier names that don't collide with anything (`.hero`, `.footer`,
   `.lib-header`, etc.) are left as-is — only the two colliding blocks
   needed prefixing.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Lora:wght@400;600&family=Source+Sans+3:wght@400;500;600&display=swap');

:root {
  --color-green: #05836E;
  --color-green-dark: #04695A;
  --color-cream: #FEFBF3;
  --color-coral-eyebrow: #D6B968;
  --color-coral-line: #C9A33D;
  --color-text: #1A1A1A;
  --color-text-muted: #555555;
  --color-divider: #E8DFCC;
  --color-accent-deep: #8A6D1F;   /* deep gold — AA-compliant for text on cream */

  /* LOCKED: site-wide typography is Source Sans 3 (body) + Lora (headings).
     Do NOT revert to Georgia / system fonts — that reintroduces a site-wide
     typography mismatch. Headings use var(--font-serif); body var(--font-body). */
  --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: 'Lora', Georgia, "Times New Roman", serif;
}

/* Overrides legacy style.css `body { font-family: Poppins; font-size: 14px; }`
   (loaded earlier in <head>) which otherwise wins since theme.css had no
   body rule of its own. */
body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: #FFFFFF;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Overrides legacy style.css `article { margin-top: 80px; }`, a leftover
   offset for the old fixed-position dashboard nav. This nav uses
   `position: sticky`, so the gap is no longer needed. */
article {
  margin-top: 0;
}

/* Overrides legacy style.css `header { position: fixed; top: 0; z-index: 100;
   width: 100%; background: #fff; }` (old dashboard topbar rule targeting the
   bare <header> tag). Redesign page-header blocks (.lib-header etc.) use
   <header> semantically but expect normal in-flow rendering; the legacy
   fixed-position rule otherwise pins them over .ym-nav at the same z-index.
   (Can't fix this one by renaming — it's a bare HTML tag selector, not a
   class collision.) */
header {
  position: static;
  width: auto;
  background: none;
  z-index: auto;
}

/* ============================================================
   Buttons (shared)
   ============================================================ */
.ym-btn {
  display: inline-block;
  padding: 0.8rem 1.6rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-family: inherit;
  text-align: center;
}
.ym-btn--primary { background: var(--color-green); color: #FFFFFF; }
.ym-btn--primary:hover { background: var(--color-green-dark); }
.ym-btn--secondary {
  background: transparent;
  color: var(--color-green);
  border: 1.5px solid var(--color-green);
}
.ym-btn--secondary:hover { background: rgba(31, 122, 61, 0.06); }

/* ============================================================
   SITE HEADER / NAV (Variation A, locked)
   ============================================================ */
.ym-nav {
  background: #FFFFFF;
  border-bottom: 1px solid var(--color-divider);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
  padding: 0 2.5rem; /* matches .hero/.lib-body-outer/.crumbs outer-padding convention so the logo lines up with page content below it */
}
/* Horizontal padding lives on .ym-nav (not .ym-nav__row) so it matches the
   same outer-padding + inner-max-width pattern every page section (.hero,
   .alook, .ts, .lib-header__inner, etc.) uses — otherwise the nav's own
   padding never gets "absorbed" by the centering the way section padding
   does, and the logo sits visibly right of the page content below it. */
.ym-nav__row {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0.75rem 0;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.ym-nav__logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.ym-nav__logo-img {
  height: 28px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: block;
  /* NOTE: mockups used `mix-blend-mode: multiply` here to hide a white
     JPEG background. Deliberately omitted in production — the hack is
     replaced by a transparent logo asset (see Step 9 production logo). */
}
.ym-nav__primary {
  display: flex;
  gap: 1.5rem;
  flex: 1;
}
.ym-nav__link {
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.15s;
}
.ym-nav__link:hover { color: var(--color-green); }
.ym-nav__link--active { color: var(--color-green); }
.ym-nav__right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}
.ym-nav__search {
  display: contents;
}
.ym-nav__search-field {
  position: relative;
  width: 360px;
}
.ym-nav__search-field input {
  width: 100%;
  padding: 0.45rem 0.85rem 0.45rem 2rem;
  border: 1px solid #DDD3BD;
  background: #FAF6E8;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--color-text);
  transition: border-color 0.15s, background 0.15s;
}
.ym-nav__search-field input::placeholder { color: #8C7E5C; }
.ym-nav__search-field input:focus {
  outline: none;
  border-color: var(--color-green);
  background: #FFF;
}
.ym-nav__search-field svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: #8C7E5C;
  pointer-events: none;
}
.ym-nav__signin {
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
}
.ym-nav__signin:hover { color: var(--color-green); }
.ym-nav__logout {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}
.ym-nav__logout:hover { color: var(--color-green); text-decoration: underline; }
.ym-nav__cta {
  display: inline-block;
  background: var(--color-green);
  color: #FFF;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s;
}
.ym-nav__cta:hover { background: var(--color-green-dark); }
.ym-nav__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-green);
  color: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
}

/* Mobile search toggle + panel — hidden on desktop, shown under the breakpoint */
.ym-nav__search-toggle { display: none; }
.ym-nav__search-panel { display: none; }

/* Nav-only breakpoint, wider than the site's general 720px mobile stack:
   the fixed-width search field + Subscribe CTA don't fit unwrapped between
   ~721-900px, so swap to the icon search-toggle earlier than everything
   else goes mobile (avoids widening the shared 720px breakpoint used by
   every other section, which would change when those stack unnecessarily). */
@media (max-width: 900px) {
  .ym-nav__search-field { display: none; }
  .ym-nav__search-toggle { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; background: #FAF6E8; border: 1px solid #DDD3BD; border-radius: 4px; color: #8C7E5C; cursor: pointer; flex-shrink: 0; transition: border-color 0.15s, color 0.15s; }
  .ym-nav__search-toggle svg { width: 16px; height: 16px; }
  .ym-nav__search-toggle[aria-expanded="true"] { border-color: var(--color-green); color: var(--color-green); }
  .ym-nav__search-panel { display: block; width: 100%; padding: 0 1rem 0.7rem; }
  .ym-nav__search-panel[hidden] { display: none; }
  .ym-nav__search-field--panel { display: block; width: 100%; }
  .ym-nav__search-field--panel input { font-size: 0.9rem; padding: 0.55rem 0.85rem 0.55rem 2.2rem; }
  .ym-nav__search-field--panel svg { width: 16px; height: 16px; }
}

@media (max-width: 720px) {
  .ym-nav { padding: 0 1.25rem; } /* matches .crumbs mobile padding */
  .ym-nav__row {
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    padding: 0.6rem 0;
  }
  .ym-nav__logo { order: 1; }
  .ym-nav__logo-text { font-size: 1.15rem; }
  .ym-nav__right { order: 2; margin-left: auto; gap: 0.75rem; }
  .ym-nav__primary {
    order: 3;
    flex-basis: 100%;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.85rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--color-divider);
    margin-top: 0.3rem;
  }
  /* gap fallback for older mobile WebKit that ignores flex `gap`. */
  .ym-nav__primary > .ym-nav__link { margin-right: 1.5rem; }
  .ym-nav__primary > .ym-nav__link:last-child { margin-right: 0; }
  .ym-nav__signin { font-size: 0.85rem; }
  .ym-nav__logout { font-size: 0.78rem; }
  /* search-field/toggle swap already handled by the 900px breakpoint above */
}

/* ============================================================
   BREADCRUMB
   Shared across every page (category, membership, post, faq,
   contact, privacy-policy) so the crumb bar aligns with the
   1140px nav/footer content column instead of drifting per page.
   ============================================================ */
.crumbs {
  background: #FFFFFF;
  border-bottom: 1px solid var(--color-divider);
  font-size: 0.82rem;
  color: var(--color-text-muted);
  padding: 0 2.5rem;
}
.crumbs__inner { max-width: 1140px; margin: 0 auto; padding: 0.7rem 0; }
.crumbs a { color: var(--color-text-muted); text-decoration: none; }
.crumbs a:hover { color: var(--color-green); text-decoration: underline; }
.crumbs span[aria-current] { color: var(--color-text); }

/* ============================================================
   SITE FOOTER
   ============================================================ */
.footer {
  background: #F5EFDD;
  border-top: 1px solid #E0D5BE;
  padding: 2.5rem 2.5rem 1.5rem;
  color: var(--color-text);
}
.footer__inner {
  max-width: 1140px;
  margin: 0 auto;
}
.footer__top {
  display: grid;
  grid-template-columns: auto auto auto auto;
  justify-content: space-between;
  column-gap: 2.25rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #E0D5BE;
}
/* Genre links — compact 2-column grid inside the Activity Library column */
.footer__links--grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1.25rem;
}
.footer__links--grid a { font-size: 0.88rem; }
.footer__view-all {
  display: inline-block;
  margin-top: 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-green);
  text-decoration: none;
}
.footer__view-all:hover { text-decoration: underline; }
.footer__brand {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.footer__logo {
  height: 32px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  display: block;
  margin-bottom: 0.5rem;
  /* NOTE: mockups used `mix-blend-mode: multiply` here too; omitted in
     production for the same reason as .ym-nav__logo-img above. */
}
.footer__tagline {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  max-width: 280px;
}
.footer__col-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.85rem;
}
.footer__links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.footer__links a {
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.15s;
}
.footer__links a:hover {
  color: var(--color-green);
  text-decoration: underline;
}
.footer__bottom {
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}
.footer__bottom a {
  color: var(--color-text-muted);
  text-decoration: none;
}
.footer__bottom a:hover {
  color: var(--color-green);
  text-decoration: underline;
}
@media (max-width: 720px) {
  .crumbs { padding: 0 1.25rem; }
  .crumbs__inner { padding: 0.6rem 0; }
  .footer { padding: 2rem 1.25rem 1.25rem; }
  .footer__top {
    grid-template-columns: 1fr;
    justify-content: start;
    gap: 1.75rem;
    padding-bottom: 1.5rem;
  }
  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}
