/* ==========================================================================
   Bionathealth — base.css
   Structure & layout. All colors, fonts, radii, shadows are read from CSS
   custom properties supplied by theme-scientific.css.
   ========================================================================== */

/* ---- Self-hosted fonts (variable weight, latin subset) ---------------------
   Downloaded from Google Fonts and served same-origin: no third-party request,
   no GDPR exposure, no render-blocking stylesheet. Characters outside the latin
   ranges below fall back to system-ui (site copy is EN/ES/FR — all covered). */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/space-grotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- Reset ---------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

/* Fixed brand colours (from the official logo) — constant across all themes */
:root { --brand-green: #84BD41; --brand-teal: #0E7C9B; }

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

body {
  font-family: var(--font-body);
  font-weight: var(--fw-body, 400);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.65;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color .35s ease, color .35s ease;
}

img, svg, picture { max-width: 100%; display: block; }
ul, ol { list-style: none; padding: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--color-tech, var(--color-primary)); outline-offset: 2px; border-radius: 3px; }

/* ---- Typography ----------------------------------------------------------- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  font-weight: var(--fw-heading, 700);
  line-height: 1.12;
  color: var(--color-heading);
  letter-spacing: var(--heading-spacing, normal);
  text-transform: var(--heading-transform, none);
  text-wrap: balance;
}

h1 { font-size: clamp(2.25rem, 5vw, 3.9rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.7rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); }
h4 { font-size: 1.1rem; }

p { text-wrap: pretty; }
strong { font-weight: 700; color: var(--color-heading); }

/* Space a heading from the paragraph (or flow block) that immediately follows
   it. The reset zeroes all heading margins, so without this a subtitle sits
   cramped against its title. Zero-specificity :where() lets components override,
   and adjacent margins collapse so headings that already set margin-bottom
   (cards, features) don't double up. */
:where(h1, h2, h3, h4, h5) + :where(p, .lead, .flow) { margin-top: .8em; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brand-teal);
  margin-bottom: .9rem;
}

.lead { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: var(--color-text-muted); line-height: 1.7; }

/* ---- Layout primitives ---------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max, 1180px);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2.5rem);
}
.container--narrow { max-width: 820px; }

.section { padding-block: var(--section-pad, clamp(3.5rem, 8vw, 7rem)); }
.section--tint { background: var(--color-surface); }
.section--tint-2 { background: var(--color-surface-2); }

.section-head { max-width: 760px; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.section-head--center { margin-inline: auto; text-align: center; }

.grid { display: grid; gap: clamp(1.1rem, 2.5vw, 1.9rem); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--5 { grid-template-columns: repeat(5, 1fr); }
.grid--auto { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.split--media-right { direction: ltr; }
/* text-heavy split: media column takes ~30% (still stacks under 940px) */
.split--media-narrow { grid-template-columns: 7fr 3fr; }

