/* ==========================================================================
   CONTENT SLOTS (Pass 62)
   Styles for osta_content_slot() (inc/content-slots.php) — the reusable-
   block placement mechanism, distinct from (but layered on top of)
   .entry-content, which Pass 61 already gave every plain page body. A
   slot's inner text/blocks get EVERY .entry-content rule for free
   (global.css, section 18) via the shared class this file's markup
   applies alongside its own — only slot-specific concerns live here:
   the outer band (padding + background choice), containing wide/full
   alignment, capping images, and a stricter font-size floor than a plain
   page body gets. Loaded on every page (inc/enqueue.php) since slots now
   exist on nearly every template in this build.
   ========================================================================== */

.osta-content-slot {
  padding-block: var(--space-8);
}

@media (max-width: 767px) {
  .osta-content-slot {
    padding-block: var(--space-6);
  }
}

.osta-content-slot--bg-grey {
  background: var(--color-surface-soft);
}

/* --bg-navy's background/text-color come from .on-dark (global.css) —
   applied alongside this class in osta_content_slot(), not redeclared
   here. This file only adds the few overrides .on-dark doesn't already
   cover: forcing an explicitly-picked light/dark PALETTE text colour back
   to readable when a navy slot is chosen (see below), and keeping the
   default button treatment visually distinct from the slot's own navy
   background rather than blending into it. */

/* ---- Containing the slot's own content to the site's normal measure ----
   .container (global.css) already centres and clamps to --container-max
   — reused as-is, not redefined, so a slot matches every other section's
   width exactly. What's new here is WIDE/FULL alignment: core's own
   .alignwide/.alignfull rely on a negative-margin breakout technique that
   assumes a theme.json-driven full-bleed layout this classic theme never
   opts into. Left alone, that breakout math is computed against nothing
   meaningful and can push content past the viewport edge — this pass's
   own explicit failure case ("must not break out of the container or
   cause horizontal overflow at any width"). Neutralising both to the
   container's own width, rather than removing the alignment options
   entirely (align-wide stays enabled, inc/content-slots.php), keeps them
   a real, useful choice — "wide" and "full" both still visually FILL the
   slot's own container edge-to-edge, they just never exceed it. */
.osta-content-slot__body .alignwide,
.osta-content-slot__body .alignfull {
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  width: 100%;
}

/* ---- Images: always responsive, never wider than their own column ---- */
.osta-content-slot__body img {
  max-width: 100%;
  height: auto;
}

.osta-content-slot__body .wp-block-image {
  max-width: 100%;
}

/* ---- Font-size floor, stricter than .entry-content's own ----
   Pass 61 already floors a Small-preset paragraph at --text-small (16px)
   for a plain page body. This pass's own instruction is explicit that
   SLOT content holds the full 18px body minimum, including against an
   inline style (a pasted snippet, or a size saved before this pass's own
   editor-font-sizes registration removed the option) — so this selector
   is deliberately MORE specific than global.css's own
   ".entry-content .has-small-font-size" (three classes vs. two), which
   guarantees it wins regardless of stylesheet load order, and it floors
   EVERY size below 18px, not only the one named "Small" — a client typing
   a raw inline style smaller than that (only reachable by pasting HTML;
   disable-custom-font-sizes removes the UI path) is still caught. */
/* Deliberately NOT a blanket "every element" rule — h1-h4 already render
   at --text-h1 through --text-h4 (global.css, all comfortably above 18px)
   via plain element selectors, and a blanket override at this class's
   higher specificity would incorrectly shrink THOSE too. Scoped instead
   to exactly the two things that can actually carry a sub-floor size: a
   legacy/pasted has-*-font-size class (the "Small" preset this pass's own
   editor-font-sizes registration above already removed from the picker,
   but old content or a paste can still carry the class), and a raw
   inline style= (only reachable the same way). Both excluded from ever
   matching a heading, which is never the thing this floor exists to
   catch. has-lead-font-size / has-large-font-size are excluded from the
   class selector below because both are already >= 18px (21px / 26px) —
   this floor only ever pulls a size UP to the minimum, never down. */
