/*
Theme Name: Osemu-Ehis Farms
Theme URI: https://osemuehisfarms.com
Author: Osemu-Ehis Farms
Author URI: https://osemuehisfarms.com
Description: A photography-led Full Site Editing block theme for Osemu-Ehis Farms — a farm growing plantain, cocoa, maize, yam and guinea fowl, and producer of Farfa Unripe Plantain Flour in Edo State, Nigeria.
Version: 2.0.0
Requires at least: 6.4
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ehis-farms

This theme, like WordPress, is licensed under the GPL.
*/

/* ===========================================================================
   Base
   =========================================================================== */
:root {
  --ehis-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ehis-radius: 4px;
  --ehis-shadow: 0 18px 50px -28px rgba(23, 61, 29, 0.55);
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html { scroll-behavior: smooth; }
/* offset anchored sections from the sticky glass header */
:where([id]) { scroll-margin-top: 6rem; }

/* Optical sizing for Fraunces wherever it appears */
h1, h2, h3, h4, h5, h6,
.wp-block-site-title,
.wp-block-post-title {
  font-optical-sizing: auto;
}

::selection {
  background: var(--wp--preset--color--gold);
  color: var(--wp--preset--color--ink);
}

/* Top-level blocks (header / main / footer) own their spacing — no inter-block
   gap, so the hero sits flush under the header. */
.wp-site-blocks > * {
  margin-block-start: 0;
  margin-block-end: 0;
}

/* ===========================================================================
   Signature: the "stem" eyebrow
   A short gold rule + uppercase kicker that introduces each section,
   echoing a plantain stem rising from the soil.
   =========================================================================== */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0 0 1.1rem;
  font-family: var(--wp--preset--font-family--body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--wp--preset--color--gold);
}
.eyebrow::before {
  content: "";
  width: 2.4rem;
  height: 2px;
  background: currentColor;
  flex: none;
}
/* When centered, give the stem a leaf on both sides */
.has-text-align-center .eyebrow,
.eyebrow.is-centered {
  justify-content: center;
}
.eyebrow.is-centered::after {
  content: "";
  width: 2.4rem;
  height: 2px;
  background: currentColor;
  flex: none;
}
/* On dark sections the kicker reads in gold over forest — keep it */
.has-forest-background-color .eyebrow,
.wp-block-cover .eyebrow {
  color: var(--wp--preset--color--gold);
}

/* ===========================================================================
   Type rhythm
   =========================================================================== */
.lead {
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  line-height: 1.6;
  letter-spacing: -0.01em;
}
.serif-accent {
  font-family: var(--wp--preset--font-family--display);
  font-style: italic;
  font-weight: 400;
}
.wp-block-heading strong { color: var(--wp--preset--color--gold); font-weight: inherit; }

/* ===========================================================================
   Header — glass, sticky
   =========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(58, 45, 31, 0.1);
}
/* Glass blur lives on a pseudo-element, NOT the header itself. backdrop-filter
   on the header would establish a containing block that traps the navigation's
   position:fixed mobile overlay (its links became unclickable). */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(250, 247, 239, 0.72);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  backdrop-filter: saturate(150%) blur(14px);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header::before { background: var(--wp--preset--color--canvas); }
}

/* Contact link in header, with a glowing/pulsing dot on the right */
.nav-contact {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--wp--preset--font-family--body);
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--wp--preset--color--forest);
  text-decoration: none;
  white-space: nowrap;
  /* match the nav items' box metrics so the text aligns vertically */
  padding-bottom: 2px;
  border-bottom: 1.5px solid transparent;
  transition: color 0.25s var(--ehis-ease);
}
.nav-contact:hover { color: var(--wp--preset--color--leaf); }
.nav-dot {
  position: relative;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--wp--preset--color--leaf);
  box-shadow: 0 0 6px rgba(45, 139, 65, 0.8);
  flex: none;
}
.nav-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--wp--preset--color--leaf);
  animation: ehis-pulse 2s ease-out infinite;
}
@keyframes ehis-pulse {
  0%   { transform: scale(1);   opacity: 0.7; }
  70%  { transform: scale(2.8); opacity: 0; }
  100% { transform: scale(2.8); opacity: 0; }
}

/* Leaf mark to the left of the site title */
.site-mark {
  display: block;
  width: 34px;
  height: 34px;
  flex: none;
}
@media (max-width: 480px) {
  .site-mark { width: 30px; height: 30px; }
}

.wp-block-template-part header .wp-block-navigation a,
header.wp-block-group .wp-block-navigation a {
  text-decoration: none;
}
.wp-block-navigation .wp-block-navigation-item__content {
  padding-bottom: 2px;
  border-bottom: 1.5px solid transparent;
  transition: border-color 0.25s var(--ehis-ease), color 0.25s var(--ehis-ease);
}
.wp-block-navigation .wp-block-navigation-item:hover .wp-block-navigation-item__content,
.wp-block-navigation .current-menu-item .wp-block-navigation-item__content {
  border-color: var(--wp--preset--color--gold);
}

