/* ============================================================
   Burrsmith Guides & Recipes - shared styles
   Design tokens mirror index.html / details.html.
   ============================================================ */
:root {
  --max-width: 1120px;
  --radius: 12px;
  --radius-pill: 999px;
  --section-pad: clamp(3.5rem, 8vw, 7rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --accent: #c6a052;
  --champagne: #e6dfd3;
  --glow: 0 0 40px rgba(198, 160, 82, 0.15);
}
[data-theme="dark"] {
  --bg: #010101;
  --surface: #0a0a0c;
  --border: rgba(255, 255, 255, 0.08);
  --text: rgba(255, 255, 255, 0.92);
  --text-muted: rgba(255, 255, 255, 0.6);
  --accent: #c6a052;
  --btn-bg: #f7f5f2;
  --btn-fg: #111111;
  --nav-bg: rgba(5, 5, 5, 0.75);
  --card-grad-a: #211a12;
  --card-grad-b: #0d0b09;
}
[data-theme="light"] {
  --bg: #f7f5f2;
  --surface: #ffffff;
  --border: #e7e3de;
  --text: #141414;
  --text-muted: #5c5f63;
  --accent: #8a6240;
  --btn-bg: #111111;
  --btn-fg: #f7f5f2;
  --nav-bg: rgba(247, 245, 242, 0.78);
  --card-grad-a: #ece1d1;
  --card-grad-b: #f4ece0;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.1; letter-spacing: -0.03em; margin: 0; font-weight: 700; }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.6rem); }
h3 { font-size: 1.1rem; }
p { margin: 0; }
::selection { background: rgba(198, 160, 82, 0.3); color: #fff; }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3rem);
}
.section { padding-block: clamp(2.5rem, 6vw, 5rem); }
.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn-primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn:hover { transform: translateY(-2px); }

/* ---------- Scroll reveal (mirrors index.html) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
/* ---------- Nav (sticky, blurred; mirrors existing + adds hamburger) ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.9rem;
}
.logo { display: inline-flex; align-items: center; }
.logo img { display: block; height: 30px; width: auto; }
[data-theme="dark"] .logo .logo-light { display: none; }
[data-theme="light"] .logo .logo-dark { display: none; }

.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s var(--ease);
}
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--text); }

.theme-toggle {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.theme-toggle:hover { border-color: var(--accent); transform: rotate(12deg); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Hamburger - hidden on desktop */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
}
.nav-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav-toggle svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

@media (max-width: 760px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem clamp(1.25rem, 5vw, 3rem) 1rem;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 0.85rem 0; border-bottom: 1px solid var(--border); font-size: 1rem; }
  .nav-links .theme-toggle { margin-top: 0.75rem; align-self: flex-start; }
  .nav-toggle { display: inline-flex; }
}

/* ---------- Breadcrumb ---------- */
.breadcrumb { margin-bottom: 1rem; }
.breadcrumb a { color: var(--accent); font-size: 0.85rem; font-weight: 600; }

/* ---------- Hero ---------- */
.g-hero { padding-top: clamp(2.5rem, 6vw, 4.5rem); }
.g-hero .lead {
  color: var(--text-muted);
  font-size: 1.15rem;
  max-width: 46ch;
  margin-top: 1rem;
}
.g-hero .hero-actions { display: flex; gap: 0.75rem; margin-top: 1.75rem; flex-wrap: wrap; }
.g-hero-media { margin-top: 2.5rem; }

/* ---------- Image placeholder (embeds AI prompt; reserves space) ---------- */
.img-slot {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 30% 20%, rgba(198,160,82,0.10), transparent 60%),
    linear-gradient(135deg, var(--card-grad-a), var(--card-grad-b));
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.img-slot[data-ratio="16:9"] { aspect-ratio: 16 / 9; }
.img-slot[data-ratio="4:3"] { aspect-ratio: 4 / 3; }
.img-slot[data-ratio="1:1"] { aspect-ratio: 1 / 1; }
.img-slot .slot-inner { text-align: center; max-width: 46ch; }
.img-slot .slot-label {
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.img-slot .slot-prompt { color: var(--text-muted); font-size: 0.82rem; line-height: 1.45; }
.img-slot .slot-meta { color: var(--text-muted); opacity: 0.7; font-size: 0.7rem; margin-top: 0.6rem; }

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

.g-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.5s var(--ease), border-color 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.g-card .img-slot { border: 0; border-radius: 0; }
.g-card .g-card-body { padding: 1.25rem 1.25rem 1.4rem; }
.g-card h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.g-card p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.9rem; }
.g-card .read-more {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  gap: 0.4rem;
  transition: gap 0.4s var(--ease);
}
.g-card .img-slot .slot-inner { transition: transform 0.7s var(--ease); }

/* Balanced hover: lift + glow + image zoom + arrow slide */
.g-card:hover {
  transform: translateY(-6px);
  border-color: rgba(198, 160, 82, 0.4);
  box-shadow: 0 18px 40px rgba(0,0,0,0.5), 0 0 30px rgba(198,160,82,0.08);
}
.g-card:hover .img-slot .slot-inner { transform: scale(1.06); }
.g-card:hover .read-more { gap: 0.75rem; }
@media (prefers-reduced-motion: reduce) {
  .g-card, .g-card .img-slot .slot-inner, .g-card .read-more { transition: none; }
  .g-card:hover { transform: none; }
  .g-card:hover .img-slot .slot-inner { transform: none; }
}

