/* Moon Charm Farm — production stylesheet.
   Ported from the approved wireframe (concepts/wireframe-1-editorial.html).
   Layout, section order, proportions, and spacing rhythm are design-locked;
   change values through the tokens below where possible. */

/* ---------- Design tokens ---------- */
:root {
  --ink: #141412;
  --paper: #ffffff;
  --muted: #6f6d68;
  --muted-strong: #5f5d58;   /* placeholder-label ink on tinted backgrounds (contrast-safe) */
  --faint: #e8e7e4;
  --accent: #1e5c3a;         /* placeholder accent — swap freely */
  --flat-1: #f4efe3;         /* flat product-background placeholders */
  --flat-2: #e9eef0;
  --flat-3: #f0e9e6;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --display: "change", Arial, Helvetica, sans-serif; /* Adobe Fonts "Change" — display roles only */
  --wrap-max: 70rem;         /* 1120px */
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
}

::selection { background: var(--accent); color: var(--paper); }

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

a { color: inherit; }

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

.wrap { max-width: var(--wrap-max); margin: 0 auto; padding-inline: 24px; }

.tag {
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}

/* Placeholder art block — replaced by .art > img when real images exist */
.ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--muted-strong);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
  width: 100%;
  min-width: 0;
  padding: 12px;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Real art block — same footprint as .ph so swapping causes no layout shift */
.art { width: 100%; min-width: 0; overflow: hidden; }
.art img { width: 100%; height: 100%; object-fit: cover; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 14px;
  font-size: 0.75rem;
  z-index: 10;
}
.skip:focus { left: 0; }

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

/* ---------- Masthead: simple, static, no scroll effects ---------- */
header.masthead { border-bottom: 2px solid var(--ink); }

header.masthead .row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding-block: 18px;
}

.wordmark {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  margin: 0;
}
.wordmark a { text-decoration: none; }
.wordmark a:hover { color: var(--accent); }

.tagline { font-size: 0.8125rem; color: var(--muted); margin: 0 0 0 14px; }

.brand { display: flex; align-items: baseline; flex-wrap: wrap; }

nav[aria-label="Main"] { font-size: 0.8125rem; letter-spacing: 0.04em; }
nav[aria-label="Main"] a { text-decoration: none; margin-left: 20px; }
nav[aria-label="Main"] a:hover,
nav[aria-label="Main"] a[aria-current="page"] { color: var(--accent); }

/* ---------- Product hero: the first substantial thing on the page ---------- */
.hero { padding-block: 40px 48px; }

.hero .frame {
  background: var(--flat-1);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  gap: 0;
}

.hero .ph,
.hero .art { aspect-ratio: 1 / 1; }

.hero .info { padding: 36px 40px; }

.hero h1 {
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

.hero .price { font-size: 1rem; color: var(--ink); margin: 0 0 16px; }

.hero .desc { font-size: 0.875rem; color: var(--muted-strong); max-width: 36ch; margin: 0 0 20px; }

.hero .cta {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 20px;
  text-decoration: none;
  margin: 0;
}
.hero a.cta:hover { background: var(--accent); }

/* Honest non-link state until a Printful URL exists */
.hero .cta--pending {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--faint);
}

/* ---------- More goods: artwork-led, varied scale, not identical cards ---------- */
.goods { padding-block: 8px 48px; }