/* ---- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .85em 1.6em;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: .98rem;
  letter-spacing: var(--btn-spacing, .01em);
  text-transform: var(--btn-transform, none);
  border-radius: var(--radius-pill, 999px);
  background: var(--color-tech);
  color: var(--color-primary-contrast);
  border: 2px solid var(--color-tech);
  transition: transform .18s ease, background-color .2s ease, box-shadow .2s ease, color .2s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--color-tech-dark); border-color: var(--color-tech-dark); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn--ghost { background: transparent; color: var(--color-tech); }
.btn--ghost:hover { background: var(--color-tech); color: var(--color-primary-contrast); }
.btn--light { background: var(--color-surface); color: var(--color-heading); border-color: var(--color-border); }
.btn--light:hover { background: var(--color-bg); }
/* Tech accent button — the logo's light blue, for tech / R&D calls-to-action */
.btn--tech { background: var(--color-tech); color: #fff; border-color: var(--color-tech); }
.btn--tech:hover { background: var(--color-tech-dark); border-color: var(--color-tech-dark); }
.btn--tech.btn--ghost { background: transparent; color: var(--color-tech); }
.btn--tech.btn--ghost:hover { background: var(--color-tech); color: #fff; }
.btn .arrow { transition: transform .2s ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* ---- Header / Navigation -------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow .3s ease;
}
/* Frosted bar drawn on a pseudo-element rather than on .site-header itself.
   An element with backdrop-filter becomes a backdrop-filter isolation root for
   its descendants, which would stop the (nested) mobile menu from blurring the
   page. Keeping the filter off .site-header lets the menu blur too. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--header-bg, color-mix(in srgb, var(--color-bg) 88%, transparent));
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
}
.site-header.is-scrolled { box-shadow: var(--shadow); }

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: var(--nav-h, 76px);
}
.nav__brand { display: flex; align-items: center; margin-right: auto; min-width: 0; }
.nav__logo { display: flex; align-items: center; gap: .55rem; }
.nav__slogan {
  display: flex; flex-direction: column; justify-content: center;
  margin-left: .85rem; padding-left: .85rem;
  border-left: 2px solid var(--color-border);
  font-size: .62rem; font-weight: 700; letter-spacing: .13em;
  line-height: 1.55; text-transform: uppercase; white-space: nowrap;
  color: var(--color-text-muted);
}
/* Full menu + slogan need ~1120px; hide the slogan in the tight range,
   bring it back in burger mode (≤820px) where the menu is a drawer. */
@media (max-width: 1120px) { .nav__slogan { display: none; } }
@media (max-width: 820px) { .nav__slogan { display: flex; } }
@media (max-width: 540px) { .nav__slogan { display: none; } }
.nav__logo .logo-mark { width: 25px; height: auto; flex: none; }
/* Two-tone stacked wordmark — inline SVG outlines (Fredoka SemiBold, traced by
   tools/generate-wordmark.js), so no display webfont is loaded. Sized in em so
   the old font-size rules keep working; fills follow the brand colours and can
   be overridden per context (see the footer). */
.brand-wordmark { display: block; height: 1.72em; width: auto; }
.nav__logo .brand-wordmark { font-size: 1.1rem; }
.brand-wordmark [data-wm="bionat"] { fill: var(--brand-green); }
.brand-wordmark [data-wm="health"] { fill: var(--brand-teal); }

.nav__menu { display: flex; align-items: center; gap: .35rem; }
/* While the window is actively resized, suppress the mobile-nav transitions so
   crossing the breakpoint doesn't animate the panel sliding away (see main.js). */
body.is-resizing .nav__menu,
body.is-resizing .nav__dropdown { transition: none !important; }
.nav__item { position: relative; }
.nav__link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .55rem .75rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: .95rem;
  color: var(--color-text);
  border-radius: var(--radius, 10px);
  transition: color .18s ease, background-color .18s ease;
}
.nav__link:hover { color: var(--color-primary); }
.nav__item.is-active > .nav__link { color: var(--color-primary); }
.nav__item.is-active > .nav__link::after {
  content: ""; position: absolute; left: .75rem; right: .75rem; bottom: 4px; height: 2px;
  background: var(--color-primary); border-radius: 2px;
}
.nav__link .caret { width: 9px; height: 9px; transition: transform .2s ease; }

/* dropdown */
.nav__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 230px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-lg);
  padding: .5rem;
  display: grid;
  gap: 2px;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.nav__item:hover .nav__dropdown,
.nav__item:focus-within .nav__dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.nav__item:hover .caret { transform: rotate(180deg); }
.nav__dropdown a { display: block; padding: .6rem .8rem; border-radius: var(--radius, 10px); font-weight: 600; font-size: .92rem; color: var(--color-text); transition: background-color .15s ease, color .15s ease; }
.nav__dropdown a span { display: block; font-weight: 400; font-size: .8rem; color: var(--color-text-muted); }
.nav__dropdown a:hover { background: var(--color-surface); color: var(--color-primary); }

.nav__actions { display: flex; align-items: center; gap: .75rem; }

/* Language dropdown — a pill trigger showing the current language, opening a
   small right-aligned menu with every language (scales beyond 3 languages).
   Opens via .is-open (main.js) and via :focus-within as a no-JS fallback. */
.lang-select { position: relative; }
.lang-select__btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .38rem .75rem;
  border: 1px solid var(--color-tech, var(--brand-teal));
  border-radius: var(--radius-pill, 999px);
  font-family: var(--font-heading); font-weight: 700; font-size: .8rem;
  color: var(--color-tech, var(--brand-teal));
  background: transparent;
  transition: background-color .18s, color .18s;
}
.lang-select__btn:hover { background: color-mix(in srgb, var(--color-tech, var(--brand-teal)) 10%, transparent); }
.lang-select__btn .globe { width: 15px; height: 15px; }
.lang-select__btn .caret { width: 9px; height: 9px; transition: transform .2s ease; }
.lang-select.is-open .lang-select__btn .caret { transform: rotate(180deg); }
.lang-select__menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 10;
  min-width: 160px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-lg);
  padding: .4rem;
  display: grid; gap: 2px;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.lang-select.is-open .lang-select__menu,
