/* aib-page.css: article layout for content pages on the aib design system.
 *
 * Loads after aib-system.css. Everything is aib-prefixed or scoped under
 * .aib-article / .aib-side, so the shared content classes the 31 use-case
 * pages already carry (.quick-answers, .prompt-box, .callout, .section-cta,
 * .related-articles, details/.faq-body, .breadcrumbs, .hero-badge) are styled
 * here without touching their markup or text. No main.css on these pages.
 */

/* The old template (main.css) set border-box sizing on every element, and the
   pages' own inline styles still assume it (cards with height:100% plus padding
   overflowed into the next section without it). Restore it for converted pages. */
.aib-page *,
.aib-page *::before,
.aib-page *::after { box-sizing: border-box; }

:root {
  --aib-read: #DCE4F0;          /* reading text on navy */
  --aib-read-width: 70ch;
  --aib-side-width: 280px;
}

/* ---------- Breadcrumb and slim banner ---------- */
.aib-page .breadcrumbs {
  margin: var(--aib-space-5) 0 0;
  color: var(--aib-muted);
  font-size: var(--aib-text-sm);
}
.aib-page .breadcrumbs a { color: var(--aib-teal-soft); text-decoration: none; }
.aib-page .breadcrumbs a:hover,
.aib-page .breadcrumbs a:focus-visible { text-decoration: underline; }

.aib-banner--slim {
  margin: var(--aib-space-4) 0 var(--aib-space-6);
  padding: var(--aib-space-6) var(--aib-space-6) var(--aib-space-5);
}
/* 800, not the system banner's 900: the H1 is this page's LCP element and the
   800 weight is the one the page preloads, so the first paint uses the real font. */
.aib-banner--slim .aib-banner-title { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem); font-weight: 800; max-width: 26ch; }
.aib-banner--slim .aib-banner-text { margin-bottom: 0; color: var(--aib-read); font-size: 1.1rem; max-width: 62ch; }
.aib-page .hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--aib-space-2);
  margin: 0 0 var(--aib-space-4);
  padding: 0.3em 0.9em;
  border: 1px solid var(--aib-line);
  border-radius: var(--aib-radius-pill);
  background: rgba(3, 15, 36, 0.35);
  color: var(--aib-teal-soft);
  font-size: var(--aib-text-sm);
  font-weight: 600;
}

@media (max-width: 600px) {
  .aib-banner--slim { padding: var(--aib-space-5) var(--aib-space-4); }
  .aib-page .hero-badge { border-radius: var(--aib-radius-sm); font-size: 0.8rem; }
}

/* ---------- Two-column layout ---------- */
.aib-layout {
  display: grid;
  grid-template-columns: minmax(0, var(--aib-read-width)) var(--aib-side-width);
  justify-content: space-between;
  gap: var(--aib-space-7);
  align-items: start;
}
@media (max-width: 1000px) {
  .aib-layout { grid-template-columns: minmax(0, 1fr); gap: var(--aib-space-6); }
}

/* ---------- Reading column ---------- */
.aib-article {
  min-width: 0;
  color: var(--aib-read);
  font-size: 1.0625rem;          /* 17 px */
  line-height: 1.75;
}
@media (min-width: 1000px) { .aib-article { font-size: 1.125rem; } }   /* 18 px */
.aib-article p { margin: 0 0 1.15em; }
.aib-article strong { color: var(--aib-white); }
.aib-article h2 {
  position: relative;
  margin: 2.2em 0 0.7em;
  padding-top: 0.9em;
  color: var(--aib-white);
  font-size: clamp(1.35rem, 1.1rem + 0.9vw, 1.7rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
  scroll-margin-top: var(--aib-space-5);
}
.aib-article h2::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 3px;
  border-radius: 2px;
  background: var(--aib-teal-soft);
}
.aib-article h3 { margin: 1.6em 0 0.5em; color: var(--aib-white); font-size: 1.2rem; font-weight: 800; }
.aib-article a {
  color: var(--aib-teal-soft);
  text-decoration: underline;
  text-decoration-color: rgba(127, 220, 214, 0.45);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-decoration-color var(--aib-dur-fast) var(--aib-ease), color var(--aib-dur-fast) var(--aib-ease);
}
.aib-article a:hover,
.aib-article a:focus-visible {
  color: var(--aib-white);
  text-decoration-color: currentColor;
  text-decoration-thickness: 2px;
}
/* Specificity guard: system buttons inside an article keep button colours.
   ".aib-article a.aib-btn" (0,2,1) beats ".aib-article a" (0,1,1) and ties with,
   then follows, ".aib-article a:hover" (0,2,1). */
