/* ==========================================================================
   Action Accountants — Blog
   Design tokens lifted from actionaccountants.uk (Divi): oxblood #90100f,
   Raleway headings, Open Sans body, #333 headings on #666 body copy.
   ========================================================================== */

/* Tokens live in design-tokens.css (generated). Loaded before this file. */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-foreground);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  margin: 0 0 .5em;
  color: var(--color-heading);
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.01em;
}

h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); }
h2 { font-size: clamp(1.55rem, 2.8vw, 2.2rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1.15em; }

a { color: var(--color-primary); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--color-primary-hover); }

img { max-width: 100%; height: auto; display: block; }

:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; border-radius: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--color-primary); color: var(--color-on-primary); padding: .75rem 1.25rem;
}
.skip:focus { left: 0; color: var(--color-on-primary); }

.wrap { width: min(100% - 2.5rem, var(--primitive-size-container)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 2.5rem, var(--primitive-size-container-narrow)); }

/* -- Buttons --------------------------------------------------------------- */

.btn {
  display: inline-block;
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-family: var(--font-heading);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .85rem 1.75rem;
  border: 2px solid var(--color-primary);
  border-radius: var(--primitive-radius-default);
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.btn:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); color: var(--color-on-primary); transform: translateY(-1px); }

.btn-sm    { padding: .6rem 1.15rem; font-size: .75rem; }
.btn-ghost { background: transparent; color: var(--color-primary); }
.btn-ghost:hover { background: var(--color-primary); color: var(--color-on-primary); }
.btn-light { background: var(--color-background); border-color: var(--color-background); color: var(--color-primary); }
.btn-dark {
  background: var(--color-inverse-background);
  border-color: var(--color-inverse-background);
  color: var(--color-on-inverse);
  border-radius: var(--primitive-radius-full);
  padding-inline: 2rem;
}
.btn-dark:hover { background: var(--color-primary); border-color: var(--color-primary); }
.btn-light:hover { background: transparent; color: var(--color-on-primary); border-color: var(--color-on-primary); }

/* -- Header ---------------------------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg-translucent);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--color-border);
  transition: transform .26s ease;
}

/* Reading down the article hides the bar; heading back up brings it straight
   back. main.js adds the class — without JS the header just stays put. */
.site-header.is-hidden { transform: translateY(-100%); }

@media (prefers-reduced-motion: reduce) {
  .site-header { transition: none; }
}

.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 78px; }

.brand img { width: auto; height: 44px; object-fit: contain; }

.site-nav { display: flex; align-items: center; gap: 1.75rem; margin-left: auto; }
/* Direct child only. `.site-nav ul` also matched the Services dropdown, which
   is a <ul> too, and laid it out as a horizontal flex row that no rule in the
   dropdown block could outrank. */
.site-nav > ul { display: flex; gap: 1.6rem; list-style: none; margin: 0; padding: 0; }

.site-nav a {
  color: var(--color-heading);
  font-family: var(--font-heading);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  position: relative;
  padding-block: .35rem;
}
.site-nav a::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 0; height: 2px; background: var(--color-primary); transition: width .2s ease;
}
.site-nav a:hover, .site-nav a.is-active { color: var(--color-primary); }
.site-nav a:hover::after, .site-nav a.is-active::after { width: 100%; }
/* -- Nav dropdown ---------------------------------------------------------- */

/* The parent site's Services menu is a dropdown parent whose own href is "#" —
   there is no services landing page — so this mirrors it rather than linking
   somewhere that would 404. Children point at the real service pages. */

.site-nav .has-submenu { position: relative; }

.submenu-toggle {
  display: inline-flex; align-items: center; gap: .3rem;
  margin: 0; padding: .35rem 0;
  background: none; border: 0; cursor: pointer;
  color: var(--color-heading);
  font-family: var(--font-heading);
  font-size: .82rem; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase;
}
.submenu-toggle svg { width: 13px; height: 13px; transition: transform .2s ease; }
.submenu-toggle:hover { color: var(--color-primary); }
.has-submenu:hover > .submenu-toggle,
.submenu-toggle[aria-expanded="true"] { color: var(--color-primary); }
.submenu-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

.submenu {
  position: absolute; top: calc(100% + .55rem); left: 50%;
  transform: translateX(-50%);
  display: block;
  min-width: 264px;
  margin: 0; padding: .5rem;
  list-style: none;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--primitive-radius-lg);
  box-shadow: var(--primitive-shadow-lg, 0 18px 40px rgb(0 0 0 / .13));
  /* Hidden but still laid out, so the width is measurable and the open
     transition has something to animate from. */
  opacity: 0; visibility: hidden;
  translate: 0 -6px;
  transition: opacity .16s ease, translate .16s ease, visibility .16s;
}

