/* ==========================================================================
   base.css  -  the one shared stylesheet of the Earthgrid framework.
   Colours and fonts are NOT here. They are tokens (CSS variables) set by the
   chosen style: css/styles/light.css, dark.css or nature.css, and by the
   "tokens" and "fonts" keys of data/site.json.

   Contents
     1  Tokens (neutral defaults, a style overrides them)
     2  Base
     3  Layout helpers and type
     4  Buttons
     5  Header and menu
     6  Hero
     7  Sections and tones
     8  Features, cards, gallery, quotes, stats, split
     9  Forms, FAQ, video, contact
    10 Footer
    11 Lightbox
    12 Motion
   Page-only rules live in css/pages/<slug>.css (linked automatically).
   ========================================================================== */

/* 1  Tokens -------------------------------------------------------------- */
:root {
  --eg-bg:        #ffffff;
  --eg-bg-alt:    #f5f3ee;
  --eg-surface:   #ffffff;
  --eg-text:      #2b2b2b;
  --eg-muted:     #666666;
  --eg-heading:   #1b1b1b;
  --eg-accent:    #d9731a;
  --eg-accent-ink:#ffffff;
  --eg-accent-2:  #2f6f5e;
  --eg-line:      rgba(0, 0, 0, .12);
  --eg-header-bg: rgba(255, 255, 255, .96);
  --eg-header-text:#1b1b1b;
  --eg-inverse-bg:#1f2a2e;
  --eg-inverse-text:#f1f1ee;
  --eg-footer-bg: #1f2a2e;
  --eg-footer-text:#d8dcdc;
  --eg-hero-overlay: rgba(10, 20, 20, .55);
  --eg-radius:    14px;
  --eg-shadow:    0 6px 24px rgba(0, 0, 0, .10);
  --eg-font-head: Georgia, "Times New Roman", serif;
  --eg-font-body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --eg-header-h:  72px;
  --eg-wrap:      1160px;
  --eg-ease:      cubic-bezier(.22, .61, .36, 1);
}

/* 2  Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--eg-header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--eg-font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--eg-text);
  background: var(--eg-bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--eg-font-head); line-height: 1.2; color: var(--eg-heading); margin: 0 0 .5em; }
p { margin: 0 0 1em; }
img, video { max-width: 100%; height: auto; display: block; }
picture { display: block; }
a { color: var(--eg-accent); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }
ul { margin: 0; padding: 0; list-style: none; }
address { font-style: normal; }
:focus-visible { outline: 3px solid var(--eg-accent); outline-offset: 3px; }
::selection { background: var(--eg-accent); color: var(--eg-accent-ink); }
main { display: block; }
.eg-skip { position: absolute; left: -999px; top: 8px; z-index: 3000; padding: .5rem 1rem; background: #fff; color: #000; border-radius: .5rem; }
.eg-skip:focus { left: 8px; }
.eg-ico { width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: none; }
.eg-ico-lg { width: 1.6em; height: 1.6em; }
.eg-ico-xl { width: 2.6rem; height: 2.6rem; }
.eg-pre { text-align: left; overflow: auto; padding: 1rem; background: var(--eg-bg-alt); border-radius: 8px; }

/* 3  Layout helpers and type --------------------------------------------- */
.eg-wrap { width: 100%; max-width: var(--eg-wrap); margin: 0 auto; padding: 0 20px; }
.eg-narrow { max-width: 820px; }
.eg-centre { text-align: center; }
.eg-left { text-align: left; }
.eg-eyebrow { display: block; margin-bottom: .6rem; font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--eg-accent); }
.eg-title { font-size: clamp(1.8rem, 1.2rem + 2.4vw, 2.8rem); }
.eg-lead { font-size: 1.2rem; color: var(--eg-muted); }
.eg-body { font-size: 1.0625rem; }
.eg-more { margin-top: 1rem; font-weight: 600; }
.eg-head { max-width: 760px; margin: 0 auto 2.5rem; text-align: center; }
.eg-head.eg-left { margin-left: 0; text-align: left; }
.eg-note { margin-top: .8rem; font-size: .9rem; color: var(--eg-muted); }

