/* Wine Making Journal — site styles */
:root {
  --wine: #5b1a2b;
  --wine-dark: #3d0f1c;
  --wine-light: #8a2f45;
  --gold: #b8893b;
  --gold-light: #e6cf9f;
  --cream: #f8f3ea;
  --paper: #fffdf8;
  --ink: #2b2324;
  --muted: #6b5f60;
  --line: #e3d8c6;
  --radius: 10px;
  --shadow: 0 6px 24px rgba(61, 15, 28, 0.12);
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --max: 1100px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
  font-size: 17px;
}

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

a { color: var(--wine-light); }
a:hover { color: var(--wine); }

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--wine-dark);
  line-height: 1.25;
  margin: 1.6em 0 0.5em;
}
h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-top: 0; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.3rem; }

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

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--wine); color: #fff; padding: .5rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  background: var(--wine-dark);
  color: #fff;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 64px;
}
.brand {
  display: flex; align-items: center; gap: .6rem;
  color: #fff; text-decoration: none; font-family: var(--serif);
}
.brand:hover { color: var(--gold-light); }
.brand svg { flex: none; }
.brand-name { font-size: 1.2rem; font-weight: bold; line-height: 1.1; }
.brand-tag { display: block; font-size: .75rem; color: var(--gold-light); font-family: var(--sans); font-weight: normal; letter-spacing: .03em; }

