/* ==========================================================================
   Product Strategy Grid — main.css
   Editorial technology-intelligence publication theme.
   Matches markup in header.php, footer.php, front-page.php, template-parts,
   and inc/template-tags.php.
   ========================================================================== */

/* ---- 1. DESIGN TOKENS ---------------------------------------------------- */
:root {
  --psg-primary:    #0F172A;
  --psg-secondary:  #1E293B;
  --psg-accent:     #2563EB;
  --psg-accent-dark:#1D4ED8;
  --psg-bg:         #FFFFFF;
  --psg-text:       #111827;
  --psg-muted:      #64748B;
  --psg-border:     #E2E8F0;

  --psg-surface:    #F8FAFC;
  --psg-surface-2:  #F1F5F9;
  --psg-accent-soft:#EFF4FF;

  --font-body: "Inter", "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: "Inter", "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif:"Source Serif 4", Georgia, "Times New Roman", serif;

  --fs-base: 1.0625rem;
  --fs-sm:   0.875rem;
  --fs-xs:   0.75rem;
  --fs-lead: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
  --fs-h1:   clamp(2rem, 1.4rem + 3vw, 3.4rem);
  --fs-h2:   clamp(1.6rem, 1.2rem + 1.7vw, 2.4rem);
  --fs-h3:   clamp(1.25rem, 1.05rem + 1vw, 1.6rem);

  --lh-body: 1.7;
  --lh-head: 1.18;

  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem;
  --s5: 1.5rem; --s6: 2rem; --s7: 3rem; --s8: 4rem; --s9: 6rem;

  --container: 1200px;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow: 0 4px 18px rgba(15,23,42,.08);
  --shadow-lg: 0 14px 40px rgba(15,23,42,.14);
  --header-h: 68px;
  --tr: 180ms ease;
}

/* ---- 2. RESET & BASE ----------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: var(--psg-text);
  background: var(--psg-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, picture, video, svg { max-width: 100%; height: auto; }
img, svg { display: block; }
a { color: var(--psg-accent); text-decoration: none; transition: color var(--tr); }
a:hover { color: var(--psg-accent-dark); }
ul, ol { padding-left: 1.25rem; }
hr { border: 0; border-top: 1px solid var(--psg-border); margin: var(--s7) 0; }
figure { margin: 0; }
button { font-family: inherit; }

h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-head);
  line-height: var(--lh-head);
  color: var(--psg-primary);
  font-weight: 700;
  letter-spacing: -.018em;
  margin: 0 0 var(--s4);
}
h1 { font-size: var(--fs-h1); font-weight: 800; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { margin: 0 0 var(--s5); }

blockquote {
  margin: var(--s6) 0;
  padding: var(--s2) 0 var(--s2) var(--s5);
  border-left: 4px solid var(--psg-accent);
  font-size: 1.25rem; line-height: 1.5; color: var(--psg-secondary); font-weight: 500;
}
code, pre { font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
pre { background: var(--psg-primary); color: #E2E8F0; padding: var(--s5); border-radius: var(--radius); overflow-x: auto; }
:not(pre) > code { background: var(--psg-surface-2); padding: .15em .4em; border-radius: 4px; }

/* ---- 3. LAYOUT ----------------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--s5); }
.section { padding-block: var(--s8); }
.site-content { min-height: 50vh; }
.no-content { color: var(--psg-muted); padding: var(--s5); background: var(--psg-surface); border-radius: var(--radius); }

.section-head { display: flex; align-items: center; gap: var(--s4); margin-bottom: var(--s6); flex-wrap: wrap; }
.section-title { margin: 0; white-space: nowrap; }
.section-title--sm { font-size: 1.1rem; }
.section-rule { flex: 1; height: 1px; background: var(--psg-border); }
.section-sub { width: 100%; color: var(--psg-muted); margin: var(--s2) 0 0; }
.section-head--sidebar { margin-bottom: var(--s5); }

/* ---- 4. ACCESSIBILITY ---------------------------------------------------- */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 1000; background: var(--psg-primary); color: #fff; padding: .75rem 1.25rem; border-radius: 0 0 var(--radius) 0; }
.skip-link:focus { left: 0; }
.screen-reader-text { border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%); height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; }
:focus-visible { outline: 3px solid var(--psg-accent); outline-offset: 2px; border-radius: 2px; }
:where(a,button,input,select,textarea):focus:not(:focus-visible) { outline: none; }

/* ---- 5. BUTTONS ---------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .8rem 1.5rem; border-radius: var(--radius); font-weight: 700; font-size: .95rem; cursor: pointer; border: 1px solid transparent; transition: all var(--tr); }
.btn-primary { background: var(--psg-accent); color: #fff; }
.btn-primary:hover { background: var(--psg-accent-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--psg-primary); border-color: var(--psg-border); }
.btn-ghost:hover { border-color: var(--psg-primary); }
.btn-outline { background: #fff; color: var(--psg-primary); border-color: var(--psg-border); }
.btn-outline:hover { border-color: var(--psg-accent); color: var(--psg-accent); }
.btn-light { background: #fff; color: var(--psg-primary); }
.btn-light:hover { background: var(--psg-surface); }

/* ---- 6. TOP / HEADER / NAV ----------------------------------------------- */
.reading-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: transparent; z-index: 300; }
.reading-progress-bar { display: block; height: 100%; width: 0; background: var(--psg-accent); transition: width 80ms linear; }

