/* ==========================================================================
   LEAF & LOOM TEA CO. — theme layer
   Sits on top of css/styles.css (Bootstrap 5 + Grayscale base).
   All theme rules use new class names, so nothing here fights the base theme.
   ========================================================================== */

:root {
  /* Ink & mist — a bright morning-tea palette: ivory light, jade ink */
  --ink-900: #faf6ec;
  --ink-800: #f1e8d3;
  --ink-700: #e3d6b0;
  --moss:    #4a6b4f;
  --jade:    #2f7a3d;
  --mist:    #24331f;
  --mist-50: rgba(36, 51, 31, 0.62);
  --mist-15: rgba(36, 51, 31, 0.14);
  --mist-08: rgba(36, 51, 31, 0.06);
  /* Infusion — the colour tea turns as it steeps */
  --brew:      #d9862a;
  --brew-deep: #8f4d18;

  --display: "Marcellus", Georgia, "Times New Roman", serif;
  --body:    "Karla", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --cjk:     "Noto Serif TC", var(--display), serif;

  --rule: 1px solid var(--mist-15);
}

/* --- base ---------------------------------------------------------------- */

html { scroll-padding-top: 4.5rem; scroll-behavior: smooth; }

body.tea {
  background: var(--ink-900);
  color: var(--mist);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.7;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

body.tea h1, body.tea h2, body.tea h3 {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 1.08;
}

.h-display { font-size: clamp(2.5rem, 6.6vw, 5.25rem); }
.h-section { font-size: clamp(1.9rem, 4.2vw, 3.25rem); margin-bottom: 1.25rem; }

.lede { font-size: clamp(1rem, 1.5vw, 1.2rem); color: var(--mist-50); max-width: 34rem; }

/* Eyebrow: small tracked-out mono, used to label a section the way a tin is
   labelled — origin, grade, date. */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--jade);
  margin-bottom: 1.75rem;
  display: block;
}

@media (max-width: 575.98px) {
  .eyebrow { letter-spacing: 0.22em; font-size: 0.64rem; }
}

.rule { border: 0; border-top: var(--rule); opacity: 1; margin: 0; }

.section { padding: clamp(5rem, 12vw, 9.5rem) 0; }
.section--ink { background: var(--ink-800); }

a { color: inherit; }
a:hover { color: var(--jade); }

/* --- buttons -------------------------------------------------------------- */

.leaf-btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 1.05rem 2.4rem;
  border: 1px solid var(--mist-50);
  color: var(--mist);
  background: transparent;
  text-decoration: none;
  transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}
.leaf-btn:hover,
.leaf-btn:focus-visible { background: var(--mist); color: var(--ink-900); border-color: var(--mist); }
.leaf-btn--solid { background: var(--mist); color: var(--ink-900); border-color: var(--mist); }
.leaf-btn--solid:hover { background: var(--jade); border-color: var(--jade); color: var(--ink-900); }

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

/* --- duotone ------------------------------------------------------------- */
/* The photographs are already colour and already sit in the palette (green
   tea gardens). A light jade tint ties them together as one set without
   burying the actual photo under the overlay. */

.duo { position: relative; overflow: hidden; background: var(--ink-900); }
.duo img { display: block; width: 100%; height: 100%; object-fit: cover; filter: saturate(1.08) contrast(1.04) brightness(1.03); }
.duo::before,
.duo::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.duo::before { background: rgba(47, 122, 61, 0.14); mix-blend-mode: multiply; }
.duo::after  { background: rgba(253, 246, 227, 0.1); mix-blend-mode: screen; }

/* --- navigation ---------------------------------------------------------- */

#teaNav {
  background: transparent;
  transition: background-color 0.4s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
  padding: 0.9rem 0;
}
#teaNav.solid { background: rgba(250, 246, 236, 0.92); backdrop-filter: blur(10px); border-bottom: var(--rule); }

.brand-mark { font-family: var(--cjk); font-size: 1.45rem; line-height: 1; color: var(--mist); }
.brand-name {
  font-family: var(--mono); font-size: 0.82rem; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--mist); display: block; margin-top: 0.35rem;
}
.navbar-brand:hover .brand-mark { color: var(--jade); }

