/* =========================================================
   A2B Web Studio — base styles (v0.1)
   Shared by every page: page defaults, text, buttons.
   Uses ROLE tokens from tokens.css only.
   ========================================================= */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--colour-background);
  color: var(--colour-text);
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  line-height: var(--line-height-body);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 400;              /* DM Serif Display has one weight */
  line-height: var(--line-height-heading);
  margin: 0;
  text-wrap: balance;            /* spreads words evenly across lines */
}

p { margin: 0; text-wrap: pretty; }

a { color: var(--colour-link); }

/* Keyboard users can always see where they are */
:focus-visible {
  outline: 3px solid var(--colour-focus);
  outline-offset: 3px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--tap-target-min);
  padding: var(--space-3) var(--space-5);
  border: 0;
  border-radius: var(--radius-small);
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-strong);
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 1.25em; height: 1.25em; flex: none; }

.btn--primary { background: var(--colour-action); color: var(--colour-on-action); }
.btn--primary:hover { background: var(--colour-action-hover); }

.btn--whatsapp { background: var(--colour-whatsapp); color: var(--colour-on-whatsapp); }
.btn--whatsapp:hover { filter: brightness(0.95); }

/* "Skip to the main content": the first stop for keyboard users; only shows when focused */
.skip-link {
  position: absolute;
  left: var(--space-3);
  top: var(--space-3);
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-small);
  background: var(--colour-surface);
  color: var(--colour-link);
  font-weight: var(--weight-strong);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }
main:focus { outline: none; }   /* focus lands here after "skip"; no ring around the whole page */

/* Hidden on screen, still read out by screen readers */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Visitors whose device asks for less motion get none */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Page sections ---------- */
/* Every block sits in a .section; .container keeps content to the page width */
.section { padding: var(--space-8) 0; }
.container {
  width: 100%;
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
}
@media (min-width: 48rem) {
  .section { padding: var(--space-9) 0; }
  .container { padding: 0 var(--space-6); }
}

/* Small uppercase label above section headings */
.eyebrow {
  font-size: var(--text-small);
  font-weight: var(--weight-strong);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--colour-accent);
  margin-bottom: var(--space-3);
}

/* Fade-up as a block scrolls into view. How much it moves comes from the Motion
   tokens (tokens.css section 7): still = not at all, gentle, lively.
   Uses the browser's own scroll timeline (no JavaScript).
   Browsers that don't support it simply show the block. */
@supports (animation-timeline: view()) {
  .reveal {
    animation: reveal-up linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 40%;
  }
  @keyframes reveal-up {
    from { opacity: var(--motion-fade-from, 0); transform: translateY(var(--motion-rise, 16px)); }
    to   { opacity: 1; transform: none; }
  }

  /* Lively only: cards and list items arrive one after another
     (at the other levels the tokens make this do nothing). */
  .trip, .highlight, .dests__list > li {
    animation: reveal-item linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 55%;
  }
  .trip:nth-child(2), .highlight:nth-child(2), .dests__list > li:nth-child(2) { animation-range: entry 10% entry 65%; }
  .trip:nth-child(3), .highlight:nth-child(3), .dests__list > li:nth-child(3) { animation-range: entry 20% entry 75%; }
  .trip:nth-child(n+4), .highlight:nth-child(n+4), .dests__list > li:nth-child(n+4) { animation-range: entry 30% entry 85%; }
  @keyframes reveal-item {
    from { opacity: var(--motion-item-from, 1); transform: translateY(var(--motion-item-rise, 0px)); }
    to   { opacity: 1; transform: none; }
  }
}
@media print { .reveal, .trip, .highlight, .dests__list > li { animation: none !important; } }

/* Staging notice: only on staging builds, never on live pages
   (moved here from topbar.css so every page type has it) */
.staging-note {
  background: var(--colour-tag);
  color: var(--colour-on-tag);
  font-size: var(--text-small);
  text-align: center;
  padding: var(--space-2) var(--space-4);
}

/* Marks sample content so nobody mistakes it for real (moved here from reviews.css) */
.sample-badge {
  display: inline-block;
  margin-left: var(--space-2);
  padding: 0 var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--colour-tag);
  color: var(--colour-on-tag);
  font-size: 0.75rem;
  font-weight: var(--weight-strong);
  vertical-align: middle;
}
