/* =============================================================================
 * GHMM — the parts Bulma does not model.
 *
 * Everything Bulma already has a token for lives in variables.css as a
 * `--bulma-*` value: colours, type scale, radii, button and input geometry,
 * titles, modals. This file is only for genuinely new components — the wave
 * backdrops, the dark marketing bands, the responsive video wrapper.
 *
 * If you find yourself writing `!important` here, the rule almost certainly
 * belongs in variables.css as a Bulma token instead.
 * ========================================================================== */

/* ===== FOCUS ================================================================
 * Bulma's default focus is a soft box-shadow, and the GHMM theme switches that
 * off (`--bulma-button-outer-shadow-a: 0`) to get Bubble's flat buttons. That
 * left keyboard focus invisible on the dashed button, which is most of the
 * app's controls.
 *
 * :focus-visible rather than :focus, so a mouse click does not leave a ring
 * behind. Orange on paper is 3.45:1, which clears the 3:1 WCAG asks of a
 * non-text indicator; the offset keeps it clear of the 2px dashed border it
 * sits outside.
 * ========================================================================== */

:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--ghmm-orange);
  outline-offset: 2px;
}

/* The skip link: off screen until it is focused, then the first thing on the
   page. Every careers screen repeats the same header, so a keyboard user
   otherwise tabs through it on the way to the content each time. */
.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background-color: var(--ghmm-olive);
  color: var(--ghmm-paper);
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
  top: 0;
}

/* ===== WAVE BACKDROPS =======================================================
 * Every page in the Bubble app except the home page sits on a full-bleed
 * layered-wave SVG, keyed to the page. Set --wave on <body> and this does the
 * rest; the SVGs are already in static/images/.
 * ========================================================================== */

/* A column layout so short pages still fill the viewport and the footer sinks
   to the bottom instead of floating halfway up an empty page. */
body {
  background-color: var(--ghmm-paper);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1 0 auto;
}

body.ghmm-waves {
  background-image: var(--wave);
  background-repeat: no-repeat;
  background-position: bottom center;
  /* Full width at the SVG's own aspect ratio, anchored to the bottom. Every
     wave is 900x450, so the band is always half the viewport width tall — 720px
     at 1440, 187px at 375. `cover` is what Bubble sets, and it looks the same
     on a short page, but the careers dashboard runs to nearly 3000px and
     `cover` stretches the wave across the whole of it. */
  background-size: 100% auto;
}

/* Keep content clear of the wave. Without this a short page — signup on a
   phone, say — puts its last row of controls straight on top of the crest,
   where dark text on orange is barely readable. */
body.ghmm-waves main {
  padding-bottom: 6rem;
}

@media screen and (max-width: 768px) {
  /* At 375px the wave is 187px tall, so this is the clearance that guarantees
     the last control never lands on the crest. */
  body.ghmm-waves main {
    padding-bottom: 13rem;
  }
}

/* Login and signup are the only two pages Bubble centres rather than anchoring
   to the bottom, and it is visible — the wave sits higher up the page. `cover`
   keeps it reaching the bottom edge; at natural aspect a centred wave would
   leave a band of bare paper beneath it. Desktop only: on a phone a 2:1 wave
   scaled to `cover` swallows most of the screen. */
@media screen and (min-width: 769px) {
  body.ghmm-waves.is-centred {
    background-position: center;
    background-size: cover;
  }
}

/* ===== LONG-FORM DOCUMENTS ==================================================
 * The terms page: 11,000 characters that someone may actually have to read.
 * Bubble renders the whole thing as one small-text element at full page width,
 * with two of its fourteen section titles carrying no heading markup at all.
 * The measure and the heading hierarchy come from `pages/_page.html` and this
 * block; nothing here sets a colour or a size that is not already a token.
 * ========================================================================== */

.legal-document > h2 {
  /* Bulma's .content spaces headings for articles, not for a document with
     fourteen sections. More air above each one, so the structure is legible
     while scrolling rather than only when read. */
  margin-top: var(--spacing-3xl);
}

.legal-document > h2:first-of-type {
  margin-top: var(--spacing-xl);
}

/* Consecutive lists under one heading are the source's own grouping, kept
   because merging clauses in a legal document changes what it says. Even
   spacing is what makes the fragmentation stop looking like an accident. */
.legal-document ul + ul {
  margin-top: var(--spacing-md);
}

.legal-updated {
  color: var(--color-text-grey);
  font-style: italic;
}

/* ===== NAVBAR AND FOOTER ==================================================== */

.ghmm-navbar {
  background-color: var(--ghmm-paper);
  box-shadow: var(--shadow-sm);
  /* Bubble's marketing header is taller than Bulma's 3.25rem, because the CTA
     inside it is a 24px button rather than a 16px one. The two go together —
     sizing the button up inside a 52px bar just overflows it. */
  --bulma-navbar-height: 4.5rem;
}

