@import "fonts.css";
/*
 * site.css  -  design system for the public "My wine" site.
 * OWNED BY AGENT E. Light theme only. Warm, minimal, friendly, effortless.
 * Self-hosted fonts arrive via fonts.css (Agent B); system stacks keep the page
 * intact before they land. No em dashes anywhere (owner rule). No CDN, no
 * external requests. Built for older, non-technical readers: large type, high
 * contrast, generous spacing, obvious 44px+ targets, real focus states.
 */

:root {
  /* Surfaces and ink */
  --bg:        #FAF7F2;   /* warm paper white page background */
  --surface:   #FFFFFF;   /* cards, panels, table rows */
  --surface-2: #F3EEE4;   /* soft neutral surface (bands, table head) */
  --ink:       #241F1B;   /* near black warm body text */
  --ink-soft:  #5F574C;   /* secondary text, still AA on paper */
  --line:      #E4DCCD;   /* hairline borders */
  --line-soft: #EFE9DD;   /* faint dividers */

  /* Accent: one confident deep vine green, used sparingly. */
  --accent:        #3D5A3C; /* deep vine green */
  --accent-strong: #2E4A2D; /* hover / active */
  --accent-ink:    #FFFFFF; /* text on accent */
  --accent-tint:   #EAF0E3; /* soft green wash for panels and step badges */
  --accent-line:   #CBD8C0; /* green-tinted hairline */

  /* Bottle placeholder glass (shown until real renders land in integration). */
  --bottle-glass:  #37492F;
  --bottle-glass-2:#2C3A26;

  /* Feedback */
  --ok:    #3D5A3C;
  --warn:  #8A6B1F;
  --bad:   #9A3B2A;

  /* Typography. fonts.css defines these families; fallbacks keep it working. */
  --font-sans: "Commissioner", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Literata", Georgia, "Times New Roman", serif;

  /* Fluid type scale (clamp). Body is 18px minimum. */
  --fs-body:  clamp(1.125rem, 1.06rem + 0.3vw, 1.2rem);   /* 18 to ~19 */
  --fs-small: 0.95rem;
  --fs-lede:  clamp(1.25rem, 1.12rem + 0.7vw, 1.55rem);
  --fs-h3:    clamp(1.2rem, 1.08rem + 0.6vw, 1.4rem);
  --fs-h2:    clamp(1.55rem, 1.25rem + 1.5vw, 2.15rem);
  --fs-h1:    clamp(2.1rem, 1.55rem + 2.7vw, 3.25rem);

  /* Rhythm and shape */
  --radius:    12px;
  --radius-lg: 20px;
  --touch:     44px;               /* minimum touch target */
  --maxw:      1120px;             /* content column */
  --measure:   64ch;               /* comfortable reading width for prose */
  --pad-x:     clamp(1.1rem, 3vw, 2rem);
  --gap:       clamp(2.75rem, 6vw, 5.5rem); /* space between page sections */
  --shadow:    0 1px 2px rgba(36, 31, 27, 0.05), 0 10px 30px rgba(36, 31, 27, 0.06);
}

/* -------------------------------------------------------------- base */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { line-height: 1.15; font-weight: 600; margin: 0 0 0.6em; }
h1 { font-family: var(--font-serif); font-weight: 600; font-size: var(--fs-h1); letter-spacing: -0.01em; }
h2 { font-family: var(--font-serif); font-weight: 600; font-size: var(--fs-h2); letter-spacing: -0.005em; }
h3 { font-size: var(--fs-h3); }
p  { margin: 0 0 1rem; }

a { color: var(--accent); text-decoration: underline; text-underline-offset: 0.16em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-strong); }

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

strong { font-weight: 600; }

/* Visible keyboard focus everywhere. */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* -------------------------------------------------------------- skip link */

.skip-link {
  position: absolute; left: 0.75rem; top: -3rem;
  background: var(--accent); color: var(--accent-ink);
  padding: 0.6rem 1rem; border-radius: 0 0 var(--radius) var(--radius);
  text-decoration: none; z-index: 100; transition: top 0.15s ease;
}
.skip-link:focus { top: 0; color: var(--accent-ink); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* -------------------------------------------------------------- header / nav */

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header-inner,
.admin-header-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 0.85rem var(--pad-x);
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}