/* 4  Buttons ------------------------------------------------------------- */
.eg-btn {
  display: inline-block; padding: .85rem 1.7rem; border: 2px solid transparent; border-radius: 999px;
  font: 700 .95rem/1.2 var(--eg-font-body); letter-spacing: .06em; text-transform: uppercase; text-align: center; text-decoration: none; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s var(--eg-ease);
}
.eg-btn:hover, .eg-btn:focus { text-decoration: none; transform: translateY(-2px); }
.eg-btn-primary { background: var(--eg-accent); border-color: var(--eg-accent); color: var(--eg-accent-ink); }
.eg-btn-primary:hover, .eg-btn-primary:focus { filter: brightness(1.08); color: var(--eg-accent-ink); }
.eg-btn-ghost { background: transparent; border-color: currentColor; color: inherit; }
.eg-btn-ghost:hover, .eg-btn-ghost:focus { background: rgba(255, 255, 255, .14); color: inherit; }
.eg-btn-light { background: #fff; border-color: #fff; color: #1b1b1b; }
.eg-btn-light:hover, .eg-btn-light:focus { color: #1b1b1b; filter: brightness(.95); }
.eg-btn-sm { padding: .55rem 1.1rem; font-size: .8rem; }
.eg-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.5rem; }
.eg-actions-centre { justify-content: center; }

/* 5  Header and menu ----------------------------------------------------- */
.eg-header { position: sticky; top: 0; z-index: 1000; background: var(--eg-header-bg); color: var(--eg-header-text); box-shadow: 0 1px 0 var(--eg-line); transition: box-shadow .3s; }
.eg-header.is-scrolled { box-shadow: 0 6px 24px rgba(0, 0, 0, .18); }
@supports ((-webkit-backdrop-filter: blur(8px)) or (backdrop-filter: blur(8px))) {
  .eg-header { -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
}
.eg-header-in { display: flex; align-items: center; justify-content: space-between; min-height: var(--eg-header-h); gap: 1rem; }
.eg-brand { display: inline-flex; align-items: center; color: inherit; font: 700 1.3rem/1 var(--eg-font-head); text-decoration: none; }
.eg-brand:hover { text-decoration: none; }
.eg-logo { max-height: 52px; width: auto; }
.eg-nav { display: flex; align-items: center; gap: .4rem; }
.eg-nav > ul { display: flex; align-items: center; gap: .2rem; }
.eg-nav a, .eg-dd-toggle {
  display: block; padding: .6rem .8rem; color: var(--eg-header-text); font: 600 .95rem/1.2 var(--eg-font-body);
  background: none; border: 0; cursor: pointer; text-decoration: none;
}
.eg-nav a:hover, .eg-dd-toggle:hover { color: var(--eg-accent); text-decoration: none; }
.eg-nav a.is-current { box-shadow: inset 0 -3px 0 var(--eg-accent); }
.eg-nav .eg-nav-cta { margin-left: .8rem; color: var(--eg-accent-ink); }
.eg-nav .eg-nav-cta:hover { color: var(--eg-accent-ink); }
.eg-dd { position: relative; }
.eg-dd-toggle::after { content: ""; display: inline-block; margin-left: .45em; border: 4px solid transparent; border-top-color: currentColor; border-bottom: 0; vertical-align: .15em; }
.eg-dd-menu {
  display: none; position: absolute; top: 100%; left: 0; z-index: 20; min-width: 240px; padding: .5rem 0;
  background: var(--eg-surface); color: var(--eg-text); border: 1px solid var(--eg-line); border-radius: 12px; box-shadow: var(--eg-shadow);
}
.eg-dd-menu li { display: block; }
.eg-dd-menu a { padding: .6rem 1.1rem; color: var(--eg-text); white-space: nowrap; }
.eg-dd-menu a:hover { background: var(--eg-bg-alt); color: var(--eg-accent); }
.eg-dd:hover > .eg-dd-menu, .eg-dd:focus-within > .eg-dd-menu, .eg-dd.is-open > .eg-dd-menu { display: block; }
.eg-burger { display: none; width: 44px; height: 44px; padding: 10px; background: none; border: 0; cursor: pointer; }
.eg-burger span { display: block; height: 3px; margin: 5px 0; background: var(--eg-header-text); border-radius: 2px; transition: transform .25s, opacity .25s; }
.eg-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.eg-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.eg-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 960px) {
  .eg-burger { display: block; }
  .eg-nav { display: block; }
  .js .eg-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; max-height: calc(100vh - var(--eg-header-h)); overflow-y: auto; padding: .5rem 20px 1.2rem; background: var(--eg-header-bg); box-shadow: 0 12px 24px rgba(0, 0, 0, .18); }
  .js .eg-nav.is-open { display: block; }
  .eg-nav > ul { flex-direction: column; align-items: stretch; gap: 0; }
  .eg-nav > ul > li { border-bottom: 1px solid var(--eg-line); }
  .eg-nav a, .eg-dd-toggle { width: 100%; padding: .9rem .2rem; text-align: left; }
  .eg-dd-menu { position: static; display: none; min-width: 0; padding: 0 0 .5rem 1rem; background: none; border: 0; box-shadow: none; }
  .eg-dd:hover > .eg-dd-menu { display: none; }
  .eg-dd.is-open > .eg-dd-menu { display: block; }
  .eg-dd-menu a { padding: .6rem .2rem; white-space: normal; }
  .eg-nav .eg-nav-cta { display: block; margin: 1rem 0 0; text-align: center; }
  html:not(.js) .eg-header-in { flex-wrap: wrap; padding-bottom: .6rem; }
  html:not(.js) .eg-nav > ul { flex-direction: row; flex-wrap: wrap; }
  html:not(.js) .eg-nav > ul > li { border: 0; }
}

