/* =========================================================
   The Choc Doc — stylesheet
   Colours and fonts are set once here, in :root.
   ========================================================= */

@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 800; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("../fonts/dm-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 1000; font-style: normal; font-display: swap;
}

:root {
  --ivory: #F7F3EA;        /* page background */
  --paper: #FFFDF9;        /* cards */
  --sand: #EEE3D0;         /* about band */
  --cocoa: #302018;        /* main text, footer */
  --cocoa-btn: #4E2F22;    /* buttons */
  --cocoa-btn-hover: #302018;
  --muted: #5E4A3C;        /* secondary text */
  --gold: #B39A60;         /* decorative lines only */
  --gold-ink: #75602F;     /* gold-toned small text (passes contrast) */
  --line: #DCCFB6;         /* hairlines */

  --font-display: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --text-sm: clamp(0.85rem, 0.82rem + 0.15vw, 0.9rem);
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1.05rem + 0.35vw, 1.3rem);
  --text-xl: clamp(1.5rem, 1.25rem + 1vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.5rem + 2vw, 3rem);
  --text-hero: clamp(2.4rem, 1.6rem + 3vw, 4.1rem);

  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-6: 1.5rem; --space-8: 2rem; --space-12: 3rem; --space-16: 4rem; --space-24: 6rem;

  --container: 72rem;
  --radius: 3px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ivory); color: var(--cocoa);
  font-family: var(--font-body); font-size: var(--text-base); line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 450; line-height: 1.12; margin: 0 0 var(--space-4); letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }
p { margin: 0 0 var(--space-4); text-wrap: pretty; }
figure { margin: 0; }

:focus-visible { outline: 2px solid var(--cocoa); outline-offset: 3px; border-radius: 2px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 2.5rem); }
.narrow { max-width: 44rem; }

.skip-link { position: absolute; left: 1rem; top: -4rem; background: var(--cocoa); color: var(--ivory); padding: 0.6rem 1rem; z-index: 100; border-radius: var(--radius); }
.skip-link:focus { top: 1rem; }

.eyebrow { font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-ink); font-weight: 600; margin-bottom: var(--space-3); }
.lede { font-size: var(--text-lg); color: var(--muted); max-width: 40ch; }
.small-note { font-size: var(--text-sm); color: var(--muted); max-width: 52ch; }

/* ---------- Buttons & links ---------- */
.button {
  display: inline-block; background: var(--cocoa-btn); color: var(--ivory); text-decoration: none;
  padding: 0.8rem 1.6rem; border-radius: 999px; font-weight: 500; font-size: 0.98rem;
  transition: background-color 160ms ease;
}
.button:hover { background: var(--cocoa-btn-hover); }
.text-link { text-decoration: none; border-bottom: 1px solid var(--gold); padding-bottom: 2px; font-weight: 500; }
.text-link:hover { border-bottom-color: var(--cocoa); }
.link-gap { margin-left: var(--space-6); }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--gold); background: var(--ivory); position: relative; z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); min-height: 5rem; }
.wordmark { font-family: var(--font-display); font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem); font-weight: 500; text-decoration: none; letter-spacing: -0.015em; white-space: nowrap; }
.wordmark-the { font-style: italic; font-weight: 400; color: var(--gold-ink); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-8); }
.site-nav a { text-decoration: none; font-size: 0.98rem; padding: 0.4rem 0; border-bottom: 1.5px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--gold); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--cocoa); font-weight: 500; }

.nav-toggle { display: none; }

@media (max-width: 47.99rem) {
  .header-inner { min-height: 4.25rem; flex-wrap: wrap; }
  /* Without JavaScript the menu is simply shown below the wordmark. */
  .no-js .site-nav { width: 100%; padding-bottom: var(--space-3); }
  .no-js .site-nav ul { gap: var(--space-2) var(--space-6); }

  .js .nav-toggle {
    display: inline-flex; align-items: center; gap: 0.55rem; background: none; border: 1px solid var(--line);
    border-radius: 999px; padding: 0.5rem 0.9rem; font: inherit; font-size: 0.92rem; color: var(--cocoa); cursor: pointer;
  }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 16px; height: 1.5px; background: currentColor; position: relative; transition: transform 160ms ease; }
  .nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-bars::before { top: -5px; } .nav-toggle-bars::after { top: 5px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(5px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-5px) rotate(-45deg); }

  .js .site-nav { display: none; width: 100%; }
  .js .site-nav.is-open { display: block; padding: var(--space-2) 0 var(--space-4); }
  .js .site-nav ul { flex-direction: column; gap: 0; }
  .js .site-nav li + li { border-top: 1px solid var(--line); }
  .js .site-nav a { display: block; padding: 0.85rem 0; font-size: 1.05rem; border-bottom: 0; }
  .js .site-nav a[aria-current="page"] { color: var(--gold-ink); }
}

