/* =========================================================
   ABZ Learning — CVC Hub Styles
   Modern, vibrant, accessible. Works with existing markup.
   ========================================================= */

/* ====== Design Tokens ====== */
:root{
  /* Surfaces */
  --bg:            #0d1117;           /* deep navy */
  --surface:       #111827;           /* dark section */
  --card:          #ffffff;           /* light cards for contrast */
  --cardText:      #0f172a;
  --line:          rgba(15, 23, 42, .08);

  /* Text */
  --text:          #e5e7eb;
  --muted:         #9ca3af;

  /* Brand */
  --brand:         #7c3aed;           /* primary */
  --brand-600:     #6d28d9;
  --brand-300:     #bca7ff;
  --pill-bg:       #f3f0ff;

  /* Accents */
  --ok:            #16a34a;
  --warn:          #f59e0b;
  --danger:        #ef4444;

  /* Radii */
  --r-lg:          20px;
  --r-md:          14px;
  --r-sm:          10px;

  /* Spacing */
  --s-1: 8px;
  --s-2: 12px;
  --s-3: 16px;
  --s-4: 24px;
  --s-5: 32px;
  --s-6: 48px;
  --s-7: 64px;

  /* Shadows */
  --sh-1: 0 8px 24px rgba(0,0,0,.18);
  --sh-2: 0 14px 42px rgba(0,0,0,.25);
  --glass: 0 8px 30px rgba(0,0,0,.25);

  /* Fluid type scale */
  --step--1: clamp(14px, .9vw, 16px);
  --step-0:  clamp(16px, 1.05vw, 18px);
  --step-1:  clamp(20px, 1.6vw, 24px);
  --step-2:  clamp(26px, 2.3vw, 34px);
  --step-3:  clamp(34px, 3.6vw, 52px);
}

