/*
 * streamline-wp-native — base.css
 *
 * Universal responsive + a11y safety net loaded on every front-end page
 * and inside the Site Editor (see functions.php → wp_enqueue_scripts and
 * add_editor_style). Every child theme inherits these rules; do NOT
 * re-declare them in a child theme — only override the bits that the
 * brand actually needs to differ on (e.g. focus-ring color).
 *
 * Rules belong here when they need a CSS selector (pseudo-class,
 * descendant, media query). Anything expressible via a block-style
 * attribute belongs in theme.json instead.
 */

/* ── Horizontal-overflow safety net ──────────────────────────────────
   `overflow-x: clip` (not `hidden`) prevents side-swipe without
   creating a scroll container, so `position: sticky` on a header or
   anchor links still work. Pair it with `overflow-wrap: break-word`
   so a single long word (German compound, telephone number with
   em-dash) wraps instead of pushing its row past the viewport. */
html, body { overflow-x: clip; }
body { overflow-wrap: break-word; }

/* Flex/grid children default to `min-width: auto` = intrinsic content
   width; one long word inside a column then pushes the whole row
   past the viewport edge. `min-width: 0` lets the column wrap. */
:where(.wp-block-columns) > .wp-block-column { min-width: 0; }

/* Replaced elements scale to their container. Without this, an image
   wider than the constrained content area introduces horizontal
   scroll on phones. */
:where(img, video, iframe, svg, canvas) { max-width: 100%; height: auto; }

/* Buttons honour their container. `padding: 1.75em` on a 100%-wide
   button overflows by 2 × 1.75em without `box-sizing`. */
:where(.wp-block-button),
:where(.wp-block-button .wp-block-button__link) {
	max-width: 100%;
	box-sizing: border-box;
}

/* Tables fit. `word-break: break-word` on cells lets long URLs and
   compound words wrap rather than push the table wide. */
:where(table) { max-width: 100%; }
:where(th, td) { overflow-wrap: anywhere; }

/* ── Focus visible ───────────────────────────────────────────────────
   Branded ring on every keyboard-focused interactive. The accent
   colour is read from theme.json, so children automatically get
   their own brand ring without touching this rule. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
	border-radius: 4px;
}

/* ── Skip-link ───────────────────────────────────────────────────────
   WP core auto-injects the `<a class="skip-link screen-reader-text">`
   markup since 5.8 (via block_template_skip_link). It needs a <main>
   element in the template to target — every parent template uses
   `tagName:"main"`. We own the visual treatment here. */
.skip-link.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	overflow: hidden;
	position: absolute !important;
	word-wrap: normal !important;
}
.skip-link.screen-reader-text:focus {
	background-color: var(--wp--preset--color--paper);
	color: var(--wp--preset--color--accent);
	clip: auto !important;
	clip-path: none;
	display: block;
	font-weight: 600;
	height: auto;
	left: 8px;
	line-height: 1.4;
	padding: 12px 18px;
	text-decoration: underline;
	top: 8px;
	width: auto;
	z-index: 100000;
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

/* ── Reduced motion ──────────────────────────────────────────────────
   Users who request reduced motion (system setting) get effectively
   no animation. The `!important` overrides per-block animation
   attributes too. */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ── German-friendly headline hyphenation ────────────────────────────
   Long compound words ("Allgemeinmedizin", "Vertretungspraxis") fit
   into narrow viewports cleanly. Body copy stays unhyphenated by
   default — readability beats compactness for paragraphs. */
:where(h1, h2, h3):lang(de) { hyphens: auto; }

/* ── Print ───────────────────────────────────────────────────────────
   Generous defaults: hide nav + buttons, expand link URLs after
   text, keep type readable. No background tints — saves toner. */
@media print {
	:where(nav, .wp-block-navigation, .wp-block-button) { display: none; }
	:where(body) { background: #fff; color: #000; }
	a::after { content: " (" attr(href) ")"; font-size: 0.85em; word-break: break-all; }
	:where(h1, h2, h3) { page-break-after: avoid; }
	:where(img, table, figure) { page-break-inside: avoid; }
}

/* ── Optional opt-ins ────────────────────────────────────────────────
   Children can copy this file into their own theme and uncomment
   what they want. Off by default to keep the agency baseline
   predictable. */

/* @media (prefers-color-scheme: dark) {
	:root {
		--wp--preset--color--paper: #0b0d10;
		--wp--preset--color--surface: #14181d;
		--wp--preset--color--ink: #e5e7eb;
	}
} */

/* @view-transition { navigation: auto; } */
