/* ==========================================================================
   Cogent HorsePlay Theme
   Design system: dark navy + gold accent, premium racing feel
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Custom properties (design tokens)
   -------------------------------------------------------------------------- */
:root {
  /* Brand */
  --ch-bg:           #0a1628;
  --ch-bg-surface:   #132038;
  --ch-bg-raised:    #1c2d4a;
  --ch-border:       #263a57;

  /* Text */
  --ch-text:         #e2e8f0;
  --ch-text-muted:   #94a3b8;
  --ch-text-subtle:  #64748b;

  /* Accent */
  --ch-gold:         #c9a84c;
  --ch-gold-light:   #e2c070;
  --ch-gold-dim:     rgba(201, 168, 76, 0.15);

  /* Cogent plugin colour tokens — must match plugin :root values */
  --cogent-primary:  #1a56db;
  --cogent-win:      #16a34a;
  --cogent-place:    #d97706;
  --cogent-miss:     #dc2626;
  --cogent-gold:     #c9a84c;

  /* States */
  --ch-focus:        #3b82f6;

  /* Typography */
  --ch-font-sans:    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ch-font-mono:    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --ch-font-size:    16px;
  --ch-line-height:  1.6;

  /* Spacing */
  --ch-space-1:      0.25rem;
  --ch-space-2:      0.5rem;
  --ch-space-3:      0.75rem;
  --ch-space-4:      1rem;
  --ch-space-6:      1.5rem;
  --ch-space-8:      2rem;
  --ch-space-12:     3rem;
  --ch-space-16:     4rem;
  --ch-space-24:     6rem;

  /* Layout */
  --ch-container:    1200px;
  --ch-radius-sm:    0.25rem;
  --ch-radius:       0.5rem;
  --ch-radius-lg:    0.75rem;
  --ch-radius-xl:    1rem;

  /* Shadows */
  --ch-shadow-sm:    0 1px 3px rgba(0,0,0,0.4);
  --ch-shadow:       0 4px 12px rgba(0,0,0,0.5);
  --ch-shadow-lg:    0 8px 24px rgba(0,0,0,0.6);

  /* Transitions */
  --ch-transition:   150ms ease;
}

/* --------------------------------------------------------------------------
   2. Reset / base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--ch-font-size);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--ch-bg);
  color: var(--ch-text);
  font-family: var(--ch-font-sans);
  line-height: var(--ch-line-height);
  min-height: 100vh;
}

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

a {
  color: var(--ch-gold);
  text-decoration: none;
  transition: color var(--ch-transition);
}
a:hover { color: var(--ch-gold-light); }

a:focus-visible {
  outline: 2px solid var(--ch-focus);
  outline-offset: 2px;
  border-radius: var(--ch-radius-sm);
}

ul, ol { list-style: none; }

h1, h2, h3, h4, h5, h6 {
  line-height: 1.25;
  color: var(--ch-text);
}

/* --------------------------------------------------------------------------
   3. Layout utilities
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--ch-container);
  margin-inline: auto;
  padding-inline: var(--ch-space-6);
}

.site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-main {
  flex: 1;
  padding-block: var(--ch-space-12);
}

.content-area {
  display: grid;
  gap: var(--ch-space-8);
}
.content-area--with-sidebar {
  grid-template-columns: 1fr;
}
@media (min-width: 1024px) {
  .content-area--with-sidebar {
    grid-template-columns: 1fr 300px;
  }
}

/* --------------------------------------------------------------------------
   4. Skip link / accessibility
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--ch-space-4);
  background: var(--cogent-primary);
  color: #fff;
  padding: var(--ch-space-2) var(--ch-space-4);
  border-radius: var(--ch-radius);
  z-index: 9999;
}
.skip-link:focus { top: var(--ch-space-4); }

.screen-reader-text {
  border: 0;
  clip: rect(1px,1px,1px,1px);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

/* --------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--ch-space-2);
  padding: var(--ch-space-3) var(--ch-space-6);
  border-radius: var(--ch-radius);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background-color var(--ch-transition), color var(--ch-transition), border-color var(--ch-transition), box-shadow var(--ch-transition);
  text-decoration: none;
}
.btn:focus-visible {
  outline: 2px solid var(--ch-focus);
  outline-offset: 2px;
}

.btn--primary {
  background: var(--cogent-primary);
  color: #fff;
  border-color: var(--cogent-primary);
}
.btn--primary:hover {
  background: #1648c0;
  border-color: #1648c0;
  color: #fff;
}

.btn--outline {
  background: transparent;
  color: var(--ch-text);
  border-color: var(--ch-border);
}
.btn--outline:hover {
  border-color: var(--ch-gold);
  color: var(--ch-gold);
}

.btn--gold {
  background: var(--ch-gold);
  color: var(--ch-bg);
  border-color: var(--ch-gold);
  font-weight: 700;
}
.btn--gold:hover {
  background: var(--ch-gold-light);
  border-color: var(--ch-gold-light);
  color: var(--ch-bg);
}

.btn--sm { padding: var(--ch-space-2) var(--ch-space-4); font-size: 0.875rem; }
.btn--lg { padding: var(--ch-space-4) var(--ch-space-8); font-size: 1.0625rem; }

/* --------------------------------------------------------------------------
   6. Site header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 22, 40, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ch-border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--ch-space-6);
  height: 64px;
}

/* Branding */
.site-branding { flex-shrink: 0; }