.lang-select:focus-within .lang-select__menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-select__menu button,
.lang-select__menu a {
  display: flex; align-items: center; justify-content: space-between; gap: .9rem;
  width: 100%; text-align: left;
  padding: .5rem .7rem;
  border-radius: var(--radius, 10px);
  font-family: var(--font-heading); font-weight: 600; font-size: .88rem;
  color: var(--color-text); text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}
.lang-select__menu button:hover,
.lang-select__menu a:hover { background: var(--color-surface); color: var(--color-primary); }
.lang-select__menu .is-active,
.lang-select__menu [aria-selected="true"] { color: var(--color-primary); }
.lang-select__menu .code { font-size: .72rem; font-weight: 700; color: var(--color-text-muted); }
.lang-select__menu .is-active .code,
.lang-select__menu [aria-selected="true"] .code { color: var(--color-primary); }

.nav__burger { display: none; width: 44px; height: 44px; border-radius: var(--radius, 10px); align-items: center; justify-content: center; }
.nav__burger span, .nav__burger span::before, .nav__burger span::after { content: ""; display: block; width: 22px; height: 2px; background: var(--color-heading); border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }
.nav__burger span { position: relative; }
.nav__burger span::before { position: absolute; top: -7px; }
.nav__burger span::after { position: absolute; top: 7px; }
body.menu-open .nav__burger span { background: transparent; }
body.menu-open .nav__burger span::before { transform: translateY(7px) rotate(45deg); }
body.menu-open .nav__burger span::after { transform: translateY(-7px) rotate(-45deg); }