.nav-toggle {
  display: none; background: none; border: 1px solid rgba(255,255,255,.4);
  color: #fff; border-radius: 6px; padding: .4rem .7rem; font-size: 1rem; cursor: pointer;
}
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; align-items: center; }
.site-nav a {
  color: #fff; text-decoration: none; padding: .5rem .75rem; border-radius: 6px; display: block; font-size: .95rem;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { background: rgba(255,255,255,.12); color: var(--gold-light); }
.site-nav .btn-buy { background: var(--gold); color: var(--wine-dark); font-weight: 600; margin-left: .4rem; }
.site-nav .btn-buy:hover { background: var(--gold-light); color: var(--wine-dark); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--wine-dark); padding: .5rem 1rem 1rem; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; }
  .site-nav .btn-buy { margin: .4rem 0 0; text-align: center; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: .8rem 1.4rem; border-radius: 999px;
  text-decoration: none; font-weight: 600; border: 2px solid transparent; transition: .15s ease;
}
.btn-primary { background: var(--gold); color: var(--wine-dark); }
.btn-primary:hover { background: var(--gold-light); color: var(--wine-dark); }
.btn-outline { border-color: currentColor; color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,.1); color: #fff; }
.btn-wine { background: var(--wine); color: #fff; }
.btn-wine:hover { background: var(--wine-light); color: #fff; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(circle at 85% 20%, rgba(184,137,59,.25), transparent 45%),
    linear-gradient(135deg, var(--wine-dark), var(--wine) 60%, var(--wine-light));
  color: #fff;
  padding: 4rem 0 4.5rem;
}
.hero .container { display: grid; grid-template-columns: 1.3fr 1fr; gap: 3rem; align-items: center; }
.hero h1 { color: #fff; }
.hero .eyebrow { color: var(--gold-light); text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 600; }
.hero p.lead { font-size: 1.2rem; color: #f3e6e9; max-width: 36rem; }
.hero .actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.5rem; }
.hero .meta { margin-top: 1.25rem; font-size: .85rem; color: var(--gold-light); }
@media (max-width: 860px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero .cover-wrap { order: -1; }
}

/* Book cover */
.cover-wrap { display: flex; justify-content: center; perspective: 1200px; }
.cover-link { display: block; max-width: 340px; width: 100%; }
.cover-img {
  display: block; width: 100%; height: auto;
  border-radius: 3px 8px 8px 3px;
  box-shadow: -10px 14px 30px rgba(0,0,0,.45);
  transform: rotateY(-10deg);
  transition: transform .3s ease;
}
.cover-link:hover .cover-img, .cover-link:focus-visible .cover-img { transform: rotateY(0deg) scale(1.02); }
@media (max-width: 860px) { .cover-link { max-width: 260px; } }

/* ---------- Sections ---------- */
.section { padding: 4rem 0; }
.section-alt { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { text-align: center; max-width: 46rem; margin: 0 auto 2.5rem; }
.section-head h2 { margin-top: 0; }
.section-head p { color: var(--muted); }

.page-head {
  background: linear-gradient(135deg, var(--wine-dark), var(--wine));
  color: #fff; padding: 3rem 0 2.5rem;
}
.page-head h1 { color: #fff; margin-bottom: .3rem; }
.page-head p { color: #f3e6e9; margin: 0; max-width: 44rem; }

.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
.card .icon { font-size: 1.8rem; line-height: 1; margin-bottom: .6rem; }

/* Features list */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: .35rem 0 .35rem 1.8rem; position: relative; }
.checklist li::before { content: "✓"; position: absolute; left: 0; color: var(--gold); font-weight: bold; }

/* Journal spread (real book pages) */
.spread {
  display: grid; grid-template-columns: 1fr 1fr;
  max-width: 1040px; margin: 0 auto;
  box-shadow: 0 18px 40px rgba(61, 15, 28, .22);
  border-radius: 4px; overflow: hidden; background: #fff;
}
.spread .page { margin: 0; position: relative; background: #fff; }
.spread a { display: block; }
.spread .page img { display: block; width: 100%; height: auto; }
/* soft gutter shadow where the pages meet */
.spread .page::after { content: ""; position: absolute; top: 0; bottom: 0; width: 28px; pointer-events: none; }
.spread .page:first-child::after { right: 0; background: linear-gradient(to left, rgba(0,0,0,.14), transparent); }
.spread .page:last-child::after { left: 0; background: linear-gradient(to right, rgba(0,0,0,.14), transparent); }
.spread figcaption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 700px) {
  .spread { grid-template-columns: 1fr; gap: 1rem; box-shadow: none; background: none; overflow: visible; }
  .spread .page { box-shadow: var(--shadow); border-radius: 4px; overflow: hidden; }
  .spread .page::after { display: none; }
}

/* Testimonials */
.testimonial {
  background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--gold);
  border-radius: var(--radius); padding: 1.5rem 1.6rem; box-shadow: var(--shadow); margin: 0;
}
.testimonial h3 { margin: .2rem 0 .6rem; font-size: 1.2rem; }
.testimonial blockquote { margin: 0; font-style: italic; color: #463a3b; }
.testimonial figcaption { margin-top: .9rem; font-weight: 600; color: var(--wine); }
.stars { color: var(--gold); letter-spacing: .1em; font-size: 1.05rem; }

/* Free sample download */
.download-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap;
  max-width: 1040px; margin: 1.75rem auto .5rem; padding: 1.1rem 1.4rem;
  background: #fff; border: 1px dashed var(--gold); border-radius: var(--radius);
}
.download-cta strong { display: block; font-family: var(--serif); font-size: 1.15rem; color: var(--wine-dark); }
.download-cta span { color: var(--muted); }
.download-cta .btn span { color: inherit; }
.btn-ghost { border-color: var(--wine); color: var(--wine); background: transparent; }
.btn-ghost:hover { background: var(--wine); color: #fff; }
.gift .actions { display: flex; flex-wrap: wrap; gap: .8rem; }

/* Seasonal ribbon (shown by JS only inside its date window) */
.season-ribbon {
  display: block; text-align: center; text-decoration: none;
  background: var(--gold); color: var(--wine-dark);
  padding: .6rem 1rem; font-size: .95rem;
}
.season-ribbon[hidden] { display: none; }
.season-ribbon:hover { background: var(--gold-light); color: var(--wine-dark); }
.season-more { font-weight: 600; white-space: nowrap; }

/* Gift section */
.gift {
  background:
    radial-gradient(circle at 10% 10%, rgba(184,137,59,.18), transparent 40%),
    #fbf3e4;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.gift-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem; align-items: center; }
.gift h2 { margin-top: .2rem; }
.gift-eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 700; margin: 0; }
.gift .checklist li { padding-top: .45rem; padding-bottom: .45rem; }
.gift .actions { margin-top: 1.25rem; }
.gift-quote { transform: rotate(1.5deg); }
@media (max-width: 860px) {
  .gift-grid { grid-template-columns: 1fr; gap: 2rem; }
  .gift-quote { transform: none; }
}

/* CTA band */
.cta-band { background: var(--wine-dark); color: #fff; text-align: center; padding: 3.5rem 0; }
.cta-band h2 { color: #fff; margin-top: 0; }
.cta-band p { color: #f3e6e9; }

/* In-context buy prompts */
.in-book-note {
  display: flex; align-items: center; gap: 1rem 1.25rem; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--gold-light); border-left: 5px solid var(--gold);
  border-radius: var(--radius); padding: 1rem 1.25rem; margin: -0.75rem 0 2.25rem;
}
.in-book-note p { margin: 0; flex: 1 1 320px; }
.in-book-note strong { color: var(--wine-dark); }
.in-book-icon { font-size: 1.8rem; line-height: 1; }
.in-book { margin: -.35rem 0 .7rem; font-size: .82rem; }
.in-book a { color: var(--gold); text-decoration: none; font-weight: 600; }
.in-book a:hover { color: var(--wine); text-decoration: underline; }

.article-buy {
  display: flex; gap: 1.1rem; align-items: flex-start;
  margin-top: 2rem; padding: 1.2rem; background: #fbf5ea;
  border: 1px solid var(--gold-light); border-radius: var(--radius);
}
.article-buy img { flex: none; border-radius: 2px 5px 5px 2px; box-shadow: -3px 4px 10px rgba(0,0,0,.25); }
.article-buy p { margin: 0 0 .8rem; }
.article-buy-sample { display: inline-block; margin-left: .8rem; font-size: .9rem; }
@media (max-width: 520px) { .article-buy img { display: none; } .article-buy-sample { margin: .6rem 0 0; display: block; } }

/* Sticky buy bar: phones only */
.buy-bar { display: none; }
@media (max-width: 700px) {
  .buy-bar {
    display: flex; align-items: center; gap: .7rem;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: .55rem .75rem calc(.55rem + env(safe-area-inset-bottom));
    background: var(--wine-dark); color: #fff;
    box-shadow: 0 -4px 16px rgba(0,0,0,.25);
    transition: transform .25s ease;
  }
  .buy-bar.is-hidden { transform: translateY(110%); }
  .buy-bar img { display: block; width: 36px; height: auto; border-radius: 2px; }
  .buy-bar-text { flex: 1; min-width: 0; line-height: 1.2; }
  .buy-bar-text strong { display: block; font-family: var(--serif); font-size: .95rem; }
  .buy-bar-text span { display: block; font-size: .75rem; color: var(--gold-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .buy-bar .btn { padding: .5rem 1.1rem; }
  .buy-bar-close { background: none; border: 0; color: #d9c7cb; font-size: 1.4rem; line-height: 1; padding: .2rem .3rem; cursor: pointer; }
  body.has-buy-bar { padding-bottom: 72px; }
}

/* How-To index + article pages */
.container.narrow { max-width: 820px; }
.howto-group { font-size: 1.1rem; font-family: var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--gold); margin: 2.2rem 0 .8rem; }
.howto-group:first-child { margin-top: 0; }
.howto-card { text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .15s ease; }
.howto-card:hover, .howto-card:focus-visible { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(61, 15, 28, .18); color: inherit; }
.howto-card h3 { margin: 0 0 .4rem; }
.howto-card p { margin: 0 0 1rem; color: var(--muted); flex: 1; }
.howto-card .kicker { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); margin-bottom: .3rem; }
.howto-more { color: var(--wine-light); font-weight: 600; font-size: .9rem; }
.breadcrumb { font-size: .85rem; color: var(--gold-light); margin-bottom: .4rem; }
.breadcrumb a { color: var(--gold-light); }
.article-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 0 0 1.5rem; }
.article-nav a {
  display: block; text-decoration: none; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: .9rem 1.1rem; color: var(--wine-dark); font-family: var(--serif);
}
.article-nav a:hover { border-color: var(--gold); color: var(--wine); }
.article-nav small { display: block; font-family: var(--sans); color: var(--muted); font-size: .78rem; margin-bottom: .2rem; }
.article-nav-next { text-align: right; }
@media (max-width: 600px) { .article-nav { grid-template-columns: 1fr; } .article-nav-next { text-align: left; } }

/* Articles (How-To) */
.toc { columns: 2 260px; column-gap: 2rem; padding: 0; list-style: none; }
.toc-group { break-inside: avoid; margin-bottom: 1.2rem; }
.toc-group h3 { margin: 0 0 .3rem; font-size: 1.05rem; color: var(--gold); text-transform: uppercase; letter-spacing: .06em; font-family: var(--sans); }
.toc-group ul { margin: 0; padding-left: 1.1rem; }

.article {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 2rem; margin: 0 0 2rem; box-shadow: var(--shadow); scroll-margin-top: 80px;
}
.article h2 { margin-top: 0; }
.article .kicker { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); }
.article .dateline { color: var(--muted); font-size: .85rem; margin-top: -.3rem; }
.article .back { font-size: .85rem; }
.callout {
  background: #fbf5ea; border: 1px solid var(--gold-light); border-radius: 8px;
  padding: 1rem 1.2rem; margin: 1rem 0;
}
.callout strong { color: var(--wine); }

.process { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: .8rem; counter-reset: step; }
.process li {
  counter-increment: step; position: relative; padding: .9rem 1rem .9rem 3.6rem;
  background: #fbf7f0; border: 1px solid var(--line); border-radius: 8px;
}
.process li::before {
  content: counter(step); position: absolute; left: 1rem; top: .85rem;
  width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--wine); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: .9rem;
}
.process li strong { color: var(--wine-dark); }

.countdown { padding-left: 0; list-style: none; }
.countdown li { display: grid; grid-template-columns: 2.5rem 1fr; gap: .5rem; padding: .4rem 0; border-bottom: 1px dashed var(--line); }
.countdown li span { font-family: var(--serif); font-size: 1.4rem; color: var(--gold); line-height: 1.2; }

/* Reference charts */
.chart-nav { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.chart-nav a {
  text-decoration: none; background: #fff; border: 1px solid var(--line); padding: .4rem .85rem;
  border-radius: 999px; font-size: .9rem; color: var(--wine);
}
.chart-nav a:hover { background: var(--wine); color: #fff; border-color: var(--wine); }

.chart { scroll-margin-top: 80px; margin-bottom: 3rem; }
.chart h2 { margin-top: 0; }
.chart .formula { color: var(--muted); font-size: .9rem; }

.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
table.data { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.data th, table.data td { padding: .5rem .8rem; text-align: left; border-bottom: 1px solid var(--line); }
table.data thead th { background: var(--wine); color: #fff; font-weight: 600; position: sticky; top: 0; }
table.data tbody tr:nth-child(even) { background: #fbf7f0; }
table.data tbody tr:hover { background: #f5ead6; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr.group th { background: #f1e5d1; color: var(--wine-dark); text-transform: uppercase; font-size: .8rem; letter-spacing: .08em; }
table.data tr.highlight td { background: #f6e3b8 !important; font-weight: 600; }

.table-scroll { max-height: 460px; overflow-y: auto; }

.calc {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; margin-bottom: 1.25rem;
}
.calc .card { padding: 1.2rem 1.3rem; }
.calc label { display: block; font-weight: 600; font-size: .9rem; color: var(--wine-dark); margin-bottom: .3rem; }
.calc input, .calc select {
  width: 100%; padding: .55rem .7rem; font-size: 1rem; border: 1px solid #cdbfa8; border-radius: 6px; background: #fff; font-family: inherit;
}
.calc input:focus, .calc select:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.calc .result { margin-top: .75rem; font-size: 1.15rem; font-family: var(--serif); color: var(--wine); min-height: 1.6em; }
.calc .row { display: flex; gap: .6rem; }
.calc .row > div { flex: 1; }
.calc small { color: var(--muted); display: block; margin-top: .4rem; }

.rules { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.rules li { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: .35rem .7rem; font-size: .9rem; }

.filter { margin: 0 0 .8rem; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.filter input { padding: .5rem .7rem; border: 1px solid #cdbfa8; border-radius: 6px; font-size: .95rem; min-width: 240px; font-family: inherit; }

/* Footer */
.site-footer { background: #22080f; color: #d9c7cb; padding: 2.5rem 0 1.5rem; font-size: .9rem; }
.site-footer a { color: var(--gold-light); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.site-footer h4 { color: #fff; margin: 0 0 .6rem; font-size: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { padding: .15rem 0; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 2rem; padding-top: 1rem; font-size: .8rem; color: #a8939a; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

.muted { color: var(--muted); }
.center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media print {
  .site-header, .site-footer, .chart-nav, .calc, .cta-band, .filter, .buy-bar, .in-book-note, .in-book, .article-buy { display: none !important; }
  body { background: #fff; font-size: 12px; }
  .table-scroll { max-height: none; overflow: visible; }
  .table-wrap, .article, .card { box-shadow: none; }
  .chart { break-inside: avoid; }
}

section[id] { scroll-margin-top: 72px; }