.site-logo a {
  display: flex;
  align-items: center;
  gap: var(--ch-space-2);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ch-text);
  text-decoration: none;
}
.site-logo a:hover { color: var(--ch-gold); }

.site-logo__horse {
  font-size: 1.5rem;
  line-height: 1;
}

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

.site-description {
  font-size: 0.75rem;
  color: var(--ch-text-muted);
  margin-top: var(--ch-space-1);
}

/* Navigation */
.main-navigation { flex: 1; }

.main-navigation ul {
  display: flex;
  align-items: center;
  gap: var(--ch-space-1);
  list-style: none;
}

.main-navigation a {
  display: block;
  padding: var(--ch-space-2) var(--ch-space-3);
  color: var(--ch-text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--ch-radius-sm);
  transition: color var(--ch-transition), background-color var(--ch-transition);
}
.main-navigation a:hover,
.main-navigation .current-menu-item > a {
  color: var(--ch-text);
  background: var(--ch-bg-raised);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--ch-space-2);
  margin-left: auto;
}
.nav-toggle__bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ch-text);
  border-radius: 2px;
  transition: transform var(--ch-transition), opacity var(--ch-transition);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-header__cta { flex-shrink: 0; }

.member-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--ch-space-1);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ch-gold);
  border: 1px solid var(--ch-gold-dim);
  border-radius: var(--ch-radius);
  padding: var(--ch-space-1) var(--ch-space-3);
  background: var(--ch-gold-dim);
}

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

  .main-navigation {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--ch-bg-surface);
    border-bottom: 1px solid var(--ch-border);
    padding: var(--ch-space-4) var(--ch-space-6);
  }
  .main-navigation.is-open { display: block; }
  .main-navigation ul { flex-direction: column; align-items: flex-start; }
  .main-navigation a { width: 100%; }

  .site-header__cta { display: none; }
}

/* --------------------------------------------------------------------------
   7. Hero section
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding-block: var(--ch-space-24) var(--ch-space-16);
  overflow: hidden;
  margin-top: -1px; /* overlap header border */
}

.hero__bg-pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse 80% 60% at 60% 40%, rgba(26,86,219,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 60% 80% at 20% 80%, rgba(201,168,76,0.06) 0%, transparent 60%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--ch-space-12);
  align-items: center;
}
@media (min-width: 768px) {
  .hero__inner { grid-template-columns: 200px 1fr 280px; }
}

