/* FreshMart Direct — brand UI layer
   Presentation only. Never touches layout-critical store logic. */

:root {
  --fm-green-900: #0b4f2c;
  --fm-green-700: #0e6b3c;
  --fm-green-500: #178c4e;
  --fm-lime: #9ad34f;
  --fm-amber: #f5a524;
  --fm-cream: #faf7f0;
  --fm-sand: #f1ead9;
  --fm-ink: #10201a;
  --fm-muted: #55655c;
  --fm-line: #e6dfd0;
  --fm-radius: 18px;
  --fm-shadow: 0 10px 30px rgba(11, 79, 44, 0.08);
  --fm-shadow-lg: 0 18px 45px rgba(11, 79, 44, 0.15);

  /* Type system: a clean UI sans for interface text paired with an editorial
     display serif for titles — the pairing specialty grocers use. */
  --fm-font-sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --fm-font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;

  /* Reading-derived scale: 13 / 14 / 15 / 17 / 19 / 21px. */
  --fm-text-xs: 0.8125rem;
  --fm-text-sm: 0.875rem;
  --fm-text-base: 0.9375rem;
  --fm-text-lede: 1.0625rem;
  --fm-text-lg: 1.1875rem;
  --fm-text-xl: 1.3125rem;
  --fm-lh-tight: 1.15;
  --fm-lh-body: 1.72;
}

/* ---------- Type & page canvas ---------- */

