/* AplusGen — shared components
 * Header, footer, buttons, cards, chips, icon badges, section titles.
 *
 * Per review appendix B.2.6, brand-visible color changes (primary button fill,
 * chip fill) are NOT applied here — they await brand sign-off and are staged in
 * contrast-candidates.html. Small brand-colored TEXT has been switched to the
 * `-ink` variants, which Review V1 §5.3 already sanctioned.
 * Rules still pending sign-off are marked: CONTRAST-PENDING.
 */

/* ============================================================
   Logo
   ============================================================ */
.logo {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  background: #fff;
  text-decoration: none;
}
.logo:hover { text-decoration: none; }
.logo__image {
  display: block;
  width: 190px;
  height: 60px;
  max-width: none;
  object-fit: cover;
  object-position: 50% 47%;
}
.logo--footer {
  border-radius: var(--r-sm);
}
.logo--footer .logo__image {
  width: 210px;
  height: 72px;
  object-position: 50% 46%;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--tap-min);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--r-pill);
  border: 1.5px solid transparent;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[aria-disabled="true"],
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn svg { width: 16px; height: 16px; flex: none; }

/* CONTRAST-PENDING: white on --orange is 2.90:1. Candidates in
   contrast-candidates.html; do not ship as-is. */
.btn--primary { background: var(--orange); color: #fff; }
.btn--primary:hover { background: var(--orange-strong); }
.btn--primary:active { background: #c85a0d; }

.btn--outline { background: #fff; color: var(--orange-ink); border-color: var(--orange-ink); }
.btn--outline:hover { background: var(--tint-orange); }

.btn--outline-blue { background: #fff; color: var(--blue-ink); border-color: var(--blue-ink); }
.btn--outline-blue:hover { background: var(--tint-blue); }

.btn--blue { background: var(--blue-strong); color: #fff; }   /* 6.52:1 */
.btn--blue:hover { background: var(--blue); }

.btn--sm { padding: var(--sp-2) var(--sp-4); font-size: var(--fs-sm); }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  min-height: var(--header-h);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--tap-min);
  padding: 0 var(--sp-3);
  border: 1px solid #cbd6e6;
  border-radius: var(--r-pill);
  color: var(--navy);
  background: #fff;
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
}
.lang-switch:hover {
  color: var(--blue-ink);
  border-color: var(--blue-ink);
  background: var(--tint-blue);
  text-decoration: none;
}
.lang-switch svg { width: 16px; height: 16px; }

.nav { margin-inline: auto; }
.nav__list { display: flex; align-items: center; gap: var(--sp-1); }
.nav__item { position: relative; }
.nav__trigger { display: flex; align-items: center; }

.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: var(--tap-min);
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-body);
  font-weight: 500;
  color: var(--navy);
  border-radius: var(--r-sm);
  background: none;
  border: 0;
  text-decoration: none;
  white-space: nowrap;
}
.nav__link:hover { color: var(--blue-ink); text-decoration: none; }
.nav__trigger .nav__link { padding-right: 3px; }
.nav__dropdown-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: var(--tap-min);
  padding: var(--sp-2) 8px var(--sp-2) 3px;
  color: var(--navy);
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.nav__trigger:hover .nav__link,
.nav__dropdown-toggle:hover { color: var(--blue-ink); text-decoration: none; }
.nav__dropdown-toggle svg {
  width: 11px;
  height: 11px;
  transition: transform var(--dur-fast) var(--ease);
}

/* Current page carries both a color and an underline — never colour alone. */
.nav__item--active > .nav__link,
.nav__item--active > .nav__trigger .nav__link,
.nav__item--active > .nav__trigger .nav__dropdown-toggle {
  color: var(--orange-ink);
  font-weight: 600;
}
.nav__item--active > .nav__link::after,
.nav__item--active > .nav__trigger::after {
  content: "";
  position: absolute;
  left: var(--sp-3); right: var(--sp-3); bottom: 6px;
  height: 2px;
  background: var(--orange);
  border-radius: 2px;
}

/* Dropdowns — contents are provisional. Review V1 §5.1 asks that these only
   appear where two or more real targets exist; pending link decisions. */
.nav__panel {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  min-width: 230px;
  padding: var(--sp-2);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease),
              visibility var(--dur-fast) var(--ease);
}
.nav__item[data-open="true"] .nav__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav__item[data-open="true"] .nav__dropdown-toggle svg { transform: rotate(180deg); }
.nav__panel a {
  display: flex;
  align-items: center;
  min-height: var(--tap-min);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  color: var(--ink);
}
.nav__panel a:hover { background: var(--tint-blue); color: var(--blue-ink); text-decoration: none; }