/* Hero logo column */
.hero__logo-col {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__brand-logo {
  width: 180px;
  height: auto;
  filter: drop-shadow(0 4px 24px rgba(201, 168, 76, 0.35));
  animation: hero-logo-float 6s ease-in-out infinite;
}

@keyframes hero-logo-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

@media (max-width: 767px) {
  .hero__logo-col { display: none; }
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ch-gold);
  border: 1px solid var(--ch-gold-dim);
  background: var(--ch-gold-dim);
  border-radius: var(--ch-radius);
  padding: var(--ch-space-1) var(--ch-space-3);
  margin-bottom: var(--ch-space-4);
}

.hero__title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: var(--ch-space-6);
}
.hero__title-accent { display: block; color: var(--ch-gold); }

.hero__lead {
  font-size: 1.125rem;
  color: var(--ch-text-muted);
  max-width: 52ch;
  margin-bottom: var(--ch-space-8);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ch-space-3);
}

/* Hero stats sidebar */
.hero__stats {
  display: flex;
  flex-direction: column;
  gap: var(--ch-space-4);
}

.stat-card {
  background: var(--ch-bg-surface);
  border: 1px solid var(--ch-border);
  border-radius: var(--ch-radius-lg);
  padding: var(--ch-space-6);
  text-align: center;
  box-shadow: var(--ch-shadow);
}
.stat-card__number {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--ch-gold);
  line-height: 1;
  margin-bottom: var(--ch-space-2);
}
.stat-card__label {
  font-size: 0.8125rem;
  color: var(--ch-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* --------------------------------------------------------------------------
   8. Member gate banner
   -------------------------------------------------------------------------- */
.member-gate-banner {
  background: linear-gradient(135deg, var(--ch-bg-surface), var(--ch-bg-raised));
  border-top: 1px solid var(--ch-border);
  border-bottom: 1px solid var(--ch-border);
  padding-block: var(--ch-space-4);
}
.member-gate-banner__inner {
  display: flex;
  align-items: center;
  gap: var(--ch-space-4);
  flex-wrap: wrap;
}
.member-gate-banner__icon { font-size: 1.25rem; flex-shrink: 0; }
.member-gate-banner__text { flex: 1; font-size: 0.9375rem; color: var(--ch-text-muted); }
.member-gate-banner__text strong { color: var(--ch-text); }

/* --------------------------------------------------------------------------
   9. Section headers
   -------------------------------------------------------------------------- */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--ch-space-4);
  margin-bottom: var(--ch-space-8);
  flex-wrap: wrap;
}
.section-header__title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
}
.section-header__subtitle {
  font-size: 0.9375rem;
  color: var(--ch-text-muted);
  margin-top: var(--ch-space-1);
  flex-basis: 100%;
}
.section-header__link {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ch-gold);
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   10. Predictions section
   -------------------------------------------------------------------------- */
.predictions-section {
  padding-block: var(--ch-space-16);
}

/* ── Cogent Predictions plugin — theme integration ──────────────────────────
   We bridge the plugin's --cogent-* design tokens to our --ch-* tokens so
   both systems share the same values. This makes the plugin look native to
   the theme without forking the plugin source.

   The browser/WP button reset is also applied here to prevent system or
   WordPress global styles from overriding the plugin's button backgrounds.
   ───────────────────────────────────────────────────────────────────────── */
.cogent-predictions {
  font-family: var(--ch-font-sans);
  background: var(--ch-bg);
  color: var(--ch-text);

  /* Token bridge */
  --cogent-bg:           var(--ch-bg);
  --cogent-bg-surface:   var(--ch-bg-surface);
  --cogent-bg-raised:    var(--ch-bg-raised);
  --cogent-bg-header:    var(--ch-bg-surface);
  --cogent-border:       var(--ch-border);
  --cogent-border-light: rgba(255,255,255,0.05);
  --cogent-text:         var(--ch-text);
  --cogent-text-muted:   var(--ch-text-muted);
  --cogent-text-subtle:  var(--ch-text-subtle);
  --cogent-gold:         var(--ch-gold);
  --cogent-gold-dim:     var(--ch-gold-dim);
  --cogent-font:         var(--ch-font-sans);
  --cogent-radius:       var(--ch-radius);
}