/* 6  Hero ---------------------------------------------------------------- */
.eg-hero { position: relative; display: flex; align-items: center; min-height: 52vh; padding: 4rem 0; color: #fff; background: var(--eg-inverse-bg); overflow: hidden; }
.eg-hero-tall { min-height: min(80vh, 760px); }
.eg-hero-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.eg-hero picture.eg-hero-media, .eg-hero picture.eg-hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.eg-has-media::after { content: ""; position: absolute; inset: 0; z-index: 1; background: var(--eg-hero-overlay); }
.eg-over-none.eg-has-media::after { display: none; }
.eg-over-light.eg-has-media::after { background: rgba(255, 255, 255, .55); }
.eg-over-light { color: var(--eg-heading); }
.eg-hero-in { position: relative; z-index: 2; }
.eg-hero-center .eg-hero-in { text-align: center; max-width: 900px; }
.eg-hero-left .eg-hero-in { max-width: var(--eg-wrap); }
.eg-hero-left .eg-hero-title, .eg-hero-left .eg-hero-text { max-width: 640px; }
.eg-hero-title { font-size: clamp(2.2rem, 1.3rem + 4vw, 4rem); color: inherit; text-shadow: 0 2px 18px rgba(0, 0, 0, .35); }
.eg-over-light .eg-hero-title { text-shadow: none; }
.eg-hero-text { font-size: clamp(1.05rem, 1rem + .5vw, 1.35rem); color: inherit; opacity: .95; }
.eg-hero .eg-eyebrow { color: inherit; opacity: .9; }
.eg-hero-center .eg-actions { justify-content: center; }
.eg-hero .eg-btn-ghost:hover { background: rgba(255, 255, 255, .2); }

/* 7  Sections and tones -------------------------------------------------- */
.eg-section { padding: clamp(3rem, 2rem + 4vw, 5.5rem) 0; background: var(--eg-bg); color: var(--eg-text); }
.eg-tone-alt { background: var(--eg-bg-alt); }
.eg-tone-dark { background: var(--eg-inverse-bg); color: var(--eg-inverse-text); }
.eg-tone-dark h1, .eg-tone-dark h2, .eg-tone-dark h3 { color: var(--eg-inverse-text); }
.eg-tone-dark .eg-lead, .eg-tone-dark .eg-note { color: inherit; opacity: .85; }
.eg-tone-accent { background: var(--eg-accent); color: var(--eg-accent-ink); }
.eg-tone-accent h1, .eg-tone-accent h2, .eg-tone-accent h3, .eg-tone-accent .eg-lead { color: inherit; }
.eg-tone-accent .eg-eyebrow { color: inherit; }
.eg-tone-accent .eg-btn-primary { background: var(--eg-accent-ink); border-color: var(--eg-accent-ink); color: var(--eg-accent); }
.eg-tone-dark a:not(.eg-btn), .eg-tone-accent a:not(.eg-btn) { color: inherit; text-decoration: underline; }

/* 8  Features, cards, gallery, quotes, stats, split ---------------------- */
.eg-grid { display: grid; gap: 1.6rem; grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .eg-cols-2, .eg-cols-3, .eg-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .eg-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .eg-cols-4 { grid-template-columns: repeat(4, 1fr); }
}
.eg-feature { text-align: center; }
.eg-feature-ico { display: inline-flex; align-items: center; justify-content: center; width: 5rem; height: 5rem; margin-bottom: 1rem; border-radius: 50%; background: var(--eg-bg-alt); color: var(--eg-accent); }
.eg-tone-alt .eg-feature-ico { background: var(--eg-surface); }
.eg-feature-img { display: block; max-width: 140px; margin: 0 auto 1rem; }
.eg-feature-title { font-size: 1.15rem; }
.eg-feature p { color: var(--eg-muted); margin: 0; }
.eg-feature-link { display: block; color: inherit; text-decoration: none; }
.eg-feature-link:hover .eg-feature-title { color: var(--eg-accent); text-decoration: none; }

.eg-card { display: flex; flex-direction: column; overflow: hidden; background: var(--eg-surface); border: 1px solid var(--eg-line); border-radius: var(--eg-radius); box-shadow: var(--eg-shadow); }
.eg-card-pic img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.eg-card-body { flex: 1; padding: 1.3rem 1.4rem 1.5rem; }
.eg-card-title { font-size: 1.25rem; }
.eg-card-body p { color: var(--eg-muted); }
.eg-card-link { font-weight: 700; }

.eg-gallery li { overflow: hidden; border-radius: var(--eg-radius); }
.eg-gallery figure { margin: 0; }
.eg-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .5s var(--eg-ease); }
.eg-gallery a.eg-zoom { display: block; cursor: zoom-in; }
.eg-gallery a.eg-zoom:hover img { transform: scale(1.05); }
.eg-gallery figcaption { padding: .5rem .2rem; font-size: .9rem; color: var(--eg-muted); }

