/* =============================================================================
   Simlotti — main.css
   Design-token base + reset + shared components (header, footer, buttons,
   container, section, product card, grid, feature/trust strips).
   Vanilla CSS, mobile-first. No preprocessor, no framework.
   render.js / product-page.js should emit markup using the class names below.
   ============================================================================= */

/* ---------------------------------------------------------------------------
   1. Design tokens
   --------------------------------------------------------------------------- */
:root {
  /* Surfaces */
  --c-bg:          #F6F0E6; /* page background — warm cream */
  --c-surface:     #FBF7EF; /* cards, raised surfaces */
  --c-sand:        #E7DBC7; /* section bands, muted fills */
  --c-sand-deep:   #D8C6AC; /* borders / hovers on sand */

  /* Ink */
  --c-ink:         #3B2C1E; /* primary text — deep walnut */
  --c-ink-soft:    #6B5844; /* secondary text */
  --c-walnut:      #5C3A21; /* logo brown / heading accent */

  /* Brand green (CTAs) */
  --c-olive:       #45503A;
  --c-olive-deep:  #363F2C;
  --c-leaf:        #8A9A6B;

  /* Utility */
  --c-line:        #DCCFB9;
  --c-white:       #FFFFFF;

  /* Typography */
  --font-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-sans:  "Jost", "Century Gothic", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  /* Spacing / layout */
  --space-section: clamp(3.5rem, 8vw, 7rem);
  --maxw: 1200px;
  --gutter: clamp(1rem, 4vw, 2.5rem);

  /* Radius / shadow */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-soft: 0 10px 30px rgba(59, 44, 30, .08);
  --shadow-lift: 0 16px 40px rgba(59, 44, 30, .14);

  /* Motion */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: .3s;
}

/* ---------------------------------------------------------------------------
   2. Reset / base
   --------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(1rem, .97rem + .15vw, 1.0625rem);
  line-height: 1.7;
  color: var(--c-ink);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, picture, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--c-walnut); }

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: none;
  border: none;
  -webkit-appearance: none;
  appearance: none;
}

ul, ol { list-style: none; padding: 0; }

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

/* Headings */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.15;
  color: var(--c-ink);
  letter-spacing: .005em;
}
h1 { font-size: clamp(2.4rem, 1.6rem + 3.4vw, 4rem); }
h2 { font-size: clamp(1.8rem, 1.35rem + 2vw, 2.75rem); }
h3 { font-size: clamp(1.25rem, 1.05rem + .9vw, 1.6rem); }

p a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------------------------------------------------------------------------
   3. Layout helpers
   --------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

main { flex: 1 0 auto; }

.section { padding-block: var(--space-section); }
.section--sand { background: var(--c-sand); }
.section--surface { background: var(--c-surface); }

.section__head { text-align: center; max-width: 46rem; margin: 0 auto clamp(2rem, 4vw, 3.5rem); }
.section__head p { color: var(--c-ink-soft); margin-top: .5rem; }

/* Uppercase tracked label (feature/trust strips, eyebrows) */
.label {
  font-family: var(--font-sans);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .72rem;
  color: var(--c-ink-soft);
}

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

/* ---------------------------------------------------------------------------
   4. Buttons
   --------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .85rem 1.6rem;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  border-radius: var(--radius-sm);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
              transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  text-decoration: none;
}
.btn--primary {
  background: var(--c-olive);
  color: var(--c-surface);
}
.btn--primary:hover {
  background: var(--c-olive-deep);
  color: var(--c-white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}
.btn--ghost {
  background: transparent;
  color: var(--c-olive);
  border: 1px solid var(--c-olive);
}
.btn--ghost:hover {
  background: var(--c-olive);
  color: var(--c-surface);
}
.btn__ext { width: 1em; height: 1em; opacity: .8; } /* external-link glyph */

