/* Trail & Ride styles. Mobile-first, no external fonts.
   Brand: forest green #285943, accent orange #E59B44. */

:root {
  --green: #285943;
  --green-dark: #1b3d2e;
  --green-light: #e7efe9;
  --orange: #e59b44;
  --orange-dark: #a4650f; /* AA on white for links/accents */
  --ink: #1b241f;         /* dark text, strong contrast */
  --muted: #4c564f;       /* AA on white */
  --bg: #ffffff;
  --surface: #f6f8f6;
  --border: #d7ded8;
  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 1120px;
  --measure: 68ch;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", "Liberation Sans", sans-serif;
  --shadow: 0 1px 2px rgba(27, 36, 31, 0.08), 0 6px 18px rgba(27, 36, 31, 0.08);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 1.0625rem;
}

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

a { color: var(--orange-dark); }
a:hover { color: var(--green); }

h1, h2, h3 { line-height: 1.2; color: var(--green-dark); }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 1rem; }

/* Accessibility helpers */
.visually-hidden, .skip-link {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: fixed; left: 1rem; top: 1rem; z-index: 1000;
  width: auto; height: auto; clip: auto;
  background: var(--green); color: #fff; padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
}
:focus-visible { outline: 3px solid var(--orange-dark); outline-offset: 2px; }

.noscript-banner {
  background: var(--green-light);
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  margin: 0.75rem auto;
  border-radius: var(--radius-sm);
}

/* Buttons */
.button {
  display: inline-block;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--green);
  color: var(--green);
  background: #fff;
  text-decoration: none;
  font-weight: 600;
}
.button:hover { background: var(--green-light); color: var(--green-dark); }
.button--accent {
  background: var(--orange);
  border-color: var(--orange);
  color: #1b140a; /* dark text on orange (never orange on white) */
}
.button--accent:hover { background: #d08a30; border-color: #d08a30; color: #1b140a; }

/* Header */
.site-header {
  background: var(--green);
  color: #fff;
  position: sticky; top: 0; z-index: 50;
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: 0.6rem; flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; }
.brand__logo { height: 40px; width: auto; }

/* The header always sits on a green background, so the light (white-text)
   logo is always correct there. The dark variant exists for use on light
   surfaces (e.g. embeds) and is shipped in the repo. */
.nav-toggle {
  margin-left: auto;
  background: transparent; border: 2px solid rgba(255,255,255,.6);
  border-radius: var(--radius-sm); width: 44px; height: 40px;
  display: none; align-items: center; justify-content: center;
  cursor: pointer;
}
.js .nav-toggle {
  display: inline-flex;
}
.nav-toggle__bar, .nav-toggle__bar::before, .nav-toggle__bar::after {
  display: block; width: 20px; height: 2px; background: #fff; position: relative;
}
.nav-toggle__bar::before, .nav-toggle__bar::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bar::before { top: -6px; }
.nav-toggle__bar::after { top: 6px; }

.js .site-nav { display: none; width: 100%; }
.js .site-nav.is-open { display: block; }
.site-nav__list {
  list-style: none; margin: 0.5rem 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 0.25rem;
}
.site-nav__list a {
  display: block; color: #fff; text-decoration: none;
  padding: 0.6rem 0.25rem; border-bottom: 1px solid rgba(255,255,255,.15);
}
.site-nav__list a[aria-current="page"] { color: var(--orange); font-weight: 700; }
.site-nav__list a:hover { color: var(--orange); }

.lang-switcher { margin-top: 0.75rem; }
.lang-switcher__label { display: block; font-size: 0.85rem; opacity: 0.85; margin-bottom: 0.25rem; }
.lang-switcher__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.lang-switcher__list a {
  color: #fff; text-decoration: none; font-size: 0.9rem;
  padding: 0.25rem 0.5rem; border: 1px solid rgba(255,255,255,.35); border-radius: 999px;
}
.lang-switcher__list a[aria-current="true"] { background: var(--orange); color: #1b140a; border-color: var(--orange); }

@media (min-width: 820px) {
  .nav-toggle { display: none; }
  .site-nav { display: flex !important; align-items: center; width: auto; gap: 1rem; flex-wrap: nowrap; }
  .site-nav__list { flex-direction: row; margin: 0; gap: 1rem; flex-wrap: nowrap; }
  .site-nav__list a { border-bottom: 0; padding: 0.25rem 0; white-space: nowrap; }
  .lang-switcher { margin-top: 0; flex: 0 0 auto; }
  .lang-switcher__label { display: none; }
  .lang-switcher__list { flex-wrap: nowrap; gap: 0.35rem; }
  .lang-switcher__list a { padding: 0.2rem 0.45rem; }
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--green-dark), var(--green));
  color: #fff; padding-block: clamp(2.5rem, 8vw, 5.5rem);
}
.hero__inner { max-width: 760px; }
.hero__title { color: #fff; font-size: clamp(1.9rem, 5vw, 3rem); margin: 0 0 0.5rem; }
.hero__subtitle { font-size: clamp(1.05rem, 2.5vw, 1.3rem); opacity: 0.95; margin: 0 0 1.5rem; }

/* Sections */
.section { padding-block: 2.25rem; }
.section--center { text-align: center; }
.section__title, .page-title { font-size: clamp(1.4rem, 3vw, 2rem); margin: 0 0 0.75rem; }
.page-title { margin-top: 1.5rem; }
.section__lead { color: var(--muted); max-width: var(--measure); font-size: 1.1rem; }

/* Card grid */
.card-grid {
  display: grid; gap: 1.25rem; margin-top: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 620px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 940px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.card__link { display: block; color: inherit; text-decoration: none; height: 100%; }
.card__media { aspect-ratio: 3 / 2; background: var(--surface); overflow: hidden; }
.card__img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 1rem; }
.card__kind {
  display: inline-block; font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--green); font-weight: 700; margin-bottom: 0.35rem;
}
.card__title { font-size: 1.15rem; margin: 0 0 0.4rem; }
.card__summary { color: var(--muted); margin: 0; font-size: 0.98rem; }
.card__link:hover .card__title { color: var(--orange-dark); }