.osta-content-slot .osta-content-slot__body [class*="-font-size"]:not(.has-lead-font-size):not(.has-large-font-size):not(h1):not(h2):not(h3):not(h4):not(h5):not(h6) {
  font-size: var(--text-body) !important;
}

.osta-content-slot .osta-content-slot__body [style*="font-size"]:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6) {
  font-size: var(--text-body) !important;
}

.osta-content-slot .osta-content-slot__body .has-lead-font-size {
  font-size: var(--text-lead) !important;
}

.osta-content-slot .osta-content-slot__body .has-large-font-size {
  font-size: var(--text-h3) !important;
}

/* ---- Navy slot: force every palette text colour back to readable ----
   The restricted palette (inc/content-slots.php) only ever writes a
   named CLASS for a picked colour (has-ink-color, has-muted-color,
   has-navy-color) — never an inline hex — because disable-custom-colors
   removes the one editor path that would otherwise produce one. That
   means every case a client could actually produce is enumerable and
   fixable here, deterministically, rather than guessed at: on a navy
   slot, any of the three colours that would be invisible or
   low-contrast against navy is redirected to the same light colour
   .on-dark already uses for everything else. White and Light Grey need
   no entry — both are already light enough to stay readable as picked. */
.osta-content-slot--bg-navy .osta-content-slot__body .has-ink-color,
.osta-content-slot--bg-navy .osta-content-slot__body .has-muted-color,
.osta-content-slot--bg-navy .osta-content-slot__body .has-navy-color {
  color: var(--color-surface) !important;
}

/* Buttons: .on-dark already restyles every .btn variant, but a client's
   OWN core Button block is styled by .entry-content .wp-block-button__link
   (global.css, Pass 61) as a solid navy pill — on a navy slot background
   that reads as barely-there. Swapped for the same light-on-dark contrast
   the rest of a navy slot already uses. */
.osta-content-slot--bg-navy .osta-content-slot__body .wp-block-button__link {
  background: var(--color-surface);
  color: var(--color-brand);
}

.osta-content-slot--bg-navy .osta-content-slot__body .wp-block-button__link:hover,
.osta-content-slot--bg-navy .osta-content-slot__body .wp-block-button__link:focus-visible,
.osta-content-slot--bg-navy .osta-content-slot__body .wp-block-button__link:active {
  background: var(--color-surface-soft);
  color: var(--color-brand);
}

.osta-content-slot--bg-navy .osta-content-slot__body .is-style-outline .wp-block-button__link {
  background: transparent;
  border-color: var(--color-surface);
  color: var(--color-surface);
}

.osta-content-slot--bg-navy .osta-content-slot__body .is-style-outline .wp-block-button__link:hover,
.osta-content-slot--bg-navy .osta-content-slot__body .is-style-outline .wp-block-button__link:focus-visible,
.osta-content-slot--bg-navy .osta-content-slot__body .is-style-outline .wp-block-button__link:active {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--color-surface);
  color: var(--color-surface);
}

.osta-content-slot--bg-navy .osta-content-slot__body blockquote {
  background: rgba(255, 255, 255, 0.08);
  border-left-color: var(--color-brand-on-dark);
  color: var(--color-surface);
}

.osta-content-slot--bg-navy .osta-content-slot__body code,
.osta-content-slot--bg-navy .osta-content-slot__body pre {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

/* ==========================================================================
   STARTER PATTERNS (Pass 62) — see inc/patterns.php for registration.
   Styled here, against site tokens, so a pattern the client inserts looks
   native immediately rather than like a generic block-editor default.
   ========================================================================== */

.osta-pattern-callout {
  background: var(--color-brand-wash);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-brand);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.osta-pattern-notice {
  background: var(--color-warning-wash);
  border: 1px solid var(--color-warning);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.osta-pattern-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

@media (max-width: 480px) {
  .osta-pattern-button-row .wp-block-button {
    width: 100%;
  }

  .osta-pattern-button-row .wp-block-button__link {
    width: 100%;
  }
}
