/* ─────────────────────────────────────────────────────────────────────────────
   Crunchdom — layout & formatting system
   Loaded last. Unifies the spacing scale, type scale, card grids and buttons that
   style.css / kitchen.css / campaign.css each defined slightly differently.
   Palette, fonts, imagery and copy are untouched.
   ───────────────────────────────────────────────────────────────────────────── */

:root {
  /* one spacing scale, used everywhere */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 44px;
  --s8: 60px;

  /* vertical rhythm between page bands */
  --band: clamp(40px, 4.6vw, 68px);
  --band-tight: clamp(28px, 3.2vw, 44px);

  /* one reading measure for body copy */
  --measure: 66ch;

  /* one radius + height system for controls */
  --r-card: 12px;
  --r-btn: 8px;
  --btn-h: 48px;
  --btn-h-sm: 40px;

  --header-h: 72px;
}

html {
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  font-size: 16px;
  line-height: 1.6;
}

.wrap {
  width: min(1240px, 90%);
  margin-inline: auto;
}

/* ── Type scale ────────────────────────────────────────────────────────────── */

h1,
h2,
h3,
h4 {
  font-family: var(--display);
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(40px, 5vw, 68px);
  font-weight: 730;
  line-height: 1.06;
  letter-spacing: -0.042em;
}

h2 {
  font-size: clamp(28px, 3.2vw, 42px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.045em;
}

h3 {
  font-size: clamp(21px, 1.7vw, 26px);
  font-weight: 680;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

/* page titles on every inner page share one size */
.inner h1,
.spread h1,
.mast-words h1 {
  font-size: clamp(40px, 5vw, 68px);
  line-height: 1.06;
  letter-spacing: -0.042em;
  max-width: 20ch;
  margin: 0;
}

/* band headings */
.section-head h2,
.unpack-text h2,
.kitchen-strip h2 {
  font-size: clamp(30px, 3.5vw, 46px);
  letter-spacing: -0.045em;
  line-height: 1.08;
}

/* article + card headings stay a step below the band headings */
.reading h2,
.contact-note h2,
.contact-list h2,
.table-wrap h2,
.service-sheet h2 {
  font-size: clamp(26px, 2.6vw, 34px);
  line-height: 1.14;
  letter-spacing: -0.03em;
}

/* one eyebrow, with or without its hand-written rule */
.eyebrow,
.gd-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 var(--s3);
  font-family: "DM", Arial, sans-serif;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.15em;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--red);
}

.eyebrow::before,
.gd-kicker::before {
  content: "";
  display: block;
  flex: none;
  width: 26px;
  height: 2px;
  background: currentColor;
}

.eyebrow span {
  display: none;
}

p {
  line-height: 1.6;
}

.lead,
.gd-lead {
  font-size: clamp(16.5px, 1.35vw, 19px);
  line-height: 1.6;
  max-width: var(--measure);
  margin: 14px 0 0;
  color: var(--muted);
}

/* ── Header ────────────────────────────────────────────────────────────────── */

header {
  position: sticky;
  top: 0;
  z-index: 40;
  padding-top: env(safe-area-inset-top);
  background: #fff8edf5;
  border-bottom: 1px solid var(--rule);
}

.navrow {
  min-height: var(--header-h);
  gap: var(--s5);
}

nav {
  gap: clamp(16px, 2.2vw, 34px);
}

nav a {
  font-size: 15px;
  font-weight: 620;
  text-decoration: none;
}

nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 7px;
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
}

/* ── Buttons & controls ────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: max-content;
  min-height: var(--btn-h);
  padding: 13px 24px;
  border: 1px solid transparent;
  border-radius: var(--r-btn);
  font-family: inherit;
  font-size: 15px;
  font-weight: 730;
  line-height: 1.15;
  text-decoration: none;
  transition: background 0.18s, color 0.18s, transform 0.18s, border-color 0.18s;
}

.btn.red {
  background: var(--gold);
  color: #241c16;
}

.btn.red:hover {
  background: #c08a20;
}

.btn.gold {
  background: var(--gold);
  color: #241c16;
}

.btn.full {
  width: 100%;
}

.btn:disabled,
.btn[aria-disabled="true"],
.btn.cd-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

.bag {
  min-height: var(--btn-h-sm);
  padding: 9px 15px;
  font-size: 14px;
  gap: 8px;
}

.choose {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--btn-h-sm);
  padding: 0 16px;
  border-radius: var(--r-btn);
  background: #f6e6c4;
  color: #1e4634;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.18s, transform 0.18s;
}

.choose:hover {
  background: #e8b75b;
}

/* filters + tab pills are one family */
.menu-filters,
.box-types {
  gap: var(--s2);
  margin: 0 0 var(--s5);
}

