/* ======================================================
   Virtual CTO For Hire
   BLOG ARTICLE CSS STANDARD (Single source of truth)
   Purpose:
   - Provide consistent header, footer, search modal, and article styling
   - Remove layout drift across article pages
   Notes:
   - Site search exists in the header only (#siteSearchModal). No article-level search UI.
====================================================== */

/* ---------- Theme tokens ---------- */
:root{
  --bg-body:#050816;
  --bg-section-dark:#050816;
  --bg-section-mid:#0b1120;
  --bg-section-light:#0f172a;

  --accent:#fbbf24;
  --accent-soft:rgba(251,191,36,0.15);
  --accent-strong:#f59e0b;

  --text-main:#e5e7eb;
  --text-muted:#9ca3af;

  --border-subtle:#1f2937;
  --card-bg:#020617;

  --radius-lg:18px;
  --radius-md:12px;
  --radius-pill:999px;

  --shadow-soft:0 18px 40px rgba(15,23,42,0.7);
  --transition-fast:0.18s ease-out;

  --max-width:1160px;
  --header-offset:86px;
}

/* ---------- Base reset ---------- */
*{box-sizing:border-box;margin:0;padding:0;}
html{scroll-padding-top:var(--header-offset);}
body{
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background:radial-gradient(circle at top,#111827 0,#020617 40%,#000 100%);
  color:var(--text-main);
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
a{color:inherit;text-decoration:none;}
img{max-width:100%;display:block;}

:focus-visible{
  outline:3px solid rgba(251,191,36,0.85);
  outline-offset:3px;
  border-radius:10px;
}
@media (prefers-reduced-motion: reduce){
  *{scroll-behavior:auto !important;transition:none !important;animation:none !important;}
}

/* ---------- Skip link (hidden until focus) ---------- */
.skip-link{
  position:absolute;
  left:16px;
  top:10px;
  padding:10px 12px;
  background:#fbbf24;
  color:#050816;
  border-radius:10px;
  transform:translateY(-140%);
  transition:transform 0.18s ease-out;
  z-index:9999;
  font-weight:800;
}
.skip-link:focus{transform:translateY(0);}

/* ======================================================
   HEADER / NAV
====================================================== */
header{
  position:sticky;
  top:0;
  z-index:50;
  backdrop-filter:blur(20px);
  background:linear-gradient(to bottom,rgba(15,23,42,0.96),rgba(15,23,42,0.82),transparent);
  border-bottom:1px solid rgba(31,41,55,0.7);
}
.nav-bar{
  max-width:var(--max-width);
  margin:0 auto;
  padding:14px 16px 10px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}
.nav-left{display:flex;align-items:center;gap:12px;min-width:0;}
.brand-logo{
  height:69px;
  width:auto;
  max-width:340px;
  object-fit:contain;
  filter:drop-shadow(0 10px 18px rgba(15,23,42,0.65));
}
.nav-brand-text{display:flex;flex-direction:column;min-width:0;}
.logo-text-main{
  font-weight:700;
  font-size:15px;
  letter-spacing:0.03em;
  white-space:nowrap;
}
.logo-text-sub{
  font-size:11px;
  color:var(--text-muted);
  white-space:nowrap;
}

/* Gold byline is a separate element in your approved standard */
.logo-byline{
  margin-top:2px;
  font-size:12px;
  color:var(--accent);
  font-weight:800;
  line-height:1;
  max-width:280px;
  white-space:nowrap;
}

.nav-right{display:flex;align-items:center;gap:14px;}
.nav-links{
  display:flex;
  align-items:center;
  gap:18px;
  font-size:14px;
  color:var(--text-muted);
  white-space:nowrap;
}
.nav-links a{position:relative;padding:4px 0;white-space:nowrap;}
.nav-links a::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:-4px;
  height:2px;
  border-radius:999px;
  transform:scaleX(0);
  transform-origin:center;
  background:linear-gradient(to right,#fbbf24,#f97316);
  transition:transform var(--transition-fast);
}
.nav-links a:hover{color:#e5e7eb;}
.nav-links a:hover::after{transform:scaleX(1);}

.nav-search-link{
  background:transparent;
  border:none;
  padding:4px 0;
  cursor:pointer;
  font:inherit;
  color:var(--accent);
  font-weight:800;
  position:relative;
  white-space:nowrap;
}
.nav-search-link:hover{color:var(--accent-strong);}

.nav-toggle{
  display:none;
  background:none;
  border:none;
  color:#e5e7eb;
  cursor:pointer;
  position:relative;
  z-index:10001;
  padding:10px;
  width:44px;
  height:44px;
}
.nav-toggle span{
  display:block;
  width:20px;
  height:2px;
  background:#e5e7eb;
  margin:4px 0;
  border-radius:999px;
}
.nav-links-mobile{
  display:none;
  flex-direction:column;
  gap:10px;
  padding:10px 16px 16px 16px;
  background:radial-gradient(circle at top,#111827 0,#020617 55%);
  border-bottom:1px solid rgba(31,41,55,0.8);
  z-index:10000;
}
.nav-links-mobile a{font-size:14px;color:var(--text-muted);}
.nav-links-mobile a:hover{color:#e5e7eb;}
.nav-links-mobile .nav-search-link{
  width:fit-content;
  color:var(--accent);
  font-size:14px;
  padding:6px 0;
}

@media (max-width: 920px){
  .nav-links{display:none;}
  .nav-toggle{display:block;}
  .nav-brand-text{display:none;}
  .brand-logo{max-width:300px;height:66px;}
}

/* ======================================================
   SITE SEARCH MODAL (header only)
====================================================== */
body.modal-open{overflow:hidden;}

#siteSearchModal{
  display:none;
  position:fixed;
  inset:0;
  z-index:9999;
  align-items:center;
  justify-content:center;
}
#siteSearchModal.is-open{display:flex;}
#siteSearchModal .search-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,0.66);
}
#siteSearchModal .search-panel{
  position:relative;
  width:min(860px,calc(100% - 28px));
  max-height:min(78vh,780px);
  overflow:auto;
  border-radius:16px;
  background:rgba(15,23,42,0.98);
  border:1px solid rgba(251,191,36,0.18);
  box-shadow:0 18px 70px rgba(0,0,0,0.55);
  padding:16px;
}
#siteSearchModal .search-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
#siteSearchModal .search-top h3{
  margin:0;
  font-size:18px;
  color:#fff;
}
#siteSearchModal .search-close{
  padding:8px 12px;
  border-radius:999px;
  border:1px solid rgba(251,191,36,0.35);
  background:rgba(251,191,36,0.08);
  color:#fff;
  font-weight:800;
  cursor:pointer;
}
#siteSearchModal .search-input{
  width:100%;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.16);
  background:rgba(5,8,22,0.55);
  color:#fff;
  outline:none;
}
#siteSearchModal .search-input:focus{
  border-color:rgba(251,191,36,0.55);
  box-shadow:0 0 0 4px rgba(251,191,36,0.14);
}
#siteSearchModal .search-filters{
  margin-top:10px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
