/* =======================================================================
   Tribune Post — sitewide stylesheet
   CSS custom properties + [data-theme] attribute for full dark mode.
   ======================================================================= */

:root {
  --color-bg: #f4f5f7;
  --color-surface: #ffffff;
  --color-text: #14171c;
  --color-text-muted: #5b6472;
  --color-text-faint: #8a919c;
  --color-border: #e5e8ec;
  --color-accent: #1a4fd6;
  --color-accent-dark: #0b1f4e;
  --color-accent-hover: #143ba8;
  --color-footer-bg: #0b1f4e;
  --color-footer-text: #c3ccdf;
  --color-footer-heading: #ffffff;
  --color-card-shadow: 0 1px 3px rgba(20, 23, 28, 0.08);
  --font-serif: 'Bitter', Georgia, 'Times New Roman', serif;
  --font-sans: 'Bitter', Georgia, 'Times New Roman', serif;
  --font-ui: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-heading-weight: 700;
  --font-heading-transform: none;
  --font-heading-tracking: normal;
  --max-width: 1180px;
  /* Admin-controlled brand colors (overridden inline per-request from site_settings) */
  --header-bar-bg: #aa0000;
  --btn-highlight-bg: #ffe500;
  --btn-highlight-text: #14171c;
  --sticky-header-height: 68px;
}

[data-theme="dark"] {
  --color-bg: #0f1216;
  --color-surface: #171b21;
  --color-text: #eef0f3;
  --color-text-muted: #a7afbc;
  --color-text-faint: #7d8595;
  --color-border: #2a3038;
  --color-accent: #5b8bff;
  --color-accent-dark: #0b1f4e;
  --color-accent-hover: #7ea0ff;
  --color-footer-bg: #060a14;
  --color-footer-text: #aab4c9;
  --color-footer-heading: #ffffff;
  --color-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #0f1216;
    --color-surface: #171b21;
    --color-text: #eef0f3;
    --color-text-muted: #a7afbc;
    --color-text-faint: #7d8595;
    --color-border: #2a3038;
    --color-accent: #5b8bff;
    --color-accent-dark: #0b1f4e;
    --color-accent-hover: #7ea0ff;
    --color-footer-bg: #060a14;
    --color-footer-text: #aab4c9;
    --color-footer-heading: #ffffff;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  color: var(--color-accent-hover);
}

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

/* ---------------- Header ---------------- */
/* Main header row: brand-colored bar — logo, category nav, Subscribe. Sticky. */
.header-main {
  background: var(--header-bar-bg);
  transition: padding 0.2s ease;
}

.header-main .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
}

.site-header.is-sticky .header-main .container {
  padding-top: 9px;
  padding-bottom: 9px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-logo img {
  height: 38px;
  width: auto;
}

.site-logo .logo-text {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.social-icons {
  display: flex;
  gap: 10px;
}

.social-icons a {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cfd3da;
  font-size: 12px;
}

.btn-subscribe {
  background: var(--btn-highlight-bg);
  color: var(--btn-highlight-text);
  padding: 10px 20px;
  border-radius: 3px;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border: none;
  cursor: pointer;
}

.btn-subscribe:hover {
  filter: brightness(0.95);
  color: var(--btn-highlight-text);
}

.theme-toggle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hamburger toggle — hidden on desktop, shown at the mobile breakpoint */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 34px;
  height: 34px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Category nav row — sits directly under the sticky main header, same brand color
   but a shade darker, so the two read as one continuous sticky block. */
.site-nav {
  background: color-mix(in srgb, var(--header-bar-bg) 82%, #000);
  position: sticky;
  top: var(--sticky-header-height);
  z-index: 490;
}

.site-header.is-sticky~* .site-nav,
.site-nav {
  transition: top 0.2s ease;
}

.site-nav .container {
  display: flex;
  overflow-x: auto;
}

.site-nav ul {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
  gap: 4px;
  white-space: nowrap;
}

.site-nav a {
  display: block;
  padding: 11px 14px;
  color: rgba(255, 255, 255, 0.88);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 13.5px;
  border-bottom: 3px solid transparent;
}

.site-nav a:hover,
.site-nav a.active {
  color: #fff;
  border-bottom-color: var(--btn-highlight-bg);
}

.nav-search {
  display: flex;
  align-items: center;
  margin-left: auto;
  padding-left: 16px;
  flex: 0 0 auto;
}

.nav-search input[type="search"] {
  width: 150px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 3px 0 0 3px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 13px;
}

.nav-search input[type="search"]::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.nav-search input[type="search"]:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.18);
}

.nav-search button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-left: none;
  border-radius: 0 3px 3px 0;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
}

