/* =====================================================================
   The Local Bird — Thème Joornal
   Architecture : CSS sémantique nature-naming, CSS Grid pur + Flexbox
   Palette : Vert forêt · Blanc cassé · Or chaud · Ardoise
   ===================================================================== */

/* --- Reset ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; max-width: 100%; height: auto; }
a { text-decoration: none; }

/* --- Tokens --------------------------------------------------------- */
:root {
  --grove:      #1E3A2B;
  --grove-mid:  #2D5A42;
  --canvas:     #F8F5F0;
  --canvas-alt: #EDEAE4;
  --amber:      #C9954C;
  --amber-lite: #E4B577;
  --ink:        #1A1A1A;
  --ink-soft:   #5A5753;
  --ink-muted:  #9A9591;
  --white:      #FFFFFF;

  --ff-display: 'Playfair Display', Georgia, serif;
  --ff-body:    'DM Sans', system-ui, sans-serif;

  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: 1.375rem;
  --step-3: 1.75rem;
  --step-4: 2.5rem;
  --step-5: 3.5rem;

  --r:      4px;
  --t:      200ms ease;
  --max:    1200px;
  --gutter: 1.5rem;
}

/* --- Base ----------------------------------------------------------- */
body {
  font-family: var(--ff-body);
  background: var(--canvas);
  color: var(--ink);
  line-height: 1.65;
  font-size: var(--step-0);
}

/* --- Layout shell --------------------------------------------------- */
.basecamp {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ===================================================================
   HEADER / TRAILHEAD
   =================================================================== */
.trailhead {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--grove);
  border-bottom: 3px solid var(--amber);
}

.trailhead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
  gap: 1.5rem;
}

.trailhead__logo {
  height: 2.25rem;
  width: auto;
}

/* Nav */
.trail {
  display: flex;
  list-style: none;
}

.trail__link {
  display: block;
  padding: 0.4rem 1rem;
  color: rgba(248, 245, 240, 0.85);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color var(--t);
  white-space: nowrap;
}

.trail__link:hover { color: var(--amber-lite); }

/* Hamburger */
.trailhead__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.trailhead__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--canvas);
  border-radius: 2px;
  transition: transform var(--t), opacity var(--t);
}

@media (max-width: 720px) {
  .trailhead__toggle { display: flex; }

  .trailhead__nav {
    position: fixed;
    top: 4rem;
    inset-inline: 0;
    background: var(--grove);
    padding: 1.5rem var(--gutter);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateY(-110%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
  }

  .trailhead__nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .trail { flex-direction: column; }
  .trail__link { font-size: 1rem; padding: 0.75rem 0; }
}

/* ===================================================================
   HOMEPAGE — SUMMIT HERO
   =================================================================== */
.summit {
  background: var(--grove);
  color: var(--canvas);
  padding: 5rem var(--gutter) 4.5rem;
  position: relative;
}

.summit::after {
  content: '';
  display: block;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--amber), transparent);
}

.summit__inner { max-width: 680px; }

.summit__eyebrow {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 1.25rem;
}

.summit__title {
  font-family: var(--ff-display);
  font-size: clamp(var(--step-4), 7vw, var(--step-5));
  font-weight: 700;
  font-style: italic;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}

.summit__sub {
  font-size: var(--step-1);
  color: rgba(248, 245, 240, 0.7);
  line-height: 1.7;
  max-width: 520px;
  margin-bottom: 2.5rem;
}

.summit__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  background: var(--amber);
  color: var(--ink);
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: var(--r);
  transition: background var(--t), transform var(--t);
}

.summit__cta:hover {
  background: var(--amber-lite);
  transform: translateY(-2px);
}

/* ===================================================================
   SECTION HEADERS — RIDGE
   =================================================================== */
.ridge {
  padding: 3.5rem 0 1.5rem;
}

.ridge__label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 0.5rem;
}

.ridge__title {
  font-family: var(--ff-display);
  font-size: var(--step-3);
  font-weight: 600;
  color: var(--ink);
}

/* ===================================================================
   HOMEPAGE GRID — TERRAIN
   =================================================================== */
.terrain {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding-bottom: 3rem;
}

@media (max-width: 992px) { .terrain { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .terrain { grid-template-columns: 1fr; } }

/* ===================================================================
   ARTICLE CARD — WAYPOINT
   =================================================================== */
.waypoint {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--canvas-alt);
  transition: transform var(--t), box-shadow var(--t);
}

.waypoint:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(30, 58, 43, 0.1);
}

.waypoint__img-wrap {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--canvas-alt);
  flex-shrink: 0;
}

.waypoint__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.waypoint:hover .waypoint__img { transform: scale(1.04); }

.waypoint__body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.waypoint__meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.waypoint__cat {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grove);
}

.waypoint__sep { color: var(--ink-muted); font-size: 0.7rem; }

.waypoint__date,
.waypoint__read {
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.waypoint__title {
  font-family: var(--ff-display);
  font-size: var(--step-2);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.waypoint__title a {
  color: var(--ink);
  transition: color var(--t);
}

.waypoint__title a:hover { color: var(--grove); }

.waypoint__excerpt {
  font-size: 0.875rem;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  flex: 1;
}

.waypoint__arrow {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grove);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: auto;
  transition: gap var(--t), color var(--t);
}

.waypoint__arrow:hover { gap: 0.6rem; color: var(--amber); }

/* ===================================================================
   POST-LIST PAGE — PATH
   =================================================================== */
.path__header {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--canvas-alt);
  margin-bottom: 2.5rem;
}

.path__title {
  font-family: var(--ff-display);
  font-size: clamp(var(--step-3), 4vw, var(--step-4));
  font-style: italic;
  font-weight: 700;
  color: var(--ink);
}