#siteSearchModal .chip{
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  font-weight:800;
  border:1px solid rgba(148,163,184,0.45);
  background:rgba(15,23,42,0.55);
  color:#e5e7eb;
  cursor:pointer;
}
#siteSearchModal .chip[aria-pressed="true"]{
  border-color:rgba(251,191,36,0.85);
  background:rgba(251,191,36,0.14);
  color:#fef3c7;
}
#siteSearchModal .search-results{
  margin-top:12px;
  display:grid;
  gap:10px;
}
#siteSearchModal .result-item{
  padding:14px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(5,8,22,0.35);
}
#siteSearchModal .result-item a{
  color:#fff;
  font-weight:800;
  text-decoration:none;
}
#siteSearchModal .result-item a:hover{text-decoration:underline;}
#siteSearchModal .result-item p{
  margin:6px 0 0 0;
  color:rgba(255,255,255,0.78);
}

/* Defensive: if any legacy/duplicate article-search markup exists, hide it inside main */
main .article-search,
main .search-inline,
main #article-search,
main #searchModal,
main .modal-backdrop,
main .search-overlay{
  display:none !important;
}

/* ======================================================
   ARTICLE LAYOUT + TYPOGRAPHY
====================================================== */
main{display:block;}
.article-page-wrap{
  max-width:980px;
  margin:0 auto;
  padding:0 24px 56px;
}