/* Hover covers a mouse; focus-within covers a keyboard even with no JS; the
   attribute covers a click or a tap, which never produces hover. */
.has-submenu:hover > .submenu,
.has-submenu:focus-within > .submenu,
.submenu-toggle[aria-expanded="true"] + .submenu {
  opacity: 1; visibility: visible; translate: 0 0;
}

/* Bridges the gap between the button and the panel so the pointer can travel
   without the menu closing under it. */
.has-submenu::after {
  content: ''; position: absolute; left: 0; right: 0; top: 100%; height: .6rem;
}

.site-nav .submenu a {
  display: block;
  padding: .5rem .75rem;
  border-radius: var(--primitive-radius-default);
  font-size: .78rem;
  letter-spacing: .03em;
  text-transform: none;
  line-height: 1.35;
}
.site-nav .submenu a::after { display: none; }
.site-nav .submenu a:hover { background: var(--color-primary-subtle); color: var(--color-primary); }

@media (prefers-reduced-motion: reduce) {
  .submenu { transition: none; }
  .submenu-toggle svg { transition: none; }
}

/* .site-nav a (0,1,1) outranks .btn (0,1,0), so the button's own colour must
   be restated here or the label renders as dark text on the brand ground. */
.site-nav .btn { color: var(--color-on-primary); text-transform: uppercase; }
.site-nav .btn::after { display: none; }
.site-nav .btn:hover { color: var(--color-on-primary); }

.nav-toggle {
  display: none; margin-left: auto;
  width: 44px; height: 44px; padding: 10px;
  background: none; border: 0; cursor: pointer;
}
.nav-toggle span {
  display: block; height: 2px; background: var(--color-heading);
  border-radius: 2px; transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle span + span { margin-top: 5px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* -- Page intro ------------------------------------------------------------ */

.page-intro {
  border-bottom: 1px solid var(--color-border);
  padding-block: clamp(2.5rem, 5vw, 3.5rem);
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.page-intro-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(1.5rem, 4vw, 3rem);
  flex-wrap: wrap;
}
.page-intro h1 { margin-bottom: .3em; }
.page-intro .lede { max-width: 52ch; margin-bottom: 0; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: .9rem;
}
.eyebrow-light { color: var(--color-on-primary-muted); }
a.eyebrow:hover { color: var(--color-primary-hover); }

/* -- Search ---------------------------------------------------------------- */

.search { display: flex; gap: .5rem; width: min(100%, 440px); }
.search input {
  flex: 1; min-width: 0;
  padding: .85rem 1.1rem;
  font-family: var(--font-body); font-size: .95rem; color: var(--color-heading);
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--primitive-radius-default);
}
.search input:focus { outline: none; border-color: var(--color-primary); box-shadow: var(--primitive-shadow-focus); }
.search-inline { margin-top: 1.5rem; }

/* -- Featured hero card ---------------------------------------------------- */

.hero-card {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: clamp(320px, 46vw, 480px);
  padding: clamp(1.75rem, 4vw, 3rem);
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  border-radius: var(--primitive-radius-lg);
  overflow: hidden;
  color: var(--color-on-inverse);
  background-color: var(--color-inverse-background);
  background-image: var(--hero-image);
  background-size: cover;
  background-position: center;
  isolation: isolate;
}
.hero-card-plain {
  background-image: linear-gradient(150deg,
    var(--color-inverse-background) 0%,
    var(--primitive-color-brand-900) 55%,
    var(--color-primary) 140%);
}

/* Scrim so the headline stays readable whatever the photo is doing. */
.hero-card::after {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top,
    rgb(0 0 0 / .82) 0%,
    rgb(0 0 0 / .62) 45%,
    rgb(0 0 0 / .25) 100%);
}
.hero-card-plain::after { background: rgb(0 0 0 / .15); }

.hero-card-body { max-width: 62ch; }
.hero-card h2 {
  color: var(--color-on-inverse);
  font-size: clamp(1.75rem, 4vw, 3rem);
  margin-bottom: .5em;
}
.hero-card p { color: rgb(255 255 255 / .88); font-size: 1.03rem; margin-bottom: .8em; }
.hero-card-meta { font-size: .85rem; color: rgb(255 255 255 / .7); margin-bottom: 0; }
.hero-card-meta span { margin-inline: .45rem; }

