/* =========================================================================
   TRIFOLA — STYLES
   Token system: colors, fonts and spacing are set once as CSS variables
   below. Change a brand color or font there and it updates everywhere.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,500&family=DM+Sans:wght@400;500;600;700&family=Noto+Serif+Thai:wght@500;600&family=Noto+Sans+Thai:wght@400;500&display=swap');

:root {
  /* Color */
  --purple: #542568;
  --purple-dark: #3e174e;
  --purple-soft: #76508a;
  --gold: #b7a321;
  --gold-deep: #887b0f;
  --cream: #faf8f3;
  --paper: #fffdf9;
  --ink: #29242b;
  --muted: #756d76;
  --line: #e8e1e7;
  --shadow: 0 24px 70px rgba(58, 25, 70, 0.10);

  /* Type */
  --font-display-en: "Cormorant Garamond", Georgia, serif;
  --font-body-en: "DM Sans", Arial, sans-serif;
  --font-display-th: "Noto Serif Thai", Georgia, serif;
  --font-body-th: "Noto Sans Thai", Arial, sans-serif;

  --font-display: var(--font-display-en);
  --font-body: var(--font-body-en);
}

html[data-lang="th"] {
  --font-display: var(--font-display-th);
  --font-body: var(--font-body-th);
}

/* -----------------------------------------------------------------------
   Base
   ----------------------------------------------------------------------- */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.65;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--purple-dark);
}

.eyebrow,
.section-kicker {
  font-size: 11px;
  letter-spacing: 0.22em;
  font-weight: 700;
  color: var(--purple);
}

.gold-dot {
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
  display: inline-block;
  flex: none;
}

/* -----------------------------------------------------------------------
   Header
   ----------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 5vw;
  background: rgba(250, 248, 243, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(84, 37, 104, 0.08);
}

.brand img {
  display: block;
  width: 130px;
  height: auto;
}

nav {
  display: flex;
  gap: 30px;
  align-items: center;
  margin-left: auto;
  margin-right: 24px;
}

nav a {
  font-size: 13px;
  font-weight: 600;
  color: #5c5560;
}
nav a:hover { color: var(--purple); }

.lang-switch {
  border: 1px solid rgba(84, 37, 104, 0.3);
  background: transparent;
  color: var(--purple);
  width: 38px;
  height: 32px;
  border-radius: 999px;
  font-weight: 700;
  font-family: var(--font-body-en);
  cursor: pointer;
}
.lang-switch:hover { background: rgba(84, 37, 104, 0.06); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--purple-dark);
  position: relative;
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle span::before { top: -7px; }
.nav-toggle span::after { top: 7px; }

/* -----------------------------------------------------------------------
   Hero
   ----------------------------------------------------------------------- */

.hero {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 6vw;
  align-items: center;
  padding: 7vh 8vw 10vh;
  overflow: hidden;
}