.aib-article a.aib-btn,
.aib-article a.aib-btn:hover,
.aib-article a.aib-btn:focus-visible { color: var(--aib-navy); text-decoration: none; }
.aib-article a.aib-btn--ghost,
.aib-article a.aib-btn--ghost:hover,
.aib-article a.aib-btn--ghost:focus-visible { color: var(--aib-white); }
.aib-article ul,
.aib-article ol { margin: 0 0 1.3em; padding-left: 1.3em; }
.aib-article li { margin: 0.45em 0; padding-left: 0.2em; }
.aib-article li::marker { color: var(--aib-teal-soft); font-weight: 800; }
.aib-article hr {
  margin: var(--aib-space-7) 0;
  border: 0;
  border-top: 1px solid var(--aib-line-soft);
}
.aib-article table { width: 100%; border-collapse: collapse; margin: 1.25em 0 1.75em; font-size: 0.95rem; }
.aib-article th,
.aib-article td { padding: 0.6em 0.75em; border: 1px solid var(--aib-line-soft); text-align: left; vertical-align: top; }
.aib-article th { background: var(--aib-panel); color: var(--aib-white); }

/* ---------- Shared content blocks (existing class names) ---------- */
.aib-article .quick-answers {
  margin: 0 0 var(--aib-space-6);
  padding: var(--aib-space-5) var(--aib-space-5) var(--aib-space-3);
  background: var(--aib-panel);
  border: 1px solid var(--aib-line);
  border-left: 4px solid var(--aib-teal);
  border-radius: var(--aib-radius-md);
}
.aib-article .quick-answers h2 {
  margin: 0 0 0.5em;
  padding-top: 0;
  color: var(--aib-teal-soft);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.aib-article .quick-answers h2::before { display: none; }
.aib-article .quick-answers ul { margin-bottom: var(--aib-space-3); }

.aib-article .prompt-box {
  margin: 0.75em 0 1.4em;
  padding: var(--aib-space-4) var(--aib-space-5);
  background: var(--aib-navy-deep);
  border: 1px solid var(--aib-line-soft);
  border-left: 3px solid var(--aib-teal);
  border-radius: 0 var(--aib-radius-sm) var(--aib-radius-sm) 0;
  color: var(--aib-read);
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.aib-article .callout {
  margin: var(--aib-space-5) 0;
  padding: var(--aib-space-5);
  background: var(--aib-panel);
  border: 1px solid var(--aib-line-soft);
  border-radius: var(--aib-radius-md);
}
.aib-article .callout p:last-child { margin-bottom: 0; }

.aib-article .section-cta {
  margin: var(--aib-space-7) 0;
  padding: var(--aib-space-6) var(--aib-space-5);
  text-align: center;
  background: linear-gradient(135deg, var(--aib-panel) 0%, var(--aib-panel-lift) 100%);
  border: 1px solid var(--aib-line);
  border-radius: var(--aib-radius-lg);
}
.aib-article .section-cta h3 { margin-top: 0; }
.aib-article .section-cta p { max-width: 46ch; margin-left: auto; margin-right: auto; }
.aib-article .actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--aib-space-3);
  margin: var(--aib-space-4) 0 var(--aib-space-3);
  padding: 0;
  list-style: none;
}
.aib-article .actions li { margin: 0; padding: 0; }
.aib-article .aib-fineprint { margin: var(--aib-space-2) 0 0; color: var(--aib-muted); font-size: 0.85rem; }