.hero-card-go {
  position: absolute;
  right: clamp(1.75rem, 4vw, 3rem);
  bottom: clamp(1.75rem, 4vw, 3rem);
  display: grid; place-items: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 1px solid rgb(255 255 255 / .35);
  background: rgb(255 255 255 / .12);
  backdrop-filter: blur(6px);
  transition: background .2s ease, transform .2s ease;
}
.hero-card-go svg { width: 22px; height: 22px; }
.hero-card:hover .hero-card-go { background: var(--color-primary); border-color: var(--color-primary); transform: translateX(4px); }

/* -- Section head ---------------------------------------------------------- */

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
}
.section-head h2 { font-size: clamp(1.35rem, 2.2vw, 1.6rem); margin: 0; }
.section-head .meta { margin: 0; }

/* -- Tag bar --------------------------------------------------------------- */

.tagbar { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 2.5rem; }
.tagbar a {
  display: inline-flex; align-items: center; gap: .45rem;
  background: var(--color-surface); color: var(--color-heading);
  font-family: var(--font-heading); font-size: .8rem; font-weight: 600;
  padding: .45rem 1rem; border-radius: 999px;
  border: 1px solid transparent; transition: all .18s ease;
}
.tagbar a span { color: var(--color-muted-foreground); font-weight: 500; }
.tagbar a:hover { background: var(--color-primary-subtle); border-color: var(--color-primary); color: var(--color-primary); }
.tagbar a:hover span { color: var(--color-primary); }
.tagbar-foot { margin-block: 3rem 4rem; }

/* -- Grid + cards ---------------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: clamp(1.5rem, 3vw, 2.25rem);
  margin-bottom: 3.5rem;
}

.card {
  display: flex; flex-direction: column;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--primitive-radius-default);
  overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--primitive-shadow-default); border-color: transparent; }

.card-media { display: block; aspect-ratio: 16 / 9; background: var(--color-surface); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card-media img { transform: scale(1.045); }

/* Stand-in tile when an article has no image — stable hue per slug. */
.card-fallback {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  background: linear-gradient(135deg, hsl(var(--hue) 32% 90%), hsl(var(--hue) 26% 78%));
  color: var(--color-on-inverse); font-family: var(--font-heading); font-size: 3.5rem; font-weight: 800;
  text-shadow: 0 2px 10px rgb(0 0 0 / .16);
}

.card-body { display: flex; flex-direction: column; flex: 1; padding: 1.6rem 1.5rem 1.35rem; }
.card-body .eyebrow { margin-bottom: .6rem; }
.card-body h3 { font-size: 1.22rem; line-height: 1.35; margin-bottom: .6rem; }
.card-body h3 a { color: var(--color-heading); }
.card-body h3 a:hover { color: var(--color-primary); }
.card-body p { font-size: .93rem; margin-bottom: 1rem; }
.card-body .meta { margin-bottom: 0; }

/* Publication facts only. Posts carry no author credit anywhere on the site,
   so there is no name and no avatar disc — just when it went out and how long
   it takes to read. */
.entry-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: .5rem;
  margin: auto 0 0;
  padding-top: .25rem;
  font-family: var(--font-heading);
  font-size: .8rem;
  font-weight: 600;
  color: var(--color-muted-foreground);
}
.entry-meta a { color: var(--color-muted-foreground); }
.entry-meta a:hover { color: var(--color-primary); }

/* -- Pagination ------------------------------------------------------------ */

.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 1.5rem; margin-block: 1rem 4.5rem;
}
.pagination .meta { margin: 0; }

/* -- Page head / empty ----------------------------------------------------- */

.page-head { background: var(--color-surface); padding: clamp(2.5rem, 6vw, 4rem) 0; margin-bottom: 3rem; }
.page-head h1 { margin-bottom: .3em; }
.page-head .meta { margin-bottom: 0; }

.crumbs { font-family: var(--font-heading); font-size: .78rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; margin-bottom: 1rem; color: var(--color-muted-foreground); }
.crumbs span { margin-inline: .5rem; }

.empty { text-align: center; padding-block: clamp(3rem, 8vw, 6rem); }
.empty code { background: var(--color-surface); padding: .15rem .4rem; border-radius: 3px; font-size: .85em; }

