/*
 * core/assets/base.css — engine baseline, loaded before the theme's style.css.
 *
 * Structural and accessibility mechanics only. It sets no brand colour, type or
 * spacing scale; where a control needs a neutral paint it uses system colours.
 * The theme may restyle anything here.
 */

/* The native hidden attribute always wins over component display rules. */
[hidden] {
  display: none !important;
}

/* Responsive-image helpers expose modes as classes and native size as data. */
picture.runtime-image-fill {
  display: block;
  width: 100%;
  height: 100%;
}

img.runtime-image-fill {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

img.runtime-image-native {
  max-width: min(100%, var(--image-native-width)) !important;
}

/* A parked off-canvas panel must never widen the document. clip (not hidden)
   keeps position: sticky and vertical scrolling intact. */
html,
body {
  overflow-x: clip;
}

/* Sticky footer: the frame is body > header, main, footer. */
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

body > main {
  flex: 1 0 auto;
}

body > footer {
  flex-shrink: 0;
}

/* Scroll lock while an overlay navigation is open (set by site-chrome.js). */
html[data-nav-lock] {
  overflow: hidden;
}

/* Cover media: the responsive helper may wrap the <img> in a <picture>, so a
   frame that owns its size stretches both. */
.media {
  display: block;
  overflow: hidden;
}

.media picture,
.media img {
  display: block;
  width: 100%;
  height: 100%;
}

.media img {
  object-fit: cover;
}

/* The native option list is a separate UA surface: keep it legible whatever
   colour the theme gives the closed select. */
select option,
select optgroup {
  background-color: Canvas;
  color: CanvasText;
}

/* Text-like controls size to their container; checkboxes, radios and file
   inputs keep their intrinsic size and never stretch inside flex/grid rows. */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="range"]):not([type="color"]),
select,
textarea {
  box-sizing: border-box;
  max-width: 100%;
  font: inherit;
}

input[type="checkbox"],
input[type="radio"] {
  flex: 0 0 auto;
  width: auto;
}

/* A consent checkbox and its label read as one inline control. */
.form-consent {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.5em;
}

.form-consent > input {
  flex: 0 0 auto;
  margin-block-start: 0.2em;
}

.form-consent > label {
  min-width: 0;
}

/* Rich-text media embeds from the admin editor. */
.embed-responsive {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.embed-responsive > iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.embed-responsive--soundcloud {
  aspect-ratio: auto;
  height: 166px;
}

.embed-responsive--soundcloud > iframe {
  position: static;
  height: 166px;
}

/* Keyboard focus is always visible unless the theme draws its own. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* A swap region (site-chrome.js) dims while its next state loads; it only
 * takes focus as a landmark, so it draws no ring. */
:where([data-swap-region]) {
  transition: opacity 0.15s ease;
}

:where([data-swap-region][aria-busy="true"]) {
  opacity: 0.6;
}

:where([data-swap-region]):focus {
  outline: none;
}

/* Consent banner mechanics; the theme styles its look. */
.consent-banner {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 2000;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75em 1.5em;
  padding: 1em;
  background: Canvas;
  color: CanvasText;
  border-top: 1px solid;
}

.consent-banner__text {
  margin: 0;
  flex: 1 1 24em;
}

.consent-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
}

@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;
  }
}
