/*
Theme Name: Thomson Park Tennis Club
Theme URI: 
Author: Antigravity
Author URI: 
Description: Custom theme for Thomson Park Tennis Club, layout matching modern design.
Version: 2.3.3
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tptc-theme
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --primary-50: #f5f5f9;
  --primary-100: #d7d6e6;
  --primary-200: #b0adcd;
  --primary-300: #8883b3;
  --primary-400: #615a9a;
  --primary-500: #393181;
  --primary-600: #2e2767;
  --primary-700: #221d4d;
  --primary-800: #171434;
  --primary-900: #0b0a1a;
  --primary-950: #06050d;
  --font-sans: 'Inter', sans-serif;
  
  --bg-color: #f9fafb; /* gray-50 */
  --text-color: #111827; /* gray-900 */
  --text-muted: #4b5563; /* gray-600 */
}

body {
  font-family: var(--font-sans);
  color: var(--text-color);
  background-color: var(--bg-color);
  margin: 0;
  padding: 0;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.site {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .container { padding: 0 24px; }
}
@media (min-width: 1024px) {
  .container { padding: 0 32px; }
}

/* Header */
.site-header {
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 50;
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #e5e7eb;
  transition: all 0.3s;
}

body.admin-bar .site-header {
  top: 32px;
}
@media (max-width: 782px) {
  body.admin-bar .site-header {
    top: 46px;
  }
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.site-branding a {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.site-branding img {
  height: 40px;
  width: auto;
}

.site-title {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
  color: var(--text-color);
  margin: 0;
}

@media (max-width: 767px) {
  /* Prevent horizontal scroll by hiding text title; logo handles branding */
  .site-title { display: none; }
}

/* Menu Toggle Button */
.menu-toggle {
  display: none;
}
@media (max-width: 767px) {
  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-color);
  }
  .menu-toggle:hover {
    color: var(--primary-600);
  }
  
  /* Mobile Menu Container */
  .main-navigation {
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    display: none;
  }
  
  body.admin-bar .main-navigation {
    top: calc(80px + 46px);
  }
  
  .main-navigation.toggled {
    display: block;
  }
}

.main-navigation ul {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 32px;
  align-items: center;
}
@media (max-width: 767px) {
  .main-navigation.toggled ul {
    display: flex;
    flex-direction: column;
    padding: 16px 24px;
    gap: 16px;
    align-items: flex-start;
  }
}
@media (min-width: 768px) {
  .main-navigation ul { display: flex; }
}

.main-navigation a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.main-navigation a:hover {
  color: var(--primary-600);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  text-decoration: none;
  border-radius: 9999px;
  transition: all 0.2s;
  cursor: pointer;
}

.btn-login {
  color: var(--primary-700);
  padding: 8px 16px;
  display: none;
}
@media (min-width: 640px) {
  .btn-login { display: block; }
}
.btn-login:hover {
  background-color: var(--primary-50);
}

.btn-join {
  background-color: var(--primary-600);
  color: white;
  padding: 10px 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.btn-join:hover {
  background-color: var(--primary-700);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* Site Content */
.site-content {
  flex: 1;
  padding-top: 80px; /* offset header */
  background-color: white;
}

/* =========================================================
   HOMEPAGE BLOCKS (Spectra Optimized)
   ========================================================= */

/* Constrain Spectra Container Widths without relying on missing inner wrappers */
.tptc-hero,
.promos-grid,
.features-list {
  padding-left: max(24px, calc((100vw - 1280px) / 2)) !important;
  padding-right: max(24px, calc((100vw - 1280px) / 2)) !important;
  box-sizing: border-box !important;
}

/* 1. Hero Section (.tptc-hero) */
.tptc-hero {
  background-color: #eff6ff !important; /* blue-50 */
  padding-top: 90px !important;
  padding-bottom: 70px !important;
}
@media (min-width: 1024px) {
  .tptc-hero { 
    padding-top: 140px !important;
    padding-bottom: 120px !important;
  }
}

.tptc-hero h1, .tptc-hero .wp-block-heading {
  font-size: 3rem !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
  letter-spacing: -0.025em;
  margin: 0 0 24px 0 !important;
}
@media (min-width: 1024px) {
  .tptc-hero h1, .tptc-hero .wp-block-heading { font-size: 3.75rem !important; }
}
.tptc-hero h1 span, .tptc-hero .wp-block-heading span {
  color: var(--primary-600);
}

.tptc-hero p {
  font-size: 1.25rem !important;
  color: var(--text-muted) !important;
  margin: 0 0 32px 0 !important;
  max-width: 500px;
}

.tptc-hero .wp-block-image img, .tptc-hero .hero-image img {
  border-radius: 16px !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
  border: 4px solid white !important;
  aspect-ratio: 16/9;
  object-fit: cover;
}
@media (min-width: 1024px) {
  .tptc-hero .wp-block-image img, .tptc-hero .hero-image img { aspect-ratio: 1/1; }
}

/* 2. Promo Flyers Section (.promo-flyer) */
.promos-grid {
  margin-top: 48px !important; /* Space between hero and promos */
  position: relative;
  z-index: 10;
  padding-bottom: 40px !important;
}

.promos-heading {
  text-align: center !important;
  font-size: 2.5rem !important;
  font-weight: 800 !important;
  color: var(--primary-900) !important;
  margin-bottom: 40px !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.promo-flyer {
  margin: 0 !important;
  position: relative;
  border-radius: 16px !important;
  overflow: hidden;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.15) !important;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
  background: rgba(255, 255, 255, 0.4) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.6) !important;
  padding: 8px !important; /* a small glass frame around the image */
}
.promo-flyer:hover {
  transform: translateY(-8px) scale(1.02) !important;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.25) !important;
  border-color: rgba(255, 255, 255, 0.9) !important;
  background: rgba(255, 255, 255, 0.8) !important;
}

.promo-flyer img {
  display: block;
  width: 100% !important;
  height: 420px !important; /* Forces all images to be exactly the same height */
  object-fit: cover !important; /* Crops image cleanly if aspect ratios don't match */
  border-radius: 8px !important;
  transition: transform 0.5s ease !important;
}
.promo-flyer:hover img {
  transform: scale(1.05) !important;
}

/* 3. Features Section (.features-list & .feature-item) */
.features-list {
  padding-top: 64px !important;
  padding-bottom: 64px !important;
  background-color: var(--bg-color) !important;
}

/* This is applied to Spectra Info Box blocks */
.feature-item {
  background: white !important;
  padding: 32px !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
  transition: transform 0.2s, box-shadow 0.2s !important;
  height: 100% !important; 
}
.feature-item:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
}
.feature-item svg {
  width: 48px !important;
  height: 48px !important;
  color: var(--primary-500) !important;
  margin-bottom: 16px !important;
}