.nav-search button svg {
  display: block;
}

.nav-search button:hover {
  background: rgba(255, 255, 255, 0.22);
}

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

  .site-nav {
    position: static;
  }

  .site-nav .container {
    overflow-x: visible;
    flex-wrap: wrap;
  }

  .site-nav ul {
    display: none;
    flex-direction: column;
    gap: 0;
    width: 100%;
    white-space: normal;
  }

  .site-nav.open ul {
    display: flex;
  }

  .site-nav a {
    padding: 12px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  }

  .site-nav li {
    width: 100%;
  }

  .nav-search {
    margin-left: 0;
    padding: 10px 0;
    width: 100%;
  }

  .nav-search input[type="search"] {
    flex: 1;
    width: auto;
  }
}

/* ---------------- Homepage layout ---------------- */
.homepage-top {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 28px;
  padding: 28px 0;
}

@media (max-width: 860px) {
  .homepage-top {
    grid-template-columns: 1fr;
  }
}

.hero-column {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

/* Below-hero grid: a stacked list of small headlines + two thumb-top cards,
   filling the space under the hero while the taller sidebar list continues. */
.below-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}

@media (max-width: 700px) {
  .below-hero-grid {
    grid-template-columns: 1fr;
  }
}

.below-hero-list {
  display: flex;
  flex-direction: column;
}

.below-hero-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}

.below-hero-list .below-hero-item:last-child {
  border-bottom: none;
}

.below-hero-item-thumb {
  flex: 0 0 80px;
  width: 80px;
  height: 64px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--color-border);
}

.below-hero-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.below-hero-item-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.below-hero-item-body .cat-label {
  margin-bottom: 2px;
}

.below-hero-item-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.35;
  color: var(--color-text);
}

.below-hero-item:hover .below-hero-item-title {
  color: var(--color-accent);
}

.below-hero-card {
  display: block;
}

.below-hero-card-thumb {
  display: block;
  aspect-ratio: 4/3;
  border-radius: 3px;
  overflow: hidden;
  background: var(--color-border);
  margin-bottom: 10px;
}

.below-hero-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.below-hero-card .cat-label {
  display: block;
  margin-bottom: 4px;
}

.below-hero-card-title {
  display: block;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
  color: var(--color-text);
}

.below-hero-card:hover .below-hero-card-title {
  color: var(--color-accent);
}

.hero-story {
  position: relative;
}

.hero-story .hero-img-wrap {
  display: block;
  aspect-ratio: 16/9.5;
  overflow: hidden;
  border-radius: 6px;
  background: var(--color-border);
}

.hero-story img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-story .hero-cat-tag {
  display: block;
  background: none;
  color: var(--color-accent);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.6px;
  padding: 0;
  margin: 16px 0 8px;
}

.hero-story h1 {
  font-family: var(--font-serif);
  font-size: 32px;
  line-height: 1.2;
  margin: 0 0 10px;
}

.hero-story h1 a {
  color: var(--color-text);
}

.hero-story p.hero-excerpt {
  color: var(--color-text-muted);
  font-size: 15.5px;
  margin: 0 0 8px;
}

.byline {
  font-size: 12.5px;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.top-stories-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.top-stories-list .list-heading {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 2px solid var(--color-text);
  padding-bottom: 8px;
  margin: 0 0 4px;
}

/* story-list-item partial */
.story-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}

.story-item:last-child {
  border-bottom: none;
}

.story-item .thumb {
  flex: 0 0 84px;
  width: 84px;
  height: 64px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--color-border);
}

.story-item .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-item .story-body {
  flex: 1;
  min-width: 0;
}