/* Neutralise browser and WP global-styles button chrome.
   WP global styles may inject low-specificity rules like `button { background: ... }`
   so we use .cogent-predictions button (higher specificity) to win without !important.
   :where() resets are also common in WP, so we cover :hover/:focus/:active too. */
.cogent-predictions button {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  background-color: transparent;
  color: inherit;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  text-decoration: none;
  box-shadow: none;
  outline-offset: 2px;
  cursor: pointer;
}

/* ── Region pill tabs ───────────────────────────────────────────────────── */
.cogent-predictions .cogent-region-tabs {
  gap: 0.625rem;
  margin-bottom: var(--ch-space-6);
}

.cogent-predictions .cogent-region-tab {
  padding: 0.55rem 1.6rem;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  /* Inactive: visible raised surface so they read as clickable */
  background: var(--ch-bg-raised);
  color: var(--ch-text-muted);
  border: 1px solid var(--ch-border);
  border-radius: 9999px;
  box-shadow: var(--ch-shadow-sm);
  transition: background var(--ch-transition), color var(--ch-transition),
              border-color var(--ch-transition), box-shadow var(--ch-transition);
}

.cogent-predictions .cogent-region-tab:hover {
  background: var(--ch-bg-surface);
  border-color: var(--ch-gold);
  color: var(--ch-gold);
  box-shadow: 0 0 0 3px var(--ch-gold-dim);
}

.cogent-predictions .cogent-region-tab--active,
.cogent-predictions .cogent-region-tab[aria-selected="true"] {
  background: var(--ch-gold-dim);
  border-color: var(--ch-gold);
  color: var(--ch-gold);
  box-shadow: 0 0 0 3px var(--ch-gold-dim), var(--ch-shadow-sm);
}

/* ── Time tabs (History / Today / Tomorrow) ─────────────────────────────── */
.cogent-predictions .cogent-time-tabs {
  margin-bottom: var(--ch-space-6);
  border-bottom: 2px solid var(--ch-border);
}

.cogent-predictions .cogent-time-tab {
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  color: var(--ch-text-subtle);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color var(--ch-transition), border-color var(--ch-transition);
}

.cogent-predictions .cogent-time-tab:hover {
  color: var(--ch-text-muted);
}

.cogent-predictions .cogent-time-tab--active,
.cogent-predictions .cogent-time-tab[aria-selected="true"] {
  color: var(--ch-gold);
  border-bottom-color: var(--ch-gold);
}

/* ── Betting Brief tabs (Portfolio / Savant) ─────────────────────────────── */
.cogent-predictions .cogent-brief__tabs {
  background: var(--ch-bg-raised);
  border-bottom: 1px solid var(--ch-border);
}

.cogent-predictions .cogent-brief__tab {
  padding: 0.45rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ch-text-subtle);
  border-bottom: 2px solid transparent;
  transition: color var(--ch-transition), border-color var(--ch-transition);
}

.cogent-predictions .cogent-brief__tab:hover {
  color: var(--ch-text-muted);
}

.cogent-predictions .cogent-brief__tab--active,
.cogent-predictions .cogent-brief__tab[aria-selected="true"] {
  color: var(--ch-gold);
  border-bottom-color: var(--ch-gold);
}

/* ── Venue accordion ────────────────────────────────────────────────────── */
.cogent-predictions .cogent-venue-accordion {
  border-radius: var(--ch-radius-lg);
  box-shadow: var(--ch-shadow-sm);
}

.cogent-predictions .cogent-venue-accordion > .cogent-accordion__toggle {
  padding: 0.875rem 1.125rem;
  background: var(--ch-bg-surface);
}

.cogent-predictions .cogent-venue-accordion > .cogent-accordion__toggle:hover {
  background: var(--ch-bg-raised);
}

