/* =========================================================
   Perfect Pour Guide — Site Stylesheet
   A single, self-contained stylesheet. No build step needed.
   Rebrand by editing the CSS variables in :root below.
   ========================================================= */

:root {
  /* ---- Brand colours (change these to rebrand the whole site) ---- */
  --color-espresso: #2c1810;      /* darkest brown - headings, nav */
  --color-coffee: #5b3a29;        /* mid brown - secondary text/accents */
  --color-caramel: #c9762f;       /* warm accent - CTAs, links */
  --color-caramel-dark: #a85f22;  /* hover state for accent */
  --color-cream: #faf5ee;         /* page background */
  --color-cream-deep: #f1e6d8;    /* card / section background */
  --color-latte: #efe0cb;         /* borders, dividers */
  --color-text: #2b2320;          /* body copy */
  --color-text-muted: #6b5d54;    /* secondary copy */
  --color-white: #ffffff;
  --color-success: #3f7d4f;
  --color-error: #b3432b;

  /* ---- Type ---- */
  --font-heading: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* ---- Spacing / shape ---- */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(44, 24, 16, 0.08);
  --shadow-md: 0 6px 24px rgba(44, 24, 16, 0.12);
  --max-width: 1140px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-cream);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--color-caramel-dark); text-decoration-color: rgba(201,118,47,0.4); }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-espresso);
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 600;
}
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1.2em; }
ul, ol { padding-left: 1.3em; }
button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--color-caramel); outline-offset: 2px; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-espresso);
  color: var(--color-white);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  z-index: 200;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  padding: 13px 24px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--color-caramel); color: var(--color-white); }
.btn-primary:hover { background: var(--color-caramel-dark); }
.btn-outline { background: transparent; border-color: var(--color-espresso); color: var(--color-espresso); }
.btn-outline:hover { background: var(--color-espresso); color: var(--color-white); }
.btn-light { background: var(--color-white); color: var(--color-espresso); }
.btn-block { width: 100%; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 245, 238, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--color-latte);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--color-espresso);
  text-decoration: none;
}
.brand-mark { width: 34px; height: 34px; flex-shrink: 0; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--color-coffee);
  font-weight: 500;
  text-decoration: none;
  font-size: 0.98rem;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--color-caramel-dark); }
.nav-cta { display: flex; align-items: center; gap: 14px; }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle svg { width: 26px; height: 26px; }

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-cream);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    border-bottom: 1px solid var(--color-latte);
    box-shadow: var(--shadow-md);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .nav-links.is-open { max-height: 400px; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 14px 20px; width: 100%; border-bottom: 1px solid var(--color-latte); }
  .nav-cta { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  padding: 64px 0 56px;
  background: linear-gradient(180deg, var(--color-cream) 0%, var(--color-cream-deep) 100%);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}
