/* =========================================================
   rem-lite — styles.css (Enterprise)
   Clean + consolidated
   Global → Layout → Components → Pages → Blocks → Utilities
   ========================================================= */

/* =========================================================
   GLOBAL – TOKENS
   ========================================================= */

:root{
  /* Core surfaces */
  --bg-primary:#08080d;
  --bg-secondary:#0e0e16;
  --bg-card:#12121e;
  --bg-card-hover:#181830;

  /* Text */
  --text-primary:#e8e8f0;
  --text-secondary:#a0a0b8;
  --text-tertiary:#6a6a88;

  /* Borders / lines */
  --border-subtle:#1a1a2e;

  /* Accent */
  --accent:#d4a012;

  /* Typography */
  --font-display:'DM Serif Display', Georgia, serif;
  --font-body:'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono:'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Layout */
  --container:1200px;

  /* Enterprise panels */
  --panel: rgba(255,255,255,.03);
  --panel-2: rgba(255,255,255,.05);
  --stroke: rgba(255,255,255,.08);
  --stroke-2: rgba(255,255,255,.12);
  --shadow: 0 20px 60px rgba(0,0,0,.45);

  /* Theme separators */
  --rem-sep: rgba(255,255,255,.12);
  --rem-sep-soft: rgba(255,255,255,.08);

  /* Compat aliases used by legacy/remixed templates */
  --rem-gold: var(--accent);
  --rem-panel: var(--panel);
  --rem-panel-2: var(--panel-2);
  --rem-border: var(--stroke);
  --rem-text: var(--text-primary);
  --rem-muted: var(--text-secondary);
  --rem-dim: var(--text-tertiary);
  --rem-shadow: var(--shadow);
  --rem-radius-lg: 18px;
  --rem-radius-md: 14px;
  --rem-radius-sm: 10px;
}

/* Light mode tokens — supports multiple toggle implementations */
body.light-mode,
body.is-light,
html.is-light,
[data-theme="light"],
body[data-theme="light"]{
  --bg-primary:#f8f9fa;
  --bg-secondary:#ffffff;
  --bg-card:#ffffff;
  --bg-card-hover:#f1f3f5;

  --text-primary:#1a1a2e;
  --text-secondary:#495057;
  --text-tertiary:#6c757d;

  --border-subtle:#dee2e6;

  --panel: rgba(0,0,0,.03);
  --panel-2: rgba(0,0,0,.05);
  --stroke: rgba(0,0,0,.10);
  --stroke-2: rgba(0,0,0,.14);
  --shadow: 0 18px 50px rgba(0,0,0,.12);

  --rem-sep: rgba(0,0,0,.12);
  --rem-sep-soft: rgba(0,0,0,.08);
}

/* Dark mode explicit (optional safety) */
body.is-dark,
html.is-dark,
[data-theme="dark"],
body[data-theme="dark"]{
  --rem-sep: rgba(255,255,255,.12);
  --rem-sep-soft: rgba(255,255,255,.08);
}

/* =========================================================
   GLOBAL – BASE
   ========================================================= */

*{ box-sizing:border-box; }

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

body{
  font-family:var(--font-body);
  background:var(--bg-primary);
  color:var(--text-primary);
  margin:0;
  line-height:1.6;
  transition:background .25s ease, color .25s ease;
}

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

a{ color:var(--accent); text-decoration:none; }
a:hover{ opacity:.9; }

.container{
  max-width:var(--container);
  margin:0 auto;
  padding:0 24px;
}

/* =========================================================
   LAYOUT – SECTIONS / HEADINGS
   ========================================================= */

.page-section{
  padding: 0 0;
}

.page-section > *:last-child{ margin-bottom:0 !important; }

.page-title{
  font-family:var(--font-display);
  font-size:2.5rem;
  margin:0 0 0;
  letter-spacing: .2px;
}

.page-subtitle{
  color:var(--text-secondary);
  font-size:1.1rem;
  max-width:820px;
  margin:0 0 28px;
}

.section-title{
  font-family:var(--font-display);
  font-size:2rem;
  margin:0 0 18px;
}

/* Gutenberg headings often add margins */
.wp-block-heading{ margin: 0 0 18px; }

/* =========================================================
   LAYOUT – TWO COLUMN GRIDS (RESTORES SIDEBARS)
   ========================================================= */

/* Generic 2-col layout wrapper used on archives/search AND can be reused on singles */
.archive-layout{
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  align-items: start;
}

@media (max-width: 980px){
  .archive-layout{ grid-template-columns: 1fr; }
}

/* Optional “single” grid class (if your template uses it) */
.editorial-single__grid{
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  align-items: start;
}

@media (max-width: 980px){
  .editorial-single__grid{ grid-template-columns: 1fr; }
}

/* Make right rail sticky when present */
.editorial-rail,
.rem-articles__rail{
  position: sticky;
  top: 18px;
  align-self: start;
}

@media (max-width: 980px){
  .editorial-rail,
  .rem-articles__rail{
    position: relative;
    top: auto;
  }
}

