/**
 * site-common.css - the website's shared chrome.
 *
 * Tier 2 for the web: the reusable component patterns the pages share, built on the tokens in
 * site-theme.css, which is tier 1 (the counterpart of src/frontend/styles/responsiveTheme.js).
 * Before this file, every one of the 22 pages under docs/ carried its own inline copy of the
 * header, nav, burger, language switcher, store badges and legal footer - roughly 200 lines each,
 * and they had already drifted.
 *
 * MIGRATION IN PROGRESS (Documentation/Admin/venue_page_layout.md § 7.2). Only the four venue
 * pages link this file today: the two generated locales and venue{,-bg}.html. The remaining pages
 * adopt it when they are next edited. The rule while that lasts:
 *
 *   A page either carries its own chrome CSS or links this file. Never both.
 *
 * The body rule below is part of the contract: the header is fixed at 60px, so a page that links
 * this file must not set its own padding-top.
 */

body {
  margin: 0;
  padding: 0;
  padding-top: 60px;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--sn-bg);
  color: var(--sn-text);
}

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

/* ── Page fills the screen ────────────────────────────────────────────────────
   Without this, a page shorter than the viewport - a loading state, an empty bookings list,
   a short legal page - ends at its footer and shows the body background below it as a grey
   strip. This is the "sticky footer" layout, which despite the name does NOT pin the footer
   to the viewport: `main` simply absorbs any spare height, so the footer rests at the bottom
   of a short page and scrolls away normally on a long one.

   100vh first, then 100dvh for the browsers that have it: on mobile 100vh ignores the
   retracting browser chrome and overshoots, which would reintroduce a scroll on a page that
   has nothing to scroll. */
body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
body > main { flex: 1 0 auto; }
body > .legal-footer { flex-shrink: 0; }

/* The closing CTA is a sibling of `main`, not its last child, so it lands in the same flex
   column as the footer and the two stay together at the foot of a short page while `main`
   absorbs the spare height. Doing it inside `main` instead - a column with margin-top:auto on
   the CTA - looks equivalent and is not: auto side margins disable `stretch` in a flex
   container, so every block centred with `margin: 0 auto` (the venue shell, the partner page's
   wrap) collapses to its content width. */
body > .secondary-cta { flex-shrink: 0; }

/* ── Fixed header ──────────────────────────────────────────────────────────── */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
}

.site-header .logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.site-header .logo-name {
  color: var(--sn-on-dark);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1.2px;
  white-space: nowrap;
}

.site-header .logo img {
  height: 52px;
  width: 52px;
  display: block;
  /* logo-figures.png carries ~20.4% transparent padding on every side, so at 52px the mark sat
     ~10.6px inside its own box: it read as indented from the header edge, and the wordmark as
     ~21px away rather than the 10px the gap asked for. Cancelling it optically lets .logo's gap
     mean what it says. */
  margin-inline: -10px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-link {
  color: var(--sn-on-dark);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  background: var(--sn-on-dark-fill);
  border: 1px solid var(--sn-on-dark-line);
  border-radius: 20px;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
  background: var(--sn-on-dark-fill-strong);
  color: var(--sn-on-dark);
}

/* The nav is identical on every page - the current page is marked, never omitted. */
.nav-link[aria-current="page"] {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.85);
  color: var(--sn-on-dark);
}

/* For Venues is the one nav item that is also a pitch, so it carries the site CTA gradient.
   Same pill as its neighbours - only the fill changes. It comes after the aria-current rule,
   which it ties with on specificity, so the CTA survives on /venue-partners itself. */
.nav-link.nav-link-cta,
.nav-link.nav-link-cta[aria-current="page"] {
  background: var(--sn-cta);
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--sn-cta-text);
}

.nav-link.nav-link-cta:hover {
  background: var(--sn-cta);
  opacity: 0.9;
}

/* Under the burger the CTA leaves the dropdown for the header row itself: For Venues is the one
   nav item worth a tap without opening the menu first. The row copy and the dropdown copy are the
   same link, and exactly one of them is ever displayed. */
.nav-cta-mobile {
  display: none;
}

