/* ── APG Base Styles ─────────────────────────────────────────────────────── */
.apg-section { max-width: 960px; margin: 0 auto 56px; padding: 0 20px; }
.apg-section--hero { max-width: 100%; padding: 0; margin-bottom: 56px; background: var(--background); }
.apg-section--cta { background: var(--foreground); color: #fff; border-radius: 1rem; padding: 48px 40px; text-align: center; }
.apg-section--tip_box { max-width: 960px; margin: 0 auto 56px; padding: 0 20px; }
.apg-section--quote_block { max-width: 960px; margin: 0 auto 40px; padding: 0 20px; }

/* Hero */
.apg-section--hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  max-width: 960px;
  margin: 0 auto 56px;
  padding: 24px 20px 0;
}
.apg-hero__image-wrap {
  width: 100%;
  max-width: 640px;
  aspect-ratio: 4 / 3;
  max-height: none;
  min-height: 0;
  overflow: hidden;
  order: 2;
  justify-self: end;
  border-radius: 1.5rem;
  border: 1px solid rgba(148,163,184,0.22);
  box-shadow: 0 24px 60px rgba(15,23,42,0.12);
  background: linear-gradient(180deg,#f8fafc 0%,#e2e8f0 100%);
}
.apg-hero__image { width: 100%; height: 100%; object-fit: cover; object-position: left bottom; display: block; }
.apg-hero__content { max-width: 640px; width: 100%; margin: 0; padding: 40px 0 48px; align-self: center; }
.apg-hero__kicker { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent, #0f766e); margin: 0 0 10px; max-width: 640px; }
.apg-hero__heading { font-size: 2.2rem; font-weight: 700; margin: 0 0 16px; line-height: 1.2; color: var(--foreground); }
.apg-hero__subtext { font-size: 1.15rem; color: var(--muted); margin: 0 0 28px; max-width: 640px; }
.apg-hero__bullets { list-style: none; padding: 0; margin: 0 0 28px; display: flex; flex-direction: column; gap: 8px; max-width: 640px; }
.apg-hero__bullets li { position: relative; padding-left: 16px; font-size: 1rem; color: var(--foreground); line-height: 1.5; border-left: 3px solid var(--accent, #0f766e); padding-top: 2px; padding-bottom: 2px; }
.apg-hero__note { font-size: 0.9rem; color: var(--muted); margin: 12px 0 0; max-width: 640px; }

/* Buttons */
.apg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.75rem;
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease;
}
.apg-btn--primary {
  /* Use --primary (#0F52BA) instead of --accent (#277FC9). The lighter accent
     only hit ~3.2:1 contrast with white text, below WCAG AA 4.5:1 for the
     button label. Primary gives ~5.6:1. */
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 15px -3px var(--accent-shadow), 0 4px 6px -4px var(--accent-shadow);
}
.apg-btn--primary:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 20px 25px -5px var(--accent-shadow), 0 10px 15px -3px var(--accent-shadow);
}
.apg-btn--large { padding: 1rem 2rem; font-size: 1.1rem; }

/* Typography */
.apg-section h2 { font-size: 1.6rem; font-weight: 700; margin: 0 0 20px; color: var(--foreground); }
.apg-section h3 { font-size: 1.2rem; font-weight: 600; margin: 0 0 12px; color: var(--foreground); }
.apg-section h4 { font-size: 1rem; font-weight: 600; margin: 16px 0 8px; color: var(--foreground); }
.apg-section p  { line-height: 1.7; color: var(--second-text); margin: 0 0 16px; }
.apg-section--cta h2 { color: #fff; }
.apg-section--cta p  { color: rgba(255,255,255,.85); margin-bottom: 28px; }

/* Lists */
.apg-bullets { list-style: none; padding: 0; margin: 0 0 20px; }
.apg-bullets li { padding: 8px 0 8px 28px; position: relative; color: var(--second-text); border-bottom: 1px solid var(--border); }
.apg-bullets li::before { content: "✓"; position: absolute; left: 0; color: var(--primary); font-weight: 700; }
.apg-bullets--watchout li::before { content: "→"; }

/* Steps */
.apg-steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.apg-step { display: flex; gap: 20px; margin-bottom: 28px; align-items: flex-start; }
.apg-step::before { counter-increment: step; content: counter(step); min-width: 40px; height: 40px; background: var(--primary); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1rem; flex-shrink: 0; }
.apg-step__title { font-weight: 600; display: block; margin-bottom: 6px; color: var(--foreground); }
.apg-step__text { margin: 0; color: var(--muted); }

/* Tables */
.apg-table { width: 100%; border-collapse: collapse; margin: 0 0 24px; font-size: 0.95rem; }
.apg-table th { background: var(--primary); color: #fff; padding: 12px 16px; text-align: left; }
.apg-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--second-text); }
.apg-table tr:nth-child(even) td { background: var(--background); }

/* Factors */
.apg-factors { list-style: none; padding: 0; margin: 0; }
.apg-factor { padding: 14px 0; border-bottom: 1px solid var(--border); line-height: 1.6; color: var(--second-text); }

/* FAQ */
.apg-faq { margin: 0; }
.apg-faq__item { border: 1px solid var(--border); border-radius: 0.75rem; margin-bottom: 12px; overflow: hidden; }
.apg-faq__question { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-weight: 600; padding: 16px 20px; cursor: pointer; background: var(--background); border: none; text-align: left; margin: 0; color: var(--foreground); font-family: inherit; font-size: 1rem; }
.apg-faq__icon { font-size: 1.25rem; font-weight: 400; flex-shrink: 0; transition: transform 0.2s ease; }
.apg-faq__icon.open { transform: rotate(45deg); }
.apg-faq__answer { display: none; padding: 16px 20px; background: var(--card); color: var(--second-text); line-height: 1.7; margin: 0; }
.apg-faq__answer.open { display: block; }

/* Print / PDF: show all FAQ answers expanded so the rendered page is fully
   readable in static media. Hide the toggle icon since clicks aren't a thing
   on paper. Same rule for any other click-to-expand panels. */
@media print {
  .apg-faq__answer { display: block !important; }
  .apg-faq__icon   { display: none !important; }
  .apg-faq__question { cursor: default; }
}

/* Product types */
.apg-product-type { background: var(--background); border-radius: 0.75rem; padding: 20px 24px; margin-bottom: 16px; }
.apg-product-type h3 { color: var(--primary); }

/* Partner blocks */
.apg-partner-block { background: var(--background); border-radius: 0.75rem; padding: 20px 24px; margin-bottom: 16px; }

/* Tip box */
.apg-tip-box { background: rgba(39,127,201,0.08); border-left: 4px solid var(--accent); border-radius: 0.75rem; padding: 24px; display: flex; gap: 20px; align-items: flex-start; }
.apg-tip__image-wrap img { width: 120px; height: 90px; object-fit: cover; border-radius: 6px; }
.apg-tip__headline { font-size: 1rem; font-weight: 700; margin: 0 0 8px; color: var(--foreground); }
.apg-tip__text { margin: 0; font-size: 0.95rem; color: var(--second-text); }

/* Quote */
.apg-quote { border-left: 4px solid var(--border); margin: 0; padding: 16px 24px; color: var(--muted); font-style: italic; background: var(--background); border-radius: 0 0.75rem 0.75rem 0; }

/* Figure */
.apg-figure { margin: 24px 0; }
.apg-figure img { width: 100%; border-radius: 0.75rem; display: block; }
.apg-section-image { width: 100%; border-radius: 0.75rem; display: block; }

/* Disclaimer */
.apg-disclaimer { color: var(--muted); font-size: 0.9rem; }

/* Internal links */
.apg-internal-links { max-width: 960px; margin: 0 auto 48px; padding: 0 20px; }
.apg-internal-links h2 { font-size: 1.2rem; font-weight: 600; margin: 0 0 16px; color: var(--foreground); }
.apg-internal-links ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.apg-internal-links a { display: inline-block; padding: 8px 16px; background: var(--background); border: 1px solid var(--border); border-radius: 20px; text-decoration: none; color: var(--second-text); font-size: 0.9rem; }
.apg-internal-links a:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

@media (max-width: 640px) {
  .apg-section--hero {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0;
  }
  .apg-hero__image-wrap {
    order: 0;
    max-width: none;
    max-height: 320px;
    margin: 0;
    justify-self: stretch;
  }
  .apg-hero__heading { font-size: 1.6rem; }
  .apg-section { margin-bottom: 40px; padding: 0 16px; }
  .apg-section--cta {
    margin-left: 16px;
    margin-right: 16px;
    padding: 32px 20px;
  }
  .apg-btn,
  .apg-btn--large { width: 100%; }
  .apg-step { gap: 14px; }
  .apg-step::before { min-width: 36px; height: 36px; font-size: 1rem; }
  .apg-table { display: block; overflow-x: auto; white-space: nowrap; }
  .apg-tip-box { flex-direction: column; }
  .apg-tip-box { padding: 20px; }
  .apg-tip__image-wrap img { width: 100%; height: auto; }
  .apg-faq__question,
  .apg-faq__answer { padding-left: 16px; padding-right: 16px; }
}

/* ── Breadcrumbs ─────────────────────────────────────────────────────────── */
.apg-breadcrumbs { max-width: 960px; margin: 20px auto 0; padding: 0 20px; color: var(--muted); font-size: 0.9rem; }
.apg-breadcrumbs__list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.apg-breadcrumbs__item { display: inline-flex; align-items: center; gap: 0.35rem; }
.apg-breadcrumbs__item a { color: var(--muted); text-decoration: none; border-bottom: 1px dotted transparent; }
.apg-breadcrumbs__item a:hover { color: var(--foreground); border-bottom-color: currentColor; }
.apg-breadcrumbs__item--current span { color: var(--foreground); font-weight: 600; }
.apg-breadcrumbs__sep { color: var(--border); font-weight: 400; }

/* ── Trust strip ─────────────────────────────────────────────────────────── */
.apg-trust-strip {
  max-width: 960px;
  margin: -20px auto 48px;
  padding: 20px;
  background: var(--card, var(--background));
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  box-shadow: 0 4px 10px -6px rgba(0,0,0,0.08);
}
.apg-trust-strip__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px 24px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.apg-trust-strip__item { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.apg-trust-strip__icon { width: 26px; height: 26px; flex-shrink: 0; color: var(--accent); }
.apg-trust-strip__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.apg-trust-strip__label { font-weight: 600; color: var(--foreground); font-size: 0.98rem; }
.apg-trust-strip__hint  { color: var(--muted); font-size: 0.86rem; line-height: 1.45; }

.apg-trust-strip--direct .apg-trust-strip__icon       { color: var(--primary); }
.apg-trust-strip--construction .apg-trust-strip__icon { color: var(--foreground); }

@media (max-width: 820px) {
  .apg-trust-strip__list { grid-template-columns: 1fr; }
  .apg-trust-strip { margin-top: -10px; }
}

/* ── Sticky mobile CTA ───────────────────────────────────────────────────── */
.apg-sticky-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px -6px rgba(0,0,0,0.15);
  display: none;
  z-index: 100;
  backdrop-filter: saturate(180%) blur(6px);
  -webkit-backdrop-filter: saturate(180%) blur(6px);
}
.apg-sticky-cta[data-visible="1"] { display: block; }
.apg-sticky-cta__button { width: 100%; }

/* Desktop never needs the sticky bar. */
@media (min-width: 768px) {
  .apg-sticky-cta,
  .apg-sticky-cta[data-visible="1"] { display: none !important; }
}

/* Avoid content being hidden behind the sticky bar on mobile. */
@media (max-width: 767px) {
  #apg-page.has-sticky-cta { padding-bottom: 96px; }
}

/* ── Progressive disclosure ──────────────────────────────────────────────── */
.apg-disclose {
  position: relative;
  overflow: hidden;
}
.apg-disclose[data-expanded="0"] { max-height: 420px; }
.apg-disclose[data-expanded="0"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 60px;
  background: linear-gradient(to bottom, transparent, var(--background) 85%);
  pointer-events: none;
}
.apg-disclose__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
}
.apg-disclose__toggle:hover { background: rgba(39,127,201,0.08); }
.apg-disclose__toggle::after { content: "↓"; transition: transform 0.2s; }
.apg-disclose[data-expanded="1"] .apg-disclose__toggle::after { transform: rotate(180deg); }

/* ── Utility-block section ───────────────────────────────────────────────── */
.apg-section--utility_block { max-width: 960px; margin: 0 auto 40px; padding: 0 20px; }
.apg-utility-block {
  background: var(--background);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 0.75rem;
  padding: 20px 24px;
}
.apg-utility-block__headline { font-size: 1.1rem; font-weight: 700; margin: 0 0 10px; color: var(--foreground); }
.apg-utility-block__text { color: var(--second-text); line-height: 1.65; margin: 0 0 10px; }
.apg-utility-block__bullets { list-style: none; padding: 0; margin: 0; }
.apg-utility-block__bullets li { padding: 4px 0 4px 22px; position: relative; color: var(--second-text); }
.apg-utility-block__bullets li::before { content: "•"; position: absolute; left: 4px; color: var(--primary); font-weight: 700; }

.apg-utility-block--regulatory_note { border-left-color: var(--foreground); }
.apg-utility-block--common_pitfall  { border-left-color: #d27a2a; }
.apg-utility-block--quality_signal  { border-left-color: #2a9d4a; }
.apg-utility-block--cost_transparency { border-left-color: var(--accent); }
.apg-utility-block--trust_builder   { border-left-color: var(--primary); }
.apg-utility-block--decision_helper { border-left-color: #7a4fd2; }
