/* ============================================================
   LAYOUT.CSS — Thirsk Squash Club
   Header, navigation, page wrapper, modal overlays
   ============================================================ */

/* ── HEADER ────────────────────────────────────────────────── */
.hdr {
  background: var(--bd);
  padding: 0 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  border-bottom: 3px solid var(--bm);
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex-shrink: 0;
  text-decoration: none;
}

.logo-canvas {
  height: 42px;
  width: 42px;
  border-radius: 50%;
}

.logo-txt {
  font-family: var(--font-display);
  font-size: 13px;
  color: #fff;
  letter-spacing: 2px;
  line-height: 1;
  white-space: nowrap;
}

.logo-txt span {
  color: var(--bm);
}

.logo-txt .logo-club {
  color: rgba(255,255,255,0.7);
  font-size: inherit;
  letter-spacing: inherit;
}

.hdr-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}

/* ── NAVIGATION ────────────────────────────────────────────── */
.nav {
  display: flex;
  gap: 2px;
}

.nav button {
  background: none;
  border: none;
  color: var(--lav);
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 6px;
  transition: all 0.2s;
  font-weight: 500;
}

.nav button:hover {
  background: rgba(34, 85, 212, 0.3);
  color: #fff;
}

.nav button.active {
  background: var(--bm);
  color: #fff;
  font-weight: 500;
}

.nav-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 4px;
  flex-shrink: 0;
}

/* ── HEADER AUTH BUTTONS ───────────────────────────────────── */
.hdr-auth {
  display: flex;
  align-items: center;
  gap: 5px;
}

.hdr-member {
  display: none;
  align-items: center;
  gap: 6px;
}

/* Header unread message pill — clickable, routes to league */
.hdr-unread {
  display: none;
  align-items: center;
  gap: 4px;
  background: var(--bm);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 12px;
  cursor: pointer;
  border: none;
  font-family: var(--font-body);
  letter-spacing: 0.3px;
  transition: transform 0.15s;
}
.hdr-unread:hover { transform: scale(1.05); }
.hdr-unread::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #111;
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}

.hdr-member-name {
  font-size: 12px;
  color: var(--bm);
  font-weight: 500;
}

/* ── MEMBER BAR (logged in indicator) ──────────────────────── */
.member-bar {
  background: var(--bm);
  color: #fff;
  padding: 0.4rem 1.2rem;
  font-size: 13px;
  display: none;
  align-items: center;
  justify-content: space-between;
}

/* ── PAGE WRAPPER ──────────────────────────────────────────── */
.page {
  display: none;
  padding: 1.4rem 1.4rem 2rem;
  max-width: 1180px;  /* widened from 940 so non-home pages breathe */
  margin: 0 auto;
}

/* Non-home pages read cramped at the old sizes (12/11px utilities).
   Bump typography one step inside .page, scoped so #page-home stays
   as-is (homepage is display-driven with its own clamp() sizes). */
.page:not(#page-home) {
  font-size: 14.5px;
}
.page:not(#page-home) .text-sm { font-size: 13.5px; }
.page:not(#page-home) .text-xs { font-size: 12.5px; }
.page:not(#page-home) .card h3 { font-size: 15.5px; }
.page:not(#page-home) .card p  { font-size: 14px; line-height: 1.6; }
.page:not(#page-home) .form-group label { font-size: 12.5px; }
.page:not(#page-home) .form-group input,
.page:not(#page-home) .form-group select,
.page:not(#page-home) .form-group textarea { font-size: 14px; }
.page:not(#page-home) .data-table    { font-size: 13px; }
.page:not(#page-home) .data-table th { font-size: 11px; }
.page:not(#page-home) .btn           { font-size: 13.5px; }
.page:not(#page-home) .btn-sm        { font-size: 12.5px; }
.page:not(#page-home) .section-title { font-size: 30px; }

.page.active {
  display: block;
}

/* ── TWO COLUMN GRID ───────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.2rem;
}

/* ── STATS ROW ─────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.7rem;
  margin-bottom: 1.2rem;
}

/* ── MEMBERSHIP CARD GRID ──────────────────────────────────── */
.mem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.2rem;
}

/* ── BOOKING GRID ──────────────────────────────────────────── */
.booking-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

/* ── CONTACT GRID ──────────────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

/* ── RESPONSIVE BREAKPOINTS ────────────────────────────────── */
@media (max-width: 640px) {
  .booking-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .nav button {
    font-size: 11px;
    padding: 5px 6px;
  }

}

@media (max-width: 480px) {
  .hdr {
    padding: 0 0.8rem;
  }

  .nav {
    display: none;
  }

  .nav-divider {
    display: none;
  }

  .hdr-auth,
  .hdr-member {
    display: none !important;
  }

  #hamburger-btn {
    display: block !important;
  }

  .modal-box {
    padding: 1.2rem 1rem;
  }
}

/* ── MODAL OVERLAY ─────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 30, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 1.4rem 1.6rem;
  width: 100%;
  max-width: 420px;
  max-height: 92vh;
  overflow-y: auto;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 2px;
  color: #111;
  margin-bottom: 0.2rem;
  border-left: 4px solid var(--bm);
  padding-left: 0.6rem;
}

.modal-sub {
  font-size: 12px;
  color: var(--mu);
  margin-bottom: 1rem;
  padding-left: 0.6rem;
}

.modal-close {
  float: right;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--mu);
  line-height: 1;
  padding: 0;
  margin-top: -2px;
}

.modal-tabs {
  display: flex;
  border: 0.5px solid var(--br);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 1rem;
}

.modal-tab {
  flex: 1;
  padding: 8px;
  font-size: 12px;
  cursor: pointer;
  background: none;
  border: none;
  transition: all 0.2s;
}

.modal-tab.active {
  background: var(--bm);
  color: #fff;
}

/* ── GATE (members only / admin only screens) ──────────────── */
.gate {
  background: var(--bd);
  border-radius: var(--radius-xl);
  padding: 1.8rem;
  text-align: center;
  color: #fff;
  margin-bottom: 1rem;
}

.gate h2 {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 2px;
  color: var(--bm);
  margin-bottom: 0.4rem;
}

.gate p {
  color: var(--lav);
  font-size: 13px;
  margin-bottom: 1rem;
}

.gate-btns {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── SECTION TITLE ─────────────────────────────────────────── */
.section-title {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 2px;
  margin-bottom: 0.9rem;
  color: #111;
  border-bottom: 2px solid var(--bm);
  padding-bottom: 0.3rem;
  display: inline-block;
}