.burger {
  display: none;
  width: 40px;
  height: 36px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  background: var(--sn-on-dark-fill);
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

.burger span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--sn-on-dark);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.lang-switcher {
  display: flex;
  gap: 8px;
  background: var(--sn-on-dark-fill);
  padding: 4px 6px;
  border-radius: 20px;
}

.lang-switcher a {
  color: var(--sn-on-dark-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.lang-switcher a.active { background: var(--sn-on-dark-fill-strong); color: var(--sn-on-dark); }
.lang-switcher a:hover { color: var(--sn-on-dark); }

@media (max-width: 600px) {
  .burger { display: flex; }

  /* Mobile: the mark alone carries the brand. Dropping the wordmark here frees the row for the
     three controls that are actually interactive on a phone - account, language and the nav
     dropdown - which otherwise crowd or wrap. */
  .site-header .logo-name { display: none; }

  .header-nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 12px;
    right: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
  }

  .header-nav.open { display: flex; }

  .header-nav .nav-link {
    display: block;
    text-align: center;
  }

  .nav-cta-mobile {
    display: inline-block;
  }

  /* The dropdown copy steps aside for the row copy. Specificity, not order, does the work: the
     rule above it sets .header-nav .nav-link to display: block. */
  .header-nav .nav-link.nav-link-cta {
    display: none;
  }
}

@media (max-width: 480px) {
  .site-header { padding: 0 12px; }
  .header-right { gap: 10px; }
  .nav-link { padding: 7px 12px; font-size: 13px; }

  .site-header .logo img {
    height: 44px;
    width: 44px;
    margin-inline: -9px;
  }

  .site-header .logo-name { font-size: 17px; }
}

/* ── Closing "get the app" CTA ─────────────────────────────────────────────── */

/* The same section and type scale as the homepage's, with shorter vertical padding since this is
   a content page's closing CTA, not a full-viewport hero. */
.secondary-cta {
  padding: 56px 20px 64px;
  background: linear-gradient(135deg, #071A34, #2E5984);
  text-align: center;
}

.secondary-cta p {
  font-size: 17px;
  color: rgba(255, 255, 255, 0.85);
  max-width: 480px;
  margin: 0 auto 32px;
}

.store-badges {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

/* Apple's and Google's own artwork, used unmodified. Both forbid recolouring, stretching, effects
   and animation, so this wrapper adds nothing visual - no background, padding, shadow or hover
   transform. .store-badges' 20px gap is the required clear space (a quarter of the 60px height is
   15px); don't tighten it below that. */
.store-badge {
  display: inline-flex;
  text-decoration: none;
}

.store-badge img {
  display: block;
  height: 60px;
  width: auto;
}

.store-badge:focus-visible {
  outline: 3px solid var(--sn-success);
  outline-offset: 4px;
  border-radius: 10px;
}

.qr-section {
  display: flex;
  gap: 50px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.qr-code { text-align: center; }

.qr-image {
  width: 150px;
  height: 150px;
  background: var(--sn-surface);
  border-radius: 12px;
  margin: 0 auto 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  padding: 8px;
}

.qr-image img { width: 100%; height: 100%; display: block; }

.qr-label {
  font-size: 14px;
  font-weight: 600;
  opacity: 0.95;
  color: var(--sn-on-dark);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Desktop gets the QR codes (which are links themselves), mobile gets the store buttons - you
   cannot scan a QR with the device displaying it. */
@media (min-width: 769px) {
  .store-badges { display: none; }
}

@media (max-width: 768px) {
  .qr-section { display: none; }
}

/* ── Legal footer ──────────────────────────────────────────────────────────── */

.legal-footer {
  padding: 24px 20px 10px;
  background: #000;
  text-align: center;
}

.legal-links {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.legal-links a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.3s ease;
}

.legal-links a:hover {
  color: var(--sn-on-dark);
  text-decoration: none;
}

.social-links {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-bottom: 12px;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  transition: background 0.2s ease, color 0.2s ease;
}

.social-links a:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--sn-on-dark);
}

.social-links svg {
  width: 16px;
  height: 16px;
}

.legal-footer footer {
  padding: 10px 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
}

.legal-footer footer p {
  margin: 2px 0;
}