.brand {
  font-family: var(--font-serif); font-size: 1.4rem; font-weight: 600;
  color: var(--ink); text-decoration: none; letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand:hover { color: var(--ink); }

.nav-toggle {
  display: none;
  margin-left: auto;
  width: var(--touch); height: var(--touch);
  align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer; color: var(--ink);
}
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
  display: block; width: 22px; height: 2px; background: currentColor; border-radius: 2px;
  content: ""; position: relative;
}
.nav-toggle-bar::before { position: absolute; top: -7px; }
.nav-toggle-bar::after  { position: absolute; top: 7px; }

.site-nav-wrap {
  margin-left: auto;
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
}
.site-nav { display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: center; }
.site-nav a {
  color: var(--ink); text-decoration: none; font-weight: 500;
  padding: 0.35rem 0; border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--accent-strong); border-bottom-color: var(--accent-line); }

.nav-cta {
  background: var(--accent); color: var(--accent-ink);
  padding: 0.5rem 0.95rem; border-radius: var(--radius);
  border-bottom: none;
}
.nav-cta:hover { background: var(--accent-strong); color: var(--accent-ink); border-bottom: none; }

.lang-toggle { display: flex; gap: 0.2rem; align-items: center; }
.lang-opt {
  padding: 0.3rem 0.5rem; border-radius: 8px; font-size: 0.9rem;
  color: var(--ink-soft); text-decoration: none; min-width: 2.2rem; text-align: center;
}
.lang-opt:hover { background: var(--surface-2); color: var(--ink); }
.lang-opt.is-active { background: var(--accent); color: var(--accent-ink); }

/* -------------------------------------------------------------- main / footer */

.site-main { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad-x) 1rem; }

.site-footer {
  max-width: var(--maxw); margin: var(--gap) auto 0;
  padding: 2rem var(--pad-x) 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft); font-size: var(--fs-small);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 1rem;
}
.site-footer a { color: var(--ink-soft); }
.site-footer a:hover { color: var(--accent-strong); }
.footer-tagline { flex: 1 1 100%; color: var(--ink); font-size: var(--fs-body); margin-bottom: 0.6rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; }
.footer-copy { margin-left: auto; }

/* -------------------------------------------------------------- buttons */

.btn, button.btn, input[type="submit"].btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: var(--touch); padding: 0.7rem 1.4rem;
  border: 1.5px solid var(--accent); border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-ink); }

.btn-lg { min-height: 52px; padding: 0.85rem 1.8rem; font-size: 1.1rem; }

.btn-quiet {
  background: transparent; color: var(--accent);
  border-color: transparent;
}
.btn-quiet:hover { background: var(--accent-tint); color: var(--accent-strong); border-color: transparent; }

.btn-outline {
  background: transparent; color: var(--accent);
  border-color: var(--accent-line);
}
.btn-outline:hover { background: var(--accent-tint); color: var(--accent-strong); border-color: var(--accent-line); }

.btn-small, .btn.btn-small { min-height: 38px; padding: 0.35rem 0.8rem; font-size: 0.95rem; }

/* Bare button element default (used in admin / auth); keep it usable. */
button:not(.btn):not(.nav-toggle),
input[type="submit"]:not(.btn) {
  min-height: var(--touch); padding: 0.6rem 1.2rem;
  border: 1.5px solid var(--accent); border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 600; cursor: pointer;
}

/* -------------------------------------------------------------- inputs */