/* ---------- Hero ---------- */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3rem); }
.hero-inner { display: grid; grid-template-columns: 1fr; gap: var(--space-8); align-items: center; }
.hero-title { font-size: var(--text-hero); font-weight: 420; line-height: 1.02; letter-spacing: -0.02em; margin-bottom: var(--space-6); }
.hero-lede { font-size: var(--text-lg); color: var(--muted); max-width: 32ch; margin-bottom: var(--space-8); }
.hero-media { justify-self: center; max-width: 542px; width: 100%; }
.hero-media img { width: 100%; border-radius: var(--radius); box-shadow: 0 18px 40px -24px rgba(48, 32, 24, 0.45); }
.hero-media figcaption { font-family: var(--font-display); font-style: italic; color: var(--muted); font-size: 0.95rem; margin-top: var(--space-3); text-align: right; }
.hero-media figcaption a { text-decoration-color: var(--gold); text-underline-offset: 3px; }
@media (min-width: 56rem) {
  .hero-inner { grid-template-columns: 1.25fr 1fr; gap: var(--space-12); }
  .hero-title .line { white-space: nowrap; }
  .hero-media { justify-self: end; }
}

/* thin gold rule with centred italic note */
.rule-note { display: flex; align-items: center; gap: var(--space-4); margin: 0; font-family: var(--font-display); font-style: italic; color: var(--muted); font-size: 1rem; text-align: center; }
.rule-note::before, .rule-note::after { content: ""; flex: 1; height: 1px; background: var(--gold); }
.rule-note span { max-width: 30ch; }
@media (min-width: 40rem) { .rule-note span { max-width: none; } }

/* ---------- Sections ---------- */
.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section-tight { padding-top: clamp(1.5rem, 4vw, 2.5rem); }
.section-head { text-align: center; max-width: 40rem; margin: 0 auto var(--space-8); }
.section-head h2 { font-size: var(--text-2xl); margin-bottom: var(--space-2); }
.section-head p { color: var(--muted); margin: 0; }
.section-more { text-align: center; margin: var(--space-8) 0 0; }

/* ---------- Chocolate cards ---------- */
.choc-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: var(--space-6); }
@media (min-width: 36rem) { .choc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 60rem) { .choc-grid { grid-template-columns: repeat(3, 1fr); } }
.choc-card { display: flex; }
.choc-card[hidden] { display: none; }
.choc-link { display: flex; flex-direction: column; width: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; transition: border-color 160ms ease, box-shadow 160ms ease; }
.choc-link:hover { border-color: var(--gold); box-shadow: 0 12px 28px -20px rgba(48, 32, 24, 0.5); }
.choc-img { display: block; background: #fff; border-bottom: 1px solid var(--line); aspect-ratio: 392 / 240; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; }
.choc-img img { width: 100%; height: 100%; object-fit: cover; }
.choc-body { display: block; padding: var(--space-4) var(--space-6) var(--space-6); }
.choc-family { display: block; font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-ink); font-weight: 600; margin-bottom: var(--space-2); }
.choc-name { font-size: 1.35rem; margin: 0 0 var(--space-2); }
.card-text { font-size: 0.95rem; color: var(--muted); margin: 0; line-height: 1.55; }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.chip { font: inherit; font-size: 0.9rem; color: var(--cocoa); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 0.45rem 1rem; cursor: pointer; transition: background-color 140ms ease, border-color 140ms ease; }
.chip:hover { border-color: var(--gold); }
.chip[aria-pressed="true"] { background: var(--cocoa-btn); color: var(--ivory); border-color: var(--cocoa-btn); }
.filter-status { font-size: var(--text-sm); color: var(--muted); margin-bottom: var(--space-6); }

