/* =========================================================================
   AE Design System — advancingexpress.com
   Gold accent + navy ink, system font, mobile-first.
   Loaded after GeneratePress styles by mu-plugins/ae-design.php
   ========================================================================= */

:root {
  --ae-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --ae-navy-900: #081a33;
  --ae-navy: #0d2a5c;
  --ae-ink: #14233d;
  --ae-muted: #55617a;
  --ae-line: #e2e7ef;
  --ae-soft: #f5f7fb;
  --ae-gold: #f2b705;
  --ae-gold-hover: #ffc72c;
  --ae-gold-ink: #1b1400;
  --ae-gold-soft: rgba(242, 183, 5, .14);
  --ae-on-navy: #ffffff;
  --ae-on-navy-muted: #b4c3e0;
  --ae-tile: rgba(255, 255, 255, .07);
  --ae-tile-line: rgba(255, 255, 255, .14);
  --ae-radius: 16px;
  --ae-radius-sm: 12px;
  --ae-shadow: 0 8px 24px rgba(8, 26, 51, .10);
}

/* ---------- Base typography ---------- */
body,
button,
input,
select,
textarea {
  font-family: var(--ae-font);
}

body {
  color: var(--ae-ink);
}

.entry-content {
  line-height: 1.65;
}

.entry-content h2,
.entry-content h3 {
  color: var(--ae-ink);
  font-weight: 700;
  line-height: 1.3;
}

@media (max-width: 767px) {
  .entry-content { font-size: 17px; }
  .entry-content h2 { font-size: 23px; margin-top: 1.6em; }
  .entry-content h3 { font-size: 19px; margin-top: 1.4em; }
}

/* ---------- Images ---------- */
.entry-content .wp-block-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--ae-radius-sm);
}

