/* ==========================================================================
   Good Tilled Earth — site stylesheet
   --------------------------------------------------------------------------
     1. Design tokens          <- branding lives here
     2. Reset + base
     3. Layout helpers
     4. Header / nav / footer
     5. Hero
     6. Product list + detail
     7. Services + video
     8. Responsive + accessibility
   ========================================================================== */

/* 1. DESIGN TOKENS ========================================================= */
:root {
  --ink:        #23291f;
  --ink-soft:   #5a6353;   /* muted text. Solid, not alpha: the old translucent
                              value measured ~2.6:1 on paper, under the 4.5:1
                              minimum. This is 5.0:1 or better on every
                              background used on the site. */
  --sage:       #8fa07c;
  --sage-deep:  #516043;   /* darkened from #5e7050: the old value measured
                              4.3:1 as text on --sage-wash, under the 4.5:1
                              minimum. Now 5.4:1 there and 6.1:1 on paper, and
                              it strengthens the buttons too. */
  --sage-pale:  #cdd6bf;
  --paper:      #f6f2e7;
  --paper-2:    #ece5d3;
  --paper-3:    #fffdf7;
  --forest:     #2f3b28;   /* deep green: footer ground, wordmark            */
  --sage-wash:  #e2e9d7;   /* pale green panel wash                          */
  --bloom:      #9e4f6e;   /* the single warm accent: prices, hover           */
  --honey:      #a9781f;   /* low stock                                      */

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body:    "Karla", "Segoe UI", system-ui, sans-serif;

  /* Page titles: normal editorial size. The oversized treatment moved to the
     wordmark, which is the actual masthead of the site. */
  --h1-size: clamp(2.4rem, 5.5vw, 3.9rem);

  /* The wordmark — "Good Tilled Earth" in the header. This is the big one. */
  --wordmark-size: clamp(1.85rem, 4.2vw, 2.9rem);

  --s1: 0.35rem;
  --s2: 0.7rem;
  --s3: 1.15rem;
  --s4: 1.9rem;
  --s5: 3rem;
  --s6: 4.75rem;

  --measure: 62ch;
  --rule: 1px solid var(--sage-pale);
}

/* 2. RESET + BASE ========================================================== */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image: repeating-linear-gradient(
    0deg, rgba(143, 160, 124, 0.05) 0 1px, transparent 1px 6px);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.02rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  line-height: 1.05;
  margin: 0 0 var(--s3);
  letter-spacing: -0.02em;
}
/* At this size the default tracking is too loose and words sit too far
   apart, so the big titles get tightened and balanced across lines. */
h1 {
  font-size: var(--h1-size);
  text-wrap: balance;
}
h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); }
h3 { font-size: 1.35rem; }

p { margin: 0 0 var(--s3); max-width: var(--measure); }

a { color: var(--sage-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--bloom); }

img { max-width: 100%; display: block; }

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

/* 3. LAYOUT HELPERS ======================================================== */
.wrap { width: min(100% - 2.5rem, 1180px); margin-inline: auto; }
.wrap--narrow { width: min(100% - 2.5rem, 720px); margin-inline: auto; }

.section { padding-block: var(--s6); }
.section--tint { background: var(--sage-wash); border-block: 1px solid var(--sage-pale); }
.section--sand { background: var(--paper-2); }   /* the old tan, still available */
.section__head { margin-bottom: var(--s4); }

.stack > * + * { margin-top: var(--s3); }

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.72em 1.5em;
  border: 1px solid var(--sage-deep);
  border-radius: 2px;
  background: var(--sage-deep);
  color: var(--paper);
  text-decoration: none;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.btn:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn--quiet { background: transparent; color: var(--sage-deep); }
.btn--quiet:hover { background: var(--sage-deep); color: var(--paper); }

.note { font-size: 0.88rem; color: var(--ink-soft); }

/* 4. HEADER / NAV / FOOTER ================================================= */
/* A 3px green rule across the very top of every page — cheap, and it stops the
   masthead reading as just more tan. */
