/* ==========================================================================
   Barrel Below — GLOBAL LAYER
   Tokens + shared components used by every section snippet.
   In Squarespace this goes ONCE into Design → Custom CSS (see SQUARESPACE.md).
   Everything is prefixed bb- so it never clashes with the theme.

   Look (2026-11-21): taken from the Barrel Below logo: black, cream, gold
   and oxblood, a fine serif for headings, uppercase letter-spaced labels,
   square edges, lots of space. Layout inspired by eaudevie.com.au/sydney.
   ========================================================================== */

:root {
  /* Logo palette */
  --bb-ink: #0D0C0B;          /* page black (logo disc) */
  --bb-ink-2: #171513;        /* raised surface on black */
  --bb-ink-3: #2C2823;        /* hairlines / borders on black */
  --bb-cream: #EFEADD;        /* logo cream: light sections */
  --bb-paper: #F6F2E8;        /* lighter cream for alternating sections */
  --bb-text: #1A1714;         /* body text on cream */
  --bb-gold: #BFAB71;         /* logo gold: accents, solid buttons (ink text on it) */
  --bb-gold-hover: #D2C18D;
  --bb-gold-deep: #6F5B2C;    /* gold for small text on cream (AA 4.9:1) */
  --bb-oxblood: #4E211E;      /* logo variant C: feature bands */
  --bb-muted-dark: rgba(239, 234, 221, .74);  /* secondary text on black (AA) */
  --bb-muted-light: rgba(26, 23, 20, .74);    /* secondary text on cream (AA) */
  --bb-rule-dark: rgba(191, 171, 113, .35);   /* gold hairline on black */
  --bb-rule-light: rgba(26, 23, 20, .16);     /* hairline on cream */

  /* Older names from Phase 1, kept as aliases so nothing breaks */
  --bb-night: var(--bb-ink);
  --bb-night-2: var(--bb-ink-2);
  --bb-night-3: var(--bb-ink-3);
  --bb-warm: var(--bb-cream);
  --bb-brown: var(--bb-text);
  --bb-orange: var(--bb-gold);
  --bb-orange-hover: var(--bb-gold-hover);

  /* Type: Playfair Display echoes the logo's high-contrast "B" and italic "elow" */
  --bb-font-display: 'Playfair Display', 'Didot', Georgia, 'Times New Roman', serif;
  --bb-font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --bb-text-xs: .75rem;     /* 12px: labels */
  --bb-text-sm: .9375rem;   /* 15px */
  --bb-text-md: 1.0625rem;  /* 17px */
  --bb-text-lg: clamp(1.125rem, 1.05rem + .4vw, 1.3rem);
  --bb-text-xl: clamp(2rem, 1.5rem + 2.2vw, 3.25rem);
  --bb-text-2xl: clamp(2.6rem, 1.7rem + 4.4vw, 5.5rem);
  --bb-label-tracking: .28em;

  /* Layout */
  --bb-max: 1240px;
  --bb-gutter: clamp(16px, 4vw, 48px);
  --bb-section-y: clamp(72px, 10vw, 140px);
  --bb-radius: 0px;
  --bb-radius-sm: 2px;
  --bb-pill: 0px;
  --bb-tap: 44px;
  --bb-ease: cubic-bezier(.2, .7, .2, 1);
  --bb-shadow: 0 20px 50px rgba(0, 0, 0, .35);

  --bb-focus: var(--bb-ink);
}

/* Surfaces ---------------------------------------------------------------- */
.bb-on-dark   { background: var(--bb-ink);     color: var(--bb-cream); --bb-focus: var(--bb-gold); }
.bb-on-light  { background: var(--bb-cream);   color: var(--bb-text);  --bb-focus: var(--bb-text); }
.bb-on-paper  { background: var(--bb-paper);   color: var(--bb-text);  --bb-focus: var(--bb-text); }
.bb-on-oxblood{ background: var(--bb-oxblood); color: var(--bb-cream); --bb-focus: var(--bb-gold); }

[class*="bb-"] :focus-visible,
[class*="bb-"]:focus-visible {
  outline: 2px solid var(--bb-focus);
  outline-offset: 3px;
}

/* Layout helpers ---------------------------------------------------------- */
.bb-wrap {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--bb-max);
  margin-inline: auto;
  padding-inline: var(--bb-gutter);
}
.bb-section { padding-block: var(--bb-section-y); font-family: var(--bb-font-body); font-size: var(--bb-text-md); line-height: 1.7; }
.bb-section *, .bb-section *::before, .bb-section *::after { box-sizing: border-box; }

.bb-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* Section header: centred label + serif title + short intro */
.bb-head { max-width: 720px; margin: 0 auto clamp(40px, 6vw, 72px); text-align: center; }
.bb-head .bb-lede { margin-inline: auto; }