.eg-quote { padding: 1.6rem; background: var(--eg-surface); border: 1px solid var(--eg-line); border-radius: var(--eg-radius); box-shadow: var(--eg-shadow); }
.eg-quote blockquote { margin: .6rem 0 1rem; padding: 0; font-style: italic; }
.eg-quote blockquote p { margin: 0; }
.eg-stars { color: #e5a50a; letter-spacing: .1em; font-size: 1.1rem; }
.eg-quote-by { display: flex; align-items: center; gap: .8rem; }
.eg-quote-by span span { display: block; font-size: .85rem; color: var(--eg-muted); }
.eg-quote-photo { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; flex: none; }
.eg-quote-photo img { width: 100%; height: 100%; object-fit: cover; }

.eg-stats li { text-align: center; }
.eg-stat-n { display: block; font: 700 clamp(2rem, 1.5rem + 2vw, 3.2rem)/1.1 var(--eg-font-head); color: var(--eg-accent); }
.eg-stat-l { display: block; margin-top: .3rem; color: var(--eg-muted); }

.eg-split { display: grid; gap: 2rem; align-items: center; grid-template-columns: 1fr; }
.eg-split-pic img { width: 100%; border-radius: var(--eg-radius); box-shadow: var(--eg-shadow); }
.eg-bullets { margin: 0 0 1rem; }
.eg-bullets li { position: relative; padding-left: 1.6rem; margin-bottom: .4rem; }
.eg-bullets li::before { content: ""; position: absolute; left: 0; top: .55em; width: .6rem; height: .6rem; border-radius: 50%; background: var(--eg-accent); }
@media (min-width: 900px) {
  .eg-split { grid-template-columns: 1fr 1fr; gap: 3.5rem; }
  .eg-split.eg-nopic { grid-template-columns: 1fr; }
  .eg-split.eg-reverse .eg-split-pic { order: 2; }
}

/* 9  Forms, FAQ, video, contact ------------------------------------------ */
.eg-form { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; align-items: flex-end; margin-top: 1rem; }
.eg-field { display: flex; flex-direction: column; flex: 1 1 220px; max-width: 360px; text-align: left; font-size: .85rem; font-weight: 600; }
.eg-field input { margin-top: .3rem; padding: .8rem 1rem; font: 400 1rem var(--eg-font-body); color: #1b1b1b; background: #fff; border: 1px solid var(--eg-line); border-radius: 10px; }
.eg-faq details { margin-bottom: .7rem; padding: 1rem 1.2rem; background: var(--eg-surface); border: 1px solid var(--eg-line); border-radius: 12px; }
.eg-faq summary { cursor: pointer; font-weight: 700; }
.eg-faq details[open] summary { margin-bottom: .6rem; color: var(--eg-accent); }
.eg-faq details p:last-child { margin-bottom: 0; }
.eg-yt { position: relative; display: block; max-width: 760px; margin: 0 auto; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--eg-radius); background: #000; box-shadow: var(--eg-shadow); }
.eg-yt img, .eg-yt picture { width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.eg-yt-noposter { background: var(--eg-inverse-bg); }
.eg-yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.eg-yt-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; }
.eg-yt-play .eg-ico { width: 4.5rem; height: 4.5rem; padding: 1rem; border-radius: 50%; background: rgba(0, 0, 0, .6); }
.eg-contact-list { display: inline-block; text-align: left; margin-top: .5rem; }
.eg-contact-list li { display: flex; align-items: flex-start; gap: .7rem; margin-bottom: .6rem; }
.eg-contact-list .eg-ico { margin-top: .25em; color: var(--eg-accent); }
.eg-sep { opacity: .5; }

/* 10 Footer -------------------------------------------------------------- */
.eg-footer { padding: 3.5rem 0 1.5rem; background: var(--eg-footer-bg); color: var(--eg-footer-text); font-size: .98rem; }
.eg-footer a { color: inherit; }
.eg-footer a:hover { color: #fff; }
.eg-foot-top { display: flex; flex-wrap: wrap; gap: 2rem 3rem; }
.eg-foot-brand { flex: 2 1 300px; }
.eg-foot-col { flex: 1 1 160px; }
.eg-foot-brand .eg-brand { color: #fff; margin-bottom: .8rem; }
.eg-foot-brand .eg-logo { max-height: 60px; }
.eg-foot-h { margin: 0 0 .8rem; font: 700 .8rem/1.2 var(--eg-font-body); letter-spacing: .14em; text-transform: uppercase; color: #fff; }
.eg-foot-col li { margin-bottom: .45rem; }
.eg-social { display: flex; gap: .9rem; margin-top: 1rem; }
.eg-social a { display: inline-flex; padding: .35rem; border: 1px solid rgba(255, 255, 255, .25); border-radius: 50%; }
.eg-social a:hover { background: var(--eg-accent); border-color: var(--eg-accent); color: var(--eg-accent-ink); }
.eg-foot-base { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid rgba(255, 255, 255, .15); font-size: .88rem; opacity: .9; }
.eg-credit { margin-left: auto; }

/* 11 Lightbox ------------------------------------------------------------ */
.eg-lb { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 2rem; background: rgba(0, 0, 0, .88); }
.eg-lb img { max-width: 100%; max-height: 100%; width: auto; height: auto; border-radius: 6px; }
.eg-lb button { position: absolute; top: 1rem; right: 1.2rem; width: 44px; height: 44px; font-size: 2rem; line-height: 1; color: #fff; background: none; border: 0; cursor: pointer; }

/* 12 Motion -------------------------------------------------------------- */
.js .eg-reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--eg-ease), transform .7s var(--eg-ease); }
.js .eg-reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .eg-reveal { opacity: 1; transform: none; }
}
@media print {
  .eg-header, .eg-footer, .eg-actions { display: none; }
  .js .eg-reveal { opacity: 1; transform: none; }
}