/* ---------- About band (home): photo | text | photo ---------- */
.band { background: var(--sand); padding: clamp(3rem, 7vw, 5rem) 0; }
.band-inner { display: grid; gap: var(--space-6); grid-template-columns: 1fr 1fr; grid-template-areas: "text text" "a b"; align-items: center; }
.band-text { grid-area: text; text-align: center; }
.band-text h2 { font-size: var(--text-2xl); }
.band-text p { max-width: 42ch; margin-left: auto; margin-right: auto; }
.band-photo { margin: 0; }
.band-photo-a { grid-area: a; }
.band-photo-b { grid-area: b; }
.band-photo img, .story-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); box-shadow: 0 14px 30px -22px rgba(48, 32, 24, 0.55); }
.band-mono { display: block; width: 3rem; height: 3rem; margin: 0 auto var(--space-4); color: var(--gold); }
@media (min-width: 56rem) {
  .band-inner { grid-template-columns: minmax(0, 260px) minmax(0, 1fr) minmax(0, 260px); grid-template-areas: "a text b"; gap: var(--space-12); justify-content: center; }
}

/* ---------- Page heads ---------- */
.page-head { padding: clamp(2.5rem, 6vw, 4.5rem) 0 var(--space-6); }
.page-head h1 { font-size: var(--text-hero); font-weight: 420; letter-spacing: -0.02em; }
.page-head-inner { display: grid; gap: var(--space-8); align-items: center; }
.page-head-img { border-radius: var(--radius); max-width: 365px; width: 100%; box-shadow: 0 18px 40px -26px rgba(48, 32, 24, 0.5); }
@media (min-width: 56rem) { .page-head-inner { grid-template-columns: 1.4fr 1fr; } .page-head-img { justify-self: end; } }

/* ---------- Detail page ---------- */
.detail { padding: var(--space-8) 0 var(--space-12); }
.breadcrumb ol { list-style: none; padding: 0; margin: 0 0 var(--space-8); display: flex; flex-wrap: wrap; gap: var(--space-2); font-size: var(--text-sm); color: var(--muted); }
.breadcrumb li + li::before { content: "/"; margin-right: var(--space-2); color: var(--gold); }
.breadcrumb a { text-decoration-color: var(--gold); text-underline-offset: 3px; }
.detail-inner { display: grid; gap: var(--space-8); align-items: start; }
.detail-media { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; max-width: 480px; width: 100%; }
.detail-wide .detail-media { max-width: 720px; }
.detail-media img { width: 100%; }
.detail-text h1 { font-size: var(--text-hero); font-weight: 420; letter-spacing: -0.02em; }
.detail-desc p { font-size: var(--text-lg); max-width: 44ch; }
.detail-note { border-left: 2px solid var(--gold); padding: var(--space-2) 0 var(--space-2) var(--space-4); margin: var(--space-6) 0; color: var(--muted); font-size: var(--text-sm); max-width: 52ch; }
.detail-note p { margin: 0; }
@media (min-width: 56rem) {
  .detail-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-12); }
  .detail-wide { grid-template-columns: 1fr; }
  .detail-wide .detail-media { justify-self: start; }
}
.pager { display: flex; justify-content: space-between; gap: var(--space-4); border-top: 1px solid var(--line); margin-top: var(--space-12); padding-top: var(--space-6); }
.pager a { text-decoration: none; font-family: var(--font-display); font-size: 1.15rem; display: flex; flex-direction: column; }
.pager a:hover { color: var(--gold-ink); }
.pager-next { text-align: right; align-items: flex-end; }
.pager-label { font-family: var(--font-body); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-ink); font-weight: 600; }
.section-related { padding-top: 0; }
.related-title { font-size: var(--text-xl); }

/* ---------- About page ---------- */
.prose-grid { display: grid; gap: var(--space-12); }
.prose { max-width: 40rem; }
.prose h2 { margin-top: var(--space-12); font-size: var(--text-xl); }
.prose h2:first-child { margin-top: 0; }
.prose-media { display: grid; gap: var(--space-6); align-content: start; }
.prose-media img { border-radius: var(--radius); box-shadow: 0 14px 30px -22px rgba(48, 32, 24, 0.55); }
@media (min-width: 56rem) {
  .prose-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--space-16); }
  .prose-media { position: sticky; top: var(--space-8); }
}