/* Uppercase letter-spaced label */
.bb-label {
  display: inline-block;
  font-family: var(--bb-font-body);
  font-size: var(--bb-text-xs);
  font-weight: 700;
  letter-spacing: var(--bb-label-tracking);
  line-height: 1.5;
  text-transform: uppercase;
  margin: 0 0 1.1rem;
}
.bb-on-dark .bb-label, .bb-on-oxblood .bb-label { color: var(--bb-gold); }
.bb-on-light .bb-label, .bb-on-paper .bb-label { color: var(--bb-gold-deep); }

/* Label with hairlines either side: — LABEL — */
.bb-label--rule { display: inline-flex; align-items: center; gap: 1rem; }
.bb-label--rule::before, .bb-label--rule::after {
  content: ""; width: 36px; height: 1px; background: currentColor; opacity: .6;
}

.bb-display, .bb-title {
  font-family: var(--bb-font-display);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -.01em;
  margin: 0;
}
.bb-title { font-size: var(--bb-text-xl); margin-bottom: 1.25rem; }
.bb-title em, .bb-display em { font-style: italic; }
.bb-on-dark .bb-title em, .bb-on-dark .bb-display em,
.bb-on-oxblood .bb-title em { color: var(--bb-gold); }

.bb-lede { max-width: 56ch; margin: 0 0 2rem; font-size: var(--bb-text-lg); line-height: 1.6; }
.bb-on-dark .bb-lede, .bb-on-oxblood .bb-lede { color: var(--bb-muted-dark); }
.bb-on-light .bb-lede, .bb-on-paper .bb-lede { color: var(--bb-muted-light); }

/* Small gold ornament: ◆ between hairlines */
.bb-ornament { display: flex; align-items: center; justify-content: center; gap: .75rem; margin: 0 auto 1.5rem; color: var(--bb-gold); }
.bb-ornament::before, .bb-ornament::after { content: ""; width: 48px; height: 1px; background: currentColor; opacity: .7; }
.bb-ornament span { width: 6px; height: 6px; transform: rotate(45deg); background: currentColor; }

/* Buttons: square, uppercase, letter-spaced ------------------------------- */
.bb-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  min-height: 48px;
  padding: .85em 1.9em;
  border: 1px solid transparent;
  border-radius: 0;
  font-family: var(--bb-font-body);
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .2em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background-color .25s var(--bb-ease), color .25s var(--bb-ease), border-color .25s var(--bb-ease);
}

/* Solid gold: ink text (never white on gold) */
.bb-btn--gold, .bb-btn--orange { background: var(--bb-gold); border-color: var(--bb-gold); color: var(--bb-ink); }
.bb-btn--gold:hover, .bb-btn--orange:hover { background: var(--bb-gold-hover); border-color: var(--bb-gold-hover); color: var(--bb-ink); }

/* Outline on dark */
.bb-btn--line-dark, .bb-btn--ghost-dark { background: transparent; color: var(--bb-cream); border-color: rgba(239, 234, 221, .6); }
.bb-btn--line-dark:hover, .bb-btn--ghost-dark:hover { border-color: var(--bb-gold); color: var(--bb-gold); }

/* Outline on light */
.bb-btn--line-light, .bb-btn--ghost-light { background: transparent; color: var(--bb-text); border-color: var(--bb-text); }
.bb-btn--line-light:hover, .bb-btn--ghost-light:hover { background: var(--bb-text); color: var(--bb-cream); }

.bb-btns { display: flex; flex-wrap: wrap; gap: .75rem; }

/* Text link with arrow: READ MORE → */
.bb-more {
  display: inline-flex; align-items: center; gap: .6em; min-height: var(--bb-tap);
  font-family: var(--bb-font-body); font-size: .75rem; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase; text-decoration: none; color: inherit;
}
.bb-more::after { content: "→"; letter-spacing: 0; transition: transform .25s var(--bb-ease); }
.bb-more:hover::after { transform: translateX(4px); }
.bb-on-dark .bb-more:hover { color: var(--bb-gold); }

/* TBC badge: marks unconfirmed facts in the prototype -------------------- */
.bb-tbc {
  display: inline-block;
  margin-left: .4em;
  padding: .05em .45em;
  border: 1px dashed currentColor;
  font-family: var(--bb-font-body);
  font-size: .62rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1.5;
  vertical-align: middle;
  text-transform: uppercase;
  opacity: .85;
}