.site-header { position: sticky; top: 0; z-index: 100; background: var(--psg-bg); border-bottom: 1px solid var(--psg-border); transition: box-shadow var(--tr); }
.site-header.is-stuck { box-shadow: var(--shadow); }
.site-header-inner { display: flex; align-items: center; gap: var(--s5); min-height: var(--header-h); }

.site-branding { flex-shrink: 0; }
.site-logo-text { display: flex; align-items: center; gap: .55rem; }
.site-logo-text:hover { color: inherit; }
.logo-mark { color: var(--psg-accent); display: inline-flex; }
.logo-name { font-family: var(--font-head); font-weight: 800; font-size: 1.15rem; color: var(--psg-primary); letter-spacing: -.02em; }
.custom-logo-link { display: inline-block; }

.main-navigation { margin-left: auto; }
.nav-menu { display: flex; align-items: center; gap: var(--s5); list-style: none; margin: 0; padding: 0; }
.nav-menu a { color: var(--psg-secondary); font-weight: 600; font-size: .95rem; padding: .35rem 0; position: relative; }
.nav-menu a:hover { color: var(--psg-accent); }
.nav-menu .current-menu-item > a, .nav-menu .current_page_item > a { color: var(--psg-accent); }
.nav-menu > li > a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 2px; background: var(--psg-accent); transform: scaleX(0); transform-origin: left; transition: transform var(--tr); }
.nav-menu > li > a:hover::after, .nav-menu > .current-menu-item > a::after { transform: scaleX(1); }