.menu-filters button,
.box-types button {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid #c8aa8d;
  font-size: 14px;
  font-weight: 680;
  line-height: 1;
}

.service-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 0;
  margin-bottom: var(--band-tight);
}

.service-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: var(--btn-h-sm);
  padding: 0 16px;
  border-radius: var(--r-btn);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.iconbutton {
  width: var(--btn-h-sm);
  height: var(--btn-h-sm);
  border-radius: 50%;
}

.dialog-close {
  width: 38px;
  height: 38px;
}

/* form controls share one shape */
.cd-input,
#box-content select,
.service-sheet select,
.field-unit input {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  margin: 6px 0 16px;
  border: 1px solid var(--rule);
  border-radius: var(--r-btn);
  background: #fffdf8;
  font: inherit;
  color: inherit;
}

#box-content textarea.cd-input {
  min-height: 78px;
  resize: vertical;
}

#box-content label {
  font-size: 14.5px;
  font-weight: 680;
}

/* ── Cards & grids ─────────────────────────────────────────────────────────── */

.box-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: clamp(14px, 1.6vw, 20px);
}

.box-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-card);
}

.box-image {
  display: block;
  width: 100%;
  overflow: hidden;
}

.box-image img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: 50% 52%;
}

.box-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: clamp(16px, 1.5vw, 20px);
}

.box-info h3 {
  font-size: clamp(21px, 1.65vw, 26px);
  letter-spacing: -0.03em;
  line-height: 1.14;
}

.box-info p {
  font-size: 15px;
  line-height: 1.55;
  margin: 9px 0 18px;
}

.box-choose {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 13px;
}

.service-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: clamp(12px, 1.5vw, 18px);
}

.service-tile {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: clamp(18px, 1.8vw, 24px);
  border-radius: var(--r-card);
  text-decoration: none;
}

.service-tile h3 {
  margin: 14px 0 6px;
}

.service-tile p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
}

/* ── Images: never crop the food ───────────────────────────────────────────── */

.story-grid > img,
.story-photo img {
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: 50% 50%;
  border-radius: var(--r-card);
}

.mast-photo {
  height: 100%;
  max-height: none;
  min-height: 220px;
  object-fit: cover;
  object-position: 50% 55%;
}

.feature-image img,
.carton > img {
  object-position: 50% 55%;
}

.cartline img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
}

/* ── Page bands ────────────────────────────────────────────────────────────── */

.section {
  padding-block: var(--band);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s4);
  margin: 0 0 var(--s5);
}

.section-head h2 {
  margin: 0;
}

.story-grid {
  padding-block: var(--band);
}

.unpack-grid {
  padding-block: var(--band);
}

.inner {
  padding-bottom: var(--band);
}

.inner > .storylink {
  display: inline-block;
  margin-top: var(--s5);
}

.crumb,
.gd-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
  padding: clamp(16px, 2vw, 22px) 0 clamp(18px, 2.2vw, 26px);
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
}

.crumb a,
.gd-crumb a {
  font-weight: 620;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}

.crumb a:hover,
.gd-crumb a:hover {
  color: var(--red);
  border-bottom-color: currentColor;
}

.crumb span,
.gd-crumb span {
  color: #b6a48c;
}

/* feature spread (about / shipping) */
.spread {
  margin: 0 0 var(--band-tight);
}

.spread > div {
  padding: clamp(24px, 3vw, 48px);
}

.spread .lead {
  margin-bottom: 0;
}

.feature-image {
  min-height: 240px;
}

/* reading column */
.reading {
  max-width: var(--measure);
  margin: var(--band-tight) auto 0;
}

.reading section {
  padding: 0;
  margin: 0 0 clamp(20px, 2.2vw, 28px);
}

.reading h2 {
  margin: 0 0 10px;
}

.reading p,
.reading ul,
.reading ol {
  margin: 0 0 14px;
  line-height: 1.65;
}

.reading > :last-child {
  margin-bottom: 0;
}

.policy h2 {
  margin-top: clamp(26px, 3vw, 36px);
}

.policy h2:first-of-type {
  margin-top: 0;
}

.policy .btn {
  margin-top: var(--s5);
}

.table-wrap {
  max-width: var(--measure);
  margin: var(--band-tight) 0 0;
  overflow-x: auto;
}