/* Media placeholder: clearly labelled, never pretends to be the venue ----- */
.bb-ph {
  box-sizing: border-box;
  position: relative;
  display: grid;
  place-content: center;
  gap: .35rem;
  width: 100%;
  aspect-ratio: var(--bb-ph-ratio, 4 / 5);
  margin: 0;
  padding: 1.25rem;
  border: 1px solid currentColor;
  background:
    linear-gradient(135deg, transparent 49.6%, rgba(127, 127, 127, .22) 50%, transparent 50.4%),
    linear-gradient(45deg, transparent 49.6%, rgba(127, 127, 127, .22) 50%, transparent 50.4%),
    rgba(127, 127, 127, .06);
  text-align: center;
  font-family: var(--bb-font-body);
  font-size: var(--bb-text-sm);
}
.bb-ph > * { position: relative; padding: .15rem .5rem; background: inherit; }
.bb-ph__tag {
  font-size: var(--bb-text-xs);
  font-weight: 700;
  letter-spacing: var(--bb-label-tracking);
  text-transform: uppercase;
}
.bb-ph__file { font-family: ui-monospace, Consolas, monospace; font-size: var(--bb-text-xs); opacity: .8; }
.bb-on-dark .bb-ph, .bb-on-oxblood .bb-ph { color: var(--bb-muted-dark); background-color: var(--bb-ink-2); }
.bb-on-light .bb-ph, .bb-on-paper .bb-ph { color: var(--bb-muted-light); background-color: rgba(26, 23, 20, .05); }
.bb-on-dark .bb-ph > *, .bb-on-oxblood .bb-ph > * { background: var(--bb-ink-2); }
.bb-on-light .bb-ph > * { background: var(--bb-cream); }
.bb-on-paper .bb-ph > * { background: var(--bb-paper); }

/* Reduced motion: switch off our animations everywhere -------------------- */
@media (prefers-reduced-motion: reduce) {
  html:not(.bb-force-motion) [class*="bb-"],
  html:not(.bb-force-motion) [class*="bb-"]::before,
  html:not(.bb-force-motion) [class*="bb-"]::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Phone numbers never break across lines */
[class*="bb-"] a[href^="tel:"] { white-space: nowrap; }

/* ==========================================================================
   FULL-SCREEN SNAP SCROLLING (TikTok-style)
   Any page containing .bb-snap sections scrolls one full screen at a time.
   Each .bb-snap fills the screen; its top padding clears the fixed header.
   The header script keeps --bb-header-h equal to the real header height.
   ========================================================================== */
:root { --bb-header-h: 110px; }
@media (min-width: 768px)  { :root { --bb-header-h: 113px; } }
@media (min-width: 1100px) { :root { --bb-header-h: 130px; } }

html:has(.bb-snap) { scroll-snap-type: y mandatory; }

.bb-snap {
  box-sizing: border-box;
  scroll-snap-align: start;
  scroll-snap-stop: always;          /* one swipe = one section */
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.bb-snap.bb-section {
  padding-top: calc(var(--bb-header-h) + clamp(16px, 4vh, 48px));
  padding-bottom: clamp(20px, 4vh, 48px);
}
.bb-snap > .bb-wrap { width: 100%; }
.bb-snap .bb-head { margin-bottom: clamp(20px, 4vh, 44px); }
.bb-snap .bb-title { margin-bottom: clamp(.5rem, 1.6vh, 1.1rem); }
.bb-snap .bb-lede { margin-bottom: clamp(1rem, 3vh, 2rem); }

/* Horizontal swipe rows for cards on phones (keeps each section one screen tall) */
@media (max-width: 767px) {
  .bb-swipe-row {
    display: flex !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 14px !important;
    margin-inline: calc(-1 * var(--bb-gutter));
    padding-inline: var(--bb-gutter);
    scrollbar-width: none;
  }
  .bb-swipe-row::-webkit-scrollbar { display: none; }
  .bb-swipe-row > * { flex: 0 0 78%; scroll-snap-align: center; }
}

/* Desktop: js/bb-snap.js does the gliding, so the browser's own snap steps aside */
html.bb-snap-js { scroll-snap-type: none !important; scroll-behavior: auto !important; }

/* Reveal: each section's content floats up as it arrives (js/bb-snap.js) */
html.bb-reveal-on .bb-reveal {
  opacity: 0;
  translate: 0 56px;
  transition: opacity .9s cubic-bezier(.2, .7, .2, 1), translate 1.1s cubic-bezier(.16, .84, .24, 1);
  transition-delay: calc(var(--bb-i, 0) * 90ms + 180ms);
}
html.bb-reveal-on .bb-snap.bb-in-view .bb-reveal { opacity: 1; translate: 0 0; }
/* Leaving: fade out quickly so it can float in again next time */
html.bb-reveal-on .bb-snap:not(.bb-in-view) .bb-reveal { transition-duration: .35s; transition-delay: 0s; }

/* While a link glide is running, CSS snapping steps aside so they don't fight */
html.bb-gliding { scroll-snap-type: none !important; scroll-behavior: auto !important; }

/* Page-to-page glide (js/bb-snap.js): the old page drifts up and fades,
   the new page rises into place, like scrolling on to the next screen. */
@keyframes bb-page-out { to { opacity: 0; translate: 0 -70px; } }
@keyframes bb-page-in { from { opacity: 0; translate: 0 90px; } }
html.bb-page-out body { animation: bb-page-out .52s cubic-bezier(.5, 0, .75, 0) forwards; pointer-events: none; }
html.bb-page-in body { animation: bb-page-in 1.1s cubic-bezier(.16, .84, .24, 1) backwards; }
html.bb-page-out, html.bb-page-in { background: var(--bb-ink); }