.nav-menu .menu-item-has-children { position: relative; }
.nav-menu .sub-menu { position: absolute; top: 100%; left: 0; min-width: 220px; background: #fff; border: 1px solid var(--psg-border); border-radius: var(--radius); box-shadow: var(--shadow); padding: .5rem; list-style: none; margin: .5rem 0 0; opacity: 0; visibility: hidden; transform: translateY(6px); transition: all var(--tr); }
.nav-menu .menu-item-has-children:hover > .sub-menu, .nav-menu .menu-item-has-children:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-menu .sub-menu a { display: block; padding: .5rem .75rem; border-radius: 6px; font-weight: 500; }
.nav-menu .sub-menu a::after { display: none; }
.nav-menu .sub-menu a:hover { background: var(--psg-surface); }

.header-actions { display: flex; align-items: center; gap: var(--s3); flex-shrink: 0; }
.header-search-toggle, .menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 1px solid var(--psg-border); border-radius: var(--radius); background: #fff; color: var(--psg-secondary); cursor: pointer; transition: all var(--tr); }
.header-search-toggle:hover { border-color: var(--psg-accent); color: var(--psg-accent); }
.header-subscribe-btn { display: inline-flex; align-items: center; padding: .6rem 1.1rem; background: var(--psg-primary); color: #fff; border-radius: var(--radius); font-weight: 700; font-size: .9rem; }
.header-subscribe-btn:hover { background: var(--psg-accent); color: #fff; }

.menu-toggle { display: none; flex-direction: column; gap: 4px; }
.menu-toggle-bar { display: block; width: 18px; height: 2px; background: var(--psg-primary); transition: all var(--tr); }
.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Search panel */
.header-search-panel { border-top: 1px solid var(--psg-border); background: var(--psg-surface); padding: var(--s5) 0; }
.header-search-panel[hidden] { display: none; }
.header-search-form { display: flex; align-items: center; gap: var(--s3); position: relative; }
.header-search-icon { position: absolute; left: 1rem; color: var(--psg-muted); }
.header-search-input { flex: 1; padding-left: 2.8rem !important; font-size: 1.1rem; }
.header-search-submit { padding: .8rem 1.4rem; background: var(--psg-accent); color: #fff; border: 0; border-radius: var(--radius); font-weight: 700; cursor: pointer; }
.header-search-submit:hover { background: var(--psg-accent-dark); }
.header-search-results { margin-top: var(--s4); }
.header-search-results .search-result { display: block; padding: .65rem .5rem; border-bottom: 1px solid var(--psg-border); }
.header-search-results .search-result:hover { background: #fff; }
.header-search-results .search-result-kicker { font-size: var(--fs-xs); color: var(--psg-accent); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.header-search-results .search-result-title { font-weight: 600; color: var(--psg-primary); }
.header-search-results .search-empty { color: var(--psg-muted); padding: .5rem; }

/* Mobile menu */
.mobile-menu { position: fixed; inset: 0 0 0 auto; width: min(360px,86vw); background: #fff; z-index: 200; transform: translateX(100%); transition: transform 260ms ease; box-shadow: var(--shadow-lg); overflow-y: auto; display: flex; flex-direction: column; padding-bottom: var(--s6); }
.mobile-menu.is-open { transform: translateX(0); }
.mobile-menu[hidden] { display: flex; } /* keep transitions; visually offscreen */
.mobile-menu-header { display: flex; justify-content: space-between; align-items: center; padding-block: var(--s5); border-bottom: 1px solid var(--psg-border); }
.mobile-menu-title { font-weight: 800; font-family: var(--font-head); color: var(--psg-primary); }
.mobile-menu-close { width: 42px; height: 42px; border: 1px solid var(--psg-border); border-radius: var(--radius); background: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--psg-primary); }
.mobile-nav { padding-top: var(--s4); }
.mobile-nav-menu { list-style: none; margin: 0; padding: 0; }
.mobile-nav-menu li { border-bottom: 1px solid var(--psg-border); }
.mobile-nav-menu a { display: block; padding: .9rem 0; color: var(--psg-primary); font-weight: 600; }
.mobile-nav-menu .sub-menu { list-style: none; padding-left: var(--s4); margin: 0; }
.mobile-nav-menu .sub-menu a { font-weight: 500; color: var(--psg-secondary); padding: .65rem 0; }
.mobile-subscribe-btn { display: block; text-align: center; margin-top: var(--s5); padding: .85rem; background: var(--psg-accent); color: #fff; border-radius: var(--radius); font-weight: 700; }
.mobile-subscribe-btn:hover { background: var(--psg-accent-dark); color: #fff; }
.mobile-menu-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 150; }
.mobile-menu-overlay[hidden] { display: none; }

/* ---- 7. BREADCRUMBS ------------------------------------------------------ */
.breadcrumbs-wrap { border-bottom: 1px solid var(--psg-border); background: var(--psg-surface); }
.breadcrumbs { font-size: var(--fs-sm); color: var(--psg-muted); padding-block: var(--s3); }
.breadcrumb-list { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; align-items: center; }
.breadcrumb-item { display: flex; align-items: center; gap: .5rem; }
.breadcrumb-sep { color: var(--psg-border); }
.breadcrumb-list a { color: var(--psg-muted); }
.breadcrumb-list a:hover { color: var(--psg-accent); }
.breadcrumb-current { color: var(--psg-text); font-weight: 600; }

/* ---- 8. HERO ------------------------------------------------------------- */
.hero { padding-block: var(--s8) var(--s7); border-bottom: 1px solid var(--psg-border); }
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: var(--s8); align-items: center; }
.hero-eyebrow { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--psg-accent); display: inline-block; margin-bottom: var(--s3); }
.hero-heading { font-size: var(--fs-h1); margin-bottom: var(--s5); max-width: 16ch; }
.hero-text { font-size: var(--fs-lead); color: var(--psg-secondary); line-height: 1.55; max-width: 48ch; margin-bottom: var(--s6); }
.hero-actions { display: flex; gap: var(--s4); flex-wrap: wrap; }
.hero-visual { position: relative; }
.hero-graphic { width: 100%; height: auto; filter: drop-shadow(0 14px 40px rgba(15,23,42,.10)); }

/* ---- 9. POST CARDS ------------------------------------------------------- */
.entry-kicker { display: inline-block; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--psg-accent); margin-bottom: var(--s3); }
a.entry-kicker:hover { color: var(--psg-accent-dark); }

.post-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--psg-border); border-radius: var(--radius-lg); overflow: hidden; height: 100%; transition: box-shadow var(--tr), transform var(--tr); }
.post-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.post-card-thumb { display: block; aspect-ratio: 16/9; overflow: hidden; background: var(--psg-surface-2); }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms ease; }
.post-card:hover .post-card-thumb img { transform: scale(1.04); }
.post-card-thumb-placeholder { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, var(--psg-surface) 0%, var(--psg-surface-2) 100%); }
.post-card-body { padding: var(--s5); display: flex; flex-direction: column; flex: 1; }
.post-card-title { font-size: 1.18rem; line-height: 1.3; margin: 0 0 var(--s3); }
.post-card-title a { color: var(--psg-primary); }
.post-card-title a:hover { color: var(--psg-accent); }
.post-card-excerpt { color: var(--psg-muted); font-size: var(--fs-sm); margin: 0 0 var(--s4); flex: 1; }
.post-card-meta { display: flex; align-items: center; gap: .5rem; font-size: var(--fs-xs); color: var(--psg-muted); margin-top: auto; }
.post-card-author { font-weight: 600; color: var(--psg-secondary); }
.meta-dot { color: var(--psg-border); }
.reading-time { display: inline-flex; align-items: center; gap: .3rem; }
.reading-time svg { flex-shrink: 0; }

.post-card--compact { flex-direction: row; }
.post-card--compact .post-card-thumb { width: 110px; aspect-ratio: 1; flex-shrink: 0; }
.post-card--compact .post-card-body { padding: var(--s4); }
.post-card--compact .post-card-title { font-size: 1rem; }

/* ---- 10. FEATURED -------------------------------------------------------- */
.featured-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--s6); }
.feature-lead { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--psg-border); border-radius: var(--radius-lg); overflow: hidden; }
.feature-lead-thumb { display: block; aspect-ratio: 16/10; overflow: hidden; background: var(--psg-surface-2); }
.feature-lead-thumb img { width: 100%; height: 100%; object-fit: cover; }
.feature-lead-body { padding: var(--s6); }
.feature-lead-title { font-size: clamp(1.4rem, 1.1rem + 1.3vw, 2rem); margin: 0 0 var(--s4); line-height: 1.22; }
.feature-lead-title a { color: var(--psg-primary); }
.feature-lead-title a:hover { color: var(--psg-accent); }
.feature-lead-dek { color: var(--psg-muted); margin-bottom: var(--s4); }
.feature-secondary { display: grid; grid-template-rows: 1fr 1fr; gap: var(--s6); }
.feature-secondary .post-card { flex-direction: row; }
.feature-secondary .post-card-thumb { width: 140px; aspect-ratio: 1; flex-shrink: 0; }
.feature-secondary .post-card-excerpt { display: none; }
.feature-secondary .post-card-body { padding: var(--s4); }
.feature-secondary .post-card-title { font-size: 1.05rem; }

