/* ============================================================
   AP & GPA Success Hub — section styles (namespace: ap-)
   Design tokens per AP_GPA_HUB_PLAN.md §4: ink #14264C, pencil
   #F5B91E, paper #FBFAF6, graphite #3C4356, rule #E4E1D6,
   link blue #2E5AAC. Fraunces 650 display / Public Sans body.
   Mobile-first. Sidebar is hub-scoped only.
   ============================================================ */

:root {
  --ap-ink: #14264C;
  --ap-pencil: #F5B91E;
  --ap-paper: #FBFAF6;
  --ap-graphite: #3C4356;
  --ap-rule: #E4E1D6;
  --ap-blue: #2E5AAC;
}

/* ---------- skip link ---------- */
.ap-skip {
  position: absolute; left: -9999px; top: 0; z-index: 2000;
  background: var(--ap-pencil); color: var(--ap-ink);
  padding: 10px 18px; font-weight: 700; border-radius: 0 0 8px 0;
}
.ap-skip:focus { left: 0; }

/* ---------- page scaffold ---------- */
.ap-page { background: var(--ap-paper); color: var(--ap-graphite);
  font-family: 'Public Sans', system-ui, sans-serif; line-height: 1.65; }
.ap-page * { box-sizing: border-box; }

/* ---------- hero ---------- */
.ap-hero { background: var(--ap-ink); color: #fff; padding: 48px 20px 56px; position: relative; overflow: hidden; }
.ap-hero::after { /* scantron bubble column, sparingly, right edge */
  content: ""; position: absolute; right: -30px; top: 0; bottom: 0; width: 180px;
  background-image: radial-gradient(circle 10px, transparent 8px, rgba(245,185,30,.14) 9px, transparent 11px);
  background-size: 52px 52px; pointer-events: none;
}
.ap-hero-wrap { max-width: 1200px; margin: 0 auto; position: relative; }
.ap-eyebrow { display: inline-block; font-size: .78rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ap-pencil); margin: 0 0 14px; }
.ap-hero h1 { font-family: 'Fraunces', Georgia, serif; font-weight: 650;
  font-size: clamp(1.85rem, 4.5vw, 2.9rem); line-height: 1.14; margin: 0; color: #fff; max-width: 20em; }
.ap-hero-lead { margin: 18px 0 0; max-width: 42em; color: #D9DEEA; font-size: 1.05rem; }

/* ---------- shell: sidebar + main ---------- */
.ap-shell { max-width: 1200px; margin: 0 auto; padding: 0 20px 64px; }
.ap-main { min-width: 0; padding-top: 32px; }

/* ---------- sidebar (mobile-first: sticky accordion bar) ---------- */
.ap-sidebar { position: sticky; top: 64px; /* below sticky site header (64px mobile) */
  z-index: 30; margin: 0 -20px; background: var(--ap-paper);
  border-bottom: 1px solid var(--ap-rule); }
.ap-sidenav-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 13px 20px; background: var(--ap-paper); color: var(--ap-ink);
  border: none; border-top: 1px solid var(--ap-rule); font: 700 .95rem 'Public Sans', sans-serif;
  cursor: pointer;
}
.ap-sidenav-toggle .ap-caret { transition: transform 150ms ease; }
.ap-sidenav-toggle[aria-expanded="true"] .ap-caret { transform: rotate(180deg); }
.ap-sidenav { overflow: hidden; max-height: 0; transition: max-height 220ms ease; }
.ap-sidenav.ap-open { max-height: 1200px; overflow-y: auto; }
.ap-sidenav-inner { padding: 4px 20px 18px; }

.ap-side-group { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: var(--ap-graphite); opacity: .75;
  margin: 18px 0 6px; }
.ap-inline-link { color: var(--ap-blue); text-decoration: underline; text-underline-offset: 2px; }
.ap-side-link { display: flex; align-items: center; gap: 10px;
  padding: 7px 8px; border-radius: 8px; text-decoration: none;
  color: var(--ap-graphite); font-size: .93rem; font-weight: 500; }
a.ap-side-link:hover { background: rgba(20,38,76,.06); color: var(--ap-ink); }
a.ap-side-link:focus-visible { outline: 3px solid var(--ap-pencil); outline-offset: 1px; }
.ap-side-link.ap-active { color: var(--ap-ink); font-weight: 700; }
.ap-side-link.ap-soon { color: var(--ap-graphite); opacity: .55; cursor: default; }
.ap-side-link.ap-soon em { font-style: normal; font-size: .68rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; background: var(--ap-rule);
  border-radius: 4px; padding: 1px 6px; margin-left: auto; }

/* scantron bubble */
.ap-bubble { flex: none; width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid currentColor; opacity: .55; }
.ap-active .ap-bubble { background: var(--ap-pencil); border-color: var(--ap-ink); opacity: 1; }

/* ---------- desktop ≥1024px: persistent left sidebar ---------- */
@media (min-width: 1024px) {
  .ap-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 44px; }
  .ap-sidebar { position: static; margin: 0; border-bottom: none; background: transparent; z-index: auto; }
  .ap-sidenav-toggle { display: none; }
  .ap-sidenav { max-height: none; overflow: visible; position: sticky; top: 96px; /* header (~72px) + breathing room */
    padding: 24px 0 32px; }
  .ap-sidenav-inner { padding: 0 8px 0 0; border-right: 1px solid var(--ap-rule); }
  .ap-main { padding-top: 40px; }
}