/* ---------------------------------------------------------------------------
   5. Header
   --------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--c-bg) 92%, transparent);
  backdrop-filter: saturate(120%) blur(8px);
  border-bottom: 1px solid var(--c-line);
  transition: padding var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.site-header[data-scrolled] { box-shadow: var(--shadow-soft); }

.header__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-block: 1rem;
}
.site-header[data-scrolled] .header__inner { padding-block: .6rem; }

.header__logo img { height: 65px; width: auto; }

.header__nav {
  display: flex;
  gap: clamp(1rem, 3vw, 2.25rem);
  margin-left: auto;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .14em;
}
.header__nav a { position: relative; padding-block: .25rem; color: var(--c-ink); }
.header__nav a::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 0; height: 1.5px; background: var(--c-olive);
  transition: width var(--dur) var(--ease);
}
.header__nav a:hover::after,
.header__nav a[aria-current="page"]::after { width: 100%; }

.header__lang {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .78rem;
  letter-spacing: .1em;
  color: var(--c-ink-soft);
}
.header__lang button {
  padding: .15rem .1rem;
  color: var(--c-ink-soft);
  transition: color var(--dur) var(--ease);
}
.header__lang button[aria-pressed="true"] {
  color: var(--c-ink);
  font-weight: 500;
}
.header__lang button:hover { color: var(--c-walnut); }

.header__menu {
  display: none;
  font-size: 1.4rem;
  line-height: 1;
  padding: .25rem .4rem;
  color: var(--c-ink);
}

/* Mobile nav */
@media (max-width: 820px) {
  .header__nav {
    position: absolute;
    inset: 100% 0 auto 0;
    flex-direction: column;
    gap: 0;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-line);
    padding: .5rem var(--gutter) 1rem;
    margin-left: 0;
    display: none;
  }
  .header__nav a { padding-block: .75rem; border-bottom: 1px solid var(--c-line); }
  .site-header[data-menu-open] .header__nav { display: flex; }
  .header__lang { margin-left: auto; }
  .header__menu { display: block; }
}

/* ---------------------------------------------------------------------------
   6. Footer
   --------------------------------------------------------------------------- */
.site-footer {
  flex-shrink: 0;
  background: var(--c-sand);
  border-top: 1px solid var(--c-line);
  padding-block: clamp(2.5rem, 6vw, 4rem);
  text-align: center;
}
.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}
.footer__logo { width: 120px; height: auto; }
.footer__nav {
  display: flex;
  gap: 1.75rem;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .14em;
}
.footer__contact { color: var(--c-ink-soft); }
.footer__contact a { color: var(--c-walnut); font-weight: 500; }
.footer__meta { font-size: .78rem; color: var(--c-ink-soft); letter-spacing: .04em; }

/* ---------------------------------------------------------------------------
   7. Hero (home)
   --------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: clamp(420px, 70vh, 680px);
  display: grid;
  align-items: center;
  overflow: hidden;
  background: var(--c-sand);
}
.hero__media { position: absolute; inset: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero__inner { position: relative; z-index: 1; max-width: 34rem; }
.hero__inner h1 { color: var(--c-ink); }
.hero__inner p { margin: 1rem 0 1.75rem; color: var(--c-ink-soft); font-size: 1.1rem; }
/* Centered hero: text sits in the empty upper area so it never covers the products */
.hero--center { align-items: start; text-align: center; }
.hero--center .container { padding-top: clamp(2rem, 7vh, 4.5rem); }
.hero--center .hero__inner { max-width: 40rem; margin-inline: auto; }
.hero--center .hero__media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(246,240,230,.85) 0%, rgba(246,240,230,.4) 32%, rgba(246,240,230,0) 58%);
}

/* ---------------------------------------------------------------------------
   8. Feature strip (5 value icons)
   --------------------------------------------------------------------------- */