.story-item .cat-label {
  display: block;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  color: var(--color-accent);
  letter-spacing: 0.6px;
}

.story-item h3 {
  font-family: var(--font-serif);
  font-size: 15.5px;
  line-height: 1.3;
  margin: 3px 0;
}

.story-item h3 a {
  color: var(--color-text);
}

.story-item .story-meta {
  font-size: 11.5px;
  color: var(--color-text-faint);
}

/* ---------------- Category modules ---------------- */
/* Flat background, no per-category tinting — matches the reference site. */
.tinted-band {
  padding: 34px 0;
  border-top: 1px solid var(--color-border);
}

.tinted-band:first-of-type {
  border-top: none;
}

.category-module-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
}

.category-module-header h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  margin: 0;
  padding-left: 12px;
  border-left: 5px solid var(--color-accent);
}

.category-module-header a.see-all {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.category-module-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 26px;
}

@media (max-width: 860px) {
  .category-module-grid {
    grid-template-columns: 1fr;
  }
}

.module-lead-story .thumb {
  display: block;
  aspect-ratio: 16/9;
  border-radius: 6px;
  overflow: hidden;
  background: var(--color-border);
  margin-bottom: 12px;
}

.module-lead-story .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.module-lead-story h3 {
  font-family: var(--font-serif);
  font-size: 21px;
  line-height: 1.3;
  margin: 0 0 8px;
}

.module-lead-story h3 a {
  color: var(--color-text);
}

.module-lead-story p {
  color: var(--color-text-muted);
  font-size: 14.5px;
  margin: 0 0 6px;
}

.module-secondary-list {
  display: flex;
  flex-direction: column;
}

/* ---------------- Article page ---------------- */
.article-page {
  padding: 28px 16px 48px;
  max-width: 780px;
  margin: 0 auto;
}

.article-cat-tag {
  display: block;
  background: none;
  color: var(--color-accent);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.6px;
  padding: 0;
  margin-bottom: 12px;
}

.article-page h1 {
  font-family: var(--font-serif);
  font-size: 34px;
  line-height: 1.2;
  margin: 0 0 14px;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: var(--color-text-faint);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 14px;
  margin-bottom: 20px;
}

.source-credit {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 5px;
  padding: 10px 14px;
  font-size: 13.5px;
  margin: 16px 0;
}

.source-credit a {
  font-weight: 600;
}

.article-hero-img {
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 20px;
  background: var(--color-border);
}

.article-hero-img img {
  width: 100%;
}

.article-body {
  font-size: 17px;
  line-height: 1.75;
  color: var(--color-text);
}

.article-body p {
  margin: 0 0 18px;
}

.article-body img {
  border-radius: 6px;
  margin: 12px 0;
}

/* ---------------- Pagination ---------------- */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 30px 0;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 13.5px;
  color: var(--color-text);
}

.pagination a:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.pagination .current {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

/* ---------------- Category archive page (reference-matched template) ---------------- */
.breadcrumb {
  padding: 18px 0;
  font-size: 13px;
  color: var(--color-text-faint);
}

.breadcrumb a {
  color: var(--color-text-faint);
}

.breadcrumb a:hover {
  color: var(--color-accent);
}

.breadcrumb span:first-of-type {
  margin: 0 6px;
}

.category-page-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  padding-bottom: 40px;
}

@media (max-width: 900px) {
  .category-page-layout {
    grid-template-columns: 1fr;
  }
}

.category-page-sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  width: 100%;
}

.sidebar-widget {
  width: 100%;
}

.widget-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 14px;
}

.widget-post-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.widget-post {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.widget-post-thumb {
  flex: 0 0 60px;
  width: 60px;
  height: 50px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--color-border);
}

.widget-post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.widget-post-title {
  display: block;
  font-family: var(--font-serif);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--color-text);
}

.widget-post:hover .widget-post-title {
  color: var(--color-accent);
}

.widget-post-date {
  display: block;
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--color-text-faint);
  margin-top: 4px;
}

.widget-post-list--trending .widget-post-thumb {
  flex-basis: 76px;
  width: 76px;
  height: 62px;
}

.widget-post--trending {
  align-items: center;
}

