/* Westport Chess Club - Main Stylesheet */
/* Mobile-first responsive design */

:root {
  /* Color Palette */
  --chess-green: #2F5233;
  --chess-green-dark: #233E27;
  --chess-green-light: #3F6B45;
  --cream: #F4EFE3;
  --cream-dark: #E7DECB;
  --charcoal: #2A2722;
  --charcoal-light: #5A554B;
  --gold: #C29A5B;
  --gold-dark: #A67E42;
  --border-subtle: #D8CDB6;
  --card: #FBF8F0;

  /* Typography */
  --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                'Helvetica Neue', Arial, sans-serif;
  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-xxl: 4rem;
  
  /* Layout */
  --max-width: 1200px;
  --border-radius: 8px;
  --radius-pill: 999px;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-medium: 0.3s ease;
}

/* Skip Navigation Link */
.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link:focus {
  position: fixed;
  top: 0;
  left: 0;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0.75rem 1.25rem;
  overflow: visible;
  clip-path: none;
  white-space: normal;
  background: var(--chess-green);
  color: #fff;
  font-weight: bold;
  z-index: 9999;
  text-decoration: none;
  border-radius: 0 0 var(--border-radius) 0;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

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

body {
  font-family: var(--font-stack);
  background-color: var(--cream);
  color: var(--charcoal);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  color: var(--charcoal);
  margin-bottom: var(--spacing-md);
}

h1 {
  font-size: 2rem;
  font-weight: 700;
}

h2 {
  font-size: 1.75rem;
  margin-top: var(--spacing-xl);
}

h3 {
  font-size: 1.5rem;
  margin-top: var(--spacing-lg);
}

h4 {
  font-size: 1.25rem;
}

p {
  margin-bottom: var(--spacing-md);
}

main ul {
  padding-left: 1.25rem;
  margin-bottom: var(--spacing-md);
}

main li + li {
  margin-top: 0.25rem;
}

.nowrap {
  white-space: nowrap;
}

a {
  color: var(--chess-green);
  text-decoration: underline;
  transition: color var(--transition-fast);
}

/* Remove underlines from buttons, navigation, and footer */
.button,
a.button,
.cta-button,
nav a,
.nav-links a,
footer a {
  text-decoration: none;
}

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

strong {
  font-weight: 600;
  color: var(--charcoal);
}

/* Header and Navigation */
header {
  background-color: var(--chess-green-dark);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 60px;
}

.logo {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--cream);
  text-decoration: none;
}

.logo:hover {
  color: var(--gold);
  text-decoration: none;
}

.nav-links {
  display: none;
  list-style: none;
}

.nav-links li {
  margin: 0;
}

.nav-links a {
  color: var(--cream);
  font-weight: 500;
  padding: var(--spacing-sm) var(--spacing-md);
  display: block;
  transition: background-color var(--transition-fast);
}

.nav-links a:hover,
.nav-links a.active {
  background-color: var(--chess-green-light);
  text-decoration: none;
}

/* Mobile Menu Toggle */
.menu-toggle {
  background: none;
  border: none;
  color: var(--cream);
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--spacing-xs);
  display: block;
}

.menu-toggle:hover {
  color: var(--gold);
}

/* Mobile Menu - Show when active */
.nav-links.active {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  background-color: var(--chess-green-dark);
  border-top: 1px solid var(--chess-green-light);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Main Content */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--spacing-xl) var(--spacing-md);
  min-height: calc(100vh - 200px);
}

/* Sections */
section {
  margin-bottom: var(--spacing-xxl);
}