.cogent-predictions .cogent-venue-accordion__name {
  font-size: 1.0625rem;
  letter-spacing: 0.01em;
}

/* Gold left accent when venue is open */
.cogent-predictions .cogent-venue-accordion > .cogent-accordion__toggle[aria-expanded="true"] {
  border-left: 3px solid var(--ch-gold);
  padding-left: calc(1.125rem - 3px);
}

/* ── Race accordion ─────────────────────────────────────────────────────── */
.cogent-predictions .cogent-race-accordion__toggle {
  font-size: 0.875rem;
}

/* ── Summary table ─────────────────────────────────────────────────────── */
.cogent-predictions .cogent-summary {
  border-radius: var(--ch-radius);
  box-shadow: var(--ch-shadow-sm);
}

.cogent-predictions .cogent-summary__table th {
  background: var(--ch-bg-raised);
}

/* ── Section layout ─────────────────────────────────────────────────────── */
.predictions-section .cogent-predictions {
  margin-top: 0;
}

/* --------------------------------------------------------------------------
   11. How it works
   -------------------------------------------------------------------------- */
.how-it-works {
  padding-block: var(--ch-space-16);
  border-top: 1px solid var(--ch-border);
}
.hiw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--ch-space-6);
}
.hiw-card {
  background: var(--ch-bg-surface);
  border: 1px solid var(--ch-border);
  border-radius: var(--ch-radius-lg);
  padding: var(--ch-space-8);
  transition: border-color var(--ch-transition), box-shadow var(--ch-transition);
}
.hiw-card:hover {
  border-color: var(--ch-gold-dim);
  box-shadow: var(--ch-shadow);
}
.hiw-card__icon {
  font-size: 2rem;
  margin-bottom: var(--ch-space-4);
}
.hiw-card__title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: var(--ch-space-3);
}
.hiw-card p { color: var(--ch-text-muted); font-size: 0.9375rem; }

/* --------------------------------------------------------------------------
   11a. Pricing
   -------------------------------------------------------------------------- */
.pricing {
  padding-block: var(--ch-space-16);
  border-top: 1px solid var(--ch-border);
}
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--ch-space-6);
}
.pricing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--ch-space-3);
  background: var(--ch-bg-surface);
  border: 1px solid var(--ch-border);
  border-radius: var(--ch-radius-lg);
  padding: var(--ch-space-8);
  text-align: center;
  transition: border-color var(--ch-transition), box-shadow var(--ch-transition);
}
.pricing-card:hover {
  border-color: var(--ch-gold-dim);
  box-shadow: var(--ch-shadow);
}
.pricing-card--featured {
  border-color: var(--ch-gold);
  box-shadow: var(--ch-shadow);
}
.pricing-card__badge {
  position: absolute;
  top: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ch-gold);
  color: var(--ch-bg);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--ch-space-1) var(--ch-space-3);
  border-radius: var(--ch-radius);
}
.pricing-card__name {
  font-size: 1.125rem;
  font-weight: 700;
}
.pricing-card__price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--ch-gold);
}
.pricing-card__period {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ch-text-muted);
}
.pricing-card__desc {
  color: var(--ch-text-muted);
  font-size: 0.9375rem;
  flex-grow: 1;
}
.pricing-card .btn {
  justify-content: center;
}
.pricing-note {
  margin-top: var(--ch-space-8);
  text-align: center;
  color: var(--ch-text-muted);
  font-size: 0.875rem;
}