/* ---- Hero ----------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(3.5rem, 8vw, 7rem); }
.hero__inner { position: relative; z-index: 2; display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; grid-template-columns: 1.1fr .9fr; }
.hero__content { max-width: 620px; }
.hero h1 { margin-bottom: 1.1rem; }
.hero .lead { margin-bottom: 1.9rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .9rem; }
.hero__media { position: relative; min-height: var(--hero-media-h, 360px); }
.hero__stats { display: flex; flex-wrap: wrap; gap: clamp(1.2rem, 3vw, 2.5rem); margin-top: 2.5rem; }
.hero__stat .num { font-family: var(--font-heading); font-weight: 800; font-size: clamp(1.6rem, 3vw, 2.3rem); color: var(--color-primary); line-height: 1; }
.hero__stat .label { font-size: .85rem; color: var(--color-text-muted); margin-top: .35rem; }

/* decorative blobs / molecule layers (theme toggles visibility) */
.hero__decor { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.decor-molecule, .decor-photo, .decor-blob { display: none; } /* themes opt-in */

/* ---- Full-bleed video hero (home) ---------------------------------------- */
.hero--video { display: flex; align-items: center; min-height: min(82vh, 760px); color: #fff; }
.hero--video > .container { width: 100%; }
.hero--video .hero__inner { grid-template-columns: 1fr; }
.hero--video .hero__content { max-width: 720px; }
.hero--video .hero__decor, .hero--video .hero__media { display: none; } /* video replaces decor + side media */

.hero__video-wrap { position: absolute; inset: 0; z-index: 0; overflow: hidden;
  background: linear-gradient(120deg, #0c2a1f, #14403a); } /* fallback before/without video */
.hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero__scrim { position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(7,26,20,.88) 0%, rgba(7,26,20,.60) 44%, rgba(7,26,20,.22) 100%),
    linear-gradient(0deg, rgba(7,26,20,.60) 0%, rgba(7,26,20,0) 48%); }

/* legible text over the video, regardless of active theme */
.hero--video h1 { color: #fff; }
.hero--video .eyebrow { color: var(--brand-green); }
.hero--video .lead { color: rgba(255,255,255,.88); }
.hero--video .hero__stat .num { color: var(--brand-green); }
.hero--video .hero__stat .label { color: rgba(255,255,255,.78); }
.hero--video .btn--ghost { color: #fff; border-color: rgba(255,255,255,.55); }
.hero--video .btn--ghost:hover { background: rgba(255,255,255,.14); border-color: #fff; }

/* Reduced-motion / small screens / Data Saver: main.js never attaches the
   video sources, so only the poster + gradient fallback are shown. */

/* ---- Cards ---------------------------------------------------------------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg, 16px);
  padding: clamp(1.4rem, 2.5vw, 2rem);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  height: 100%;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--color-primary) 40%, var(--color-border)); }
.card__icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: var(--radius, 12px); background: color-mix(in srgb, var(--color-primary) 12%, transparent); color: var(--color-primary); margin-bottom: 1.1rem; }
.card__icon svg { width: 28px; height: 28px; }
.card h3 { margin-bottom: .6rem; }
.card p { color: var(--color-text-muted); }

/* product card */
.product-card { display: flex; flex-direction: column; }
.product-card__media { aspect-ratio: 16/10; border-radius: var(--radius, 12px); margin-bottom: 1.25rem; background: var(--prod-media-bg, linear-gradient(135deg, color-mix(in srgb, var(--color-primary) 18%, var(--color-surface)), var(--color-surface))); display: grid; place-items: center; overflow: hidden; }
.product-card__media svg { width: 46%; height: auto; }
.product-card__media img { width: auto; max-width: 62%; max-height: 74%; height: auto; object-fit: contain; padding: 1.25rem; }
/* photo media (vs. padded logo) fills the block edge to edge */
.product-card__media picture { width: 100%; height: 100%; }
.product-card__media .product-card__img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; padding: 0; }
.product-card .tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--color-primary); margin-bottom: .5rem; }
.product-card .btn { margin-top: auto; align-self: flex-start; }
.product-card h3 { margin-bottom: .5rem; }
/* Flex column: margins don't collapse, so the global heading+p rule would
   stack on the h3's margin — and the auto-margin button needs a floor. */
.product-card h3 + p { margin-top: 0; }
.product-card p { margin-bottom: 1.1rem; }

/* feature / icon list */
.feature { display: flex; gap: 1rem; align-items: flex-start; }
.feature__icon { flex: none; width: 46px; height: 46px; border-radius: var(--radius, 12px); display: grid; place-items: center; background: color-mix(in srgb, var(--color-primary) 12%, transparent); color: var(--color-primary); }
.feature__icon svg { width: 24px; height: 24px; }
.feature h4 { margin-bottom: .25rem; }
.feature p { color: var(--color-text-muted); font-size: .95rem; }

.check-list li { position: relative; padding-left: 1.9rem; margin-bottom: .8rem; color: var(--color-text-muted); }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: .15rem; width: 1.25rem; height: 1.25rem;
  background: var(--color-primary); border-radius: 50%;
  -webkit-mask: var(--check-icon) center/64% no-repeat; mask: var(--check-icon) center/64% no-repeat;
}
.check-list li strong { color: var(--color-heading); }
/* two-column check list for longer benefit lists */
.check-list--2col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2.4rem; margin-top: 2.2rem; }
@media (max-width: 720px) { .check-list--2col { grid-template-columns: 1fr; } }

/* pill chips */
.chips { display: flex; flex-wrap: wrap; gap: .6rem; }
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .9rem; border-radius: var(--radius-pill, 999px); background: var(--color-surface); border: 1px solid var(--color-border); font-size: .9rem; font-weight: 600; }
.chip svg { width: 16px; height: 16px; color: var(--color-tech, var(--color-primary)); }
.chips--center { justify-content: center; margin-top: 2.2rem; }
/* "and more" chip: same surface as the other chips, italic to read as an aside */
.chip--muted { font-style: italic; font-weight: 500; color: var(--color-text-muted); }

/* WS / OS / MX range list (Defenda OX) */
.range-list { display: grid; gap: .8rem; }
.range-list li { display: flex; gap: .8rem; align-items: baseline; color: var(--color-text-muted); }
.range-list__code { flex: none; min-width: 2.6rem; font-weight: 700; color: var(--color-primary); letter-spacing: .04em; }

/* ---- Certification logos -------------------------------------------------- */
/* Flex wrap + fixed basis keeps all badges the same size and breaks the 7 logos
   into two centred rows (4 + 3) on desktop, so each can sit a little larger. */
.cert-logos { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }
.cert-logo {
  flex: 0 1 240px; display: grid; place-items: center; min-height: 150px; padding: 1.5rem;
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius, 12px);
  box-shadow: var(--shadow); transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.cert-logo:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--color-primary) 40%, var(--color-border)); }
.cert-logo img { max-width: 100%; max-height: 98px; width: auto; height: auto; object-fit: contain; }

