/*
Theme Name: Cycle 99
Theme URI: https://cycle99.com
Author: Cycle 99
Description: Practical cycling for real riders — maintenance, e-bikes, commuting, and gear.
Version: 1.3.2
License: GNU General Public License v2 or later
Text Domain: cycle99
Tags: cycling, bicycle, e-bike, blog, adsense, responsive, light
*/

/* =========================================================
   DESIGN TOKENS — Vibrant Light Palette
   =========================================================
   Primary: Electric Blue  #0070F3  (e-bike energy, sky, speed)
   Accent:  Flame Orange   #FF5C00  (cycling jersey, sun, warmth)
   Accent2: Lime Green     #22C55E  (trail, nature, go)
   Surface: Clean whites and soft grays
   ========================================================= */
:root {
  color-scheme: light;   /* Prevent browser/OS dark-mode from inverting this theme */

  /* Backgrounds */
  --c-bg:         #FFFFFF;
  --c-surface:    #F8FAFF;
  --c-surface2:   #EEF2FF;
  --c-surface3:   #E0E9FF;

  /* Borders */
  --c-border:     #D4DCEE;
  --c-border-l:   #E8EEF8;

  /* Text */
  --c-text:       #111827;
  --c-text-2:     #374151;
  --c-muted:      #6B7280;
  --c-muted-l:    #9CA3AF;

  /* Brand colours */
  --c-blue:       #0070F3;   /* electric / e-bike */
  --c-blue-d:     #0057CC;
  --c-blue-l:     #3B8EFF;
  --c-blue-bg:    #EFF6FF;

  --c-orange:     #FF5C00;   /* flame / cycling energy */
  --c-orange-d:   #D94E00;
  --c-orange-l:   #FF7A33;
  --c-orange-bg:  #FFF4EE;

  --c-green:      #16A34A;   /* trail / go */
  --c-green-l:    #22C55E;
  --c-green-bg:   #F0FDF4;

  --c-yellow:     #F59E0B;   /* road markings / highlights */
  --c-yellow-bg:  #FFFBEB;

  /* Semantic aliases */
  --c-primary:    var(--c-blue);
  --c-primary-d:  var(--c-blue-d);
  --c-primary-l:  var(--c-blue-l);
  --c-primary-bg: var(--c-blue-bg);

  --c-accent:     var(--c-orange);
  --c-accent-d:   var(--c-orange-d);
  --c-accent-bg:  var(--c-orange-bg);

  /* Typography */
  --font-head:  'Barlow Condensed', 'Arial Narrow', Arial, sans-serif;
  --font-body:  'Inter', system-ui, -apple-system, sans-serif;

  /* Spacing & shape */
  --radius:     8px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --shadow-sm:  0 1px 4px rgba(0,60,150,.07), 0 4px 12px rgba(0,60,150,.06);
  --shadow:     0 2px 8px rgba(0,60,150,.08), 0 8px 24px rgba(0,60,150,.08);
  --shadow-lg:  0 4px 16px rgba(0,60,150,.1), 0 16px 40px rgba(0,60,150,.1);

  --max-w:      1200px;
  --content-w:  720px;
  --sidebar-w:  300px;
  --gap:        clamp(16px, 3vw, 32px);
}

/* =========================================================
   RESET & BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

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

img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--c-primary-d); }

ul, ol { padding-left: 1.5rem; }

/* =========================================================
   TYPOGRAPHY
   ========================================================= */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.01em;
  color: var(--c-text);
}

h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.15rem; }

p { margin-bottom: 1.2rem; color: var(--c-text-2); }
p:last-child { margin-bottom: 0; }

blockquote {
  border-left: 4px solid var(--c-primary);
  padding: 1rem 1.5rem;
  background: var(--c-primary-bg);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--c-muted);
}

code {
  background: var(--c-surface2);
  color: var(--c-primary-d);
  padding: .15em .4em;
  border-radius: 4px;
  font-size: .9em;
}

pre {
  background: var(--c-surface2);
  border: 1px solid var(--c-border);
  padding: 1.2rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
}

hr {
  border: none;
  border-top: 2px solid var(--c-border-l);
  margin: 2rem 0;
}

/* =========================================================
   LAYOUT WRAPPER
   ========================================================= */