/* --------------------------------------------------------------------------
   12. Post cards / grid
   -------------------------------------------------------------------------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--ch-space-6);
}

.post-card {
  background: var(--ch-bg-surface);
  border: 1px solid var(--ch-border);
  border-radius: var(--ch-radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color var(--ch-transition), box-shadow var(--ch-transition);
}
.post-card:hover {
  border-color: var(--ch-border);
  box-shadow: var(--ch-shadow);
}
.post-card__thumbnail img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}
.post-card__body {
  padding: var(--ch-space-6);
  display: flex;
  flex-direction: column;
  gap: var(--ch-space-3);
  flex: 1;
}
.post-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ch-space-3);
  font-size: 0.8125rem;
  color: var(--ch-text-subtle);
}
.post-card__title {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
}
.post-card__title a { color: var(--ch-text); }
.post-card__title a:hover { color: var(--ch-gold); }
.post-card__excerpt {
  font-size: 0.9375rem;
  color: var(--ch-text-muted);
  flex: 1;
}
.post-card__readmore {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ch-gold);
  margin-top: auto;
}

/* Latest posts section */
.latest-posts {
  padding-block: var(--ch-space-16);
  border-top: 1px solid var(--ch-border);
}

/* --------------------------------------------------------------------------
   13. Single entry
   -------------------------------------------------------------------------- */
.entry--single {
  max-width: 72ch;
}
.entry-header { margin-bottom: var(--ch-space-8); }
.entry-title { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; }
.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ch-space-4);
  font-size: 0.875rem;
  color: var(--ch-text-subtle);
  margin-top: var(--ch-space-3);
}
.post-thumbnail { margin-bottom: var(--ch-space-8); border-radius: var(--ch-radius-lg); overflow: hidden; }
.post-thumbnail img { width: 100%; }

.entry-content {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--ch-text-muted);
}
.entry-content > * + * { margin-top: var(--ch-space-6); }
.entry-content h2, .entry-content h3, .entry-content h4 {
  color: var(--ch-text);
  margin-top: var(--ch-space-8);
}
.entry-content a { color: var(--ch-gold); text-decoration: underline; }
.entry-content ul, .entry-content ol {
  padding-left: var(--ch-space-6);
  list-style: revert;
}
.entry-content blockquote {
  border-left: 4px solid var(--ch-gold);
  padding-left: var(--ch-space-6);
  color: var(--ch-text-muted);
  font-style: italic;
}
.entry-content code {
  font-family: var(--ch-font-mono);
  font-size: 0.875em;
  background: var(--ch-bg-raised);
  border: 1px solid var(--ch-border);
  border-radius: var(--ch-radius-sm);
  padding: 1px 6px;
}
.entry-content pre {
  background: var(--ch-bg-raised);
  border: 1px solid var(--ch-border);
  border-radius: var(--ch-radius);
  padding: var(--ch-space-6);
  overflow-x: auto;
}
.entry-content pre code { background: none; border: none; padding: 0; }

.entry-footer { margin-top: var(--ch-space-8); padding-top: var(--ch-space-6); border-top: 1px solid var(--ch-border); }
.entry-tags { font-size: 0.875rem; color: var(--ch-text-subtle); }
.entry-tags a { color: var(--ch-text-muted); }

/* Post navigation */
.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--ch-space-4);
  margin-top: var(--ch-space-12);
  padding-top: var(--ch-space-8);
  border-top: 1px solid var(--ch-border);
}
.nav-subtitle { display: block; font-size: 0.75rem; color: var(--ch-text-subtle); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: var(--ch-space-1); }
.nav-title { font-weight: 600; color: var(--ch-text); }
.nav-next { text-align: right; }

/* --------------------------------------------------------------------------
   14. Breadcrumbs
   -------------------------------------------------------------------------- */
.breadcrumbs {
  margin-bottom: var(--ch-space-6);
}
.breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ch-space-2);
  align-items: center;
  font-size: 0.8125rem;
  color: var(--ch-text-subtle);
}
.breadcrumbs__list li + li::before {
  content: '/';
  margin-right: var(--ch-space-2);
  opacity: 0.4;
}
.breadcrumbs__list a { color: var(--ch-text-muted); }
.breadcrumbs__item--current { color: var(--ch-text); }

/* --------------------------------------------------------------------------
   15. Page header
   -------------------------------------------------------------------------- */
