/* ==========================================================================
   Live settings layer — v30
   Everything the Settings screen can change reads from custom properties that
   the layout prints into :root. This file is the bridge: it is loaded last, so
   these rules win over site.css defaults without editing the base stylesheet.
   ========================================================================== */

html { font-size: var(--base-size, 16px); }

body { font-family: var(--body); }

.wrap, .wrapper { max-width: var(--wrap, 1200px); }

h1, h2, h3, h4, h5 {
  font-family: var(--display);
  font-weight: var(--h-weight, 800);
  text-transform: var(--h-transform, none);
}

main p a, .prose a, article a { text-decoration: var(--link-line, underline); }
main p a:hover, .prose a:hover, article a:hover { text-decoration: underline; }

.card, .panel, .box, .surface { border-radius: var(--radius, 12px); }
.btn, button.btn, a.btn, input[type="submit"] { border-radius: var(--btn-radius, 10px); }
.card, .panel { box-shadow: var(--shadow); }

/* Density: sections breathe more or less without touching every component. */
section, .section { padding-block: calc(var(--space-scale, 1) * 3.4rem); }

/* Motion off: honours the visitor as well as the setting. */
:root[data-motion="0"] *,
@media (prefers-reduced-motion: reduce) {}

:root[data-motion="0"] * {
  animation-duration: .001ms !important;
  transition-duration: .001ms !important;
  scroll-behavior: auto !important;
}

/* Logo height ------------------------------------------------------------ */
.brand__logo { height: var(--logo-h, 38px); width: auto; }

/* Sticky header ---------------------------------------------------------- */
:root[data-sticky-header="1"] .masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: saturate(180%) blur(8px);
}

/* Announcement bar ------------------------------------------------------- */
.announce {
  display: block;
  text-align: center;
  padding: 9px 16px;
  font-size: .86rem;
  font-weight: 600;
  letter-spacing: .01em;
  color: #fff;
  background: var(--brand);
  text-decoration: none;
}

.announce--accent { background: var(--accent, var(--warn)); }
.announce--ink    { background: var(--ink); }
.announce--good   { background: var(--good, #17a97a); }
.announce a, a.announce:hover { color: #fff; text-decoration: underline; }

/* Floating actions ------------------------------------------------------- */
.fab {
  position: fixed;
  right: 18px;
  z-index: 70;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  color: #fff;
  border-radius: 999px;
  box-shadow: 0 10px 26px -12px rgba(0, 0, 0, .5);
}

.fab--whatsapp {
  bottom: 18px;
  padding: 12px 18px;
  background: #25d366;
  text-decoration: none;
}

.fab--top {
  /* Right-hand side, sitting above the WhatsApp pill when both are on. */
  bottom: 18px;
  right: 18px;
  left: auto;
  width: 44px;
  height: 44px;
  background: var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.fab--top.is-visible { opacity: .92; pointer-events: auto; }

/* Both floats on: lift the arrow clear of the WhatsApp pill. */
.fab--whatsapp ~ .fab--top { bottom: 78px; }

/* Cookie notice ---------------------------------------------------------- */
/* [hidden] must win over the flex display below, otherwise "Got it" does
   nothing visible. */
.cookiebar[hidden] { display: none !important; }

.cookiebar {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 80;
  width: min(720px, calc(100% - 28px));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface, #fff);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius, 12px);
  box-shadow: 0 18px 46px -22px rgba(0, 0, 0, .55);
  font-size: .84rem;
}

.cookiebar p { margin: 0; flex: 1 1 260px; }
.cookiebar .btn { padding: 7px 14px; }

/* Dark scheme ------------------------------------------------------------ */
:root[data-scheme="dark"] body { background: var(--paper); color: var(--ink); }
:root[data-scheme="dark"] .card,
:root[data-scheme="dark"] .panel,
:root[data-scheme="dark"] .surface { background: var(--surface); }
:root[data-scheme="dark"] img:not([src$=".svg"]) { filter: brightness(.94); }

/* Share row on articles (Settings -> Content -> Show share buttons). */
.sharebar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 18px 0 4px;
  font-size: 0.85rem;
}
.sharebar > span { color: var(--muted, #6b7280); font-weight: 600; }
.sharebar a {
  border: 1px solid var(--line, #e5e7eb);
  border-radius: var(--radius-pill, 999px);
  padding: 5px 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color .18s ease, background .18s ease;
}
.sharebar a:hover { border-color: var(--brand, #1d4ed8); background: var(--brand-tint, rgba(29,78,216,.08)); }