/* Topbar / breadcrumbs */
.article-topbar{
  padding:14px 0 10px 0;
  border-bottom:1px solid rgba(31,41,55,0.55);
  margin-bottom:18px;
}
.article-breadcrumbs{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  color:var(--text-muted);
  font-size:12px;
}
.article-breadcrumbs a{color:var(--accent);font-weight:800;}
.article-breadcrumbs a:hover{color:var(--accent-strong);}
.article-breadcrumbs .sep{color:rgba(255,255,255,0.35);}

h1{
  font-size:32px;
  line-height:1.15;
  font-weight:800;
  margin:18px 0 8px 0;
}
.article-meta{
  font-size:12px;
  color:var(--text-muted);
  margin-bottom:10px;
}

.article-pdf-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:var(--radius-pill);
  padding:9px 14px;
  font-size:12px;
  font-weight:800;
  border:1px solid rgba(148,163,184,0.45);
  background:rgba(15,23,42,0.55);
  color:#e5e7eb;
  margin-bottom:14px;
}
.article-pdf-link:hover{
  border-color:rgba(251,191,36,0.55);
  background:rgba(15,23,42,0.85);
}

.section-lead{
  font-size:13px;
  color:var(--text-muted);
  width:100%;
  line-height:1.55;
  margin:10px 0 18px 0;
}

/* Executive takeaway block (tight spacing by default) */
.exec-takeaway{
  border-radius:14px;
  border:1px solid rgba(55,65,81,0.9);
  background:rgba(2,6,23,0.65);
  box-shadow:var(--shadow-soft);
  padding:12px 12px 10px 12px;
  margin:16px 0 18px 0;
}
.exec-takeaway h3{
  font-size:12px;
  font-weight:900;
  letter-spacing:0.06em;
  text-transform:uppercase;
  color:#e5e7eb;
  margin:0 0 8px 0;
}
.exec-takeaway ul{
  margin:0;
  padding-left:16px;
  font-size:12px;
  color:#e5e7eb;
  line-height:1.45;
}
.exec-takeaway li{margin-bottom:6px;}
.exec-takeaway li:last-child{margin-bottom:0;}

/* Main article body */
.article-body{
  margin-top:12px;
}
.article-body h2{
  font-size:20px;
  font-weight:800;
  margin:22px 0 10px 0;
  color:#e5e7eb;
}
.article-body h3{
  font-size:16px;
  font-weight:800;
  margin:18px 0 8px 0;
  color:#e5e7eb;
}
.article-body p{
  margin:0 0 12px 0;
  color:rgba(255,255,255,0.86);
  line-height:1.6;
  font-size:14px;
}
.article-body ul,
.article-body ol{
  margin:10px 0 12px 0;
  padding-left:18px;
  color:rgba(255,255,255,0.86);
  line-height:1.6;
  font-size:14px;
}
.article-body li{margin-bottom:6px;}
.article-body li:last-child{margin-bottom:0;}

/* Clamp stacked margins between headings and lists (fixes the wide gaps you see) */
.article-body h3 + ul,
.article-body h3 + ol{margin-top:6px;}
.article-body ul + h3,
.article-body ol + h3{margin-top:14px;}