/* Existing .button links in the body take the system button look. They are
   <a> elements, and main.css is not loaded here, so nothing forces their colour. */
.aib-article a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 0.8rem 1.4rem;
  border: 2px solid var(--aib-teal);
  border-radius: var(--aib-radius-pill);
  background: transparent;
  color: var(--aib-white);
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.25;
  text-decoration: none;
  transition: background-color var(--aib-dur-fast) var(--aib-ease), transform var(--aib-dur-fast) var(--aib-ease);
}
.aib-article a.button:hover,
.aib-article a.button:focus-visible { background: rgba(43, 182, 176, 0.14); color: var(--aib-white); transform: translateY(-1px); }
/* The one full-course action is gold. */
.aib-article a.button.primary {
  background: var(--aib-gold);
  border-color: var(--aib-gold);
  color: var(--aib-navy);
  box-shadow: var(--aib-glow-gold);
}
.aib-article a.button.primary:hover,
.aib-article a.button.primary:focus-visible { background: #F8CB66; border-color: #F8CB66; color: var(--aib-navy); }

/* FAQ disclosure */
.aib-article details {
  margin: var(--aib-space-3) 0;
  background: var(--aib-panel);
  border: 1px solid var(--aib-line-soft);
  border-radius: var(--aib-radius-md);
}
.aib-article details summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--aib-space-4);
  padding: var(--aib-space-4) var(--aib-space-5);
  color: var(--aib-white);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.aib-article details summary::-webkit-details-marker { display: none; }
.aib-article details summary::after { content: "+"; color: var(--aib-teal-soft); font-size: 1.3rem; font-weight: 800; flex-shrink: 0; }
.aib-article details[open] summary::after { content: "\2212"; }
.aib-article details summary:focus-visible { outline: 3px solid var(--aib-teal-soft); outline-offset: 2px; border-radius: var(--aib-radius-md); }
.aib-article .faq-body { padding: 0 var(--aib-space-5) var(--aib-space-3); }

/* Related guides row (existing .related-articles links) */
.aib-article .related-articles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--aib-space-4);
  margin: var(--aib-space-4) 0 var(--aib-space-6);
}
.aib-article .related-card {
  display: flex;
  flex-direction: column;
  gap: var(--aib-space-2);
  padding: var(--aib-space-5);
  background: var(--aib-panel);
  border: 1px solid var(--aib-line);
  border-radius: var(--aib-radius-md);
  color: var(--aib-read);
  text-decoration: none;
  transition: transform var(--aib-dur-fast) var(--aib-ease), border-color var(--aib-dur-fast) var(--aib-ease);
}
.aib-article .related-card:hover,
.aib-article .related-card:focus-visible { transform: translateY(-2px); border-color: rgba(127, 220, 214, 0.55); color: var(--aib-read); }
.aib-article .related-card .tag { color: var(--aib-teal-soft); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.aib-article .related-card h4 { margin: 0; color: var(--aib-white); font-size: 1rem; font-weight: 800; line-height: 1.35; }
.aib-article .related-card span:last-child { margin-top: auto; color: var(--aib-teal-soft); font-size: 0.9rem; font-weight: 800; }

/* Author box and AI-summary note (were inline style="" blocks) */
.aib-author {
  display: flex;
  align-items: center;
  gap: var(--aib-space-4);
  margin: var(--aib-space-6) 0 var(--aib-space-4);
  padding: var(--aib-space-4) var(--aib-space-5);
  background: var(--aib-panel);
  border: 1px solid var(--aib-line-soft);
  border-radius: var(--aib-radius-md);
}
.aib-author img { width: 56px; height: 56px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--aib-line); object-fit: cover; }
.aib-author p { margin: 0; font-size: 0.95rem; }
.aib-note {
  margin: var(--aib-space-4) 0 0;
  padding: var(--aib-space-4) var(--aib-space-5);
  border: 1px solid var(--aib-line-soft);
  border-radius: var(--aib-radius-md);
}
.aib-note p { margin: 0; color: var(--aib-muted); font-size: 0.9rem; }

