/*
 * 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; }
}

/* ── Section styles (styles/section-*.json) ─────────────────────────
   Core prints preset colour classes with !important, so a paragraph
   marked "muted" or "accent" inside a Dark or Accent section would keep
   its grey or blue on the dark background. Inside those two sections
   both follow the section's text colour instead. */
:is(.is-style-section-dark, .is-style-section-accent) :is(.has-muted-color, .has-accent-color) {
	color: inherit !important;
}
.is-style-section-dark .has-muted-color {
	opacity: 0.8;
}
/* A light card inside a Dark or Accent section (contact-split's form
   card) keeps dark text, headings included — the section style would
   otherwise paint them white on the card's light background. */
:is(.is-style-section-dark, .is-style-section-accent) :is(.has-paper-background-color, .has-surface-background-color, .is-style-section-soft) {
	color: var(--wp--preset--color--ink, #111827);
}
:is(.is-style-section-dark, .is-style-section-accent) :is(.has-paper-background-color, .has-surface-background-color, .is-style-section-soft) :is(h1, h2, h3, h4, h5, h6) {
	color: inherit;
}
:is(.is-style-section-dark, .is-style-section-accent) :is(.has-paper-background-color, .has-surface-background-color, .is-style-section-soft) a:where(:not(.wp-element-button)) {
	color: inherit;
	text-decoration: underline;
}
/* A child palette without a `surface` slug gets no class rule for it, so
   a surface card inside a Dark or Accent section would turn transparent.
   Core's rule, where it exists, carries !important and wins over this
   fallback. Scoped to the sections so content elsewhere stays as it was. */
:is(.is-style-section-dark, .is-style-section-accent) .has-surface-background-color {
	background-color: var(--wp--preset--color--surface, #f6f7f9);
}
/* A surface card inside a Soft section would vanish (surface on surface). */
.is-style-section-soft .has-surface-background-color {
	background-color: var(--wp--preset--color--paper, #ffffff) !important;
}

/* ── 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; } */
