/* ═══════════════════════════════════════════════════════════
   CERTIFIED TO CONTRACTED — brand layer v2
   Loaded last on every page; overrides the inline draft palette.
   Brand: Capaciti Co royal navy #1a2d59 + brass gold #c5a142.
   ═══════════════════════════════════════════════════════════ */

:root {
  --navy: #1a2d59;
  --navy-mid: #2b4079;
  --navy-light: #3d5694;
  --navy-faint: #eef1f8;
  --gold: #c5a142;
  --gold-light: #dcc06e;
  --gold-pale: #f7efdb;
  --gold-faint: #fdfaf1;
  --cream: #fbfaf6;
  --white: #ffffff;
  --text: #16203a;
  --muted: #5a6478;
  --border: rgba(197, 161, 66, 0.24);
  --border-light: rgba(197, 161, 66, 0.13);
  --green: #2a7a5c;
  --green-pale: #eef7f2;
  --purple: #7b4f9e;
  --purple-pale: #f4effa;
  --red: #b85b42;
  --red-pale: #fff3ee;
  --shadow-sm: 0 8px 22px rgba(26, 45, 89, 0.08);
  --shadow-md: 0 18px 54px rgba(26, 45, 89, 0.14);
  --shadow-lg: 0 24px 80px rgba(26, 45, 89, 0.18);
}

body { background: var(--cream); }