/* ---------- Contact placeholder (review only) ---------- */
.review-placeholder { border: 2px dashed #A0522D; background: #FFF4EA; padding: var(--space-4) var(--space-6); border-radius: var(--radius); margin-bottom: var(--space-8); }
.review-label { font-weight: 700; color: #7A3A1A; margin-bottom: var(--space-2); }
.review-placeholder p:last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--cocoa); color: #EFE6D6; padding: var(--space-12) 0 var(--space-8); }
.footer-inner { display: grid; gap: var(--space-6); text-align: center; justify-items: center; }
.footer-wordmark { font-family: var(--font-display); font-size: 1.9rem; margin: 0; color: #FBF6EC; }
.footer-tag { margin: 0; color: #D9CBB2; }
.footer-nav { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2) var(--space-6); }
.footer-nav a { text-decoration: none; color: #EFE6D6; font-size: 0.95rem; }
.footer-nav a:hover { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 4px; }
.site-footer :focus-visible { outline-color: #F7F3EA; }
.footer-note { font-size: 0.85rem; color: #CBBBA0; margin: 0; border-top: 1px solid rgba(179, 154, 96, 0.45); padding-top: var(--space-6); width: 100%; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Collection sections (chocolates page) ---------- */
.coll { margin-top: var(--space-12); }
.coll:first-of-type { margin-top: var(--space-4); }
.coll[hidden] { display: none; }
.coll-head { border-top: 1px solid var(--line); padding-top: var(--space-6); margin-bottom: var(--space-6); max-width: 60ch; }
.coll-head h2 { font-size: var(--text-2xl); margin: 0 0 var(--space-2); }
.coll-head p { margin: 0; color: var(--muted); }
.coll-count { display: inline-block; font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-ink); font-weight: 600; margin-left: 0.35em; white-space: nowrap; }
.coll-figure { margin: 0 0 var(--space-6); border-radius: var(--radius); overflow: hidden; background: #fff; border: 1px solid var(--line); }
.coll-figure img { width: 100%; }
.coll-jump { font-size: var(--text-sm); color: var(--muted); display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin-top: var(--space-4); }
.coll-jump a { color: var(--cocoa); text-decoration-color: var(--gold); text-underline-offset: 3px; }
.detail-media.detail-small { max-width: 304px; }

/* ---------- Logo (CD monogram, redrawn from the original) ---------- */
.wordmark { display: inline-flex; align-items: center; gap: 0.6rem; }
.wordmark-mono { width: 2.75rem; height: 2.75rem; flex: none; color: #A08647; }
.footer-brand { display: grid; justify-items: center; gap: var(--space-2); }
.footer-mono { width: 4.5rem; height: 4.5rem; color: #C8AE6A; margin-bottom: var(--space-2); }
@media (max-width: 22rem) { .wordmark-mono { width: 2.1rem; height: 2.1rem; } }

/* ---------- About page ---------- */
.about-head { text-align: center; }
.about-head .lede { margin-left: auto; margin-right: auto; }
.about-mono { display: block; width: 4rem; height: 4rem; margin: 0 auto var(--space-6); color: var(--gold); }
.story .container { max-width: 64rem; }
.story-row { display: grid; gap: var(--space-6); align-items: center; padding: var(--space-8) 0; }
.story-row + .story-row { border-top: 1px solid var(--line); }
.story-text h2 { font-size: var(--text-2xl); margin-top: 0; }
.story-text p { max-width: 56ch; }
.story-media { margin: 0; }
@media (min-width: 48rem) { .story-media { max-width: 300px; } }
.story-media figcaption { font-size: var(--text-sm); color: var(--muted); margin-top: var(--space-2); }
.story-media figcaption a { color: var(--cocoa); text-decoration-color: var(--gold); text-underline-offset: 3px; }
@media (min-width: 48rem) {
  .story-row { grid-template-columns: minmax(0, 1fr) 300px; gap: var(--space-12); }
  .story-row-rev { grid-template-columns: 300px minmax(0, 1fr); }
  .story-row-rev .story-media { order: -1; }
}
.about-close .container { max-width: 64rem; }
.close-figure { margin: 0 0 var(--space-8); border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: 0 14px 30px -22px rgba(48, 32, 24, 0.55); }
.close-figure img { width: 100%; }
.close-text { text-align: center; }
.close-text h2 { font-size: var(--text-2xl); }
.close-text p { max-width: 52ch; margin-left: auto; margin-right: auto; }