.feature-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
  text-align: center;
}
.feature-strip__item { display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.feature-strip__item svg { width: 30px; height: 30px; color: var(--c-olive); stroke-width: 1.5; }
@media (max-width: 720px) {
  .feature-strip { grid-template-columns: repeat(2, 1fr); gap: 1.75rem 1rem; }
}

/* ---------------------------------------------------------------------------
   9. Product grid + card  (emitted by render.js)
   --------------------------------------------------------------------------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1.25rem, 2.5vw, 2rem);
}
@media (max-width: 1000px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .product-grid { grid-template-columns: 1fr; } }

.product-card {
  display: flex;
  flex-direction: column;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }

.product-card__media {
  aspect-ratio: 1 / 1;
  background: var(--c-sand);
  overflow: hidden;
}
.product-card__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s var(--ease);
}
.product-card:hover .product-card__media img { transform: scale(1.04); }

.product-card__body {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding: 1.1rem 1.2rem 1.4rem;
  flex: 1;
}
.product-card__name { font-size: 1.15rem; }
.product-card__tagline { color: var(--c-ink-soft); font-size: .92rem; }
.product-card__price { color: var(--c-walnut); font-size: .82rem; letter-spacing: .04em; margin-top: .1rem; }
.product-card__cta { margin-top: auto; padding-top: .9rem; }

/* ---------------------------------------------------------------------------
   10. Trust strip
   --------------------------------------------------------------------------- */
.trust-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.trust-strip__item { display: flex; align-items: flex-start; gap: .75rem; }
.trust-strip__item svg { width: 26px; height: 26px; color: var(--c-olive); flex: none; stroke-width: 1.5; }
.trust-strip__item strong { display: block; font-weight: 500; font-size: .9rem; }
.trust-strip__item span { color: var(--c-ink-soft); font-size: .82rem; }
@media (max-width: 780px) { .trust-strip { grid-template-columns: repeat(2, 1fr); } }

/* ---------------------------------------------------------------------------
   11. Full-width lifestyle band (story teaser)
   --------------------------------------------------------------------------- */
.band {
  position: relative;
  min-height: clamp(340px, 48vw, 460px);
  display: grid;
  align-items: center;
  overflow: hidden;
}
.band__media { position: absolute; inset: 0; }
.band__media img { width: 100%; height: 100%; object-fit: cover; }
.band__media::after { content: ""; position: absolute; inset: 0; background: rgba(45, 36, 24, .38); }
.band__inner { position: relative; z-index: 1; color: var(--c-white); max-width: 34rem; }
.band__inner h2, .band__inner p { color: var(--c-white); }
.band__inner p { margin: .75rem 0 1.5rem; }

/* ---------------------------------------------------------------------------
   12. Product detail page (product-page.js)
   --------------------------------------------------------------------------- */
.pdp { padding-block: clamp(1.5rem, 4vw, 3rem) var(--space-section); }
.pdp__breadcrumb { font-size: .78rem; letter-spacing: .06em; color: var(--c-ink-soft); margin-bottom: 1.5rem; }
.pdp__breadcrumb a:hover { color: var(--c-walnut); }

.pdp__top {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
@media (max-width: 900px) { .pdp__top { grid-template-columns: 1fr; } }

.pdp__gallery-main {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--c-surface);
  padding: clamp(.5rem, 2vw, 1rem);
}
/* contain so wide/tall product shots are shown in full, not cropped by the frame */
.pdp__gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.pdp__thumbs { display: flex; gap: .6rem; margin-top: .75rem; flex-wrap: wrap; }
.pdp__thumb {
  width: 68px; height: 68px; border-radius: var(--radius-sm);
  overflow: hidden; border: 1px solid var(--c-line); opacity: .7;
  transition: opacity var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.pdp__thumb[aria-current="true"] { opacity: 1; border-color: var(--c-olive); }
.pdp__thumb:hover { opacity: 1; }

.pdp__info h1 { margin-bottom: .5rem; }
.pdp__tagline { color: var(--c-ink-soft); font-size: 1.1rem; }
.pdp__price { color: var(--c-walnut); letter-spacing: .04em; margin: 1rem 0; }
.pdp__buy-trust { font-size: .8rem; color: var(--c-ink-soft); margin-top: .75rem; }

.pdp__section { margin-top: var(--space-section); }
.pdp__desc { max-width: 46rem; color: var(--c-ink-soft); }

.pdp__features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}
.pdp__feature {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}
.pdp__feature svg { width: 28px; height: 28px; color: var(--c-olive); stroke-width: 1.5; margin-bottom: .6rem; }
.pdp__feature strong { display: block; font-weight: 500; margin-bottom: .25rem; }
.pdp__feature span { color: var(--c-ink-soft); font-size: .9rem; }

.pdp__specs { width: 100%; border-collapse: collapse; max-width: 46rem; }
.pdp__specs th, .pdp__specs td { text-align: left; padding: .8rem 0; border-bottom: 1px solid var(--c-line); vertical-align: top; }
.pdp__specs th { font-weight: 500; width: 38%; color: var(--c-ink); }
.pdp__specs td { color: var(--c-ink-soft); }

/* ---------------------------------------------------------------------------
   12c. Guide section (care / quick guide — product-page.js)
   --------------------------------------------------------------------------- */
.pdp__guide-media {
  max-width: 46rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--c-sand);
  box-shadow: var(--shadow-soft);
}
.pdp__guide-media img { width: 100%; height: auto; }