/* ---- 11. TRENDING TOPICS ------------------------------------------------- */
.topics-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s4); }
.topic-chip-card a { display: flex; align-items: center; gap: var(--s3); padding: var(--s4); border: 1px solid var(--psg-border); border-radius: var(--radius); background: #fff; transition: all var(--tr); }
.topic-chip-card a:hover { border-color: var(--psg-accent); background: var(--psg-accent-soft); }
.topic-icon { width: 40px; height: 40px; border-radius: var(--radius); background: var(--psg-accent-soft); color: var(--psg-accent); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.topic-name { font-weight: 700; font-size: var(--fs-sm); color: var(--psg-primary); flex: 1; }
.topic-arrow { color: var(--psg-muted); transition: transform var(--tr); }
.topic-chip-card a:hover .topic-arrow { transform: translateX(3px); color: var(--psg-accent); }

/* ---- 12. LATEST + POPULAR ------------------------------------------------ */
.latest-layout { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: var(--s7); align-items: start; }
.latest-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s6); }
.latest-cta { margin-top: var(--s6); }
.latest-sidebar { position: sticky; top: calc(var(--header-h) + 1.5rem); }
.popular-box { border: 1px solid var(--psg-border); border-radius: var(--radius-lg); padding: var(--s5); background: var(--psg-surface); }
.popular-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s4); counter-reset: pop; }
.popular-item { display: flex; gap: var(--s4); padding-bottom: var(--s4); border-bottom: 1px solid var(--psg-border); }
.popular-item:last-child { border-bottom: 0; padding-bottom: 0; }
.popular-rank { font-family: var(--font-head); font-size: 1.4rem; font-weight: 800; color: var(--psg-border); line-height: 1; min-width: 1.8ch; }
.popular-content { flex: 1; }
.popular-title { font-size: 1rem; line-height: 1.3; margin: .15rem 0 .35rem; }
.popular-title a { color: var(--psg-primary); }
.popular-title a:hover { color: var(--psg-accent); }

/* ---- 13. NEWSLETTER ------------------------------------------------------ */
.newsletter-section { padding-block: var(--s7); }
.newsletter-inner { background: var(--psg-primary); color: #fff; border-radius: var(--radius-lg); padding: clamp(2rem,1.5rem + 3vw,4rem); position: relative; overflow: hidden; }
.newsletter-inner::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(var(--psg-secondary) 1px, transparent 1px); background-size: 22px 22px; opacity: .5; }
.newsletter-content { position: relative; max-width: 640px; }
.newsletter-eyebrow { color: #93C5FD; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.newsletter-title { color: #fff; margin: var(--s3) 0 var(--s3); }
.newsletter-text { color: #CBD5E1; margin-bottom: var(--s5); }
.newsletter-form { display: flex; gap: var(--s3); flex-wrap: wrap; }
.newsletter-form input[type="email"] { flex: 1; min-width: 220px; padding: .9rem 1rem; border: 1px solid var(--psg-secondary); border-radius: var(--radius); }
.newsletter-note { font-size: var(--fs-xs); color: #94A3B8; margin: var(--s3) 0 0; }

/* ---- 14. RESOURCE HUB ---------------------------------------------------- */
.resource-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--s5); }
.resource-card { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s5); border: 1px solid var(--psg-border); border-radius: var(--radius-lg); background: #fff; transition: all var(--tr); height: 100%; }
.resource-card:hover { border-color: var(--psg-accent); box-shadow: var(--shadow); }
.resource-type-badge { align-self: flex-start; font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--psg-accent); background: var(--psg-accent-soft); padding: .25rem .6rem; border-radius: 999px; }
.resource-card-title { font-size: 1.2rem; margin: 0; }
.resource-card-title a { color: var(--psg-primary); }
.resource-card-title a:hover { color: var(--psg-accent); }
.resource-card-excerpt { color: var(--psg-muted); font-size: var(--fs-sm); margin: 0; flex: 1; }
.resource-card-link { font-weight: 700; font-size: var(--fs-sm); margin-top: var(--s2); }
.resource-card-link--muted { color: var(--psg-muted); }
.resource-card--placeholder { background: var(--psg-surface); border-style: dashed; }

/* ---- 15. SINGLE ARTICLE -------------------------------------------------- */
.article-wrap { padding-block: var(--s7) var(--s8); }
.article-header { max-width: 760px; margin-inline: auto; margin-bottom: var(--s6); }
.article-header .entry-kicker { margin-bottom: var(--s4); }
.article-title { font-size: clamp(2rem,1.4rem + 2.6vw,3rem); margin-bottom: var(--s5); }
.article-dek { font-size: var(--fs-lead); color: var(--psg-secondary); line-height: 1.5; margin-bottom: var(--s5); }
.article-meta { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; color: var(--psg-muted); font-size: var(--fs-sm); padding-block: var(--s4); border-top: 1px solid var(--psg-border); border-bottom: 1px solid var(--psg-border); }
.article-meta-author { display: flex; align-items: center; gap: .6rem; }
.article-meta-author img { width: 40px; height: 40px; border-radius: 50%; }
.article-meta-author .name { font-weight: 700; color: var(--psg-text); }
.article-byline-sep { color: var(--psg-border); }