/* Badges (brew time / difficulty / stats) */
.badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.9rem; }
.badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.28rem 0.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.badge svg { width: 13px; height: 13px; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Brew Calculator ---------- */
.calc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: clamp(1.25rem, 4vw, 2rem);
}
@media (max-width: 720px) { .calc { grid-template-columns: 1fr; } }
.calc label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--text-muted); }
.calc select,
.calc input[type="number"] {
  width: 100%;
  min-height: 44px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 0.9rem;
  font: inherit;
}
.calc .field { margin-bottom: 1.1rem; }
.calc input[type="range"] { width: 100%; height: 44px; accent-color: var(--accent); }
.calc .ratio-readout { color: var(--accent); font-weight: 700; }
.calc-results { display: flex; flex-direction: column; justify-content: center; gap: 0.9rem; }
.calc-result {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
}
.calc-result .k { color: var(--text-muted); font-size: 0.85rem; }
.calc-result .v { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.calc-result .v small { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); }

/* ---------- Grind Size Guide ---------- */
.grind-list { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 2rem; }
.grind-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.grind-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  min-height: 44px;
  background: transparent;
  border: 0;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.grind-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.grind-particles { flex: 0 0 auto; display: flex; align-items: center; gap: 3px; width: 76px; }
.grind-particles i { display: block; border-radius: 50%; background: var(--champagne); opacity: 0.85; }
.grind-name { font-weight: 700; flex: 1; }
.grind-methods { color: var(--text-muted); font-size: 0.8rem; }
.grind-body { max-height: 0; overflow: hidden; transition: max-height 0.35s var(--ease); }
.grind-item.open .grind-body { max-height: 200px; }
.grind-body p { padding: 0 1.1rem 1.1rem; color: var(--text-muted); font-size: 0.9rem; }
@media (prefers-reduced-motion: reduce) { .grind-body { transition: none; } }

/* ---------- Guide timeline (builds on .steps concept, vertical) ---------- */
.timeline { margin-top: 2rem; display: flex; flex-direction: column; gap: 1.5rem; }
.tl-step {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 1.25rem;
  align-items: start;
}
.tl-num {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--accent);
}
.tl-content h3 { margin-bottom: 0.35rem; display: flex; align-items: center; gap: 0.5rem; }
.tl-content h3 svg { width: 18px; height: 18px; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tl-content p { color: var(--text-muted); font-size: 0.95rem; }
.tl-content .img-slot { margin-top: 0.9rem; }

/* Meta bar + quick reference + recipe stat row */
.meta-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.25rem; }
.quick-ref, .stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
}
.stat { text-align: center; }
.stat .k { display: block; color: var(--text-muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.3rem; }
.stat .v { font-size: 1.15rem; font-weight: 700; }

/* ---------- Tips ---------- */
.tip-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 1.4rem; transition: transform 0.5s var(--ease), border-color 0.5s var(--ease), box-shadow 0.5s var(--ease); }
.tip-card:hover { transform: translateY(-6px); border-color: rgba(198,160,82,0.4); box-shadow: 0 18px 40px rgba(0,0,0,0.5), 0 0 30px rgba(198,160,82,0.08); }
.tip-card h3 { margin-bottom: 0.5rem; }
.tip-card p { color: var(--text-muted); font-size: 0.9rem; }
@media (prefers-reduced-motion: reduce) { .tip-card { transition: none; } .tip-card:hover { transform: none; } }

/* ---------- Recommended Tools ---------- */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-top: 2rem; }
.tool-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; transition: transform 0.5s var(--ease), border-color 0.5s var(--ease); }
.tool-card:hover { transform: translateY(-4px); border-color: rgba(198,160,82,0.4); }
.tool-card .tool-body { padding: 1rem 1.1rem 1.2rem; }
.tool-card h3 { font-size: 0.98rem; margin-bottom: 0.3rem; }
.tool-card p { color: var(--text-muted); font-size: 0.82rem; margin-bottom: 0.7rem; }
.tool-card .read-more { font-size: 0.82rem; font-weight: 600; color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .tool-card { transition: none; } .tool-card:hover { transform: none; } }

/* ---------- Related links ---------- */
.related-links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.related-links a { border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 0.6rem 1.1rem; font-size: 0.9rem; font-weight: 600; transition: border-color 0.2s var(--ease); }
.related-links a:hover { border-color: var(--accent); }

/* ---------- Footer (mirrors existing) ---------- */
.footer { border-top: 1px solid var(--border); padding-block: 2.5rem; text-align: center; color: var(--text-muted); font-size: 0.85rem; }
.footer .logo { margin-bottom: 0.75rem; justify-content: center; }
.footer .logo img { height: 22px; }
.footer-links { display: flex; gap: 1.5rem; justify-content: center; margin-top: 0.75rem; flex-wrap: wrap; }
.footer-links a { display: inline-flex; align-items: center; gap: 0.45rem; transition: color 0.2s var(--ease); }
.footer-links a:hover { color: var(--text); }
.social-icon { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.footer-links a:hover .social-icon { stroke: var(--accent); }
