/* ── RESET ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── VARIABLES ── */
:root {
  --green: #2d7a3a;
  --green-dark: #1e5527;
  --green-light: #e8f5ea;
  --yellow: #f5c518;
  --yellow-dark: #d4a800;
  --text: #1a1a1a;
  --text-muted: #555;
  --white: #ffffff;
  --border: #d0e8d3;
}

html {
  scroll-behavior: smooth;
  font-size: 18px;
}

body {
  font-family: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
}

/* ── NAV ── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--green-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  isolation: isolate;
}

.nav-brand {
  color: var(--white);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  letter-spacing: 0.01em;
  flex-shrink: 0;
}

.nav-brand span {
  color: var(--yellow);
}

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.nav-links a:hover {
  color: var(--yellow);
  background: rgba(255, 255, 255, 0.08);
}

.nav-links a:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
  color: var(--yellow);
}

.nav-links a.current {
  color: var(--green-dark);
  background: var(--yellow);
}

/* ── NAV TOOLTIP (cursor-following) ── */
.nav-tooltip {
  position: fixed;
  z-index: 9999;
  background: rgba(15, 15, 15, 0.92);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 400;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  top: -100px;
  left: -100px;
}

/* ── NAV RIGHT GROUP ── */
.nav-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── DARK MODE TOGGLE ── */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.82);
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
  padding: 0;
}

.theme-toggle:hover {
  color: var(--yellow);
  background: rgba(255, 255, 255, 0.08);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
  color: var(--yellow);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: flex; }
[data-theme="dark"] .theme-toggle .icon-sun { display: flex; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ── DARK MODE VARIABLES ── */
[data-theme="dark"] {
  --green: #5abf6a;
  --green-dark: #3d9950;
  --green-light: #1e3020;
  --yellow: #f5c518;
  --yellow-dark: #d4a800;
  --text: #ffffff;
  --text-muted: #b0c8b4;
  --white: #1a2b1c;
  --border: #2d4a30;
}

[data-theme="dark"] body {
  background: #121a13;
}

[data-theme="dark"] .courts-table tbody tr:hover td {
  background: #1e3020;
}

[data-theme="dark"] footer {
  background: #0a120b;
}

/* ── HAMBURGER ── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.22s ease, opacity 0.22s ease;
  transform-origin: center;
}

.nav-hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── LAYOUT ── */
.container {
  max-width: 1000px;
  margin: 0 auto;
}

.section-label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 6px;
}

.section-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.01em;
  margin-bottom: 24px;
}

.section-sub {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 620px;
  margin-bottom: 32px;
}

/* ── COURTS TABLE ── */
.courts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin-top: 8px;
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border);
}

.courts-table th {
  text-align: left;
  padding: 12px 20px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--green);
  background: var(--green-light);
  border-bottom: 2px solid var(--border);
}

.courts-table td {
  padding: 14px 20px;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.courts-table tbody tr:last-child td {
  border-bottom: none;
}

.courts-table tbody tr:hover td {
  background: #f5fbf6;
}

.courts-location {
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

/* ── BOOKING KEY ── */
.booking-key {
  margin-top: 20px;
  padding: 16px 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.9rem;
}

.booking-key-title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.booking-key-intro {
  margin-bottom: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.booking-key-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.booking-key-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.booking-key-label {
  font-weight: 700;
  color: var(--text);
  min-width: 92px;
  flex-shrink: 0;
  line-height: 1.45;
}

.booking-key-description {
  color: var(--text-muted);
  line-height: 1.45;
}

.booking-key-note {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── DIRECTIONS BUTTON ── */
.directions-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: var(--green);
  color: var(--white);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 999px;
  transition: background 0.2s, transform 0.15s;
  border: none;
  cursor: pointer;
}

.directions-btn:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
}

.directions-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ── FOOTER ── */
footer {
  background: #111;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
  padding: 24px 20px;
  font-size: 0.85rem;
}

.footer-signup {
  max-width: 420px;
  margin: 0 auto 20px;
}

.footer-signup h3 {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.footer-signup p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.footer-signup-form {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.footer-signup-form input[type="email"] {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.88rem;
}

.footer-signup-form input[type="email"]::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.footer-signup-form input[type="email"]:focus {
  outline: none;
  border-color: var(--yellow);
}

.footer-signup-form button {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: var(--yellow);
  color: #18210f;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.footer-signup-form button:hover {
  background: var(--yellow-dark);
}

.footer-signup-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.footer-signup-status {
  margin-top: 8px;
  font-size: 0.82rem;
  min-height: 1.4em;
}

.footer-signup-status.success {
  color: #8ce89b;
}

.footer-signup-status.error {
  color: #f5a3a3;
}

/* ── MOBILE NAV ── */
@media (max-width: 600px) {
  .nav-hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--green-dark);
    flex-direction: column;
    gap: 0;
    flex-wrap: nowrap;
    padding: 8px 0 12px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  }

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

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: 12px 24px;
    font-size: 0.95rem;
    border-radius: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .nav-links a.current {
    color: var(--yellow);
    background: rgba(255, 255, 255, 0.08);
  }

  .nav-links li:last-child a {
    border-bottom: none;
  }

}

/* ── RESPONSIVE TABLE ── */
@media (max-width: 620px) {
  .courts-table thead {
    display: none;
  }

  .courts-table,
  .courts-table tbody,
  .courts-table tr,
  .courts-table td {
    display: block;
  }

  .courts-table tbody tr {
    border-bottom: 1px solid var(--border);
    padding: 14px 16px;
  }

  .courts-table tbody tr:last-child {
    border-bottom: none;
  }

  .courts-table td {
    padding: 3px 0;
    border: none;
  }

  .courts-table tbody tr:hover td {
    background: none;
  }
}

/* ── RESPONSIVE BOOKING KEY ── */
@media (max-width: 480px) {
  .booking-key {
    padding: 14px 16px;
  }

  .booking-key-item {
    gap: 6px;
  }

  .booking-key-label {
    min-width: 84px;
  }
}