.article-hero-media { max-width: 1000px; margin: var(--s6) auto; }
.article-hero-media img { width: 100%; border-radius: var(--radius-lg); }
.article-hero-media figcaption { text-align: center; font-size: var(--fs-sm); color: var(--psg-muted); margin-top: var(--s3); }

.article-layout { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: var(--s7); max-width: 1080px; margin-inline: auto; align-items: start; }
.article-main { max-width: 760px; }
.article-content { font-size: 1.125rem; line-height: 1.75; }
.article-content > * { margin-bottom: var(--s5); }
.article-content h2 { font-size: var(--fs-h2); margin-top: var(--s7); scroll-margin-top: calc(var(--header-h) + 1rem); }
.article-content h3 { font-size: var(--fs-h3); margin-top: var(--s6); scroll-margin-top: calc(var(--header-h) + 1rem); }
.article-content img { border-radius: var(--radius); }
.article-content figcaption { font-size: var(--fs-sm); color: var(--psg-muted); margin-top: var(--s2); }
.article-content ul, .article-content ol { padding-left: 1.4rem; }
.article-content li { margin-bottom: .5rem; }
.article-content a { text-decoration: underline; text-underline-offset: 2px; }

.article-sidebar { position: sticky; top: calc(var(--header-h) + 1.5rem); display: grid; gap: var(--s5); }

/* TOC */
.toc { border: 1px solid var(--psg-border); border-radius: var(--radius); padding: var(--s5); background: var(--psg-surface); }
.toc-title { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--psg-muted); margin: 0 0 var(--s4); }
.toc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; counter-reset: toc; }
.toc-list a { display: block; padding: .4rem .6rem; border-radius: 6px; color: var(--psg-secondary); font-size: var(--fs-sm); border-left: 2px solid transparent; }
.toc-list a:hover { background: #fff; }
.toc-list a.is-active { color: var(--psg-accent); border-left-color: var(--psg-accent); background: var(--psg-accent-soft); font-weight: 600; }
.toc-level-3 a { padding-left: 1.4rem; font-size: .82rem; }

/* Share */
.share-buttons { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-block: var(--s6); padding-block: var(--s5); border-top: 1px solid var(--psg-border); border-bottom: 1px solid var(--psg-border); }
.share-label { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--psg-muted); font-weight: 700; margin-right: var(--s2); }
.share-btn { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 1px solid var(--psg-border); border-radius: var(--radius); color: var(--psg-secondary); background: #fff; cursor: pointer; transition: all var(--tr); }
.share-btn:hover { background: var(--psg-primary); color: #fff; border-color: var(--psg-primary); }
.share-copy.copied { background: var(--psg-accent); color: #fff; border-color: var(--psg-accent); }

/* Tags */
.entry-tags { margin-block: var(--s6); display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.entry-tags-label { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--psg-muted); font-weight: 700; }
.tag-chips { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s2); margin: 0; padding: 0; }
.tag-chip { display: inline-block; font-size: var(--fs-sm); padding: .35rem .75rem; background: var(--psg-surface); border: 1px solid var(--psg-border); border-radius: 999px; color: var(--psg-secondary); }
.tag-chip:hover { background: var(--psg-accent-soft); color: var(--psg-accent); border-color: var(--psg-accent); }

/* Author box */
.author-box { display: flex; gap: var(--s5); padding: var(--s6); background: var(--psg-surface); border-radius: var(--radius-lg); margin-block: var(--s7); max-width: 760px; margin-inline: auto; }
.author-box-avatar img, .author-avatar { width: 80px; height: 80px; border-radius: 50%; flex-shrink: 0; }
.author-box-label { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--psg-muted); font-weight: 700; }
.author-box-name { margin: .25rem 0 .25rem; font-size: 1.2rem; }
.author-box-name a { color: var(--psg-primary); }
.author-box-bio { color: var(--psg-muted); font-size: var(--fs-sm); margin: 0 0 var(--s3); }
.author-box-link { font-weight: 700; font-size: var(--fs-sm); }

/* Related */
.related-posts { margin-block: var(--s8); }
.related-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--s5); }

/* Post nav */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); margin-block: var(--s7); max-width: 1080px; margin-inline: auto; }
.post-nav a { display: block; padding: var(--s5); border: 1px solid var(--psg-border); border-radius: var(--radius); }
.post-nav a:hover { border-color: var(--psg-accent); }
.post-nav-dir { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--psg-muted); }
.post-nav-title { display: block; font-weight: 700; color: var(--psg-primary); margin-top: .35rem; }
.post-nav .next { text-align: right; }

/* ---- 16. CASE STUDY ------------------------------------------------------ */
.cs-meta { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: var(--s5); padding: var(--s6); background: var(--psg-surface); border-radius: var(--radius-lg); margin-block: var(--s6); max-width: 760px; margin-inline: auto; }
.cs-meta dt { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--psg-muted); font-weight: 700; margin-bottom: .35rem; }
.cs-meta dd { margin: 0; font-weight: 700; color: var(--psg-primary); font-size: 1.05rem; }
.cs-result strong { font-size: 1.7rem; color: var(--psg-accent); font-family: var(--font-head); }