/* ---------- Sidebar ---------- */
.aib-side {
  position: sticky;
  top: var(--aib-space-5);
  display: flex;
  flex-direction: column;
  gap: var(--aib-space-5);
  font-family: var(--aib-font);
}
@media (max-width: 1000px) { .aib-side { position: static; } }
.aib-toc {
  padding: var(--aib-space-5);
  background: var(--aib-panel);
  border: 1px solid var(--aib-line-soft);
  border-radius: var(--aib-radius-md);
}
.aib-toc-title {
  margin: 0 0 var(--aib-space-3);
  color: var(--aib-teal-soft);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.aib-toc ol { margin: 0; padding: 0; list-style: none; counter-reset: aib-toc; }
.aib-toc li { margin: 0; counter-increment: aib-toc; }
.aib-toc a {
  display: flex;
  gap: var(--aib-space-2);
  padding: 0.45em 0;
  color: var(--aib-muted);
  font-size: 0.92rem;
  line-height: 1.4;
  text-decoration: none;
  border-bottom: 1px solid var(--aib-line-soft);
}
.aib-toc li:last-child a { border-bottom: 0; }
.aib-toc a::before { content: counter(aib-toc, decimal-leading-zero); color: var(--aib-teal-soft); font-weight: 800; font-size: 0.8rem; padding-top: 0.1em; }
.aib-toc a:hover,
.aib-toc a:focus-visible { color: var(--aib-white); text-decoration: underline; }
.aib-side-card { padding: var(--aib-space-5); }
.aib-side-card .aib-card-title { font-size: 1.1rem; }
.aib-side-card .aib-btn { justify-content: center; }

/* ---------- Single-column content pages (blog, guides, hubs, tools, legal) ---------- */
.aib-article--narrow { max-width: var(--aib-read-width); }
.aib-article--wide { max-width: var(--aib-container); }
.aib-article--wide p,
.aib-article--wide li { max-width: 78ch; }
.aib-article--narrow .aib-banner--slim,
.aib-article--wide .aib-banner--slim { margin-top: var(--aib-space-4); }
.aib-article img,
.aib-article video { max-width: 100%; height: auto; }
.aib-article iframe { max-width: 100%; border: 0; border-radius: var(--aib-radius-md); }
.aib-article .image.fit,
.aib-article .image.fit img { display: block; width: 100%; }
.aib-article blockquote {
  margin: var(--aib-space-5) 0;
  padding: var(--aib-space-4) var(--aib-space-5);
  border-left: 3px solid var(--aib-teal);
  background: var(--aib-panel);
  border-radius: 0 var(--aib-radius-sm) var(--aib-radius-sm) 0;
}
.aib-article code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 0.92em; }
.aib-article h4 { margin: 1.3em 0 0.4em; color: var(--aib-white); font-size: 1.05rem; font-weight: 800; }
.aib-article a.button.small { padding: 0.55rem 1.05rem; font-size: 0.875rem; }

/* Native form controls and buttons inside content (tools pages). These pages
   do not load main.css, so nothing forces button colours here. */
.aib-article button,
.aib-article input[type="submit"],
.aib-article input[type="button"],
.aib-article input[type="reset"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 0.7rem 1.2rem;
  border: 2px solid var(--aib-teal);
  border-radius: var(--aib-radius-pill);
  background: var(--aib-teal);
  color: var(--aib-navy);
  font: 800 0.95rem/1.2 var(--aib-font);
  cursor: pointer;
}
.aib-article button:hover,
.aib-article input[type="submit"]:hover,
.aib-article input[type="button"]:hover { background: var(--aib-teal-soft); border-color: var(--aib-teal-soft); }
.aib-article input[type="text"],
.aib-article input[type="email"],
.aib-article input[type="search"],
.aib-article input[type="number"],
.aib-article select,
.aib-article textarea {
  box-sizing: border-box;
  max-width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--aib-line);
  border-radius: var(--aib-radius-sm);
  background: var(--aib-navy-deep);
  color: var(--aib-white);
  font: 400 1rem/1.4 var(--aib-font);
}
.aib-article input[type="checkbox"],
.aib-article input[type="radio"] { accent-color: var(--aib-teal); }
.aib-article label { color: var(--aib-read); }