/* -- Post layout ----------------------------------------------------------- */

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: clamp(1.75rem, 3.5vw, 3rem);
  align-items: start;
  padding-block: clamp(1.5rem, 3vw, 2.5rem) clamp(3rem, 6vw, 5rem);
}

.post { min-width: 0; }

.crumbs {
  font-family: var(--font-heading); font-size: .78rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  margin-bottom: 1.25rem; color: var(--color-muted-foreground);
}
.crumbs span { margin-inline: .5rem; }

.post-head { margin-bottom: clamp(1.5rem, 3vw, 2.25rem); }
.post-head .badge { margin-bottom: 1rem; }
.post-head h1 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.15;
  margin-bottom: .4em;
}
.post-head .lede {
  font-size: 1.12rem;
  color: var(--color-muted-foreground);
  margin-bottom: 1.5rem;
}

/* Byline sits under the headline on an article, above a rule. */
.post-head .entry-meta {
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
  font-size: .85rem;
}

.post-hero { margin: 0 0 clamp(1.75rem, 3.5vw, 2.75rem); }
.post-hero img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: var(--primitive-radius-lg);
}

/* The measure is set by the column, so the prose no longer needs its own
   width cap — remove the old .wrap-narrow constraint on this page. */
.post .prose { max-width: 72ch; }

.post-tags { display: flex; flex-wrap: wrap; gap: .55rem; margin-block: clamp(2rem, 4vw, 3rem) 0; }
.post-tags a {
  background: var(--color-surface); color: var(--color-foreground);
  font-size: .8rem; padding: .4rem .95rem; border-radius: var(--primitive-radius-full);
}
.post-tags a:hover { background: var(--color-primary-subtle); color: var(--color-primary); }

.post-note {
  margin-block: clamp(2rem, 4vw, 3rem) 0;
  padding: clamp(1.75rem, 4vw, 2.5rem);
  background: var(--color-primary-subtle);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--primitive-radius-default);
}
.post-note h2 { font-size: 1.35rem; }
.post-note p { margin-bottom: 1.4em; }

/* -- Badge ----------------------------------------------------------------- */

.badge {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: .72rem; font-weight: 700; letter-spacing: .04em;
  padding: .32rem .7rem;
  border-radius: var(--primitive-radius-default);
  background: var(--color-primary-subtle);
  color: var(--color-primary);
}
.badge:hover { background: var(--primitive-color-brand-200); }
.badge-sm { font-size: .66rem; padding: .2rem .5rem; }

/* -- Sidebar --------------------------------------------------------------- */

.sidebar {
  display: flex; flex-direction: column;
  gap: .85rem;
  min-width: 0;
  /* The whole column pins under the header and stays there for the article.
     It is taller than the viewport, so its lower blocks sit permanently below
     the fold — that is why the order in partial-sidebar.php puts the contact
     details high and leaves the two blocks the footer already repeats at the
     bottom. Shorten the column, do not add to it. */
  align-self: start;
  position: sticky;
  top: calc(var(--nav-height) + 1rem);
}

/* Never cap the height and scroll inside this column. An earlier version did,
   and it captured the mouse wheel whenever the pointer sat over the right-hand
   side — the page itself would not move. */

.side-card, .side-block {
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--primitive-radius-lg);
  /* Tighter than the rest of the page. The pinned column has a fixed budget of
     screen, so padding here is traded directly against how far down the column
     a reader can still see. */
  padding: 1.25rem;
}

.side-about { text-align: center; }
.about-logo {
  display: block;
  margin: 0 auto var(--primitive-spacing-3);
  padding-bottom: var(--primitive-spacing-3);
  border-bottom: 1px solid var(--color-border);
}
/* Kept small on purpose. The pinned column only has about 800px of screen, and
   every pixel the logo takes is a pixel of the contact card below the fold. */
.about-logo img {
  width: 112px; max-width: 100%; height: auto;
  margin-inline: auto;
  transition: opacity .15s ease;
}
.about-logo:hover img { opacity: .78; }
.side-about h2 { font-size: 1.25rem; margin-bottom: .2em; }
.about-role {
  font-family: var(--font-heading); font-size: .82rem; font-weight: 600;
  color: var(--color-primary); margin-bottom: 1em;
}
.about-bio { font-size: .92rem; margin-bottom: 1.25em; }

.side-heading {
  font-size: 1.05rem;
  margin-bottom: var(--primitive-spacing-4);
  padding-bottom: var(--primitive-spacing-3);
  border-bottom: 1px solid var(--color-border);
}