section:last-child {
  margin-bottom: 0;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: var(--spacing-xxl) var(--spacing-md);
  background: 
    linear-gradient(rgba(35, 62, 39, 0.6), rgba(35, 62, 39, 0.6)),
    url('../img/header-bg.jpg') center center / cover no-repeat;
  color: var(--cream);
  border-radius: 16px;
  margin-bottom: var(--spacing-xxl);
  min-height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* About page hero with Susan Polgar image */
.hero.about-hero {
  background: 
    linear-gradient(rgba(35, 62, 39, 0.6), rgba(35, 62, 39, 0.6)),
    url('../img/susan-polgar-visit.jpg') center center / cover no-repeat;
}

/* Learn page hero */
.hero.learn-hero {
  background: 
    linear-gradient(rgba(35, 62, 39, 0.6), rgba(35, 62, 39, 0.6)),
    url('../img/learn-hero.jpg') center center / cover no-repeat;
}

/* Tournaments page hero */
.hero.tournaments-hero {
  background: 
    linear-gradient(rgba(35, 62, 39, 0.6), rgba(35, 62, 39, 0.6)),
    url('../img/tournaments-hero.jpg') center center / cover no-repeat;
}

/* Contact page hero */
.hero.contact-hero {
  background: 
    linear-gradient(rgba(35, 62, 39, 0.6), rgba(35, 62, 39, 0.6)),
    url('../img/contact-us-hero.jpg') center center / cover no-repeat;
  justify-content: flex-start;
  padding-top: 150px;
}

/* Hero image caption */
.hero-caption {
  text-align: center;
  font-size: 0.9rem;
  color: var(--charcoal-light);
  margin-top: -3rem;
  margin-bottom: var(--spacing-xl);
  font-style: italic;
}

.hero h1 {
  color: var(--cream);
  font-size: 2.75rem;
  margin-bottom: var(--spacing-sm);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.04em;
}

.hero p {
  font-size: 1.65rem;
  font-weight: 600;
  font-style: italic;
  opacity: 0.95;
  max-width: 700px;
  margin: 0 auto var(--spacing-lg);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.hero .cta-button {
  display: inline-block;
  background-color: var(--gold);
  color: var(--charcoal);
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-medium);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hero .cta-button:hover {
  background-color: var(--gold-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  text-decoration: none;
}

/* Cards and Boxes */
.card {
  background-color: var(--card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.card h3 {
  margin-top: 0;
  color: var(--chess-green-dark);
}

/* Info Box (for highlights) */
.info-box {
  background-color: var(--cream-dark);
  border-left: 4px solid var(--chess-green);
  padding: var(--spacing-md);
  margin: var(--spacing-lg) 0;
  border-radius: var(--border-radius);
}

.info-box.highlight {
  background-color: #FFF9EC;
  border-left-color: var(--gold);
}

/* FAQ Section */
.faq-item {
  margin-bottom: var(--spacing-lg);
}

.faq-item h3 {
  color: var(--chess-green-dark);
  font-size: 1.25rem;
  margin-bottom: var(--spacing-sm);
}

/* Grid Layouts */
.grid {
  display: grid;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.grid-2 {
  grid-template-columns: 1fr;
}

.grid-3 {
  grid-template-columns: 1fr;
}

/* Officers/Team Grid — equal-height cells via grid stretch; extra top padding lowers photos */
.officer-card {
  background: var(--card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  padding-top: var(--spacing-xxl);
  text-align: center;
  height: 100%;
  box-sizing: border-box;
}

.officer-card img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: var(--spacing-md);
  border: 3px solid var(--chess-green);
}

.officer-card h3 {
  margin: var(--spacing-sm) 0 var(--spacing-xs);
  font-size: 1.25rem;
}

.officer-card p {
  color: var(--charcoal-light);
  font-size: 0.95rem;
  margin: 0;
}

/* Tournament Schedule */
.tournament-item {
  background: var(--card);
  border-left: 4px solid var(--chess-green);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  border-radius: var(--border-radius);
}

.tournament-item h3 {
  margin-top: 0;
  color: var(--chess-green-dark);
}

.tournament-item .time {
  color: var(--charcoal-light);
  font-weight: 600;
  font-size: 0.95rem;
}

.tournament-item .fee {
  color: var(--gold-dark);
  font-weight: 600;
  margin-top: var(--spacing-sm);
}

/* Forms */
form {
  max-width: 600px;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
  color: var(--charcoal);
}

input[type="text"],
input[type="email"],
textarea,
select {
  width: 100%;
  padding: var(--spacing-sm);
  border: 2px solid var(--border-subtle);
  border-radius: var(--border-radius);
  font-family: var(--font-stack);
  font-size: 1rem;
  transition: border-color var(--transition-fast);
  margin-bottom: var(--spacing-md);
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--chess-green);
}

textarea {
  resize: vertical;
  min-height: 150px;
}

button[type="submit"],
.button {
  background-color: var(--chess-green);
  color: var(--cream);
  padding: 0.8rem 1.6rem;
  border: none;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-medium);
  display: inline-block;
}

button[type="submit"]:hover,
.button:hover {
  background-color: var(--chess-green-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  text-decoration: none;
  color: var(--cream);
}

/* Footer */
footer {
  background-color: var(--charcoal);
  color: var(--cream);
  padding: var(--spacing-xl) var(--spacing-md);
  margin-top: var(--spacing-xxl);
}

footer .footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

footer a {
  color: var(--gold);
}

footer a:hover {
  color: var(--cream);
}

footer p {
  margin-bottom: var(--spacing-sm);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
  margin-top: var(--spacing-md);
}

.social-links a {
  transition: transform var(--transition-fast);
  display: inline-block;
}

.social-icon {
  width: 1.5rem;
  height: 1.5rem;
  display: block;
  fill: currentColor;
}

.social-links a:hover {
  transform: scale(1.1);
}

/* Brooks bio modal (about page) */
.modal-backdrop {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6);
}

.modal-backdrop.is-open {
  display: block;
}

.modal-panel {
  background-color: var(--cream);
  margin: 5% auto;
  padding: var(--spacing-xl);
  border-radius: var(--border-radius);
  max-width: 700px;
  position: relative;
}

.modal-close {
  position: absolute;
  right: 20px;
  top: 20px;
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--charcoal);
  line-height: 1;
  padding: var(--spacing-xs);
}

.modal-portrait {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  margin: var(--spacing-md) auto;
  display: block;
  border: 3px solid var(--chess-green);
}

.brooks-modal-trigger {
  margin-top: 1rem;
}

.modal-panel .button.modal-dismiss {
  margin-top: var(--spacing-md);
}

@media (prefers-reduced-motion: reduce) {
  .hero .cta-button:hover,
  .merch-item:hover,
  button[type="submit"]:hover,
  .button:hover {
    transform: none;
  }

  .social-links a:hover {
    transform: none;
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.mb-0 {
  margin-bottom: 0;
}

.mt-lg {
  margin-top: var(--spacing-lg);
}

/* Calendar Embed */
.calendar-embed {
  width: 100%;
  height: 600px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius);
  margin: var(--spacing-lg) 0;
}

/* Merch Grid */
.merch-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-lg);
  margin-top: var(--spacing-lg);
}

.merch-item {
  background: var(--card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  text-align: center;
  transition: transform var(--transition-medium), box-shadow var(--transition-medium);
}

.merch-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.merch-item img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing-md);
}

.merch-item h3 {
  font-size: 1.1rem;
  margin: var(--spacing-sm) 0;
}

/* Mobile: add vertical gap between stacked buttons */
@media (max-width: 767px) {
  .button {
    margin-bottom: var(--spacing-sm);
  }
}

/* Hide mobile-only line break on larger screens */
.mobile-break {
  display: none;
}
@media (max-width: 767px) {
  .mobile-break {
    display: block;
  }
}

/* Tablet Breakpoint (768px and up) */
@media (min-width: 768px) {
  h1 {
    font-size: 2.5rem;
  }
  
  h2 {
    font-size: 2rem;
  }
  
  .menu-toggle {
    display: none;
  }
  
  .nav-links {
    display: flex;
    flex-direction: row;
    position: static;
    background: none;
    border: none;
    box-shadow: none;
  }
  
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .merch-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  main {
    padding: var(--spacing-xxl) var(--spacing-lg);
  }
}

/* Desktop Breakpoint (1024px and up) */
@media (min-width: 1024px) {
  h1 {
    font-size: 3rem;
  }
  
  .hero h1 {
    font-size: 3.5rem;
  }
  
  .hero {
    min-height: 500px;
    padding: var(--spacing-xxl) var(--spacing-xl);
  }
  
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .merch-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
