/* ============================================================
   PALMERBETT — Layout: header, nav, footer, RG bar, grids
   ============================================================ */

/* ---- Responsible-gambling top strip --------------------------------- */
.rg-bar {
  position: relative;
  z-index: var(--z-rgbar);
  background: linear-gradient(90deg, var(--bg-deep), var(--panel));
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-300);
}
.rg-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 38px;
  padding-block: 6px;
}
.rg-bar__tagline {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-weight: 600;
}
.rg-bar__tagline .badge-18 { flex: none; }
.rg-bar__msg { transition: opacity var(--dur) var(--ease); }
.rg-bar__links { display: flex; align-items: center; gap: 1.1rem; color: var(--muted); }
.rg-bar__links a { color: var(--muted); font-weight: 600; }
.rg-bar__links a:hover { color: var(--gold); }
@media (max-width: 760px) {
  .rg-bar__links { display: none; }
  .rg-bar__inner { justify-content: center; }
}

/* ---- Header --------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
/* Blur lives on a pseudo-element so the header is NOT a containing block for
   the fixed mobile nav drawer (backdrop-filter would otherwise trap it). */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(18, 11, 31, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background var(--dur) var(--ease);
  pointer-events: none;
}
.site-header.is-scrolled::before { background: rgba(12, 7, 23, 0.9); }
.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: var(--shadow);
}
.header-inner { position: relative; }
.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: var(--header-h);
}
.brand { display: inline-flex; align-items: center; flex: none; }
.brand img, .brand svg { height: 34px; width: auto; }
.brand:hover { filter: drop-shadow(var(--glow-violet)); }

.primary-nav { margin-inline: auto; }
.primary-nav ul {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  padding: 0;
}
.primary-nav a {
  display: inline-block;
  padding: 0.55rem 0.85rem;
  border-radius: var(--r-pill);
  color: var(--text);
  font-weight: 600;
  font-size: var(--fs-400);
  position: relative;
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.primary-nav a::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 4px;
  width: 0; height: 2px;
  background: var(--grad-gold);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: width var(--dur) var(--ease);
}
.primary-nav a:hover { color: var(--text); background: rgba(124, 77, 255, 0.14); }
.primary-nav a:hover::after,
.primary-nav a[aria-current="page"]::after { width: 60%; }
.primary-nav a[aria-current="page"] { color: var(--gold); }

.header-actions { display: flex; align-items: center; gap: 0.6rem; flex: none; }

.nav-toggle { display: none; }

/* ---- Mobile nav ----------------------------------------------------- */
@media (max-width: 980px) {
  .primary-nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(86vw, 360px);
    margin: 0;
    padding: calc(var(--header-h) + 1.5rem) 1.5rem 2rem;
    background: var(--panel);
    border-left: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform var(--dur) var(--ease-out);
    overflow-y: auto;
  }
  .primary-nav.is-open { transform: translateX(0); }
  .primary-nav ul { flex-direction: column; align-items: stretch; gap: 0.25rem; }
  .primary-nav a { padding: 0.9rem 1rem; border-radius: var(--r); font-size: var(--fs-500); }
  .primary-nav a::after { display: none; }
  .primary-nav a[aria-current="page"] { background: rgba(124, 77, 255, 0.16); }

  .nav-toggle {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 44px; height: 44px;
    border-radius: var(--r-sm);
    color: var(--text);
    margin-left: auto;
  }
  .nav-toggle svg { width: 26px; height: 26px; }
  .header-actions .btn--login { display: none; }

  .nav-backdrop {
    position: fixed; inset: 0;
    background: rgba(6, 3, 14, 0.6);
    backdrop-filter: blur(2px);
    opacity: 0; visibility: hidden;
    transition: opacity var(--dur) var(--ease), visibility var(--dur) var(--ease);
    z-index: calc(var(--z-header) - 1);
  }
  .nav-backdrop.is-open { opacity: 1; visibility: visible; }
}

/* Very small screens: shrink the brand so the header row never overflows. */
@media (max-width: 400px) {
  .header-inner { gap: 0.6rem; }
  .brand img, .brand svg { height: 28px; }
  .header-actions { gap: 0.4rem; }
  .btn--sm { padding: 0.5rem 0.85rem; }
}

/* ---- Generic grids -------------------------------------------------- */
/* Prevent grid/flex children from overflowing their track (min-content blowout). */
.grid > *, .split > * { min-width: 0; }
.grid { display: grid; gap: var(--sp-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
/* Auto-flow card rows: fill the row, wrap, and CENTER an incomplete last row
   (avoids an orphan card stuck to the left). Used by racing "next to jump". */
.grid-auto { display: flex; flex-wrap: wrap; justify-content: center; }
.grid-auto > * { flex: 1 1 190px; max-width: 250px; }
/* Meeting tab panels: 3 / 2 / 2 cards per code — keep partial rows centred. */
.meet-grid { display: flex; flex-wrap: wrap; justify-content: center; }
.meet-grid > * { flex: 1 1 280px; max-width: 380px; }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-auto > *, .meet-grid > * { max-width: 100%; }
}

/* ---- Page header (interior pages) ----------------------------------- */
.page-head {
  position: relative;
  padding-block: clamp(2.5rem, 2rem + 4vw, 5rem);
  background: var(--grad-hero);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.page-head__inner { position: relative; z-index: 1; max-width: 60ch; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 0.4rem; font-size: var(--fs-300); color: var(--muted-2); margin-bottom: 1rem; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs li { display: inline-flex; gap: 0.4rem; align-items: center; }
.breadcrumbs li + li::before { content: "/"; color: var(--muted-2); }

/* ---- Footer --------------------------------------------------------- */
.site-footer {
  margin-top: var(--sp-9);
  background: var(--bg-deep);
  border-top: 1px solid var(--line);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 2.5rem;
  padding-block: var(--sp-8) var(--sp-6);
}
.footer-col h4 { font-size: var(--fs-400); text-transform: uppercase; letter-spacing: 0.12em; color: var(--gold); margin-bottom: 1rem; }
.footer-col ul { list-style: none; padding: 0; display: grid; gap: 0.55rem; }
.footer-col a { color: var(--muted); font-weight: 500; }
.footer-col a:hover { color: var(--text); }
.footer-brand p { max-width: 38ch; margin-block: 1rem; }
.footer-brand .brand img { height: 38px; }

.footer-compliance {
  border-top: 1px solid var(--line);
  padding-block: var(--sp-6);
  display: grid;
  gap: 1.25rem;
}
.compliance-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.footer-legal-text { font-size: var(--fs-300); color: var(--muted-2); line-height: 1.7; max-width: 90ch; }
.footer-legal-text strong { color: var(--muted); }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding-block: var(--sp-5);
  display: flex; flex-wrap: wrap; gap: 1rem;
  justify-content: space-between; align-items: center;
  font-size: var(--fs-300); color: var(--muted-2);
}
.footer-bottom nav { display: flex; flex-wrap: wrap; gap: 1.2rem; }
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
}