.pdp__guide-transcript {
  max-width: 46rem;
  margin-top: 1.25rem;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-md);
  padding: .25rem 1.25rem;
}
.pdp__guide-transcript summary {
  cursor: pointer;
  padding-block: .9rem;
  font-weight: 500;
  color: var(--c-ink);
  list-style: none;
}
.pdp__guide-transcript summary::-webkit-details-marker { display: none; }
.pdp__guide-transcript summary::before {
  content: "+";
  display: inline-block;
  width: 1.1em;
  color: var(--c-olive);
  font-weight: 600;
}
.pdp__guide-transcript[open] summary::before { content: "–"; }
.pdp__guide-transcript ul {
  padding-bottom: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.pdp__guide-transcript li {
  color: var(--c-ink-soft);
  font-size: .92rem;
  padding-left: 1.1rem;
  border-left: 2px solid var(--c-line);
}

/* ---------------------------------------------------------------------------
   12d. Recipe carousel (fermentation sets — product-page.js)
   --------------------------------------------------------------------------- */
.recipe-carousel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(.75rem, 3vw, 2rem);
}
.recipe-carousel__arrow {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  color: var(--c-ink);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}
.recipe-carousel__arrow svg { width: 18px; height: 18px; }
.recipe-carousel__arrow:hover {
  background: var(--c-olive);
  border-color: var(--c-olive);
  color: var(--c-surface);
}

.recipe-carousel__card {
  flex: 0 1 auto;
  width: min(280px, 62vw);
  text-align: center;
}
.recipe-carousel__img-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.recipe-carousel__img-btn img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  background: var(--c-sand);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.recipe-carousel__img-btn:hover img,
.recipe-carousel__img-btn:focus-visible img {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}
.recipe-carousel__card figcaption {
  margin-top: .85rem;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: .92rem;
  color: var(--c-ink);
}
.recipe-carousel__counter {
  margin-top: 1rem;
  text-align: center;
  font-size: .78rem;
  letter-spacing: .06em;
  color: var(--c-ink-soft);
}

.recipe-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 3rem);
  background: rgba(20, 15, 10, .86);
  cursor: zoom-out;
}
/* Prioritize width (legibility of the dense recipe text) over fitting the
   viewport height — the lightbox itself scrolls when the image runs tall. */
.recipe-lightbox img {
  width: min(94vw, 1100px);
  max-width: 100%;
  height: auto;
  margin: auto 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lift);
}

/* ---------------------------------------------------------------------------
   12b. Split block (image + text) — home "thoughtful tools", Our Story
   --------------------------------------------------------------------------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}
.split__media img {
  border-radius: var(--radius-lg);
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.split__body p { color: var(--c-ink-soft); margin-top: 1rem; }
.split__body .btn { margin-top: 1.5rem; }
.split--reverse .split__media { order: 2; }
@media (max-width: 800px) {
  .split { grid-template-columns: 1fr; }
  .split--reverse .split__media { order: 0; }
}

/* ---------------------------------------------------------------------------
   13. Reduced motion
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .product-card:hover { transform: none; }
  .product-card:hover .product-card__media img { transform: none; }
}