.widget-rank {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Featured grid: reference measurements, taken directly from the live site
   (1.65fr : 1fr : 1fr asymmetric columns, one shared row height across all
   three cards — not an independent aspect-ratio per card — with the text
   overlay panel covering the bottom ~33% of the image height). */
.category-featured-grid {
  display: grid;
  grid-template-columns: 1.65fr 1fr 1fr;
  gap: 20px;
  aspect-ratio: 2.4 / 1;
  margin-bottom: 30px;
}

@media (max-width: 700px) {
  .category-featured-grid {
    grid-template-columns: 1fr;
    aspect-ratio: auto;
  }
}

.cat-grid-card {
  display: block;
  height: 100%;
}

@media (max-width: 700px) {
  .cat-grid-card {
    height: auto;
  }
}

.cat-grid-card-img {
  position: relative;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 2px;
  overflow: hidden;
  background: var(--color-border);
}

@media (max-width: 700px) {
  .cat-grid-card-img {
    height: auto;
    aspect-ratio: 4/3;
  }
}

.cat-grid-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Text is overlaid directly on the image with a dark gradient scrim,
   matching the reference archive template exactly. */
.cat-grid-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.75) 25%, rgba(0, 0, 0, 0.15) 55%, rgba(0, 0, 0, 0) 70%);
}

.cat-grid-pill {
  display: inline-block;
  align-self: flex-start;
  background: var(--color-accent);
  color: #efefef;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 9px;
  border-radius: 1px;
  margin-bottom: 10px;
}

.cat-grid-card h3 {
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.3;
  margin: 0 0 8px;
  color: #ffffff;
}

.cat-grid-card .story-meta {
  color: rgba(255, 255, 255, 0.75);
  font-family: var(--font-ui);
  font-size: 12px;
}

.cat-grid-card:hover h3 {
  text-decoration: underline;
}

