/* St. Marys Cricket Academy - mobile-first responsive styles */

:root {
  --navy: #2d2560;
  --navy-dark: #1f1a45;
  --red: #c8454a;
  --red-dark: #a93539;
  --cream: #fbf8f4;
  --ink: #1d1d25;
  --muted: #5a5a66;
  --line: #e6e1ea;
  --white: #ffffff;
  --wa: #25d366;
  --wa-dark: #1ebe5b;
  --radius: 14px;
  --shadow: 0 6px 20px rgba(31, 26, 69, 0.08);
  --header-h: 64px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  padding-bottom: 76px; /* room for the mobile call bar */
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--red);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  line-height: 1.25;
  color: var(--navy);
  margin: 0 0 0.6em;
}

h1 {
  font-size: 1.85rem;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 1em;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 18px;
}

/* ---------- Header & navigation ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-weight: 700;
  font-size: 1rem;
  min-width: 0;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--white);
  object-fit: contain;
  flex-shrink: 0;
}

.brand span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-nav {
  display: none;
  background: var(--navy-dark);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
}

.nav-open .site-nav {
  display: block;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 6px 0;
}

.site-nav a {
  display: block;
  padding: 14px 22px;
  color: var(--white);
  font-weight: 500;
  border-left: 4px solid transparent;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.site-nav a.active {
  border-left-color: var(--red);
  background: rgba(255, 255, 255, 0.08);
}

/* ---------- Hero & sections ---------- */

.hero {
  position: relative;
  color: var(--white);
  background:
    linear-gradient(160deg, rgba(31, 26, 69, 0.92) 0%, rgba(45, 37, 96, 0.82) 55%, rgba(200, 69, 74, 0.7) 100%),
    url("../images/bowling.jpg") center / cover no-repeat;
  padding: 64px 0 72px;
}

.hero h1 {
  color: var(--white);
  font-size: 2.1rem;
  margin-bottom: 14px;
}

.hero .lead {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.92);
  max-width: 60ch;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffc9c9;
  margin-bottom: 10px;
}

.section {
  padding: 48px 0;
}

.section.alt {
  background: var(--white);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.page-head {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: var(--white);
  padding: 36px 0 30px;
  border-bottom: 4px solid var(--red);
}

.page-head h1 {
  color: var(--white);
  margin: 0;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  border: 2px solid transparent;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s ease, transform 0.1s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--red);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--red-dark);
  color: var(--white);
}

.btn-wa {
  background: var(--wa);
  color: #0b3d20;
}

.btn-wa:hover {
  background: var(--wa-dark);
  color: #0b3d20;
}

.btn-call {
  background: var(--navy);
  color: var(--white);
}

.btn-call:hover {
  background: var(--navy-dark);
  color: var(--white);
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.7);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.btn-row.center {
  justify-content: center;
}

/* ---------- Cards, lists, layout ---------- */

.cards-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.card {
  display: block;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: var(--shadow);
  color: var(--ink);
}

a.card:hover {
  text-decoration: none;
  border-color: var(--red);
}

a.card h3 {
  color: var(--navy);
}

.card h3 {
  margin-bottom: 6px;
}

.card p {
  color: var(--muted);
  margin: 0;
}

.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: center;
}

.photo {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  object-fit: cover;
}

.photo.portrait {
  max-width: 360px;
  margin: 0 auto;
}

.stats {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}

.stats li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.stats strong {
  color: var(--red);
  font-size: 1.4rem;
  margin-right: 6px;
}

.checklist {
  padding-left: 0;
  list-style: none;
}

.checklist li {
  padding: 8px 0 8px 28px;
  position: relative;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--red);
}

/* ---------- Fees & schedule ---------- */

.fee-box {
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
}

.fee-box p {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: #d9d4f0;
}

.fee-box strong {
  display: block;
  font-size: 2.6rem;
  line-height: 1.2;
  color: var(--white);
}

.fee-box span {
  color: #ffc9c9;
}

.schedule {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.schedule th,
.schedule td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.schedule th {
  background: var(--navy);
  color: var(--white);
  font-weight: 600;
}

.schedule tr.match td {
  background: #fdf0f0;
  font-weight: 600;
  color: var(--red-dark);
}

/* ---------- Gallery ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.gallery-item {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  background: var(--line);
  aspect-ratio: 1 / 1;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.04);
}

/* ---------- Footer & mobile call bar ---------- */

.site-footer {
  background: var(--navy-dark);
  color: #d9d4f0;
  padding: 36px 0 20px;
  font-size: 0.95rem;
}

.site-footer a {
  color: var(--white);
  word-break: break-word;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

.footer-grid p {
  margin: 4px 0;
}

.footer-grid strong {
  color: var(--white);
}

.social {
  display: flex;
  gap: 16px;
}

.copy {
  text-align: center;
  font-size: 0.85rem;
  margin: 24px 0 0;
  color: #a9a3c9;
  padding: 0 18px;
}

.mobile-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--white);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
}

.mobile-cta .btn {
  min-height: 46px;
}

/* ---------- Tablet & desktop ---------- */

@media (min-width: 640px) {
  .hero h1 {
    font-size: 2.8rem;
  }

  .cards-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 900px) {
  :root {
    --header-h: 72px;
  }

  body {
    padding-bottom: 0;
  }

  .mobile-cta {
    display: none;
  }

  h1 {
    font-size: 2.3rem;
  }

  .nav-toggle {
    display: none;
  }

  .site-nav {
    display: block;
    background: transparent;
    border: 0;
    max-height: none;
    overflow: visible;
  }

  .site-nav ul {
    display: flex;
    gap: 4px;
    padding: 0;
  }

  .site-nav a {
    padding: 8px 12px;
    border-left: 0;
    border-bottom: 3px solid transparent;
    border-radius: 6px 6px 0 0;
    font-size: 0.92rem;
  }

  .site-nav a.active {
    border-left: 0;
    border-bottom-color: var(--red);
    background: transparent;
  }

  .site-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
  }

  .hero {
    padding: 110px 0 120px;
  }

  .hero h1 {
    font-size: 3.4rem;
  }

  .cards-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .split {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }

  .gallery {
    grid-template-columns: repeat(4, 1fr);
  }

  .schedule th,
  .schedule td {
    padding: 16px 22px;
  }
}

/* Schedule table: stack rows as cards on very small phones */
@media (max-width: 480px) {
  .schedule thead {
    display: none;
  }

  .schedule,
  .schedule tbody,
  .schedule tr,
  .schedule td {
    display: block;
    width: 100%;
  }

  .schedule tr {
    border-bottom: 1px solid var(--line);
    padding: 10px 16px;
  }

  .schedule tr:last-child {
    border-bottom: 0;
  }

  .schedule td {
    border: 0;
    padding: 4px 0;
  }

  .schedule td[data-label="Day"] {
    font-weight: 700;
    color: var(--navy);
  }

  .schedule tr.match td {
    background: transparent;
  }

  .schedule tr.match {
    background: #fdf0f0;
  }

  .schedule td[data-label="Activity"]::before {
    content: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