*{ box-sizing: border-box; }
html,body{ margin:0; padding:0; }
body{
  font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: var(--step-0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.hide{ display:none !important; }

/* ===== Utilities ===== */
.container{ max-width: 1120px; margin: 0 auto; padding: 0 var(--s-4); }
.muted{ color: var(--muted); }
.sr-only{ position:absolute!important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0 }

/* ===== Hero ===== */
.hero{
  /* vibrant, soft gradient */
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 55%, #ef4444 100%);
  color: #fff;
  padding: var(--s-7) 0 var(--s-6);
  position: relative;
  overflow: clip;
}
.hero::after{
  /* subtle grain/flares */
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(1000px 600px at 80% -10%, rgba(255,255,255,.18), transparent 60%),
    radial-gradient(800px 500px at -10% 110%, rgba(255,255,255,.12), transparent 70%);
  pointer-events: none;
}
.hero__inner{ max-width: 1120px; position: relative; z-index: 1; }
.eyebrow{ opacity:.92; letter-spacing:.06em; text-transform:uppercase; font-weight:700; margin-bottom: var(--s-3); }
.hero__title{
  margin: 0 0 var(--s-3);
  font-size: var(--step-3);
  line-height: 1.05;
  letter-spacing: -.01em;
  text-wrap: balance;
}
.hero__sub{ max-width: 62ch; opacity:.96; margin:0 0 var(--s-3); }
.hero__bullets{
  display:flex; gap: var(--s-3); flex-wrap: wrap; list-style:none; padding:0; margin: 0 0 var(--s-4);
}
.hero__bullets li{
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.25);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}
.hero__cta{ display:flex; gap: var(--s-3); flex-wrap: wrap; margin: 0 0 var(--s-2); }
.cta-notes small{ opacity:.95; margin-right: var(--s-4); }

/* Quick check starter — frosted panel */
.qc-starter{
  margin-top: var(--s-5);
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: var(--r-lg);
  padding: var(--s-3);
  display:flex; justify-content:space-between; align-items:center; gap: var(--s-3);
  backdrop-filter: blur(8px) saturate(140%);
  box-shadow: var(--glass);
}
.qc-starter__left{ display:flex; align-items:center; gap: var(--s-3); }
.qc-starter__title{ font-weight:800; margin:0; }
.qc-starter__right{ display:flex; align-items:center; gap: var(--s-2); flex-wrap:wrap }
.qc-note{ opacity:.95 }
.time-badge{
  display:inline-flex; align-items:center; justify-content:center;
  background: rgba(0,0,0,.35);
  color:#fff; border-radius: 999px; padding: 4px 10px; font-weight:800; font-size: 12px;
}

/* ===== Buttons & Selects ===== */
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  font-weight:800; border-radius: 999px; padding: 12px 18px;
  text-decoration:none; cursor:pointer; border:2px solid transparent;
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
}
.btn:active{ transform: translateY(1px); }
.btn--primary{
  background:#fff; color:#0b1220; border-color: rgba(0,0,0,.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 6px 18px rgba(0,0,0,.18);
}
.btn--primary:hover{ filter:brightness(.97); }
.btn--secondary{ background: var(--brand); color:#fff; }
.btn--secondary:hover{ background: var(--brand-600); }
.btn--ghost{ background: transparent; color:#fff; border-color: rgba(255,255,255,.6); }
.btn--ghost:hover{ background: rgba(255,255,255,.13); }
.btn--mini{ padding:6px 10px; font-size: 12px; border-radius:10px; background: var(--surface); color:#fff; border:1px solid rgba(255,255,255,.12); }
.btn--sm{ padding:8px 12px; }
.btn--lg{ padding:12px 16px; border-radius:12px; }

.select{
  background: #fff; color:#111; border:1px solid #e5e7eb; border-radius: 12px; padding: 10px 12px; min-width: 140px;
}
.select--sm{ padding: 8px 10px; min-width:120px; }

/* ===== Sticky tabs ===== */
.page-tabs{
  position:sticky; top:0; z-index:50;
  backdrop-filter:saturate(140%) blur(10px);
  background: color-mix(in oklab, var(--bg) 75%, transparent);
  border-bottom:1px solid rgba(255,255,255,.06);
  box-shadow: 0 8px 12px rgba(0,0,0,.25);
}
.page-tabs .container{ display:flex; gap: 6px; overflow:auto; padding: 10px var(--s-4); }
.page-tab{
  color:#e5e7eb; text-decoration:none; padding:10px 12px; border-radius:999px; border:1px solid transparent;
  white-space: nowrap; font-weight:700;
}
.page-tab.is-active, .page-tab:focus-visible{
  outline:none; border-color: rgba(255,255,255,.25);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .45);
}
.page-tab:hover{ background: rgba(255,255,255,.06); }

/* ===== Breadcrumb ===== */
.breadcrumb{ display:flex; align-items:center; gap:8px; color: var(--muted); padding-top: var(--s-4); }
.breadcrumb a{ color:#cbd5e1; text-decoration:none; }
.breadcrumb a:hover{ text-decoration:underline; }

/* ===== Sections ===== */
.section{ padding: var(--s-7) 0 var(--s-6); }
.section--alt{ background: var(--surface); }
.section__head{ margin-bottom: var(--s-5); }
.section__title{ font-size: var(--step-2); margin:0 0 8px; }
.section__title--xl{ font-size: clamp(28px, 2.6vw, 40px); }
.section__sub{ margin:0; color: var(--muted); max-width: 70ch; }

/* ===== Cards ===== */
.card-grid{
  --cols: 3;
  display:grid; grid-template-columns: repeat(var(--cols), 1fr);
  gap: var(--s-4);
}
@media (max-width: 980px){ .card-grid{ --cols: 2; } }
@media (max-width: 640px){ .card-grid{ --cols: 1; } }

.card{
  display:flex; flex-direction:column;
  background: var(--card); color: var(--cardText);
  border-radius: var(--r-lg); overflow:hidden; box-shadow: var(--sh-1);
  border: 1px solid var(--line);
}
.card__media{ background:#f8fafc; }
.card__media img{
  display:block; width:100%; height:auto; aspect-ratio: 16/9; object-fit: cover;
}
.card__media--ratio{ position: relative; aspect-ratio: 16/9; overflow: hidden; }
.card__media--ratio img{ width:100%; height:100%; object-fit:cover; display:block; }
.card__flag{
  position:absolute; left:10px; top:10px;
  background:linear-gradient(90deg, var(--brand), #9f67ff);
  color:#fff; font-size:12px; font-weight:800;
  padding:4px 10px; border-radius:999px; box-shadow:0 2px 8px rgba(0,0,0,.2);
}

.card__body{ padding: var(--s-4) var(--s-4) 0; }
.card__title{ font-size: 20px; line-height:1.25; margin:0 0 6px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient: vertical; overflow:hidden; }
.card__subtitle{ margin:0 0 var(--s-2); color:#334155; }
.chips{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom: var(--s-4);}
.chip{ background: var(--pill-bg); color:#2b1b68; padding:6px 10px; border-radius:999px; font-weight:800; font-size:12px; }

.card__actions{ padding: 0 var(--s-4) var(--s-4); display:flex; gap:10px; flex-wrap:wrap; }
.card__actions--dec .btn--outline{
  background:transparent; border:2px solid rgba(0,0,0,.12); color:inherit;
}
.card__actions .btn--primary{
  background: var(--brand); border: 2px solid var(--brand); color: #fff;
}
.card__actions .btn--primary:hover{ filter: brightness(1.05); transform: translateY(-1px); }
.card__actions .btn--outline:hover{ background: rgba(0,0,0,.04); }
@media (prefers-color-scheme: dark){
  .card__actions .btn--outline{ border-color: rgba(255,255,255,.24); }
  .card__actions .btn--outline:hover{ background: rgba(255,255,255,.06); }
}

/* ===== Tiles (mini-lessons & checks) ===== */
.tiles{ display:grid; grid-template-columns: repeat(12, 1fr); gap: var(--s-4); }
.tiles .tile{
  grid-column: span 4; background: var(--card); color: var(--cardText);
  border-radius: var(--r-md); padding: var(--s-4); box-shadow: var(--sh-1);
  border: 1px solid var(--line);
}
.tiles .tile h3{ margin-top:0; }
.tiles .tile .tip{ margin-top:10px; background:#f1f5f9; padding:10px 12px; border-radius: 12px; color:#0f172a; }
.tiles .pill-list{ display:flex; flex-wrap:wrap; gap:8px; }
.tiles .pill{ background:#e5e7eb; color:#111; padding:6px 10px; border-radius:999px; font-weight:700; }
@media (max-width: 980px){ .tiles .tile{ grid-column: span 12; } }
.tiles--three .tile{ grid-column: span 4; }

/* ===== Accordions & Word Lists (copy-only) ===== */
.accordion h3{ margin: 16px 0 0; }
.acc{
  width:100%; text-align:left; background: #0f172a; color:#fff;
  border: 1px solid rgba(255,255,255,.1);
  padding: 14px 16px; border-radius: 12px; font-weight:800; cursor:pointer;
}
.acc:focus-visible{ outline:none; box-shadow: 0 0 0 3px rgba(124, 58, 237, .45); }
.accordion [role="region"]{
  padding: 14px 16px; border-inline: 1px solid rgba(255,255,255,.1);
  border-bottom: 1px solid rgba(255,255,255,.1); border-radius: 0 0 12px 12px;
  background: #0b1220; margin-bottom: 12px;
}
.list-row{
  display:flex; justify-content:space-between; gap: var(--s-3); align-items:flex-start;
  padding:8px 0; border-bottom: 1px dashed rgba(255,255,255,.08);
}
.list-row:last-child{ border-bottom:none; }
.words{ margin:0; }
.row-actions{ display:flex; gap: 8px; flex-wrap:wrap; }

/* ===== Filters (vowel/grade) ===== */
.filters{ display:flex; gap:10px; flex-wrap:wrap; margin-bottom: 12px; }
.chip--filter{
  background:#1f2937; color:#e5e7eb; border:1px solid rgba(255,255,255,.12);
  cursor:pointer; padding:8px 14px; border-radius:999px; font-weight:800;
}
.chip--filter.is-active, .chip--filter:hover{
  outline:none; box-shadow: 0 0 0 2px var(--brand-300) inset;
}

/* ===== Resource lists & helpers ===== */
.resource-list{ margin-top: var(--s-5); }
.resource-list h3{ margin: 0 0 var(--s-2); }
.resource-list ul{ margin:0; padding-left: 18px; }
.resource-list li{ margin: 6px 0; color:#d1d5db; }
.resource-list a{ color:#c4b5fd; text-decoration:underline; }
.resource-list a:hover{ color:#fff; }

.tip-block{
  margin: var(--s-4) 0 var(--s-2);
  background: #0b1220;
  border: 1px dashed rgba(255,255,255,.14);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  color:#cbd5e1;
}

.text-links ul{ margin: var(--s-4) 0 0; padding-left: 18px; }
.text-links a{ color:#c4b5fd; text-decoration:underline; }

/* ===== Loading & Empty states ===== */
.loading{ display:flex; align-items:center; gap:10px; color:#cbd5e1; }
.spinner{
  width:18px; height:18px; border-radius:50%;
  border:3px solid rgba(255,255,255,.25);
  border-top-color:#fff;
  animation: spin 1s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg); } }
.empty-state{
  background:#0b1220; border:1px dashed rgba(255,255,255,.12);
  padding: var(--s-4); border-radius: var(--r-md); color:#cbd5e1;
}

/* ===== Footer ===== */
.site-footer{
  background:#0b0f16; border-top: 1px solid rgba(255,255,255,.06);
  padding: var(--s-5) 0;
}
.site-footer__inner{ display:flex; gap: var(--s-4); align-items:center; justify-content:space-between; flex-wrap:wrap; }
.trust{ display:flex; align-items:center; gap: 12px; }
.stars{ color:#fde047; }
.badges .badge{
  background:#111827; border:1px solid rgba(255,255,255,.12);
  border-radius:999px; padding:6px 10px; font-size:12px; margin-left:8px;
}
.foot-links a{ color:#cbd5e1; text-decoration:none; margin-right: 14px; }
.foot-links a:hover{ text-decoration:underline; }
.copyright{ color:#94a3b8; margin:0; }

/* ===== Focus visibility ===== */
a:focus-visible, button:focus-visible, select:focus-visible{
  outline: 3px solid rgba(124, 58, 237, .6);
  outline-offset: 2px;
  border-radius: 10px;
}

/* ===== Motion polish ===== */
@media (prefers-reduced-motion: no-preference){
  .card{ transition: transform .15s ease, box-shadow .15s ease; }
  .card:hover{ transform: translateY(-2px); box-shadow: var(--sh-2); }
}


/* =========================================================
   RESPONSIVE MEDIA QUERIES — 1200px and under
   Order: 1200 → 1024 → 900 → 768 → 640 → 480 → 360
   (mobile-first overrides cascade downward)
   ========================================================= */

/* ---------- ≤1200px (Large tablets / small laptops) ---------- */
@media (max-width: 1200px) {
  .container { max-width: 1040px; padding-inline: var(--s-4); }

  /* Typographic tuning */
  :root{
    --step-3: clamp(32px, 3.2vw, 48px);
    --step-2: clamp(24px, 2.1vw, 32px);
    --step-1: clamp(18px, 1.5vw, 22px);
  }

  .hero { padding: var(--s-6) 0 var(--s-5); }
  .hero__title { margin-bottom: var(--s-3); }
  .hero__sub { max-width: 70ch; }

  .card-grid{ --cols: 3; }
  .tiles .tile { padding: var(--s-4); }

  .page-tabs .container { padding-block: 8px; }
  .breadcrumb { padding-top: var(--s-3); }

  .qc-starter { gap: var(--s-3); }
  .qc-starter__right { gap: var(--s-2); }
}

/* ---------- ≤1024px (iPad landscape / narrow laptops) ---------- */
@media (max-width: 1024px) {
  .container { max-width: 960px; }

  /* Slightly reduce global font size for density */
  body { font-size: clamp(15px, 0.98vw, 17px); }

  .hero__bullets { gap: var(--s-2); }
  .hero__bullets li { padding: 6px 10px; }

  .btn { padding: 10px 16px; }
  .btn--lg { padding: 10px 14px; }
  .select { padding: 8px 10px; }

  /* Cards: tighter spacing */
  .card__body { padding: var(--s-3) var(--s-3) 0; }
  .card__actions { padding: 0 var(--s-3) var(--s-3); }

  /* Tiles: keep three across if space allows */
  .tiles { gap: var(--s-3); }
  .tiles .tile { padding: var(--s-3); }

  .filters { gap: 8px; }
  .chip--filter { padding: 8px 12px; }
}

/* ---------- ≤900px (iPad portrait / large phones) ---------- */
@media (max-width: 900px) {
  .container { max-width: 820px; }

  :root{
    --step-3: clamp(30px, 4.2vw, 44px);
    --step-2: clamp(22px, 2.6vw, 30px);
  }

  .hero { padding: var(--s-6) 0 var(--s-5); }
  .hero__sub { margin-bottom: var(--s-3); }
  .hero__cta { gap: var(--s-2); }

  /* Grids: shift to 2 columns earlier for breathing room */
  .card-grid{ --cols: 2; gap: var(--s-3); }

  /* Sticky tabs: taller hit area, more scroll affordance */
  .page-tabs .container { gap: 8px; padding: 8px var(--s-4); }
  .page-tab { padding: 10px 12px; }

  /* Quick check starter stacks at this width */
  .qc-starter {
    flex-direction: column;
    align-items: stretch;
    gap: var(--s-3);
  }
  .qc-starter__left { justify-content: space-between; }
  .qc-starter__right { justify-content: flex-start; }
}

/* ---------- ≤768px (Common tablet portrait) ---------- */
@media (max-width: 768px) {
  .container { max-width: 680px; padding-inline: var(--s-3); }

  body { font-size: clamp(15px, 1.8vw, 16px); }

  .section { padding: var(--s-6) 0 var(--s-5); }
  .section__head { margin-bottom: var(--s-4); }
  .section__title { font-size: clamp(20px, 2.8vw, 24px); }
  .section__title--xl { font-size: clamp(24px, 3.6vw, 32px); }

  .hero { padding: var(--s-5) 0 var(--s-5); }
  .eyebrow { margin-bottom: var(--s-2); }
  .hero__title { margin-bottom: var(--s-2); }
  .hero__bullets { margin-bottom: var(--s-3); }
  .hero__bullets li { font-size: 12px; padding: 6px 10px; }

  /* Buttons: smaller pills */
  .btn { padding: 9px 14px; border-width: 2px; }
  .btn--sm { padding: 7px 10px; }
  .btn--mini { padding: 5px 8px; font-size: 11px; }

  /* Card media ratio: keep 16:9, reduce shadows */
  .card { box-shadow: var(--sh-1); }
  .card__title { font-size: 18px; }
  .card__subtitle { font-size: 13px; }

  /* Tiles collapse to two per row */
  .tiles { gap: var(--s-3); grid-template-columns: repeat(12, 1fr); }
  .tiles .tile { grid-column: span 6; }
  .tiles--three .tile { grid-column: span 6; }

  /* Lists & accordions: tighter padding */
  .acc { padding: 12px 14px; }
  .accordion [role="region"] { padding: 12px 14px; }
  .list-row { gap: var(--s-2); }

  .filters { margin-bottom: 10px; }
  .chip--filter { padding: 8px 12px; font-size: 13px; }

  .resource-list ul { padding-left: 16px; }
  .resource-list li { margin: 4px 0; }

  .tip-block { padding: var(--s-3); }

  .site-footer__inner { gap: var(--s-3); }
  .foot-links a { margin-right: 12px; }
}

/* ---------- ≤640px (Large phones / small tablets) ---------- */
@media (max-width: 640px) {
  .container { max-width: 560px; padding-inline: var(--s-3); }

  :root{
    --step-3: clamp(26px, 6vw, 36px);
    --step-2: clamp(20px, 4.2vw, 26px);
    --step-1: clamp(16px, 3.2vw, 20px);
  }

  .hero { padding: var(--s-5) 0 var(--s-4); }
  .hero__sub { margin-bottom: var(--s-2); }

  /* One-column cards on small screens */
  .card-grid{ --cols: 1; gap: var(--s-3); }

  /* Buttons become full-width when grouped */
  .card__actions { gap: 8px; }
  .card__actions .btn { flex: 1 1 160px; }

  /* Tiles: single column */
  .tiles .tile { grid-column: span 12; }

  .breadcrumb { gap: 6px; font-size: 13px; }

  .page-tab { padding: 8px 10px; font-size: 13px; }
  .page-tabs .container { padding-inline: var(--s-3); }

  .filters { gap: 6px; }
  .chip--filter { padding: 7px 10px; font-size: 12px; }

  .empty-state, .loading { padding: var(--s-3); }
}

/* ---------- ≤480px (Most phones) ---------- */
@media (max-width: 480px) {
  .container { max-width: 440px; padding-inline: var(--s-2); }

  body { font-size: clamp(14px, 3.6vw, 15px); }

  .hero { padding: var(--s-4) 0 var(--s-4); }
  .hero__bullets { gap: 6px; }
  .hero__bullets li { padding: 5px 9px; font-weight: 700; }
  .hero__cta { flex-direction: column; align-items: stretch; }
  .btn, .select { width: 100%; }

  .qc-starter { padding: var(--s-3); }
  .time-badge { padding: 3px 8px; font-size: 11px; }

  .card { border-radius: var(--r-md); }
  .card__media img { aspect-ratio: 16/9; }
  .card__title { font-size: 17px; }
  .chips { gap: 6px; margin-bottom: var(--s-3); }
  .chip { padding: 5px 8px; font-size: 11px; }

  .acc { padding: 12px; }
  .accordion [role="region"] { padding: 12px; }

  .list-row { flex-direction: column; gap: 6px; }
  .row-actions { justify-content: flex-start; }

  .site-footer__inner { flex-direction: column; align-items: flex-start; gap: var(--s-3); }
  .foot-links a { display: inline-block; margin: 6px 12px 0 0; }
}

/* ---------- ≤360px (Compact phones) ---------- */
@media (max-width: 360px) {
  .container { padding-inline: var(--s-2); }

  :root{
    --step-3: clamp(22px, 7.5vw, 30px);
    --step-2: clamp(18px, 5.4vw, 22px);
    --step-1: clamp(15px, 4.4vw, 18px);
  }

  .hero__bullets li { padding: 4px 8px; font-size: 10.5px; }
  .btn--mini { padding: 4px 7px; font-size: 10px; border-radius: 8px; }
  .chip { padding: 4px 7px; font-size: 10.5px; }

  .page-tab { padding: 7px 9px; font-size: 12px; }
  .filters { gap: 5px; }
  .chip--filter { padding: 6px 9px; font-size: 11px; }

  .breadcrumb { font-size: 12px; }
}
