/* =============================================================
   BBI - Base
   assets/css/base.css

   1. (Optional) self-hosted @font-face — brand fonts normally load via
      Adobe Typekit (header.php) and Google Fonts (enqueue.php: Zalando, Azeret).
   2. CSS reset / normalise rules.
   3. Base element typography.

   Brand fonts load from Typekit (header.php) + Google (enqueue.php). The
   block below is only for optional self-hosted woff2 overrides.
   ============================================================= */

/* -------------------------------------------------------------
   1. (Optional) self-hosted @font-face
      If used, family names must match --font-* tokens in tokens.css.
   ------------------------------------------------------------- */

/*
@font-face {
  font-family: "neue-haas-grotesk-display";
  src: url("../fonts/neue-haas-grotesk-display-pro-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Zalando Sans";
  src: url("../fonts/zalando-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Zalando Sans";
  src: url("../fonts/zalando-sans-300-italic.woff2") format("woff2");
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "eroika-slab";
  src: url("../fonts/eroika-slab-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
*/

/* -------------------------------------------------------------
   2. Reset / normalise
   ------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* Prevent rogue horizontal scrolling on mobile when a long word or a
     fixed-pixel element exceeds the viewport width. Vertical scrolling
     stays fully intact. */
  overflow-x: hidden;
}

::-webkit-scrollbar {
  display: none;
}

body {
  margin: 0;
  background-color: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Defensive belt-and-braces — keeps narrow mobile viewports clean even
     when individual components forget their own min-width:0. */
  overflow-x: hidden;
  max-width: 100%;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--space-4);
  font-family: var(--font-display);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
  color: var(--color-text);
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl);  }
h5 { font-size: var(--font-size-lg);  }
h6 { font-size: var(--font-size-md);  }

p {
  margin: 0 0 var(--space-4);
}

a {
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
  transition: color var(--transition-fast);
}

a:focus-visible {
  outline: 2px solid var(--color-accent-blue);
  outline-offset: 2px;
}

img,
picture,
video,
canvas,
svg,
iframe {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Long URLs / hashtags / unbroken strings should wrap on narrow screens
   instead of forcing horizontal scroll. Use `break-word` (not `anywhere`)
   so normal copy still breaks at spaces and only ultra-long tokens split. */
p, h1, h2, h3, h4, h5, h6, li, dt, dd, blockquote, figcaption,
.bbi-card__title,
.bbi-section-heading,
.bbi-prose {
  overflow-wrap: break-word;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-accent-blue);
  outline-offset: 2px;
}

ul,
ol {
  margin: 0 0 var(--space-4);
  padding-left: var(--space-6);
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding-left: 0;
}

hr {
  border: 0;
  border-top: var(--border-width) solid var(--color-border);
  margin: var(--space-8) 0;
}

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

/* -------------------------------------------------------------
   3. Accessibility utilities
   ------------------------------------------------------------- */

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  -webkit-clip-path: inset(50%);
  clip-path: inset(50%);
  height: 1px;
  width: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: var(--color-background);
  border-radius: var(--button-radius);
  -webkit-clip-path: none;
  clip-path: none;
  color: var(--color-text);
  clip: auto !important;
  display: block;
  font-weight: var(--font-weight-bold);
  height: auto;
  left: var(--space-4);
  padding: var(--space-3) var(--space-4);
  position: absolute !important;
  text-decoration: none;
  top: var(--space-4);
  width: auto;
  z-index: var(--z-top);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}

.skip-link:focus,
.skip-link:focus-visible {
  left: var(--space-4);
  top: var(--space-4);
  z-index: var(--z-top);
  background-color: var(--color-text);
  color: var(--color-background);
  padding: var(--space-2) var(--space-4);
  text-decoration: none;
}

/* WordPress-required core helper classes (set by post_class()/body_class()) */
.alignleft   { float: left;  margin: 0 var(--space-4) var(--space-4) 0; }
.alignright  { float: right; margin: 0 0 var(--space-4) var(--space-4); }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignwide   { max-width: var(--container-max); margin-left: auto; margin-right: auto; }
.alignfull   { width: 100%; }

.wp-caption,
.gallery-caption {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
}