/* Duplicate CTA that lives inside the mobile nav panel; hidden on desktop. */
.nav__cta { display: none; }

.nav-toggle {
  display: none;
  margin-left: auto;
  width: var(--tap-min);
  height: var(--tap-min);
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--navy);
}
.nav-toggle svg { width: 22px; height: 22px; display: block; }

/* ============================================================
   Section headings
   Signature pattern: individual words color-swapped for emphasis.
   Only used at h2 size or larger, where the 3:1 threshold applies.
   ============================================================ */
.section-title {
  font-size: var(--fs-h2);
  text-align: center;
  font-weight: 600;
}
.section-title--left { text-align: left; }
.section-sub {
  text-align: center;
  color: var(--muted);
  max-width: 620px;
  margin: var(--sp-3) auto 0;
}

.hl-blue { color: var(--blue); }        /* 5.09:1 */
.hl-green { color: var(--green); }      /* 3.21:1 — headings only (>=24px) */
.hl-orange { color: var(--orange-ink); }/* bright orange fails even large text */

/* "AplusGen" set as running text inside a heading. Same pair as the logo
   wordmark, so the name looks identical wherever it appears. */
.wm-a { color: var(--accent-from); }
.wm-b { color: var(--accent-to); }

/* Gradient highlight — the treatment on "Curious" and "Future" in the hero.
   Falls back to a flat blue where background-clip:text is unsupported, and
   reverts to system colours under forced-colors, where transparent text
   would otherwise vanish. */
.hl-grad {
  color: var(--accent-from);
  /* Keeps descenders from being clipped by the background box. */
  padding-bottom: 0.04em;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hl-grad {
    background-image: var(--grad-hl);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
}
@media (forced-colors: active) {
  .hl-grad {
    background: none;
    color: CanvasText;
    -webkit-text-fill-color: CanvasText;
  }
}

.section-head { margin-bottom: var(--sp-4); }
.section-head--row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

/* ============================================================
   Cards
   Shadow denotes interactivity. Static information cards use a border
   or tint only (Review V1 §5.5).
   ============================================================ */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  transition: box-shadow var(--dur-base) var(--ease),
              transform var(--dur-base) var(--ease);
}
.card--interactive { box-shadow: var(--shadow-sm); }
.card--interactive:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.card--interactive:focus-within { box-shadow: var(--shadow-md); }

.card__title { font-size: var(--fs-h3); margin-bottom: var(--sp-2); }
.card__text { color: var(--muted); font-size: var(--fs-sm); }

/* ============================================================
   Chips (grade levels, status)
   ============================================================ */
.chip {
  display: inline-block;
  padding: 3px 11px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.5;
}
/* CONTRAST-PENDING: white on saturated brand fills at 14px falls under the
   4.5:1 threshold. Candidates staged in contrast-candidates.html. */