/* ===========================================================================
   Buttons
   =========================================================================== */
.wp-block-button__link {
  transition: transform 0.25s var(--ehis-ease), background-color 0.25s var(--ehis-ease), color 0.25s var(--ehis-ease), box-shadow 0.25s var(--ehis-ease);
  will-change: transform;
}
.wp-block-button__link:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -14px rgba(23, 61, 29, 0.6);
}
/* Outline buttons (used on dark hero) */
.wp-block-button.is-style-outline .wp-block-button__link {
  border: 1.5px solid rgba(255, 255, 255, 0.65);
  background: transparent;
  color: #fff;
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: #fff;
  color: var(--wp--preset--color--forest);
  border-color: #fff;
}

/* ===========================================================================
   Hero (cover block)
   =========================================================================== */
.ehis-hero {
  align-items: flex-end;
}
.ehis-hero .wp-block-cover__inner-container {
  width: 100%;
}
.ehis-hero h1 {
  color: #fff;
  text-shadow: 0 2px 30px rgba(11, 33, 16, 0.55);
  max-width: 16ch;
}
.ehis-hero p:not(.eyebrow) {
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 1px 16px rgba(11, 33, 16, 0.6);
}
/* Brighten the eyebrow so it reads over the bright foliage */
.ehis-hero .eyebrow {
  color: #eccf63;
  text-shadow: 0 1px 14px rgba(11, 33, 16, 0.8);
}

/* ===========================================================================
   Image treatments
   =========================================================================== */
.wp-block-image img,
.wp-block-cover {
  border-radius: var(--ehis-radius);
}
.wp-block-image.is-style-rounded img { border-radius: 10px; }

/* Framed image — sits in a column beside text, with a subtle lift */
.img-frame {
  margin: 0;
  height: 100%;
}
.img-frame img {
  width: 100%;
  height: 100%;
  min-height: 340px;
  max-height: 560px;
  object-fit: cover;
  box-shadow: var(--ehis-shadow);
  border-radius: var(--ehis-radius);
}

/* ===========================================================================
   Crop / feature cards
   =========================================================================== */
.crop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}
.crop-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--ehis-radius);
  min-height: clamp(380px, 34vw, 480px);
  display: flex;
  align-items: flex-end;
  isolation: isolate;
  color: #fff;
}
.crop-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  transition: transform 0.7s var(--ehis-ease);
}
.crop-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(11, 33, 16, 0) 30%, rgba(11, 33, 16, 0.82) 100%);
}
.crop-card:hover img { transform: scale(1.06); }
.crop-card__body {
  padding: 1.4rem 1.5rem 1.5rem;
}
.crop-card__body h3 { color: #fff; margin: 0 0 0.35rem; }
.crop-card__body p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
}

/* ===========================================================================
   Stat / credibility strip
   =========================================================================== */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  background: rgba(201, 162, 39, 0.4);
  border: 1px solid rgba(201, 162, 39, 0.4);
  border-radius: var(--ehis-radius);
  overflow: hidden;
}
.stat {
  background: var(--wp--preset--color--canvas);
  padding: 2rem 1.5rem;
  text-align: center;
}
.stat__num {
  display: block;
  font-family: var(--wp--preset--font-family--display);
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 1;
  color: var(--wp--preset--color--forest);
}
.stat__label {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wp--preset--color--soil);
}

/* ===========================================================================
   Process steps (a real, ordered sequence: harvest -> dry -> mill -> pack)
   =========================================================================== */
.process-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--ehis-radius);
  overflow: hidden;
}
.process-steps li {
  background: var(--wp--preset--color--forest);
  padding: 1.75rem 1.5rem;
}
.process-steps__n {
  display: block;
  font-family: var(--wp--preset--font-family--display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--wp--preset--color--gold);
  letter-spacing: 0.04em;
  margin-bottom: 0.85rem;
}
.process-steps h3 {
  color: #fff;
  margin: 0 0 0.4rem;
  font-size: 1.25rem;
}
.process-steps p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
}

/* ===========================================================================
   Fast facts (plantain flour page badges)
   =========================================================================== */
.facts {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.facts li {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--wp--preset--color--forest);
  background: var(--wp--preset--color--mist);
  border: 1px solid rgba(45, 139, 65, 0.28);
  border-radius: 100px;
  padding: 0.45rem 0.95rem;
}

/* Nutrition fast-stat grid */
.nutri {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: rgba(58, 45, 31, 0.12);
  border: 1px solid rgba(58, 45, 31, 0.12);
  border-radius: var(--ehis-radius);
  overflow: hidden;
}
.nutri li {
  background: var(--wp--preset--color--white);
  padding: 1.5rem 1rem;
  text-align: center;
}
.nutri b {
  display: block;
  font-family: var(--wp--preset--font-family--display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--wp--preset--color--forest);
  line-height: 1.1;
}
.nutri span {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.82rem;
  color: var(--wp--preset--color--soil);
}

