/**
 * @file        base.css
 * @description Reset, typography, layout primitives and section backgrounds for the SOS Strassenhunde MVP
 *
 * @author      Thomas Dobler - SYNTHETIXMIND LTD
 * @email       tom@synthetixmind.com
 * @company     SYNTHETIXMIND LTD, Paphos, Cyprus
 * @url         https://synthetixmind.com
 *
 * @uid         8f3a97d5-5e2e-436f-9865-2e5817c6f357
 * @version     0.3.0.5
 * @created     2026-10-25
 * @updated     2026-11-07
 *
 * @copyright   (c) 2026 by SYNTHETIXMIND LTD
 * @license     Proprietary — All rights reserved
 */

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

/* WHY: overflow-x clip on the root, not just body — otherwise the closed off-canvas menu (fixed, just right of the
   screen) widens the mobile layout viewport (measured 360 → 677 px) and phones can pan sideways or zoom out.
   clip (unlike hidden) creates no scroll container, so the sticky header keeps working. */
html, body { overflow-x: clip; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.6;
}

img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, p, ul, ol, figure, dl { margin: 0; }

h1, h2 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-secondary);
  text-wrap: balance;
}
h1 { font-size: var(--text-h1); line-height: 1.15; }
h2 { font-size: var(--text-h2); line-height: 1.2; }
h3 { font-size: var(--text-h3); font-weight: 700; line-height: 1.3; }

p { max-width: 68ch; }

a { color: var(--color-secondary); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--color-primary-dark); }

/* Visible focus everywhere (WCAG 2.4.7, 1.4.11, issue #8): ring plus white halo, yellow ring on dark sections.
   WHY the halo: the pressed stat switch is Sonnengelb like the dark-section ring; the white gap keeps them apart. */
:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
  box-shadow: 0 0 0 calc(var(--focus-ring-offset) + var(--focus-ring-width) + 2px) var(--focus-ring-halo);
  border-radius: 4px;
}
.section--dark :focus-visible, .site-footer :focus-visible { outline-color: var(--focus-ring-color-on-dark); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: 200;
  padding: var(--space-3) var(--space-4);
  background: var(--color-secondary); color: var(--color-white);
  border-radius: var(--radius); font-weight: 700;
}
.skip-link:focus { top: var(--space-4); color: var(--color-white); }

/* ---------------------------------------------------------------- Layout */
.container {
  width: 100%;
  max-width: calc(var(--content-max) + 2 * var(--page-gutter));
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

.section { padding-block: var(--section-space); }
.section--white { background: var(--color-white); }
.section--dark { background: var(--color-secondary); color: var(--color-white); }
.section--dark h2 { color: var(--color-white); }

.section-head { display: grid; gap: var(--space-4); margin-bottom: var(--space-6); }
.section-foot { margin-top: var(--space-6); }

.overline {
  font-size: var(--text-small);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary-dark);
}

.small { font-size: var(--text-small); line-height: 1.4; }

.grid { display: grid; gap: var(--grid-gap); grid-template-columns: 1fr; }
@media (min-width: 768px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

/* ---------------------------------------------------------------- Motion (NewConcept 4.9)
   WHY: no prefers-reduced-motion gate — owner decision 2026-10-22/23: animations always run.
   .js-motion is set by motion.js only, so content stays visible without JavaScript. */
/* WHY: reveals use the individual translate/scale/filter properties, not transform, so hover transforms
   (card tilt, lifts) keep working after an element has been revealed. */
.js-motion [data-reveal] {
  opacity: 0;
  translate: 0 28px;
  filter: blur(6px);
  transition: opacity 700ms var(--ease-out), translate 800ms var(--ease-out), scale 800ms var(--ease-out),
    filter 700ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.js-motion [data-reveal="fade"] { translate: none; scale: 0.96; }
.js-motion [data-reveal="left"] { translate: -16px 0; }
.js-motion [data-reveal="right"] { translate: 16px 0; }
@media (min-width: 1024px) {
  .js-motion [data-reveal="left"] { translate: -48px 0; }
  .js-motion [data-reveal="right"] { translate: 48px 0; }
}
.js-motion [data-reveal="zoom"] { translate: 0 20px; scale: 0.9; }
/* WHY: the wipe clips the image, never the observed element — Chrome's IntersectionObserver reports a fully
   clipped target as not intersecting, so the reveal would never fire and the image would stay hidden. */
.js-motion [data-reveal="wipe"] { translate: none; filter: none; opacity: 1; }
.js-motion [data-reveal="wipe"] > img { clip-path: inset(0 100% 0 0 round 12px); transition: clip-path 1100ms var(--ease-out), transform 1200ms var(--ease-out); }
.js-motion [data-reveal="wipe"].is-visible > img { clip-path: inset(0 0 0 0 round 12px); }
.js-motion [data-reveal].is-visible { opacity: 1; translate: 0 0; scale: 1; filter: none; }