.browsing-header {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  padding: 14px 18px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.browsing-header strong {
  color: var(--color-text);
}

.category-list {
  display: flex;
  flex-direction: column;
}

.category-list .story-item {
  padding: 20px 0;
}

.story-item--with-excerpt .thumb {
  flex: 0 0 150px;
  width: 150px;
  height: 110px;
}

.story-item--with-excerpt h3 {
  font-size: 18px;
}

.story-excerpt {
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 6px 0 0;
}

/* ---------------- Newsletter box ---------------- */
.newsletter-box {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 22px;
}

.newsletter-box h3 {
  color: #fff;
  font-family: var(--font-serif);
  margin: 0 0 6px;
  font-size: 19px;
}

.newsletter-box p {
  color: var(--color-footer-text);
  font-size: 13.5px;
  margin: 0 0 14px;
}

.newsletter-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.newsletter-form input[type="email"] {
  flex: 1;
  min-width: 160px;
  padding: 10px 12px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 13.5px;
}

.newsletter-form input::placeholder {
  color: #8fa0c4;
}

.newsletter-form button {
  background: var(--color-accent);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
}

.newsletter-form button:hover {
  background: var(--color-accent-hover);
}

.newsletter-note {
  font-size: 12px;
  color: #7d8db3;
  margin-top: 8px;
}

/* ---------------- Footer ---------------- */
.site-footer {
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  margin-top: 40px;
  padding: 46px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.2fr;
  gap: 30px;
}

@media (max-width: 860px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-grid h4 {
  color: var(--color-footer-heading);
  font-family: var(--font-serif);
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 14px;
}

.footer-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-grid li {
  margin-bottom: 9px;
}

.footer-grid a {
  color: var(--color-footer-text);
  font-size: 13.5px;
}

.footer-grid a:hover {
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 34px;
  padding-top: 18px;
  font-size: 12.5px;
  color: #7d8db3;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------------- Forms / admin shared ---------------- */
.flash {
  padding: 12px 16px;
  border-radius: 5px;
  margin-bottom: 18px;
  font-size: 14px;
}

.flash.success {
  background: #d9f2e3;
  color: #14532d;
}

.flash.error {
  background: #fbdcdc;
  color: #7f1d1d;
}

[data-theme="dark"] .flash.success {
  background: #12351f;
  color: #86e6ac;
}

[data-theme="dark"] .flash.error {
  background: #3a1414;
  color: #ffb3b3;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-muted);
}

.badge-featured {
  display: inline-block;
  background: var(--header-bar-bg);
  color: #fff;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 9px;
  border-radius: 2px;
  margin-left: 6px;
}

/* Headline treatment: serif (Bitter), bold, normal case — matches the
   reference theme's article/hero titles. */
.site-logo .logo-text,
.hero-story h1,
.top-stories-list .list-heading,
.story-item h3,
.category-module-header h2,
.module-lead-story h3,
.article-page h1,
.category-hero h1,
.newsletter-box h3,
.footer-grid h4 {
  font-weight: var(--font-heading-weight);
  letter-spacing: var(--font-heading-tracking);
  text-transform: var(--font-heading-transform);
}

/* UI chrome (nav/buttons/meta labels) uses the sans "Open Sans" face,
   matching the reference theme, while body copy stays in the serif "Bitter".
   Category labels (.hero-cat-tag/.article-cat-tag/.cat-label) are styled
   separately above in DM Serif Display, matching the reference's plain-text
   red category labels — they're deliberately excluded from this list. */
.byline,
.story-meta,
.article-meta,
.category-module-header a.see-all,
.pagination a,
.pagination span,
.footer-bottom,
.ad-label {
  font-family: var(--font-ui);
}

/* ---------------- Ad slots ---------------- */
.ad-slot {
  margin: 18px 0;
  text-align: center;
}

.ad-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--color-text-faint);
  margin-bottom: 6px;
}

.ad-slot-link {
  display: block;
  background: var(--color-border);
  border-radius: 4px;
  overflow: hidden;
  line-height: 0;
}

.ad-slot img {
  width: 100%;
  height: auto;
  display: block;
}

.article-page .ad-slot {
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------------- Hover image zoom ---------------- */
/* Applied to every major/large article image format (hero, category grid
   cards, category-module lead stories, article hero image). List thumbnails
   stay static — the effect is reserved for the bigger, editorial imagery. */
.hero-story .hero-img-wrap,
.cat-grid-card-img,
.module-lead-story .thumb,
.below-hero-card-thumb,
.article-hero-img {
  overflow: hidden;
}

.hero-story .hero-img-wrap img,
.cat-grid-card-img img,
.module-lead-story .thumb img,
.below-hero-card-thumb img,
.article-hero-img img {
  transition: transform 0.45s cubic-bezier(0.25, 0.8, 0.25, 1);
  will-change: transform;
}

.hero-story .hero-img-wrap:hover img,
.cat-grid-card:hover .cat-grid-card-img img,
.module-lead-story:hover .thumb img,
.below-hero-card:hover .below-hero-card-thumb img,
.article-hero-img:hover img {
  transform: scale(1.06);
}

@media (prefers-reduced-motion: reduce) {

  .hero-story .hero-img-wrap img,
  .cat-grid-card-img img,
  .module-lead-story .thumb img,
  .below-hero-card-thumb img,
  .article-hero-img img {
    transition: none;
  }
}

/* ---------------- Section heading (plain, no accent bar) ---------------- */
.section-heading {
  font-family: var(--font-ui);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 18px;
}

/* ---------------- Hand-Picked by Editor ---------------- */
.hand-picked-section {
  padding: 36px 16px 44px;
}

.hp-row1 {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr;
  gap: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .hp-row1 {
    grid-template-columns: 1fr;
  }
}

.hp-text-card {
  display: block;
}

.hp-text-card .cat-label {
  display: block;
  margin-bottom: 8px;
}

.hp-text-card h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1.28;
  margin: 0 0 10px;
  color: var(--color-text);
}

.hp-text-card:hover h3 {
  color: var(--color-accent);
}

.hp-meta {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--color-text-faint);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.hp-text-card p {
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
}

.hp-image-card {
  position: relative;
  display: block;
  border-radius: 3px;
  overflow: hidden;
  aspect-ratio: 4/3.4;
  background: var(--color-border);
}

.hp-image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hp-image-card-caption {
  position: absolute;
  left: 14px;
  bottom: 14px;
  right: 14px;
  background: rgba(12, 12, 12, 0.78);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  padding: 10px 14px;
  border-radius: 3px;
}

.hp-row2 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .hp-row2 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .hp-row2 {
    grid-template-columns: 1fr;
  }
}

