/* Victory Tennis Club — Direction A: Classic Club */
:root {
  --green-primary: #1B5E3B;
  --green-dark: #134529;
  --green-light: #2D7A52;
  --cream: #FAF8F5;
  --cream-dark: #F0EDE8;
  --tennis-green: #C5D429;
  --tennis-green-light: #D4E35A;
  --gold: #C9A227;
  --text-primary: #1A1A1A;
  --text-muted: #5C5C5C;
  --text-on-dark: #FFFFFF;
  --border: #E8E4DF;
  --mountain-grey: #6B6B6B;
  --tagline-green: #9BA85C;
  --shadow: 0 2px 8px rgba(27, 94, 59, 0.08);
  --radius: 8px;
  --max-width: 1200px;
  --header-height: 5rem;
  --font-heading: 'Fraunces', Georgia, serif;
  --font-body: 'Source Sans 3', system-ui, sans-serif;
  --activity-challenge-day: #E8C547;
  --activity-mixed-singles: #2A9D8F;
  --activity-mixed-doubles: #4A90D9;
  --activity-womens-doubles: #3D9B6E;
  --activity-mens-doubles: #7B5EA7;
  --activity-womens-30-league: #E87D9A;
  --activity-womens-35-league: #5BA3D9;
  --activity-mens-35-league: #D94A4A;
  --activity-member: #E8E4DF;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--cream);
}

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

a { color: var(--green-primary); text-decoration: none; }
a:hover { color: var(--green-light); }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.75rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }

.container {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

/* Header */
.site-header {
  background: var(--green-primary);
  color: var(--text-on-dark);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  flex-shrink: 0;
}

.logo-link:hover { color: inherit; opacity: 0.9; }

.logo-img {
  height: 48px;
  width: auto;
}

@media (min-width: 480px) {
  .logo-img { height: 56px; }
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-on-dark);
  transition: transform 0.2s;
}

.site-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--green-dark);
  padding: 1rem;
  flex-direction: column;
  gap: 0.25rem;
}

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

.site-nav a {
  color: var(--text-on-dark);
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
}

.site-nav a:hover,
.site-nav a.active {
  background: rgba(255,255,255,0.1);
  color: var(--tennis-green);
}

.nav-auth {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.15);
}

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .site-nav {
    display: flex;
    position: static;
    flex-direction: row;
    align-items: center;
    background: none;
    padding: 0;
    gap: 0.25rem;
  }
  .nav-auth {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    margin-left: 0.5rem;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--tennis-green);
  color: var(--green-dark);
  border-color: var(--tennis-green);
}

.btn-primary:hover {
  background: var(--tennis-green-light);
  border-color: var(--tennis-green-light);
  color: var(--green-dark);
}

.btn-secondary {
  background: transparent;
  color: var(--text-on-dark);
  border-color: var(--text-on-dark);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.15);
  color: var(--text-on-dark);
}

.btn-outline {
  background: transparent;
  color: var(--green-primary);
  border-color: var(--green-primary);
}

.btn-outline:hover {
  background: var(--green-primary);
  color: var(--text-on-dark);
}

.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Hero */
.hero {
  position: relative;
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100svh - var(--header-height));
  min-height: calc(100dvh - var(--header-height));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-on-dark);
  overflow: hidden;
}

@media (min-height: 1600px) {
  .hero {
    min-height: min(calc(100svh - var(--header-height)), 64rem);
  }
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
}

.hero-slide.active { opacity: 1; }

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(19, 69, 41, 0.6) 0%,
    rgba(19, 69, 41, 0.38) 50%,
    rgba(19, 69, 41, 0.65) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: clamp(1.5rem, 4vh, 2.5rem) 1rem;
  width: 100%;
  max-width: 800px;
}

.hero-carousel {
  display: grid;
  width: 100%;
  overflow: hidden;
}

.hero-carousel-slide {
  grid-area: 1 / 1;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-100%);
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.7s;
}

.hero-carousel-slide.active {
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
  z-index: 2;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
}

.hero-carousel-slide.exit-left {
  visibility: visible;
  transform: translateX(-100%);
  z-index: 1;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.7s;
}

.hero-carousel-slide.exit-right {
  visibility: visible;
  transform: translateX(100%);
  z-index: 1;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.7s;
}

.hero-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.hero-carousel-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: transparent;
  cursor: pointer;
}

.hero-carousel-dot.active {
  background: rgba(255, 255, 255, 0.95);
}

