/* ── Reset & Tokens ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }

body {
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", -apple-system, sans-serif;
  color: #14231d;
  background:
    radial-gradient(circle at top left, rgba(212, 228, 219, 0.75), transparent 30%),
    radial-gradient(circle at top right, rgba(241, 220, 191, 0.55), transparent 28%),
    linear-gradient(180deg, #f8f4ee 0%, #f4f0ea 44%, #f7f5f1 100%);
  -webkit-font-smoothing: antialiased;
}

/* faint grid overlay */
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 100;
  background-image:
    linear-gradient(rgba(20,35,29,.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20,35,29,.02) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.55), transparent 85%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.55), transparent 85%);
}

h1,h2,h3,h4,h5,h6 {
  font-family: "Iowan Old Style","Palatino Linotype","Book Antiqua",Georgia,serif;
  letter-spacing: -0.02em; font-weight: 700; color: #14231d;
}

a { color: #1d5a4d; text-decoration: none; transition: color 150ms ease; }
a:hover { color: #123a32; }

/* ── Page ────────────────────────────────────────────────────────────────── */
/* Matches learning.js: width min(1180px, 100% - 2rem), padding 2rem 0 4rem */
.page {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

/* ── Card base (exact from Learning.module.css) ──────────────────────────── */
.sectionCard,
.emptyCard,
.errorCard {
  border: 1px solid rgba(20, 35, 29, 0.08);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 18px 46px rgba(20, 35, 29, 0.08);
}

/* Exact from Learning.module.css .sectionCard */
.sectionCard {
  margin-top: 1.25rem;
  padding: 1.35rem;
  border-radius: 30px;
}

/* ── Section header ─────────────────────────────────────────────────────── */
.sectionHeader { margin-bottom: 1.25rem; }

.sectionHeader h1 {
  margin: 0;
  color: #11231c;
  font-size: clamp(1.7rem, 3vw, 2rem);
  line-height: 1.05;
}

.sectionHeader .attribution {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  font-style: italic;
  color: #55655f;
}
.attribution a { color: #1d5a4d; text-decoration: underline; text-underline-offset: 0.15em; }

/* ── Search bar ─────────────────────────────────────────────────────────── */
/* Exact from Learning.module.css .searchWrap */
.searchWrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 1.4rem;
}

.searchIcon {
  position: absolute; left: 1.05rem; color: #6a7a74; pointer-events: none;
}

.searchInput {
  width: 100%;
  min-height: 52px;
  padding: 0.85rem 2.9rem;
  border-radius: 999px;
  border: 1px solid rgba(20, 35, 29, 0.12);
  background: rgba(255, 255, 255, 0.94);
  color: #172a23;
  font-size: 1rem;
  font-family: inherit;
  box-shadow: 0 10px 24px rgba(20, 35, 29, 0.05);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.searchInput::placeholder { color: #8a978f; }
.searchInput::-webkit-search-cancel-button,
.searchInput::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.searchInput:focus { outline: none; border-color: rgba(29,90,77,.4); box-shadow: 0 0 0 4px rgba(29,90,77,.1); }

.searchClear {
  position: absolute; right: 0.9rem;
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border: none; border-radius: 999px;
  background: rgba(20,35,29,.06); color: #47564f; cursor: pointer;
}
.searchClear:hover { background: rgba(20,35,29,.12); }

/* ── Filter rows ────────────────────────────────────────────────────────── */
/* Exact from Learning.module.css .filterRows */
.filterRows { min-width: 0; }

/* Exact from .filterRowsHeading */
.filterRowsHeading {
  display: flex; align-items: center; gap: 0.35rem;
  margin: 0 0 0.4rem;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #48584f;
}

/* Exact from .controlGrid */
.controlGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 0.9rem;
}

/* ── Control label ───────────────────────────────────────────────────────── */
/* Exact from .controlLabel */
.controlLabel {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #48584f;
}

/* Exact from .control */
.control { display: flex; flex-direction: column; gap: 0.45rem; }

/* ── Select ─────────────────────────────────────────────────────────────── */
/* Exact from .selectWrap */
.selectWrap { position: relative; display: flex; align-items: center; }

/* Exact from .select */
.select {
  appearance: none;
  width: 100%;
  min-height: 50px;
  padding: 0.8rem 2.6rem 0.8rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(20,35,29,.12);
  background: rgba(255,255,255,.94);
  color: #172a23;
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(20,35,29,.05);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.select:focus { outline: none; border-color: rgba(29,90,77,.4); box-shadow: 0 0 0 4px rgba(29,90,77,.1); }
.select:disabled { opacity: 0.5; cursor: not-allowed; background: rgba(246,248,246,.7); }

/* Exact from .selectIcon */
.selectIcon { position: absolute; right: 0.9rem; color: #6a7a74; pointer-events: none; }

/* ── Grade pills ────────────────────────────────────────────────────────── */
/* Exact from .gradeOptions */
.gradeOptions {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem;
}

/* Exact from .gradeOption — 58×34 compact pills */
.gradeOption {
  box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.35rem;
  width: 58px; height: 34px;
  padding: 0 0.55rem;
  border: 1px solid rgba(20,35,29,.12);
  border-radius: 999px;
  background: rgba(20,35,29,.035);
  color: #596861;
  font: inherit;
  font-size: 0.85rem; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(20,35,29,.05);
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
.gradeOption:hover { border-color: rgba(29,90,77,.35); }
.gradeOption:focus-visible { outline: none; border-color: rgba(29,90,77,.4); box-shadow: 0 0 0 4px rgba(29,90,77,.1); }

/* Exact from .gradeOptionSelected */
.gradeOptionSelected {
  border-color: #1d5a4d;
  background: #e8f2ee;
  color: #174b40;
  box-shadow: 0 3px 10px rgba(29,90,77,.1);
}

/* Exact from .gradeCheck */
.gradeCheck {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px;
  border: 1.5px solid #9aa69f;
  border-radius: 5px;
  background: #fff; color: #fff;
}
/* Exact from .gradeOptionSelected .gradeCheck */
.gradeOptionSelected .gradeCheck { border-color: #1d5a4d; background: #1d5a4d; }

/* ── Filter actions ─────────────────────────────────────────────────────── */
/* Exact from .filterActions */
.filterActions {
  display: flex; justify-content: flex-start; gap: 0.55rem; margin-bottom: 1.4rem;
}

/* Exact from .filterAction */
.filterAction {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  width: 148px; min-height: 36px;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  font: inherit; font-size: 0.82rem; font-weight: 400;
  cursor: pointer;
  transition: transform 160ms ease, color 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.filterAction:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(29,90,77,.12); }

/* Exact from .clearFilterAction */
.clearFilterAction {
  border: 1px solid rgba(20,35,29,.14); background: rgba(255,255,255,.72); color: #526159;
}
.clearFilterAction:hover { border-color: rgba(20,35,29,.28); background: rgba(255,255,255,.96); color: #1f332b; }

/* Exact from .shareFilterAction */
.shareFilterAction {
  border: 1px solid #1d5a4d; background: #1d5a4d; color: #fff;
  box-shadow: 0 7px 16px rgba(29,90,77,.18);
}
.shareFilterAction:hover:not(:disabled) { transform: translateY(-1px); background: #174b40; box-shadow: 0 9px 20px rgba(29,90,77,.24); }
.shareFilterAction:disabled { border-color: rgba(20,35,29,.1); background: rgba(20,35,29,.07); color: rgba(20,35,29,.38); box-shadow: none; cursor: not-allowed; }

/* ── Results meta ────────────────────────────────────────────────────────── */
/* Exact from .resultsMeta */
.resultsMeta { color: #6a7a74; font-size: 0.85rem; font-weight: 600; margin: 0 0 0.9rem; }

/* ── Empty card ─────────────────────────────────────────────────────────── */
/* Exact from .emptyCard */
.emptyCard {
  margin-top: 1.4rem; padding: 2rem 1.5rem; border-radius: 26px;
  border-style: dashed; border-color: rgba(20,35,29,.14);
  background: rgba(246,248,246,.7);
  text-align: center; color: #55655f; line-height: 1.7;
}
.emptyCard .welcome-icon { font-size: 1.8rem; display: block; margin-bottom: 0.5rem; }
.emptyCard p { font-size: 0.95rem; }

/* ── Error card ─────────────────────────────────────────────────────────── */
.errorCard {
  margin-top: 1rem; padding: 1.25rem; border-radius: 20px;
  background: rgba(239,68,68,.04); border-color: rgba(239,68,68,.2);
}
.errorCard p { font-size: 0.88rem; color: #ef4444; line-height: 1.5; }

/* ── Spinner ────────────────────────────────────────────────────────────── */
.spinner {
  width: 28px; height: 28px;
  border: 2px solid rgba(29,90,77,.1); border-top-color: #1d5a4d;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 0.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── WrappingSelect (exact from Learning.module.css) ─────────────────────── */
.wrappingSelect { position: relative; min-width: 0; }

.wrappingSelectSummary {
  box-sizing: border-box;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  width: 100%; min-height: 50px;
  padding: 0.8rem 0.9rem 0.8rem 1rem;
  border: 1px solid rgba(20,35,29,.12); border-radius: 16px;
  background: rgba(255,255,255,.94); color: #172a23;
  font-size: 0.95rem; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(20,35,29,.05);
  transition: border-color 160ms ease, box-shadow 160ms ease;
  list-style: none;
}
.wrappingSelectSummary::-webkit-details-marker { display: none; }
.wrappingSelectSummary:focus-visible,
.wrappingSelect[open] .wrappingSelectSummary {
  outline: none; border-color: rgba(29,90,77,.4); box-shadow: 0 0 0 4px rgba(29,90,77,.1);
}

.wrappingSelectValue { display: block; flex: 1 1 auto; min-width: 0; }
.wrappingSelectPlaceholder { color: #8a978f; font-weight: 500; }

.wrappingSelectCode {
  display: inline-block; max-width: 100%; margin-right: 0.45rem;
  padding: 0.12rem 0.42rem;
  border: 1px solid rgba(29,90,77,.1); border-radius: 999px;
  background: rgba(29,90,77,.055); color: #60716a;
  font-size: 0.74em; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; vertical-align: baseline;
}
.wrappingSelectLabel { overflow-wrap: anywhere; }

.wrappingSelectIcon { flex: 0 0 auto; color: #6a7a74; transition: transform 160ms ease; }
.wrappingSelect[open] .wrappingSelectIcon { transform: rotate(180deg); }

.wrappingSelectOptions {
  position: absolute; z-index: 50;
  top: calc(100% + 0.4rem); left: 0;
  display: grid; gap: 0.3rem; width: 100%;
  max-height: min(360px, 55vh); padding: 0.35rem; overflow-y: auto;
  border: 1px solid rgba(20,35,29,.12); border-radius: 14px;
  background: #fff; box-shadow: 0 18px 38px rgba(20,35,29,.16);
}

.wrappingSelectOption {
  width: 100%; padding: 0.7rem 0.75rem;
  border: 0; border-radius: 10px; background: transparent; color: #24382f;
  font: inherit; font-size: 0.88rem; line-height: 1.4; overflow-wrap: anywhere;
  text-align: left; white-space: normal; cursor: pointer;
}
.wrappingSelectOption:hover,
.wrappingSelectOption:focus-visible { outline: none; background: rgba(29,90,77,.08); }
.wrappingSelectOptionSelected { background: #e8f2ee; color: #174b40; }

/* ── Collapsed filter row (exact from Learning.module.css) ───────────────── */
.collapsedFilterRow {
  display: flex; align-items: center; justify-content: space-between; gap: 0.55rem;
  width: min(100%, 360px); min-height: 34px;
  margin-bottom: 0.65rem; padding: 0.4rem 0.65rem;
  border: 1px solid rgba(20,35,29,.07); border-radius: 10px;
  background: rgba(247,249,247,.55); color: #7a8781;
  font: inherit; font-size: 0.74rem; font-weight: 500; text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}
.collapsedFilterRow:hover { border-color: rgba(29,90,77,.18); background: rgba(247,250,248,.9); color: #52645d; }
.collapsedFilterRow > span { min-width: 0; overflow-wrap: anywhere; }
.collapsedFilterRow:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(29,90,77,.1); }

/* ── Results divider + heading (exact) ──────────────────────────────────── */
.standardResultsDivider { height: 1px; margin: 1.9rem 0 0; border: 0; background: rgba(20,35,29,.11); }

.standardResultsHeading { margin: 0.9rem 0 0; color: #24382f; font-size: 1.15rem; line-height: 1.25; }
.standardResultsHeading + .standardCard { margin-top: 0.75rem; }

/* ── Standard card (exact from Learning.module.css) ─────────────────────── */
.standardCard {
  margin-top: 1.25rem; padding: 1.5rem; border-radius: 26px;
  border: 1px solid rgba(20,35,29,.08);
  background: linear-gradient(180deg, rgba(248,245,241,.86), rgba(245,247,245,.92));
  box-shadow: 0 18px 46px rgba(20,35,29,.06);
}
.standardCardDirect { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }

/* ── Standard list ──────────────────────────────────────────────────────── */
.standardList { display: grid; gap: 1rem; margin-top: 1.1rem; }

/* ── Standard item (exact from Learning.module.css) ─────────────────────── */
.standardItem {
  position: relative;
  display: grid; grid-template-columns: minmax(0,1fr);
  gap: 0.75rem; align-items: start; width: 100%;
  padding: 1rem 1.1rem; border-radius: 20px;
  background: rgba(255,255,255,.7); border: 1px solid rgba(20,35,29,.08);
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}
.standardItem:hover { transform: translateY(-1px); border-color: rgba(29,90,77,.24); background: rgba(233,241,235,.85); }
.standardItem:focus-within { outline: 2px solid #c88f3d; outline-offset: 2px; }

.standardItemHitTarget {
  position: absolute; z-index: 1; inset: 0; width: 100%;
  padding: 0; border: 0; border-radius: inherit; background: transparent; cursor: pointer;
}

.standardItemContent { display: flow-root; min-width: 0; }

/* Exact from .standardItemCode */
.standardItemCode {
  position: relative; z-index: 2;
  float: left; width: fit-content; max-width: 100%;
  margin: 0.24rem 0.5rem 0 0;
  padding: 0.14rem 0.48rem;
  border: 1px solid rgba(29,90,77,.1); border-radius: 999px;
  background: rgba(29,90,77,.055); color: #60716a;
  font-size: 0.74rem; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere;
}

/* Exact from .standardText */
.standardText { padding-top: 0.1rem; color: #1b2c25; font-size: 1rem; line-height: 1.7; }
.standardText p { margin: 0; }
.standardText p + p, .standardText p + ul, .standardText p + ol,
.standardText ul + p, .standardText ol + p { margin-top: 0.65rem; }
.standardText ul, .standardText ol { margin: 0.45rem 0 0; padding-left: 1.35rem; }
.standardText a { position: relative; z-index: 2; color: #1d5a4d; text-decoration-thickness: 1px; text-underline-offset: 0.15em; }

/* ── Learning components (Skills) ───────────────────────────────────────── */
.standardLc { position: relative; z-index: 2; font-size: 0.85rem; color: #52645d; }
.standardLcSummary { width: fit-content; cursor: pointer; font-weight: 600; color: #1d5a4d; list-style: none; }
.standardLcSummary::-webkit-details-marker { display: none; }
.standardLcSummary:hover { color: #14453a; }
.standardLcList { margin: 0.6rem 0 0; padding-left: 1.2rem; display: grid; gap: 0.4rem; }
.standardLcItem { line-height: 1.55; }
.standardPathGroups { display: grid; gap: 1.35rem; margin-top: 1rem; }
.standardPathGroup { display: grid; gap: 0.75rem; }
.standardPathHeading {
  margin: 0; color: #52645d;
  font-family: inherit; font-size: 0.82rem; font-weight: 650;
  letter-spacing: 0; line-height: 1.55;
}
.standardPathSeparator { color: rgba(20,35,29,.32); }
.standardPathSegment { overflow-wrap: anywhere; }
.flatStandardsGroups { display: grid; gap: 1rem; }

/* ── Breadcrumb ─────────────────────────────────────────────────────────── */
/* Exact from .breadcrumb */
.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem;
  color: #6a7a74; font-size: 0.82rem; font-weight: 600;
}
.breadcrumb .sep { color: rgba(20,35,29,.28); }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.siteFooter { padding: 1.5rem 1rem 2rem; text-align: center; }
.footerText { color: #51615b; font-size: 0.85rem; line-height: 1.6; }
.footerLink { color: #51615b; text-decoration: underline; text-underline-offset: 0.15em; font-weight: 500; font-size: 0.85rem; transition: color 0.18s ease; }
.footerLink:hover { color: #1d5a4d; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .controlGrid { grid-template-columns: 1fr; }
  .filterActions { flex-wrap: wrap; }
  .sectionCard { padding: 1rem; }
}