.side-post {
  display: flex; gap: .8rem; align-items: flex-start;
  padding: .7rem 0;
  border-bottom: 1px solid var(--color-border);
}
.side-post:last-child { border-bottom: 0; padding-bottom: 0; }
.side-post:first-of-type { padding-top: 0; }
.side-thumb {
  flex: none; width: 68px; height: 60px;
  border-radius: var(--primitive-radius-default);
  overflow: hidden; background: var(--color-surface);
}
.side-thumb img { width: 100%; height: 100%; object-fit: cover; }
.side-thumb .card-fallback { font-size: 1.4rem; }
.side-text { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.side-title {
  font-family: var(--font-heading);
  font-size: .92rem; font-weight: 700; line-height: 1.35;
  color: var(--color-heading);
}
.side-post:hover .side-title { color: var(--color-primary); }
.side-text .badge-sm { align-self: flex-start; }

.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { border-bottom: 1px solid var(--color-border); }
.side-list li:last-child { border-bottom: 0; }
.side-list a {
  display: block; padding: .6rem 0; font-size: .93rem;
  color: var(--color-foreground);
  transition: padding-left .15s ease, color .15s ease;
}
.side-list a:hover { color: var(--color-primary); padding-left: .25rem; }

.side-tools { display: flex; flex-direction: column; gap: .5rem; }
.side-tool {
  display: flex; align-items: center; gap: .6rem;
  padding: .7rem .9rem;
  border-radius: var(--primitive-radius-default);
  background: var(--color-surface);
  font-family: var(--font-heading); font-size: .9rem; font-weight: 600;
  color: var(--color-heading);
}
.side-tool:hover { background: var(--color-primary-subtle); color: var(--color-primary); }
.side-tool .icon { width: 18px; height: 18px; flex: none; color: var(--color-primary); }

.side-cta { background: var(--color-inverse-background); border-color: transparent; text-align: center; }
.side-cta h2 { color: var(--color-on-inverse); font-size: 1.1rem; }
.side-cta p { color: var(--color-on-inverse-muted); font-size: .9rem; margin-bottom: 1em; }
.cta-line {
  display: block;
  font-family: var(--font-heading); font-weight: 700;
  color: var(--color-on-inverse);
  padding: .3rem 0;
}
.cta-line:hover { color: var(--primitive-color-brand-300); }

.related { margin-block: 0 clamp(3rem, 6vw, 4.5rem); }

/* -- CTA ------------------------------------------------------------------- */

.cta { background: var(--color-primary); color: var(--color-on-primary-muted); padding: clamp(2.5rem, 6vw, 4rem) 0; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.cta h2 { color: var(--color-on-primary); margin-bottom: .25em; }
.cta p { margin: 0; color: var(--color-on-primary-muted); }

/* -- Footer ---------------------------------------------------------------- */

.site-footer { background: var(--color-inverse-background); color: var(--color-on-inverse-muted); font-size: .92rem; }

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.2fr;
  gap: clamp(2rem, 5vw, 4rem);
  padding-block: clamp(3rem, 6vw, 4.5rem) 3rem;
}

.footer-brand img { height: 46px; width: auto; object-fit: contain; margin-bottom: 1.25rem; }
.footer-brand p { max-width: 38ch; }

.footer-col h3 {
  color: var(--color-on-inverse); font-size: .82rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; margin-bottom: 1.2rem;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: .6rem; }
.footer-col a, .site-footer address a { color: var(--color-on-inverse-muted); }
.footer-col a:hover, .site-footer address a:hover { color: var(--color-on-inverse); }

.site-footer address { font-style: normal; line-height: 1.7; }

.socials { display: flex; gap: 1.1rem; margin-top: 1.4rem; }
.socials a { font-family: var(--font-heading); font-size: .78rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; }

.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap;
  border-top: 1px solid var(--color-inverse-border);
  padding-block: 1.5rem;
  font-size: .82rem;
}
.footer-bottom p { margin: 0; }

/* -- Responsive ------------------------------------------------------------ */

@media (max-width: 1024px) {
  .post-layout { grid-template-columns: 1fr; }
  .sidebar { align-self: auto; position: static; }
}

