/* Tenant base: the reset, the brand-kit contract, and the mechanics of the
   shared partials (sites/shared: announcement bar, footer) — how the banner
   rotates and how the footer lays out, not how either looks. Each theme styles
   those partials itself. RULE: anything here must be overridable by a theme's
   CSS, and taste decisions do not belong here. Every rule added to this file
   makes every theme alike in that respect. */

/* ─── Reset ───
   The subset of Tailwind's preflight the theme rules were written against.
   Tenant sites no longer load Tailwind; without this, browser default margins,
   heading sizes and box-sizing come back on every site. */
*, ::before, ::after, ::backdrop, ::file-selector-button { box-sizing: border-box; margin: 0; padding: 0; border: 0 solid; }
html { line-height: 1.5; -webkit-text-size-adjust: 100%; tab-size: 4; font-family: ui-sans-serif, system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
body { line-height: inherit; }
hr { height: 0; color: inherit; border-top-width: 1px; }
h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; }
a { color: inherit; text-decoration: inherit; }
b, strong { font-weight: bolder; }
code, kbd, samp, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1em; }
small { font-size: 80%; }
sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; }
sub { bottom: -0.25em; }
sup { top: -0.5em; }
table { text-indent: 0; border-color: inherit; border-collapse: collapse; }
ol, ul, menu { list-style: none; }
img, svg, video, canvas, audio, iframe, embed, object { display: block; vertical-align: middle; }
img, video { max-width: 100%; height: auto; }
button, input, select, optgroup, textarea {
  font: inherit; font-feature-settings: inherit; font-variation-settings: inherit;
  letter-spacing: inherit; color: inherit; background-color: transparent; border-radius: 0;
}
button, input:where([type="button"], [type="reset"], [type="submit"]) { appearance: button; }
:-moz-focusring { outline: auto; }
:-moz-ui-invalid { box-shadow: none; }
abbr:where([title]) { text-decoration: underline dotted; }
progress { vertical-align: baseline; }
::-webkit-search-decoration { -webkit-appearance: none; }
::-webkit-inner-spin-button, ::-webkit-outer-spin-button { height: auto; }
textarea { resize: vertical; }
::placeholder { opacity: 1; color: color-mix(in srgb, currentColor 50%, transparent); }
summary { display: list-item; }
[hidden]:where(:not([hidden="until-found"])) { display: none !important; }

/* ─── Brand kit contract ───
   layouts/sites.html.erb sets --color-primary, --color-background,
   --color-secondary, --color-text, --font-display, --font-body from the
   brand kit and applies background, color and font-family to body. Themes
   build on those variables; base defines no colors of its own. */

/* ─── Utility ─── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ─── Announcement Bar ───
   Rotation only. Colors, type, spacing and the --closed state's look belong
   to the theme, except the tone: an accent banner's color, below. */
/* Rotation: every banner sits in the same grid cell, so the bar is as tall as
   its tallest message and the page never shifts. A shorter message is centered
   in that height rather than left at the top (a one-line banner next to a
   two-line one on a phone). Until sites.js adds .is-rotating (no JS, or
   reduced motion) only the first banner shows. The bar's color fades with
   the messages, so the outgoing one doesn't fade out on the next one's tone. */
.announcement-bar[data-announcement-rotator] {
  display: grid;
  align-items: center;
  transition: background-color 400ms ease, color 400ms ease;
}

.announcement-bar[data-announcement-rotator] .announcement-bar__item {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  transition: opacity 400ms ease, visibility 0s linear 400ms;
}

.announcement-bar[data-announcement-rotator]:not(.is-rotating) .announcement-bar__item:first-child,
.announcement-bar[data-announcement-rotator] .announcement-bar__item.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 400ms ease;
}

/* Tone: a banner in the accent color (BannerAd tone "secondary") turns the
   bar the brand's secondary color, with the text color on it, while it is
   the one showing: alone, first in a bar that isn't rotating (no JS, reduced
   motion, the editor), or the rotating one. A theme may add to its look. */
.announcement-bar:not(.is-rotating):has(> .announcement-bar__item--secondary:first-child),
.announcement-bar.is-rotating:has(> .announcement-bar__item--secondary.is-active) {
  background-color: var(--color-secondary);
  color: var(--color-text);
}

/* ─── Footer ───
   Layout only: centered, social icons in a row. Type, color and spacing
   belong to the theme. */
.site-footer {
  text-align: center;
}

.site-footer__social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.site-footer__social a {
  display: inline-flex;
}