.hero-announcement-panel {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.hero-announcement-panel h1 {
  margin-bottom: 0.75rem;
}

.hero-announcement-body {
  font-size: 1.125rem;
  opacity: 0.95;
  margin: 0;
  white-space: pre-line;
}

.hero-logo {
  max-width: 320px;
  margin: 0 auto 1.5rem;
}

.hero h1 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  color: var(--text-on-dark);
  margin-bottom: 1rem;
}

.hero-tagline {
  font-size: 1.125rem;
  opacity: 0.95;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide { transition: none; }
  .hero-carousel-slide { transition: none; }
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-alt { background: var(--cream-dark); }

.section-title {
  text-align: center;
  margin-bottom: 2.5rem;
}

/* Cards grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(27, 94, 59, 0.12);
}

.card h3 { color: var(--green-primary); }

.card-link {
  display: block;
  color: inherit;
}

.card-link:hover { color: inherit; }

/* Photo galleries */
.gallery-page {
  max-width: 800px;
}

.gallery-intro {
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
}

.gallery-list {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.gallery-entry h2 {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}

.gallery-entry p {
  margin-bottom: 0.75rem;
}

.gallery-entry a {
  font-weight: 600;
}

.gallery-external {
  margin-top: 1rem;
  margin-bottom: 0;
}

.gallery-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.gallery-photo {
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--cream);
}

.gallery-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}

.gallery-photo:hover img {
  transform: scale(1.03);
}

/* Club documents */
.documents-page {
  max-width: 800px;
}

.documents-intro {
  margin-bottom: 1.5rem;
}

.document-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.document-item {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.document-link {
  display: block;
  padding: 1rem 1.25rem;
  color: inherit;
  text-decoration: none;
}

.document-link:hover {
  background: var(--cream);
}

.document-title {
  display: block;
  font-weight: 600;
  color: var(--green-primary);
}

.document-description {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .gallery-page {
    max-width: 960px;
  }

  .gallery-photos {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
  }
}

@media (min-width: 1024px) {
  .gallery-page {
    max-width: 1100px;
  }

  .gallery-photos {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
  }
}

/* Quotes */
.quotes-section .quotes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  width: min(100%, 1120px);
  margin-inline: auto;
}

.quotes-section blockquote {
  margin: 0;
  padding: 2rem 1.75rem;
  min-height: 100%;
  background: white;
  border-left: none;
  border-top: 4px solid var(--tennis-green);
  border-radius: var(--radius);
  font-style: italic;
  text-align: center;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.quotes-section cite {
  display: block;
  margin-top: 0.75rem;
  font-style: normal;
  font-weight: 600;
  color: var(--green-primary);
  text-align: center;
}

@media (max-width: 899px) {
  .quotes-section .quotes-grid {
    grid-template-columns: 1fr;
    width: min(100%, 560px);
  }
}

/* Forms */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  font-family: var(--font-body);
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--green-primary);
  box-shadow: 0 0 0 3px rgba(27, 94, 59, 0.15);
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.checkbox-group input { width: auto; margin-top: 0.25rem; }

.email-prefs-fieldset {
  border: none;
  padding: 0;
  margin: 0 0 1.25rem;
}

.email-pref-row {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border, #e8e8e8);
}

.email-pref-row:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.form-success {
  color: var(--green, #1b5e3b);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.form-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.form-error {
  color: #c0392b;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.auth-card {
  max-width: 440px;
  margin: 2rem auto;
  padding: 2rem;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Alerts */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.alert-info {
  background: #e8f4fc;
  border: 1px solid #4A90D9;
  color: #1a5276;
}

.alert-warning {
  background: #fef9e7;
  border: 1px solid var(--gold);
  color: #7d6608;
}

.alert-success {
  background: #e8f8f0;
  border: 1px solid var(--green-light);
  color: var(--green-dark);
}

/* Page header */
.page-header {
  background: var(--green-primary);
  color: var(--text-on-dark);
  padding: 3rem 0;
  text-align: center;
}

.page-header h1 { color: var(--text-on-dark); font-size: 2.25rem; }

.page-content {
  padding: 3rem 0;
}

/* Footer */
.site-footer {
  background: var(--green-dark);
  color: rgba(255,255,255,0.85);
  padding: 3rem 0 1.5rem;
}

.footer-inner {
  display: grid;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

.site-footer a { color: var(--tennis-green); }
.site-footer a:hover { color: var(--tennis-green-light); }

.footer-logo { max-width: 200px; margin-bottom: 1rem; }

.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.15);
  font-size: 0.875rem;
  opacity: 0.8;
}

/* Utility */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }
.hidden { display: none !important; }

/* Loading */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--green-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 2rem auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; border-top-color: var(--green-primary); }
}
