/* --- Global Styles & Typography Refinement --- */
:root {
  --primary-color: #333333;
  --accent-color: #0EBF08;
  --card-bg: #ffffff;
  --text-dark: #222222;
  --text-light: #ffffff;
  --font-stack: Madefor, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-stack);
  font-size: 1.1rem;
  color: var(--text-dark);
  line-height: 1.6;

  /* --- Fixed Background Settings --- */
  background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), 
                    url('../images/site_background.jpg');
  background-attachment: fixed;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;

  /* --- Sticky Footer --- */
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* Forces body container row to occupy at least 100% */
}

abbr {
  text-decoration: none;
}

/* --- PDF icon for links to PDFs --- */
a[href$=".pdf"]::after {
  content: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="14" height="14" fill="%23d9381e"><path d="M64 464V48h224l128 128v304H64zm192-300V64H80v400h352V180H256z"/></svg>');
  margin-left: 4px;
  display: inline-block;
  vertical-align: middle;
}

.section-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Responsive Header & Navbar --- */
.site-header {
  background-color: var(--primary-color);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08); /* Dark subtle border accent */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 75px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.logo-text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.05em;
  color: var(--text-light);
  text-decoration: none;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-item {
  text-decoration: none;
  color: var(--text-light); 
  font-size: 15px;
  font-weight: 600;
  position: relative;
  transition: color 0.2s ease;
}

.nav-item:hover, .nav-item.active {
  color: var(--accent-color);
}

/* High-contrast sliding underscore animation using accent color */
.nav-item::after {
  content: '';
  position: absolute;
  width: 100%;
  transform: scaleX(0);
  height: 2px;
  bottom: -6px;
  left: 0;
  background-color: var(--accent-color);
  transform-origin: bottom right;
  transition: transform 0.25s ease-out;
}

.nav-item:hover::after, 
.nav-item.active::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

/* Hover updates link colors cleanly to vivid highlight token */
.nav-item:hover, 
.nav-item.active {
  color: var(--accent-color);
}

.cta-button {
  display: inline-flex;
  align-items: center;
  background: var(--primary-color);
  color: var(--text-light);ß
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.cta-button:hover {
  background: var(--accent-color);
  color: var(--text-dark);
}

/* Mobile Menu Button - Hidden on Desktop */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
}

.menu-toggle span {
  background: var(--text-light);
  height: 2px;
  width: 22px;
  border-radius: 2px;
}

.hero-section {
  background: transparent;
  color: var(--text-light);
  padding: 100px 0 40px 0;
  text-align: center;
}

.hero-section.home {
  padding: 140px 0 100px 0;
}

.hero-content h1 {
  font-size: 3.8rem;
}

/* --- Serif Hero Typography --- */
.hero-content h1 {
  font-family: "Times New Roman", serif;
  font-size: 4.2rem;
  font-weight: 800;
  font-style: normal;
  letter-spacing: -0.01em; /* Serif headings look best with tighter tracking */
  line-height: 1.15;
  margin: 12px 0 16px 0;
}

/* Subtle adjustment to the subtitle line above the header */
.hero-content .subtitle {
  font-family: var(--font-stack); /* Keeps clean sans-serif text for contrast */
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em; /* Wider spacing to balance the strong serif beneath it */
}

.hero-content .tagline {
  font-size: 1.5rem;
  font-style: italic;
  font-weight: 700;
}

/* --- Core Content Grid Layout --- */
.main-content {
  padding: 60px 0;
}

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

/* --- Content Floating Refinements --- */
.content-card {
  background: rgba(255, 255, 255, 0.95); /* Makes cards semi-transparent for a premium frosted-glass appearance */
  backdrop-filter: blur(8px); /* Optional modern frosting visual anchor */
  padding: 35px;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08); /* Deepened shadow for readability contrast */
}

.content-card.full-width {
  grid-column: span 2;
}

.content-card h2 {
  font-size: 1.8rem;
  margin-bottom: 15px;
  color: var(--primary-color);
  border-bottom: 2px solid var(--accent-color);
  display: inline-block;
  padding-bottom: 5px;
}

.content-card h3 {
  font-size: 1.3rem;
  margin: 20px 0 10px;
}

.content-card p {
  margin-bottom: 10px;
}

.bullet-list {
  margin-left: 15px;
  margin-bottom: 15px;
}

.bullet-list li {
  margin-bottom: 8px;
}

/* Splitting the dashboard feature points cleanly into two columns on desktop */
.grid-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  list-style: none;
}

.grid-list li::before {
  content: "• ";
  color: var(--text-dark);
  font-weight: bold;
}

.alert-box {
  background-color: #fff3cd;
  border-left: 4px solid #ffc107;
  padding: 15px;
  margin-top: 20px;
  border-radius: 4px;
}

.has-image {
  display: flex;
  gap: 40px;
  align-items: center;
}

.has-image .card-info,
.has-image .card-image {
  flex: 1;
  width: 100%;
}

.has-image.inverse {
  flex-direction: row-reverse;
}

.has-image.stacked {
  flex-direction: column;
  align-items: stretch;
}

/* Optional interaction effect: gently zooms the asset image frame when hovering over a card */
.has-image:hover .image-frame img {
  transform: scale(1.03);
}

/* --- Fluid Image Framing Elements --- */
.image-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9; /* Matches modern wide banner landscape dimensions */
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  background-color: #eaeaea; /* Smooth background loading fallback color */
}