/* The marketing call to action, at Bubble's 24px against Bulma's 16px. Scoped
   deliberately: the careers screens were reviewed against their own captures at
   16px and are not part of this. `.is-cta` carries the same size onto the one
   in-page button that Bubble also sets at 24px, the contact form's Submit.
   Vertical padding comes back a little so the pair still fits the bar. */
.ghmm-navbar .buttons .button,
.button.is-cta {
  font-size: 1.5rem;
  --bulma-button-padding-vertical: 0.5em;
}

/* Below the phone breakpoint the navbar collapses to a burger menu and the
   buttons stack full-width inside it, where 24px is simply too big. */
@media screen and (max-width: 1023px) {
  .ghmm-navbar .buttons .button {
    font-size: 1.125rem;
  }
}

.navbar-item:hover,
.navbar-link:hover {
  background-color: rgba(var(--ghmm-orange-rgb), 0.05);
  color: var(--ghmm-orange);
}

/* Bubble's footer everywhere: two items spread across a 1000px row, sitting on
   the page background — or on the wave, on the pages that have one. */
.wave-footer {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  justify-content: space-around;
  align-items: center;
  max-width: 1000px;
  min-height: 150px;
  margin: var(--spacing-3xl) auto 0;
  padding: 0 var(--spacing-md);
  font-size: var(--font-size-xl);
}

.wave-footer a {
  color: inherit;
}

/* ===== MARKETING BANDS =====================================================
 * The home page alternates full-bleed olive bands with paper ones. Bulma's own
 * .is-dark modifier means something else on a .section, so these keep their
 * GHMM names rather than colliding with it.
 * ========================================================================== */

.section.is-light {
  background-color: var(--ghmm-paper);
}

.section.is-dark,
.hero.is-ghmm-dark {
  background-color: var(--ghmm-olive);
  color: var(--ghmm-paper);
}

.section.is-dark :is(h1, h2, h3, h4, h5, h6, p, li, strong, .title, .subtitle, .content),
.hero.is-ghmm-dark :is(h1, h2, h3, h4, h5, h6, p, li, strong, .title, .subtitle, .content) {
  color: var(--ghmm-paper);
}

.hero.is-ghmm {
  background-color: var(--ghmm-paper);
}

/* ===== MARKETING COMPONENTS =================================================
 * The three GHMM bands are a list of questions, each marked by a ringed dot in
 * the category colour — not the boxed cards this page used to carry. The "How
 * it works" steps put their caption on an olive plate above the screenshot.
 * ========================================================================== */

.ghmm-question-list {
  list-style: none;
  margin: 0;
  font-size: var(--font-size-xl);
}

.ghmm-question-list li {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md) 0;
}

.ghmm-dot {
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: var(--bulma-radius-rounded);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.9);
}

.ghmm-dot.is-greatest { background-color: var(--ghmm-teal); }
.ghmm-dot.is-happiest { background-color: var(--ghmm-orange); }
.ghmm-dot.is-motivated { background-color: var(--ghmm-yellow); }

.step-caption {
  background-color: var(--ghmm-olive);
  color: var(--ghmm-paper);
  border-radius: var(--bulma-radius);
  padding: var(--spacing-md) var(--spacing-lg);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--spacing-md);
}

.step-shot img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--bulma-radius);
  box-shadow: var(--shadow-md);
}

/* ===== CATEGORY COLOUR UTILITIES ===========================================
 * The three GHMM words are colour-coded wherever they appear in prose. Bulma's
 * own has-text-* helpers cover success/warning/danger, but reading
 * "has-text-success" when you mean "Greatest" is how the palette drifts.
 *
 * The dark bands force their own text colour, so these have to win there —
 * that is the whole point of colouring the word in the first place.
 * ========================================================================== */

/* Bulma gives .help display:block, overriding the browser's [hidden] rule.
 * Validation messages must disappear when their form clears them. */
.help[hidden] { display: none; }

.text-greatest,
.section.is-dark .text-greatest { color: var(--ghmm-teal); }

.text-happiest,
.section.is-dark .text-happiest { color: var(--ghmm-orange); }

.text-motivated,
.section.is-dark .text-motivated { color: var(--ghmm-yellow); }

/* ===== VIDEO EMBEDS =========================================================
 * One definition, used by the goal steps and the home page. The goal-step
 * template used to carry a second, conflicting copy in an inline <style>.
 * ========================================================================== */

.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--ghmm-radius-card);
  overflow: hidden;
  background: #000;
}

.video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ===== RESPONSIVE ========================================================== */

@media screen and (max-width: 768px) {
  .section {
    padding: 2rem 1.5rem;
  }

  .wave-footer {
    min-height: 100px;
    font-size: var(--font-size-lg);
    text-align: center;
  }
}