.site-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  background: #fff;
  border-bottom: 2px solid var(--c-border-l);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,70,180,.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 1rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
}

.logo-mark { width: 40px; height: 40px; flex-shrink: 0; }

.logo-text { display: flex; flex-direction: column; line-height: 1; }

.logo-name {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--c-text);
  letter-spacing: .02em;
  text-transform: uppercase;
}

.logo-tagline {
  font-size: .62rem;
  color: var(--c-muted);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-top: 1px;
}

/* Primary nav */
.primary-nav ul {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 0;
}

.primary-nav a {
  display: block;
  padding: .5rem .85rem;
  font-size: .82rem;
  font-weight: 700;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  border-radius: var(--radius);
  transition: color .15s, background .15s;
}

.primary-nav a:hover,
.primary-nav .current-menu-item a,
.primary-nav .current-menu-ancestor a {
  color: var(--c-primary);
  background: var(--c-primary-bg);
}

/* Search */
.nav-search { display: flex; align-items: center; }

.nav-search input {
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: 24px;
  padding: .38rem 1rem;
  color: var(--c-text);
  font-size: .85rem;
  width: 150px;
  transition: width .25s, border-color .2s, box-shadow .2s;
}

.nav-search input::placeholder { color: var(--c-muted-l); }

.nav-search input:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(0,112,243,.12);
  width: 200px;
}

/* Mobile toggle */
.menu-toggle {
  display: none;
  background: none;
  border: 1.5px solid var(--c-border);
  color: var(--c-text);
  padding: .4rem .75rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1.2rem;
  transition: border-color .15s;
}
.menu-toggle:hover { border-color: var(--c-primary); color: var(--c-primary); }

@media (max-width: 900px) {
  .menu-toggle { display: flex; align-items: center; }
  .primary-nav {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 2px solid var(--c-border-l);
    padding: 1rem var(--gap);
    box-shadow: 0 8px 24px rgba(0,70,180,.08);
  }
  .primary-nav.open { display: block; }
  .primary-nav ul { flex-direction: column; }
  .nav-search { display: none; }
}

/* =========================================================
   TOP COLOUR STRIPE
   ========================================================= */
.site-header::before {
  content: '';
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--c-orange) 0%, var(--c-blue) 50%, var(--c-green) 100%);
}

/* =========================================================
   HERO — HOMEPAGE
   ========================================================= */
.site-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #EFF6FF 0%, #FFF4EE 50%, #F0FDF4 100%);
  padding: clamp(52px, 9vw, 104px) 0;
  border-bottom: 2px solid var(--c-border-l);
}

/* Dot-grid texture */
.hero-bg {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(0,112,243,.15) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

/* Big decorative wheel */
.hero-wheel {
  position: absolute;
  right: -60px;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(280px, 38vw, 500px);
  opacity: .12;
  pointer-events: none;
}

.hero-content { position: relative; max-width: 600px; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-orange);
  background: var(--c-orange-bg);
  border: 1.5px solid rgba(255,92,0,.25);
  padding: .3rem .9rem;
  border-radius: 20px;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 900;
  margin-bottom: 1.1rem;
  text-wrap: balance;
  color: var(--c-text);
}

.hero-title em {
  font-style: normal;
  color: var(--c-primary);
  position: relative;
}

/* Underline squiggle on em */
.hero-title em::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--c-orange), var(--c-primary));
  border-radius: 2px;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--c-muted);
  margin-bottom: 2rem;
  max-width: 500px;
  line-height: 1.7;
}

.hero-ctas { display: flex; flex-wrap: wrap; gap: .75rem; }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .72rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: .88rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--c-primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0,112,243,.35);
}
.btn-primary:hover {
  background: var(--c-primary-d);
  color: #fff;
  box-shadow: 0 6px 20px rgba(0,112,243,.45);
  transform: translateY(-1px);
}

.btn-orange {
  background: var(--c-orange);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255,92,0,.35);
}
.btn-orange:hover {
  background: var(--c-orange-d);
  color: #fff;
  box-shadow: 0 6px 20px rgba(255,92,0,.45);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #fff;
  color: var(--c-text);
  border: 2px solid var(--c-border);
}
.btn-secondary:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
  transform: translateY(-1px);
}

/* =========================================================
   SECTION
   ========================================================= */
.section { padding: clamp(44px, 7vw, 80px) 0; }