@media (max-width: 900px) {
  .featured { grid-template-columns: 1fr; }
  .featured { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 780px) {
  .nav-toggle { display: block; }

  /* Stacked panel: the dropdown becomes an accordion in the flow rather than
     an overlay, so it can never be pinned off the edge of a phone screen. */
  .site-nav .has-submenu { position: static; }
  .site-nav .has-submenu::after { display: none; }
  .submenu-toggle { width: 100%; justify-content: space-between; padding-block: .7rem; }

  .submenu {
    position: static; transform: none; translate: none;
    min-width: 0; margin: 0 0 .5rem; padding: 0 0 0 .75rem;
    background: none; border: 0; border-left: 2px solid var(--color-border);
    border-radius: 0; box-shadow: none;
    display: none; opacity: 1; visibility: visible;
  }
  .submenu-toggle[aria-expanded="true"] + .submenu { display: block; }
  /* Hover and focus-within must not spring the accordion open on a tap. */
  .has-submenu:hover > .submenu,
  .has-submenu:focus-within > .submenu { display: none; }
  .submenu-toggle[aria-expanded="true"] + .submenu { display: block; }

  .site-nav {
    position: fixed; inset: 78px 0 auto;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--color-background); border-bottom: 1px solid var(--color-border);
    padding: 1rem 1.25rem 1.5rem;
    box-shadow: var(--primitive-shadow-default);
    /* Collapsed by default on small screens; JS flips the attribute. */
    display: none;
  }
  .site-nav.is-open { display: flex; }

  /* Direct children only, so these do not reach into the Services dropdown. */
  .site-nav > ul { flex-direction: column; gap: 0; }
  .site-nav > ul > li { border-bottom: 1px solid var(--color-border); }
  .site-nav > ul > li > a { display: block; padding: .95rem .25rem; }
  .site-nav .submenu li { border-bottom: 0; }
  .site-nav .submenu a { padding: .55rem .25rem; }
  .site-nav a::after { display: none; }
  .site-nav .btn { margin-top: 1.1rem; text-align: center; }

  .grid { grid-template-columns: 1fr; }
  .cta-inner { flex-direction: column; align-items: flex-start; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* -- Infinite scroll ------------------------------------------------------- */

.infinite-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--primitive-spacing-3);
}
.infinite-note { margin: 0; text-align: center; }

/* Cards fade in as they stream, so new rows do not just snap into place.
   Suppressed entirely under prefers-reduced-motion. */
.card-enter {
  animation: card-in .45s var(--primitive-easing-out) both;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .card-enter { animation: none; }
}

/* -- Accreditations -------------------------------------------------------- */

/* The badges are supplied as PNGs drawn for a white ground, so the tile stays
   white in dark mode rather than fringing every logo. */
.side-badges { display: grid; grid-template-columns: 1fr 1fr; gap: var(--primitive-spacing-3); }
.side-badge {
  display: grid; place-items: center;
  min-height: 84px;
  padding: .8rem .7rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--primitive-radius-default);
}
.side-badge img { width: auto; max-width: 100%; max-height: 54px; object-fit: contain; }

/* -- Video embeds ---------------------------------------------------------- */

/* The sanitiser rebuilds every allowlisted iframe from its src alone, which
   discards the source width and height. With no rule here an iframe falls back
   to the replaced-element default of 300x150 — a stamp beside a 72ch measure.
   The ratio belongs in the frame, not in the markup we are rebuilding. */
.embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: clamp(1.75rem, 3.5vw, 2.5rem) 0;
  overflow: hidden;
  border-radius: var(--primitive-radius-lg);
  background: #000;
}
.embed iframe {
  position: absolute; inset: 0;
  display: block;
  width: 100%; height: 100%;
  border: 0;
}

/* WordPress wrapped some migrated embeds in its own figure. Strip the extra
   margin so the ratio box above is the only thing spacing them. */
.prose figure > .embed { margin: 0; }
.prose .wp-block-embed__wrapper { margin: 0; }

/* -- Unpublished preview --------------------------------------------------
   Shown only to a signed-in admin reading a post Outrank has not released.
   Deliberately loud: the page is otherwise identical to a live article, and
   the one thing the reader must not do is assume it is one. */

.preview-bar {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .4rem;
  margin-bottom: var(--primitive-spacing-6);
  padding: var(--primitive-spacing-4) var(--primitive-spacing-5);
  border: 1px solid var(--color-warning);
  border-left-width: 4px;
  border-radius: var(--primitive-radius-default);
  background: var(--color-warning-subtle);
  color: var(--color-warning);
  font-size: var(--primitive-fontSize-sm);
  line-height: var(--primitive-lineHeight-normal, 1.5);
}
.preview-bar a {
  margin-left: auto;
  color: inherit;
  font-weight: var(--primitive-fontWeight-bold);
  text-decoration: underline;
}
