/* ============================================
   TORONTO YACHT CLUB — Main Stylesheet
   ============================================ */

:root {
  --navy: #0B1D33;
  --navy-light: #132C4A;
  --navy-mid: #1A3A5C;
  --blue: #2E6DA4;
  --blue-light: #4A90C4;
  --sky: #E8F0F8;
  --cream: #F7F5F0;
  --white: #FFFFFF;
  --gold: #C49A3C;
  --gold-light: #D4AF5E;
  --text: #1E1E1E;
  --text-light: #5A5A5A;
  --text-on-dark: #E0E6EC;
  --border: #D8DDE3;
  --shadow: rgba(11, 29, 51, 0.12);
  --shadow-heavy: rgba(11, 29, 51, 0.22);
  --radius: 6px;
  --max-width: 1200px;
  --transition: 0.25s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--blue);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--gold); }

h1, h2, h3, h4 {
  font-family: 'DM Serif Display', Georgia, serif;
  color: var(--navy);
  line-height: 1.2;
  font-weight: 400;
}
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.1rem; }

.container { width: 90%; max-width: var(--max-width); margin: 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.section-label {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 0.5rem;
}

/* ============================================
   HEADER & NAV
   ============================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--navy);
  box-shadow: 0 2px 12px var(--shadow-heavy);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  gap: 0.5rem;
}

.logo {
  display: flex; align-items: center; gap: 0.75rem;
  color: var(--white);
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.3rem; letter-spacing: 0.02em;
}
.logo span { white-space: nowrap; }
.logo-img { height: 52px; width: auto; flex-shrink: 0; }

/* Social icons in header */
.social-icons { display: flex; gap: 0.5rem; align-items: center; }
.social-icons a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; min-width: 32px; min-height: 32px; max-width: 32px; max-height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: var(--white);
  transition: background var(--transition);
}
.social-icons a:hover { background: var(--gold); color: var(--navy); }
.social-icons svg { width: 16px; height: 16px; min-width: 16px; max-width: 16px; fill: currentColor; }

/* CTA buttons in header — always visible */
.header-ctas { display: flex; gap: 0.5rem; }

/* Nav toggle — hidden on desktop */
.nav-toggle {
  display: none;
  background: none; border: none; color: var(--white);
  font-size: 1.5rem; cursor: pointer; padding: 0.25rem; line-height: 1;
}

/* Navigation bar */
.main-nav {
  background: var(--navy-light);
  border-top: 1px solid rgba(255,255,255,0.08);
}
.nav-list { list-style: none; display: flex; gap: 0; }
.nav-list a {
  display: block; padding: 0.7rem 1.1rem;
  color: var(--text-on-dark); font-size: 0.88rem;
  font-weight: 500; letter-spacing: 0.02em;
  transition: background var(--transition), color var(--transition);
}
.nav-list a:hover, .nav-list a.active {
  background: var(--navy-mid); color: var(--white);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-block; padding: 0.6rem 1.4rem;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.88rem; font-weight: 600;
  border-radius: var(--radius); border: 2px solid transparent;
  cursor: pointer; transition: all var(--transition);
  text-align: center; white-space: nowrap;
}
.btn-primary { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.btn-primary:hover { background: var(--gold-light); border-color: var(--gold-light); color: var(--navy); }
.btn-secondary { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.4); }
.btn-secondary:hover { border-color: var(--white); color: var(--white); }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-large { padding: 0.85rem 2rem; font-size: 1rem; }

/* ============================================
   HERO SECTIONS
   ============================================ */
.hero {
  position: relative; background: var(--navy); color: var(--white);
  padding: 5rem 0 4rem; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 50%, var(--blue) 100%);
  opacity: 0.9;
}
.hero .container { position: relative; z-index: 2; }
.hero-content { max-width: 640px; }
.hero h1 { color: var(--white); margin-bottom: 1rem; }
.hero p { font-size: 1.15rem; color: var(--text-on-dark); margin-bottom: 2rem; line-height: 1.7; }
.hero-ctas { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* Fullscreen hero — homepage */
.hero-fullscreen {
  position: relative; min-height: 85vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center; color: var(--white); overflow: hidden; padding: 2rem 0;
}
.hero-fullscreen .hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center; background-repeat: no-repeat;
}
.hero-fullscreen .hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(11, 29, 51, 0.55);
}
.hero-fullscreen .container { position: relative; z-index: 2; }
.hero-fullscreen h1 {
  color: var(--white); font-size: clamp(2.5rem, 6vw, 4rem);
  margin-bottom: 0.5rem; text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.hero-fullscreen .hero-tagline {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: rgba(255,255,255,0.9); margin-bottom: 2.5rem;
  font-weight: 300; letter-spacing: 0.03em;
}
.hero-fullscreen .hero-ctas { justify-content: center; }

/* ============================================
   CONTENT SECTIONS
   ============================================ */
.section { padding: 4rem 0; }
.section-alt { background: var(--cream); }
.section-dark { background: var(--navy); color: var(--text-on-dark); }
.section-dark h2, .section-dark h3 { color: var(--white); }
.section-header { text-align: center; max-width: 700px; margin: 0 auto 3rem; }
.section-header p { color: var(--text-light); margin-top: 0.75rem; font-size: 1.05rem; }

/* ============================================
   SERVICES GRID
   ============================================ */
.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }
.service-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem;
  transition: box-shadow var(--transition), transform var(--transition);
}
.service-card:hover { box-shadow: 0 6px 24px var(--shadow); transform: translateY(-2px); }
.service-card h3 { margin-bottom: 0.75rem; }
.service-card p { color: var(--text-light); font-size: 0.95rem; line-height: 1.65; }
.service-category { margin-top: 3rem; margin-bottom: 1.5rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--gold); }
.service-category:first-of-type { margin-top: 0; }