.article-body strong{color:#fff;font-weight:800;}

.article-figure{
  margin:16px 0 16px 0;
  border-radius:14px;
  overflow:hidden;
  border:1px solid rgba(148,163,184,0.18);
  background:rgba(15,23,42,0.35);
}
.article-figure img{width:100%;height:auto;display:block;}
.article-figure figcaption{
  padding:10px 12px;
  font-size:12px;
  color:var(--text-muted);
  border-top:1px solid rgba(148,163,184,0.14);
}

/* CTA panel */
.cta-panel{
  margin:18px 0 8px 0;
  border-radius:18px;
  border:1px solid rgba(251,191,36,0.22);
  background:rgba(251,191,36,0.08);
  padding:14px 14px 12px 14px;
}
.cta-panel h3{
  margin:0 0 6px 0;
  font-size:16px;
  font-weight:900;
  color:#fff;
}
.cta-panel p{
  margin:0 0 10px 0;
  color:rgba(255,255,255,0.85);
  font-size:13px;
  line-height:1.55;
}
.cta-button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  padding:10px 14px;
  border-radius:12px;
  background:#fbbf24;
  color:#050816;
  font-weight:900;
  text-decoration:none;
}
.cta-button:hover{background:var(--accent-strong);}

/* ======================================================
   FOOTER
====================================================== */
footer{
  background:#020617;
  border-top:1px solid var(--border-subtle);
  padding:24px 16px 16px 16px;
}
.footer-main{
  max-width:var(--max-width);
  margin:0 auto 14px auto;
  display:grid;
  grid-template-columns:2fr 1.2fr 1.1fr 1.4fr;
  gap:18px;
  font-size:12px;
  align-items:start;
}
.footer-brand{display:flex;flex-direction:column;gap:10px;}
.footer-logo{
  height:63px;
  width:auto;
  max-width:340px;
  object-fit:contain;
  filter:drop-shadow(0 10px 18px rgba(15,23,42,0.65));
}
.footer-main h4{font-size:13px;margin-bottom:6px;}
.footer-main p,
.footer-main li{color:var(--text-muted);line-height:1.55;}
.footer-main ul{list-style:none;display:grid;gap:4px;}
.footer-cta-text{margin-bottom:8px;color:var(--text-muted);}