/* ── Dark sections → royal navy ── */
.hero {
  background: linear-gradient(150deg, #16264c 0%, #1a2d59 55%, #24396b 100%) !important;
}
.part-banner,
.resource-footer,
.cta-section {
  background: var(--navy) !important;
}
footer { background: #101b3a !important; }

.free-section {
  background: linear-gradient(135deg, #16264c 0%, #1a2d59 50%, #22376b 100%) !important;
}

/* ── NAV (markup generated by site-nav.js) ── */
.top-nav.site-nav {
  position: sticky;
  top: 0;
  z-index: 500;
  height: auto;
  min-height: 72px;
  padding: 10px clamp(18px, 5vw, 72px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(197, 161, 66, 0.35);
  box-shadow: 0 10px 32px rgba(26, 45, 89, 0.09);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.site-brand { display: inline-flex; align-items: center; text-decoration: none; }
.site-brand img { height: 46px; width: auto; display: block; }

.site-menu-toggle {
  display: none;
  justify-self: end;
  border: 1px solid rgba(26, 45, 89, 0.22);
  background: var(--navy-faint);
  color: var(--navy);
  border-radius: 7px;
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 9px 12px;
  text-transform: uppercase;
  cursor: pointer;
}

.site-nav-menu {
  grid-column: 2 / 4;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.site-nav-pages {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}
.site-nav-pages a,
.site-section-menu summary,
.site-direction-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 7px;
  color: #3a4a6b;
  font-family: 'DM Mono', monospace;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  padding: 0 11px;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}
.site-nav-pages a:hover,
.site-section-menu summary:hover,
.site-direction-link:hover {
  background: var(--gold-faint);
  color: var(--navy);
}
.site-nav-pages a.is-active { background: var(--navy); color: #fff; }
.site-nav-index { color: var(--gold); font-weight: 700; }
.site-nav-pages a.is-active .site-nav-index { color: var(--gold-light); }

.site-section-menu { position: relative; }
.site-section-menu summary {
  border: 1px solid rgba(197, 161, 66, 0.35);
  cursor: pointer;
  list-style: none;
}
.site-section-menu summary::-webkit-details-marker { display: none; }
.site-section-menu summary::after { content: '+'; color: var(--gold); font-size: 0.95rem; line-height: 1; }
.site-section-menu[open] summary::after { content: '-'; }
.site-section-list {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(330px, 78vw);
  max-height: min(430px, 70vh);
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(26, 45, 89, 0.14);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(26, 45, 89, 0.18);
}
.site-section-list a {
  display: block;
  border-radius: 6px;
  color: #3a4a6b;
  font-size: 0.82rem;
  line-height: 1.35;
  padding: 9px 10px;
  text-decoration: none;
}
.site-section-list a:hover { background: var(--navy-faint); color: var(--navy); }

.site-nav-directions { display: flex; gap: 6px; align-items: center; }
.site-direction-link { border: 1px solid rgba(197, 161, 66, 0.4); color: var(--navy-mid); }
.site-direction-link.is-disabled { display: none; }

/* ── Cards: consistent hairline + navy shadow ── */
.guide-card, .info-card, .ai-card, .platform-card, .response-template,
.resource-card, .timeline-item, .cfv-card, .bond-card, .scenario-card,
.accordion-item, .capabilities-sample, .sidebar {
  border-color: rgba(197, 161, 66, 0.22) !important;
  box-shadow: var(--shadow-sm);
}
.section-badge, .step-num, .process-dot, .capab-header, .platform-header,
.rt-header, .cfv-header, .bond-card-header, .data-table th {
  background: var(--navy) !important;
}
.callout-navy, .stat-bar, .navy-faint, .sidebar-nav .snav-num,
.accordion-icon, .card-badge.cb-navy, .resource-tag.rt-navy {
  background: var(--navy-faint) !important;
}
.btn-primary, .nav-cta, .guide-link, .toc-num, .journey-step a {
  border-radius: 7px !important;
}

/* ── CERT LOGO WALL (injected on the home page) ── */
.cert-logo-band {
  background: var(--white);
  border-bottom: 1px solid var(--border-light);
  padding: 44px clamp(18px, 6vw, 72px);
}
.cert-logo-band-inner { max-width: 1200px; margin: 0 auto; }
.cert-logo-band .clb-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  text-align: center;
  margin-bottom: 24px;
}
.cert-logo-wall {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  align-items: stretch;
}
.cert-logo-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border: 1px solid rgba(26, 45, 89, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  padding: 12px 16px;
  height: 64px;
  box-sizing: content-box;
  transition: transform 0.2s, box-shadow 0.2s;
}
.cert-logo-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.cert-logo-tile img { height: 100%; width: auto; max-width: 170px; object-fit: contain; display: block; }

/* inline cert logos injected where guides mention certifications */
.cert-inline-logo {
  height: 34px;
  width: auto;
  max-width: 110px;
  object-fit: contain;
  background: #fff;
  border: 1px solid rgba(26, 45, 89, 0.1);
  border-radius: 6px;
  padding: 3px 6px;
  box-sizing: content-box;
  flex-shrink: 0;
}
.info-card-icon.has-logo {
  width: auto !important;
  height: 44px !important;
  padding: 4px 8px;
  background: #fff !important;
  border: 1px solid rgba(26, 45, 89, 0.1);
}
.info-card-icon.has-logo img {
  height: 100%;
  width: auto;
  max-width: 130px;
  object-fit: contain;
  display: block;
}

/* who-card + ta-org-card injected logos */
.who-logo, .ta-org-logo {
  display: flex;
  align-items: center;
  height: 52px;
  margin-bottom: 12px;
}
.who-logo img { height: 100%; width: auto; max-width: 150px; object-fit: contain; }
.ta-org-logo { background: #fff; border-radius: 6px; padding: 8px 10px; box-sizing: content-box; height: 40px; }
.ta-org-logo img { height: 100%; width: auto; max-width: 140px; object-fit: contain; }

/* ── CAPACITI CONTACT BAND (injected on every page) ── */
.capaciti-band {
  background: #101b3a;
  border-top: 1px solid rgba(197, 161, 66, 0.35);
  padding: 56px clamp(18px, 6vw, 72px) 48px;
}
.capaciti-band-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 40px;
  align-items: center;
}
.capaciti-band .cb-logo img { height: 110px; width: auto; display: block; }
.capaciti-band .cb-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 10px;
}
.capaciti-band .cb-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 8px;
}
.capaciti-band .cb-title em { font-style: italic; color: var(--gold-light); }
.capaciti-band .cb-desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.7;
  max-width: 520px;
}
.capaciti-band .cb-contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.capaciti-band .cb-contact a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--gold-light);
  text-decoration: none;
  border: 1px solid rgba(197, 161, 66, 0.35);
  border-radius: 7px;
  padding: 12px 18px;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.capaciti-band .cb-contact a:hover { background: rgba(197, 161, 66, 0.12); border-color: var(--gold); }
.capaciti-band .cb-contact .cb-ico { color: var(--gold); }

/* ── SERIES PAGER ── */
.series-pager {
  background: var(--cream);
  border-top: 1px solid rgba(197, 161, 66, 0.2);
  padding: 34px clamp(18px, 5vw, 72px);
}
.series-pager-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.series-pager a {
  min-height: 82px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid rgba(197, 161, 66, 0.28);
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  padding: 15px 18px;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, border-color 0.2s;
}
.series-pager a:hover { border-color: var(--gold); transform: translateY(-1px); }
.series-pager-label {
  color: var(--gold);
  font-family: 'DM Mono', monospace;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.series-pager-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.15;
}
.series-pager-all { text-align: center; }
.series-pager-next { text-align: right; }

/* ── RESPONSIVE ── */
@media (max-width: 980px) {
  .top-nav.site-nav { grid-template-columns: minmax(0, 1fr) auto; }
  .site-menu-toggle { display: inline-flex; align-items: center; }
  .site-nav-menu {
    grid-column: 1 / -1;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-top: 6px;
  }
  .site-nav.is-open .site-nav-menu { display: flex; }
  .site-nav-pages, .site-nav-directions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    overflow: visible;
  }
  .site-nav-pages a, .site-direction-link, .site-section-menu summary {
    justify-content: center;
    min-height: 42px;
  }
  .site-section-menu { width: 100%; }
  .site-section-list { position: static; width: 100%; max-height: 300px; margin-top: 8px; }
  .capaciti-band-inner { grid-template-columns: 1fr; text-align: center; gap: 24px; }
  .capaciti-band .cb-logo img { margin: 0 auto; }
  .capaciti-band .cb-desc { margin: 0 auto; }
  .capaciti-band .cb-contact { align-items: center; }
}
@media (max-width: 640px) {
  .site-brand img { height: 38px; }
  .site-nav-pages, .site-nav-directions, .series-pager-inner { grid-template-columns: 1fr; }
  .series-pager-next { text-align: left; }
  .cert-logo-tile { height: 48px; }
}

@media print {
  .top-nav.site-nav, .series-pager, .capaciti-band { display: none !important; }
}