.page-header { margin-bottom: var(--ch-space-8); }
.page-title { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; }
.archive-description { margin-top: var(--ch-space-3); color: var(--ch-text-muted); font-size: 1.0625rem; }

/* --------------------------------------------------------------------------
   16. Widget sidebar
   -------------------------------------------------------------------------- */
.widget-area { display: flex; flex-direction: column; gap: var(--ch-space-6); }

.widget {
  background: var(--ch-bg-surface);
  border: 1px solid var(--ch-border);
  border-radius: var(--ch-radius-lg);
  padding: var(--ch-space-6);
}
.widget-title {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ch-text-subtle);
  margin-bottom: var(--ch-space-4);
  padding-bottom: var(--ch-space-3);
  border-bottom: 1px solid var(--ch-border);
}
.widget ul { display: flex; flex-direction: column; gap: var(--ch-space-2); }
.widget li { font-size: 0.9375rem; }
.widget a { color: var(--ch-text-muted); }
.widget a:hover { color: var(--ch-gold); }

/* --------------------------------------------------------------------------
   17. 404 page
   -------------------------------------------------------------------------- */
.error-404__inner {
  max-width: 480px;
  margin-inline: auto;
  text-align: center;
  padding-block: var(--ch-space-16);
}
.error-404__number {
  font-size: 6rem;
  font-weight: 900;
  line-height: 1;
  color: var(--ch-border);
  margin-bottom: var(--ch-space-4);
}
.error-404__title { font-size: 1.75rem; font-weight: 700; margin-bottom: var(--ch-space-4); }
.error-404__message { color: var(--ch-text-muted); margin-bottom: var(--ch-space-8); }
.error-404__actions { margin-bottom: var(--ch-space-8); }
.error-404__search p { font-size: 0.9375rem; color: var(--ch-text-subtle); margin-bottom: var(--ch-space-3); }

/* --------------------------------------------------------------------------
   18. Search form
   -------------------------------------------------------------------------- */
.search-form {
  display: flex;
  gap: var(--ch-space-2);
}
.search-field {
  flex: 1;
  background: var(--ch-bg-raised);
  border: 1px solid var(--ch-border);
  border-radius: var(--ch-radius);
  color: var(--ch-text);
  padding: var(--ch-space-3) var(--ch-space-4);
  font-size: 0.9375rem;
  font-family: var(--ch-font-sans);
}
.search-field:focus {
  outline: 2px solid var(--ch-focus);
  outline-offset: -1px;
}
.search-submit {
  background: var(--cogent-primary);
  color: #fff;
  border: none;
  border-radius: var(--ch-radius);
  padding: var(--ch-space-3) var(--ch-space-4);
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 600;
  transition: background-color var(--ch-transition);
}
.search-submit:hover { background: #1648c0; }

/* --------------------------------------------------------------------------
   19. Notice
   -------------------------------------------------------------------------- */
.notice {
  padding: var(--ch-space-4) var(--ch-space-6);
  border-radius: var(--ch-radius);
  font-size: 0.9375rem;
}
.notice--warning {
  background: rgba(202,138,4,0.1);
  border: 1px solid rgba(202,138,4,0.3);
  color: #fbbf24;
}

/* --------------------------------------------------------------------------
   20. Site footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--ch-border);
  margin-top: auto;
}

.site-footer__widgets {
  padding-block: var(--ch-space-12);
  border-bottom: 1px solid var(--ch-border);
}

.site-footer__bottom {
  padding-block: var(--ch-space-6);
  background: var(--ch-bg-surface);
}
.site-footer__bottom-inner {
  display: flex;
  align-items: center;
  gap: var(--ch-space-8);
  flex-wrap: wrap;
  justify-content: space-between;
}

.site-footer__brand {
  display: flex;
  align-items: center;
  gap: var(--ch-space-2);
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--ch-text);
}
.site-footer__horse { font-size: 1.25rem; }

.footer-navigation ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ch-space-1);
}
.footer-navigation a {
  font-size: 0.875rem;
  color: var(--ch-text-muted);
  padding: var(--ch-space-1) var(--ch-space-2);
  border-radius: var(--ch-radius-sm);
}
.footer-navigation a:hover { color: var(--ch-text); }

.site-footer__legal {
  font-size: 0.8125rem;
  color: var(--ch-text-subtle);
  line-height: 1.5;
  text-align: right;
}
.site-footer__legal small { color: var(--ch-text-subtle); opacity: 0.7; }

@media (max-width: 767px) {
  .site-footer__bottom-inner { flex-direction: column; align-items: flex-start; text-align: left; }
  .site-footer__legal { text-align: left; }
}

/* --------------------------------------------------------------------------
   21. WP core element overrides
   -------------------------------------------------------------------------- */

/* Alignments */
.alignleft  { float: left; margin-right: var(--ch-space-6); }
.alignright { float: right; margin-left: var(--ch-space-6); }
.aligncenter { margin-inline: auto; }
.alignwide { max-width: calc(var(--ch-container) + 160px); margin-inline: auto; }
.alignfull { width: 100vw; margin-left: calc(50% - 50vw); }

/* Captions */
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 0.875rem; color: var(--ch-text-subtle); text-align: center; margin-top: var(--ch-space-2); }