/* ===========================================================================
   Benefit list (plantain flour page)
   =========================================================================== */
.benefit-list { list-style: none; margin: 0; padding: 0; }
.benefit-list li {
  position: relative;
  padding: 0 0 1.1rem 2rem;
  margin: 0 0 1.1rem;
  border-bottom: 1px solid rgba(58, 45, 31, 0.12);
  line-height: 1.6;
}
.benefit-list li:last-child { border-bottom: none; }
.benefit-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--wp--preset--color--leaf);
  box-shadow: 0 0 0 4px rgba(45, 139, 65, 0.18);
}

/* ===========================================================================
   Dynamic gallery
   =========================================================================== */
.ehis-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.ehis-gallery__item {
  /* it is a <button> — reset, then style as a tile */
  margin: 0;
  padding: 0;
  border: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  width: 100%;
  display: block;
  cursor: zoom-in;
  position: relative;
  overflow: hidden;
  border-radius: var(--ehis-radius);
  background: var(--wp--preset--color--mist);
  aspect-ratio: 4 / 3;
}
.ehis-gallery__item:focus-visible {
  outline: 3px solid var(--wp--preset--color--gold);
  outline-offset: 3px;
}
.ehis-gallery__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ehis-ease);
}
.ehis-gallery__item:hover .ehis-gallery__img { transform: scale(1.05); }
/* Tile captions are shown in the lightbox instead — keep the grid images clean
   (no dark overlay band). The text stays for screen readers. */
.ehis-gallery__caption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.ehis-gallery__empty {
  text-align: center;
  font-size: 1.15rem;
  color: var(--wp--preset--color--soil);
  padding: 3rem 1rem;
}

/* ===========================================================================
   Lightbox / carousel (built by assets/js/lightbox.js)
   =========================================================================== */
.ehis-lb {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 33, 16, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s var(--ehis-ease), visibility 0.25s var(--ehis-ease);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.ehis-lb.is-open {
  opacity: 1;
  visibility: visible;
}
.ehis-lb__stage {
  max-width: min(92vw, 1400px);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}
.ehis-lb__img {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--ehis-radius);
}
.ehis-lb__caption {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  text-align: center;
}
.ehis-lb__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s var(--ehis-ease);
}
.ehis-lb__btn:hover { background: rgba(255, 255, 255, 0.28); }
.ehis-lb__prev { left: clamp(0.5rem, 3vw, 2rem); }
.ehis-lb__next { right: clamp(0.5rem, 3vw, 2rem); }
.ehis-lb__close {
  position: absolute;
  top: clamp(0.75rem, 3vw, 1.5rem);
  right: clamp(0.75rem, 3vw, 1.5rem);
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.ehis-lb__close:hover { background: rgba(255, 255, 255, 0.28); }
.ehis-lb__count {
  position: absolute;
  top: clamp(0.85rem, 3vw, 1.65rem);
  left: clamp(0.75rem, 3vw, 1.5rem);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
}
.ehis-lb__btn:focus-visible,
.ehis-lb__close:focus-visible {
  outline: 3px solid var(--wp--preset--color--gold);
  outline-offset: 2px;
}
body.ehis-lb-open { overflow: hidden; }

@media (max-width: 600px) {
  .ehis-lb__btn { width: 42px; height: 42px; font-size: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ehis-lb { transition: none; }
}

/* ===========================================================================
   Floating WhatsApp button
   =========================================================================== */
.ehis-wa {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 999;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #25d366;
  color: #fff;
  border-radius: 50%;
  box-shadow: 0 8px 24px -6px rgba(11, 33, 16, 0.45);
  transition: transform 0.25s var(--ehis-ease), box-shadow 0.25s var(--ehis-ease);
}
.ehis-wa:hover {
  transform: translateY(-3px) scale(1.04);
  color: #fff;
  box-shadow: 0 12px 30px -8px rgba(11, 33, 16, 0.55);
}
.ehis-wa:focus-visible {
  outline: 3px solid var(--wp--preset--color--gold);
  outline-offset: 3px;
}

/* ===========================================================================
   Footer
   =========================================================================== */
footer .wp-block-navigation a { text-decoration: none; }
footer .wp-block-navigation a:hover { text-decoration: underline; }
footer .wp-block-navigation { gap: 0.55rem; }

/* ===========================================================================
   Accessibility & responsive
   =========================================================================== */
a:focus-visible,
.wp-block-button__link:focus-visible,
.wp-block-navigation a:focus-visible {
  outline: 3px solid var(--wp--preset--color--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

@media (max-width: 781px) {
  .ehis-hero { align-items: center; }
  .ehis-hero h1 { max-width: none; }
  .ehis-gallery { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .crop-card:hover img,
  .ehis-gallery__item:hover .ehis-gallery__img { transform: none; }
}