/* ---- 17. PAGE / PILLAR --------------------------------------------------- */
.page-hero { padding-block: var(--s8); border-bottom: 1px solid var(--psg-border); }
.page-hero .container { max-width: 820px; }
.page-content { padding-block: var(--s7); }
.page-content-inner { max-width: 760px; margin-inline: auto; font-size: 1.125rem; line-height: 1.75; }
.page-content-inner > * { margin-bottom: var(--s5); }
.page-content-inner h2 { margin-top: var(--s7); }
.page-content-inner h3 { margin-top: var(--s6); }

.pillar-toc { background: var(--psg-surface); border-radius: var(--radius-lg); padding: var(--s6); margin-block: var(--s6); }
.pillar-toc h2 { font-size: 1.2rem; margin-top: 0; }
.pillar-toc ol { columns: 2; gap: var(--s6); margin: 0; }
.pillar-toc li { margin-bottom: .5rem; break-inside: avoid; }

/* ---- 18. ARCHIVE / SEARCH ------------------------------------------------ */
.archive-header { padding-block: var(--s7); border-bottom: 1px solid var(--psg-border); margin-bottom: var(--s7); }
.archive-title { margin-bottom: var(--s3); }
.archive-description { color: var(--psg-muted); max-width: 60ch; margin: 0; }
.content-sidebar-layout { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: var(--s7); align-items: start; }
.archive-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s6); }
.main-sidebar { position: sticky; top: calc(var(--header-h) + 1.5rem); display: grid; gap: var(--s6); }

/* ---- 19. WIDGETS --------------------------------------------------------- */
.widget { margin-bottom: var(--s6); padding-bottom: var(--s6); border-bottom: 1px solid var(--psg-border); }
.widget:last-child { border-bottom: 0; }
.widget-title { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .06em; color: var(--psg-muted); margin-bottom: var(--s4); }
.widget ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.widget a { color: var(--psg-secondary); }
.widget a:hover { color: var(--psg-accent); }

