/* ===================================================================
   DA GIULIA -- Website Design System
   Colors and type pulled directly from the printed book's own
   identity, not invented fresh for the web.
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,600&display=swap');

:root {
  /* -- Palette: the book's own wine and pine, plus two new warm accents -- */
  --wine: #7A1F2B;
  --wine-deep: #591620;
  --pine: #1F4838;
  --pine-deep: #163529;
  --parchment: #FBF6EC;
  --parchment-deep: #F1E8D3;
  --ink: #2B2620;
  --ink-soft: #5C554B;
  --terracotta: #C4653B;
  --gold: #A98544;
  --line: #DED0AE;
  --line-soft: #E9DFC5;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'EB Garamond', Garamond, Georgia, serif;

  --measure: 42rem;
  --measure-wide: 60rem;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--parchment);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.22rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--wine);
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}
a:hover { color: var(--wine-deep); }

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--pine);
  line-height: 1.15;
  margin: 0 0 0.5em;
  font-weight: 600;
}

/* ---------- Site header ---------- */
.site-header {
  padding: 1.6rem 5vw 1.4rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  border-bottom: 1px solid var(--line);
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: 0.03em;
  color: var(--wine);
  text-decoration: none;
}
.site-nav {
  display: flex;
  gap: 1.6rem;
  font-size: 1.02rem;
}
.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}
.site-nav a:hover { color: var(--wine); border-bottom-color: var(--wine); }

/* ---------- Hero (homepage) ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 4vw;
  align-items: center;
  padding: 4.5vw 5vw 3vw;
  max-width: 1400px;
  margin: 0 auto;
}
.hero-text .kicker {
  font-family: var(--font-body);
  font-style: italic;
  color: var(--terracotta);
  font-size: 1.15rem;
  margin-bottom: 0.9rem;
}
.hero-text h1 {
  font-size: clamp(2.1rem, 4.2vw, 3.4rem);
  max-width: 12ch;
}
.hero-text p {
  max-width: 42ch;
  font-size: 1.28rem;
  color: var(--ink);
}
.hero-text .byline {
  font-style: italic;
  color: var(--ink-soft);
  margin-top: -0.4rem;
}
.hero-photo {
  position: relative;
  border-radius: 2px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Section framing ---------- */
.section {
  max-width: var(--measure-wide);
  margin: 0 auto;
  padding: 3.2rem 5vw;
}
.section-intro {
  max-width: 56ch;
  color: var(--ink-soft);
  font-size: 1.2rem;
  margin-bottom: 2.2rem;
}
.divider {
  border: none;
  border-top: 1px solid var(--gold);
  width: 64px;
  margin: 0 0 1.6rem;
  opacity: 0.6;
}

/* ---------- Chapter list (table-of-contents style, not cards) ---------- */
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr auto;
  gap: 1.4rem;
  align-items: baseline;
  padding: 1.35rem 0;
  border-top: 1px solid var(--line-soft);
  text-decoration: none;
  color: inherit;
}
.toc-row:last-child { border-bottom: 1px solid var(--line-soft); }
.toc-num {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 1.1rem;
  font-weight: 600;
}
.toc-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--pine);
  font-weight: 600;
}
.toc-title .it { color: var(--wine); }
.toc-desc {
  display: block;
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--ink-soft);
  font-weight: 400;
  margin-top: 0.15rem;
}
.toc-count {
  font-size: 0.98rem;
  color: var(--ink-soft);
  white-space: nowrap;
}
.toc-row:hover .toc-title { color: var(--wine); }

/* ---------- Recipe list within a chapter page ---------- */
.recipe-list { list-style: none; margin: 0; padding: 0; }
.recipe-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 1.3rem;
  align-items: center;
  padding: 1.1rem 0;
  border-top: 1px solid var(--line-soft);
  text-decoration: none;
  color: inherit;
}
.recipe-row:last-child { border-bottom: 1px solid var(--line-soft); }
.recipe-thumb {
  width: 96px; height: 96px;
  object-fit: cover;
  border-radius: 2px;
}
.recipe-row-title {
  font-family: var(--font-display);
  font-size: 1.28rem;
  color: var(--wine);
  font-weight: 600;
}
.recipe-row-teaser {
  font-size: 1.03rem;
  color: var(--ink-soft);
  margin-top: 0.2rem;
}
.recipe-row:hover .recipe-row-title { color: var(--wine-deep); }
.story-flag {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.92rem;
  font-style: italic;
  color: var(--gold);
}