#teaNav .nav-link {
  font-family: var(--mono); font-size: 0.85rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--mist); padding: 0.6rem 0; margin-left: 2.25rem;
}
#teaNav .nav-link:hover, #teaNav .nav-link:focus { color: var(--jade); }
#teaNav .navbar-toggler {
  border: 1px solid var(--mist-15); border-radius: 0; color: var(--mist);
  font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.2em; padding: 0.5rem 0.9rem;
}
#teaNav .nav-cta { padding: 0.55rem 1.5rem; font-size: 0.8rem; }
#teaNav .nav-cta.dropdown-toggle::after { margin-left: 0.6rem; vertical-align: 0.1em; }
.nav-user-menu {
  border-radius: 0; border: var(--rule); box-shadow: 0 8px 24px var(--mist-15);
  background: var(--ink-900); padding: 0.4rem 0; margin-top: 0.6rem;
}
.nav-user-menu .dropdown-item {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--mist); padding: 0.6rem 1.3rem;
}
.nav-user-menu .dropdown-item:hover, .nav-user-menu .dropdown-item:focus { background: var(--ink-800); color: var(--jade); }
@media (max-width: 991.98px) {
  #teaNav .navbar-collapse { background: var(--ink-800); margin-top: 0.9rem; padding: 0.5rem 1rem 1rem; }
  #teaNav .nav-link { margin-left: 0; border-bottom: var(--rule); }
  #teaNav .nav-cta { display: inline-block; margin-top: 0.75rem; }
}

/* --- hero ---------------------------------------------------------------- */

.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; }
.hero__media { position: absolute; inset: 0; }
.hero__scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, rgba(250,246,236,0.75) 0%, rgba(250,246,236,0.25) 30%, rgba(250,246,236,0.82) 72%, rgba(250,246,236,0.95) 100%),
    linear-gradient(to right, rgba(250,246,236,0.7) 0%, rgba(250,246,236,0.3) 45%, rgba(250,246,236,0) 78%);
}
.hero__inner { position: relative; padding-bottom: clamp(3.5rem, 9vh, 7rem); padding-top: 9rem; width: 100%; }
.hero h1 { max-width: 20ch; text-shadow: 0 0.1em 0.9em rgba(36,51,31,0.18); }
.hero .eyebrow, .hero .lede { text-shadow: 0 0.05em 0.6em rgba(36,51,31,0.15); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 1rem 1.75rem; align-items: center; margin-top: 2.5rem; }

/* Ambient drift on the hero photograph — slow enough to read as weather. */
@media (prefers-reduced-motion: no-preference) {
  .hero__media img { animation: drift 34s ease-in-out infinite alternate; transform-origin: 60% 40%; }
  @keyframes drift { from { transform: scale(1.06); } to { transform: scale(1.14) translate3d(-1.2%, -0.8%, 0); } }
}

/* --- spec list ----------------------------------------------------------- */
/* Real numbers off the tin: altitude, harvest window, oxidation, roast. */

.spec { list-style: none; padding: 0; margin: 2.5rem 0 0; border-top: var(--rule); }
.spec li {
  display: flex; justify-content: space-between; gap: 1.5rem;
  padding: 0.85rem 0; border-bottom: var(--rule);
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.04em;
}
.spec dt, .spec .k { color: var(--jade); text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.68rem; }
.spec .v { color: var(--mist); text-align: right; }

/* --- leaves / steep cards ------------------------------------------------ */

.leaf-card {
  position: relative; overflow: hidden; height: 100%;
  background: var(--ink-800); border: var(--rule);
  padding: 2.25rem 1.75rem 1.75rem;
  display: flex; flex-direction: column;
}
.leaf-card { transition: border-color 0.4s ease, transform 0.4s ease; }
.leaf-card:hover { border-color: rgba(180,113,42,0.55); }
.leaf-card__fill {
  position: absolute; left: 0; right: 0; bottom: 0; height: 0;
  background: linear-gradient(to top, rgba(111,58,18,0.92), rgba(180,113,42,0.55) 55%, rgba(180,113,42,0.12));
  transition: height linear 0s;
  z-index: 0;
}
.leaf-card > *:not(.leaf-card__fill) { position: relative; z-index: 1; }
.leaf-card__name { font-family: var(--display); font-size: 1.5rem; margin-bottom: 0.5rem; }
.leaf-card__cjk { font-family: var(--cjk); font-size: 0.95rem; color: var(--jade); margin-bottom: 1rem; display: block; }
.leaf-card__note { color: var(--mist-50); font-size: 0.95rem; flex-grow: 1; }

.brewline {
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.06em;
  color: var(--mist); border-top: var(--rule); border-bottom: var(--rule);
  padding: 0.7rem 0; margin: 1.5rem 0 1.25rem;
  display: flex; justify-content: space-between; gap: 0.5rem;
}
.brewline span { white-space: nowrap; }