/* ---------- Zigzag week cards (/first-30-days) ---------- */
.aib-weeks { list-style: none; margin: var(--aib-space-6) 0 var(--aib-space-7); padding: 0; display: grid; gap: var(--aib-space-5); counter-reset: none; }
.aib-week {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: var(--aib-space-5);
  margin: 0;
  padding: var(--aib-space-4);
  background: var(--aib-panel);
  border: 1px solid var(--aib-line);
  border-radius: var(--aib-radius-lg);
}
.aib-week:nth-child(even) .aib-week-img { order: 2; }
.aib-week-img { display: block; width: 100%; height: auto; border-radius: var(--aib-radius-md); aspect-ratio: 16 / 9; }
.aib-week-copy { padding: var(--aib-space-2); }
.aib-article .aib-week-kicker { margin: 0 0 var(--aib-space-2); color: var(--aib-teal-soft); font-size: 0.8rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.aib-article .aib-week-title { margin: 0 0 var(--aib-space-2); color: var(--aib-white); font-size: 1.3rem; line-height: 1.25; }
.aib-article .aib-week-sub { margin: 0 0 var(--aib-space-3); color: var(--aib-muted); }
.aib-week:last-child { border-color: rgba(245, 185, 58, 0.45); }
.aib-week:last-child .aib-week-kicker { color: var(--aib-gold); }
@media (max-width: 640px) {
  .aib-week { grid-template-columns: 1fr; }
  .aib-week:nth-child(even) .aib-week-img { order: 0; }
}

/* ---------- Motion ---------- */
.aib-side { animation: aib-rise var(--aib-dur-enter) var(--aib-ease) 120ms both; }

@media (prefers-reduced-motion: reduce) {
  .aib-side,
  .aib-article a,
  .aib-article a.button,
  .aib-article button,
  .aib-article .related-card {
    animation: none;
    transition: none;
  }
  .aib-article a.button:hover,
  .aib-article a.button:focus-visible,
  .aib-article .related-card:hover,
  .aib-article .related-card:focus-visible { transform: none; }
}

/* Quiet buy card (e.g. after the week list on /first-30-days) */
.aib-buycard { max-width: 62ch; margin: var(--aib-space-6) 0; border-color: rgba(245, 185, 58, 0.35); }
.aib-buycard:hover { transform: none; border-color: rgba(245, 185, 58, 0.35); }
.aib-buycard p { margin: 0; color: var(--aib-read); }
.aib-buycard .aib-fineprint { color: var(--aib-muted); font-size: 0.9rem; }

/* Path buttons (.btn-path) on older blog/tool pages. Each page's own <style>
   block paints them with !important (white on #35a4ff 2.7:1, #2bb673 2.6:1,
   purple #5A42B4), and main.css section 15 also forces them with !important,
   so !important at higher specificity is the only way to win. Palette only. */
a.button.btn-path.path-academy { background: #F5B93A !important; background-image: none !important; border-color: #F5B93A !important; color: #061A3A !important; } /* 9.8:1 */
a.button.btn-path.path-free { background: #2BB6B0 !important; background-image: none !important; border-color: #2BB6B0 !important; color: #061A3A !important; } /* 6.9:1 */
a.button.btn-path.path-business { background: #123672 !important; background-image: none !important; border-color: #2BB6B0 !important; color: #FFFFFF !important; } /* 11.6:1 */
.aib-article pre { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; } /* long prompt blocks wrap instead of widening the page */