/* The masthead carries the pale green. Everything below it sits on the warm
   textured paper, so the green reads as a deliberate band rather than a wash
   over the whole page. */
.masthead {
  border-top: 3px solid var(--sage-deep);
  border-bottom: 1px solid var(--sage-pale);
  background: var(--sage-wash);
  position: sticky; top: 0; z-index: 40;
}
/* Padding is tightened because the wordmark itself now carries the height —
   a sticky header that eats a third of a phone screen is a bad trade. */
.masthead__inner { display: flex; align-items: center; gap: var(--s4); padding-block: 0.85rem; }

.wordmark {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--wordmark-size);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--forest);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark:hover { color: var(--bloom); }

.brand { display: flex; flex-direction: column; gap: 0.2rem; }
.brand__tagline {
  margin: 0;
  max-width: none;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage-deep);
}

.nav { margin-left: auto; display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.nav a {
  color: var(--ink); text-decoration: none; font-size: 1rem;
  padding-bottom: 2px; border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--sage-deep); border-bottom-color: var(--sage); }
.nav a[aria-current="page"] { border-bottom-color: var(--bloom); }

/* --- footer: contact block + social row, on every page ---
   Deep green rather than tan. It gives every page a weighted base, and it's
   the one place a dark block can't compete with the content above it. */
.footer {
  background: var(--forest);
  color: #d8e0cd;
  padding-block: var(--s5);
  font-size: 0.94rem;
}
.footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s4);
}
.footer h4 {
  font-family: var(--font-body); font-style: normal;
  font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.09em; text-transform: uppercase;
  color: #b5c3a5;          /* 6.4:1 on forest; --sage was only 4.2:1 */
  margin-bottom: var(--s2);
}
.footer p { margin-bottom: var(--s2); max-width: none; }
.footer a { color: var(--paper); text-decoration-color: rgba(246, 242, 231, 0.4); }
.footer a:hover { color: #fff; text-decoration-color: currentColor; }

.social { display: flex; gap: var(--s2); list-style: none; padding: 0; margin: 0; }
.social a {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border: 1px solid rgba(216, 224, 205, 0.3);
  border-radius: 2px;
  color: #d8e0cd;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.social a:hover { background: var(--paper); border-color: var(--paper); color: var(--forest); }
.social svg { width: 19px; height: 19px; fill: currentColor; }

.footer__base {
  border-top: 1px solid rgba(216, 224, 205, 0.22);
  margin-top: var(--s4); padding-top: var(--s3);
  color: rgba(216, 224, 205, 0.65);
  font-size: 0.85rem;
}

/* 5. HERO ================================================================== */
/* With the title at roughly double size it needs the full column width, so
   the hero is one stacked column rather than a two-up grid. */
/* No background of its own — the hero sits on the body's textured paper. */
.hero { padding-block: var(--s5) var(--s6); }
.hero__lede { font-size: 1.22rem; max-width: 52ch; margin-top: var(--s4); }
.hero__actions { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s4); }
/* The hero sits on its own green ground now, so it no longer needs a rule
   to separate itself from what follows. */
.hero__grid {
   display: grid;
   grid-template-columns: 1.2fr 0.8fr;
   gap: var(--s5);
   align-items: start;
}
/* Grid items default to min-width:auto, meaning they refuse to shrink below
  their content's intrinsic size. A 1200px-wide image can therefore force its
  column wider than its share and push the whole grid past its container —
  which looks exactly like the margins disappearing. min-width:0 lets the
  columns shrink as intended. */
.hero__text, .hero__photo { min-width: 0; }

.hero__text > h2 { margin-top: 0; }
.hero__text > .hero__lede:first-of-type { margin-top: var(--s3); }
.hero__photo {
  margin: 0;
  justify-self: end;
  width: fit-content;        /* border and caption hug the image, not the column */
  max-width: 450px;
}
.hero__photo img {
  width: auto;               /* overrides the earlier width:100% */
  height: auto;
  max-width: 100%;           /* never wider than the column */
  max-height: 1000px;         /* never taller than this — your main dial */
  aspect-ratio: auto;        /* stop forcing a shape */
  object-fit: fill;          /* no cropping; with auto ratio it's a no-op */
  border: 1px solid var(--sage-pale);
}
.hero__photo figcaption { font-size: 0.85rem; color: var(--ink-soft); margin-top: var(--s2); }

.page-head { padding-block: var(--s5) var(--s4); border-bottom: 2px solid var(--sage); }
.page-head p { color: var(--ink-soft); margin-bottom: 0; font-size: 1.1rem; }

/* Plain panel for signposts that aren't products. */
.panel {
  background: var(--paper-3);
  border: 1px solid var(--sage-pale);
  border-left: 3px solid var(--sage-deep);
  padding: var(--s3) var(--s3) var(--s4);
  transition: background 140ms ease, border-color 140ms ease;
}
.panel:hover { background: var(--sage-wash); border-left-color: var(--bloom); }
.panel h3 { margin-bottom: var(--s2); }
.panel h3 a { color: var(--ink); text-decoration: none; }
.panel h3 a:hover { color: var(--bloom); }
.panel p { font-size: 0.94rem; color: var(--ink-soft); margin-bottom: 0; }

.section--tint .panel { background: var(--paper-3); }
.section--tint .panel:hover { background: var(--paper); }

.trio { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s4); }