.steep {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: transparent; border: 1px solid var(--mist-15); color: var(--mist);
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase;
  padding: 0.8rem 1.1rem; width: 100%; cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease;
}
.steep:hover:not([disabled]) { border-color: var(--jade); color: var(--jade); }
.steep[disabled] { cursor: default; color: var(--mist); border-color: var(--mist-50); }
.steep__count { font-variant-numeric: tabular-nums; }

/* --- alternating story blocks -------------------------------------------- */

.story { display: grid; grid-template-columns: 1fr; }
@media (min-width: 992px) { .story { grid-template-columns: 1.15fr 1fr; } .story--flip .story__media { order: 2; } }
.story__media { min-height: 26rem; position: relative; }
.story__media::after { opacity: 1; }
.story__body { padding: clamp(2.5rem, 6vw, 5.5rem); display: flex; flex-direction: column; justify-content: center; background: var(--ink-800); }

/* Opt-in scrim for a .story used as the first thing on a page (no .hero above
   it) — the fixed nav starts transparent and only goes solid on scroll, so a
   bright photo sitting directly under it at the top needs its own scrim to
   keep the (dark) nav text legible, same idea as .hero__scrim. */
.story__topscrim {
  position: absolute; top: 0; left: 0; right: 0; height: 7rem; z-index: 2; pointer-events: none;
  background: linear-gradient(to bottom, rgba(250,246,236,0.85) 0%, rgba(250,246,236,0) 100%);
}

/* --- brewing steps ------------------------------------------------------- */
/* Numbered because the order genuinely matters — you cannot rinse before you
   warm the pot. */

.step { border-top: var(--rule); padding: 2rem 0 0; height: 100%; }
.step__n { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.2em; color: var(--jade); display: block; margin-bottom: 1rem; }
.step h3 { font-size: 1.35rem; margin-bottom: 0.65rem; }
.step p { color: var(--mist-50); font-size: 0.95rem; margin: 0; }

/* --- first-flush list ---------------------------------------------------- */

.flush { position: relative; }
.flush__media { position: absolute; inset: 0; }
.flush__scrim { position: absolute; inset: 0; background: rgba(250,246,236,0.88); }
.flush__inner { position: relative; }
.flush input[type="email"] {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--mist-50);
  color: var(--mist); font-family: var(--mono); font-size: 0.85rem; letter-spacing: 0.08em;
  padding: 0.9rem 0.2rem;
}
.flush input::placeholder { color: rgba(36,51,31,0.4); text-transform: uppercase; letter-spacing: 0.2em; font-size: 0.7rem; }
.flush input:focus { outline: none; border-bottom-color: var(--jade); }
.flush__msg { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; color: var(--jade); margin-top: 1rem; min-height: 1.2rem; }

/* --- visit --------------------------------------------------------------- */

.visit-item { border-top: var(--rule); padding-top: 1.5rem; height: 100%; }
.visit-item h3 { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--jade); margin-bottom: 1rem; }
.visit-item p { margin: 0; color: var(--mist); font-size: 0.98rem; }
.visit-item p + p { color: var(--mist-50); }

.social { border-top: var(--rule); padding-top: 1.75rem; }
.social a {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--mist-50); text-decoration: none; transition: color 0.3s ease;
}
.social a:hover { color: var(--jade); }

/* --- footer -------------------------------------------------------------- */

.tea-footer { background: var(--ink-900); border-top: var(--rule); padding: 3rem 0; }
.tea-footer, .tea-footer a { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.12em; color: var(--mist-50); }
.tea-footer a:hover { color: var(--jade); }

/* --- auth / login card ----------------------------------------------------- */

.auth-header { height: 4.5rem; display: flex; align-items: center; }
.auth-header__brand { text-decoration: none; }
.auth-header__brand:hover .brand-name { color: var(--jade); }

.auth-section { min-height: calc(100svh - 4.5rem); display: flex; align-items: center; }
.auth-card {
  background: var(--ink-800); border: var(--rule);
  padding: clamp(2.5rem, 5vw, 3.5rem); max-width: 28rem; margin: 0 auto; width: 100%;
}
.auth-card h1, .auth-card h2 { font-size: clamp(1.9rem, 4vw, 2.4rem); margin: 0.5rem 0 0.75rem; }
.auth-card .subtitle { color: var(--mist-50); font-size: 0.95rem; margin: 0 0 2rem; }