/* ---------- headings & prose ---------- */
.ap-main h2 { font-family: 'Fraunces', Georgia, serif; font-weight: 650;
  color: var(--ap-ink); font-size: clamp(1.35rem, 2.6vw, 1.8rem); line-height: 1.22; margin: 0 0 10px; }
.ap-main .ap-intro { max-width: 46em; margin: 0 0 26px; font-size: 1.02rem; }
.ap-section { margin-bottom: 44px; }

/* ---------- entry cards ---------- */
.ap-cards { display: grid; gap: 18px; }
@media (min-width: 700px) { .ap-cards { grid-template-columns: repeat(3, 1fr); } }
.ap-card { background: #fff; border: 1px solid var(--ap-rule); border-left: 5px solid var(--ap-pencil);
  border-radius: 12px; padding: 22px; }
.ap-card h3 { font-family: 'Fraunces', Georgia, serif; font-weight: 650;
  color: var(--ap-ink); font-size: 1.12rem; margin: 0 0 8px; }
.ap-card p { font-size: .93rem; margin: 0 0 12px; }
.ap-card ul { list-style: none; margin: 0; padding: 0; }
.ap-card li { display: flex; align-items: baseline; gap: 8px; padding: 5px 0;
  font-size: .9rem; border-top: 1px dashed var(--ap-rule); }
.ap-card li .ap-bubble { width: 10px; height: 10px; transform: translateY(1px); }
.ap-card li em { font-style: normal; font-size: .66rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; background: var(--ap-rule); border-radius: 4px;
  padding: 1px 6px; margin-left: auto; }

/* ---------- featured calculator strip ---------- */
.ap-feature { background: var(--ap-ink); color: #fff; border-radius: 14px;
  padding: 26px 26px 24px; display: flex; flex-wrap: wrap; gap: 18px;
  align-items: center; justify-content: space-between; }
.ap-feature h3 { font-family: 'Fraunces', Georgia, serif; font-weight: 650;
  font-size: 1.25rem; margin: 0 0 6px; color: var(--ap-pencil); }