/* Tile grid */
.tile-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); margin-top: 1rem; }
.tile {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.9rem 1rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  text-decoration: none; color: var(--green-dark); font-weight: 600;
}
.tile:hover { border-color: var(--green); background: var(--green-light); }
.tile__count { color: var(--muted); font-weight: 400; font-size: 0.85rem; }

/* Prose / article */
.prose { max-width: var(--measure); }
.prose p, .prose li { font-size: 1.08rem; overflow-wrap: break-word; }
.prose h2 { margin-top: 2rem; }
.prose__lead, .prose__section p { color: var(--ink); }
.prose__lead { font-size: 1.15rem; }

.article { padding-block: 1.5rem 3rem; }
.article__header { max-width: var(--measure); }
.article__context { display: flex; gap: 0.75rem; color: var(--muted); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.03em; }
.article__kind { color: var(--green); font-weight: 700; }
.article__title { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0.25rem 0 0.5rem; }
.article__summary { font-size: 1.2rem; color: var(--muted); }
.article-hero, .article-figure { margin: 1.5rem 0; }
.article-hero img, .article-figure img { width: 100%; border-radius: var(--radius); }
.article-figure figcaption { font-size: 0.9rem; color: var(--muted); margin-top: 0.4rem; }
.article__layout { display: grid; gap: 2rem; }
@media (min-width: 960px) {
  .article__layout { grid-template-columns: minmax(0, 1fr) 280px; align-items: start; }
}

/* Breadcrumb */
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; margin: 0.5rem 0 1rem; font-size: 0.9rem; }
.breadcrumb li + li::before { content: "/"; margin-right: 0.4rem; color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.breadcrumb [aria-current="page"] { color: var(--ink); }

/* Facts */
.facts { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; }
.facts h2 { font-size: 1.1rem; margin-top: 0; }
.facts__row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.35rem 0; border-bottom: 1px solid var(--border); }
.facts__row:last-child { border-bottom: 0; }
.facts dt { font-weight: 600; }