input, select, textarea {
  min-height: var(--touch); padding: 0.6rem 0.8rem;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font: inherit;
  max-width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
label { font-weight: 500; }

/* -------------------------------------------------------------- section rhythm */

.section { padding-block: var(--gap); }
.section + .section { padding-top: 0; }
.section-lead { max-width: var(--measure); }
.lede { font-size: var(--fs-lede); color: var(--ink); line-height: 1.5; }
.muted { color: var(--ink-soft); }
.center { text-align: center; }

/* Tinted band that reaches the content-column edges. */
.panel {
  margin-inline: calc(var(--pad-x) * -1);
  padding: clamp(2rem, 5vw, 3.5rem) var(--pad-x);
  background: var(--accent-tint);
  border-radius: var(--radius-lg);
}
.panel--paper { background: var(--surface); border: 1px solid var(--line); }

.section-title { margin-bottom: 1.5rem; }

/* -------------------------------------------------------------- hero */

.hero {
  display: grid; gap: clamp(1.5rem, 4vw, 3.5rem);
  grid-template-columns: 1.05fr 0.95fr; align-items: center;
  padding-block: clamp(2.5rem, 6vw, 5rem);
}
.hero-copy { max-width: 36rem; }
.hero h1 { margin-bottom: 0.6rem; }
.hero-sub { font-size: var(--fs-lede); color: var(--ink-soft); line-height: 1.5; margin-bottom: 1.8rem; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.4rem; }

.hero-media { align-self: center; }
.hero-bottles {
  display: flex; align-items: flex-end; justify-content: center;
  gap: clamp(0.4rem, 2vw, 1.4rem);
}
.bottle-slot { flex: 1 1 0; max-width: 33%; position: relative; }
.bottle-slot--tall { transform: translateY(-6%); max-width: 37%; }
.bottle-img { display: block; width: 100%; height: auto; filter: drop-shadow(0 14px 22px rgba(36,31,27,0.16)); }

/* Placeholder bottle, shown until real renders land (JS removes a broken img). */
.bottle-ph { display: none; }
.bottle-slot.is-missing .bottle-ph {
  display: flex; flex-direction: column; align-items: center;
}
.bottle-ph-neck {
  width: 26%; height: 42px;
  background: linear-gradient(var(--bottle-glass-2), var(--bottle-glass));
  border-radius: 8px 8px 3px 3px;
}
.bottle-ph-body {
  width: 100%; aspect-ratio: 1 / 2.7;
  margin-top: -4px;
  background: linear-gradient(160deg, var(--bottle-glass) 0%, var(--bottle-glass-2) 100%);
  border-radius: 16px 16px 10px 10px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 14px 22px rgba(36,31,27,0.16), inset 0 0 0 1px rgba(255,255,255,0.05);
}
.bottle-ph-label {
  width: 74%; padding: 1.1rem 0.6rem;
  background: var(--surface); border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--ink-soft); font-size: 0.9rem; text-align: center; line-height: 1.35;
}

/* -------------------------------------------------------------- audiences */

.audiences { display: flex; flex-direction: column; gap: 0; }
.audience {
  display: grid; grid-template-columns: 1fr 1.5fr; gap: 1rem 2.5rem;
  padding-block: clamp(1.6rem, 3vw, 2.4rem);
  border-top: 1px solid var(--line-soft);
  align-items: start;
}
.audience:first-child { border-top: none; padding-top: 0.5rem; }
.audience h3 { font-family: var(--font-serif); font-weight: 600; font-size: var(--fs-h3); margin: 0; }
.audience p { margin: 0; color: var(--ink-soft); }

/* -------------------------------------------------------------- how-it-works steps */

.steps {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
  counter-reset: step; list-style: none; margin: 0; padding: 0;
}
.step { margin: 0; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.6rem; height: 2.6rem; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-serif); font-size: 1.25rem; font-weight: 600;
  margin-bottom: 0.9rem;
}
.step h3 { margin-bottom: 0.4rem; }
.step p { margin: 0; color: var(--ink-soft); }

/* -------------------------------------------------------------- price hint / trust */

.hint-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; }
.hint-row .lede { flex: 1 1 22rem; margin: 0; }

.trust p { max-width: var(--measure); color: var(--ink-soft); }

/* -------------------------------------------------------------- price table */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-block: 1.5rem; }
.price-table {
  width: 100%; border-collapse: collapse; min-width: 34rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.price-table caption { caption-side: bottom; text-align: left; color: var(--ink-soft); font-size: var(--fs-small); padding-top: 0.7rem; }
.price-table th, .price-table td { padding: 0.85rem 1rem; text-align: left; border-bottom: 1px solid var(--line-soft); }
.price-table thead th { background: var(--surface-2); font-weight: 600; border-bottom: 1px solid var(--line); }
.price-table tbody tr:last-child td { border-bottom: none; }
.price-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-table .wine-cell { font-weight: 600; }
.price-table tbody tr:hover { background: var(--accent-tint); }

/* Worked example */
.example { margin-top: 1.5rem; }
.example dl {
  margin: 1rem 0 0; display: grid; grid-template-columns: 1fr auto;
  gap: 0.1rem 1.5rem; max-width: 30rem;
}
.example dt { color: var(--ink-soft); padding: 0.5rem 0; border-bottom: 1px solid var(--line-soft); }
.example dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; padding: 0.5rem 0; border-bottom: 1px solid var(--line-soft); }
.example .total { display: contents; }
.example .total dt, .example .total dd { font-weight: 700; color: var(--ink); border-bottom: none; font-size: 1.1rem; }
.example-note { color: var(--ink-soft); font-size: var(--fs-small); margin-top: 0.6rem; }

