/* =========================================================
   Welsh Bikers — Design System
   Modern, responsive, accessible styles for a large content site.
   ========================================================= */

:root {
  /* Brand palette (Welsh-inspired) */
  --red: #c8102e;
  --red-dark: #9c0c24;
  --green: #00843d;
  --green-dark: #00602c;
  --ink: #10151b;
  --ink-2: #1b232d;
  --slate: #2c3742;
  --grey: #5b6b7a;
  --grey-2: #8a97a3;
  --line: #e2e8ee;
  --paper: #ffffff;
  --paper-2: #f5f8fb;
  --paper-3: #eef3f8;
  --gold: #f4b400;

  /* Typography */
  --font-head: "Inter", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;

  /* Layout */
  --maxw: 1200px;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 6px 24px rgba(16, 21, 27, 0.08);
  --shadow-lg: 0 18px 50px rgba(16, 21, 27, 0.18);
  --gap: 24px;
  --header-h: 68px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; color: var(--ink); font-weight: 800; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -0.02em; margin: 0 0 .5em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); letter-spacing: -0.01em; margin: 0 0 .6em; }
h3 { font-size: 1.25rem; margin: 0 0 .5em; }
p { margin: 0 0 1.1em; }
ul, ol { margin: 0 0 1.1em; padding-left: 1.3em; }
li { margin-bottom: .4em; }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section { padding: 64px 0; }
.section--tight { padding: 40px 0; }
.section--alt { background: var(--paper-2); }
.section--ink { background: var(--ink); color: #dfe7ee; }
.section--ink h2, .section--ink h3 { color: #fff; }
.lead { font-size: 1.2rem; color: var(--grey); max-width: 70ch; }
.center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.eyebrow {
  display: inline-block; text-transform: uppercase; letter-spacing: .14em;
  font-size: .78rem; font-weight: 700; color: var(--red); margin-bottom: .6em;
}
.section--ink .eyebrow { color: var(--gold); }

/* ---------- Skip link (a11y) ---------- */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 2000;
  background: var(--red); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  font-family: var(--font-head); font-weight: 700; font-size: 1rem;
  padding: 13px 24px; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn--primary { background: var(--red); color: #fff; box-shadow: 0 8px 20px rgba(200,16,46,.28); }
.btn--primary:hover { background: var(--red-dark); color: #fff; }
.btn--green { background: var(--green); color: #fff; box-shadow: 0 8px 20px rgba(0,132,61,.28); }
.btn--green:hover { background: var(--green-dark); color:#fff; }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.btn--ghost:hover { background: rgba(255,255,255,.12); color:#fff; }
.btn--outline { background: #fff; color: var(--ink); border-color: var(--line); }
.btn--outline:hover { border-color: var(--red); color: var(--red); }
.btn--sm { padding: 9px 16px; font-size: .9rem; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,.92); backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h); gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 900; font-size: 1.25rem; color: var(--ink); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand__logo { width: 40px; height: 40px; border-radius: 9px; flex: none; }
.brand__mark { color: var(--red); }
.brand__mark--2 { color: var(--green); }
.nav__links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  color: var(--slate); font-weight: 600; font-size: .97rem; padding: 8px 13px; border-radius: 8px;
  transition: background .15s, color .15s;
}
.nav__links a:hover, .nav__links a.is-active { background: var(--paper-3); color: var(--red); text-decoration: none; }
.nav__cta { margin-left: 6px; }
.nav__toggle {
  display: none; background: none; border: 0; cursor: pointer; padding: 8px;
  width: 44px; height: 44px; border-radius: 8px;
}
.nav__toggle span { display: block; width: 24px; height: 2.5px; background: var(--ink); margin: 5px auto; border-radius: 2px; transition: .25s; }
.nav__toggle[aria-expanded="true"] span:nth-child(1){ transform: translateY(7.5px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2){ opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3){ transform: translateY(-7.5px) rotate(-45deg); }

@media (max-width: 960px) {
  .nav__toggle { display: block; }
  .nav__links {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 10px 16px 18px; box-shadow: var(--shadow);
    transform: translateY(-140%); transition: transform .28s ease; max-height: calc(100vh - var(--header-h)); overflow:auto;
  }
  .nav__links.is-open { transform: translateY(0); }
  .nav__links a { padding: 13px 12px; border-radius: 8px; font-size: 1.05rem; }
  .nav__cta { margin: 8px 0 0; }
  .nav__cta .btn { width: 100%; justify-content: center; }
}

/* ---------- Hero ---------- */
.hero { position: relative; color: #fff; overflow: hidden; }
.hero__bg { position: absolute; inset: 0; z-index: 0; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; }
.hero__bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(16,21,27,.35) 0%, rgba(16,21,27,.55) 55%, rgba(16,21,27,.82) 100%);
}
.hero__inner { position: relative; z-index: 1; padding: 96px 0 84px; max-width: 760px; }
.hero h1 { color: #fff; text-shadow: 0 2px 24px rgba(0,0,0,.35); }
.hero p { font-size: 1.25rem; color: #eef2f6; max-width: 60ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }
.hero__stats { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 40px; }
.hero__stat b { display: block; font-family: var(--font-head); font-size: 2rem; font-weight: 900; color: #fff; }
.hero__stat span { color: #cdd6df; font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; }

/* ---------- Grid & cards ---------- */
.grid { display: grid; gap: var(--gap); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px){ .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px){ .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card__media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--paper-3); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card__media img { transform: scale(1.06); }
.card__body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.card__title { font-size: 1.2rem; margin: 6px 0 8px; }
.card__title a { color: var(--ink); }
.card__title a:hover { color: var(--red); text-decoration: none; }
.card__meta { font-size: .85rem; color: var(--grey-2); margin-top: auto; padding-top: 12px; display:flex; gap:14px; flex-wrap: wrap; }
.card__excerpt { color: var(--grey); font-size: .97rem; }

/* Badges */
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.badge {
  display: inline-block; font-size: .74rem; font-weight: 700; letter-spacing: .03em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 999px;
  background: var(--paper-3); color: var(--slate);
}
.badge--region { background: #e7f3ec; color: var(--green-dark); }
.badge--easy { background: #e7f3ec; color: var(--green-dark); }
.badge--moderate { background: #fff3d6; color: #8a6100; }
.badge--challenging { background: #fde4e7; color: var(--red-dark); }
.badge--overlay { position: absolute; top: 12px; left: 12px; background: rgba(16,21,27,.78); color:#fff; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { font-size: .85rem; color: var(--grey-2); padding: 16px 0; }
.breadcrumbs a { color: var(--grey); }
.breadcrumbs span { margin: 0 8px; color: var(--grey-2); }

/* ---------- Article / prose ---------- */
.prose { max-width: 74ch; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose img { border-radius: var(--radius); margin: 1.4em 0; box-shadow: var(--shadow); }
.prose blockquote {
  margin: 1.4em 0; padding: 6px 22px; border-left: 4px solid var(--red);
  color: var(--slate); font-style: italic; background: var(--paper-2);
}
.figure { margin: 1.6em 0; }
.figure figcaption { font-size: .85rem; color: var(--grey-2); margin-top: 8px; text-align: center; }

/* Page header band */
.page-head { background: var(--ink-2); color: #fff; padding: 54px 0; }
.page-head h1 { color: #fff; }
.page-head p { color: #c8d2db; font-size: 1.15rem; max-width: 70ch; margin: 0; }

/* Fact box / spec list */
.specs { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.specs li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 16px; margin: 0; border-bottom: 1px solid var(--line); }
.specs li:last-child { border-bottom: 0; }
.specs li:nth-child(odd){ background: var(--paper-2); }
.specs dt, .specs .k { color: var(--grey); font-weight: 600; }
.specs .v { font-weight: 700; text-align: right; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }

/* ---------- Map ---------- */
.map { width: 100%; height: 460px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); z-index: 0; }
.map--tall { height: 560px; }
.map-note { font-size: .85rem; color: var(--grey-2); margin-top: 8px; }

/* ---------- Ad slots (Google AdSense / direct ready) ---------- */
.ad-slot {
  display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg, #f2f5f8, #f2f5f8 10px, #eef2f6 10px, #eef2f6 20px);
  border: 1px dashed var(--line); border-radius: var(--radius-sm);
  color: var(--grey-2); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em;
  min-height: 100px; margin: 0 auto; text-align: center;
}
.ad-slot--leaderboard { max-width: 728px; min-height: 90px; }
.ad-slot--rectangle { max-width: 336px; min-height: 280px; }
.ad-label { display:block; font-size:.7rem; letter-spacing:.14em; color: var(--grey-2); text-transform: uppercase; text-align:center; margin-bottom:6px; }

/* Sidebar layout */
.with-sidebar { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 44px; align-items: start; }
.sidebar { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 24px; }
.sidebar__box { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.sidebar__box h3 { font-size: 1.05rem; }
@media (max-width: 900px){ .with-sidebar { grid-template-columns: 1fr; } .sidebar { position: static; } }

/* ---------- CTA band ---------- */
.cta-band { background: linear-gradient(120deg, var(--red) 0%, var(--red-dark) 100%); color: #fff; border-radius: var(--radius); padding: 46px; text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #ffe1e6; max-width: 60ch; margin-left:auto; margin-right:auto; }

/* ---------- Newsletter ---------- */
.newsletter { display: flex; gap: 10px; flex-wrap: wrap; max-width: 460px; }
.newsletter input[type=email] { flex: 1; min-width: 200px; padding: 13px 16px; border-radius: 999px; border: 1px solid var(--line); font-size: 1rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #aeb9c4; padding: 56px 0 28px; font-size: .95rem; }
.site-footer h4 { color: #fff; font-size: 1rem; margin: 0 0 14px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 820px){ .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px){ .footer-grid { grid-template-columns: 1fr; } }
.site-footer a { color: #aeb9c4; }
.site-footer a:hover { color: #fff; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-bottom { border-top: 1px solid #2a333d; margin-top: 40px; padding-top: 20px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: #8593a0; font-size: .85rem; }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 16px; max-width: 640px; }
.form-row { display: grid; gap: 6px; }
.form-row label { font-weight: 600; font-size: .92rem; }
.form-row input, .form-row select, .form-row textarea {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; width: 100%;
}
.form-row textarea { min-height: 140px; resize: vertical; }

/* ---------- Utility ---------- */
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.muted { color: var(--grey); }
.divider { height: 1px; background: var(--line); border: 0; margin: 40px 0; }
.icon-list { list-style: none; padding: 0; }
.icon-list li { padding-left: 30px; position: relative; }
.icon-list li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 900; }
.pill-nav { display: flex; flex-wrap: wrap; gap: 10px; }
.pill-nav a { background: #fff; border: 1px solid var(--line); padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: .92rem; color: var(--slate); }
.pill-nav a:hover, .pill-nav a.is-active { background: var(--red); color: #fff; border-color: var(--red); text-decoration: none; }