/* =========================================================
   HEADER / NAV
   ========================================================= */

.site-header{
  position: sticky;
  top: 0;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--rem-sep);
  z-index: 1000;
}

.site-header__inner{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 70px;
}

/* Logo */
.site-logo{
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  min-width: 0;
}

.site-logo__mark{
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  flex-shrink: 0;
}

.site-logo span{
  font-weight: 700;
  white-space: nowrap;
}

/* Desktop nav */
.site-nav{
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.site-nav__menu{
  display: flex;
  gap: 20px;
  align-items: center;
}

.site-nav__link{
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: color .2s ease;
}

.site-nav__link.active,
.site-nav__link:hover{
  color: var(--accent);
}

/* Theme toggle */
.theme-toggle{
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 1.35rem;
  line-height: 1;
  opacity: .9;
}
.theme-toggle:hover{ opacity: 1; }

/* Header search */
.site-search{
  display:flex;
  align-items:center;
  margin-left: 10px;
  position: relative;
}

.site-search__input{
  width: 260px;
  max-width: 36vw;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--panel);
  color: var(--text-primary);
  outline: none;
}

.site-search__input::placeholder{
  color: color-mix(in srgb, var(--text-secondary) 70%, transparent);
}

.site-search__input:focus{
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

/* Hamburger */
.nav-toggle{
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle__bar{
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  transition: transform .3s ease, opacity .3s ease;
}
.site-header.is-menu-open .nav-toggle__bar:nth-child(1){
  transform: translateY(7px) rotate(45deg);
}
.site-header.is-menu-open .nav-toggle__bar:nth-child(2){
  opacity: 0;
}
.site-header.is-menu-open .nav-toggle__bar:nth-child(3){
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile dropdown */
@media (max-width: 900px){
  .site-search{ display:none; } /* optional: keep header clean on mobile */

  .nav-toggle{
    display: flex;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1002;
  }

  .site-nav__menu{
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--rem-sep);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 16px 24px;
    z-index: 1001;
  }

  .site-header.is-menu-open .site-nav__menu{ display:flex; }

  .site-nav__link{
    width: 100%;
    padding: 14px 0;
    font-size: 16px;
  }

  .site-nav{
    margin-left: auto;
    padding-right: 48px;
  }

  .theme-toggle{ margin-top: 10px; }
}

/* =========================================================
   BUTTONS (RESTORED)
   ========================================================= */

.btn,
.wp-block-button__link,
button.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--stroke));
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 650;
  text-decoration:none;
  line-height:1.1;
}

.btn:hover,
.wp-block-button__link:hover{
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--stroke));
}

.btn--solid{
  background: var(--accent);
  border-color: var(--accent);
  color: #111;
}
.btn--solid:hover{ opacity:.92; }

/* =========================================================
   FOOTER
   ========================================================= */

.site-footer{
  padding:22px 0;
  border-top:1px solid var(--rem-sep);
  margin-top:50px;
}

.footer-nav{ display:flex; gap:20px; flex-wrap:wrap; margin-bottom:20px; }

.footer-link{
  color:var(--accent);
  font-size:14px;
  font-weight:500;
}
.footer-link:hover{ opacity:.7; }

.copyright{ color:var(--text-tertiary); font-size:12px; }

/* =========================================================
   COMPONENT – BASIC CARDS
   ========================================================= */

.card{
  background:var(--bg-card);
  border:1px solid var(--border-subtle);
  border-radius:14px;
  padding:28px;
}

/* =========================================================
   COMPONENT – ARTICLE CARDS (GENERIC GRID)
   ========================================================= */

.article-card{
  background:var(--bg-card);
  border:1px solid var(--border-subtle);
  border-radius:14px;
  padding:18px;
  text-decoration:none;
  color:inherit;
}

.article-card__category{
  font-family:var(--font-mono);
  color:var(--accent);
  font-size:11px;
  text-transform:uppercase;
  margin:0 0 10px;
}

.article-grid{
  display:grid;
  gap:18px;
  padding: 18px 0;
  align-items:start;
}

@media (min-width:1200px){
  .article-grid{ grid-template-columns:repeat(4,1fr); }
}
@media (min-width:768px) and (max-width:1199px){
  .article-grid{ grid-template-columns:repeat(2,1fr); }
}
@media (max-width:767px){
  .article-grid{ grid-template-columns:1fr; }
}

.article-card__thumb{
  width:100%;
  aspect-ratio:16/9;
  border-radius:12px;
  overflow:hidden;
  border:1px solid var(--border-subtle);
  background:var(--bg-secondary);
  margin-bottom:14px;
}