/* 6. PRODUCTS ============================================================== */
.catalogue { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--s4); }

/* Nursery plant tag: square shoulders, notched foot, punched hole. */
.tag {
  position: relative;
  background: var(--paper-3);
  border: 1px solid var(--sage-pale);
  border-top: 3px solid var(--sage-deep);   /* the green shoulder of the tag */
  border-bottom: none;
  padding: var(--s3) var(--s3) var(--s4);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 26px), 50% 100%, 0 calc(100% - 26px));
  transition: box-shadow 160ms ease, transform 160ms ease;
}
.tag::after {
  content: ""; position: absolute; top: 13px; left: 50%;
  transform: translateX(-50%);
  width: 22px; height: 6px; border-radius: 3px; background: var(--paper-2);
}
.tag:hover, .tag:focus-within {
  box-shadow: 0 10px 26px -18px rgba(35, 41, 31, 0.7);
  transform: translateY(-3px);
}
.tag__media { display: block; margin: var(--s3) 0; overflow: hidden; background: var(--paper-2); }
.tag__media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 220ms ease; }
.tag:hover .tag__media img, .tag:focus-within .tag__media img { transform: scale(1.06); }

.tag__name { margin: 0 0 var(--s1); font-size: 1.3rem; }
.tag__name a { color: var(--ink); text-decoration: none; }
.tag__name a:hover { color: var(--bloom); }

.tag__meta { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2); }
.tag__price { font-weight: 700; color: var(--bloom); }
.tag__stock { font-size: 0.82rem; color: var(--ink-soft); }
.tag__stock--low { color: var(--honey); }
.tag__stock--out { color: var(--ink-soft); font-style: italic; }
.tag__blurb { font-size: 0.92rem; color: var(--ink-soft); margin: var(--s2) 0 0; }

/* --- product detail --- */
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); padding-block: var(--s4); align-items: start; }
.detail h1 { font-size: clamp(2.6rem, 6vw, 4.2rem); }  /* product names run long */
.detail__gallery { border: var(--rule); background: var(--paper-3); padding: var(--s2); }
.detail__thumbs { display: flex; gap: var(--s2); margin-top: var(--s2); }
.detail__thumbs button { padding: 0; border: 1px solid var(--sage-pale); background: none; cursor: pointer; width: 72px; }
.detail__thumbs button[aria-pressed="true"] { border-color: var(--bloom); }

