/* =============================================================================
   Base — Typography, body defaults, semantic elements
   ============================================================================= */

body {
  font-family: var(--flavor-font-body);
  font-size: var(--flavor-fs-base);
  line-height: var(--flavor-lh-base);
  color: var(--flavor-text);
  background-color: var(--flavor-bg);
}

/* ── Headings ─────────────────────────────────────────────────────────────────
   Sizes come from the Customizer (Typography section) as --flavor-h1..h6.
   Each is clamped against a fluid floor so small screens never overflow.
   ─────────────────────────────────────────────────────────────────────────── */
h1 { font-size: clamp(1.75rem, 4vw,   var(--flavor-h1, 2.5rem)); }
h2 { font-size: clamp(1.5rem,  3.5vw, var(--flavor-h2, 2rem)); }
h3 { font-size: clamp(1.25rem, 3vw,   var(--flavor-h3, 1.5rem)); }
h4 { font-size: clamp(1.125rem, 2.5vw, var(--flavor-h4, 1.25rem)); }
h5 { font-size: var(--flavor-h5, 1.125rem); }
h6 { font-size: var(--flavor-h6, 1rem); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--flavor-font-heading);
  line-height: var(--flavor-lh-heading);
  font-weight: var(--flavor-heading-weight, 700);
  letter-spacing: var(--flavor-ls-heading, normal);
  text-transform: var(--flavor-tt-heading, none);
  margin-block-end: 0.5em;
}

body {
  letter-spacing: var(--flavor-ls-body, normal);
}

/* ── Paragraphs & Inline ──────────────────────────────────────────────────── */
p {
  margin-block-end: 1em;
}

strong, b { font-weight: 700; }
em, i     { font-style: italic; }

small {
  font-size: 0.875em;
  color: var(--flavor-text-muted);
}

blockquote {
  border-inline-start: 4px solid var(--flavor-primary);
  padding-inline-start: var(--flavor-sp-lg);
  margin: var(--flavor-sp-lg) 0;
  font-style: italic;
  color: var(--flavor-text-muted);
}

code, kbd, samp, pre {
  font-family: var(--flavor-font-mono);
  font-size: 0.875em;
}

pre {
  background: var(--flavor-bg-alt);
  padding: var(--flavor-sp-md);
  border-radius: var(--flavor-radius);
  overflow-x: auto;
  margin: var(--flavor-sp-lg) 0;
}

code {
  background: var(--flavor-bg-alt);
  padding: 2px 6px;
  border-radius: 4px;
}

pre code {
  background: none;
  padding: 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--flavor-border);
  margin: var(--flavor-sp-xl) 0;
}

/* ── Lists ────────────────────────────────────────────────────────────────── */
ul, ol {
  margin-block-end: 1em;
}

li + li {
  margin-block-start: 0.25em;
}

/* ── Tables ───────────────────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--flavor-sp-lg) 0;
  display: block;
  overflow-x: auto;
}

th, td {
  padding: var(--flavor-sp-sm) var(--flavor-sp-md);
  border-bottom: 1px solid var(--flavor-border);
  text-align: start;
}

th {
  font-weight: 700;
  color: var(--flavor-secondary);
}

/* ── Images & Embeds ──────────────────────────────────────────────────────── */
figure {
  margin: var(--flavor-sp-lg) 0;
}

figcaption {
  font-size: 0.875rem;
  color: var(--flavor-text-muted);
  margin-block-start: var(--flavor-sp-sm);
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════════════
   WordPress alignment classes

   `.alignfull` defaults to a SAFE 100% width. The viewport-breakout is opted
   into only where a full-bleed element is actually valid — i.e. layouts with
   no sidebar. Inside a sidebar grid column a -50vw margin escapes the column
   and covers adjacent UI, which is what broke the map's layer panel.

   `overflow-x: clip` on the shell absorbs any residual scrollbar rounding.
   Unlike `hidden`, `clip` does not create a scroll container, so
   `position: sticky` on the header keeps working.
   ═══════════════════════════════════════════════════════════════════════════ */
.alignwide {
  max-width: var(--flavor-wide-w);
  margin-inline: auto;
}

.alignfull {
  width: 100%;
  max-width: 100%;
  margin-inline: 0;
}

.content-area,
.site-main {
  overflow-x: clip;
}

/* True edge-to-edge breakout — only in sidebar-free layouts */
.layout-full-width .alignfull,
.layout-centered .alignfull,
.content-area--front .alignfull,
.entry-content--full-width > .alignfull {
  width: 100vw;
  max-width: 100vw;
  margin-inline: calc(50% - 50vw);
}

.aligncenter {
  display: block;
  margin-inline: auto;
}

.alignleft {
  float: inline-start;
  margin-inline-end: var(--flavor-sp-lg);
  margin-block-end: var(--flavor-sp-md);
}

.alignright {
  float: inline-end;
  margin-inline-start: var(--flavor-sp-lg);
  margin-block-end: var(--flavor-sp-md);
}

/* ── WordPress core block overrides (minimal) ─────────────────────────────── */
.entry-content > * + * {
  margin-block-start: var(--flavor-sp-md);
}

.wp-block-image img {
  border-radius: var(--flavor-radius);
}

.wp-block-separator {
  border-color: var(--flavor-border);
}