/* Tags */
.tag-list { margin: 0.75rem 0; }
.tag-list__label { color: var(--muted); font-size: 0.9rem; }
.tag { display: inline-block; background: var(--green-light); color: var(--green-dark); border-radius: 999px; padding: 0.15rem 0.7rem; font-size: 0.85rem; text-decoration: none; margin: 0.15rem 0.1rem; }
.tag:hover { background: var(--green); color: #fff; }

/* Gallery */
.article-gallery { margin: 2.5rem 0; }
.gallery { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.gallery__link { display: block; border-radius: var(--radius-sm); overflow: hidden; }
.gallery__link img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }

/* Share, prev/next, related */
.share { margin: 2rem 0; color: var(--muted); }
.share__label { font-weight: 600; }
.prev-next { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; margin: 2rem 0; }
.prev-next__link { display: block; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: inherit; background: var(--surface); }
.prev-next__link span { display: block; font-size: 0.8rem; color: var(--muted); text-transform: uppercase; }
.prev-next__next { text-align: right; }
.related { margin-top: 2.5rem; }

.fallback-note { background: #fff6e8; border: 1px solid var(--orange); color: #5a3a08; padding: 0.6rem 1rem; border-radius: var(--radius-sm); }

/* Search */
.search-form { display: flex; gap: 0.5rem; margin: 1.25rem 0; flex-wrap: wrap; }
.search-form input {
  flex: 1 1 240px; padding: 0.7rem 0.9rem; font-size: 1rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.search-status { color: var(--muted); min-height: 1.2em; }
.search-result { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.search-result__title { margin: 0 0 0.25rem; font-size: 1.2rem; }
.search-fallback__list { columns: 2 220px; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10, 18, 13, 0.92);
  display: flex; align-items: center; justify-content: center;
}
/* The hidden attribute must win over the flex display above, otherwise the
   overlay covers the whole page on load before any gallery link is clicked. */
.lightbox[hidden] { display: none; }
.lightbox__img { max-width: 92vw; max-height: 86vh; width: auto; height: auto; border-radius: var(--radius-sm); }
.lightbox__close, .lightbox__nav {
  position: absolute; background: rgba(255,255,255,0.15); color: #fff;
  border: 0; font-size: 2rem; width: 48px; height: 48px; border-radius: 50%;
  cursor: pointer; line-height: 1;
}
.lightbox__close { top: 1rem; right: 1rem; }
.lightbox__prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox__close:hover, .lightbox__nav:hover { background: rgba(255,255,255,0.3); }

/* Footer */
.site-footer { background: var(--green-dark); color: #fff; margin-top: 3rem; padding-block: 2rem; }
.site-footer__inner { display: grid; gap: 1rem; }
.site-footer__tagline { font-size: 1.1rem; margin: 0; }
.site-footer__nav { list-style: none; display: flex; flex-wrap: wrap; gap: 1rem; padding: 0; margin: 0; }
.site-footer__nav a { color: #fff; text-decoration: none; }
.site-footer__nav a:hover { color: var(--orange); }
.site-footer__copyright { margin: 0; opacity: 0.8; font-size: 0.9rem; }

/* Empty / not-found */
.empty { color: var(--muted); }
.not-found-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; margin-top: 1.5rem; }

/* Language chooser root page */
.chooser-page { background: linear-gradient(135deg, var(--green-dark), var(--green)); color: #fff; min-height: 100vh; }
.chooser { max-width: 560px; text-align: center; padding-block: 3rem; }
.chooser__logo { margin: 0 auto 1.5rem; height: 56px; width: auto; }
.chooser__title { color: #fff; }
.chooser__text { opacity: 0.9; }
.chooser__list { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.chooser__list a { display: block; padding: 0.8rem; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.3); border-radius: var(--radius-sm); color: #fff; text-decoration: none; font-weight: 600; }
.chooser__list a:hover { background: var(--orange); color: #1b140a; border-color: var(--orange); }

/* prefers-color-scheme: both logo variants ship in the repo. The dark-text
   variant (logo-horizontal-dark.svg) is available for light surfaces; the
   header and chooser use the light variant because they sit on green. */

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