.table-wrap h2 {
  margin-bottom: var(--s4);
}

td,
th {
  padding: 11px 15px;
  line-height: 1.45;
}

/* service sheets (shipping) */
.service-sheet {
  padding-block: clamp(26px, 3vw, 38px);
  align-items: start;
}

.service-sheet h2 {
  margin-bottom: 10px;
}

.service-sheet p {
  margin: 0 0 12px;
  max-width: 60ch;
  line-height: 1.65;
}

.service-sheet aside,
.contact-note,
.contents {
  padding: clamp(20px, 2.2vw, 26px);
  border-radius: var(--r-card);
}

.service-sheet aside h3,
.contact-note h2 {
  margin: 0 0 8px;
}

.service-sheet aside p {
  margin: 0 0 10px;
}

.service-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s5);
  margin-top: var(--band-tight);
}

/* contact */
.contact-layout {
  gap: clamp(20px, 3vw, 44px);
  margin: var(--band-tight) 0;
  align-items: stretch;
}

.contact-note {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.contact-note .phone {
  display: inline-block;
  margin: 4px 0 8px;
}

.contact-note .btn {
  margin-top: var(--s4);
}

.contact-list h2 {
  margin: 0 0 var(--s3);
}

.contact-list a {
  margin-top: 10px;
  line-height: 1.5;
}

.minor {
  margin: var(--band-tight) 0 var(--s3);
}

.guide-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  padding: 15px 2px;
  font-weight: 620;
  line-height: 1.4;
}

.guide-row::after {
  content: "→";
  flex: none;
  color: var(--red);
}

.guide-row:hover {
  color: var(--red);
}

.small-link:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  text-decoration: none;
}

/* ── Box drawer & picker ───────────────────────────────────────────────────── */

#cart .carttop {
  padding: 16px 22px;
}

#cart .carttop h2,
.dialog-body h2 {
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.1;
}

#box-content {
  padding: 20px 22px calc(28px + env(safe-area-inset-bottom));
}

.cartline {
  padding: 14px 0;
  gap: 12px;
}

.cartline .line-detail b {
  font-size: 15px;
  line-height: 1.3;
}

.cartline small {
  font-size: 13px;
  line-height: 1.4;
}

.qty {
  gap: 6px;
}

.qty button {
  width: 34px;
  height: 34px;
  flex: none;
}

#box-content .line-remove {
  width: 34px;
  height: 34px;
}

.subtotal {
  font-size: 18px;
}

.cd-breakdown {
  margin-top: 18px;
  padding-top: 14px;
}

.cd-row,
.cd-total {
  padding: 5px 0;
  font-size: 15px;
  line-height: 1.45;
}

.cd-total {
  margin-top: 10px;
  padding-top: 12px;
  font-size: 19px;
}

#box-content .btn.full {
  margin-top: 6px;
}

.cd-msg {
  margin: 10px 0 0;
}

.empty {
  padding: 40px 8px;
}

.empty h3 {
  margin: 10px 0 4px;
}

#picker {
  width: min(470px, 94vw);
  border-radius: var(--r-card);
}

#pick-image {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  object-position: 50% 55%;
}

.dialog-body {
  padding: 22px 24px 26px;
}

.dialog-body h2 {
  margin: 6px 0 10px;
}

#sizes {
  gap: 8px;
  margin-top: 10px;
}

#sizes button {
  min-height: 58px;
  padding: 9px 4px;
  border-radius: var(--r-btn);
  line-height: 1.25;
  color: #281e18;
}

#sizes button[aria-pressed="true"] {
  background: #fffdf8;
  color: #281e18;
  border-color: #281e18;
  box-shadow: inset 0 0 0 1px #281e18;
}

#sizes small {
  margin-top: 2px;
  font-size: 13px;
}

.dialog-body .btn.full {
  margin-top: var(--s4);
}

/* ── Footer ────────────────────────────────────────────────────────────────── */

footer {
  padding-block: clamp(38px, 4vw, 54px);
  padding-bottom: calc(clamp(38px, 4vw, 54px) + env(safe-area-inset-bottom));
}

.footer-grid {
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: clamp(24px, 4vw, 48px);
}

footer p {
  margin: 14px 0 0;
  line-height: 1.6;
  max-width: 34ch;
}

footer b {
  margin: 0 0 10px;
  font-size: 12.5px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d9c6ae;
}

.footer-grid > div > a:not(.brand),
footer small {
  margin-top: 8px;
  line-height: 1.5;
}