.article-card__thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.article-card__title{
  margin:0;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.article-card__excerpt{
  margin:0;
  color:var(--text-secondary);
  display:-webkit-box;
  -webkit-line-clamp:3;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

/* =========================================================
   BLOCKS / GUTENBERG – NORMALIZE SPACING + SEPARATORS
   ========================================================= */

.wp-block-columns{
  gap:24px;
  align-items:stretch;
  margin:0;
}

.wp-block-column{ min-width:0; }

.wp-block-separator{
  margin:18px 0 !important;
  opacity: 1 !important;
  height: 1px !important;
  border: 0 !important;
  background: var(--rem-sep) !important;
}

/* =========================================================
   EMBEDS – YOUTUBE (GLOBAL)
   ========================================================= */

.wp-block-embed__wrapper{
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  height: 0;
}

.wp-block-embed__wrapper iframe{
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  border: 0;
  border-radius: 12px;
}

/* Safety for any iframes outside wrapper */
.wp-block-embed iframe{
  width:100% !important;
  aspect-ratio:16/9;
  height:auto !important;
  border-radius:12px;
  border:1px solid var(--rem-sep);
  background:var(--bg-card);
}

/* =========================================================
   FORMS – GHL EMBED (RESTORED)
   ========================================================= */

.ghl-embed{ width:100%; }

.ghl-embed iframe{
  width:100% !important;
  min-height:720px;
  border:0;
  display:block;
}

.ghl-embed form{ width:100%; }

/* =========================================================
   TYPEAHEAD (HEADER AUTOCOMPLETE)
   ========================================================= */

.typeahead{
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  background: color-mix(in srgb, var(--bg-card) 92%, transparent);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: none;
  z-index: 2000;
}

.typeahead.is-open{ display: block; }

.typeahead__item{
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--text-primary);
  border-top: 1px solid var(--rem-sep-soft);
}

.typeahead__item:first-child{ border-top: 0; }

.typeahead__item:hover{ background: var(--panel-2); }

.typeahead__thumb{
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  background: var(--panel);
  display: grid;
  place-items: center;
}

.typeahead__thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.typeahead__ph{
  width: 100%;
  height: 100%;
  background: var(--panel-2);
}

.typeahead__text{
  min-width: 0;
  display: grid;
  gap: 2px;
}

.typeahead__title{
  font-weight: 650;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.typeahead__meta{
  font-size: 11px;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--accent) 85%, var(--text-secondary));
}

/* =========================================================
   SEARCH RESULTS — ENTERPRISE
   ========================================================= */

.search-results{
  display: grid;
  gap: 14px;
}

.search-card{
  border: 1px solid var(--stroke);
  background: var(--panel);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.search-card__link{
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  text-decoration: none;
  color: inherit;
}

.search-card__media{
  background: var(--panel);
  border-right: 1px solid var(--rem-sep-soft);
  min-height: 150px;
}

.search-card__media img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.search-card__media--placeholder{
  width: 100%;
  height: 100%;
  min-height: 150px;
  background: var(--panel-2);
}

.search-card__body{
  padding: 14px 16px 16px;
}

.search-card__meta{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.search-pill{
  font-size: 11px;
  letter-spacing: .10em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--bg-primary) 10%, transparent);
  color: var(--text-secondary);
}

.search-pill--accent{
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
  color: var(--accent);
}