/* Square/Portrait crop footprint adjustments for column blocks */
.image-frame.ratio-4-3 {
  aspect-ratio: 4 / 3;
}

/* Universal image rendering logic */
.image-frame img {
  width: 100%;
  height: 100%;
  display: block;
  /* Object-fit works like a cover canvas, preventing images from squeezing out of proportions */
  object-fit: cover; 
  object-position: center center;
  transition: transform 0.4s ease;
}

/* Specific styling modifier for graphics (like the tennis logo) so they don't get cropped */
.image-frame.asset-contain img {
  object-fit: contain;
  padding: 20px;
  background-color: rgba(255, 255, 255, 0.4);
}

/* --- Committees Special Content Additions --- */

.chair-tag {
  margin-top: 15px;
  padding: 8px 14px;
  background-color: rgba(14, 191, 8, 0.08); /* 8% alpha wash of your green accent color */
  border-left: 3px solid var(--accent-color);
  border-radius: 0 6px 6px 0;
  display: inline-block;
  font-size: 0.95rem;
}

.flex-media-row {
  display: flex;
  gap: 15px;
  width: 100%;
}

.flex-media-row .image-frame {
  flex: 1;
}

.image-frame.ratio-16-10 {
  aspect-ratio: 16 / 10;
}

/* Fallback adjustment if image titles contain spaces or special text strings */
img[src*="1102"] {
  object-position: center 30%; /* Focus on house frontage if needed */
}

/* --- Form Grid & Element Controls --- */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
  margin-top: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Text Element Labels */
.form-group label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Input Fields & Textareas Box Rules */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-stack);
  font-size: 1rem;
  background-color: #fcfcfc;
  color: var(--text-dark);
  border: 2px solid #e1e2e6;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.form-group textarea {
  resize: vertical; /* Safe parameter bounds for manual dragging expansion */
}

/* Smooth Focus Highlights on Select */
.form-group input:focus,
.form-group textarea:focus {
  background-color: #ffffff;
  border-color: var(--accent-color); /* Vivid green accent highlight ring toggle */
  box-shadow: 0 0 0 4px rgba(14, 191, 8, 0.15); /* Soft glowing aura drop shadow */
}

/* --- Form Submit CTA Button Overrides --- */
form .cta-button {
  align-self: flex-start; /* Prevents the button from stretching all the way across desktop screens */
  background-color: var(--primary-color);
  color: var(--text-light);
  font-family: var(--font-stack);
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 36px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
  margin-top: 8px;
}

form .cta-button:hover {
  background-color: var(--accent-color);
  color: var(--text-dark);
  box-shadow: 0 6px 16px rgba(14, 191, 8, 0.25);
}

form .cta-button:active {
  transform: scale(0.98); /* Slight physical compression bounce effect upon click/tap */
}

/* --- Footer --- */
.site-footer {
  text-align: center;
  padding: 40px 0;
  background: var(--primary-color);
  color: var(--text-light);
  font-size: 0.9rem;

  /* --- Sticky Footer ---*/
  margin-top: auto; 
  width: 100%;
}

/* --- RESPONSIVE MEDIA QUERIES (BREAKPOINTS) --- */

@media (max-width: 992px) {
  .layout-grid {
    grid-template-columns: 1fr; /* Drop layouts down to single columns */
  }
  
  .content-card.full-width {
    grid-column: span 1;
  }
  
  .has-image, 
  .has-image.inverse {
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
  }
  
  .grid-list {
    grid-template-columns: 1fr;
  }

  .image-frame {
    aspect-ratio: 16 / 10; /* Slightly taller aspect for mid-size viewing devices */
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex; /* Reveal burger menu bar */
    z-index: 110;
  }

  /* Animate burger icon lines into an 'X' shape when active */
  .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  .menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
  }

  .menu-toggle span {
    transition: all 0.3s ease;
  }

  /* Style the menu layout as a mobile drawer overlay */
  .nav-menu {
    position: fixed;
    top: 75px; /* Aligns right beneath  fixed site-header height */
    left: 0;
    width: 100%;
    height: calc(100vh - 75px);
    background-color: var(--text-dark);
    flex-direction: column;
    justify-content: flex-start;
    padding: 24px 24px;
    gap: 28px;
    text-align: center;
    
    /* Hide off-screen by default with smooth slide transition */
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.3s ease;
    pointer-events: none;
  }

  /* This selector fires dynamically via JavaScript */
  .nav-menu.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-item, #primary-nav .cta-button {
    font-size: 15px;
    width: 100%;
    padding: 6px 0;
  }

  .cta-button {
    width: 100%;
    justify-content: center;
    margin-top: 10px;
  }

  /* Adjusting the mobile breakpoint size so the serif doesn't snap rows awkwardly */
  .hero-content h1 {
    font-size: 2.8rem;
    letter-spacing: 0;
  }
}

@media (max-width: 576px) {
  body {
    font-size: 1rem;
  }

  form .cta-button {
    width: 100%; /* Expands button to fill the screen width for easier mobile tapping targets */
    justify-content: center;
    text-align: center;
  }

  .hero-content h1 {
    font-size: 2.2rem;
  }

  .content-card {
    padding: 24px;
  }
  
  .content-card h2 {
    font-size: 1.6rem;
  }
}