/* ---- 20. PAGINATION ------------------------------------------------------ */
.pagination { margin-block: var(--s8) 0; }
.pagination-list { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: center; align-items: center; list-style: none; padding: 0; margin: 0; }
.pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 .75rem; border: 1px solid var(--psg-border); border-radius: var(--radius); color: var(--psg-secondary); font-weight: 600; }
.pagination .page-numbers:hover { border-color: var(--psg-accent); color: var(--psg-accent); }
.pagination .page-numbers.current { background: var(--psg-primary); color: #fff; border-color: var(--psg-primary); }
.pagination .page-numbers.dots { border: 0; }

/* ---- 21. COMMENTS -------------------------------------------------------- */
.comments-area { max-width: 760px; margin: var(--s8) auto 0; }
.comments-title { margin-bottom: var(--s5); }
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-body { padding: var(--s5) 0; border-bottom: 1px solid var(--psg-border); }
.comment-list .children { list-style: none; padding-left: var(--s6); }
.comment-author { font-weight: 700; color: var(--psg-primary); display: flex; align-items: center; gap: .5rem; }
.comment-author .avatar { border-radius: 50%; }
.comment-metadata { font-size: var(--fs-xs); color: var(--psg-muted); margin-bottom: var(--s3); }
.comment-respond { margin-top: var(--s6); }
.comment-form label { display: block; margin-bottom: .4rem; font-weight: 600; font-size: var(--fs-sm); }
.comment-form input, .comment-form textarea { width: 100%; margin-bottom: var(--s4); }
.comment-form .submit { width: auto; background: var(--psg-accent); color: #fff; border: 0; padding: .8rem 1.6rem; border-radius: var(--radius); font-weight: 700; cursor: pointer; }

/* ---- 22. FORMS ----------------------------------------------------------- */
input[type="text"], input[type="email"], input[type="search"], input[type="url"], input[type="tel"], textarea, select {
  font-family: inherit; font-size: 1rem; padding: .8rem 1rem; border: 1px solid var(--psg-border); border-radius: var(--radius); background: #fff; color: var(--psg-text); width: 100%;
}
input:focus, textarea:focus, select:focus { border-color: var(--psg-accent); outline: none; box-shadow: 0 0 0 3px var(--psg-accent-soft); }

/* ---- 23. 404 ------------------------------------------------------------- */
.error-404 { padding-block: var(--s9); text-align: center; }
.error-404 .error-code { font-size: clamp(4rem,3rem + 8vw,9rem); font-weight: 800; color: var(--psg-border); line-height: 1; font-family: var(--font-head); }
.error-404 h1 { margin-top: var(--s4); }
.error-404 p { color: var(--psg-muted); max-width: 50ch; margin-inline: auto; }
.error-404 .search-form { max-width: 480px; margin: var(--s6) auto 0; }

/* ---- 24. FOOTER ---------------------------------------------------------- */
.site-footer { background: var(--psg-primary); color: #CBD5E1; margin-top: var(--s9); }
.site-footer a { color: #CBD5E1; }
.site-footer a:hover { color: #fff; }
.footer-top { padding-block: var(--s8); display: grid; grid-template-columns: 1.6fr repeat(3,1fr); gap: var(--s6); }
.footer-brand .logo-name { color: #fff; }
.footer-brand p { margin-top: var(--s4); font-size: var(--fs-sm); max-width: 38ch; color: #94A3B8; }
.footer-col h3, .footer-widget-title { color: #fff; font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .06em; margin-bottom: var(--s4); }
.footer-col ul, .footer-widget ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; font-size: var(--fs-sm); }
.footer-newsletter input[type="email"] { margin-bottom: var(--s3); }
.footer-bottom { border-top: 1px solid var(--psg-secondary); padding-block: var(--s5); display: flex; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; font-size: var(--fs-xs); color: #94A3B8; align-items: center; }
.footer-social { display: flex; gap: var(--s3); }
.footer-social a { width: 38px; height: 38px; border: 1px solid var(--psg-secondary); border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center; }
.footer-social a:hover { background: var(--psg-secondary); }
.footer-logo-mark { color: var(--psg-accent); }

/* ---- 25. BACK TO TOP ----------------------------------------------------- */
.back-to-top { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 90; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--psg-primary); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transform: translateY(12px); transition: all var(--tr); box-shadow: var(--shadow); }
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--psg-accent); }

/* ---- 25b. TEMPLATE CLASS RECONCILIATION ---------------------------------
   These map the exact class names used in the PHP templates onto the
   editorial layout system above. Keeps markup and styles in lockstep.
   ------------------------------------------------------------------------- */
.container--narrow { max-width: 760px; }

/* Single article real classes */
.single-post .article-header { max-width: none; margin-bottom: var(--s6); }
.single-post .article-header .container--narrow { margin-inline: auto; }
.article-featured-image { margin-block: var(--s6); }
.article-featured-image img { width: 100%; border-radius: var(--radius-lg); }
.article-image-caption { text-align: center; font-size: var(--fs-sm); color: var(--psg-muted); margin-top: var(--s3); }

.single-post .article-layout { grid-template-columns: minmax(0,1fr) 300px; }
.article-body { max-width: 760px; min-width: 0; }
.article-body .entry-content { font-size: 1.125rem; line-height: 1.75; }
.article-body .entry-content > * { margin-bottom: var(--s5); }
.article-body .entry-content h2 { font-size: var(--fs-h2); margin-top: var(--s7); scroll-margin-top: calc(var(--header-h) + 1rem); }
.article-body .entry-content h3 { font-size: var(--fs-h3); margin-top: var(--s6); scroll-margin-top: calc(var(--header-h) + 1rem); }
.article-body .entry-content img { border-radius: var(--radius); }
.article-body .entry-content ul, .article-body .entry-content ol { padding-left: 1.4rem; }
.article-body .entry-content li { margin-bottom: .5rem; }
.article-body .entry-content a { text-decoration: underline; text-underline-offset: 2px; }
.article-share-bottom { margin-block: var(--s6); }

.article-sidebar-sticky { position: sticky; top: calc(var(--header-h) + 1.5rem); display: grid; gap: var(--s5); }
.article-meta-author-info { display: flex; flex-direction: column; }
.article-meta-name { font-weight: 700; color: var(--psg-text); }
.article-meta-sub { display: flex; align-items: center; gap: .5rem; }
.article-meta-avatar { width: 44px; height: 44px; border-radius: 50%; }

.widget-newsletter-mini, .widget-popular-mini { background: var(--psg-surface); border: 1px solid var(--psg-border); border-radius: var(--radius-lg); padding: var(--s5); }
.widget-newsletter-mini p, .widget-popular-mini p { color: var(--psg-muted); font-size: var(--fs-sm); }
.widget-popular-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.widget-popular-list a { color: var(--psg-primary); font-weight: 600; font-size: var(--fs-sm); }
.widget-popular-list a:hover { color: var(--psg-accent); }
.btn-sm { padding: .55rem 1rem; font-size: .85rem; }

/* Newsletter real classes */
.newsletter-inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--s7); align-items: center; }
.newsletter-copy, .newsletter-form-wrap { position: relative; z-index: 1; }
.newsletter-heading { color: #fff; margin: var(--s3) 0; }
.newsletter-input { padding: .9rem 1rem !important; border: 1px solid var(--psg-secondary) !important; }
.newsletter-message { color: #93C5FD; font-size: var(--fs-sm); margin-top: var(--s3); }
.newsletter-message[hidden] { display: none; }

/* Footer real classes */
.footer-columns { display: contents; }
.footer-menu { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; font-size: var(--fs-sm); }
.footer-menu li { margin: 0; }
.site-logo-text--footer .logo-name { color: #fff; }

/* Related section uses latest-grid */
.related-section .latest-grid { grid-template-columns: repeat(3,1fr); }

/* ---- 27. REMAINING TEMPLATE STYLES --------------------------------------- */
/* 404 (real class names) */
.error-404 { padding-block: var(--s8); text-align: center; }
.error-404-code { font-size: clamp(4rem,3rem + 8vw,9rem); font-weight: 800; color: var(--psg-border); line-height: 1; font-family: var(--font-head); display: block; }
.error-404-title { margin-top: var(--s4); }
.error-404-text { color: var(--psg-muted); max-width: 52ch; margin: 0 auto var(--s5); }
.error-404-links { margin-block: var(--s5); }
.error-404-recent { margin-top: var(--s8); text-align: left; }
.error-404-recent-title { font-size: 1.2rem; margin-bottom: var(--s5); text-align: center; }

/* Search forms */
.search-page-form { display: flex; gap: var(--s3); margin-top: var(--s5); max-width: 520px; }
.search-page-form input[type="search"] { flex: 1; }
.search-form { display: flex; gap: var(--s3); }
.search-form label { flex: 1; margin: 0; }
.search-query { color: var(--psg-accent); }
.no-results { padding: var(--s6); background: var(--psg-surface); border-radius: var(--radius-lg); }
.no-results-title { margin-bottom: var(--s3); }

/* Page template */
.page-main { padding-block: var(--s7) var(--s8); }
.page-header { margin-bottom: var(--s6); }
.page-title { font-size: clamp(2rem,1.4rem + 2.4vw,2.8rem); }
.page-article .entry-content { font-size: 1.125rem; line-height: 1.75; }
.page-article .entry-content > * { margin-bottom: var(--s5); }
.page-article .entry-content h2 { margin-top: var(--s7); }
.page-article .entry-content h3 { margin-top: var(--s6); }
.page-featured-image { margin-block: var(--s5) var(--s6); }
.page-featured-image img { width: 100%; border-radius: var(--radius-lg); }

/* Case study / resource kicker */
.entry-kicker--case { background: var(--psg-accent-soft); padding: .25rem .7rem; border-radius: 999px; }
.cs-meta { margin-inline: auto; }

/* Pillar template */
.pillar-main { padding-bottom: var(--s8); }
.pillar-header { padding-block: var(--s7) var(--s5); }
.pillar-title { font-size: clamp(2.1rem,1.5rem + 2.8vw,3.2rem); margin-block: var(--s4); }
.pillar-dek { font-size: var(--fs-lead); color: var(--psg-secondary); line-height: 1.5; }
.pillar-meta { display: flex; align-items: center; gap: .5rem; color: var(--psg-muted); font-size: var(--fs-sm); margin-top: var(--s4); }
.pillar-layout { display: grid; grid-template-columns: 260px minmax(0,1fr); gap: var(--s7); align-items: start; margin-top: var(--s6); }
.pillar-toc-sticky { position: sticky; top: calc(var(--header-h) + 1.5rem); }
.pillar-toc-label { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--psg-muted); display: block; margin-bottom: var(--s3); }
.pillar-toc-cta { margin-top: var(--s5); }
.pillar-body { max-width: 760px; min-width: 0; }
.entry-content--pillar { font-size: 1.125rem; line-height: 1.8; }
.entry-content--pillar > * { margin-bottom: var(--s5); }
.entry-content--pillar h2 { font-size: var(--fs-h2); margin-top: var(--s8); padding-top: var(--s4); border-top: 1px solid var(--psg-border); scroll-margin-top: calc(var(--header-h) + 1rem); }
.entry-content--pillar h3 { font-size: var(--fs-h3); margin-top: var(--s6); scroll-margin-top: calc(var(--header-h) + 1rem); }
.btn-block { display: flex; width: 100%; justify-content: center; }

/* Page-links (paged posts) */
.page-links { display: flex; gap: .4rem; align-items: center; margin-block: var(--s5); font-weight: 600; }
.page-links a, .page-links > span { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; border: 1px solid var(--psg-border); border-radius: var(--radius); }

/* Comment form layout */
.comment-form-author, .comment-form-email, .comment-form-url { display: inline-block; width: 100%; }
@media (min-width: 600px) {
  .comment-form-author, .comment-form-email { width: 48%; }
  .comment-form-author { margin-right: 3%; }
}

/* ---- 26. RESPONSIVE ------------------------------------------------------ */
@media (max-width: 1024px) {
  .latest-layout { grid-template-columns: 1fr; }
  .latest-sidebar { position: static; }
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { position: static; order: -1; }
  .content-sidebar-layout { grid-template-columns: 1fr; }
  .main-sidebar { position: static; }
  .topics-grid { grid-template-columns: repeat(2,1fr); }
  .resource-grid, .related-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: var(--s6); }
  .hero-visual { order: -1; max-width: 460px; }
  .featured-grid { grid-template-columns: 1fr; }
  .feature-secondary { grid-template-rows: none; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .newsletter-inner { grid-template-columns: 1fr; gap: var(--s5); }
  .related-section .latest-grid { grid-template-columns: repeat(2,1fr); }
  .single-post .article-layout { grid-template-columns: 1fr; }
  .single-post .article-sidebar { position: static; }
  .article-sidebar-sticky { position: static; }
  .single-case-study .article-layout { grid-template-columns: 1fr; }
  .pillar-layout { grid-template-columns: 1fr; }
  .pillar-toc-sticky { position: static; }
  .pillar-toc-col { order: -1; }
}
@media (max-width: 820px) {
  .main-navigation, .header-subscribe-btn { display: none; }
  .menu-toggle { display: inline-flex; }
}
@media (max-width: 680px) {
  .latest-grid, .archive-grid, .topics-grid, .resource-grid, .related-grid, .related-section .latest-grid { grid-template-columns: 1fr; }
  .feature-secondary .post-card { flex-direction: column; }
  .feature-secondary .post-card-thumb { width: 100%; aspect-ratio: 16/9; }
  .feature-secondary .post-card-excerpt { display: block; }
  .footer-top { grid-template-columns: 1fr; }
  .post-nav { grid-template-columns: 1fr; }
  .pillar-toc ol { columns: 1; }
  .section { padding-block: var(--s7); }
  .article-meta { gap: var(--s3); }
}
