/* ==========================================================================
   Tours Bénies — base + components
   Depends on tokens.css
   ========================================================================== */

/* --- Reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--tb-surface);
  color: var(--tb-ink);
  font-family: var(--tb-font-body);
  font-size: var(--tb-size-body);
  line-height: var(--tb-leading-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

/* Visible focus everywhere. Non-negotiable. */
:focus-visible {
  outline: 2px solid var(--tb-gold-700);
  outline-offset: 3px;
  border-radius: var(--tb-radius-sm);
}

.tb-sr {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.tb-skip {
  position: absolute; top: -100%; left: var(--tb-gutter); z-index: 999;
  background: var(--tb-forest-700); color: var(--tb-cream);
  padding: .75rem 1.25rem; border-radius: var(--tb-radius-sm);
}
.tb-skip:focus { top: 1rem; }

/* --- Layout --------------------------------------------------------------- */
.tb-wrap {
  width: 100%; max-width: var(--tb-max);
  margin-inline: auto; padding-inline: var(--tb-gutter);
}
.tb-wrap--text { max-width: var(--tb-max-text); }

.tb-section { padding-block: var(--tb-section); position: relative; }
.tb-section--tight { padding-block: calc(var(--tb-section) * .62); }

.tb-section--blush { background: var(--tb-blush-50); }
.tb-section--sand  { background: var(--tb-sand-soft); }
.tb-section--gold  { background: var(--tb-gold-100); }
.tb-section--dark  { background: var(--tb-surface-dark); color: var(--tb-cream); }

/* The hero is a dark surface too but is not a .tb-section--dark, so it was
   inheriting light-theme text colours: the lead measured 2.3:1 and the
   eyebrow 2.67:1 against the forest. Every dark-context rule below is keyed
   to both, so a new dark surface cannot drift out of contract again. */
:is(.tb-section--dark, .tb-hero) :is(.tb-lead, .tb-body) { color: rgba(251, 248, 244, .78); }

/* --- Typography ----------------------------------------------------------- */
.tb-display, h1, h2, h3 {
  font-family: var(--tb-font-display);
  font-weight: 500;
  line-height: var(--tb-leading-head);
  letter-spacing: var(--tb-track-display);
  color: var(--tb-forest-700);
  text-wrap: balance;
}
:is(.tb-section--dark, .tb-hero) :is(h1,h2,h3,.tb-display) { color: var(--tb-cream); }

.tb-hero-title { font-size: var(--tb-size-hero); line-height: var(--tb-leading-display); }
h1, .tb-h1 { font-size: var(--tb-size-h1); }
h2, .tb-h2 { font-size: var(--tb-size-h2); }
h3, .tb-h3 { font-size: var(--tb-size-h3); }

/* The one flourish: italic serif on the closing phrase of a headline.
   Mirrors the wordmark's TOURS(light) / BÉNIES(bold) two-tone split. */
.tb-display em, .tb-em {
  font-style: italic;
  font-weight: 400;
  color: var(--tb-gold-700);
}
:is(.tb-section--dark, .tb-hero) :is(.tb-display em, .tb-em) { color: var(--tb-gold-300); }

.tb-lead {
  font-size: var(--tb-size-lead);
  line-height: 1.58;
  color: var(--tb-ink-soft);
  max-width: 58ch;
  text-wrap: pretty;
}
.tb-body { max-width: var(--tb-measure); text-wrap: pretty; }
.tb-body + .tb-body { margin-top: var(--tb-space-3); }

/* Eyebrow — the wordmark's wide tracking, used as a system-wide label. */
.tb-eyebrow {
  display: flex; align-items: center; gap: .75rem;
  font-size: var(--tb-size-micro);
  font-weight: 700;
  letter-spacing: var(--tb-track-eyebrow);
  text-transform: uppercase;
  color: var(--tb-gold-700);
  margin-bottom: var(--tb-space-3);
}
.tb-eyebrow::before {
  content: ""; width: 2.25rem; height: 1px; flex: none;
  background: currentColor; opacity: .55;
}
.tb-eyebrow--center { justify-content: center; }
.tb-eyebrow--center::after {
  content: ""; width: 2.25rem; height: 1px; flex: none;
  background: currentColor; opacity: .55;
}
:is(.tb-section--dark, .tb-hero) .tb-eyebrow { color: var(--tb-gold-300); }

/* Slogan — her two taglines, set as a recurring signature mark. */
.tb-slogan {
  font-family: var(--tb-font-display);
  font-style: italic;
  font-size: var(--tb-size-h3);
  color: var(--tb-gold-700);
  line-height: 1.3;
}
:is(.tb-section--dark, .tb-hero) .tb-slogan { color: var(--tb-gold-300); }

.tb-center { text-align: center; }
.tb-center :is(.tb-lead, .tb-body) { margin-inline: auto; }

/* --- Buttons -------------------------------------------------------------- */
.tb-btn {
  --_bg: var(--tb-forest-700);
  --_fg: var(--tb-cream);
  --_bd: var(--tb-forest-700);
  display: inline-flex; align-items: center; justify-content: center;
  gap: .625rem;
  padding: 1rem 2rem;
  min-height: 48px;                       /* touch target floor */
  background: var(--_bg); color: var(--_fg);
  border: 1px solid var(--_bd);
  border-radius: var(--tb-radius-sm);
  font-size: var(--tb-size-small);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--tb-dur-fast) var(--tb-ease),
              color var(--tb-dur-fast) var(--tb-ease),
              border-color var(--tb-dur-fast) var(--tb-ease),
              transform var(--tb-dur-fast) var(--tb-ease);
}
.tb-btn:hover { --_bg: var(--tb-forest-500); --_bd: var(--tb-forest-500); transform: translateY(-1px); }
.tb-btn:active { transform: translateY(0); }

