/* ==========================================================================
   base.css — FUNCTION ONLY. Client-neutral.
   Reset, accessibility helpers, and the mechanics main.js depends on
   (mobile drawer, lightbox, gallery filter, form states, reveal, floating buttons).

   No brand colours, fonts, radii, shadows, section layouts or decoration here.
   Every visual decision goes in the client's own site.css, which is loaded AFTER this
   file and is written fresh from the chosen design direction (reference/design-directions.md).

   The few visual values below are neutral defaults exposed as custom properties —
   site.css overrides them (--accent, --focus, --drawer-bg, --lb-bg, --error, ...).
   ========================================================================== */

:root {
  --accent: #333;          /* override in site.css */
  --focus: #1a73e8;        /* override in site.css (must be visible on the site background) */
  --error: #b42318;
  --drawer-bg: #fff;
  --lb-bg: rgba(0, 0, 0, .92);
  --wa-green: #1f8f4e;     /* WhatsApp button: white text 4.6:1 */
  --gutter: clamp(16px, 4vw, 32px);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
img, svg, picture, video { display: block; max-width: 100%; }
img { height: auto; }
ul, ol { margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
/* a <picture> that must fill a fixed-size box */
.fill, .fill picture, .fill img { display: block; width: 100%; height: 100%; }
.fill img { object-fit: cover; }

/* ---------- Accessibility ---------- */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -80px; z-index: 300; padding: 10px 16px; background: #000; color: #fff; }
.skip-link:focus { top: 12px; }

/* ---------- Header / mobile drawer mechanics ----------
   site.css decides the look. Keep this rule: the header must NOT get backdrop-filter, filter or
   transform at drawer widths — they make the header the containing block of the fixed drawer and
   trap it inside the header bar. main.js sets the drawer's `top` from the header's bottom edge.
   The drawer breakpoint below must match NAV_BREAKPOINT in build.py (CSS can't read variables in
   media queries): change 1024px here AND in build.py together. */
.site-header { position: sticky; top: 0; z-index: 100; }
.nav-toggle { display: none; cursor: pointer; }
.nav__cta { display: none; }
@media (max-width: 1024px) {
  .site-header { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; filter: none !important; transform: none !important; }
  .nav-toggle { display: grid; place-items: center; }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; top: 0; z-index: 99; margin: 0;
    background: var(--drawer-bg); padding: 16px var(--gutter) 32px; overflow-y: auto;
    transform: translateX(100%); visibility: hidden; transition: transform .3s ease, visibility .3s;
  }
  .nav.is-open { transform: none; visibility: visible; }
  .nav__list { flex-direction: column; align-items: stretch; }
  .nav__cta { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
  body.nav-open { overflow: hidden; }
}

/* ---------- Slider mechanics (only if used) ---------- */
[data-slider] { position: relative; overflow: hidden; }
[data-slider] .slide { position: absolute; inset: 0; opacity: 0; transition: opacity .9s ease; }
[data-slider] .slide.is-active { opacity: 1; }
.slider__dot { cursor: pointer; }

/* ---------- Gallery filter + lightbox mechanics ---------- */
.gallery__item[hidden] { display: none !important; }
[data-lb] { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 400; display: none; align-items: center; justify-content: center; background: var(--lb-bg); padding: 64px 16px 72px; }
.lightbox.is-open { display: flex; }
.lightbox__img { max-width: min(1200px, 100%); max-height: 100%; width: auto; height: auto; object-fit: contain; }
.lightbox__cap { position: absolute; left: 16px; right: 16px; bottom: 20px; margin: 0; text-align: center; color: #fff; }
.lightbox__count { position: absolute; top: 24px; left: 20px; color: #ddd; font-size: .95rem; }
.lightbox__btn { position: absolute; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; }
.lightbox__btn:hover { background: rgba(255,255,255,.26); }
.lightbox__btn svg { width: 26px; height: 26px; }
.lightbox__close { top: 12px; right: 12px; }
.lightbox__prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 12px; top: 50%; transform: translateY(-50%); }
body.lb-open { overflow: hidden; }

/* ---------- Form states (layout + look of fields belong to site.css) ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field input, .field select, .field textarea { width: 100%; min-height: 48px; }
.field__error { display: none; color: var(--error); font-size: .9rem; }
.field.has-error .field__error { display: block; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--error) !important; }
.form-success { display: none; }
.form-success.is-shown { display: block; }
.form-status:empty { display: none; }   /* Nocture form mode: status line written by form.js */

/* ---------- Floating call / WhatsApp buttons (position + size only) ---------- */
.fab { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: flex; flex-direction: column; gap: 12px; }
.fab a { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; color: #fff; text-decoration: none; }
.fab svg { width: 28px; height: 28px; }
.fab__wa { background: var(--wa-green); }
.fab__call { background: var(--accent); }
@media (min-width: 1025px) { .fab__call { display: none !important; } }
/* keep the footer's last row (with the Nocture credit) clear of the floating buttons */
.footer-clear-fab { padding-right: calc(var(--gutter) + 72px); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