/* Shared field styling — used by .auth-card (admin forms) and .contact-form
   (public marketing-style forms, e.g. the enquiry page). */
.field-form .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
@media (max-width: 575.98px) { .field-form .field-row { grid-template-columns: 1fr; } }

.field-form .input { margin-bottom: 1.5rem; }
.field-form .input label {
  display: block; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--jade); margin-bottom: 0.5rem;
}
.field-form .input input,
.field-form .input textarea {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--mist-50);
  color: var(--mist); font-family: var(--body); font-size: 1rem; padding: 0.7rem 0.1rem;
  resize: vertical;
}
.field-form .input input:focus,
.field-form .input textarea:focus { outline: none; border-bottom-color: var(--jade); }

.field-form .verify-hint { font-family: var(--mono); font-size: 0.7rem; color: var(--mist-50); margin-top: 0.75rem; }

.auth-links {
  margin-top: 2rem; padding-top: 1.5rem; border-top: var(--rule);
  display: flex; flex-direction: column; gap: 0.75rem;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em;
}
.auth-links a { color: var(--mist-50); text-decoration: none; }
.auth-links a:hover { color: var(--jade); }
.auth-links hr { border: 0; border-top: var(--rule); margin: 0.25rem 0; }

/* --- scroll reveal ------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(1.75rem); transition: opacity 0.9s ease, transform 0.9s ease; }
  .reveal.in { opacity: 1; transform: none; }
}

/* --- shop -------------------------------------------------------------- */
/* Product catalogue + detail. Structure is adapted from Start Bootstrap's
   shop-homepage / shop-item templates, recoloured onto the tea palette. */

/* Extra top padding so the first section clears the fixed nav (#teaNav). */
.shop-hero { background: var(--ink-800); border-bottom: var(--rule); padding-top: clamp(7.5rem, 14vw, 10rem); }

.product-grid {
  display: grid;
  gap: 2.5rem 1.5rem;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 768px)  { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .product-grid { grid-template-columns: repeat(4, 1fr); } }

.product-card {
  position: relative;
  display: flex; flex-direction: column; height: 100%;
  background: var(--ink-800); border: var(--rule);
  transition: border-color 0.4s ease, transform 0.4s ease;
}
.product-card:hover { border-color: rgba(180, 113, 42, 0.55); transform: translateY(-3px); }
.product-card__img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.product-card__body {
  padding: 1.5rem 1.5rem 1.75rem;
  text-align: center;
  display: flex; flex-direction: column; flex-grow: 1;
}
.product-card__title { font-family: var(--display); font-size: 1.35rem; margin: 0 0 0.4rem; }
.product-card__origin {
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--jade); margin-bottom: 0.9rem;
}
.product-card__price {
  font-family: var(--mono); font-size: 0.92rem; color: var(--mist);
  margin-bottom: 1.35rem;
}
.product-card__price del { color: var(--mist-50); margin-right: 0.5rem; }
.product-card .leaf-btn { margin-top: auto; align-self: center; padding: 0.7rem 1.9rem; }

/* Sale flag — unused until products carry a sale price, kept so the markup
   hook is ready. */
.product-card__flag {
  position: absolute; top: 0.6rem; right: 0.6rem; z-index: 2;
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-900);
  background: var(--brew-deep); padding: 0.3rem 0.6rem;
}

/* --- product detail --------------------------------------------------- */

.product-detail { padding-top: clamp(7.5rem, 14vw, 10rem); }
.product-detail__back {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--mist-50); text-decoration: none;
}
.product-detail__back:hover { color: var(--jade); }
.product-detail__media { border: var(--rule); background: var(--ink-800); overflow: hidden; }
.product-detail__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.product-detail__origin {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--jade); margin-bottom: 0.75rem;
}
.product-detail__price {
  font-family: var(--mono); font-size: 1.15rem; color: var(--mist);
  margin: 0 0 2rem;
}
.product-detail__price del { color: var(--mist-50); margin-right: 0.6rem; }
.product-detail__buy { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-top: 2.5rem; }
.product-detail__qty {
  width: 3.5rem; text-align: center;
  background: transparent; border: 1px solid var(--mist-50); color: var(--mist);
  font-family: var(--mono); font-size: 0.95rem; padding: 0.7rem 0.4rem;
}
.product-detail__qty:focus { outline: none; border-color: var(--jade); }
.product-detail__ingredients { color: var(--mist-50); font-size: 0.95rem; margin-top: 1.5rem; }