.hp-text-only {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.4;
  color: var(--color-text);
  padding: 0 22px;
  border-left: 1px solid var(--color-border);
}

.hp-row2 .hp-text-only:first-child {
  border-left: none;
  padding-left: 0;
}

.hp-text-only:hover {
  color: var(--color-accent);
}

.hp-row3 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 900px) {
  .hp-row3 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .hp-row3 {
    grid-template-columns: 1fr;
  }
}

.hp-tinted-card {
  display: block;
}

.hp-tinted-card-thumb {
  display: block;
  aspect-ratio: 4/3;
  border-radius: 3px 3px 0 0;
  overflow: hidden;
  background: var(--color-border);
}

.hp-tinted-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hp-tinted-card-body {
  display: block;
  background: color-mix(in srgb, var(--color-accent) 7%, var(--color-surface));
  padding: 14px 14px 18px;
  border-radius: 0 0 3px 3px;
}

.hp-tinted-card-title {
  display: block;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.35;
  color: var(--color-text);
}

.hp-tinted-card:hover .hp-tinted-card-title {
  color: var(--color-accent);
}

/* ---------------- Featured Videos (dark box) ---------------- */
.fv-box {
  background: linear-gradient(115deg, var(--header-bar-bg) 0%, #1a0303 45%, #0c0c0c 100%);
  border-radius: 4px;
  padding: 30px 32px 34px;
  margin: 10px 0 44px;
}

.fv-heading {
  font-family: var(--font-ui);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 22px;
}

.fv-layout {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 34px;
}

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

.fv-main {
  display: block;
}

.fv-main-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16/9.5;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 16px;
}

.fv-main-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fv-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  padding-left: 4px;
  backdrop-filter: blur(1px);
}

.fv-main h3 {
  font-family: var(--font-serif);
  font-size: 24px;
  line-height: 1.28;
  color: #fff;
  margin: 0 0 10px;
}

.fv-main:hover h3 {
  color: var(--btn-highlight-bg);
}

.fv-main p {
  color: rgba(255, 255, 255, 0.65);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

.fv-list {
  display: flex;
  flex-direction: column;
}

.fv-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.fv-list-item:first-child {
  padding-top: 0;
}

.fv-list-item:last-child {
  border-bottom: none;
}

.fv-list-item-title {
  display: block;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.35;
  color: #fff;
}

.fv-list-item:hover .fv-list-item-title {
  color: var(--btn-highlight-bg);
}

.fv-list-item-date {
  display: block;
  font-family: var(--font-ui);
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 5px;
}

.fv-list-item-thumb {
  flex: 0 0 84px;
  width: 84px;
  height: 64px;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.fv-list-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------------- You May Have Missed (dark cards) ---------------- */
.missed-section {
  padding-bottom: 44px;
}

.missed-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 900px) {
  .missed-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .missed-grid {
    grid-template-columns: 1fr;
  }
}

.missed-card {
  display: block;
  border-radius: 4px;
  overflow: hidden;
}

.missed-card-thumb {
  display: block;
  aspect-ratio: 4/3;
  background: var(--color-border);
}

.missed-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.missed-card-body {
  display: block;
  background: var(--color-footer-bg, #0c0c0c);
  padding: 16px 16px 20px;
}

.missed-card-body .cat-label {
  display: block;
  margin-bottom: 6px;
}

.missed-card-title {
  display: block;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.32;
  color: #fff;
  margin-bottom: 8px;
}

.missed-card:hover .missed-card-title {
  color: var(--btn-highlight-bg);
}

.missed-card-excerpt {
  display: block;
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.55);
}

/* ---------------- Accessibility / SEO utility ---------------- */
/* Keeps a real <h1> per page for search engines & screen readers without
   duplicating the visible heading treatment (e.g. category.php's styled
   "Browsing: X" bar is the visual heading; this carries the semantic one). */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}