body {
  font-family: var(--fm-font-sans);
  font-size: var(--fm-text-lede);
  line-height: var(--fm-lh-body);
  /* Give the storefront room to breathe instead of the default narrow column. */
  --wp--style--global--content-size: 1140px;
  --wp--style--global--wide-size: 1280px;
  background-color: var(--fm-cream);
  color: var(--fm-ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, .wp-block-post-title {
  font-family: var(--fm-font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: var(--fm-lh-tight);
  text-wrap: balance;
}

/* Fluid display scale: confident on desktop, never crowded on a phone. */
h1, .wp-block-post-title {
  font-size: clamp(2.1rem, 1.3rem + 2.7vw, 3.05rem);
}

h2 {
  font-size: clamp(1.6rem, 1.25rem + 1.4vw, 2.1rem);
}

h3 {
  font-size: clamp(1.3rem, 1.14rem + 0.6vw, 1.5rem);
}

h4 {
  font-size: 1.125rem;
}

h2, h3 {
  color: var(--fm-green-900);
}

/* Interface text keeps the sans face — controls, labels and product names
   read better without a serif. */
.fms-footer__head,
.fms-club__title,
.fms-club__kicker,
.fms-drawer__head h2,
.fm-card__title,
.fms-pill,
.fms-linkbtn,
button,
input,
select,
textarea {
  font-family: var(--fm-font-sans);
}

/* The front page starts with its own hero — drop the theme's duplicate page title. */
body.home .wp-block-post-title {
  display: none;
}

p, li {
  line-height: var(--fm-lh-body);
}

/* Long-form prose — policies, shipping and about pages — gets a
   comfortable measure so paragraphs never run the full page width. */
.entry-content > p,
.wp-block-post-content > p,
.entry-content > ul,
.wp-block-post-content > ul {
  max-width: 74ch;
}

a {
  color: var(--fm-green-700);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--fm-green-500);
}

.wp-site-blocks {
  padding-top: 0;
  /* The header/footer chrome sits outside this wrapper and is full-bleed with its
     own 22px side gutter (.fms-wrap). The theme's root padding here would push
     the body out of line with it, so the gutter lives on <main> instead. */
  padding-left: 0;
  padding-right: 0;
}

/* The FreshMart chrome (smoke bar + masthead + aisle strip) sits in the normal
   flow, so the stock theme's "clear the header" top spacer is pure dead space.
   Trim it so content follows the aisle strip immediately. */
.wp-site-blocks main.wp-block-group {
  margin-top: 0 !important;
}

.wp-site-blocks main.wp-block-group > .wp-block-group.alignfull[style*="spacing--60"] {
  padding-top: 0 !important;
}

::selection {
  background: var(--fm-lime);
  color: var(--fm-ink);
}

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

/* The theme's own header template part is the only <header> these brand tokens
   should paint: the storefront uses <header> for its own shelf and guarantee
   headings, so an unscoped selector bleeds the emerald band across all of them. */
header.wp-block-template-part {
  background: var(--fm-green-900);
  color: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

header.wp-block-template-part .wp-block-site-title,
header.wp-block-template-part .wp-block-site-title a,
.wp-site-blocks footer .wp-block-site-title,
.wp-site-blocks footer .wp-block-site-title a {
  font-family: var(--fm-font-sans);
}

header.wp-block-template-part .wp-block-site-title a {
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  text-decoration: none;
}

header.wp-block-template-part .wp-block-site-title::after {
  content: ".";
  color: var(--fm-lime);
  font-weight: 800;
}

.wp-block-navigation .wp-block-navigation-item__content {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--fm-ink);
  padding: 6px 10px;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease;
}

.wp-block-navigation .wp-block-navigation-item__content:hover,
.wp-block-navigation .current-menu-item > .wp-block-navigation-item__content {
  background: var(--fm-sand);
  color: var(--fm-green-900);
}

/* The header band is brand green, so its links flip to light-on-dark and the
   hover pill becomes a translucent white instead of sand-on-dark. */
header.wp-block-template-part .wp-block-navigation .wp-block-navigation-item__content {
  color: rgba(255, 255, 255, 0.88);
}

header.wp-block-template-part .wp-block-navigation .wp-block-navigation-item__content:hover,
header.wp-block-template-part .wp-block-navigation .wp-block-navigation-item__content:focus-visible,
header.wp-block-template-part .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* ---------- Buttons ---------- */

.wp-block-button__link,
.wp-element-button,
button:not(.components-button):not(.wp-block-navigation__submenu-icon),
input[type="submit"] {
  font-family: inherit;
  font-weight: 700;
  letter-spacing: 0.01em;
  border-radius: 12px;
  background-color: var(--fm-green-700);
  color: #fff;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

/* Hover only lifts + brightens, so buttons that carry their own inline brand
   colour (hero CTA, promo band) keep that colour instead of turning green. */
.wp-block-button__link:hover,
.wp-element-button:hover,
button:not(.components-button):hover,
input[type="submit"]:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 10px 22px rgba(14, 107, 60, 0.22);
}

.wp-block-button.is-style-outline .wp-block-button__link,
.wp-element-button.is-style-outline {
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  color: #fff;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.wp-block-buttons {
  gap: 0.75rem;
}

/* ---------- Layout width ---------- */

/* The FreshMart chrome (masthead, aisle strip, footer) runs edge-to-edge, and its
   own inner gutter lands that chrome's content 44px in from the viewport edge on
   desktop and 16px on phones. The stock block theme centres the page body in a
   narrow reading column instead, leaving every page recessed between two full-bleed
   bands. Below, the body is put on the chrome's grid: <main> owns a single gutter,
   and the theme's root-padding offset is dropped so it can no longer push bands
   past the viewport. */
@media (min-width: 782px) {
  .wp-site-blocks .is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
    max-width: none;
  }
}

:root {
  /* Body gutter — same line the chrome's content sits on: 44px, 16px on phones. */
  --fm-body-gutter: 44px;
}

.wp-site-blocks main {
  padding-left: var(--fm-body-gutter);
  padding-right: var(--fm-body-gutter);
}

/* WordPress insets each full-width band by the theme's root padding and cancels it
   with an equal negative margin, then repeats that at every nesting level — which
   pushed bands ~28px past the viewport edge and compounded page content off-screen.
   Nested wrappers no longer add that offset, and a band keeps its own background
   rather than a per-section horizontal inset: its content sits on the shared gutter.
   (The padding needs !important — band wrappers carry the theme's padding inline.) */
.wp-site-blocks main .alignfull,
.wp-site-blocks main .has-global-padding {
  margin-left: 0;
  margin-right: 0;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Full-width bands still reach both viewport edges — by cancelling exactly the
   <main> gutter and never more, so the document stays viewport-wide. */
.wp-site-blocks main > .alignfull {
  margin-left: calc(-1 * var(--fm-body-gutter));
  margin-right: calc(-1 * var(--fm-body-gutter));
  padding-left: var(--fm-body-gutter) !important;
  padding-right: var(--fm-body-gutter) !important;
}

@media (max-width: 720px) {
  :root {
    --fm-body-gutter: 16px;
  }
}

/* ---------- Cards, images, forms ---------- */

.wp-block-image img,
.wp-block-post-featured-image img {
  border-radius: var(--fm-radius);
}

.wp-block-columns > .wp-block-column > .wp-block-group,
.wp-block-column.is-layout-constrained > .wp-block-group {
  border-radius: var(--fm-radius);
}

/* Keep card copy legible in narrow columns — no mid-word breaks. */
.wp-block-column p {
  font-size: 0.95rem;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  text-wrap: pretty;
}

/* Cards get the lift; full-width colour bands (hero, promo) stay flat. */
.wp-block-column > .wp-block-group.has-background,
.wp-block-columns .wp-block-group.has-background:not(.alignfull) {
  box-shadow: var(--fm-shadow);
}

input[type="text"],
input[type="email"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="password"],
input[type="number"],
select,
textarea {
  font-family: inherit;
  border: 1px solid var(--fm-line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  color: var(--fm-ink);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--fm-lime);
  outline-offset: 2px;
}

/* ---------- WooCommerce surfaces ---------- */

.wp-block-woocommerce-product-template li,
ul.wc-block-grid__products li {
  border-radius: var(--fm-radius);
  overflow: hidden;
}

.wc-block-components-button,
.wc-block-components-button:not(.is-link) {
  border-radius: 12px;
  font-weight: 700;
  background-color: var(--fm-green-700);
  color: #fff;
}

.wc-block-components-button:hover:not(.is-link) {
  background-color: var(--fm-green-500);
  color: #fff;
}

.wc-block-components-price ins,
.price ins {
  color: var(--fm-green-700);
  text-decoration: none;
  font-weight: 700;
}

.wc-block-components-notice-banner {
  border-radius: 14px;
}

/* ---------- Posts & page furniture ---------- */

.wp-block-post-title a,
.entry-title a {
  text-decoration: none;
  color: var(--fm-green-900);
}

.wp-block-post-date,
.wp-block-post-terms,
.wp-block-post-author {
  color: var(--fm-muted);
  font-size: 0.85rem;
}

.wp-block-post-template .wp-block-post {
  background: #fff;
  border: 1px solid var(--fm-line);
  border-radius: var(--fm-radius);
  padding: 24px;
  box-shadow: var(--fm-shadow);
}

hr.wp-block-separator {
  border-color: var(--fm-line);
}

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

.wp-site-blocks footer,
footer.wp-block-template-part {
  background: var(--fm-green-900);
  color: rgba(255, 255, 255, 0.86);
  margin-top: 0;
}

.wp-site-blocks footer a,
footer.wp-block-template-part a {
  color: #fff;
  text-decoration: none;
  opacity: 0.88;
}

.wp-site-blocks footer a:hover,
footer.wp-block-template-part a:hover {
  opacity: 1;
  color: var(--fm-lime);
}

.wp-site-blocks footer .wp-block-site-title a {
  font-weight: 800;
  letter-spacing: -0.03em;
}

.wp-site-blocks footer h2,
.wp-site-blocks footer h3 {
  color: #fff;
}

.wp-site-blocks footer .wp-block-navigation .wp-block-navigation-item__content {
  color: rgba(255, 255, 255, 0.86);
  padding-left: 0;
}

.wp-site-blocks footer .wp-block-navigation .wp-block-navigation-item__content:hover {
  background: transparent;
  color: var(--fm-lime);
}

/* ---------- Placeholder links ---------- */

/* Keep dead "not built yet" links out of the storefront chrome. */
header.wp-block-template-part .wp-block-navigation-item:has(a[href*="sample-page"]) {
  display: none;
}

/* The demo footer columns all point at "#" — hide the block instead of
   shipping eight dead links next to the brand. */
.wp-site-blocks footer .wp-block-navigation:has(a[href="#"]) {
  display: none;
}

/* ---------- Small screens ---------- */

/* The brand bands carry their spacing inline in the block markup, so the
   mobile overrides below are scoped to .wp-block-group and win on specificity
   without touching buttons that share the same brand colour. */
@media (max-width: 600px) {
  :root {
    --fm-radius: 14px;
  }

  header.wp-block-template-part .wp-block-navigation .wp-block-navigation-item__content {
    font-size: 0.9rem;
  }

  header.wp-block-template-part {
    padding-top: 12px !important;
    padding-bottom: 12px !important;
  }

  /* Hero band */
  .wp-block-group[style*="background-color:#0b4f2c"] {
    padding-top: 44px !important;
    padding-bottom: 44px !important;
  }

  /* Aisle section + value props */
  .wp-block-group[style*="padding-top:72px"],
  .wp-block-group[style*="padding-top:64px"] {
    padding-top: 36px !important;
    padding-bottom: 36px !important;
  }

  /* Promo band */
  .wp-block-group[style*="background-color:#f1ead9"] {
    padding-top: 32px !important;
    padding-bottom: 32px !important;
  }

  /* Aisle cards */
  .wp-block-group[style*="padding-top:28px"] {
    padding-top: 22px !important;
    padding-bottom: 22px !important;
  }

  .wp-block-columns {
    gap: 14px;
  }
}


/* ---------- WooCommerce "coming soon" (store-only) screens ----------
   While the store is unpublished, WooCommerce wraps the entire document —
   header, content and footer — inside .wp-block-woocommerce-coming-soon, so
   the chrome rules above must not assume a direct-child relationship, and the
   wrapped screen gets the brand hero treatment instead of the stock palette. */
.wp-block-woocommerce-coming-soon .has-cardo-font-family,
.wp-block-woocommerce-coming-soon .has-inter-font-family {
  font-family: var(--fm-font-sans) !important;
}

.wp-block-woocommerce-coming-soon .wp-block-group:has(> h1) {
  background-color: var(--fm-green-900);
  background-image: radial-gradient(circle at 12% 8%, rgba(154, 211, 79, 0.22), transparent 55%);
  padding: 84px 24px;
  min-height: 58vh;
  justify-content: center;
}

.wp-block-woocommerce-coming-soon h1 {
  color: #ffffff;
  font-weight: 700;
  letter-spacing: -0.02em;
  max-width: 20ch;
  margin-inline: auto;
}

.wp-block-woocommerce-coming-soon .has-inter-font-family {
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.05rem;
  max-width: 46ch;
  margin-inline: auto;
}

.wp-block-woocommerce-coming-soon .wp-block-spacer {
  height: 22px !important;
}

@media (max-width: 600px) {
  .wp-block-woocommerce-coming-soon .wp-block-group:has(> h1) {
    padding: 56px 20px;
    min-height: 50vh;
  }
}

/* ---------- Editorial pages (About, returns, policies) ---------------- */
:where(.entry-content, .wp-block-post-content, .fm-prose) > p {
  font-size: 1.0625rem;
  line-height: 1.72;
  color: #33443b;
  max-width: 68ch;
  margin: 0 0 16px;
}

:where(.entry-content, .wp-block-post-content, .fm-prose) > p.fm-lede {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.12rem, 0.6vw + 1rem, 1.3rem);
  line-height: 1.6;
  font-weight: 500;
  color: #10201a;
  max-width: 70ch;
  margin: 0 0 26px;
  padding-left: 18px;
  border-left: 3px solid var(--fm-amber, #f5a524);
}

:where(.entry-content, .wp-block-post-content, .fm-prose) > h2 {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.32rem, 1.1vw + 1.05rem, 1.72rem);
  line-height: 1.25;
  font-weight: 600;
  color: var(--fm-green-900, #0b4f2c);
  margin: 38px 0 12px;
  max-width: 30ch;
}

:where(.entry-content, .wp-block-post-content, .fm-prose) > h2:first-child {
  margin-top: 0;
}

:where(.entry-content, .wp-block-post-content, .fm-prose) > h3 {
  font-size: 1.12rem;
  font-weight: 700;
  color: #10201a;
  margin: 26px 0 10px;
}

:where(.entry-content, .wp-block-post-content, .fm-prose) > ul,
:where(.entry-content, .wp-block-post-content, .fm-prose) > ol {
  max-width: 68ch;
  margin: 0 0 20px;
  padding-left: 1.15em;
  display: grid;
  gap: 9px;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: #33443b;
}

:where(.entry-content, .wp-block-post-content, .fm-prose) > p a,
:where(.entry-content, .wp-block-post-content, .fm-prose) > ul a {
  color: var(--fm-green-900, #0b4f2c);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

:where(.entry-content, .wp-block-post-content, .fm-prose) > p a:hover,
:where(.entry-content, .wp-block-post-content, .fm-prose) > ul a:hover {
  color: #14703f;
}

:where(.entry-content, .wp-block-post-content, .fm-prose) > p strong,
:where(.entry-content, .wp-block-post-content, .fm-prose) > ul strong {
  color: #10201a;
}

@media (max-width: 600px) {
  :where(.entry-content, .wp-block-post-content, .fm-prose) > p,
  :where(.entry-content, .wp-block-post-content, .fm-prose) > ul,
  :where(.entry-content, .wp-block-post-content, .fm-prose) > ol {
    font-size: 1rem;
  }

  :where(.entry-content, .wp-block-post-content, .fm-prose) > p.fm-lede {
    padding-left: 14px;
    margin-bottom: 20px;
  }

  :where(.entry-content, .wp-block-post-content, .fm-prose) > h2 {
    margin-top: 28px;
  }
}
