/*
Theme Name: Samba Foundation
Theme URI: https://samba.foundation
Author: Samba Foundation
Description: Block theme (Full Site Editing) for samba.foundation. Editorial layout, Samba red accent, gitter motif. Core blocks plus three custom blocks (jump nav, fact list, tier table). Built for WCAG 2.1 AA / BITV 2.0.
Requires at least: 7.0
Tested up to: 7.0
Requires PHP: 8.1
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: samba-foundation
Tags: full-site-editing, block-patterns, accessibility-ready, translation-ready
*/

/* Everything visual lives in theme.json. This file carries only what theme.json
   cannot express: the tablet breakpoint, sticky offsets and focus visibility. */

:root { --samba-header-height: 64px; }

/* ---- Focus visibility (WCAG 2.4.7 / BITV 9.2.4.7) ---------------------- */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--wp--preset--color--brand-red);
  outline-offset: 2px;
  border-radius: 2px;
}
.samba-skip-link:focus {
  position: fixed; top: 8px; left: 8px; z-index: 999;
  background: #fff; color: #1A1A1B; padding: 12px 18px;
  border: 2px solid var(--wp--preset--color--brand-red); border-radius: 4px;
}

/* ---- Sticky jump navigation ------------------------------------------- */
.wp-block-samba-jump-nav { position: sticky; top: 0; z-index: 40; }
.wp-block-samba-jump-nav a { border-bottom: 1px solid transparent; }
.wp-block-samba-jump-nav a:hover,
.wp-block-samba-jump-nav a:focus-visible {
  color: var(--wp--preset--color--brand-red);
  border-bottom-color: var(--wp--preset--color--brand-red);
}
:where([id]) { scroll-margin-top: calc(var(--samba-header-height) + 24px); }

/* ---- Editorial two-column rhythm --------------------------------------
   Core Columns stack only at 782px. The text + facts layout needs to stack
   one step earlier, hence the explicit tablet breakpoint. */
@media (max-width: 1024px) {
  .samba-editorial-row { flex-wrap: wrap !important; }
  .samba-editorial-row > .wp-block-column { flex-basis: 100% !important; }
  .samba-editorial-row > .wp-block-column + .wp-block-column { margin-top: var(--wp--preset--spacing--40); }
}
@media (max-width: 782px) {
  .wp-block-samba-jump-nav { position: static; }
  .wp-block-samba-jump-nav ul { overflow-x: auto; flex-wrap: nowrap !important; }
}

/* ---- Gitter cover: keep the motif from cutting a hard vertical seam ---- */
.samba-cover-gitter > .wp-block-cover__image-background {
  object-position: right center;
  -webkit-mask-image: linear-gradient(90deg, transparent 8%, #000 60%);
  mask-image: linear-gradient(90deg, transparent 8%, #000 60%);
}

/* ---- Tables ------------------------------------------------------------ */
.wp-block-samba-tier-table table { border-collapse: collapse; width: 100%; }
.wp-block-samba-tier-table caption { text-align: left; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