/* Posts navigation */
.posts-navigation {
  margin-top: var(--ch-space-8);
  display: flex;
  justify-content: space-between;
}
.nav-previous a, .nav-next a {
  font-weight: 600;
  color: var(--ch-gold);
}

/* Comments */
.comment-list { display: flex; flex-direction: column; gap: var(--ch-space-6); margin-top: var(--ch-space-8); }
.comment-body {
  background: var(--ch-bg-surface);
  border: 1px solid var(--ch-border);
  border-radius: var(--ch-radius-lg);
  padding: var(--ch-space-6);
}
.comment-author { font-weight: 700; }
.comment-metadata { font-size: 0.8125rem; color: var(--ch-text-subtle); }
.comment-content { margin-top: var(--ch-space-3); color: var(--ch-text-muted); font-size: 0.9375rem; }
.reply a { font-size: 0.875rem; font-weight: 600; }

/* Comment form */
.comment-form label { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: var(--ch-space-2); color: var(--ch-text-muted); }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  background: var(--ch-bg-raised);
  border: 1px solid var(--ch-border);
  border-radius: var(--ch-radius);
  color: var(--ch-text);
  padding: var(--ch-space-3) var(--ch-space-4);
  font-size: 0.9375rem;
  font-family: var(--ch-font-sans);
  margin-bottom: var(--ch-space-4);
}
.comment-form input:focus, .comment-form textarea:focus {
  outline: 2px solid var(--ch-focus);
  outline-offset: -1px;
}
.comment-form .submit {
  background: var(--cogent-primary);
  color: #fff;
  border: none;
  border-radius: var(--ch-radius);
  padding: var(--ch-space-3) var(--ch-space-6);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--ch-font-sans);
}
.comment-form .submit:hover { background: #1648c0; }

/* --------------------------------------------------------------------------
   22. Responsive tweaks
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  :root { --ch-space-24: 4rem; --ch-space-16: 2.5rem; --ch-space-12: 2rem; }
  .post-grid { grid-template-columns: 1fr; }
  .hero__stats { flex-direction: row; overflow-x: auto; }
  .stat-card { min-width: 140px; }
}

/* --------------------------------------------------------------------------
   23. JS-powered states
   -------------------------------------------------------------------------- */

/* Sticky header scroll states */
.site-header { transition: transform 300ms ease, box-shadow 200ms ease; }
.site-header--scrolled { box-shadow: 0 4px 20px rgba(0,0,0,0.5); }
.site-header--hidden { transform: translateY(-100%); }

/* Fade-in reveal */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 400ms ease, transform 400ms ease;
}
.fade-in.is-visible {
  opacity: 1;
  transform: none;
}