.chip--orange { background: var(--orange); color: #fff; }
.chip--green { background: var(--green); color: #fff; }
.chip--purple { background: var(--purple); color: #fff; }
.chip--grey { background: var(--tint-grey); color: var(--muted); }

/* ============================================================
   Icon badge — circular tinted disc holding a line icon
   ============================================================ */
.ibadge {
  display: grid;
  place-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  flex: none;
}
.ibadge svg { width: 26px; height: 26px; }
.ibadge--sm { width: 42px; height: 42px; }
.ibadge--sm svg { width: 21px; height: 21px; }

.ibadge--blue { background: var(--tint-blue); color: var(--blue); }
.ibadge--orange { background: var(--tint-orange); color: var(--orange); }
.ibadge--green { background: var(--tint-green); color: var(--green); }
.ibadge--purple { background: var(--tint-purple); color: var(--purple); }
.ibadge--teal { background: var(--tint-teal); color: var(--teal); }
.ibadge--amber { background: var(--tint-amber); color: var(--amber-ink); }

/* ============================================================
   Arrow link — "Learn More →"
   ============================================================ */
.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: var(--tap-min);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--blue-ink);
}
.arrow-link svg { width: 15px; height: 15px; transition: transform var(--dur-fast) var(--ease); }
.arrow-link:hover { text-decoration: none; }
.arrow-link:hover svg { transform: translateX(3px); }
.arrow-link--green { color: var(--green-ink); }
.arrow-link--orange { color: var(--orange-ink); }
.arrow-link--purple { color: var(--purple-ink); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: linear-gradient(135deg, var(--navy-deep), var(--navy-deep-2));
  color: #d3dff2;
  padding-top: var(--sp-12);
  font-size: var(--fs-sm);
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr 1.3fr;
  gap: var(--sp-8);
}
.site-footer h4 {
  color: #fff;
  font-size: var(--fs-body);
  margin-bottom: var(--sp-4);
}
.site-footer a { color: #d3dff2; }
.site-footer a:hover { color: #fff; }
.site-footer li + li { margin-top: var(--sp-2); }
.site-footer :focus-visible { outline-color: #fff; }

.footer__blurb { margin: var(--sp-4) 0 var(--sp-4); color: #c2d2ea; max-width: 260px; }

.social { display: flex; gap: var(--sp-2); }
.social a {
  display: grid;
  place-content: center;
  width: var(--tap-min);
  height: var(--tap-min);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.social a:hover { background: var(--blue); }
.social svg { width: 17px; height: 17px; }

.footer__contact li { display: flex; gap: var(--sp-3); align-items: flex-start; }
.footer__contact svg { width: 16px; height: 16px; flex: none; margin-top: 4px; }

.site-footer__bar {
  margin-top: var(--sp-8);
  padding: var(--sp-4) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
  font-size: var(--fs-xs);
}
.site-footer__bar nav { display: flex; gap: var(--sp-6); flex-wrap: wrap; }
.site-footer__bar a { display: inline-flex; align-items: center; min-height: var(--tap-min); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 900px) {
  .site-header__inner { gap: var(--sp-2); }
  .logo--header .logo__image { width: 170px; height: 54px; }
  .site-header__actions { margin-left: auto; }
  .nav-toggle { display: flex; margin-left: 0; }
  .site-header__cta { display: none; }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    display: none;
    padding: var(--sp-2) var(--gutter) var(--sp-6);
  }
  .nav[data-open="true"] { display: block; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav__link { width: 100%; justify-content: space-between; padding: var(--sp-3) var(--sp-1); }
  .nav__trigger { width: 100%; }
  .nav__trigger .nav__link {
    flex: 1;
    width: auto;
    justify-content: flex-start;
    padding-right: var(--sp-1);
  }
  .nav__dropdown-toggle {
    flex: 0 0 var(--tap-min);
    min-width: var(--tap-min);
    padding: 0;
  }
  .nav__item--active > .nav__link::after,
  .nav__item--active > .nav__trigger::after { display: none; }
  .nav__item--active > .nav__link { border-left: 3px solid var(--orange); padding-left: var(--sp-3); }
  .nav__item--active > .nav__trigger { border-left: 3px solid var(--orange); }
  .nav__item--active > .nav__trigger .nav__link { padding-left: var(--sp-3); }

  .nav__panel {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
    box-shadow: none;
    border: 0;
    border-left: 2px solid var(--line);
    border-radius: 0;
    margin-left: 6px;
    padding: 2px 0 6px var(--sp-3);
  }
  .nav__item[data-open="true"] .nav__panel { display: block; }

  .nav__cta { display: flex !important; width: 100%; margin-top: var(--sp-4); }
}

@media (max-width: 640px) {
  .logo--footer .logo__image { width: 195px; height: 66px; }
  .site-footer__grid { grid-template-columns: 1fr 1fr; gap: var(--sp-6); }
  .site-footer__bar { flex-direction: column; align-items: flex-start; gap: var(--sp-2); }
}