/* Price + size list. No cart — this is a price list, so it reads as one. */
.sizes { border-top: var(--rule); margin: var(--s3) 0; }
.size {
  display: flex;
  flex-wrap: wrap;              /* the missing line — lets stock drop to its own row */
  align-items: baseline;
  gap: var(--s2) var(--s3);
  padding: var(--s2) 0;
  border-bottom: var(--rule);
}
.size__label {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  white-space: nowrap;
  flex: 0 1 auto;
}
.size__price {
  font-weight: 700;
  color: var(--bloom);
  font-size: 1.35rem;
  white-space: nowrap;
}
.size__stock {
  font-size: 0.85rem;
  color: var(--ink-soft);
  flex-basis: 100%;
  margin: 0;
}
.size--out { opacity: 0.55; }

.enquire { background: var(--sage-wash); border-left: 3px solid var(--sage-deep); padding: var(--s3); }
.enquire h3 { margin-bottom: var(--s2); }
.enquire p:last-child { margin-bottom: 0; }

.care { border-top: 2px solid var(--sage); padding-top: var(--s3); margin-top: var(--s4); }
.care h2 { color: var(--sage-deep); font-size: 1.5rem }
.care ul { padding-left: 1.1rem; max-width: none; }
.care li { margin-bottom: var(--s2); }

.spec { width: 100%; border-collapse: collapse; margin-top: var(--s3); font-size: 0.92rem; }
.spec th, .spec td { text-align: left; padding: 0.45rem 0; border-bottom: var(--rule); vertical-align: top; }
.spec th { font-weight: 700; width: 38%; }

.reviews { border-top: var(--rule); padding-top: var(--s4); margin-top: var(--s5); }
.review { border-left: 3px solid var(--sage-pale); padding-left: var(--s3); margin-bottom: var(--s4); }
.review__stars { color: var(--honey); letter-spacing: 2px; }
.review__who { font-size: 0.85rem; color: var(--ink-soft); }

/* 7. SERVICES + VIDEO ======================================================
   The page alternates: text left / video right, then video left / text right.
   The flip is done with grid `order` rather than by reordering the markup, so
   the reading order in the HTML stays text-then-video — which is what a screen
   reader and a phone both want. Visual order and DOM order are allowed to
   disagree; DOM order is the one that has to make sense. */
.service-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s5);
  align-items: center;
  padding-block: var(--s6);
  border-top: 1px solid var(--sage-pale);
}
.service-row:first-of-type { border-top: 0; }
.service-row--flip .service-row__media { order: -1; }

.service-row h2 { margin-bottom: var(--s2); }
.service-row__rate {
  display: inline-block;
  font-weight: 700;
  color: var(--sage-deep);
  background: var(--sage-wash);
  border: 1px solid var(--sage-pale);
  border-radius: 2px;
  padding: 0.25em 0.8em;
  font-size: 0.92rem;
  margin-bottom: var(--s3);
}
.service-row__list { padding-left: 1.1rem; margin: var(--s3) 0 0; max-width: var(--measure); }
.service-row__list li { margin-bottom: var(--s2); }
.service-row__list li::marker { color: var(--sage); }

/* Responsive 16:9 frame. aspect-ratio keeps the iframe proportional at any
   width without the old padding-bottom percentage hack. */
.video { margin: 0; }
.video__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--forest);
  border: 1px solid var(--sage-pale);
  box-shadow: 0 16px 34px -26px rgba(35, 41, 31, 0.85);
}
.video__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video figcaption { font-size: 0.88rem; color: var(--ink-soft); margin-top: var(--s2); }

/* 8. RESPONSIVE + ACCESSIBILITY ============================================ */
@media (max-width: 860px) {
  .detail { grid-template-columns: 1fr; }
  .service-row { grid-template-columns: 1fr; gap: var(--s4); padding-block: var(--s5); }
  .service-row--flip .service-row__media { order: 0; }
  .masthead__inner { flex-wrap: wrap; gap: var(--s2); }
  .nav { margin-left: 0; width: 100%; }
  .section { padding-block: var(--s5); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

.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;
}