.goods .items {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.product .ph,
.product .art { aspect-ratio: 4 / 5; margin-bottom: 12px; }
.product.a .ph, .product.a .art { background: var(--flat-2); }
.product.b .ph, .product.b .art { background: var(--flat-3); aspect-ratio: 1 / 1; }
.product.c .ph, .product.c .art { background: var(--flat-1); aspect-ratio: 3 / 4; }

.product h3 {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.25;
  margin: 0 0 4px;
}
.product h3 a { text-decoration: none; }
.product h3 a:hover { color: var(--accent); text-decoration: underline; }

.product p { font-size: 0.75rem; color: var(--muted); margin: 0; }

/* ---------- Shop CTA band ---------- */
.shop-cta {
  padding-block: 26px;
  border-block: 1px solid var(--faint);
  text-align: center;
}

.shop-cta a {
  font-size: 0.8125rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
  color: var(--ink);
}
.shop-cta a:hover { color: var(--accent); }

/* Honest pending state until the Printful store URL exists */
.shop-cta p { font-size: 0.8125rem; letter-spacing: 0.05em; color: var(--muted); margin: 0; }

/* ---------- From the Almanac: demoted, visually quiet ---------- */
.almanac-stories { padding-block: 36px; border-bottom: 1px solid var(--faint); }

.almanac-stories .entries {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}

.story .ph,
.story .art { aspect-ratio: 16 / 10; background: var(--faint); margin-bottom: 8px; }

.story h3 {
  font-family: var(--display);
  font-size: 0.9375rem;
  font-weight: 400;
  margin: 0 0 4px;
  line-height: 1.3;
}
.story h3 a { text-decoration: none; }
.story h3 a:hover { color: var(--accent); text-decoration: underline; }

.story p { font-size: 0.75rem; color: var(--muted); margin: 0; }

.story.text-only h3 { font-size: 0.875rem; }

.almanac-stories .more { font-size: 0.75rem; letter-spacing: 0.04em; margin-top: 18px; }
.almanac-stories .more a {
  text-decoration: none;
  border-bottom: 1px solid var(--muted);
  padding-bottom: 2px;
}
.almanac-stories .more a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Newsletter ---------- */
.newsletter {
  padding-block: 32px;
  border-bottom: 2px solid var(--ink);
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.newsletter h2 {
  font-family: var(--display);
  font-size: 1.0625rem;
  font-style: italic;
  font-weight: 400;
  margin: 0 0 2px;
}

.newsletter p { font-size: 0.8125rem; color: var(--muted); margin: 0; }

/* EmailOctopus injects its own form (Bootstrap-flavored markup + a
   Montserrat import) here. These overrides pull it back into the design:
   inline row, square corners, ink button, system type. Selectors follow
   the injected markup: .inline-container > form.emailoctopus-form with
   input.form-control and input.btn.btn-primary. min-height reserves space
   so the injection doesn't shift layout. */
.newsletter-embed { margin-left: auto; min-height: 3.25rem; min-width: min(24rem, 100%); }

.newsletter-embed .inline-container { max-width: none !important; }

.newsletter-embed .emailoctopus-form-wrapper { font-family: var(--sans); }

.newsletter-embed .emailoctopus-form .main-form {
  display: flex;
  gap: 10px;
  align-items: stretch;
  flex-wrap: wrap;
}
.newsletter-embed [eo-form-fields-container] { flex: 1 1 auto; }
.newsletter-embed .emailoctopus-form-row.form-group { margin: 0 !important; }

.newsletter-embed input.form-control {
  font-family: var(--sans) !important;
  font-size: 1rem !important; /* ≥16px prevents iOS focus zoom */
  padding: 9px 12px !important;
  border: 1px solid var(--ink) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  width: 100%;
  accent-color: var(--accent);
}
.newsletter-embed input.form-control:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.newsletter-embed input.btn {
  font-family: var(--sans) !important;
  font-size: 0.75rem !important;
  padding: 11px 16px !important;
  background: var(--ink) !important;
  color: var(--paper) !important;
  border: none !important;
  border-radius: 0 !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  width: auto !important;
  margin: 0 !important;
}
.newsletter-embed input.btn:hover { background: var(--accent) !important; }
.newsletter-embed input.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.newsletter-embed .emailoctopus-success-message,
.newsletter-embed .emailoctopus-error-message { font-size: 0.8125rem; margin: 0 0 6px; }

/* "Powered by EmailOctopus" attribution — keep, but quiet it down */
.newsletter-embed .mastfoot { background: transparent; }
.newsletter-embed .mastfoot p { font-size: 0.6875rem; color: var(--muted); margin: 8px 0 0; }
.newsletter-embed .text-center { text-align: right; }

.newsletter-pending,
.newsletter-noscript { margin-left: auto; }

/* ---------- Footer ---------- */
footer {
  padding-block: 20px 40px;
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
footer a { text-decoration: none; }
footer a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- Articles & inner pages (same voice, quieter) ---------- */
.article { padding-block: 40px 48px; }

.article-header { max-width: 44rem; }

.article-header h1 {
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

.article-date { font-size: 0.75rem; color: var(--muted); margin: 0 0 24px; }

.article-art { aspect-ratio: 16 / 10; background: var(--faint); max-width: 44rem; margin-block: 0 24px; }

.prose { max-width: 40rem; font-size: 1rem; line-height: 1.7; }
.prose p { margin-block: 0 1em; }
.prose h2 {
  font-family: var(--display);
  font-size: 1.125rem;
  font-weight: 700;
  margin-block: 1.6em 0.4em;
}
.prose a { color: var(--accent); }
.prose img { background: var(--faint); }

.article-back { font-size: 0.75rem; letter-spacing: 0.04em; margin-top: 32px; }
.article-back a {
  text-decoration: none;
  border-bottom: 1px solid var(--muted);
  padding-bottom: 2px;
}
.article-back a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Almanac index: lead story large, the rest quiet rows ---------- */
.almanac-index { padding-block: 40px 48px; }

.almanac-index .index-entries { display: grid; gap: 28px; max-width: 44rem; }

.almanac-index .story .ph,
.almanac-index .story .art { aspect-ratio: 16 / 10; margin-bottom: 12px; }

.almanac-index .story h3 { font-size: 1.25rem; }

.almanac-index .story.secondary {
  border-top: 1px solid var(--faint);
  padding-top: 20px;
}
.almanac-index .story.secondary h3 { font-size: 1rem; }

/* ---------- Motion: none by design; guard future additions ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Tablet (≤960px): keep varied scale, loosen the 3-up grids ---------- */
@media (max-width: 960px) {
  .goods .items {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .goods .product.a { grid-column: 1 / -1; }
  .goods .product.a .ph,
  .goods .product.a .art { aspect-ratio: 16 / 10; }

  .almanac-stories .entries { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .almanac-stories .story.text-only { grid-column: 1 / -1; }

  .hero .info { padding: 28px 30px; }
}

/* ---------- Mobile (≤720px) ---------- */
@media (max-width: 720px) {
  .hero .frame { grid-template-columns: minmax(0, 1fr); }
  .hero .info { padding: 24px 20px 28px; }

  .goods .items { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  /* Alternating widths keep the varied scale instead of a uniform list */
  .goods .product.a { grid-column: auto; }
  .goods .product.a .ph,
  .goods .product.a .art { aspect-ratio: 4 / 5; }
  .goods .product.b { width: 82%; }
  .goods .product.c { width: 88%; margin-left: auto; }

  .almanac-stories .entries { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .almanac-stories .story.text-only { grid-column: auto; }

  .newsletter { flex-direction: column; align-items: flex-start; }
  .newsletter-embed { margin-left: 0; }
  .newsletter-pending, .newsletter-noscript { margin-left: 0; }

  .brand { flex-direction: column; align-items: flex-start; gap: 2px; }
  .tagline { margin-left: 0; }

  nav[aria-label="Main"] {
    width: 100%;
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
  }
  nav[aria-label="Main"] a { margin-left: 0; }
}