.path__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 3rem;
}

@media (max-width: 992px) { .path__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .path__grid { grid-template-columns: 1fr; } }

/* Pagination */
.pages {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  padding-bottom: 4rem;
}

.pages .page a,
.pages .page span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding-inline: 0.5rem;
  border: 1px solid var(--canvas-alt);
  border-radius: var(--r);
  font-size: 0.875rem;
  color: var(--ink-soft);
  transition: border-color var(--t), color var(--t), background var(--t);
}

.pages .page a:hover {
  border-color: var(--grove);
  color: var(--grove);
}

.pages .active a,
.pages .active span {
  background: var(--grove);
  border-color: var(--grove);
  color: var(--white);
  font-weight: 600;
}

/* ===================================================================
   ARTICLE PAGE — ASCENT
   =================================================================== */
.ascent {
  padding-block: 2.5rem 4rem;
  max-width: 800px;
  margin-inline: auto;
}

/* Breadcrumb */
.ascent__crumb {
  max-width: 800px;
  margin-inline: auto;
  padding-top: 1.5rem;
  margin-bottom: 0;
}

.ascent__crumb ol,
.ascent__crumb ul {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.ascent__crumb li + li::before {
  content: '/';
  margin-right: 0.4rem;
  color: var(--ink-muted);
}

.ascent__crumb a { color: var(--ink-muted); transition: color var(--t); }
.ascent__crumb a:hover { color: var(--grove); }

/* Category badge */
.ascent__cat-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grove);
  background: rgba(30, 58, 43, 0.08);
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}

.ascent__h1 {
  font-family: var(--ff-display);
  font-size: clamp(var(--step-3), 4.5vw, var(--step-4));
  font-weight: 700;
  font-style: italic;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 1.25rem;
}

.ascent__byline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--ink-muted);
  padding-block: 0.75rem;
  border-top: 1px solid var(--canvas-alt);
  border-bottom: 1px solid var(--canvas-alt);
  margin-bottom: 2rem;
}

.ascent__sep { color: var(--canvas-alt); }

/* Cover image */
.ascent__cover {
  margin-bottom: 2rem;
  border-radius: var(--r);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--canvas-alt);
}

.ascent__cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Table of contents */
.toc {
  background: var(--canvas-alt);
  border-left: 3px solid var(--grove);
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--r) var(--r) 0;
  margin-bottom: 2.5rem;
  font-size: 0.875rem;
}

.toc ol,
.toc ul {
  padding-left: 1.25rem;
  color: var(--ink-soft);
  line-height: 1.8;
}

.toc a { color: var(--ink-soft); }
.toc a:hover { color: var(--grove); }

/* Prose / article body */
.prose {
  font-size: var(--step-1);
  line-height: 1.8;
  color: var(--ink);
}

.prose > * + * { margin-top: 1.5rem; }

.prose h2 {
  font-family: var(--ff-display);
  font-size: var(--step-3);
  font-weight: 600;
  color: var(--grove);
  margin-top: 3rem;
  line-height: 1.3;
}

.prose h3 {
  font-family: var(--ff-display);
  font-size: var(--step-2);
  font-weight: 600;
  margin-top: 2.5rem;
  line-height: 1.3;
}

.prose a {
  color: var(--grove);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose a:hover { color: var(--grove-mid); }
.prose strong { font-weight: 600; }

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

.prose li { margin-bottom: 0.4rem; }

.prose blockquote {
  border-left: 4px solid var(--amber);
  padding: 1rem 1.5rem;
  background: var(--canvas-alt);
  font-style: italic;
  color: var(--ink-soft);
  border-radius: 0 var(--r) var(--r) 0;
}

.prose img {
  border-radius: var(--r);
  margin-block: 2rem;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.prose th {
  background: var(--grove);
  color: var(--white);
  padding: 0.6rem 1rem;
  text-align: left;
  font-weight: 500;
}

.prose td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--canvas-alt);
}

.prose tr:nth-child(even) td { background: rgba(0, 0, 0, 0.02); }

/* Author card */
.author-card {
  margin-top: 3rem;
  padding: 1.5rem;
  background: var(--canvas-alt);
  border-radius: var(--r);
  border-left: 3px solid var(--amber);
}

/* Related articles */
.echoes {
  padding-block: 3rem 4rem;
  border-top: 1px solid var(--canvas-alt);
  margin-top: 1rem;
}

.echoes__title {
  font-family: var(--ff-display);
  font-size: var(--step-3);
  font-weight: 600;
  margin-bottom: 2rem;
}

.echoes__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 720px) { .echoes__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .echoes__grid { grid-template-columns: 1fr; } }

/* ===================================================================
   FOOTER — BASE
   =================================================================== */
.base {
  background: var(--grove);
  color: rgba(248, 245, 240, 0.7);
  border-top: 3px solid var(--amber);
  padding: 3rem var(--gutter);
  margin-top: 4rem;
}

.base__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2rem;
  max-width: var(--max);
  margin-inline: auto;
}

@media (max-width: 720px) {
  .base__inner { grid-template-columns: 1fr; text-align: center; }
}

.base__logo-link { display: inline-block; }
.base__logo { height: 1.75rem; width: auto; opacity: 0.8; }
.base__tagline { font-size: 0.8rem; margin-top: 0.5rem; }

.base__links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  flex-wrap: wrap;
  justify-content: center;
}

.base__link {
  color: rgba(248, 245, 240, 0.7);
  font-size: 0.8rem;
  transition: color var(--t);
}

.base__link:hover { color: var(--amber-lite); }

.base__copy {
  font-size: 0.75rem;
  text-align: right;
}

@media (max-width: 720px) { .base__copy { text-align: center; } }