/* ---------- Recipe page ---------- */
.recipe-page { max-width: var(--measure-wide); margin: 0 auto; padding: 2.6rem 5vw 5rem; }
.breadcrumb {
  font-size: 0.98rem;
  color: var(--ink-soft);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 1.6rem;
}
.recipe-head {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 3rem;
  align-items: start;
  margin-bottom: 2.4rem;
}
.recipe-head h1 { font-size: clamp(1.9rem, 3.2vw, 2.7rem); color: var(--wine); }
.recipe-intro { font-size: 1.24rem; }
.recipe-photo img { border-radius: 2px; aspect-ratio: 4/5; object-fit: cover; }

.recipe-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2.6rem;
}
.recipe-columns h2, .recipe-body h2 {
  font-size: 1.3rem;
  color: var(--pine);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.4rem;
  margin-bottom: 0.9rem;
}
.ingredient-list, .cookware-list { list-style: none; margin: 0; padding: 0; }
.ingredient-list li, .cookware-list li {
  padding-left: 1.3rem;
  position: relative;
  margin-bottom: 0.55rem;
}
.ingredient-list li::before {
  content: "\25CF";
  color: var(--wine);
  position: absolute; left: 0; font-size: 0.75em; top: 0.3em;
}
.cookware-list li::before {
  content: "\25C6";
  color: var(--pine);
  position: absolute; left: 0; font-size: 0.75em; top: 0.3em;
}
.cookware-list .it { font-style: italic; }
.yield-note { font-style: italic; color: var(--ink-soft); margin-top: 0.8rem; }

.recipe-body h2 { margin-top: 2rem; }
.recipe-body p { margin: 0 0 1.1rem; }

.storto {
  background: var(--parchment-deep);
  border-left: 3px solid var(--pine);
  padding: 1.5rem 1.7rem;
  margin-top: 2.2rem;
  border-radius: 0 3px 3px 0;
}
.storto h2 { border: none; padding: 0; margin-bottom: 0.6rem; color: var(--pine); }
.storto p:last-child { margin-bottom: 0; }

.storia {
  border-left: 3px solid var(--gold);
  padding: 1.6rem 0 1.6rem 1.7rem;
  margin-top: 2.4rem;
}
.storia h2 {
  border: none; padding: 0; margin-bottom: 0.6rem;
  color: var(--terracotta);
  font-style: italic;
}
.storia p:last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.6rem 5vw 3rem;
  color: var(--ink-soft);
  font-size: 1rem;
}
.site-footer a { color: var(--ink-soft); }
.footer-links { display: flex; gap: 1.6rem; flex-wrap: wrap; margin-bottom: 1rem; }

.pan-chart-section { margin-top: 2rem; }
.table-wrap { overflow-x: auto; margin: 1.2rem 0; }
table.pan-chart {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.98rem;
}
table.pan-chart th {
  background: var(--pine);
  color: var(--parchment);
  font-family: var(--font-display);
  font-weight: 600;
  text-align: left;
  padding: 0.6rem 0.8rem;
}
table.pan-chart th:not(:first-child), table.pan-chart td:not(:first-child) { text-align: center; }
table.pan-chart td {
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--line-soft);
}
table.pan-chart tr.chart-row-bold td {
  font-weight: 600;
  background: var(--parchment-deep);
}

/* ---------- Glossary & About pages ---------- */
.glossary-entry { margin-bottom: 1.3rem; }
.glossary-term {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 600;
  color: var(--wine);
}
.about-page p, .glossary-page p { max-width: var(--measure); }
.signoff { text-align: right; font-style: italic; color: var(--ink-soft); margin-top: 1.5rem; }

@media (max-width: 780px) {
  .hero { grid-template-columns: 1fr; }
  .hero-photo { order: -1; aspect-ratio: 16/10; }
  .recipe-head { grid-template-columns: 1fr; }
  .recipe-photo { order: -1; }
  .recipe-columns { grid-template-columns: 1fr; gap: 2rem; }
  .toc-row { grid-template-columns: 1fr; gap: 0.2rem; }
  .toc-num { font-size: 0.95rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

:focus-visible {
  outline: 2px solid var(--wine);
  outline-offset: 2px;
}