.hero h1 {
  font-size: clamp(48px, 7vw, 100px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin: 20px 0 28px;
}
.hero h1 em {
  font-style: italic;
  font-weight: 500;
  color: var(--purple-soft);
}

.hero-text {
  max-width: 580px;
  font-size: 18px;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 34px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 21px;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 700;
}
.button-primary {
  background: var(--purple);
  color: white;
}
.button-primary:hover { background: var(--purple-dark); }
.button-quiet {
  border: 1px solid #d8cfd9;
  color: var(--purple);
  background: rgba(255, 255, 255, 0.35);
}
.button-quiet:hover { border-color: var(--purple); }

/* Hero product card + orbit rings */

.hero-product {
  position: relative;
  display: flex;
  justify-content: center;
}

.truffle-orbit {
  position: absolute;
  border: 1px solid rgba(183, 163, 33, 0.35);
  border-radius: 50%;
  z-index: -1;
}
.orbit-one { width: 510px; height: 510px; right: -40px; top: -15px; }
.orbit-two {
  width: 350px; height: 350px; left: 15px; bottom: 10px;
  border-color: rgba(84, 37, 104, 0.16);
}

.hero-card {
  position: relative;
  width: min(430px, 100%);
  background: var(--paper);
  padding: 15px;
  box-shadow: var(--shadow);
  transform: rotate(1.5deg);
}

.card-label {
  display: block;
  font-size: 9px;
  letter-spacing: 0.2em;
  font-weight: 700;
  color: var(--gold);
  padding: 12px 10px 10px;
}

/* Product photo boxes size themselves to each photo's real shape — set
   dynamically by main.js as "aspect-ratio" once the image loads (clamped
   to a sane range so one extreme photo can't break the grid). This means
   a tall bottle gets a tall box and a square jar gets a square box,
   automatically, for any photo you add later — nothing to configure. */
.hero-image,
.photo-placeholder,
.product-photo {
  background: linear-gradient(145deg, #eee8ef, #f9f6f1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--purple);
  letter-spacing: 0.13em;
  font-weight: 700;
  text-align: center;
  overflow: hidden;
  aspect-ratio: 4 / 3.2; /* fallback shown briefly before the photo loads */
}
.hero-image img,
.photo-placeholder img,
.product-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-image small,
.photo-placeholder small,
.product-photo small {
  font-family: var(--font-body-en);
  font-size: 8px;
  letter-spacing: 0.18em;
  color: #9b919c;
  margin-top: 8px;
}
.hero-image {
  font-family: var(--font-display);
  font-size: 30px;
  transition: opacity 0.4s ease;
}

.hero-card-footer {
  padding: 18px 10px 12px;
  display: flex;
  flex-direction: column;
}
.hero-card-footer strong {
  font-family: var(--font-display);
  font-size: 27px;
  color: var(--purple-dark);
}
.hero-card-footer span {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

/* -----------------------------------------------------------------------
   Intro strip
   ----------------------------------------------------------------------- */

.intro-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.intro-strip > div {
  padding: 25px 5vw;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #625a64;
}

/* -----------------------------------------------------------------------
   Section shell
   ----------------------------------------------------------------------- */

.section { padding: 120px 8vw; }
.about { background: var(--paper); }

h2 {
  font-size: clamp(40px, 5vw, 68px);
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 40px;
  margin-bottom: 48px;
}
.section-heading > p {
  max-width: 380px;
  color: var(--muted);
  font-size: 13px;
}

/* About */

.two-col {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 9vw;
  margin-top: 20px;
}
.lead {
  font-size: 16px;
  color: var(--muted);
  max-width: 720px;
}
.lead p { margin: 0 0 22px; }
.lead p:last-child { margin-bottom: 0; }

/* -----------------------------------------------------------------------
   Fresh truffle — bento grid, first item featured
   ----------------------------------------------------------------------- */

.fresh-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
  align-items: start;
}
.fresh-card {
  grid-column: span 4;
  background: var(--paper);
  border: 1px solid var(--line);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.fresh-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}
.fresh-card.featured { grid-column: span 6; }

.fresh-info { padding: 22px 22px 26px; }
.season {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--gold-deep);
  font-weight: 700;
}
.fresh-info h3 {
  font-size: 32px;
  line-height: 1;
  margin: 8px 0 3px;
}
.fresh-info p {
  font-size: 12px;
  color: var(--muted);
  margin: 5px 0 0;
}
.fresh-info p em { font-style: italic; }
.fresh-info p.fresh-desc {
  font-size: 13px;
  margin-top: 15px;
}

/* -----------------------------------------------------------------------
   Products — dry / frozen / accessories
   ----------------------------------------------------------------------- */

.products { background: var(--cream); }

.product-subgroup + .product-subgroup { margin-top: 56px; }

.subgroup-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 22px;
}
.subgroup-heading .section-kicker { font-size: 10px; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  align-items: start;
}
.product-card {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 14px;
  position: relative;
}
.product-photo { font-size: 12px; }
.product-card h3 {
  font-size: 25px;
  line-height: 1.05;
  padding: 17px 8px 0;
}
.product-card p {
  font-size: 12px;
  color: var(--muted);
  padding: 0 8px;
  margin: 6px 0 0;
}
.badge {
  display: inline-block;
  margin: 4px 8px 12px;
  border: 1px solid rgba(183, 163, 33, 0.5);
  color: var(--gold-deep);
  padding: 4px 8px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.custom-note {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: 48px;
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.custom-note strong {
  font-family: var(--font-display);
  color: var(--purple-dark);
  font-size: 24px;
}
.custom-note p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* -----------------------------------------------------------------------
   Contact
   ----------------------------------------------------------------------- */

.contact { padding-top: 80px; }

.contact-panel {
  background: var(--purple-dark);
  color: white;
  padding: 70px 7vw;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 8vw;
  position: relative;
  overflow: hidden;
}
.contact-panel::after {
  content: "";
  position: absolute;
  width: 430px;
  height: 430px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 50%;
  right: -180px;
  top: -180px;
}
.contact-panel h2 { color: white; margin: 15px 0 20px; }
.contact-panel .section-kicker { color: #d2c34c; }
.contact-panel > div:first-child > p {
  color: #d8d0db;
  max-width: 540px;
}
.contact-email,
.whatsapp {
  display: block;
  font-size: 17px;
  font-weight: 600;
  margin-top: 20px;
  color: #fff;
}
.whatsapp { color: #d9cb4a; }

.addresses { display: grid; gap: 28px; }
.address {
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  padding-left: 22px;
}
.address-label {
  font-size: 9px;
  letter-spacing: 0.16em;
  color: #d2c34c;
  font-weight: 700;
}
.address p { color: #ddd5df; font-size: 13px; }

/* -----------------------------------------------------------------------
   Footer
   ----------------------------------------------------------------------- */

footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 28px 5vw;
  color: #817985;
  font-size: 11px;
  background: var(--paper);
}
.footer-mark { width: 28px; height: 28px; }

/* -----------------------------------------------------------------------
   Responsive
   ----------------------------------------------------------------------- */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 70px; }
  .hero-product { margin-top: 30px; }
  .two-col,
  .contact-panel { grid-template-columns: 1fr; }
  .fresh-card,
  .fresh-card.featured { grid-column: span 6; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .nav-toggle { display: block; order: 3; }

  nav {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    padding: 18px 22px 26px;
    gap: 18px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
  }
  nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .lang-switch { order: -1; margin-left: 0; }
}

@media (max-width: 600px) {
  .site-header { padding: 12px 18px; }
  .brand img { width: 105px; }
  .hero { padding: 55px 22px 70px; }
  .intro-strip { grid-template-columns: 1fr; }
  .intro-strip > div { padding: 16px 22px; }
  .section { padding: 78px 22px; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 20px; }
  .fresh-card,
  .fresh-card.featured { grid-column: span 12; }
  .product-grid { grid-template-columns: 1fr; }
  .contact-panel { padding: 50px 28px; }
  .hero h1 { font-size: 56px; }
}