.section-title { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: .4rem; }
.section-sub { color: var(--c-muted); margin-bottom: 2.25rem; font-size: .95rem; }

/* =========================================================
   CATEGORY CARDS
   ========================================================= */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1.1rem;
}

/* Each card gets its own vivid accent */
.cat-card {
  background: #fff;
  border: 2px solid var(--c-border-l);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: .7rem;
  transition: border-color .18s, transform .18s, box-shadow .18s;
  position: relative;
  overflow: hidden;
}

.cat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--cat-color, var(--c-primary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
  border-radius: 2px 2px 0 0;
}

.cat-card:hover {
  border-color: var(--cat-color, var(--c-primary));
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  color: var(--c-text);
}

.cat-card:hover::before { transform: scaleX(1); }

/* Per-category colours via inline var */
.cat-card[data-cat="e-bikes"]               { --cat-color: #0070F3; }
.cat-card[data-cat="bike-maintenance"]      { --cat-color: #FF5C00; }
.cat-card[data-cat="gear-accessories"]      { --cat-color: #7C3AED; }
.cat-card[data-cat="cycling-for-beginners"] { --cat-color: #16A34A; }
.cat-card[data-cat="commuter-cycling"]      { --cat-color: #DB2777; }
.cat-card[data-cat="vintage-classic-bikes"] { --cat-color: #92400E; }
.cat-card[data-cat="kids-family-cycling"]   { --cat-color: #0891B2; }
.cat-card[data-cat="buying-guides"]         { --cat-color: #D97706; }

.cat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--c-surface2);
}

.cat-name {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--c-text);
}

.cat-desc {
  font-size: .82rem;
  color: var(--c-muted);
  line-height: 1.55;
}

.cat-count {
  font-size: .75rem;
  color: var(--cat-color, var(--c-primary));
  font-weight: 700;
  margin-top: auto;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* =========================================================
   POST CARDS
   ========================================================= */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.post-card {
  background: #fff;
  border: 2px solid var(--c-border-l);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}

.post-card:hover {
  border-color: var(--c-primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.post-card-thumb {
  height: 185px;
  position: relative;
  overflow: hidden;
}

.post-card-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
}

/* Per-category thumb backgrounds */
.post-card-thumb-placeholder[data-cat="e-bikes"]               { background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%); }
.post-card-thumb-placeholder[data-cat="bike-maintenance"]      { background: linear-gradient(135deg, #FFF4EE 0%, #FFEDD5 100%); }
.post-card-thumb-placeholder[data-cat="gear-accessories"]      { background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%); }
.post-card-thumb-placeholder[data-cat="cycling-for-beginners"] { background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%); }
.post-card-thumb-placeholder[data-cat="commuter-cycling"]      { background: linear-gradient(135deg, #FDF2F8 0%, #FCE7F3 100%); }
.post-card-thumb-placeholder[data-cat="vintage-classic-bikes"] { background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%); }
.post-card-thumb-placeholder[data-cat="kids-family-cycling"]   { background: linear-gradient(135deg, #ECFEFF 0%, #CFFAFE 100%); }
.post-card-thumb-placeholder[data-cat="buying-guides"]         { background: linear-gradient(135deg, #FFFBEB 0%, #FDE68A 50%, #FFF 100%); }

.post-card-body {
  padding: 1.3rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-cat-badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .22rem .65rem;
  border-radius: 20px;
  margin-bottom: .75rem;
  text-decoration: none;
  border: 1.5px solid;
}

/* Badge colour variants */
.badge-e-bikes               { color: #0070F3; background: #EFF6FF; border-color: #BFDBFE; }
.badge-bike-maintenance      { color: #D94E00; background: #FFF4EE; border-color: #FFCBA4; }
.badge-gear-accessories      { color: #6D28D9; background: #F5F3FF; border-color: #DDD6FE; }
.badge-cycling-for-beginners { color: #15803D; background: #F0FDF4; border-color: #BBF7D0; }
.badge-commuter-cycling      { color: #BE185D; background: #FDF2F8; border-color: #FBCFE8; }
.badge-vintage-classic-bikes { color: #92400E; background: #FFFBEB; border-color: #FDE68A; }
.badge-kids-family-cycling   { color: #0E7490; background: #ECFEFF; border-color: #A5F3FC; }
.badge-buying-guides         { color: #B45309; background: #FFFBEB; border-color: #FCD34D; }
.badge-e-bike-troubleshooting      { color: #B91C1C; background: #FEF2F2; border-color: #FECACA; }
.badge-technical-reference         { color: #0F766E; background: #F0FDFA; border-color: #99F6E4; }
.badge-default               { color: var(--c-primary); background: var(--c-primary-bg); border-color: #BFDBFE; }

.post-card-title {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: .6rem;
  color: var(--c-text);
}

.post-card-title a { color: inherit; }
.post-card-title a:hover { color: var(--c-primary); }

.post-card-excerpt {
  font-size: .85rem;
  color: var(--c-muted);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 1rem;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .76rem;
  color: var(--c-muted-l);
  border-top: 1.5px solid var(--c-border-l);
  padding-top: .8rem;
}

.read-more-link {
  margin-left: auto;
  color: var(--c-primary);
  font-weight: 700;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.read-more-link:hover { color: var(--c-primary-d); }

/* =========================================================
   FEATURED POST (large card)
   ========================================================= */
.featured-post {
  background: #fff;
  border: 2px solid var(--c-border-l);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2.5rem;
}

@media (max-width: 680px) { .featured-post { grid-template-columns: 1fr; } }

.featured-post-thumb {
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 50%, #FFF4EE 100%);
}

.featured-post-body {
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-label {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-orange);
  background: var(--c-orange-bg);
  border: 1.5px solid rgba(255,92,0,.2);
  display: inline-block;
  padding: .2rem .7rem;
  border-radius: 12px;
  margin-bottom: .9rem;
}

.featured-post-title { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: .8rem; }
.featured-post-title a { color: var(--c-text); }
.featured-post-title a:hover { color: var(--c-primary); }

/* =========================================================
   CONTENT + SIDEBAR
   ========================================================= */
.content-sidebar {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 940px) { .content-sidebar { grid-template-columns: 1fr; } }

/* =========================================================
   SIDEBAR WIDGETS
   ========================================================= */
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; }

.widget {
  background: #fff;
  border: 2px solid var(--c-border-l);
  border-radius: var(--radius-lg);
  padding: 1.3rem;
}

.widget-title {
  font-family: var(--font-head);
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--c-muted);
  border-bottom: 2px solid var(--c-border-l);
  padding-bottom: .6rem;
  margin-bottom: 1rem;
}

.widget ul { list-style: none; padding: 0; }
.widget li { border-bottom: 1px solid var(--c-border-l); }
.widget li:last-child { border-bottom: none; }
.widget li a {
  display: block;
  padding: .5rem 0;
  font-size: .88rem;
  color: var(--c-text-2);
}
.widget li a:hover { color: var(--c-primary); }

/* Ad slot */
.ad-slot {
  background: var(--c-surface);
  border: 2px dashed var(--c-border);
  border-radius: var(--radius-lg);
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  color: var(--c-muted-l);
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* =========================================================
   SINGLE POST
   ========================================================= */
.post-header {
  background: linear-gradient(135deg, var(--c-surface) 0%, var(--c-primary-bg) 100%);
  padding: clamp(36px, 6vw, 64px) 0 2.5rem;
  border-bottom: 2px solid var(--c-border-l);
  margin-bottom: 2.5rem;
}

.post-title {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  margin-bottom: 1rem;
  text-wrap: balance;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  font-size: .82rem;
  color: var(--c-muted);
}

.post-meta span { display: flex; align-items: center; gap: .3rem; }

/* =========================================================
   POST CONTENT
   ========================================================= */
.post-content {
  font-size: 1.06rem;
  line-height: 1.82;
  color: var(--c-text-2);
}

.post-content h2 {
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  margin: 2.5rem 0 .8rem;
  padding-top: 2rem;
  border-top: 2px solid var(--c-border-l);
  color: var(--c-text);
}

.post-content h3 { font-size: 1.25rem; margin: 1.8rem 0 .6rem; color: var(--c-text); }
.post-content h4 { font-size: 1.05rem; margin: 1.4rem 0 .4rem; color: var(--c-primary); }

.post-content ul, .post-content ol { margin: 1rem 0 1.2rem 1.5rem; }
.post-content li { margin-bottom: .45rem; }
.post-content a { color: var(--c-primary); font-weight: 500; }
.post-content a:hover { color: var(--c-primary-d); }

/* Tip box */
.post-content .tip-box {
  background: var(--c-primary-bg);
  border: 2px solid #BFDBFE;
  border-left: 4px solid var(--c-primary);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.post-content .tip-box::before {
  content: "⚡ Quick tip";
  display: block;
  font-weight: 800;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--c-primary);
  margin-bottom: .4rem;
}

/* Warning box */
.post-content .warning-box {
  background: var(--c-orange-bg);
  border: 2px solid rgba(255,92,0,.25);
  border-left: 4px solid var(--c-orange);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

/* In-content ad */
.in-content-ad {
  background: var(--c-surface);
  border: 2px dashed var(--c-border);
  border-radius: var(--radius);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-muted-l);
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 2rem 0;
}

/* =========================================================
   RELATED POSTS
   ========================================================= */
.related-posts { margin-top: 3rem; padding-top: 2rem; border-top: 2px solid var(--c-border-l); }
.related-posts h3 { margin-bottom: 1.25rem; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; }

/* =========================================================
   ARCHIVE HEADER
   ========================================================= */
.archive-header {
  padding: clamp(32px, 5vw, 56px) 0 2rem;
  border-bottom: 2px solid var(--c-border-l);
  margin-bottom: 2.5rem;
}

.archive-eyebrow {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-muted);
  margin-bottom: .4rem;
}

.archive-title { margin-bottom: .5rem; }
.archive-desc { color: var(--c-muted); font-size: .95rem; }

/* =========================================================
   PAGINATION
   ========================================================= */
.pagination {
  display: flex;
  gap: .5rem;
  justify-content: center;
  margin: 3rem 0 1rem;
  flex-wrap: wrap;
}

.pagination a, .pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 .5rem;
  border-radius: var(--radius);
  border: 2px solid var(--c-border);
  font-size: .88rem;
  font-weight: 700;
  color: var(--c-muted);
  transition: all .15s;
}

.pagination a:hover { border-color: var(--c-primary); color: var(--c-primary); background: var(--c-primary-bg); }
.pagination .current { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }

/* =========================================================
   BREADCRUMBS
   ========================================================= */
.breadcrumbs {
  font-size: .8rem;
  color: var(--c-muted-l);
  padding: .75rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  align-items: center;
}

.breadcrumbs a { color: var(--c-muted); }
.breadcrumbs a:hover { color: var(--c-primary); }
.breadcrumbs .sep { opacity: .4; }

/* =========================================================
   STATS BAR (optional homepage belt)
   ========================================================= */
.stats-bar {
  background: linear-gradient(90deg, var(--c-primary) 0%, #0057CC 100%);
  padding: .9rem 0;
  color: #fff;
}

.stats-inner {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  font-weight: 600;
  opacity: .92;
}

.stat-item strong { font-weight: 800; font-size: 1rem; }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  background: var(--c-text);
  color: #CBD5E1;
  margin-top: 5rem;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding: 3.5rem 0 2.5rem;
}

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

.footer-brand .logo-name { font-size: 1.4rem; color: #fff; }
.footer-brand .logo-tagline { color: #94A3B8; }
.footer-brand p { font-size: .85rem; color: #94A3B8; margin-top: .8rem; line-height: 1.65; }

.footer-col h4 {
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #fff;
  margin-bottom: .85rem;
}

.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: .5rem; }
.footer-col a { font-size: .85rem; color: #94A3B8; }
.footer-col a:hover { color: #fff; }

.footer-accent-bar {
  height: 4px;
  background: linear-gradient(90deg, var(--c-orange) 0%, var(--c-primary) 50%, var(--c-green) 100%);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 1.25rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
  font-size: .78rem;
  color: #64748B;
}

.footer-bottom a { color: #64748B; }
.footer-bottom a:hover { color: #fff; }

/* =========================================================
   SEARCH
   ========================================================= */
.search-form { display: flex; gap: .5rem; margin: 1.5rem 0; }
.search-form input {
  flex: 1;
  background: #fff;
  border: 2px solid var(--c-border);
  border-radius: var(--radius);
  padding: .8rem 1rem;
  color: var(--c-text);
  font-size: 1rem;
}
.search-form input:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(0,112,243,.12); }
.search-form button {
  background: var(--c-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: .8rem 1.4rem;
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  transition: background .15s;
}
.search-form button:hover { background: var(--c-primary-d); }

/* =========================================================
   404
   ========================================================= */
.error-404 { text-align: center; padding: 5rem 0; }
.error-404 .big-num {
  font-size: 8rem;
  font-family: var(--font-head);
  font-weight: 900;
  color: var(--c-border);
  line-height: 1;
}

/* =========================================================
   UTILITIES
   ========================================================= */
.text-primary { color: var(--c-primary); }
.text-orange  { color: var(--c-orange); }
.text-muted   { color: var(--c-muted); }
.text-center  { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }

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

/* =========================================================
   SCROLLBAR
   ========================================================= */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--c-surface2); }
::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-primary); }

/* =========================================================
   SELECTION
   ========================================================= */
::selection { background: rgba(0,112,243,.15); color: var(--c-primary-d); }

/* =========================================================
   FOCUS (accessibility)
   ========================================================= */
:focus-visible {
  outline: 3px solid var(--c-primary);
  outline-offset: 2px;
  border-radius: 3px;
}


/* =========================================================
   v1.3 ARTICLE CONTENT: tables, figures, sources, byline
   ========================================================= */
.cat-card[data-cat="e-bike-troubleshooting"] { --cat-color: #DC2626; }
.cat-card[data-cat="technical-reference"]    { --cat-color: #0F766E; }
.post-card-thumb-placeholder[data-cat="e-bike-troubleshooting"] { background: linear-gradient(135deg, #FEF2F2 0%, #FECACA 100%); }
.post-card-thumb-placeholder[data-cat="technical-reference"]    { background: linear-gradient(135deg, #F0FDFA 0%, #CCFBF1 100%); }

.post-content table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: .93rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
}
.post-content thead th {
  background: var(--c-surface2);
  color: var(--c-text);
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}
.post-content th, .post-content td {
  padding: .65rem .85rem;
  border-bottom: 1px solid var(--c-border-l);
  vertical-align: top;
  text-align: left;
}
.post-content tbody tr:nth-child(even) td { background: var(--c-surface); }
.post-content tbody tr:last-child td { border-bottom: none; }

.post-content figure { margin: 1.9rem 0; }
.post-content figure img {
  width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid var(--c-border-l);
  border-radius: var(--radius);
  padding: .5rem;
}
.post-content figcaption {
  margin-top: .55rem;
  font-size: .85rem;
  line-height: 1.45;
  color: var(--c-muted);
  text-align: center;
}
.post-content img { border-radius: var(--radius); }
.post-content h2 { scroll-margin-top: 90px; }
.post-content > h2:last-of-type + ul { font-size: .92rem; color: var(--c-muted); }
.post-content blockquote p { margin-bottom: .5rem; }
.post-meta a { color: inherit; text-decoration: underline; text-decoration-color: var(--c-border); }
.post-meta a:hover { color: var(--c-primary); }

@media (max-width: 640px) {
  .post-content table { font-size: .85rem; }
  .post-content th, .post-content td { padding: .5rem .6rem; }
}

/* v1.3.1 header fit: nine menu items + search on one row (desktop only) */
@media (min-width: 901px) {
  .primary-nav a { white-space: nowrap; padding: .5rem .6rem; font-size: .76rem; letter-spacing: .04em; }
  .nav-search input { width: 120px; }
  .nav-search input:focus { width: 160px; }
  .header-inner { gap: .75rem; }
}
@media (min-width: 901px) and (max-width: 1180px) {
  .primary-nav a { padding: .45rem .42rem; font-size: .7rem; }
}
.logo-name { font-size: 1.35rem; white-space: nowrap; }
.logo-tagline { display: none; }
@media (min-width: 1500px) { .logo-tagline { display: block; } }
@media (max-width: 900px) { .logo-tagline { display: block; font-size: .56rem; } }

/* v1.3.2 mobile overflow fix: let grid children shrink below their content width */
.content-sidebar > * { min-width: 0; }
#post-content, .post-content { min-width: 0; overflow-wrap: break-word; }
@media (max-width: 940px) { .content-sidebar { grid-template-columns: minmax(0, 1fr); } }
html, body { overflow-x: hidden; }
