/*
Theme Name: SLTC Block Theme V19
Theme URI: https://sltc.denisechase.com/
Author: Antigravity
Description: A lightweight, custom Block Theme for the Stephen Leacock Tennis Club. Optimized for Gutenberg and Spectra.
Version: 1.0.19
Text Domain: sltc-block-theme
*/
/* 
 * SLTC Block Theme Global Styles
 */

:root {
  /* Vibrant Fun Palette */
  --primary: #0284c7;       /* Ocean Blue */
  --primary-light: #38bdf8;
  --secondary: #16a34a;     /* Court Green */
  --accent: #6b21a8;        /* Deep Purple (Logo Highlight) */
  --highlight: #a855f7;     /* Bright Purple */
  
  --bg-color: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: rgba(148, 163, 184, 0.2);

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: 1px solid rgba(255, 255, 255, 0.4);
  --glass-blur: blur(16px);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);

  /* Typography */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 14px 0 rgba(0,0,0,0.07);
  --shadow-hover: 0 10px 30px 0 rgba(107, 33, 168, 0.2);
  
  --radius: 20px;
  --radius-pill: 50px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  color: var(--text-main);
  background-color: var(--bg-color);
  background-image: 
    radial-gradient(at 0% 0%, rgba(2, 132, 199, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(22, 163, 74, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.2) 0px, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Prevent long text and URLs from breaking mobile layouts */
a, p, li, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1rem;
}

h2, h3 {
  font-weight: 600;
  color: #1e293b; /* A softer, warmer slate color */
}

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

a:hover {
  color: var(--secondary);
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Glass Card */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius);
  padding: 2rem;
  transition: var(--transition);
}

.glass-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.125rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  outline: none;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white !important;
  box-shadow: 0 4px 15px rgba(107, 33, 168, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(107, 33, 168, 0.4);
}

.btn-secondary {
  background: var(--surface);
  color: var(--primary) !important;
  border: 2px solid var(--primary);
}

.btn-secondary:hover {
  background: var(--primary);
  color: white !important;
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 2px solid currentColor;
}

/* Header & Nav */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border-bottom: var(--glass-border);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-link, .wp-nav-menu a {
  font-family: var(--font-heading);
  font-weight: 500;
  color: var(--text-main);
  position: relative;
  text-decoration: none;
}

.wp-nav-menu {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.wp-nav-menu a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--secondary);
  transition: width 0.3s ease;
}

.wp-nav-menu a:hover::after {
  width: 100%;
}

/* Dropdown Menu Support */
.wp-nav-menu .menu-item {
  position: relative;
}

/* The sub-menu (hidden by default) */
.wp-nav-menu .sub-menu {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 0.5rem 0;
  margin: 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 999;
}

/* Show sub-menu on hover or focus */
.wp-nav-menu .menu-item:hover > .sub-menu,
.wp-nav-menu .menu-item:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Sub-menu links */
.wp-nav-menu .sub-menu a {
  display: block;
  padding: 0.5rem 1.5rem;
  font-size: 0.95rem;
  color: var(--text-main);
  white-space: nowrap;
}

.wp-nav-menu .sub-menu a:hover {
  background: var(--surface-alt);
  color: var(--primary);
}

.wp-nav-menu .sub-menu a::after {
  display: none; /* No underline effect on dropdown links */
}

/* Down Arrow for items with children */
.wp-nav-menu .menu-item-has-children > a {
  padding-right: 1.25rem;
}

.wp-nav-menu .menu-item-has-children > a::before {
  content: "▾";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8em;
  color: currentColor;
}

/* 3rd Level Menu Support */
.wp-nav-menu .sub-menu .sub-menu {
  top: -1px; /* Align with parent item vertically */
  left: 100%; /* Push exactly to the right of the parent sub-menu */
}

/* Make the arrow point right for items inside a sub-menu */
.wp-nav-menu .sub-menu .menu-item-has-children > a::before {
  content: "▸";
}

/* Mobile Menu Toggle (Hidden by default) */
.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1000;
}

.hamburger-line {
  display: block;
  width: 25px;
  height: 3px;
  margin: 5px auto;
  background-color: var(--primary);
  transition: all 0.3s ease-in-out;
  border-radius: 3px;
}

/* Mobile Nav Styles */
@media (max-width: 992px) {
  .mobile-menu-toggle {
    display: block;
  }
  
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    flex-direction: column;
    padding: 1rem 2rem 2rem;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    border-radius: 0 0 var(--radius) var(--radius);
  }
  
  .nav-links.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .wp-nav-menu {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }

  .wp-nav-menu a {
    display: block;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
  }

  /* Make submenus appear inline on mobile */
  .wp-nav-menu .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background: transparent;
    border: none;
    padding-left: 1rem;
    display: none; /* Hidden until parent is hovered/focused */
  }

  .wp-nav-menu .menu-item:hover > .sub-menu,
  .wp-nav-menu .menu-item:focus-within > .sub-menu {
    display: block;
  }
  
  .wp-nav-menu .sub-menu .sub-menu {
    padding-left: 1rem;
  }

  .nav-links .btn-primary {
    margin-top: 1.5rem;
    width: 100%;
    text-align: center;
  }
  
  /* Hamburger Animation */
  .mobile-menu-toggle.is-active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .mobile-menu-toggle.is-active .hamburger-line:nth-child(2) {
    opacity: 0;
  }
  .mobile-menu-toggle.is-active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
}

/* Geometric Decorative Shapes */
.shape {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: float 15s infinite ease-in-out alternate;
}

.shape-1 {
  top: 10%; right: 10%;
  width: 400px; height: 400px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.shape-2 {
  bottom: 10%; left: 5%;
  width: 300px; height: 300px;
  background: linear-gradient(135deg, var(--accent), var(--primary-light));
  animation-delay: -5s;
}

@keyframes float {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(30px, 50px) rotate(10deg); }
}

/* Animations */
.fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s forwards;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Page Header */
.page-header {
  padding: 80px 0 40px;
  text-align: center;
  position: relative;
}

.page-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.content-wrapper {
  max-width: 1000px;
  margin: 0 auto;
}

/* Gutenberg Block Overrides */
.wp-block-group {
  border-radius: var(--radius);
}

.wp-block-button__link {
  border-radius: var(--radius-pill) !important;
  font-family: var(--font-heading);
  font-weight: 600;
  transition: var(--transition);
}

.wp-block-button__link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Events Shortcode Grid */
.sltc-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.event-card {
    border-left: 4px solid var(--accent);
}

.event-date {
    color: var(--accent);
    font-weight: bold;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.event-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.event-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}

/* Footer */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-col h4 {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}

.footer-links {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
}

/* Uniform Sponsor Logos */
.footer-grid img {
  height: 60px !important;
  width: auto !important;
  object-fit: contain !important;
  margin: 0 auto;
  display: block;
}

/* Fallback for Spectra specific image structures */
.footer-grid .spectra-image-gallery__media-thumbnail {
  height: 60px !important;
  object-fit: contain !important;
}

/* Mobile Adjustments for Footer Images */
@media (max-width: 768px) {
  .footer-grid img, 
  .footer-grid .spectra-image-gallery__media-thumbnail {
    height: 50px !important; /* Slightly smaller on phones */
  }
}