.footer-bottom{
  max-width:var(--max-width);
  margin:0 auto;
  border-top:1px solid rgba(31,41,55,0.9);
  padding-top:10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  font-size:11px;
  color:var(--text-muted);
  gap:10px;
  flex-wrap:wrap;
}
.footer-links{display:flex;gap:10px;flex-wrap:wrap;align-items:center;}
.footer-links a{color:var(--text-muted);}
.footer-links a:hover{color:#e5e7eb;}

.footer-cta-gold{color:var(--accent);font-weight:800;}
.footer-cta-gold:hover{color:var(--accent-strong);}

@media (max-width: 960px){
  .footer-main{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (max-width: 640px){
  .footer-main{grid-template-columns:minmax(0,1fr);}
}

/* ======================================================
   Responsive article tweaks
====================================================== */
@media (max-width: 768px){
  .article-page-wrap{padding:0 16px 48px;}
  h1{font-size:28px;}
}

/* ======================================================
   TWEAKS: Cards + link emphasis + list alignment
   Matches approved "perfect article" structure
====================================================== */

/* 1) Download Executive Brief pill: gold text */
.article-pdf-link{
  color: var(--accent);
  font-weight: 800;
}
.article-pdf-link:hover{
  color: var(--accent);
}

/* 2) Section heads in gold for the four highlighted blocks */
.exec-takeaway h3{ color: var(--accent); }

/* Quick Executive Answers = first H2 inside .article-body */
.article-body > h2:first-of-type{
  color: var(--accent);
}

/* Executive Definitions wrapper */
.exec-definitions h3{ color: var(--accent); }

/* What You Leave With wrapper */
.leave-with h3{ color: var(--accent); }

/* 3) Card treatment for Quick Executive Answers, Executive Definitions, What You Leave With
   - Mirrors Executive Takeaway card spacing and border
   - No extra vertical spacing added beyond existing rhythm
*/

/* Quick Executive Answers: first H2 + its immediately following UL */
.article-body > h2:first-of-type{
  margin-bottom: 10px;
}
.article-body > h2:first-of-type + ul{
  border-radius: 14px;
  border: 1px solid rgba(55,65,81,0.9);
  background: rgba(2,6,23,0.65);
  box-shadow: var(--shadow-soft);
  padding: 12px 12px 10px 12px;
  margin: 0 0 18px 0;
  list-style-position: outside;
}

/* Align bullets with the rest of the article */
.article-body > h2:first-of-type + ul{
  padding-left: 30px; /* 12px card padding + 18px bullet indent */
}
.article-body > h2:first-of-type + ul li{
  margin-bottom: 6px;
}
.article-body > h2:first-of-type + ul li:last-child{
  margin-bottom: 0;
}

/* Executive Definitions card */
.exec-definitions{
  border-radius: 14px;
  border: 1px solid rgba(55,65,81,0.9);
  background: rgba(2,6,23,0.65);
  box-shadow: var(--shadow-soft);
  padding: 12px 12px 10px 12px;
  margin: 16px 0 18px 0;
}
.exec-definitions h3{
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 8px 0;
}
.exec-definitions ul{
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: #e5e7eb;
  line-height: 1.45;
}
.exec-definitions li{ margin-bottom: 6px; }
.exec-definitions li:last-child{ margin-bottom: 0; }

/* What You Leave With card */
.leave-with{
  border-radius: 14px;
  border: 1px solid rgba(55,65,81,0.9);
  background: rgba(2,6,23,0.65);
  box-shadow: var(--shadow-soft);
  padding: 12px 12px 10px 12px;
}
.leave-with h3{
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 8px 0;
}
.leave-with ul{
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: #e5e7eb;
  line-height: 1.45;
}
.leave-with li{ margin-bottom: 6px; }
.leave-with li:last-child{ margin-bottom: 0; }

/* 4) Related articles links: gold + bold (includes Browse all articles)
   This section is typically the last H2 on the page.
*/
.article-body > h2:last-of-type + ul a{
  color: var(--accent);
  font-weight: 800;
}
.article-body > h2:last-of-type + ul a:hover{
  color: var(--accent-strong);
}

/* ======================================================
   LIVE PAGE COMPATIBILITY LAYER
   Some articles render the 4 executive blocks as plain H3 + UL
   without wrapper divs. Style them by structure.
====================================================== */

/* Hide search dialog content by default (header search only). Show only when opened. */
[role="dialog"][aria-modal="true"]{ display:none; }
[role="dialog"][aria-modal="true"].is-open{ display:flex; }
[role="dialog"][aria-modal="true"][aria-hidden="false"]{ display:flex; }

/* Download Executive Brief: support both class and generic download links in main */
main a.article-pdf-link,
main a[download]{
  color: var(--accent);
  font-weight: 800;
}

/* Executive blocks as the first four H3s in main content */
main h3:nth-of-type(-n+4){
  color: var(--accent);
}

/* Card styling for the UL immediately following each of the first four H3s */
main h3:nth-of-type(-n+4) + ul{
  border-radius: 14px;
  border: 1px solid rgba(55,65,81,0.9);
  background: rgba(2,6,23,0.65);
  box-shadow: var(--shadow-soft);
  padding: 12px 12px 10px 12px;
  margin: 0 0 18px 0;
  padding-left: 30px; /* 12px card padding + 18px list indent */
  list-style-position: outside;
}
main h3:nth-of-type(-n+4) + ul li{
  margin-bottom: 6px;
}
main h3:nth-of-type(-n+4) + ul li:last-child{
  margin-bottom: 0;
}

/* Related articles links:
   - Gold + bold for links in the list
   - Gold + bold for the "Browse all articles" link that follows the list
*/
main h2:last-of-type + ul a{
  color: var(--accent);
  font-weight: 800;
}
main h2:last-of-type + ul a:hover{
  color: var(--accent-strong);
}
main h2:last-of-type + ul + a{
  color: var(--accent);
  font-weight: 800;
}
main h2:last-of-type + ul + a:hover{
  color: var(--accent-strong);
}