.search-date{
  margin-left: auto;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.search-card__title{
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.2;
  color: var(--text-primary);
}

.search-card__excerpt{
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

@media (max-width: 820px){
  .search-card__link{ grid-template-columns: 1fr; }
  .search-card__media{
    border-right: 0;
    border-bottom: 1px solid var(--rem-sep-soft);
    min-height: 0;
  }
  .search-date{ margin-left: 0; }
}

/* =========================================================
   ARTICLES HUB — ENTERPRISE (home.php / /articles)
   ========================================================= */

.rem-articles{ color: var(--text-primary); }

.rem-articles__header{
  padding: 0 0 0;
  margin-bottom: 0;
}

.rem-articles .page-title{
  margin: 0;
  font-weight: 750;
}

.rem-articles__top{ padding: 22px 0 30px; }

.rem-articles__grid{
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 26px;
  align-items: start;
}

.rem-articles__rail{
  display: grid;
  gap: 16px;
}

@media (max-width: 920px){
  .rem-articles__grid{ grid-template-columns: 1fr; }
}

/* Feature card */
.feature-card{
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border-radius: 18px;
  overflow: hidden;
}

.feature-card__media{ display:block; width:100%; background: var(--panel); }
.feature-card__media img{ width:100%; height:auto; display:block; }
.feature-card__media--placeholder{
  width:100%;
  aspect-ratio: 16 / 9;
  background: var(--panel);
}

.feature-card__body{ padding: 18px; }

.feature-card__meta{
  display:flex;
  gap: 12px;
  align-items:center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 12px;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.feature-card__kicker a{ color: var(--accent); text-decoration: none; }
.feature-card__kicker a:hover{ text-decoration: underline; }
.feature-card__date{ color: var(--text-tertiary); }

.feature-card__title{
  margin: 0 0 10px;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.15;
}

.feature-card__title a{ color: var(--text-primary); text-decoration:none; }
.feature-card__title a:hover{
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
  text-underline-offset: 4px;
}

.feature-card__excerpt{
  margin: 0 0 12px;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 70ch;
}

.feature-card__cta{
  display:inline-flex;
  gap: 8px;
  align-items:center;
  color: var(--accent);
  text-decoration: none;
  font-weight: 650;
  font-size: 14px;
}
.feature-card__cta:hover{ text-decoration: underline; text-underline-offset: 4px; }

/* Rail cards */
.rail-card{
  border: 1px solid var(--stroke);
  background: var(--panel);
  border-radius: 18px;
  padding: 14px 14px 12px;
}

.rail-card__title{
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.rail-list{
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

/* Default rail link */
.rail-link{
  display:grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  text-decoration:none;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--text-primary);
}

.rail-link:hover{
  background: var(--panel-2);
  border-color: var(--stroke);
}

/* Thumb container + image sizing (hardening) */
.rail-thumb,
.rail-item__thumb{
  width:46px;
  height:46px;
  border-radius: 10px;
  overflow:hidden;
  background: var(--panel);
  border: 1px solid var(--stroke);
  display:block;
  flex: 0 0 auto;
}

.rail-thumb img,
.rail-item__thumb img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}

.rail-thumb--ph{ display:block; width:100%; height:100%; background: var(--panel-2); }

.rail-text{ min-width:0; display:flex; flex-direction: column; gap: 2px; }

.rail-kicker{
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--accent);
}

.rail-headline{
  font-size: 13px;
  line-height: 1.25;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Topics chips */
.topic-chips{
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
}

.topic-chip{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--bg-primary) 10%, transparent);
  text-decoration:none;
  color: var(--text-primary);
  font-size: 13px;
}

.topic-chip:hover{ border-color: var(--stroke-2); }

.topic-chip__count{
  font-size: 12px;
  color: var(--text-secondary);
}

/* Category rows */
.rem-articles__rows{
  padding: 22px 0 0;
  border-top: 1px solid var(--rem-sep);
  margin-top: 4px;
}

.cat-row{ margin-top: 24px; }
.cat-row:first-child{ margin-top: 0; }

.cat-row__head{
  display:flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.cat-row__title{
  margin: 0;
  font-size: 16px;
  letter-spacing: .2px;
  font-weight: 750;
}

.cat-row__title a{ color: var(--text-primary); text-decoration:none; }
.cat-row__title a:hover{
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
  text-underline-offset: 4px;
}

.cat-row__more{
  color: var(--accent);
  text-decoration:none;
  font-size: 13px;
  font-weight: 650;
}
.cat-row__more:hover{ text-decoration: underline; text-underline-offset: 4px; }

.cat-row__grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 1100px){
  .cat-row__grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px){
  .cat-row__grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px){
  .cat-row__grid{ grid-template-columns: 1fr; }
}

/* Mini cards */
.mini-card{
  border: 1px solid var(--stroke);
  background: var(--panel);
  border-radius: 18px;
  overflow:hidden;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.mini-card:hover{
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 25%, var(--stroke));
  background: var(--panel-2);
}

.mini-card__media{ display:block; background: var(--panel); }
.mini-card__media img{
  width:100%;
  height:auto;
  display:block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.mini-card__media--placeholder{
  width:100%;
  aspect-ratio: 16 / 9;
  background: var(--panel-2);
}

.mini-card__body{ padding: 12px 12px 14px; }
.mini-card__meta{ font-size: 12px; color: var(--text-tertiary); margin-bottom: 6px; }
.mini-card__title{ margin: 0; font-size: 14px; line-height: 1.25; letter-spacing: .1px; }
.mini-card__title a{ color: var(--text-primary); text-decoration:none; }
.mini-card__title a:hover{
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
  text-underline-offset: 4px;
}

/* =========================================================
   ARCHIVES / CATEGORY PAGES (RESTORED)
   ========================================================= */

.editorial-archive{
  padding-top: 0;
  padding-bottom: 0;
}

.archive-head{ margin-bottom: 18px; }

.archive-title{
  margin: 0 0 8px;
  font-size: clamp(28px, 3.2vw, 44px);
  letter-spacing: -0.02em;
  font-family: var(--font-display);
}

.archive-desc{
  color: var(--text-secondary);
  max-width: 72ch;
  line-height: 1.6;
}

/* Pagination */
.archive-pagination{
  margin-top: 18px;
}

.archive-pagination .page-numbers{
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.archive-pagination a.page-numbers{
  color: var(--accent);
  text-decoration: none;
}

.archive-pagination .page-numbers.current{
  color: var(--text-primary);
  font-weight: 800;
}

/* =========================================================
   SINGLE POST — ENTERPRISE + GUTENBERG SAFETY (RESTORED)
   ========================================================= */

.editorial-single{
  padding-top: 34px;
  padding-bottom: 0px;
}

/* Main content wrapper safety */
.single-article,
.post-content{ min-width: 0; }

/* A lot of themes wrap content in .post-content; this keeps it readable */
.post-content{
  color: var(--text-primary);
  font-size: 18px;
  line-height: 1.85;
}

/* Headings inside post */
.post-content h2,
.post-content h3,
.post-content h4{
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  margin: 1.6em 0 .6em;
  line-height: 1.2;
}
.post-content h2{ font-size: 26px; }
.post-content h3{ font-size: 22px; }
.post-content h4{ font-size: 18px; }

.post-content p{ margin: 0 0 1.1em; }

.post-content a{
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.post-content a:hover{
  border-bottom-color: color-mix(in srgb, var(--accent) 80%, transparent);
}

.post-content img,
.post-content figure img{
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--stroke);
}

.post-content figure{ margin: 22px 0; }

.post-content figcaption{
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-tertiary);
}

/* Prevent alignwide/full from breaking container */
.post-content .alignwide,
.post-content .alignfull{
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.post-content blockquote{
  margin: 1.4em 0;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  color: var(--text-primary);
}

.post-content table{
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--stroke);
}

.post-content th,
.post-content td{
  padding: 10px 12px;
  border-bottom: 1px solid var(--rem-sep-soft);
}

.post-content th{
  text-align: left;
  color: var(--text-primary);
  background: var(--panel-2);
}

.post-content td{ color: var(--text-secondary); }

.post-content pre{
  background: var(--panel);
  border: 1px solid var(--stroke);
  padding: 14px 16px;
  border-radius: 12px;
  overflow: auto;
}

.post-content code{
  font-family: var(--font-mono);
  font-size: 0.95em;
}

/* =========================================================
   VIDEO HUB (/video) — ENTERPRISE (FIXES BIG RIGHT THUMBS)
   ========================================================= */

.video-hub__header{
  padding: 0 0 0;
  margin-bottom: 26px;
}

.video-hub__grid{
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 26px;
  align-items: start;
}

@media (max-width: 920px){
  .video-hub__grid{ grid-template-columns: 1fr; }
}

/* Featured card */
.video-feature-card{
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* Player */
.video-player__frame{
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-player__frame iframe{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-feature-card__meta{
  padding: 16px 18px 18px;
}

.video-meta-line{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.video-kicker{
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .10em;
  text-transform: uppercase;
}

.video-date{ color: var(--text-tertiary); }

.video-feature-card__title{
  margin: 10px 0 0;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.15;
  font-family: var(--font-display);
}

/* RIGHT RAIL: clickable buttons */
.rail-list--videos{ gap: 10px; }

/* Some templates use <button class="rail-item__btn"> */
.rail-item__btn{
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 8px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: var(--text-primary);
}

.rail-item__btn:hover{
  background: var(--panel-2);
  border-color: var(--rem-sep-soft);
}

.rail-item__btn.is-active{
  border-color: color-mix(in srgb, var(--accent) 35%, var(--stroke));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 12%, transparent);
}

body.light-mode .rail-item__btn:hover{
  background: rgba(0,0,0,.03);
}

/* HARD FIX: if the rail markup uses <img> directly without a thumb wrapper */
.rail-item__btn img{
  width: 46px !important;
  height: 46px !important;
  object-fit: cover !important;
  border-radius: 10px !important;
  display: block !important;
}

/* More coverage grid */
.video-hub__rows{
  padding: 22px 0 0;
  border-top: 1px solid var(--rem-sep);
  margin-top: 22px;
}

.video-grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 1100px){ .video-grid{ grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 820px){ .video-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 520px){ .video-grid{ grid-template-columns: 1fr; } }

.video-tile{
  display: grid;
  text-decoration: none;
  color: inherit;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  overflow: hidden;
}

.video-tile__thumb{
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--panel-2);
  border-bottom: 1px solid var(--rem-sep-soft);
}

.video-tile__thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-tile__title{
  padding: 12px 12px 14px;
  font-weight: 650;
  line-height: 1.25;
  color: var(--text-primary);
}

/* =========================================================
   VIDEO PAGE TEMPLATE (page-video.php) — GRID SAFETY
   ========================================================= */

.page-template-page-video-php .page-section { padding: 18px 0; }

.page-template-page-video-php .wp-block-query .wp-block-post-template,
.page-template-page-video-php .wp-block-post-template,
.page-template-page-video-php ul.wp-block-post-template,
.page-template-page-video-php .wp-block-latest-posts{
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.page-template-page-video-php .wp-block-query .wp-block-post,
.page-template-page-video-php .wp-block-post-template > li,
.page-template-page-video-php .wp-block-latest-posts > li{
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  overflow: hidden;
  padding: 0;
}

.page-template-page-video-php .wp-block-query .wp-block-post-featured-image img,
.page-template-page-video-php .wp-block-latest-posts .wp-block-latest-posts__featured-image img{
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

@media (max-width: 640px){
  .page-template-page-video-php .wp-block-query .wp-block-post-template,
  .page-template-page-video-php .wp-block-post-template,
  .page-template-page-video-php .wp-block-latest-posts{
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   UTILITIES
   ========================================================= */

.muted{ color: var(--text-secondary); }

/* Hide any legacy Top Posts rail elements if still present */
.rem-articles .rail-card.top-posts,
.rem-articles .rail-card[data-rail="top-posts"],
.rem-articles .rail-card .rail-ol,
.rem-articles .rail-card .rail-ol__item{
  display: none !important;
}

/* =========================================================
   CONTINUE — remaining CSS (append after your last line)
   ========================================================= */

/* =========================================================
   HOME – EDITORIAL FOCUS (equal height cards)
   ========================================================= */

.editorial-cards.wp-block-columns{ align-items: stretch; }
.editorial-cards.wp-block-columns > .wp-block-column{ display: flex; }
.editorial-cards.wp-block-columns > .wp-block-column > .article-card{
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
}
.editorial-cards .article-card > *:last-child{ margin-bottom: 0; }

/* =========================================================
   HOME — VIDEO HIGHLIGHTS (Gutenberg)
   ========================================================= */

.home-video-highlights{ padding: 18px 0; }

.video-highlight-meta{
  display:flex;
  flex-direction:column;
  gap:16px;
  width:100%;
  min-width:0;
  height:100%;
}
.video-highlight-meta > *{ width:100%; min-width:0; }

.video-highlight-meta .wp-block-buttons{
  display:flex;
  justify-content:flex-start;
  width:100%;
  margin-top:auto;
}

/* =========================================================
   VIDEO EMBED FRAME (non-Gutenberg helpers)
   ========================================================= */

.video-frame{
  position:relative;
  padding-bottom:56.25%;
  height:0;
  overflow:hidden;
  border-radius:12px;
  background:var(--bg-card);
  border:1px solid var(--stroke);
}
.video-frame iframe{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  border:0;
}

/* =========================================================
   ARCHIVE / SEARCH TERM COLOR
   ========================================================= */

.search-archive .archive-head{ margin-bottom: 18px; }
.search-term{ color: var(--accent); }

/* =========================================================
   SECTION RULE / HR NORMALIZATION
   ========================================================= */

.section-rule{
  margin: 28px 0;
  border: none;
  height: 1px;
  background: var(--rem-sep);
}

/* Normalize common dividers (keeps light/dark consistent) */
hr{
  border: 0 !important;
  border-top: 1px solid var(--rem-sep) !important;
  opacity: 1 !important;
}

/* =========================================================
   SINGLE POST WIDTH CONTROL (matches original)
   ========================================================= */

.single-article{ max-width: 900px; margin: 0 auto; }

/* =========================================================
   TOP-LEVEL PAGE WRAPPER SAFETY (prevents weird stacking)
   ========================================================= */

main{ display:block; }
.site-main{ display:block; min-height: 40vh; }

/* =========================================================
   ACCESSIBILITY / REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce){
  *{
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =========================================================
   LIGHT MODE HARDENING (these existed in original)
   ========================================================= */

/* Post content reads better in light mode */
body.light-mode .post-content{
  color: rgba(0,0,0,.86);
}
body.light-mode .post-content th{
  background: rgba(0,0,0,.03);
}
body.light-mode .post-content pre{
  background: rgba(0,0,0,.03);
}

/* Typeahead panel in light mode (background + border/shadow) */
body.light-mode .typeahead{
  background: rgba(255,255,255,.98);
  border-color: rgba(0,0,0,.12);
  box-shadow: 0 18px 50px rgba(0,0,0,.12);
}
body.light-mode .typeahead__item{
  color: rgba(0,0,0,.88);
  border-top-color: rgba(0,0,0,.08);
}
body.light-mode .typeahead__item:hover{
  background: rgba(0,0,0,.04);
}
body.light-mode .typeahead__thumb{
  border-color: rgba(0,0,0,.12);
  background: rgba(0,0,0,.03);
}
body.light-mode .typeahead__ph{
  background: rgba(0,0,0,.06);
}

/* Topic chips + search pills in light mode (original behavior) */
body.light-mode .topic-chip{
  background: rgba(255,255,255,.55);
}
body.light-mode .search-pill{
  background: rgba(255,255,255,.55);
  color: rgba(0,0,0,.66);
}

/* =========================================================
   MISC SAFETY — prevents odd overflow on wide embeds/tables
   ========================================================= */

.post-content{ overflow-wrap: break-word; }
.post-content table{ display: block; overflow-x: auto; }

/* =========================================================
   SINGLE POST TEMPLATE — styles for single.php markup
   (Append to end of your stylesheet)
   ========================================================= */

/* --- Header wrapper --- */
.single-head{
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rem-sep);
}

/* Meta row (cats left, date right) */
.single-meta{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

/* Categories chip row */
.single-cats{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Category chip links */
.cat-chip{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--bg-primary) 10%, transparent);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .04em;
  text-decoration: none;
}
.cat-chip:hover{
  border-color: color-mix(in srgb, var(--accent) 25%, var(--stroke));
  background: var(--panel-2);
}

/* Date (top right) */
.single-date{
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  white-space: nowrap;
  margin-top: 2px;
}

/* Title + dek */
.single-title{
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.single-dek{
  margin: 0 0 16px;
  color: var(--text-secondary);
  font-size: 18px;
  line-height: 1.7;
  max-width: 75ch;
}

/* Hero image */
.single-hero{
  margin: 18px 0 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  background: var(--panel);
}
.single-hero__img{
  display: block;
  width: 100%;
  height: auto;
}

/* Mobile wrap behavior */
@media (max-width: 720px){
  .single-meta{
    flex-direction: column;
    align-items: flex-start;
  }
  .single-date{
    white-space: normal;
  }
}

/* =========================================================
   RIGHT RAIL — Latest list markup in single.php
   ========================================================= */

.rail-card__head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

/* List items */
.rail-item{ margin: 0; }

/* Link wrapper (single.php uses .rail-item__link, not .rail-link) */
.rail-item__link{
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  text-decoration: none;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--text-primary);
}
.rail-item__link:hover{
  background: var(--panel-2);
  border-color: var(--stroke);
}

/* Thumbnail wrapper already styled earlier as .rail-item__thumb,
   but single.php uses placeholder class we need to define */
.rail-item__img--placeholder{
  display: block;
  width: 100%;
  height: 100%;
  background: var(--panel-2);
}

/* If WP adds img class rail-item__img, ensure consistent sizing */
.rail-item__img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Title/meta inside right rail */
.rail-item__title{
  font-size: 13px;
  line-height: 1.25;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Optional: slightly soften meta in rail */
.rail-item__meta{
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

/* =========================================================
   CATEGORY / ARCHIVE PAGES — FIX GRID CARDS + IMAGE SIZING
   (append at end of stylesheet)
   ========================================================= */

/* 1) Right rail spacing (your sidebar cards are touching) */
.editorial-rail{
  display: grid;
  gap: 16px;
}

/* 2) CATEGORY + ARCHIVE: if using Gutenberg Query Loop (most common) */
body.category .wp-block-query .wp-block-post-template,
body.archive  .wp-block-query .wp-block-post-template,
body.search   .wp-block-query .wp-block-post-template,
body.category .wp-block-post-template,
body.archive  .wp-block-post-template,
body.search   .wp-block-post-template{
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  align-items: start;
}

/* Each post card */
body.category .wp-block-query .wp-block-post-template > li,
body.archive  .wp-block-query .wp-block-post-template > li,
body.search   .wp-block-query .wp-block-post-template > li,
body.category .wp-block-post-template > li,
body.archive  .wp-block-post-template > li,
body.search   .wp-block-post-template > li{
  margin: 0;
  border: 1px solid var(--stroke);
  background: var(--panel);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* Prevent default “big vertical stack” padding/margins inside cards */
body.category .wp-block-post-template > li > *,
body.archive  .wp-block-post-template > li > *,
body.search   .wp-block-post-template > li > *{
  margin-left: 0;
  margin-right: 0;
}

/* Featured image becomes a consistent thumbnail (not huge) */
body.category .wp-block-post-featured-image,
body.archive  .wp-block-post-featured-image,
body.search   .wp-block-post-featured-image{
  margin: 0;
}

body.category .wp-block-post-featured-image a,
body.archive  .wp-block-post-featured-image a,
body.search   .wp-block-post-featured-image a{
  display: block;
}

body.category .wp-block-post-featured-image img,
body.archive  .wp-block-post-featured-image img,
body.search   .wp-block-post-featured-image img{
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border: 0;
}

/* Card inner spacing for title/excerpt/meta */
body.category .wp-block-post-template > li .wp-block-post-title,
body.archive  .wp-block-post-template > li .wp-block-post-title,
body.search   .wp-block-post-template > li .wp-block-post-title{
  margin: 0;
  padding: 12px 14px 0;
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: .1px;
}

body.category .wp-block-post-template > li .wp-block-post-title a,
body.archive  .wp-block-post-template > li .wp-block-post-title a,
body.search   .wp-block-post-template > li .wp-block-post-title a{
  color: var(--text-primary);
  text-decoration: none;
}

body.category .wp-block-post-template > li .wp-block-post-title a:hover,
body.archive  .wp-block-post-template > li .wp-block-post-title a:hover,
body.search   .wp-block-post-template > li .wp-block-post-title a:hover{
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
  text-underline-offset: 4px;
}

body.category .wp-block-post-template > li .wp-block-post-date,
body.archive  .wp-block-post-template > li .wp-block-post-date,
body.search   .wp-block-post-template > li .wp-block-post-date{
  padding: 6px 14px 0;
  margin: 0;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

body.category .wp-block-post-template > li .wp-block-post-excerpt,
body.archive  .wp-block-post-template > li .wp-block-post-excerpt,
body.search   .wp-block-post-template > li .wp-block-post-excerpt{
  padding: 8px 14px 14px;
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

body.category .wp-block-post-template > li .wp-block-post-excerpt__excerpt,
body.archive  .wp-block-post-template > li .wp-block-post-excerpt__excerpt,
body.search   .wp-block-post-template > li .wp-block-post-excerpt__excerpt{
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Hover: subtle lift like your other cards */
body.category .wp-block-post-template > li:hover,
body.archive  .wp-block-post-template > li:hover,
body.search   .wp-block-post-template > li:hover{
  transform: translateY(-2px);
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
  border-color: color-mix(in srgb, var(--accent) 25%, var(--stroke));
  background: var(--panel-2);
}

/* 3) CATEGORY + ARCHIVE: classic theme loop fallback (if not using Query Loop) */
body.category .site-main .post,
body.archive  .site-main .post,
body.search   .site-main .post{
  border: 1px solid var(--stroke);
  background: var(--panel);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin: 0 0 18px;
}

body.category .site-main .post .wp-post-image,
body.archive  .site-main .post .wp-post-image,
body.search   .site-main .post .wp-post-image{
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

/* If the classic loop has .entry-title / .entry-summary */
body.category .site-main .entry-title,
body.archive  .site-main .entry-title,
body.search   .site-main .entry-title{
  margin: 0;
  padding: 12px 14px 0;
  font-size: 18px;
  line-height: 1.25;
}

body.category .site-main .entry-title a,
body.archive  .site-main .entry-title a,
body.search   .site-main .entry-title a{
  color: var(--text-primary);
  text-decoration: none;
}

body.category .site-main .entry-summary,
body.archive  .site-main .entry-summary,
body.search   .site-main .entry-summary{
  padding: 8px 14px 14px;
  color: var(--text-secondary);
}

/* 4) Mobile: make sure cards remain 1-col when needed */
@media (max-width: 640px){
  body.category .wp-block-post-template,
  body.archive  .wp-block-post-template,
  body.search   .wp-block-post-template{
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   CATEGORY ARCHIVE (category.php) — FIX GRID + CARD SIZING
   Targets: .card-grid .post-card .archive-rail
   Append at END of stylesheet
   ========================================================= */

/* Ensure archive layout behaves like a 2-col grid */
.editorial-archive .archive-layout{
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  align-items: start;
}

@media (max-width: 980px){
  .editorial-archive .archive-layout{ grid-template-columns: 1fr; }
}

/* Right rail: add spacing so Latest + Topics don't touch */
.editorial-archive .archive-rail{
  display: grid;
  gap: 16px;
  align-self: start;
  position: sticky;
  top: 18px;
}

@media (max-width: 980px){
  .editorial-archive .archive-rail{
    position: relative;
    top: auto;
  }
}

/* Main grid of posts: responsive cards instead of stacked */
.editorial-archive .card-grid{
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

/* Breakpoints to match your “small cards” layout */
@media (max-width: 1100px){
  .editorial-archive .card-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px){
  .editorial-archive .card-grid{ grid-template-columns: 1fr; }
}

/* Card container */
.editorial-archive .post-card{
  border: 1px solid var(--stroke);
  background: var(--panel);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

/* Make the entire card clickable without weird inline gaps */
.editorial-archive .post-card__link{
  display: grid;
  grid-template-rows: auto 1fr;
  text-decoration: none;
  color: inherit;
}

/* BIG FIX: control media height so images stop becoming huge */
.editorial-archive .post-card__media{
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--panel-2);
  border-bottom: 1px solid var(--rem-sep-soft);
  overflow: hidden;
}

/* Image sizing */
.editorial-archive .post-card__img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Placeholder */
.editorial-archive .post-card__img--placeholder{
  width: 100%;
  height: 100%;
  background: var(--panel-2);
}

/* Body spacing */
.editorial-archive .post-card__body{
  padding: 12px 12px 14px;
  min-width: 0;
}

/* Meta line (kicker + date) */
.editorial-archive .post-card__meta{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.editorial-archive .post-card__meta .kicker{
  font-size: 11px;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: var(--font-mono);
}

.editorial-archive .post-card__meta .date{
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* Title */
.editorial-archive .post-card__title{
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: .1px;
  color: var(--text-primary);

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Excerpt */
.editorial-archive .post-card__excerpt{
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.55;

  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Hover */
.editorial-archive .post-card:hover{
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 25%, var(--stroke));
  background: var(--panel-2);
}

/* =========================================================
   Right rail compatibility (category.php uses different inner classes)
   ========================================================= */

/* category.php uses .rail-item__text (not .rail-text) */
.rail-item__text{
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* category.php sets inline style on .rail-item__date; override safely */
.rail-item__date{
  color: var(--text-tertiary) !important;
  font-size: 11px !important;
  letter-spacing: .08em !important;
  text-transform: uppercase !important;
}

/* Ensure rail thumbs are consistent */
.rail-item__thumb{
  width: 46px;
  height: 46px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--stroke);
  display: block;
  flex: 0 0 auto;
}

.rail-item__img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rail-item__img--placeholder{
  display: block;
  width: 100%;
  height: 100%;
  background: var(--panel-2);
}