/* white logo plate atop a certification card — pixel max-height on the image
   guarantees tall/portrait logos stay contained inside the plate. */
.cert-card__logo {
  display: grid; place-items: center; height: 182px; padding: 1.5rem; margin-bottom: 1.25rem;
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius, 12px);
}
.cert-card__logo img { max-width: 80%; max-height: 126px; width: auto; height: auto; object-fit: contain; }

/* ---- Media block (image placeholder) ------------------------------------- */
.media-block {
  position: relative;
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  min-height: 320px;
  background: var(--media-block-bg, linear-gradient(140deg, color-mix(in srgb, var(--color-primary) 85%, #000), var(--color-primary)));
  display: grid;
  place-items: center;
  color: #fff;
}
.media-block svg { width: 40%; opacity: .9; }
.media-block img.product-logo { width: auto; max-width: 60%; max-height: 58%; object-fit: contain; }
.media-block img.media-block__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media-block .ph-note { position: absolute; bottom: 10px; right: 12px; font-size: .68rem; letter-spacing: .05em; opacity: .55; }

/* ---- Map embed ------------------------------------------------------------ */
/* Click-to-load: the Google iframe is only injected once the visitor asks for
   it (see main.js), so no third-party request leaves the page on its own —
   which is what the cookie policy promises. Until then this is a media-block. */
.map-embed { padding: 1.6rem; text-align: center; }
.map-embed__load {
  display: grid; place-items: center; gap: .55rem;
  max-width: 32ch; margin: 0; padding: 0;
  font: inherit; color: inherit; background: none; border: 0; cursor: pointer;
}
.map-embed .map-embed__load svg { width: 52px; opacity: .9; }
/* colour is explicit: the global `strong` rule would otherwise repaint it dark */
.map-embed__load strong { color: #fff; font-size: 1.02rem; text-decoration: underline; text-underline-offset: 4px; }
.map-embed__load span { font-size: .76rem; line-height: 1.45; opacity: .72; }
.map-embed__load:hover strong, .map-embed__load:focus-visible strong { opacity: .82; }
.map-embed__open {
  position: absolute; right: 12px; bottom: 10px;
  font-size: .72rem; color: #fff; opacity: .78; text-decoration: underline;
}
.map-embed__open:hover, .map-embed__open:focus-visible { opacity: 1; }
.map-embed iframe { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; }
.map-embed.is-loaded { padding: 0; }
.map-embed.is-loaded .map-embed__open {
  background: rgba(0, 0, 0, .6); padding: .28rem .55rem; border-radius: 6px; opacity: 1; text-decoration: none;
}

/* ---- Stats band ----------------------------------------------------------- */
.stat-band { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(1rem, 3vw, 2.5rem); text-align: center; }
.stat-band .num { font-family: var(--font-heading); font-weight: 800; font-size: clamp(2rem, 4vw, 3rem); color: var(--color-primary); line-height: 1; }
.stat-band .label { color: var(--color-text-muted); margin-top: .5rem; font-size: .92rem; }
/* flag in place of a number: match the numerals' optical height and baseline */
.stat-band .num--flag { display: flex; align-items: center; justify-content: center; height: clamp(2rem, 4vw, 3rem); }
.stat-band .num--flag img { width: auto; height: clamp(1.7rem, 3.4vw, 2.5rem); border-radius: 3px; box-shadow: 0 1px 4px rgb(0 0 0 / .18); }

/* ---- Table ---------------------------------------------------------------- */
.spec-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.spec-table caption { text-align: left; color: var(--color-text-muted); margin-bottom: .8rem; }
.spec-table th, .spec-table td { text-align: left; padding: .9rem 1rem; border-bottom: 1px solid var(--color-border); vertical-align: top; }
.spec-table thead th { font-family: var(--font-heading); color: var(--color-heading); border-bottom: 2px solid var(--color-tech, var(--color-primary)); text-transform: var(--heading-transform, none); letter-spacing: .03em; }
.spec-table tbody tr:hover { background: var(--color-surface); }
.spec-table td:first-child { font-weight: 700; color: var(--color-heading); }
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg, 16px); border: 1px solid var(--color-border); }

/* ---- CTA band ------------------------------------------------------------- */
.cta-band { background: var(--cta-bg, linear-gradient(120deg, var(--color-primary-dark), var(--color-primary))); color: #fff; border-radius: var(--radius-lg, 20px); padding: clamp(2.2rem, 5vw, 3.6rem); text-align: center; position: relative; overflow: hidden; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.85); max-width: 560px; margin: .8rem auto 1.8rem; }
.cta-band .btn { background: #fff; color: var(--color-tech-dark); border-color: #fff; }
.cta-band .btn:hover { background: rgba(255,255,255,.9); }

/* ---- Breadcrumb / page hero ---------------------------------------------- */
.page-hero { position: relative; overflow: hidden; padding-block: clamp(3rem, 6vw, 5rem); background: var(--color-surface); border-bottom: 1px solid var(--color-border); }
.page-hero .eyebrow { margin-bottom: .6rem; }
.page-hero h1 { margin-bottom: .9rem; }
.page-hero p { max-width: 640px; }
.breadcrumb { display: flex; gap: .5rem; font-size: .85rem; color: var(--color-text-muted); margin-bottom: 1.2rem; }
.breadcrumb a:hover { color: var(--color-primary); }

/* Feature hero — deep green, with molecule art on the right */
.page-hero--feature {
  background:
    radial-gradient(60% 120% at 88% 12%, color-mix(in srgb, var(--color-accent) 40%, transparent), transparent 60%),
    radial-gradient(55% 110% at 12% 8%, color-mix(in srgb, var(--color-tech, #0E7C9B) 45%, transparent), transparent 58%),
    radial-gradient(70% 130% at 0% 100%, color-mix(in srgb, #000 22%, transparent), transparent 55%),
    linear-gradient(125deg, #12261c, var(--color-primary-dark) 55%, var(--color-primary));
  border-bottom: none;
  padding-block: clamp(3.5rem, 7vw, 6rem);
}
.page-hero--feature .container { position: relative; z-index: 2; }
/* Crisp 1px drop + soft dark halo keep the text readable over the hero art */
.page-hero--feature h1 { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 3px 18px rgba(0, 0, 0, .25); }
.page-hero--feature .eyebrow { color: var(--color-tech-bright); }
.page-hero--feature .lead,
.page-hero--feature p { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 2px 10px rgba(0, 0, 0, .25); }
.page-hero--feature .breadcrumb { color: rgba(255, 255, 255, .65); text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.page-hero--feature .breadcrumb a { color: rgba(255, 255, 255, .85); }
.page-hero--feature .breadcrumb a:hover { color: #fff; }

.page-hero__art {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(70%, 780px);
  pointer-events: none;
  z-index: 1;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 38%);
          mask-image: linear-gradient(90deg, transparent, #000 38%);
}
.page-hero__art svg { width: 100%; height: 100%; }
.page-hero__art [data-stroke] { stroke: var(--color-tech-bright, var(--color-accent)); opacity: .55; }
.page-hero__art [data-dot] { fill: var(--color-tech-bright, var(--color-accent)); }
/* Node motion + edge following is driven by assets/js/hero-molecule.js */
@media (max-width: 760px) { .page-hero__art { display: none; } }

/* Full-bleed variant — oversized, faint molecule cropped by the hero edges */
.page-hero__art--full {
  inset: 0;
  width: 100%;
  -webkit-mask-image: radial-gradient(125% 125% at 55% 45%, #000 50%, transparent 100%);
          mask-image: radial-gradient(125% 125% at 55% 45%, #000 50%, transparent 100%);
}
.page-hero__art--full svg { transform: scale(1.05); transform-origin: 58% 50%; opacity: .4; }

/* Rosemary hero variant (client test) — sprigs drawn + swayed by assets/js/hero-rosemary.js.
   The clumps hug the hero edges, so skip the radial mask + zoom of the --full variant. */
.page-hero__art [data-plant] { stroke: var(--color-accent, #84BD41); }
.page-hero__art--full svg[data-rosemary] { opacity: .55; }
.page-hero__art--rosemary { -webkit-mask-image: none; mask-image: none; }
.page-hero__art--rosemary svg { transform: none; }

/* ---- Forms ---------------------------------------------------------------- */
.form-grid { display: grid; gap: 1.1rem; }
/* The submit button is a grid item, so it would stretch to the full column and
   leave its label left-aligned. Keep it content-sized like every other pill
   button; on small screens let it fill the row with a centered label instead
   (bigger tap target at the end of the form). */
.form-grid .btn { justify-self: start; }
@media (max-width: 640px) {
  .form-grid .btn { justify-self: stretch; justify-content: center; }
}
.field { display: grid; gap: .4rem; }
.field label { font-family: var(--font-heading); font-weight: 600; font-size: .9rem; }
.field input, .field textarea, .field select {
  width: 100%; padding: .8rem 1rem; background: var(--color-bg);
  border: 1px solid var(--color-border); border-radius: var(--radius, 10px);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--color-tech, var(--color-primary)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-tech, var(--color-primary)) 22%, transparent); }
.field textarea { min-height: 140px; resize: vertical; }
.field.has-error input, .field.has-error textarea { border-color: #d64545; }
.field__error { color: #d64545; font-size: .82rem; display: none; }
.field.has-error .field__error { display: block; }
.honeypot { position: absolute; left: -9999px; opacity: 0; }
.form-status { padding: 1rem 1.2rem; border-radius: var(--radius, 12px); font-weight: 600; display: none; }
.form-status.is-success { display: block; background: color-mix(in srgb, var(--color-primary) 15%, transparent); color: var(--color-primary-dark); }
.form-status.is-error { display: block; background: #fdecec; color: #b53030; }

/* GDPR consent checkbox (contact form) */
.field--consent .consent { display: flex; align-items: flex-start; gap: .65rem; font-family: var(--font-body); font-weight: 400; font-size: .92rem; color: var(--color-text-muted); cursor: pointer; }
.field--consent input[type="checkbox"] { width: 1.05rem; height: 1.05rem; padding: 0; margin-top: .15rem; flex: none; accent-color: var(--color-primary); cursor: pointer; }
.field--consent a { color: var(--color-primary); font-weight: 600; }
.field--consent a:hover { text-decoration: underline; }

/* ---- Legal pages (privacy / legal notice / cookies) ----------------------- */
.legal-body { max-width: 72ch; }
.legal-body h2 { font-size: 1.3rem; margin: 2.4rem 0 .9rem; }
.legal-body h2:first-child { margin-top: 0; }
.legal-body p { margin-bottom: .95rem; }
.legal-body ul { list-style: disc; padding-left: 1.25rem; margin: 0 0 .95rem; display: grid; gap: .5rem; }
.legal-body a { color: var(--color-primary); font-weight: 600; }
.legal-body a:hover { text-decoration: underline; }
.legal-updated { margin-top: 2.6rem; font-size: .85rem; color: var(--color-text-muted); }

/* ---- World map (markets served) ------------------------------------------- */
/* Traditional filled map: a dot at each served country + a flag marker joined
   by a leader line. Below 820px the overlay is hidden and .market-list takes over. */
.market-map { position: relative; max-width: 1000px; margin: 2.4rem auto 0; }
.market-map__base { display: block; width: 100%; height: auto; }
.market-map__lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.market-map__lines line { stroke: var(--color-primary-dark); stroke-width: 1.2; stroke-dasharray: 3 3; opacity: .5; vector-effect: non-scaling-stroke; }

.market-dot { position: absolute; left: var(--x); top: var(--y); width: 7px; height: 7px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--color-primary-dark); box-shadow: 0 0 0 1.5px #fff, 0 1px 2px rgba(0,0,0,.35); }

.market-flag { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); padding: 2px; background: #fff; border-radius: 4px; box-shadow: 0 0 0 1px rgba(0,0,0,.1), 0 2px 5px rgba(0,0,0,.22); line-height: 0; }
.market-flag img { width: 26px; height: auto; border-radius: 2px; display: block; }

/* Full country list — accessible fallback, and the layout used on narrow screens */
.market-list { display: none; flex-wrap: wrap; justify-content: center; gap: .6rem; max-width: 880px; margin: 2rem auto 0; }
.market-list li { display: inline-flex; align-items: center; gap: .55rem; padding: .45rem 1rem; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-pill); font-size: .92rem; font-weight: 600; color: var(--color-heading); }
.market-list img { width: 22px; height: auto; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }

@media (max-width: 820px) {
  .market-map { display: none; }
  .market-list { display: flex; }
}

/* ---- Footer --------------------------------------------------------------- */
.site-footer { background: var(--color-footer-bg); color: var(--color-footer-text); padding-block: clamp(3rem, 6vw, 4.5rem) 1.5rem; margin-top: auto; }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: clamp(1.5rem, 4vw, 3rem); padding-bottom: 2.5rem; border-bottom: 1px solid rgba(0,0,0,.1); }
.footer__brand .logo-mark { width: 30px; height: auto; }
.footer__brand .brand-row { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.footer__brand .brand-wordmark { font-size: 1.18rem; }
/* Light footer: the wordmark keeps its brand colors (same as the header). */
.footer__brand p { color: rgba(0,0,0,.7); max-width: 320px; font-size: .95rem; }
.footer h4 { color: var(--color-heading); font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 1.1rem; }
.footer__links li { margin-bottom: .6rem; }
.footer__links a { color: rgba(0,0,0,.7); font-size: .95rem; transition: color .15s ease; }
.footer__links a:hover { color: #000; }
.footer address { font-style: normal; color: rgba(0,0,0,.7); font-size: .95rem; line-height: 1.8; }
.footer address a:hover { color: #000; }
/* Brand slogan under the footer logo (overrides the generic .footer__brand p). */
.footer__brand p.footer__slogan {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .08em;
  color: var(--color-primary-dark, #2b6019);
  margin-bottom: .9rem;
}
/* EU emblem + ERDF/FEDER note (co-financing acknowledgement, links to the EU page). */
.footer__eu {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  margin-top: 1.4rem;
  max-width: 320px;
  color: rgba(0,0,0,.6);
  font-size: .78rem;
  line-height: 1.4;
  transition: color .18s ease;
}
.footer__eu img { flex: none; border-radius: 3px; }
.footer__eu:hover { color: #000; }
.footer__social { display: flex; gap: .7rem; margin-top: 1.2rem; }
.footer__social a { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.08); transition: background-color .18s ease, transform .18s ease; }
.footer__social a:hover { background: var(--color-primary); transform: translateY(-2px); }
.footer__social svg { width: 18px; height: 18px; color: var(--color-heading); transition: color .18s ease; }
.footer__social a:hover svg { color: #fff; }
.footer__bottom { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; padding-top: 1.5rem; font-size: .85rem; color: rgba(0,0,0,.6); }
.footer__bottom nav { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.footer__bottom a:hover { color: #000; }

/* ---- Scroll reveal animation --------------------------------------------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---- Utilities ------------------------------------------------------------ */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.flow > * + * { margin-top: 1.1rem; }
.flow-lg > * + * { margin-top: 1.6rem; }
.muted { color: var(--color-text-muted); }
.hidden { display: none !important; }
.page-wrap { display: flex; flex-direction: column; min-height: 100vh; }
.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; }

/* ---- Responsive ----------------------------------------------------------- */
@media (max-width: 940px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__media { min-height: 280px; order: -1; }
  .split { grid-template-columns: 1fr; }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--5 { grid-template-columns: repeat(3, 1fr); }
  .stat-band { grid-template-columns: repeat(2, 1fr); gap: 1.8rem; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  .nav__burger { display: flex; }
  .nav__menu {
    position: fixed; inset: var(--nav-h, 76px) 0 auto 0;
    /* More opaque than the bar's tint for legibility over page content. */
    background: color-mix(in srgb, var(--color-bg) 94%, transparent);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    backdrop-filter: saturate(140%) blur(10px);
    flex-direction: column; align-items: stretch; gap: 0;
    padding-inline: clamp(1.1rem, 4vw, 2.5rem);
    /* Reveal downward from just under the bar (emerges from behind it), via
       max-height so it stays compatible with the panel's backdrop blur.
       Vertical padding, border and shadow live in the open state so the panel
       collapses to a true zero height when closed (border-box won't shrink
       below its own vertical padding). */
    max-height: 0; overflow-y: auto;
    transition: max-height .35s ease;
  }
  body.menu-open .nav__menu {
    max-height: calc(100vh - var(--nav-h, 76px));
    padding-block: 1rem 2rem;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
  }
  .nav__link { padding: .9rem .25rem; font-size: 1.05rem; border-radius: 0; border-bottom: 1px solid var(--color-border); width: 100%; justify-content: space-between; }
  .nav__menu > .nav__item:last-child > .nav__link { border-bottom: none; }
  .nav__item.is-active > .nav__link::after { display: none; }
  .nav__dropdown { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none; padding: 0 0 .5rem 1rem; min-width: 0; background: transparent; max-height: 0; overflow: hidden; transition: max-height .3s ease; }
  .nav__item.menu-expanded .nav__dropdown { max-height: 500px; }
  .nav__item.menu-expanded .caret { transform: rotate(180deg); }
}

@media (max-width: 560px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .grid--5 { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr; }
  .stat-band { grid-template-columns: 1fr 1fr; }
  .btn { width: 100%; justify-content: center; }
  .hero__cta { width: 100%; }
}