.ap-feature p { margin: 0; color: #D9DEEA; font-size: .95rem; max-width: 34em; }
.ap-feature .ap-soon-chip { font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; background: rgba(245,185,30,.18); color: var(--ap-pencil);
  border: 1px solid rgba(245,185,30,.5); border-radius: 999px; padding: 7px 16px; }

/* ---------- soft CTA block (isolated component per plan A2) ---------- */
.ap-cta { background: #fff; border: 1px solid var(--ap-rule); border-radius: 14px;
  padding: 26px; }
.ap-cta h3 { font-family: 'Fraunces', Georgia, serif; font-weight: 650;
  color: var(--ap-ink); font-size: 1.2rem; margin: 0 0 8px; }
.ap-cta p { margin: 0 0 14px; max-width: 46em; }
.ap-cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.ap-cta-link { display: inline-block; text-decoration: none; font-weight: 700;
  padding: 11px 20px; border-radius: 8px; }
.ap-cta-link.ap-primary { background: var(--ap-pencil); color: var(--ap-ink); }
.ap-cta-link.ap-quiet { border: 2px solid var(--ap-ink); color: var(--ap-ink); }
.ap-cta-link:focus-visible { outline: 3px solid var(--ap-pencil); outline-offset: 2px; }
.ap-cta-meta { font-size: .9rem; color: var(--ap-graphite); }
.ap-cta-meta a { color: var(--ap-blue); }

/* ---------- article pages ---------- */
.ap-article-head { padding: 40px 0 6px; }
.ap-article-head .ap-eyebrow { color: var(--ap-blue); }
.ap-article-head h1 { font-family: 'Fraunces', Georgia, serif; font-weight: 650;
  color: var(--ap-ink); font-size: clamp(1.7rem, 3.6vw, 2.5rem); line-height: 1.16;
  margin: 0 0 10px; max-width: 22em; }
.ap-updated { font-size: .85rem; color: var(--ap-graphite); opacity: .75; margin: 0 0 8px; }
.ap-article { max-width: 46em; }
.ap-article h2 { margin-top: 36px; }
.ap-article h3 { font-family: 'Fraunces', Georgia, serif; font-weight: 650;
  color: var(--ap-ink); font-size: 1.15rem; margin: 26px 0 8px; }
.ap-article p { margin: 0 0 16px; }
.ap-article ul, .ap-article ol { margin: 0 0 16px; padding-left: 22px; }
.ap-article li { margin-bottom: 8px; }
.ap-article strong { color: var(--ap-ink); }

/* callout */
.ap-callout { border-left: 4px solid var(--ap-pencil); background: rgba(245,185,30,.12);
  border-radius: 0 10px 10px 0; padding: 14px 18px; margin: 0 0 18px; font-size: .96rem; }
.ap-callout strong { display: block; margin-bottom: 3px; color: var(--ap-ink); }

/* data table */
.ap-table-wrap { overflow-x: auto; margin: 0 0 18px; }
.ap-table { border-collapse: collapse; width: 100%; font-size: .93rem; background: #fff;
  border: 1px solid var(--ap-rule); border-radius: 10px; overflow: hidden; }
.ap-table th { background: var(--ap-ink); color: #fff; text-align: left;
  padding: 10px 14px; font-weight: 700; font-size: .85rem; letter-spacing: .04em; }
.ap-table td { padding: 10px 14px; border-top: 1px solid var(--ap-rule); vertical-align: top; }
.ap-table tr:nth-child(even) td { background: rgba(20,38,76,.025); }

/* FAQ accordion (native details, no JS) */
.ap-faq details { background: #fff; border: 1px solid var(--ap-rule); border-radius: 10px;
  margin-bottom: 10px; }
.ap-faq summary { cursor: pointer; padding: 14px 18px; font-weight: 700; color: var(--ap-ink);
  list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.ap-faq summary::-webkit-details-marker { display: none; }
.ap-faq summary::after { content: "+"; font-weight: 700; color: var(--ap-blue); flex: none; }
.ap-faq details[open] summary::after { content: "–"; }
.ap-faq summary:focus-visible { outline: 3px solid var(--ap-pencil); outline-offset: 2px; border-radius: 10px; }
.ap-faq .ap-faq-a { padding: 0 18px 16px; }
.ap-faq .ap-faq-a p { margin: 0 0 10px; }

/* sources footnote */
.ap-sources { font-size: .82rem; color: #4A5163;
  border-top: 1px solid var(--ap-rule); padding-top: 14px; margin-top: 36px; }
.ap-sources a { color: var(--ap-blue); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- GPA calculator ---------- */
.ap-calc { background: #fff; border: 1px solid var(--ap-rule); border-radius: 14px;
  padding: 20px; margin: 0 0 26px; }
.ap-calc-head, .ap-calc-row { display: grid; gap: 8px; align-items: center;
  grid-template-columns: minmax(0, 1fr) 74px 78px 106px 34px; }
.ap-calc-head { font-size: .7rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ap-graphite); opacity: .75; padding: 0 2px 8px; }
.ap-calc-row { padding: 5px 0; }
.ap-calc-row input, .ap-calc-row select {
  font: 500 .95rem 'Public Sans', sans-serif; color: var(--ap-ink);
  background: var(--ap-paper); border: 1.5px solid var(--ap-rule);
  border-radius: 8px; padding: 9px 8px; width: 100%; min-width: 0; }
.ap-calc-row input:focus-visible, .ap-calc-row select:focus-visible,
.ap-calc button:focus-visible { outline: 3px solid var(--ap-pencil); outline-offset: 1px; }
.ap-calc-del { border: none; background: transparent; color: var(--ap-graphite);
  font-size: 1.25rem; line-height: 1; cursor: pointer; border-radius: 6px; padding: 6px; }
.ap-calc-del:hover { color: #B23A1B; }
.ap-calc-del:disabled { opacity: .3; cursor: default; }
.ap-calc-actions { display: flex; gap: 10px; flex-wrap: wrap; padding: 12px 0 4px; }
.ap-calc-actions .ap-cta-link { font-size: .9rem; padding: 9px 16px; cursor: pointer;
  background: transparent; font-family: inherit; }
.ap-calc-results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin-top: 14px; }
.ap-calc-stat { background: var(--ap-ink); color: var(--ap-mist, #D9DEEA);
  border-radius: 12px; padding: 16px 14px 14px; text-align: center;
  font-size: .78rem; line-height: 1.35; }
.ap-calc-num { display: block; font-family: 'Fraunces', Georgia, serif;
  font-weight: 650; font-size: 1.9rem; color: var(--ap-pencil); margin-bottom: 4px; }
.ap-calc-share { display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  margin-top: 16px; border-top: 1px dashed var(--ap-rule); padding-top: 16px; }
.ap-calc-share .ap-cta-link { cursor: pointer; font-family: inherit; border: none; }
.ap-calc-share-note { font-size: .85rem; color: var(--ap-graphite); }
@media (max-width: 560px) {
  .ap-calc-head { display: none; }
  .ap-calc-row { grid-template-columns: 1fr 1fr; grid-template-areas:
    "name name" "credits grade" "level del"; }
  .ap-calc-row input { grid-area: name; }
  .ap-calc-row select:nth-of-type(1) { grid-area: credits; }
  .ap-calc-row select:nth-of-type(2) { grid-area: grade; }
  .ap-calc-row select:nth-of-type(3) { grid-area: level; }
  .ap-calc-del { grid-area: del; justify-self: end; }
  .ap-calc-results { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .ap-page * { transition: none !important; animation: none !important; }
}