.tb-btn--ghost {
  /* forest-700 inverts to #17281A in the dark theme — 1.21:1 on the dark
     CTA fill. --tb-ink tracks the surface in both themes. */
  --_bg: transparent; --_fg: var(--tb-ink); --_bd: var(--tb-sand);
}
.tb-btn--ghost:hover {
  --_bg: transparent; --_fg: var(--tb-gold-700); --_bd: var(--tb-gold-500);
}

.tb-btn--blush { --_bg: var(--tb-blush-500); --_fg: #4A2A1C; --_bd: var(--tb-blush-500); }
.tb-btn--blush:hover { --_bg: var(--tb-blush-300); --_bd: var(--tb-blush-300); }

:is(.tb-section--dark, .tb-hero) .tb-btn--ghost {
  --_fg: var(--tb-cream); --_bd: var(--tb-rule-dark);
}
:is(.tb-section--dark, .tb-hero) .tb-btn--ghost:hover { --_fg: var(--tb-gold-300); --_bd: var(--tb-gold-300); }

/* Gold metallic hairline ring on the primary CTA. */
.tb-btn--gold {
  --_fg: var(--tb-forest-900);
  background: var(--tb-gold-metal);
  background-size: 220% 100%;
  background-position: 0% 50%;
  border-color: transparent;
  transition: background-position var(--tb-dur-slow) var(--tb-ease),
              transform var(--tb-dur-fast) var(--tb-ease);
}
.tb-btn--gold:hover { background-position: 100% 50%; transform: translateY(-1px); }

.tb-btn-row {
  display: flex; flex-wrap: wrap; gap: var(--tb-space-2);
  margin-top: var(--tb-space-4);
}
.tb-center .tb-btn-row { justify-content: center; }

/* Text link with a rule that draws in on hover. */
.tb-link {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: var(--tb-size-small); font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--tb-gold-700);
  padding-bottom: .25rem;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size var(--tb-dur-base) var(--tb-ease);
}
.tb-link:hover { background-size: 100% 1px; }
.tb-link svg { transition: transform var(--tb-dur-base) var(--tb-ease); }
.tb-link:hover svg { transform: translateX(4px); }

/* --- Rules ---------------------------------------------------------------- */
.tb-rule { height: 1px; background: var(--tb-rule); border: 0; }
.tb-rule--gold {
  height: 1px; border: 0;
  background: linear-gradient(90deg, transparent, var(--tb-gold-500), transparent);
  opacity: .6;
}

/* --- Photo placeholders --------------------------------------------------
   The client has no dessert-display photography yet. Rather than invent it,
   every image slot renders a labelled, correctly-proportioned placeholder so
   she can see the layout AND know exactly which shot to send for each slot.
   -------------------------------------------------------------------------- */
.tb-ph {
  position: relative;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: .5rem;
  background:
    repeating-linear-gradient(-45deg,
      transparent 0 11px,
      rgba(180, 137, 79, .05) 11px 22px),
    var(--tb-blush-100);
  border: 1px dashed rgba(180, 137, 79, .40);
  border-radius: var(--tb-radius-md);
  color: var(--tb-gold-700);
  text-align: center;
  padding: var(--tb-space-3);
  overflow: hidden;
}
.tb-ph__icon { width: 34px; height: 34px; opacity: .45; }
.tb-ph__label {
  font-size: var(--tb-size-micro);
  font-weight: 800;
  letter-spacing: var(--tb-track-eyebrow);
  text-transform: uppercase;
  line-height: 1.5;
  /* gold-700 measured 4.04:1 on the blush fill — just under the floor. */
  color: var(--tb-gold-900);
}
.tb-ph__meta {
  font-size: .6875rem;
  letter-spacing: .06em;
  /* ink-faint measured 3.41:1 on the dark-theme placeholder fill — under the
     4.5 floor for 11px text. ink-soft clears it in both themes (4.7 / 6.9). */
  color: var(--tb-ink-soft);
  text-transform: uppercase;
}

/* Aspect helpers */
.tb-ar-1x1   { aspect-ratio: 1 / 1; }
.tb-ar-4x5   { aspect-ratio: 4 / 5; }
.tb-ar-3x4   { aspect-ratio: 3 / 4; }
.tb-ar-3x2   { aspect-ratio: 3 / 2; }
.tb-ar-16x9  { aspect-ratio: 16 / 9; }

.tb-figure { position: relative; overflow: hidden; border-radius: var(--tb-radius-md); }
.tb-figure img { width: 100%; height: 100%; object-fit: cover; }

/* Photographs of people crop badly from the centre — the face sits in the
   upper third, so a centred cover crop takes the head off. */
.tb-figure--portrait img { object-position: center 22%; }

/* Arch-topped frame — the tower silhouette as a photo mask. */
.tb-figure--arch { border-radius: var(--tb-radius-arch); }

/* --- Reveal on scroll ------------------------------------------------------
   Elements start hidden only when JS is present (the .tb-js gate), so the
   page is fully readable with JS disabled or if the observer never fires. */
.tb-js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity var(--tb-dur-slow) var(--tb-ease),
              transform var(--tb-dur-slow) var(--tb-ease);
  transition-delay: var(--_d, 0ms);
}
.tb-js [data-reveal].is-in { opacity: 1; transform: none; }

/* --- Vertical rhythm -------------------------------------------------------
   The reset zeroes every margin, so the space between a section heading and
   the copy under it is restated once, here. Scoped to h2: h3s live inside
   grid cards whose gap already spaces them. */
h2 + :is(p, .tb-lead, .tb-body, .tb-prose) { margin-top: var(--tb-space-3); }
.tb-lead + .tb-body { margin-top: var(--tb-space-3); }