/* -------------------------------------------------------------- prose (how / legal) */

.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2.4rem; }
.prose h2:first-of-type { margin-top: 0; }
.prose p { color: var(--ink-soft); }
.prose ul { color: var(--ink-soft); padding-left: 1.2rem; }
.prose li { margin-bottom: 0.4rem; }

.draft-note {
  background: var(--surface-2); border: 1px solid var(--line);
  border-left: 4px solid var(--warn);
  padding: 0.9rem 1.1rem; border-radius: var(--radius);
  color: var(--ink); font-size: var(--fs-small); margin-bottom: 2rem;
}

/* -------------------------------------------------------------- FAQ */

.faq { max-width: var(--measure); margin-top: 1rem; }
.faq details {
  border-bottom: 1px solid var(--line);
}
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none;
  padding: 1.1rem 2.5rem 1.1rem 0; position: relative;
  font-weight: 600; font-size: var(--fs-h3); color: var(--ink);
  min-height: var(--touch);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0.4rem; top: 50%;
  transform: translateY(-50%) rotate(0deg); transform-origin: center;
  font-size: 1.6rem; font-weight: 400; color: var(--accent); line-height: 1;
  transition: transform 0.15s ease;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); } /* plus becomes a cross */
.faq summary:hover { color: var(--accent-strong); }
.faq details p { margin: 0 0 1.1rem; color: var(--ink-soft); max-width: 58ch; }

/* -------------------------------------------------------------- flash messages */

.flash { padding: 0.8rem 1.1rem; border-radius: var(--radius); margin: 1rem 0; border: 1px solid transparent; }
.flash-success { background: var(--accent-tint); color: var(--accent-strong); border-color: var(--accent-line); }
.flash-error   { background: #F6E3DC; color: var(--bad); border-color: #E7C6BC; }
.flash-info    { background: var(--surface-2); color: var(--ink); border-color: var(--line); }

/* -------------------------------------------------------------- stub / bare */

.stub { max-width: 40rem; margin: clamp(2.5rem, 8vw, 5rem) auto; text-align: center; }
.stub-title { font-family: var(--font-serif); font-size: var(--fs-h1); }
.stub-body { color: var(--ink-soft); font-size: var(--fs-lede); }

.bare { background: var(--bg); }
.bare-wrap { max-width: 27rem; margin: clamp(2rem, 8vw, 4rem) auto; padding: 0 var(--pad-x); text-align: center; }
.bare-brand { display: inline-block; margin-bottom: 0.5rem; }
.bare-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.75rem; text-align: left; margin-top: 1rem; box-shadow: var(--shadow); }
.inline-form { display: inline; }

/* -------------------------------------------------------------- admin base (shared shell before admin.css loads) */

.admin-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.admin-main { max-width: var(--maxw); margin: 0 auto; padding: 1.25rem var(--pad-x); }
.admin-nav { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.admin-right { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; }
.admin-who { color: var(--ink-soft); font-size: var(--fs-small); }

/* -------------------------------------------------------------- responsive */

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-media { order: -1; max-width: 22rem; margin: 0 auto; }
  .steps { grid-template-columns: 1fr; gap: 1.75rem; }
  .audience { grid-template-columns: 1fr; gap: 0.5rem; }
}

@media (max-width: 680px) {
  .nav-toggle { display: inline-flex; }
  .site-nav-wrap {
    flex-basis: 100%; margin-left: 0; margin-top: 0.75rem;
    flex-direction: column; align-items: stretch; gap: 0.25rem;
    display: none;
  }
  .site-nav-wrap.is-open { display: flex; }
  .site-nav { flex-direction: column; align-items: stretch; gap: 0.25rem; }
  .site-nav a { padding: 0.7rem 0.25rem; border-bottom: 1px solid var(--line-soft); }
  .site-nav a:hover { border-bottom-color: var(--line-soft); }
  .nav-cta { text-align: center; margin-top: 0.5rem; padding: 0.7rem 1rem; }
  .nav-cta:hover { border-bottom: none; }
  .lang-toggle { margin-top: 0.6rem; }
  .footer-copy { margin-left: 0; flex-basis: 100%; margin-top: 0.4rem; }
}