/* ---------- Tables ---------- */
.entry-content .wp-block-table {
  border: 1px solid var(--ae-line);
  border-radius: var(--ae-radius-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.entry-content .wp-block-table table {
  margin: 0;
  border: 0;
  font-size: 15px;
  line-height: 1.45;
}
.entry-content .wp-block-table th,
.entry-content .wp-block-table td {
  border: 0;
  border-bottom: 1px solid var(--ae-line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
.entry-content .wp-block-table tr:last-child td { border-bottom: 0; }
.entry-content .wp-block-table th {
  background: var(--ae-soft);
  color: var(--ae-ink);
  font-weight: 700;
}
.entry-content .wp-block-table td:first-child { font-weight: 600; }
/* wide tables (4+ columns) scroll sideways on phones instead of squashing */
@media (max-width: 767px) {
  .entry-content .wp-block-table table:has(tr > :nth-child(4)) { width: max-content; min-width: 100%; table-layout: auto; }
  .entry-content .wp-block-table table:has(tr > :nth-child(4)) :is(td, th) { word-break: normal; min-width: 150px; max-width: 220px; }
  .entry-content .wp-block-table table:has(tr > :nth-child(4)) :is(td, th):first-child { min-width: 0; white-space: nowrap; }
}

/* ---------- CTA buttons (core/button with .ae-cta) ---------- */
.entry-content .ae-cta-row { justify-content: center; margin: 1.5em 0; }
.entry-content .ae-cta .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  min-width: 280px;
  padding: 12px 28px;
  border: 0;
  border-radius: var(--ae-radius-sm);
  background: var(--ae-gold);
  color: var(--ae-gold-ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(242, 183, 5, .32);
  transition: background .15s ease, transform .15s ease;
}
.entry-content .ae-cta .wp-block-button__link::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: none;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3v11m0 0 4.5-4.5M12 14 7.5 9.5M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3v11m0 0 4.5-4.5M12 14 7.5 9.5M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.entry-content .ae-cta .wp-block-button__link:hover { background: var(--ae-gold-hover); color: var(--ae-gold-ink); }
.entry-content .ae-cta .wp-block-button__link:active { transform: translateY(1px); }
.entry-content .ae-cta .wp-block-button__link:focus-visible,
.ae-sticky__btn:focus-visible { outline: 3px solid var(--ae-navy); outline-offset: 3px; }
@media (max-width: 767px) {
  .entry-content .ae-cta-row { display: block; }
  .entry-content .ae-cta-row .wp-block-button { width: 100%; }
  .entry-content .ae-cta .wp-block-button__link { width: 100%; min-width: 0; }
}

/* ---------- Table of contents (Spectra) ---------- */
.wp-block-uagb-table-of-contents .uagb-toc__wrap {
  border: 1px solid var(--ae-line) !important;
  border-radius: var(--ae-radius-sm) !important;
  background: var(--ae-soft) !important;
  padding: 16px 20px !important;
}
.wp-block-uagb-table-of-contents .uagb-toc__title { font-weight: 700; color: var(--ae-ink); }

/* ---------- FAQ (Yoast FAQ block) — cards; accordion enhanced by ae-design.js ---------- */
.entry-content .wp-block-yoast-faq-block {
  display: grid;
  gap: 10px;
  margin: 1em 0 3em;
}
.entry-content .schema-faq-section {
  margin: 0;
  border: 1px solid var(--ae-line);
  border-radius: var(--ae-radius-sm);
  background: #fff;
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.entry-content .schema-faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  color: var(--ae-ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
}
.entry-content .schema-faq-answer {
  margin: 0;
  padding: 0 18px 18px;
  color: #33415c;
  font-size: 16px;
  line-height: 1.6;
}
.ae-faq-ready .schema-faq-question {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ae-faq-ready .schema-faq-question::after {
  content: "";
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ae-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%230d2a5c' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
  transition: transform .2s ease, background-color .15s ease;
}
.ae-faq-ready .schema-faq-section:not(.is-open) .schema-faq-answer { display: none; }
.ae-faq-ready .schema-faq-section.is-open {
  border-color: var(--ae-gold);
  box-shadow: 0 6px 18px rgba(8, 26, 51, .07);
}
.ae-faq-ready .schema-faq-section.is-open .schema-faq-question::after {
  transform: rotate(180deg);
  background-color: var(--ae-gold-soft);
}
.ae-faq-ready .schema-faq-question:hover { color: var(--ae-navy); }
.ae-faq-ready .schema-faq-question:focus-visible {
  outline: 3px solid var(--ae-navy);
  outline-offset: -3px;
  border-radius: var(--ae-radius-sm);
}
@media (max-width: 767px) {
  .entry-content .schema-faq-question { padding: 14px 14px 14px 16px; font-size: 16px; }
  .entry-content .schema-faq-answer { padding: 0 16px 16px; font-size: 15.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .ae-faq-ready .schema-faq-question::after { transition: none; }
}

/* =========================================================================
   Front-page hero card: entry header (H1) + quick-facts table + CTA + file meta
   painted as one navy card. Markup stays semantic (H1, table, links).
   ========================================================================= */
body.home.one-container .site-content { padding-top: 16px; }

body.home .inside-article > .entry-header,
body.home .entry-content > .wp-block-table:first-child,
body.home .entry-content > .wp-block-table:first-child + .wp-block-buttons,
body.home .entry-content > .ae-file-meta {
  background: var(--ae-navy);
  margin-left: var(--ae-hero-bleed, -14px);
  margin-right: var(--ae-hero-bleed, -14px);
  padding-left: var(--ae-hero-pad, 16px);
  padding-right: var(--ae-hero-pad, 16px);
}
body.home .inside-article > .entry-header {
  margin-bottom: 0;
  padding-top: 20px;
  padding-bottom: 12px;
  border-radius: var(--ae-radius) var(--ae-radius) 0 0;
}
body.home .inside-article > .entry-header + .entry-content { margin-top: 0; }
body.home .entry-title {
  margin: 0;
  color: var(--ae-on-navy);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
}
body.home .ae-checked {
  margin: 8px 0 0;
  color: var(--ae-on-navy-muted);
  font-size: 13px;
  line-height: 1.4;
}
body.home .ae-checked::before { content: "\2713\00a0"; color: var(--ae-gold); font-weight: 700; }

/* quick-facts table -> tiles */
body.home .entry-content > .wp-block-table:first-child {
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 4px;
  padding-bottom: 12px;
  border: 0;
  border-radius: 0;
  overflow: visible;
}
body.home .entry-content > .wp-block-table:first-child table { display: block; min-width: 0; margin: 0; border: 0; table-layout: auto; }
body.home .entry-content > .wp-block-table:first-child tbody {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
body.home .entry-content > .wp-block-table:first-child tr {
  display: flex;
  flex-direction: column;
  gap: 2px;
  grid-column: span 6;
  padding: 9px 11px;
  border: 1px solid var(--ae-tile-line);
  border-radius: 10px;
  background: var(--ae-tile);
}
body.home .entry-content > .wp-block-table:first-child tr:first-child { display: none; }
body.home .entry-content > .wp-block-table:first-child tr:nth-child(2),
body.home .entry-content > .wp-block-table:first-child tr:nth-child(3) { grid-column: span 3; }
body.home .entry-content > .wp-block-table:first-child tr:nth-child(4) { grid-column: span 2; }
body.home .entry-content > .wp-block-table:first-child tr:nth-child(5) { grid-column: span 4; }
body.home .entry-content > .wp-block-table:first-child td,
body.home .entry-content > .wp-block-table:first-child th {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
}
body.home .entry-content > .wp-block-table:first-child td:first-child {
  color: var(--ae-on-navy-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1.3;
  text-transform: uppercase;
}
body.home .entry-content > .wp-block-table:first-child td:last-child {
  color: var(--ae-on-navy);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}
body.home .entry-content > .wp-block-table:first-child td em { font-style: normal; }
body.home .entry-content > .wp-block-table:first-child td strong { font-weight: 700; }
/* bonus plate */
body.home .entry-content > .wp-block-table:first-child tr:last-child {
  align-items: center;
  text-align: center;
  border-color: var(--ae-gold);
  background: var(--ae-gold-soft);
}
body.home .entry-content > .wp-block-table:first-child tr:last-child td { text-align: center; }
body.home .entry-content > .wp-block-table:first-child tr:last-child td:first-child { color: var(--ae-gold); }
body.home .entry-content > .wp-block-table:first-child tr:last-child strong {
  color: var(--ae-gold);
  font-size: 17px;
  white-space: nowrap;
}

/* hero CTA */
body.home .entry-content > .wp-block-table:first-child + .wp-block-buttons {
  display: block;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 2px;
  padding-bottom: 8px;
}
body.home .entry-content > .wp-block-table:first-child + .wp-block-buttons .wp-block-button { width: 100%; }
body.home .entry-content > .wp-block-table:first-child + .wp-block-buttons .wp-block-button__link {
  width: 100%;
  min-width: 0;
  box-shadow: 0 6px 20px rgba(242, 183, 5, .30);
}
/* file meta line = last segment of the card */
body.home .entry-content > .ae-file-meta {
  margin-top: 0;
  margin-bottom: 20px;
  padding-top: 4px;
  padding-bottom: 16px;
  border-radius: 0 0 var(--ae-radius) var(--ae-radius);
  color: var(--ae-on-navy-muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}
body.home .entry-content > .ae-file-meta a { color: var(--ae-on-navy); text-decoration: underline; text-underline-offset: 2px; }
body.home .entry-content > .ae-file-meta + br { display: none; }

/* desktop / tablet hero */
@media (min-width: 768px) {
  body.home { --ae-hero-pad: 32px; --ae-hero-bleed: 0px; }
  body.home .inside-article > .entry-header { padding-top: 32px; padding-bottom: 14px; }
  body.home .entry-title { font-size: 32px; }
  body.home .ae-checked { font-size: 14px; }
  body.home .entry-content > .wp-block-table:first-child tbody { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  body.home .entry-content > .wp-block-table:first-child tr,
  body.home .entry-content > .wp-block-table:first-child tr:nth-child(n) { grid-column: span 1; padding: 12px 14px; }
  body.home .entry-content > .wp-block-table:first-child tr:last-child {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: center;
    gap: 14px;
  }
  body.home .entry-content > .wp-block-table:first-child td:last-child { font-size: 14px; }
  body.home .entry-content > .wp-block-table:first-child tr:last-child td:first-child { font-size: 12px; }
  body.home .entry-content > .wp-block-table:first-child tr:last-child td:last-child { font-size: 16px; }
  body.home .entry-content > .wp-block-table:first-child tr:last-child strong { font-size: 20px; }
  body.home .entry-content > .wp-block-table:first-child + .wp-block-buttons { text-align: center; padding-top: 8px; }
  body.home .entry-content > .wp-block-table:first-child + .wp-block-buttons .wp-block-button { width: auto; }
  body.home .entry-content > .wp-block-table:first-child + .wp-block-buttons .wp-block-button__link { width: auto; min-width: 360px; min-height: 56px; font-size: 18px; }
  body.home .entry-content > .ae-file-meta { padding-bottom: 28px; font-size: 14px; }
}

/* ---------- In-app browser notice (inserted by ae-design.js) ---------- */
.ae-inapp {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--ae-gold);
  border-radius: var(--ae-radius-sm);
  background: #fff8e1;
  color: var(--ae-ink);
  font-size: 14px;
  line-height: 1.45;
}
.ae-inapp__text { flex: 1 1 220px; margin: 0; }
.ae-inapp__btn {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--ae-navy);
  border-radius: 10px;
  background: #fff;
  color: var(--ae-navy);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

/* ---------- Sticky CTA (inserted by ae-design.js) ---------- */
.ae-sticky {
  position: fixed;
  z-index: 50;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(8, 26, 51, .96);
  box-shadow: 0 -6px 20px rgba(8, 26, 51, .25);
  transform: translateY(calc(100% + 40px));
  visibility: hidden;
  transition: transform .2s ease, visibility 0s linear .2s;
}
.ae-sticky.is-visible { transform: translateY(0); visibility: visible; transition: transform .2s ease; }
.ae-sticky__btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 16px;
  border-radius: var(--ae-radius-sm);
  background: var(--ae-gold);
  color: var(--ae-gold-ink);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}
.ae-sticky__btn:hover { background: var(--ae-gold-hover); color: var(--ae-gold-ink); }
.ae-sticky__meta { flex: none; color: var(--ae-on-navy-muted); font-size: 12px; line-height: 1.3; text-align: right; }
body.ae-has-sticky .generate-back-to-top { bottom: 84px; }
@media (min-width: 768px) {
  .ae-sticky {
    left: auto;
    right: 24px;
    bottom: 24px;
    width: auto;
    padding: 8px 8px 8px 16px;
    border-radius: 16px;
  }
  .ae-sticky__btn { flex: none; padding: 10px 22px; }
  body.ae-has-sticky .generate-back-to-top { bottom: 96px; }
}
@media (max-height: 480px) { .ae-sticky { display: none; } }
@media (prefers-reduced-motion: reduce) { .ae-sticky { transition: none; } }