/* 4. CTA Section (.tptc-cta) */
.tptc-cta {
  background-color: var(--primary-50) !important;
  padding: 80px max(24px, calc((100vw - 896px) / 2)) !important;
  border-top: 1px solid var(--primary-100) !important;
  margin-bottom: 32px !important;
  text-align: center !important;
}

.tptc-cta h2, .tptc-cta .wp-block-heading {
  font-size: 2.25rem !important;
  font-weight: 800 !important;
  margin: 0 0 16px 0 !important;
}
.tptc-cta p {
  color: var(--text-muted) !important;
  font-size: 1.125rem !important;
  margin: 0 0 32px 0 !important;
}

/* Global button overrides for primary/secondary */
.btn-primary-large, .tptc-cta .wp-block-button__link {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px 48px !important;
  background-color: var(--primary-600) !important;
  color: white !important;
  border-radius: 9999px !important;
  font-weight: 700 !important;
  font-size: 1.125rem !important;
  text-decoration: none !important;
  transition: all 0.2s !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
  border: none !important;
}
.btn-primary-large:hover, .tptc-cta .wp-block-button__link:hover {
  background-color: var(--primary-700) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
}

/* Footer */
.site-footer {
  background-color: white;
  border-top: 1px solid #4b5563; /* gray-600 */
  padding: 48px 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
@media (min-width: 768px) {
  .footer-inner { flex-direction: row; }
}

.footer-branding {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-logo-icon {
  width: 32px;
  height: 32px;
  background-color: var(--primary-600);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
}

.footer-branding span {
  color: var(--text-color);
  font-weight: 600;
}

.footer-sponsors {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 24px;
}
@media (min-width: 768px) {
  .footer-sponsors { justify-content: flex-end; }
}
.footer-sponsors a {
  display: block;
  transition: opacity 0.2s;
}
.footer-sponsors a:hover {
  opacity: 0.8;
}
.footer-sponsors img {
  width: 101px;
  height: 94px;
  object-fit: contain;
}

/* Ensure the entire row stretches its columns to equal heights */
.uagb-container-inner-blocks-wrap:has(.program-card) {
  align-items: stretch !important;
}

/* Ensure the column wrapping the card acts as a flex container so the card can stretch */
.wp-block-uagb-container:has(> .program-card) {
  display: flex !important;
  flex-direction: column !important;
}

.program-card {
  padding: 0 !important;
  gap: 0 !important; /* Forces Spectra container to have absolutely no gap between header and body */
  background: transparent !important;
  border: none !important; /* Remove outer border to avoid conflict with header */
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  height: 100% !important;
  flex-grow: 1 !important; /* Stretches card to fill the parent column */
  transition: all 0.3s ease;
}
.program-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 20px -8px rgba(0, 0, 0, 0.15);
}

/* Ensure Spectra inner wrapper fills height and has absolutely no gaps */
.program-card > .uagb-container-inner-blocks-wrap {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  gap: 0 !important;
  padding: 0 !important;
}

.program-header {
  padding: 24px !important;
  margin: 0 !important; 
  width: 100%;
  box-sizing: border-box;
  color: white !important;
  font-weight: 700;
  font-size: 1.5rem;
  text-align: center;
  border-top-left-radius: 16px !important; /* Match card rounding perfectly */
  border-top-right-radius: 16px !important;
}
/* Color Variations for headers */
.program-header.bg-blue { background-color: var(--primary-600); }
.program-header.bg-green { background-color: #16a34a; }
.program-header.bg-purple { background-color: #7c3aed; }
.program-header.bg-orange { background-color: #ea580c; }
.program-header.bg-teal { background-color: #0d9488; }

.program-body {
  margin-top: 0 !important; /* Kills any lingering block margin */
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 16px;
  background: white;
  border: 2px solid #e5e7eb;
  border-top: none; /* Start border exactly where header ends */
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  transition: border-color 0.3s ease;
}

/* Push any buttons (Spectra or Native) to the absolute bottom of the card */
.program-body > .wp-block-uagb-buttons,
.program-body > .wp-block-buttons {
  margin-top: auto !important;
}

.program-card:hover .program-body {
  border-color: var(--primary-300); /* highlights border on hover */
}

/* Ensure paragraph text matches layout */
.program-body p {
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* Push the last item (usually the button) to the bottom of the card */
.program-body > .wp-block-button:last-child,
.program-body > .wp-block-buttons:last-child {
  margin-top: auto;
}

/* =========================================================
   SCOREBOARD JUMBOTRON (For Team Match Results)
   ========================================================= */

/* Center the tab buttons above the scoreboard */
.scoreboard-tabs .uagb-tabs__panel {
  justify-content: center !important;
}

/* The main scoreboard card that sits inside the tab */
.scoreboard-card {
  background: linear-gradient(135deg, var(--primary-700), var(--primary-900));
  color: white;
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
  margin-top: 16px;
}

/* Matchup Heading (e.g., TPTC vs Guildwood) */
.scoreboard-matchup {
  color: var(--primary-200) !important;
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 8px 0 !important;
}

/* Aggregate Score Heading (e.g., 4 - 1) */
.scoreboard-aggregate {
  color: white !important;
  font-size: 5rem !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  margin: 0 0 32px 0 !important;
  text-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

/* Individual Matches List Container */
.scoreboard-lines {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 24px !important;
  list-style: none !important;
  margin: 0 auto !important;
  max-width: 600px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Individual Lines */
.scoreboard-lines li {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 1.15rem;
  color: white;
  text-align: center;
}

.scoreboard-lines li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.scoreboard-lines li:first-child {
  padding-top: 0;
}

/* Scoreboard Mobile Responsive */
@media (max-width: 640px) {
  .scoreboard-card { padding: 32px 20px; }
  .scoreboard-aggregate { font-size: 3.5rem !important; margin-bottom: 24px !important; }
  .scoreboard-matchup { font-size: 1rem !important; }
  .scoreboard-lines { padding: 16px !important; }
  .scoreboard-lines li { font-size: 1rem; }
}

/* =========================================================
   FLYER LIGHTBOX
   ========================================================= */

.flyer-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  padding: 20px;
  box-sizing: border-box;
}
.flyer-lightbox.active {
  opacity: 1;
  visibility: visible;
}
.flyer-lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}
.flyer-lightbox-content img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  display: block;
}
.flyer-lightbox-close {
  position: absolute;
  top: -40px;
  right: -40px;
  background: transparent;
  border: none;
  color: white;
  font-size: 40px;
  cursor: pointer;
  line-height: 1;
}
@media (max-width: 768px) {
  .flyer-lightbox-close {
    top: -40px;
    right: 0;
  }
}