.footer-staff {
  margin-top: var(--s5);
}

/* ── Responsive ────────────────────────────────────────────────────────────── */

@media (max-width: 1000px) {
  .wrap {
    width: 92%;
  }

  .box-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .box-image img {
    aspect-ratio: 3 / 2;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-grid > div:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .service-sheet {
    grid-template-columns: 1fr;
    gap: var(--s5);
  }

  .contact-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  :root {
    --header-h: 64px;
    --band: 40px;
    --band-tight: 30px;
  }

  .navrow {
    min-height: var(--header-h);
  }

  nav {
    padding: 10px 4% 18px;
    box-shadow: 0 18px 30px -24px rgba(40, 30, 24, 0.6);
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
  }

  nav a {
    padding: 9px 0;
    font-size: 16px;
    border-bottom: 1px solid #eee3d2;
  }

  nav a:last-child {
    border-bottom: 0;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .section-head h2,
  .unpack-text h2,
  .kitchen-strip h2 {
    font-size: clamp(27px, 6.4vw, 34px);
  }

  .inner h1,
  .spread h1,
  .mast-words h1 {
    font-size: clamp(32px, 7.4vw, 44px);
  }

  .reading h2,
  .contact-note h2,
  .contact-list h2,
  .table-wrap h2,
  .service-sheet h2 {
    font-size: clamp(23px, 5.4vw, 28px);
  }

  /* mast + spread stack: picture first, words under it */
  .editorial-mast,
  .spread {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .editorial-mast .mast-photo,
  .spread .feature-image {
    order: -1;
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 3 / 2;
  }

  .editorial-mast .mast-photo {
    aspect-ratio: 16 / 9;
  }

  .mast-words,
  .spread > div {
    align-self: stretch;
    padding: 22px;
  }

  .service-tiles {
    grid-template-columns: 1fr;
  }

  .story-grid {
    gap: var(--s5);
  }

  .story-grid > img {
    aspect-ratio: 3 / 2;
  }

  .reading,
  .table-wrap {
    max-width: none;
  }

  #cart .carttop,
  #box-content {
    padding-inline: 18px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--s5);
  }

  .footer-grid > div:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .wrap {
    width: 90%;
  }

  .box-grid {
    grid-template-columns: 1fr;
  }

  /* the phone card reads top-to-bottom: full-width photo, then the copy */
  .box-card {
    display: flex;
    flex-direction: column;
  }

  .box-image img {
    aspect-ratio: 3 / 2;
    height: auto;
    min-height: 0;
  }

  .box-info {
    padding: 16px;
  }

  .box-choose {
    flex-wrap: nowrap;
  }

  .mast-words,
  .spread > div {
    padding: 20px;
  }

  .service-sheet aside,
  .contact-note {
    padding: 18px;
  }

  td,
  th {
    padding: 9px 11px;
    font-size: 14px;
  }

  /* the ribbon is a 2×2 grid on phones — no squeezed columns */
  .ribbon-row {
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
    padding-block: 12px;
  }

  .ribbon-row span {
    max-width: none;
    font-size: 13px;
    line-height: 1.3;
  }

  #sizes {
    grid-template-columns: 1fr 1fr;
  }

  #cart .carttop h2,
  .dialog-body h2 {
    font-size: 26px;
  }

  .cartline {
    flex-wrap: wrap;
    gap: 10px;
  }

  .cartline img {
    width: 52px;
    height: 52px;
  }

  .qty {
    gap: 4px;
  }

  .qty button,
  #box-content .line-remove {
    width: 32px;
    height: 32px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--s5);
  }
}

/* ── Top-of-page hero cards ───────────────────────────────────────────────────
   Every page opens with the same card: one wine surface, cream words, gold
   kicker. The guide pages used to carry their own lighter wine, and the plain
   headers on Contact and the refund policy had no card at all. */
.editorial-mast,
.spread,
.hero-card {
  background: #173a2b;
  color: #faf6ee;
  border: 0;
  border-radius: var(--r-card);
  overflow: hidden;
  margin: 0 0 var(--band-tight);
}

.hero-card {
  padding: clamp(24px, 3vw, 48px);
}

.editorial-mast h1,
.spread h1,
.hero-card h1 {
  color: inherit;
}

.spread .eyebrow,
.hero-card .eyebrow {
  color: #e8b75b;
}

.spread .lead,
.hero-card .lead {
  color: #e6efe8;
}

.hero-card .lead {
  max-width: 50ch;
}