.eyebrow {
  display: inline-block;
  background: var(--color-latte);
  color: var(--color-coffee);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.hero-lede {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  max-width: 52ch;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 24px; }
.hero-art { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-tight { padding: 32px 0; }
.section-alt { background: var(--color-cream-deep); }
.section-head { max-width: 60ch; margin-bottom: 32px; }
.section-head p { color: var(--color-text-muted); }
.section-flex-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

/* ---------- Cards / Grids ---------- */
.grid { display: grid; gap: 28px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.card {
  background: var(--color-white);
  border: 1px solid var(--color-latte);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-media { aspect-ratio: 16/10; background: var(--color-cream-deep); }
.card-body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-caramel-dark);
}
.card-title { font-size: 1.15rem; margin: 0; }
.card-title a { color: var(--color-espresso); text-decoration: none; }
.card-title a:hover { color: var(--color-caramel-dark); }
.card-excerpt { color: var(--color-text-muted); font-size: 0.95rem; margin: 0; }
.card-meta { margin-top: auto; font-size: 0.82rem; color: var(--color-text-muted); }

/* ---------- Icon tiles (feature list) ---------- */
.feature {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.feature-icon {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--color-latte);
  display: flex;
  align-items: center;
  justify-content: center;
}
.feature-icon svg { width: 24px; height: 24px; }
.feature h3 { margin-bottom: 4px; font-size: 1.05rem; }
.feature p { color: var(--color-text-muted); margin: 0; font-size: 0.95rem; }

/* ---------- Newsletter ---------- */
.newsletter {
  background: var(--color-espresso);
  color: var(--color-cream);
  border-radius: var(--radius-lg);
  padding: 40px;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 32px;
  align-items: center;
}
@media (max-width: 760px) {
  .newsletter { grid-template-columns: 1fr; padding: 28px; }
}
.newsletter h2 { color: var(--color-white); }
.newsletter p { color: #e6d9c9; margin-bottom: 0; }
.newsletter-form { display: flex; gap: 10px; flex-wrap: wrap; }
.newsletter-form input[type="email"] {
  flex: 1;
  min-width: 180px;
  padding: 13px 16px;
  border-radius: 999px;
  border: 1px solid #7a5c47;
  background: #3a2418;
  color: var(--color-white);
  font-size: 1rem;
}
.newsletter-form input[type="email"]::placeholder { color: #c8b6a5; }
.form-note { font-size: 0.82rem; color: #c8b6a5; margin-top: 10px; }
.form-status { font-size: 0.9rem; margin-top: 10px; min-height: 1.2em; }
.form-status.is-error { color: #ffb4a0; }
.form-status.is-success { color: #b7e6c2; }

/* ---------- Ad slots ---------- */
.ad-slot {
  background: repeating-linear-gradient(45deg, var(--color-cream-deep), var(--color-cream-deep) 10px, #ffffff 10px, #ffffff 20px);
  border: 1px dashed #c9b79f;
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}
.ad-slot-label {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-size: 0.7rem;
  margin-bottom: 6px;
  color: #8a7862;
}
.ad-slot--leaderboard { min-height: 100px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ad-slot--rectangle { min-height: 250px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ad-slot--inline { min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 32px 0; }

/* ---------- Article / prose layout ---------- */
.article-header {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--color-latte);
}
.article-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 14px;
}
.breadcrumbs { font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 18px; }
.breadcrumbs a { color: var(--color-text-muted); }
.article-layout {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 48px;
  padding: 40px 0 64px;
  align-items: start;
}
@media (max-width: 900px) {
  .article-layout { grid-template-columns: 1fr; }
}
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.3em; }
.prose p, .prose li { color: var(--color-text); }
.prose ul, .prose ol { margin-bottom: 1.2em; }
.prose li { margin-bottom: 0.4em; }
.prose blockquote {
  margin: 1.6em 0;
  padding: 16px 22px;
  border-left: 4px solid var(--color-caramel);
  background: var(--color-cream-deep);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--color-coffee);
}
.prose table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: 0.94rem; }
.prose th, .prose td { border: 1px solid var(--color-latte); padding: 10px 12px; text-align: left; }
.prose th { background: var(--color-cream-deep); font-family: var(--font-heading); }
.callout {
  background: var(--color-cream-deep);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 1.6em 0;
}
.callout h3 { margin-top: 0; }
.affiliate-box {
  border: 1px solid var(--color-latte);
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 1.4em 0;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--color-white);
}
.affiliate-box .num {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-caramel);
  flex-shrink: 0;
}
.affiliate-box .btn { margin-top: 8px; }
.affiliate-disclosure-tag {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  border: 1px solid var(--color-latte);
  border-radius: 999px;
  padding: 2px 10px;
  display: inline-block;
  margin-top: 6px;
}
.rating-stars { color: var(--color-caramel); font-size: 0.95rem; letter-spacing: 1px; }

/* ---------- Sidebar ---------- */
.sidebar { display: flex; flex-direction: column; gap: 28px; position: sticky; top: 90px; }
.sidebar-card {
  background: var(--color-cream-deep);
  border-radius: var(--radius-md);
  padding: 22px;
}
.sidebar-card h3 { font-size: 1.05rem; }
.toc { font-size: 0.92rem; }
.toc a { display: block; padding: 5px 0; color: var(--color-coffee); text-decoration: none; }
.toc a:hover { color: var(--color-caramel-dark); }

/* ---------- Author box ---------- */
.author-box {
  display: flex;
  gap: 16px;
  align-items: center;
  background: var(--color-cream-deep);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 40px;
}
.author-avatar { width: 60px; height: 60px; border-radius: 50%; flex-shrink: 0; }
.author-box h3 { margin-bottom: 2px; font-size: 1rem; }
.author-box p { margin: 0; font-size: 0.9rem; color: var(--color-text-muted); }

/* ---------- Forms (contact) ---------- */
.form-grid { display: grid; gap: 18px; max-width: 560px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-weight: 600; font-size: 0.92rem; color: var(--color-espresso); }
.form-field input, .form-field textarea, .form-field select {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid #d8c7b3;
  background: var(--color-white);
  font-family: inherit;
  font-size: 1rem;
  color: var(--color-text);
}
.form-field textarea { resize: vertical; min-height: 140px; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
  border-color: var(--color-caramel);
}

/* ---------- Social links ---------- */
.social-links { display: flex; gap: 12px; }
.social-links a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-cream-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-espresso);
}
.social-links a:hover { background: var(--color-caramel); color: var(--color-white); }
.social-links svg { width: 18px; height: 18px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-espresso);
  color: #d8c7b3;
  padding: 56px 0 28px;
  margin-top: 64px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid #4a2f20;
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
.site-footer h4 { color: var(--color-white); font-family: var(--font-heading); font-size: 1rem; margin-bottom: 14px; }
.site-footer a { color: #d8c7b3; text-decoration: none; font-size: 0.92rem; }
.site-footer a:hover { color: var(--color-white); }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-brand { display: flex; align-items: center; gap: 10px; color: var(--color-white); font-family: var(--font-heading); font-weight: 700; font-size: 1.2rem; margin-bottom: 12px; text-decoration: none; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 22px;
  font-size: 0.82rem;
  color: #a4907a;
}
.footer-bottom a { color: #a4907a; }

/* ---------- Page header (non-article pages) ---------- */
.page-header { padding: 56px 0 40px; background: var(--color-cream-deep); }
.page-header p { color: var(--color-text-muted); max-width: 60ch; }

/* ---------- Utilities ---------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.badge {
  display: inline-block;
  background: var(--color-cream-deep);
  color: var(--color-coffee);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-right: 6px;
}

/* ---------- Filter tabs (blog index) ---------- */
.filter-tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.filter-tabs a {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--color-latte);
  color: var(--color-coffee);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
}
.filter-tabs a[aria-current="true"], .filter-tabs a:hover { background: var(--color-espresso); color: var(--color-white); border-color: var(--color-espresso); }

/* ---------- Calculator tool ---------- */
.tool-panel {
  background: var(--color-white);
  border: 1px solid var(--color-latte);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 640px) { .tool-grid { grid-template-columns: 1fr; } }
.tool-result {
  margin-top: 24px;
  background: var(--color-cream-deep);
  border-radius: var(--radius-md);
  padding: 22px;
}
.tool-result .big-number { font-family: var(--font-heading); font-size: 2.2rem; color: var(--color-caramel-dark); }
.range-value { font-weight: 700; color: var(--color-caramel-dark); }

/* ---------- 404 ---------- */
.error-page { padding: 100px 0; text-align: center; }
.error-code { font-family: var(--font-heading); font-size: 6rem; color: var(--color-latte); line-height: 1; }

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