/* ============================================
   LOCATIONS
   ============================================ */
.locations-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.location-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.location-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.location-card address { font-style: normal; color: var(--text-light); font-size: 0.92rem; line-height: 1.5; }

/* ============================================
   PHOTO GALLERY
   ============================================ */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.75rem; }
.gallery-item {
  position: relative; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 4 / 3; background: var(--sky); cursor: pointer;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.gallery-item:hover img { transform: scale(1.05); }

/* Lightbox */
.lightbox { display: none; position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,0.92); align-items: center; justify-content: center; padding: 2rem; }
.lightbox.active { display: flex; }
.lightbox img { max-width: 90vw; max-height: 85vh; border-radius: var(--radius); }
.lightbox-close { position: absolute; top: 1.5rem; right: 1.5rem; background: none; border: none; color: var(--white); font-size: 2rem; cursor: pointer; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.15); border: none; color: white; font-size: 2rem; padding: 0.5rem 1rem; cursor: pointer; border-radius: var(--radius); }
.lightbox-nav:hover { background: rgba(255,255,255,0.3); }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

/* ============================================
   FORMS
   ============================================ */
.form-container { max-width: 680px; margin: 0 auto; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 2.5rem; }
.form-header { text-align: center; margin-bottom: 2rem; }
.form-header p { color: var(--text-light); margin-top: 0.5rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 0.35rem; color: var(--navy); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 0.65rem 0.85rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: 0.95rem; color: var(--text);
  background: var(--white); transition: border-color var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(46,109,164,0.12); }
.form-group textarea { resize: vertical; min-height: 120px; }
.form-submit { text-align: center; margin-top: 1.5rem; }
.form-success { display: none; text-align: center; padding: 2rem; }
.form-success.show { display: block; }
.form-success h3 { color: var(--navy); margin-bottom: 0.5rem; }

/* ============================================
   FOOTER
   ============================================ */
.site-footer { background: var(--navy); color: var(--text-on-dark); padding: 3rem 0 1.5rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; margin-bottom: 2rem; }
.footer-col h4 { color: var(--white); font-family: 'Source Sans 3', sans-serif; font-weight: 600; font-size: 0.88rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.75rem; }
.footer-col p, .footer-col address { font-style: normal; font-size: 0.9rem; line-height: 1.6; color: var(--text-on-dark); }
.footer-col a { color: var(--text-on-dark); }
.footer-col a:hover { color: var(--gold); }
.footer-nav { list-style: none; }
.footer-nav li { margin-bottom: 0.35rem; }
.footer-nav a { font-size: 0.9rem; }
.footer-logo { height: 60px; width: auto; margin-bottom: 0.75rem; display: block; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 1.5rem; text-align: center; font-size: 0.82rem; color: rgba(255,255,255,0.45); }

/* ============================================
   PAGE-SPECIFIC
   ============================================ */
.about-content { max-width: 760px; margin: 0 auto; font-size: 1.05rem; line-height: 1.8; }
.about-content p + p { margin-top: 1.25rem; }
.about-signature { margin-top: 2rem; font-family: 'DM Serif Display', Georgia, serif; font-size: 1.2rem; color: var(--navy); }
.about-logo { max-width: 260px; width: 100%; height: auto; margin-top: 2rem; display: block; }

.listing-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: grid; grid-template-columns: 300px 1fr; }
.listing-card .listing-image { background: var(--sky); aspect-ratio: 4/3; }
.listing-card .listing-image img { width: 100%; height: 100%; object-fit: cover; }
.listing-card .listing-info { padding: 1.5rem; }
.listing-card .listing-price { font-family: 'DM Serif Display', Georgia, serif; font-size: 1.5rem; color: var(--navy); margin-top: 0.75rem; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .main-nav { display: none; }
  .main-nav.open { display: block; }
  .nav-list { flex-direction: column; }
  .nav-list a { padding: 0.85rem 1.2rem; border-bottom: 1px solid rgba(255,255,255,0.05); }

  /* Keep CTAs visible on mobile — smaller size beside hamburger */
  .header-ctas {
    display: flex;
    gap: 0.35rem;
  }
  .header-ctas .btn {
    padding: 0.4rem 0.7rem;
    font-size: 0.72rem;
  }

  .social-icons a { width: 44px; height: 44px; min-width: 44px; min-height: 44px; max-width: 44px; max-height: 44px; }
  .social-icons svg { width: 20px; height: 20px; min-width: 20px; max-width: 20px; }
  .logo span { display: none; }
  .logo-img { height: 48px; }
  .hero { padding: 3.5rem 0 3rem; }
  .hero-fullscreen { min-height: 70vh; }
  .form-row { grid-template-columns: 1fr; }
  .listing-card { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .header-ctas .btn { padding: 0.35rem 0.5rem; font-size: 0.68rem; }
  .logo-img { height: 34px; }
  .hero-ctas { flex-direction: column; }
  .hero-ctas .btn { width: 100%; text-align: center; }
  .footer-grid { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
}
