/* =====================================================================
   Trail Vida — shared design system
   Warm, earthy outdoor-adventure palette. Mobile-first, no dependencies.
   ===================================================================== */

:root {
  --bg: #faf7f1;          /* warm cream page background */
  --surface: #ffffff;     /* cards */
  --sand: #ece2d0;        /* soft sand panels */
  --sand-deep: #ddcfb6;
  --ink: #2c2a24;         /* near-black warm text */
  --muted: #6f6a5d;       /* secondary text */
  --forest: #38493d;      /* deep evergreen */
  --forest-deep: #25332a;
  --accent: #c46a39;      /* terracotta / late-sun */
  --accent-soft: #e5a06a;
  --line: rgba(44, 42, 36, 0.12);

  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --maxw: 1140px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 18px 40px -24px rgba(37, 51, 42, 0.45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 0.4em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
h3 { font-size: 1.35rem; }

p { margin: 0 0 1.1em; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

em { font-style: italic; color: var(--accent); }

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

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.85em 1.7em;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #ab582c; }
.btn-ghost { background: transparent; border-color: currentColor; color: var(--forest); }
.btn-ghost:hover { background: var(--forest); color: #fff; border-color: var(--forest); }
.btn-light { background: #fff; color: var(--forest-deep); }
.btn-light:hover { background: var(--sand); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 247, 241, 0.88);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand svg { display: block; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a {
  color: var(--ink);
  font-weight: 500;
  font-size: 0.97rem;
}
.nav-links a:hover { color: var(--accent); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; transition: 0.2s; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 72px; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .nav-links.open { max-height: 420px; }
  .nav-links a { width: 100%; padding: 14px 22px; border-top: 1px solid var(--line); }
  .nav-links .btn { margin: 14px 22px; text-align: center; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--forest-deep);
  color: #fff;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg svg { width: 100%; height: 100%; }
.hero-inner {
  position: relative;
  z-index: 2;
  padding: clamp(5rem, 12vw, 9rem) 0 clamp(4rem, 9vw, 7rem);
  max-width: 760px;
}
.hero h1 { color: #fff; }
.hero h1 em { color: var(--accent-soft); }
.hero .lede { font-size: 1.22rem; color: rgba(255,255,255,0.86); max-width: 38ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 2rem; }
.hero .btn-ghost { color: #fff; }
.hero .btn-ghost:hover { background: #fff; color: var(--forest-deep); border-color: #fff; }

/* ---------- Generic sections ---------- */
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.section-sand { background: var(--sand); }
.section-forest { background: var(--forest); color: #fff; }
.section-forest h2, .section-forest h3 { color: #fff; }
.section-forest em { color: var(--accent-soft); }
.center { text-align: center; }
.lead { font-size: 1.18rem; color: var(--muted); max-width: 60ch; }
.center .lead { margin-left: auto; margin-right: auto; }

/* ---------- Split (meet the team) ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.split-media {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.split-media svg { width: 100%; height: 100%; display: block; }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } .split-media { max-width: 420px; margin: 0 auto; } }

/* ---------- Category tiles ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 2.5rem; }
.cat {
  display: block;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem 1.4rem;
  text-align: center;
  border: 1px solid var(--line);
  color: var(--ink);
  transition: transform 0.18s ease, box-shadow 0.2s ease;
}
.cat:hover { transform: translateY(-4px); box-shadow: var(--shadow); text-decoration: none; }
.cat-icon {
  width: 64px; height: 64px; margin: 0 auto 1rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--sand); border-radius: 50%; color: var(--forest);
}
.cat h3 { margin: 0; font-size: 1.18rem; }
.cat p { margin: 0.3rem 0 0; font-size: 0.9rem; color: var(--muted); }
@media (max-width: 760px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Post cards ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; margin-top: 2.5rem; }
.post-grid.two { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  display: flex; flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-media { aspect-ratio: 16 / 11; overflow: hidden; }
.card-media svg { width: 100%; height: 100%; display: block; }
.card-body { padding: 1.3rem 1.4rem 1.6rem; display: flex; flex-direction: column; flex: 1; }
.tags { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.6rem; }
.card-body h3 { font-size: 1.22rem; }
.card-body h3 a { color: var(--ink); }
.card-body h3 a:hover { color: var(--accent); text-decoration: none; }
.card-excerpt { font-size: 0.95rem; color: var(--muted); margin: 0.2rem 0 0; }
.read-more { margin-top: auto; padding-top: 1rem; font-weight: 600; font-size: 0.9rem; }
@media (max-width: 900px) { .post-grid, .post-grid.two { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .post-grid, .post-grid.two { grid-template-columns: 1fr; } }

/* ---------- Newsletter ---------- */
.newsletter { text-align: center; }
.signup { display: flex; gap: 10px; max-width: 480px; margin: 1.8rem auto 0; }
.signup input {
  flex: 1; padding: 0.85em 1.1em; border-radius: 999px; border: 1px solid var(--line);
  font-size: 1rem; font-family: var(--font-body); background: #fff; color: var(--ink);
}
.signup input:focus { outline: 2px solid var(--accent); border-color: transparent; }
@media (max-width: 520px) { .signup { flex-direction: column; border-radius: var(--radius); } .signup .btn { width: 100%; } }

/* ---------- Partners ---------- */
.partners { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 18px 38px; margin-top: 2.2rem; }
.partner {
  font-family: var(--font-display); font-weight: 700; font-size: 1.25rem;
  color: var(--muted); opacity: 0.7; letter-spacing: 0.02em;
}

/* ---------- Filter chips (blog) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 1.8rem; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 0.5em 1.2em; border-radius: 999px; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; font-family: var(--font-body); transition: 0.15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--forest); color: #fff; border-color: var(--forest); }

/* ---------- Article ---------- */
.article-hero { background: var(--forest-deep); color: #fff; padding: clamp(3.5rem, 8vw, 6rem) 0 clamp(3rem, 6vw, 4.5rem); }
.article-hero .tags { color: var(--accent-soft); }
.article-hero h1 { color: #fff; max-width: 18ch; }
.article-meta { color: rgba(255,255,255,0.75); font-size: 0.95rem; }
.article-body { max-width: 720px; margin: 0 auto; padding: clamp(2.5rem, 6vw, 4rem) 22px; }
.article-body h2 { margin-top: 2rem; }
.article-body figure { margin: 2rem 0; }
.article-body figure svg { width: 100%; border-radius: var(--radius); display: block; }
.article-body figcaption { font-size: 0.85rem; color: var(--muted); text-align: center; margin-top: 0.6rem; }
.callout {
  border-left: 4px solid var(--accent);
  background: var(--sand);
  padding: 1.2rem 1.4rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 2rem 0;
}
.callout p:last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--forest-deep); color: rgba(255,255,255,0.8); padding: 4rem 0 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2.5rem; }
.site-footer h4 { color: #fff; font-family: var(--font-body); font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 1rem; }
.site-footer a { color: rgba(255,255,255,0.8); }
.site-footer a:hover { color: #fff; }
.footer-brand { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: #fff; margin-bottom: 0.6rem; }
.footer-list { list-style: none; padding: 0; margin: 0; }
.footer-list li { margin-bottom: 0.6rem; font-size: 0.95rem; }
.footer-bottom {
  margin-top: 3rem; padding-top: 1.6rem; border-top: 1px solid rgba(255,255,255,0.15);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; font-size: 0.85rem;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .rise { opacity: 0; transform: translateY(18px); animation: rise 0.7s ease forwards; }
  .rise.d1 { animation-delay: 0.1s; }
  .rise.d2 { animation-delay: 0.2s; }
  .rise.d3 { animation-delay: 0.3s; }
  @keyframes rise { to { opacity: 1; transform: none; } }
}
