/* Westport Charter Boat Association - Demo Site Styles */

/* Font display optimization - ensures text is visible during font load */
/* Using system fonts with font-display: swap for any future custom fonts */

:root {
  --primary-blue: #0066cc;
  --dark-blue: #003d7a;
  --light-blue: #e6f2ff;
  --ocean-teal: #008b8b;
  --success-green: #1e7e34; /* Darkened for WCAG AA contrast compliance */
  --danger-red: #dc3545;
  --grey-dark: #333;
  --grey-medium: #666;
  --grey-light: #f4f4f4;
  --white: #ffffff;
  --shadow: rgba(0, 0, 0, 0.1);
}

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

body {
  /* System font stack for fast rendering - no web fonts to load */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  color: var(--grey-dark);
  background-color: var(--white);
  overflow-x: hidden; /* Prevent horizontal scrolling */
  width: 100%;
  max-width: 100vw;
  /* Optimize text rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Announcement Bar */
.announcement-bar {
  background: linear-gradient(135deg, var(--ocean-teal), var(--primary-blue));
  color: var(--white);
  padding: 12px 20px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
}

.announcement-bar a {
  color: var(--white);
  text-decoration: underline;
  margin-left: 10px;
}

/* Header */
header {
  background: var(--white);
  box-shadow: 0 2px 8px var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
}

/* Centered logo layout - logo and nav stacked and centered */
.header-centered {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.header-centered .mobile-header-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.header-centered .logo-centered {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
}

.header-centered .logo-centered img {
  margin: 0 auto;
  display: block;
}

.header-centered nav {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.header-centered nav ul {
  justify-content: center;
  margin: 0 auto;
}

.logo h1 {
  color: var(--dark-blue);
  font-size: 24px;
}

.logo p {
  color: var(--grey-medium);
  font-size: 14px;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 30px;
}

nav a {
  color: var(--grey-dark);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 8px 4px;
}

nav a:hover {
  color: var(--primary-blue);
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, rgba(0, 102, 204, 0.9), rgba(0, 139, 139, 0.9));
  color: var(--white);
  padding: 100px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Hero with dynamic background */
.hero-with-bg {
  background: none;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none; /* Allow clicks through to content */
}

.hero-bg-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 2s ease-in-out;
  will-change: opacity; /* Performance optimization */
  backface-visibility: hidden; /* Prevent flickering */
}

.hero-bg-image.active {
  opacity: 1;
}

.hero-bg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 61, 122, 0.85), rgba(0, 102, 204, 0.75));
  z-index: 1;
}

/* Derby page overlay - darker for catch photos */
.hero-bg-overlay.derby-overlay {
  background: linear-gradient(135deg, rgba(0, 41, 82, 0.9), rgba(0, 82, 164, 0.85));
}

/* Ensure all hero content is visible above backgrounds */
.hero-with-bg h1,
.hero-with-bg h2,
.hero-with-bg p,
.hero-with-bg .cta-buttons {
  position: relative;
  z-index: 2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero h1,
.hero h2 {
  font-size: clamp(28px, 5vw, 48px);
  margin-bottom: 20px;
  line-height: 1.2;
  max-width: 90ch;
  margin-left: auto;
  margin-right: auto;
}

.hero p {
  font-size: clamp(16px, 2.5vw, 20px);
  margin-bottom: 30px;
  line-height: 1.6;
  max-width: 65ch;
  margin-left: auto;
  margin-right: auto;
}

.cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  max-width: 100%;
  padding: 0 20px;
  box-sizing: border-box;
}

.btn {
  padding: 15px 30px;
  border: none;
  border-radius: 5px;
  font-size: clamp(14px, 2vw, 16px);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: normal;
  word-wrap: break-word;
  text-align: center;
  line-height: 1.4;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

.btn-primary {
  background: var(--success-green);
  color: var(--white);
}

.btn-secondary {
  background: var(--white);
  color: var(--primary-blue);
}

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

.btn-large {
  font-size: 18px;
  padding: 15px 40px;
}

/* Section CTA (centered button containers) */
.section-cta {
  text-align: center;
  margin-top: 40px;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 20px;
  text-align: center; /* Center text on all screen sizes - fixes tablet/desktop alignment issue */
  box-sizing: border-box;
  width: 100%;
}

/* Ensure inner content divs are properly centered within containers */
.container > div[style*="max-width"] {
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box;
  display: block;
}

/* Ensure body and html don't have any offset */
html {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  position: relative;
}

/* Section Headers */
.section-header {
  text-align: center;
  margin-bottom: 50px;
  max-width: 90ch;
  margin-left: auto;
  margin-right: auto;
  padding: 0 20px;
}

.section-header h2 {
  font-size: clamp(28px, 5vw, 36px);
  color: var(--dark-blue);
  margin-bottom: 10px;
  line-height: 1.3;
}

.section-header p {
  font-size: clamp(16px, 2.5vw, 18px);
  color: var(--grey-medium);
  line-height: 1.7;
  max-width: 65ch;
  margin-left: auto;
  margin-right: auto;
}

/* Grid Layouts */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 25px;
  min-height: 600px; /* Reserve space for trip types section to prevent CLS */
}

/* Grand Prizes section - compact cards */
#prizes .grid-4 {
  min-height: auto; /* Remove min-height for prizes */
}

#prizes .card {
  min-height: auto; /* Allow cards to be compact */
}

/* Trip types section - cards size to content, no stretch (fixes extended box past Find Boats) */
#trips .grid-4 {
  align-items: start;
  min-height: 0;
}

/* Cards */
.card {
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 2px 8px var(--shadow);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

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

.card-image {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--light-blue), var(--grey-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  position: relative;
  overflow: hidden;
}

/* Add subtle wave pattern to trip type cards */
.card-image::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(to top, rgba(0, 102, 204, 0.05), transparent);
  z-index: 0;
}

.card-image::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 100px;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(0, 139, 139, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(0, 102, 204, 0.05) 0%, transparent 50%);
  animation: waves 6s ease-in-out infinite;
  z-index: 0;
}

@keyframes waves {
  0%, 100% {
    transform: translateX(0) translateY(0);
  }
  50% {
    transform: translateX(10px) translateY(-5px);
  }
}

.card-content {
  padding: 20px;
}

.card h3 {
  color: var(--dark-blue);
  margin-bottom: 10px;
  line-height: 1.3;
  font-size: clamp(18px, 2.5vw, 22px);
}

.card p {
  color: var(--grey-medium);
  margin-bottom: 15px;
  line-height: 1.7;
  font-size: clamp(14px, 2vw, 16px);
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.card .btn {
  display: block;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* Image Orientation Handling - Auto-detect portrait/landscape */
.img-portrait {
  object-fit: contain !important;
  object-position: top center; /* Show top portion (faces, fish heads) instead of center */
  background: linear-gradient(135deg, rgba(0, 102, 204, 0.03), rgba(0, 139, 139, 0.03));
}

.img-landscape {
  object-fit: cover !important;
  object-position: center;
}

.img-square {
  object-fit: cover !important;
  object-position: center;
}

/* Trip cards: show full image for portrait and square (no face cropping); container grows up to max */
#trips .card-image:has(.img-portrait),
#trips .card-image:has(.img-square),
#trips .card-image.has-portrait-image,
#trips .card-image.has-square-image {
  height: auto;
  min-height: 200px;
  max-height: 420px;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
#trips .card-image:has(.img-portrait) img,
#trips .card-image:has(.img-square) img,
#trips .card-image.has-portrait-image img,
#trips .card-image.has-square-image img {
  object-fit: contain !important;
  object-position: top center;
  width: 100%;
  height: auto;
  max-height: 420px;
  display: block;
}
/* Trip cards: landscape also show full image on desktop (no top cropping) */
#trips .card-image:has(.img-landscape),
#trips .card-image.has-landscape-image {
  height: auto;
  min-height: 200px;
  max-height: 420px;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
#trips .card-image:has(.img-landscape) img,
#trips .card-image.has-landscape-image img {
  object-fit: contain !important;
  object-position: top center;
  width: 100%;
  height: auto;
  max-height: 420px;
  display: block;
}

/* ==============================================
   MOBILE PORTRAIT IMAGE DISPLAY ENHANCEMENT
   Allow portrait images to display at full height on mobile/tablet
   while maintaining desktop behavior (object-fit: contain)
   ============================================== */
@media (max-width: 768px) {
  /* Portrait images - use cover with top alignment to show faces/fish heads */
  /* Note: Container rules below will set fixed height to prevent overlap */
  .img-portrait {
    object-fit: cover !important; /* Use cover to enable position control */
    object-position: top !important; /* Show top portion (faces, fish heads) - NOT center */
    height: 100% !important;
    width: 100%;
  }
  
  /* Square images on mobile - allow full display */
  .img-square {
    object-fit: contain !important;
    height: auto !important;
    max-height: 400px;
    width: 100%;
  }
  
  /* Landscape images on mobile - show full image instead of cropping */
  .img-landscape {
    object-fit: contain !important;
    height: auto !important;
    max-height: 400px;
    width: 100%;
  }
  
  /* Season image containers expand for portrait, square, AND landscape images */
  .season-image:has(.img-portrait),
  .season-image:has(.img-square),
  .season-image:has(.img-landscape) {
    height: auto !important;
    min-height: 180px;
    max-height: 500px;
    overflow: visible !important;
  }
  
  /* Ensure images inside season-image containers can expand */
  .season-image:has(.img-portrait) img,
  .season-image:has(.img-square) img,
  .season-image:has(.img-landscape) img {
    height: auto !important;
    max-height: 500px;
    width: 100%;
    object-position: top center; /* Show top portion when cropped (faces, fish heads) */
  }
  
  /* Champion photo containers: portrait and square show full image (contain), no face cropping */
  .champion-photo:has(.img-portrait),
  .champion-photo:has(.img-square) {
    height: auto !important;
    min-height: 220px;
    max-height: 400px;
    overflow: hidden !important;
  }
  .champion-photo:has(.img-portrait) img,
  .champion-photo:has(.img-square) img {
    object-fit: contain !important;
    object-position: top center;
    height: auto !important;
    max-height: 400px;
    width: 100%;
  }
  
  /* Tie photo containers expand for portrait images */
  .tie-photo:has(.img-portrait) {
    width: auto;
    height: auto !important;
    min-width: 80px;
    min-height: 80px;
    max-width: 120px;
    max-height: 180px;
  }
  
  /* Tie photo containers for square images */
  .tie-photo:has(.img-square) {
    width: auto;
    height: auto !important;
    min-width: 80px;
    min-height: 80px;
    max-width: 120px;
    max-height: 120px;
  }
}

/* Fallback for browsers that don't support :has() selector */
/* JavaScript will add .has-portrait-image, .has-square-image, .has-landscape-image classes to containers */
@media (max-width: 768px) {
  /* Portrait images - fixed height to prevent overlap and CLS */
  .card-image.has-portrait-image {
    height: 400px !important; /* Fixed height prevents overlap and CLS */
    min-height: 400px;
    max-height: 400px;
    overflow: hidden !important;
  }
  
  /* Square and landscape images */
  .card-image.has-square-image,
  .card-image.has-landscape-image {
    height: auto !important;
    min-height: 200px;
    max-height: 400px;
    overflow: hidden;
  }
  
  /* Portrait images - use cover with top alignment */
  .card-image.has-portrait-image img {
    height: 100% !important; /* Fill container */
    width: 100%;
    object-fit: cover !important; /* Cover enables position control */
    object-position: top !important; /* Show top portion (faces, fish heads) - NOT center */
  }
  
  /* Square and landscape images */
  .card-image.has-square-image img,
  .card-image.has-landscape-image img {
    height: auto !important;
    max-height: 400px;
    width: 100%;
  }
  
  .card-image.has-portrait-image .img-portrait {
    height: 100% !important; /* Fill container */
    width: 100%;
    object-fit: cover !important; /* Cover enables position control */
    object-position: top !important; /* Show top portion (faces, fish heads) - NOT center */
  }
  
  .card-image.has-square-image .img-square,
  .card-image.has-landscape-image .img-landscape {
    height: auto !important;
    max-height: 400px;
    width: 100%;
  }
  
  .season-image.has-portrait-image,
  .season-image.has-square-image,
  .season-image.has-landscape-image {
    height: auto !important;
    min-height: 180px;
    max-height: 500px;
    overflow: visible !important;
  }
  
  .season-image.has-portrait-image img,
  .season-image.has-square-image img,
  .season-image.has-landscape-image img {
    height: auto !important;
    max-height: 400px;
    width: 100%;
    object-fit: contain !important;
    object-position: top center;
  }
  
  .season-image.has-portrait-image .img-portrait,
  .season-image.has-square-image .img-square,
  .season-image.has-landscape-image .img-landscape {
    height: auto !important;
    max-height: 400px;
    width: 100%;
    object-fit: contain !important;
    object-position: top center;
  }
  
  .champion-photo.has-portrait-image {
    height: auto !important;
    min-height: 220px;
    max-height: 400px;
    overflow: hidden !important;
  }
  
  .champion-photo.has-portrait-image .img-portrait {
    height: auto !important;
    max-height: 400px;
    width: 100%;
    object-fit: contain !important;
    object-position: top center;
  }
  
  .champion-photo.has-square-image {
    height: auto !important;
    min-height: 220px;
    max-height: 400px;
    overflow: hidden !important;
  }
  
  .champion-photo.has-square-image .img-square {
    height: auto !important;
    max-height: 400px;
    width: 100%;
    object-fit: contain !important;
    object-position: top center;
  }
  
  .tie-photo.has-portrait-image {
    width: auto;
    height: auto !important;
    min-width: 80px;
    min-height: 80px;
    max-width: 120px;
    max-height: 180px;
  }
  
  .tie-photo.has-square-image {
    width: auto;
    height: auto !important;
    min-width: 80px;
    min-height: 80px;
    max-width: 120px;
    max-height: 120px;
  }
}

/* ==============================================
   COMPREHENSIVE MOBILE IMAGE LAYOUT FIX
   Fix overflow issues and prevent images from covering content
   NEW APPROACH: Let cards grow to contain images, don't use overflow:visible
   ============================================== */
@media (max-width: 768px) {
  /* CRITICAL: Keep cards with overflow: hidden to prevent overlap */
  /* Cards should grow to contain their content, not overflow */
  .card:has(.card-image:has(.img-portrait)),
  .card:has(.card-image:has(.img-square)),
  .card:has(.card-image:has(.img-landscape)),
  .champion-card:has(.champion-photo:has(.img-portrait)),
  .champion-card:has(.champion-photo:has(.img-square)),
  .season-card:has(.season-image:has(.img-portrait)),
  .season-card:has(.season-image:has(.img-square)),
  .season-card:has(.season-image:has(.img-landscape)) {
    overflow: hidden; /* Keep overflow hidden to prevent card overlap */
    /* Card will grow naturally to contain expanded image container */
  }
  
  /* Fallback for browsers without :has() */
  .card.has-portrait-image,
  .card.has-square-image,
  .card.has-landscape-image,
  .champion-card.has-portrait-image,
  .champion-card.has-square-image,
  .season-card.has-portrait-image,
  .season-card.has-square-image,
  .season-card.has-landscape-image {
    overflow: hidden;
  }
  
  /* Phase 1: Fixed height for portrait images to prevent layout shift and overlap */
  /* Use cover with top alignment to show faces/fish heads in upper portion */
  .card-image:has(.img-portrait) {
    height: 400px !important; /* Fixed height prevents overlap and CLS */
    min-height: 400px;
    max-height: 400px;
    overflow: hidden !important; /* Prevent overflow */
  }
  
  .card-image:has(.img-square),
  .card-image:has(.img-landscape) {
    height: auto !important;
    min-height: 200px;
    max-height: 400px;
    overflow: hidden;
  }
  
  /* Fallback for browsers without :has() */
  .card-image.has-portrait-image {
    height: 400px !important; /* Fixed height prevents overlap and CLS */
    min-height: 400px;
    max-height: 400px;
    overflow: hidden !important;
  }
  
  .card-image.has-square-image,
  .card-image.has-landscape-image {
    height: auto !important;
    min-height: 200px;
    max-height: 400px;
    overflow: hidden;
  }
  
  /* Trip cards on mobile: show full image (contain) for portrait and square so faces aren't cut off */
  #trips .card-image:has(.img-portrait),
  #trips .card-image:has(.img-square),
  #trips .card-image.has-portrait-image,
  #trips .card-image.has-square-image {
    height: auto !important;
    min-height: 200px;
    max-height: 400px;
    overflow: hidden !important;
  }
  #trips .card-image:has(.img-portrait) img,
  #trips .card-image:has(.img-square) img,
  #trips .card-image.has-portrait-image img,
  #trips .card-image.has-square-image img {
    object-fit: contain !important;
    object-position: top center;
    height: auto !important;
    max-height: 400px;
    width: 100%;
    display: block;
  }
  
  /* Portrait images - use cover with top alignment to show upper portion */
  .card-image:has(.img-portrait) img {
    height: 100% !important; /* Fill container */
    width: 100%;
    display: block;
    object-fit: cover !important; /* Cover enables position control */
    object-position: top !important; /* Show top portion (faces, fish heads) - NOT center */
  }
  
  /* Square and landscape images */
  .card-image:has(.img-square) img,
  .card-image:has(.img-landscape) img {
    height: auto !important;
    max-height: 400px;
    width: 100%;
    display: block;
    object-fit: contain;
    object-position: top center;
  }
  
  /* Fallback for browsers without :has() */
  .card-image.has-portrait-image img {
    height: 100% !important; /* Fill container */
    width: 100%;
    display: block;
    object-fit: cover !important; /* Cover enables position control */
    object-position: top !important; /* Show top portion (faces, fish heads) - NOT center */
  }
  
  .card-image.has-square-image img,
  .card-image.has-landscape-image img {
    height: auto !important;
    max-height: 400px;
    width: 100%;
    display: block;
    object-fit: contain;
    object-position: top center;
  }
  
  /* Phase 2: Protect Card Content - ensure it's always visible */
  .card:has(.card-image:has(.img-portrait)) .card-content,
  .card:has(.card-image:has(.img-square)) .card-content,
  .card:has(.card-image:has(.img-landscape)) .card-content {
    margin-top: 0;
    padding-top: 20px;
    position: relative;
    z-index: 1;
    background: var(--white);
  }
  
  /* Fallback for browsers without :has() */
  .card.has-portrait-image .card-content,
  .card.has-square-image .card-content,
  .card.has-landscape-image .card-content {
    margin-top: 0;
    padding-top: 20px;
    position: relative;
    z-index: 1;
    background: var(--white);
  }
  
  /* Champion card content protection */
  .champion-card:has(.champion-photo:has(.img-portrait)) .champion-info,
  .champion-card:has(.champion-photo:has(.img-square)) .champion-info {
    margin-top: 0;
    padding-top: 15px;
    position: relative;
    z-index: 1;
    background: white;
  }
  
  /* Fallback for browsers without :has() */
  .champion-card.has-portrait-image .champion-info,
  .champion-card.has-square-image .champion-info {
    margin-top: 0;
    padding-top: 15px;
    position: relative;
    z-index: 1;
    background: white;
  }
  
  /* Season card content protection */
  .season-card:has(.season-image:has(.img-portrait)) .season-content,
  .season-card:has(.season-image:has(.img-square)) .season-content {
    margin-top: 0;
    padding-top: 15px;
    position: relative;
    z-index: 1;
    background: var(--white);
  }
  
  /* Fallback for browsers without :has() */
  .season-card.has-portrait-image .season-content,
  .season-card.has-square-image .season-content {
    margin-top: 0;
    padding-top: 15px;
    position: relative;
    z-index: 1;
    background: var(--white);
  }
  
  /* Phase 3: Grid Layout - ensure proper spacing and alignment */
  .grid-4 {
    gap: 25px !important; /* Adequate gap for card spacing */
    align-items: start !important; /* Align to top, don't stretch */
  }
  
  .champions-grid {
    gap: 25px !important;
    align-items: start !important;
  }
  
  /* Remove any margin-bottom that was causing issues */
  .card:has(.card-image:has(.img-portrait)),
  .card:has(.card-image:has(.img-square)),
  .card:has(.card-image:has(.img-landscape)),
  .champion-card:has(.champion-photo:has(.img-portrait)),
  .champion-card:has(.champion-photo:has(.img-square)),
  .season-card:has(.season-image:has(.img-portrait)),
  .season-card:has(.season-image:has(.img-square)),
  .season-card:has(.season-image:has(.img-landscape)) {
    margin-bottom: 0 !important; /* Let grid gap handle spacing */
  }
  
  /* Fallback for browsers without :has() */
  .card.has-portrait-image,
  .card.has-square-image,
  .card.has-landscape-image,
  .champion-card.has-portrait-image,
  .champion-card.has-square-image,
  .season-card.has-portrait-image,
  .season-card.has-square-image,
  .season-card.has-landscape-image {
    margin-bottom: 0 !important;
  }
}

/* Boat Cards */
.boat-card {
  position: relative;
}

.boat-card .badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--success-green);
  color: var(--white);
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.boat-features {
  display: flex;
  gap: 15px;
  margin: 15px 0;
  flex-wrap: wrap;
}

.feature {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  color: var(--grey-medium);
}

.booking-info {
  background: var(--light-blue);
  padding: 15px;
  border-radius: 5px;
  margin-top: 15px;
}

.booking-info strong {
  color: var(--dark-blue);
}

/* Derby Table */
.derby-section {
  background: var(--grey-light);
}

.table-container {
  overflow-x: auto;
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 2px 8px var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: var(--primary-blue);
  color: var(--white);
}

th, td {
  padding: 12px;
  text-align: left;
}

tbody tr:nth-child(even) {
  background: var(--grey-light);
}

tbody tr:hover {
  background: var(--light-blue);
}

.species-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.lingcod { background: #ff6b6b; color: white; }
.chinook { background: #4ecdc4; color: white; }
.coho { background: #95e1d3; color: #333; }
.halibut { background: #f38181; color: white; }

/* Season Status */
.season-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.season-card {
  background: var(--white);
  border-radius: 8px;
  padding: 20px;
  border-left: 5px solid var(--success-green);
  box-shadow: 0 2px 8px var(--shadow);
}

.season-card.closed {
  border-left-color: var(--danger-red);
}

/* Season card image container (matches .card-image styling) */
.season-image {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--light-blue), var(--grey-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 12px;
}

/* Season cards: portrait and square show full image (no face cropping), same logic as trip/champion cards */
.season-image:has(.img-portrait),
.season-image:has(.img-square),
.season-image.has-portrait-image,
.season-image.has-square-image {
  height: auto;
  min-height: 180px;
  max-height: 400px;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.season-image:has(.img-portrait) img,
.season-image:has(.img-square) img,
.season-image.has-portrait-image img,
.season-image.has-square-image img {
  object-fit: contain !important;
  object-position: top center;
  width: 100%;
  height: auto;
  max-height: 400px;
  display: block;
}
/* Season cards: landscape show full image on desktop (no top cropping) */
.season-image:has(.img-landscape),
.season-image.has-landscape-image {
  height: auto;
  min-height: 180px;
  max-height: 400px;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.season-image:has(.img-landscape) img,
.season-image.has-landscape-image img {
  object-fit: contain !important;
  object-position: top center;
  width: 100%;
  height: auto;
  max-height: 400px;
  display: block;
}

.season-status {
  display: inline-block;
  padding: 5px 15px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 10px;
}

.status-open {
  background: var(--success-green);
  color: var(--white);
}

.status-closed {
  background: var(--danger-red);
  color: var(--white);
}

/* Season card: rules vary — not a simple open/closed fishery */
.status-regulations {
  background: var(--grey-medium);
  color: var(--white);
}

.season-card h3 {
  color: var(--dark-blue);
  margin-bottom: 10px;
}

.season-card p {
  margin: 5px 0;
  color: var(--grey-medium);
}

/* Blog Section */
.blog-posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 30px;
  min-height: 400px; /* Reserve space to prevent CLS */
}

.blog-card {
  display: flex;
  flex-direction: column;
}

.blog-card .card-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.blog-meta {
  display: flex;
  gap: 15px;
  font-size: 14px;
  color: var(--grey-medium);
  margin-bottom: 10px;
}

.blog-card .btn {
  margin-top: auto;
  align-self: flex-start;
}

/* Footer */
footer {
  min-height: 300px; /* Reserve space to prevent layout shift when footer loads */
  background: var(--dark-blue);
  color: var(--white);
  padding: 40px 20px 20px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 30px;
}

.footer-section h3 {
  margin-bottom: 15px;
  color: var(--white);
}

.footer-section ul {
  list-style: none;
}

.footer-section a {
  color: var(--light-blue);
  text-decoration: none;
  display: block;
  margin-bottom: 8px;
  transition: color 0.3s;
}

.footer-section a:hover {
  color: var(--white);
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--light-blue);
  width: 100%;
}

.footer-bottom p {
  text-align: center;
  margin: 0 auto;
  max-width: 100%;
}

.footer-bottom a {
  color: var(--white);
  text-decoration: underline;
  transition: opacity 0.3s;
}

.footer-bottom a:hover {
  opacity: 0.8;
}

.footer-managed-by {
  font-size: 0.75rem;
  margin-top: 8px;
  opacity: 0.85;
}

/* Filters */
.filters-container {
  margin-bottom: 30px;
}

.filters {
  display: flex;
  gap: 15px;
  margin-bottom: 30px;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-btn {
  padding: 10px 20px;
  border: 2px solid var(--primary-blue);
  background: var(--white);
  color: var(--primary-blue);
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: clamp(13px, 2vw, 15px);
  min-height: 44px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.search-box {
  margin-bottom: 20px;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.search-box input {
  width: 100%;
  padding: 14px 20px;
  border: 2px solid var(--grey-medium);
  border-radius: 8px;
  font-size: clamp(15px, 2vw, 16px);
  min-height: 44px;
  box-sizing: border-box;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary-blue);
  color: var(--white);
}

/* Chart Containers */
.chart-container {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
}

.chart-container canvas {
  max-height: 500px;
  width: 100% !important;
  height: auto !important;
}

/* ============================================
   CTA SECTION STYLES
   ============================================ */
.cta-section {
  text-align: center;
  background: linear-gradient(135deg, var(--primary-blue), var(--ocean-teal));
  color: var(--white);
  padding: 80px 20px;
}

.cta-section h2 {
  color: var(--white);
  font-size: clamp(28px, 5vw, 42px);
  margin-bottom: 20px;
  text-align: center;
}

.cta-section p {
  font-size: clamp(16px, 2.5vw, 20px);
  margin-bottom: 30px;
  text-align: center;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.cta-section .btn {
  font-size: clamp(16px, 2vw, 18px);
  padding: 18px 40px;
  max-width: 100%;
  box-sizing: border-box;
  display: inline-block;
}

/* Tablet and below - left align for better mobile readability */
@media (max-width: 768px) {
  .cta-section {
    text-align: left;
    padding: 60px 20px;
  }
  
  .cta-section h2 {
    text-align: left;
  }
  
  .cta-section p {
    text-align: left;
    margin-left: 0;
    margin-right: 0;
  }
  
  .cta-section .btn {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .cta-section {
    padding: 60px 15px;
  }
  
  .cta-section .btn {
    padding: 15px 30px;
  }
  
  /* Navigation overflow protection for very small screens */
  nav ul {
    gap: 6px 10px;
  }
  
  nav a {
    font-size: 13px;
    padding: 8px 2px;
    min-height: 44px;
  }
  
  /* Ensure header doesn't overflow */
  .header-content {
    padding: 10px 15px;
  }
}

/* ============================================
   TABLET BREAKPOINT (769px - 1024px)
   ============================================ */
@media (max-width: 1024px) {
  /* Grid layouts - 2 columns on tablet */
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .blog-posts {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .champions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Typography scaling for tablet */
  .hero h2 {
    font-size: 36px;
  }
  
  .section-header h2 {
    font-size: clamp(28px, 4vw, 36px);
  }
  
  /* Container padding adjustments */
  .container {
    padding: 50px 20px;
  }
}

/* ============================================
   MOBILE BREAKPOINT (768px and below)
   ============================================ */
@media (max-width: 768px) {
  /* Universal mobile container fixes */
  .container,
  section.container,
  .guide-content-section .container,
  .guide-hero .container {
    max-width: 100% !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
  
  /* Remove excessive padding from nested containers */
  section {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
  
  /* Content boxes - reduce padding */
  #guide-content,
  .captain-section,
  .boat-info,
  .card {
    padding: 15px !important;
  }
  
  /* Chart mobile optimizations */
  .chart-container {
    padding: 15px !important;
    margin-bottom: 20px !important;
  }
  
  .chart-container canvas {
    max-height: 300px !important;
  }
  
  /* Filter buttons mobile layout */
  .filters {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 8px !important;
    margin-bottom: 20px !important;
  }
  
  .filter-btn {
    font-size: 12px !important;
    padding: 8px 12px !important;
    min-width: auto !important;
  }

  /* Header */
  header {
    position: relative;
  }
  
  .header-content {
    flex-direction: column;
    gap: 15px;
    padding: 15px;
  }

  nav ul {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    gap: 10px 15px;
  }
  
  nav a {
    font-size: 14px;
  }

  /* Hero sections */
  .hero h2,
  .guide-hero h1 {
    font-size: 28px !important;
  }

  .hero p,
  .guide-hero p {
    font-size: 16px !important;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center; /* Center buttons vertically stacked */
    justify-content: center;
    width: 100%;
    padding: 0 20px;
    gap: 12px; /* Increased spacing between buttons */
  }
  
  .cta-buttons .btn {
    width: 100%;
    max-width: 280px; /* Limit width but allow centering */
    text-align: center;
    padding: 14px 24px; /* Larger touch target */
    margin: 0 auto; /* Center the button */
  }

  /* Grids */
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
    gap: 15px !important;
  }
  
  /* Blog posts / Guide cards */
  .blog-posts {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  
  /* Sponsor containers */
  .sponsors-grid,
  .sponsor-logo-container {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 15px !important;
  }
  
  /* Boat carousels and galleries */
  .boat-carousel {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .gallery-grid {
    column-count: 2 !important;
    column-gap: 10px !important;
  }
  .gallery-item {
    margin-bottom: 10px !important;
  }
  
  /* Images in content */
  #guide-content img,
  .captain-section img {
    max-width: 100% !important;
    height: auto !important;
  }
  
  /* Sponsor callouts in guides - stack on mobile */
  .sponsor-callout-content {
    flex-direction: column !important;
    text-align: center !important;
  }
  
  .sponsor-callout-logo {
    width: 140px !important;
    min-width: 140px !important;
    height: 100px !important;
    margin: 0 auto !important;
  }
  
  .sponsor-callout-info {
    width: 100% !important;
  }
  
  .sponsor-callout-arrow {
    display: none !important;
  }
  
  /* Typography in content */
  #guide-content h2 {
    font-size: 22px !important;
    margin-top: 25px !important;
  }
  
  #guide-content h3 {
    font-size: 18px !important;
    margin-top: 20px !important;
  }
  
  #guide-content p,
  #guide-content li {
    font-size: 16px !important;
    line-height: 1.7 !important;
    margin-bottom: 15px !important;
  }
  
  #guide-content ul,
  #guide-content ol {
    padding-left: 25px !important;
    margin-bottom: 20px !important;
  }
}

/* ========================================
   DYNAMIC BOAT SYSTEM STYLES
   ======================================== */

/* Loading Indicator */
.loading-indicator {
  text-align: center;
  padding: 60px 20px;
}

.spinner {
  border: 4px solid var(--grey-light);
  border-top: 4px solid var(--primary-blue);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Error Message */
.error-message {
  text-align: center;
  padding: 60px 20px;
  background: var(--light-blue);
}

.error-message h2 {
  color: var(--danger-red);
  margin-bottom: 15px;
}

/* Boat Hero Section */
.boat-hero {
  background: linear-gradient(135deg, rgba(0, 51, 102, 0.8), rgba(0, 102, 204, 0.8));
  background-size: cover;
  background-position: center;
  color: var(--white);
  padding: 80px 20px;
  text-align: center;
}

.boat-hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.boat-name {
  font-size: 48px;
  margin-bottom: 15px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.boat-tagline {
  font-size: 20px;
  opacity: 0.9;
}

/* Boat Details Layout */
.boat-details-section {
  padding: 40px 20px;
  background: var(--grey-light);
}

.boat-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.boat-main-content {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.boat-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Boat Profile Image */
.boat-profile-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--shadow);
}

/* Boat Description */
.boat-description {
  background: var(--white);
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 8px var(--shadow);
}

.boat-description h2 {
  color: var(--dark-blue);
  margin-bottom: 15px;
  text-align: left; /* Override container centering - section headings should be left-aligned */
}

#description-text {
  white-space: pre-line;
  line-height: 1.7;
}

/* Info Cards */
.info-card {
  background: var(--white);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px var(--shadow);
}

.info-card h3 {
  color: var(--dark-blue);
  margin-bottom: 15px;
  font-size: 18px;
}

/* Trip Types List */
.trip-types-list {
  list-style: none;
}

.trip-types-list li {
  padding: 8px 12px;
  margin-bottom: 8px;
  background: var(--light-blue);
  border-radius: 4px;
  color: var(--dark-blue);
  font-weight: 500;
}

/* Specs List */
.specs-list {
  list-style: none;
}

.specs-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--grey-light);
}

.specs-list li:last-child {
  border-bottom: none;
}

/* Amenities List */
.amenities-list {
  list-style: none;
}

.amenities-list li {
  padding: 6px 0;
  padding-left: 20px;
  position: relative;
}

.amenities-list li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success-green);
  font-weight: bold;
}

/* Pricing Content */
.pricing-content p {
  margin-bottom: 10px;
}

/* Contact Card */
.contact-card {
  background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
  color: var(--white);
}

.contact-card h3 {
  color: var(--white);
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.contact-item {
  margin-bottom: 12px;
}

.contact-item:last-child {
  margin-bottom: 0;
}

/* Contact Buttons */
.btn-contact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-contact:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateX(5px);
  text-decoration: none;
}

.btn-contact .icon {
  font-size: 20px;
  flex-shrink: 0;
}

.btn-contact .label {
  flex: 1;
  text-align: left;
}

/* Platform Buttons */
.platform-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.platform-btn {
  display: block;
  padding: 10px 15px;
  background: var(--white);
  color: var(--primary-blue);
  text-align: center;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
  transition: all 0.3s;
}

.platform-btn:hover {
  background: var(--light-blue);
  transform: translateY(-2px);
}

/* Social Links */
.social-media {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid rgba(255, 255, 255, 0.2);
}

.social-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  color: var(--white);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.social-link.facebook {
  background: rgba(24, 119, 242, 0.3);
  border-color: rgba(24, 119, 242, 0.5);
}

.social-link.facebook:hover {
  background: #1877f2;
  transform: translateX(5px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.social-link.instagram {
  background: rgba(193, 53, 132, 0.3);
  border-color: rgba(193, 53, 132, 0.5);
}

.social-link.instagram:hover {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  transform: translateX(5px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Member Badge */
.member-badge {
  background: linear-gradient(135deg, var(--success-green), #1e7e34);
  color: var(--white);
  text-align: center;
}

.member-badge p {
  margin-bottom: 5px;
}

.member-since {
  font-size: 14px;
  opacity: 0.9;
}

/* Photo Gallery */
.boat-gallery {
  background: var(--white);
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 8px var(--shadow);
}

.boat-gallery h2 {
  color: var(--dark-blue);
  margin-bottom: 20px;
  text-align: left; /* Override container centering - section headings should be left-aligned */
}

/* Masonry-style gallery: images keep aspect ratio, no cropping */
.gallery-grid {
  column-count: 3;
  column-gap: 15px;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 15px;
}

.gallery-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s;
  vertical-align: bottom;
}

.gallery-image:hover {
  transform: scale(1.02);
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: pointer;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 8px;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: var(--white);
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
}

.lightbox-close:hover {
  color: var(--accent-orange);
}

/* Lightbox Navigation Buttons */
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
  font-size: 30px;
  font-weight: bold;
  border: none;
  padding: 15px 20px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.3s ease;
  z-index: 10000;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.4);
  color: var(--accent-orange);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

/* Lightbox Counter */
.lightbox-counter {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--white);
  font-size: 16px;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.6);
  padding: 8px 16px;
  border-radius: 20px;
}

/* Captain Section */
.captain-section {
  background: var(--white);
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 8px var(--shadow);
}

.captain-section h2 {
  color: var(--dark-blue);
  margin-bottom: 20px;
  text-align: left; /* Override container centering - section headings should be left-aligned */
}

.captain-content {
  display: flex;
  gap: 20px;
  align-items: start;
}

/* When photo is hidden, bio takes full width */
.captain-content:has(.captain-photo[style*="display: none"]) {
  display: block;
}

.captain-photo {
  flex-shrink: 0;
  width: 150px;
}

.captain-photo img {
  width: 100%;
  border-radius: 50%;
  box-shadow: 0 2px 8px var(--shadow);
}

.captain-bio {
  flex: 1;
  text-align: left;
}

.captain-bio h3 {
  color: var(--dark-blue);
  margin-bottom: 10px;
  text-align: left;
  width: 100%;
}

/* Back to Boats */
.back-to-boats {
  padding: 40px 20px;
  text-align: center;
}

/* Filters Container */
.filters-container {
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Search Box */
.filters-container .search-box {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.filters-container .search-box input {
  width: 100%;
  max-width: 1000px;
  min-width: 400px;
  padding: 12px 20px;
  font-size: 16px;
  border: 2px solid var(--grey-light);
  border-radius: 25px;
  outline: none;
  transition: border-color 0.3s;
  box-sizing: border-box;
}

.search-box input:focus {
  border-color: var(--primary-blue);
}

/* Filters */
.filters {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 10px 20px;
  background: var(--white);
  color: var(--grey-dark);
  border: 2px solid var(--grey-light);
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s;
}

.filter-btn:hover {
  border-color: var(--primary-blue);
  color: var(--primary-blue);
}

.filter-btn.active {
  background: var(--primary-blue);
  color: var(--white);
  border-color: var(--primary-blue);
}

/* No Results */
.no-results {
  text-align: center;
  padding: 60px 20px;
  background: var(--light-blue);
  border-radius: 8px;
  margin-top: 30px;
}

.no-results h3 {
  color: var(--dark-blue);
  margin-bottom: 10px;
}

/* Boat Card Enhancements */
.boat-card {
  transition: transform 0.3s, box-shadow 0.3s;
}

.boat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px var(--shadow);
}

.boat-specs {
  color: var(--grey-medium);
  font-size: 14px;
  margin: 5px 0;
}

/* Responsive Design for Boat Pages */
@media (max-width: 768px) {
  .boat-layout {
    grid-template-columns: 1fr;
  }

  .boat-name {
    font-size: 32px;
  }

  .boat-tagline {
    font-size: 16px;
  }

  .captain-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .captain-photo {
    width: 120px;
  }
  
  .captain-bio {
    width: 100%;
  }

  .gallery-grid {
    column-count: 2 !important;
    column-gap: 10px !important;
  }
  .gallery-item {
    margin-bottom: 10px !important;
  }

  .filters-container {
    padding: 0 10px;
  }

  .search-box input {
    font-size: 14px;
  }
}

/* ============================================
   CHARTER OFFICE STYLES
   ============================================ */

/* Charter Office Card (Full Info) */
.charter-office-card {
  background: var(--white);
  border: 2px solid var(--primary-blue);
  border-radius: 12px;
  padding: 25px;
  margin: 30px 0;
  display: flex;
  gap: 25px;
  align-items: flex-start;
  box-shadow: 0 4px 12px var(--shadow);
}

.charter-office-card .office-logo {
  flex-shrink: 0;
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--light-blue);
  border-radius: 8px;
  padding: 15px;
}

.charter-office-card .office-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.charter-office-card .office-info {
  flex: 1;
}

.charter-office-card h3 {
  color: var(--primary-blue);
  font-size: 28px;
  margin-bottom: 12px;
  font-weight: 700;
}

.charter-office-card .office-description {
  color: var(--grey-medium);
  margin-bottom: 18px;
  line-height: 1.6;
}

.charter-office-card .office-contact {
  margin-bottom: 15px;
}

.charter-office-card .office-contact p {
  margin: 8px 0;
  color: var(--grey-dark);
}

.charter-office-card .office-contact a {
  color: var(--primary-blue);
  text-decoration: none;
  font-weight: 500;
}

.charter-office-card .office-contact a:hover {
  text-decoration: underline;
}

.charter-office-card .office-social {
  display: flex;
  gap: 12px;
  margin-top: 15px;
}

.charter-office-card .social-link {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s ease;
}

.charter-office-card .social-link.facebook {
  background: #1877f2;
  color: var(--white);
}

.charter-office-card .social-link.instagram {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  color: var(--white);
}

.charter-office-card .social-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px var(--shadow);
}

/* Charter Office Banner (Compact - for boat pages) */
.charter-office-banner {
  background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
  border-radius: 12px;
  padding: 20px;
  margin: 30px 0;
  display: flex;
  flex-direction: column; /* Stack vertically on all screen sizes for true centering */
  gap: 20px;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px var(--shadow);
  color: var(--white);
  text-align: center;
}

.charter-office-banner .banner-logo {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border-radius: 8px;
  padding: 12px;
}

.charter-office-banner .banner-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.charter-office-banner .banner-content {
  text-align: center; /* Center-align booking office information */
}

.charter-office-banner h4 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.9;
  margin-bottom: 5px;
  font-weight: 500;
}

.charter-office-banner h3 {
  font-size: 26px;
  margin-bottom: 8px;
  font-weight: 700;
}

.charter-office-banner p {
  margin: 5px 0;
  font-size: 16px;
}

.charter-office-banner a {
  color: var(--white);
  text-decoration: none;
}

.charter-office-banner a:hover {
  text-decoration: underline;
}

.charter-office-banner .btn-book {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 24px;
  background: var(--white);
  color: var(--primary-blue);
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.charter-office-banner .btn-book:hover {
  background: var(--light-blue);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  text-decoration: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .charter-office-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .charter-office-card .office-logo {
    width: 120px;
    height: 120px;
  }

  .charter-office-card .office-social {
    justify-content: center;
  }

  .charter-office-banner {
    flex-direction: column;
    text-align: center;
  }

  .charter-office-banner .banner-logo {
    width: 80px;
    height: 80px;
  }

  .charter-office-banner h3 {
    font-size: 22px;
  }
}

/* Charter Office Logo in Contact Card */
.office-logo-small {
  text-align: center;
  padding: 15px;
  margin-bottom: 20px;
  background: var(--light-blue);
  border-radius: 8px;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.office-logo-small:hover {
  background: var(--white);
  border-color: var(--primary-blue);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

.office-logo-small img {
  max-width: 120px;
  max-height: 80px;
  object-fit: contain;
  margin-bottom: 8px;
  transition: transform 0.3s ease;
}

.office-logo-small:hover img {
  transform: scale(1.05);
}

.office-logo-small .office-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-blue);
  margin: 5px 0;
  transition: color 0.3s ease;
}

.office-logo-small:hover .office-name {
  color: var(--dark-blue);
}

.office-logo-small .office-booking-note {
  font-size: 13px;
  color: var(--grey-medium);
  margin: 5px 0 0 0;
  font-weight: 500;
}

.office-logo-small:hover .office-booking-note {
  color: var(--primary-blue);
}

/* Independent Operator Badge */
.independent-badge {
  text-align: center;
  padding: 15px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--ocean-teal), var(--primary-blue));
  color: var(--white);
  border-radius: 8px;
}

.independent-badge p {
  margin: 5px 0;
}

.independent-badge .independent-note {
  font-size: 13px;
  opacity: 0.9;
}

/* Accommodations Link */
.accommodations-link {
  margin: 20px 0;
  text-align: center;
}

.btn-accommodations {
  display: block;
  padding: 12px 20px;
  background: var(--ocean-teal);
  color: var(--white);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s ease;
  text-align: center;
}

.btn-accommodations:hover {
  background: var(--primary-blue);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px var(--shadow);
}

/* ==================== Guides System ==================== */

/* Guides Grid */
.guides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.guide-card {
  transition: all 0.3s ease;
  cursor: pointer;
}

.guide-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px var(--shadow);
}

.guide-featured {
  border: 2px solid #ffd700;
}

.guide-icon {
  transition: transform 0.3s ease;
}

.guide-card:hover .guide-icon {
  transform: scale(1.1);
}

/* Guide Modal */
.guide-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.guide-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
}

.guide-modal-content {
  position: relative;
  background: white;
  width: 90%;
  max-width: 1000px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}

.guide-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.3);
  border: none;
  color: white;
  font-size: 36px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
  line-height: 1;
  padding: 0;
}

.guide-modal-close:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: rotate(90deg);
}

/* Modal Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Boat Carousel Styles */
.boat-carousel-container {
  position: relative;
  padding: 0 20px; /* Space for arrow buttons */
}

.boat-carousel-track {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 10px 0 15px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: auto; /* Make scrollbar more visible */
  scrollbar-color: #0066cc #e0e0e0;
  scroll-snap-type: x mandatory; /* Snap to cards */
}

.boat-carousel-track::-webkit-scrollbar {
  height: 12px; /* Bigger scrollbar */
}

.boat-carousel-track::-webkit-scrollbar-track {
  background: #e0e0e0;
  border-radius: 10px;
}

.boat-carousel-track::-webkit-scrollbar-thumb {
  background: #0066cc;
  border-radius: 10px;
  border: 2px solid #e0e0e0; /* Make it more prominent */
}

.boat-carousel-track::-webkit-scrollbar-thumb:hover {
  background: #003d7a;
  border-color: #d0d0d0;
}

.boat-carousel-card {
  min-width: 280px;
  max-width: 300px;
  background: white;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
  flex-shrink: 0;
  scroll-snap-align: start; /* Snap to start of card */
}

.boat-carousel-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* Responsive Guides */
@media (max-width: 768px) {
  .guides-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .guide-modal-content {
    width: 95%;
    max-height: 95vh;
  }
  
  .guide-modal-close {
    width: 40px;
    height: 40px;
    font-size: 28px;
  }
  
  .guide-body {
    padding: 20px !important;
  }
  
  /* Mobile boat carousel optimizations */
  .boat-carousel-container {
    padding: 0 10px; /* Less padding for mobile */
  }
  
  .boat-carousel-card {
    min-width: 260px;
    max-width: 280px;
  }
  
  .boat-carousel-track {
    gap: 12px;
    padding: 10px 5px 15px 5px;
  }
  
  /* Make arrow buttons more prominent on mobile */
  .boat-carousel-container button[onclick*="scrollCarousel"] {
    width: 44px !important; /* Touch-friendly size */
    height: 44px !important;
    font-size: 28px !important;
    left: -10px !important;
  }
  
  .boat-carousel-container button[onclick*="scrollCarousel"][aria-label="Scroll right"] {
    right: -10px !important;
    left: auto !important;
  }
  
  /* Bigger scrollbar on mobile for easier grabbing */
  .boat-carousel-track::-webkit-scrollbar {
    height: 14px;
  }
}

@media (max-width: 480px) {
  /* Smaller phones */
  .boat-carousel-card {
    min-width: 240px;
    max-width: 260px;
    padding: 12px;
  }
}

/* ============================================
   BOATS PAGE SPECIFIC STYLES
   ============================================ */

/* Boats page hero */
.boats-page-hero {
  padding: 60px 20px;
}

.boats-page-hero h1 {
  font-size: clamp(28px, 5vw, 42px);
  margin-bottom: 12px;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: clamp(16px, 3vw, 20px);
  font-weight: normal;
  margin-top: 10px;
  line-height: 1.4;
}

.hero-tagline {
  margin-top: 15px;
  font-size: clamp(15px, 3vw, 18px);
  line-height: 1.5;
}

/* Breadcrumb section */
.breadcrumb-section {
  padding: 15px 20px !important;
}

.breadcrumb-list {
  display: flex;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
  color: var(--grey-medium);
  flex-wrap: wrap;
}

.breadcrumb-list a {
  color: var(--primary-blue);
  text-decoration: none;
  padding: 4px 0;
}

.breadcrumb-list a:hover {
  text-decoration: underline;
}

.breadcrumb-list li[aria-current="page"] {
  color: var(--grey-dark);
}

/* SEO intro section */
.seo-intro-section {
  padding: 25px 20px !important;
}

.seo-intro-content {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.seo-intro-content p {
  font-size: clamp(16px, 2.5vw, 18px);
  line-height: 1.7;
  color: var(--grey-dark);
  text-align: center;
  max-width: 75ch;
  margin-left: auto;
  margin-right: auto;
}

/* Booking help section */
.booking-help-section {
  background: var(--grey-light);
}

.booking-help-section .card-content {
  text-align: center;
}

.booking-help-section .card-content p {
  text-align: center;
  max-width: 100%;
}

/* Visually hidden - for screen readers only */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   TABLET BREAKPOINT (769px - 1024px)
   Treats tablets as distinct devices with
   moderate layouts between mobile and desktop
   ============================================ */
@media (min-width: 769px) and (max-width: 1024px) {
  /* Container spacing */
  .container {
    padding: 50px 20px;
  }
  
  /* Grids - 2 columns on tablet */
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }
  
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .blog-posts {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }
  
  .guides-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }
  
  .season-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  /* Hero section - tablet padding */
  .hero {
    padding: 70px 20px;
  }
  
  .hero h1,
  .hero h2 {
    font-size: clamp(32px, 4.5vw, 42px);
    line-height: 1.3;
  }
  
  .hero p {
    font-size: clamp(17px, 2.2vw, 19px);
    line-height: 1.7;
  }
  
  /* CTA buttons - horizontal layout on tablet */
  .cta-buttons {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
  }
  
  .cta-buttons .btn {
    width: auto;
    max-width: none;
    margin: 0;
    flex: 0 1 auto;
    min-width: 200px;
  }
  
  /* Boats page hero - tablet specific */
  .hero.boats-page-hero {
    padding: 50px 20px;
  }
  
  .hero.boats-page-hero h1 {
    font-size: 32px;
  }
  
  .hero.boats-page-hero h2 {
    font-size: 18px;
  }
  
  /* Section headers */
  .section-header h2 {
    font-size: 32px;
  }
  
  .section-header p {
    font-size: 17px;
  }
  
  /* Navigation - tablet spacing */
  nav ul {
    gap: 20px;
  }
  
  nav a {
    font-size: 15px;
    padding: 10px 5px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  
  /* Filter buttons - tablet touch targets */
  .filter-btn {
    padding: 12px 18px;
    font-size: 14px;
    min-height: 44px;
  }
  
  .filters {
    gap: 12px;
  }
  
  /* Search input - tablet */
  .filters-container .search-box input {
    padding: 14px 20px;
    font-size: 16px;
    max-width: 1000px;
    min-width: 400px;
  }
  
  .filters-container .search-box {
    max-width: 100%;
  }
  
  /* Cards - tablet spacing */
  .card-content {
    padding: 18px;
  }
  
  /* Boat layout on tablet */
  .boat-layout {
    grid-template-columns: 1.5fr 1fr;
    gap: 25px;
  }
  
  .boat-name {
    font-size: 38px;
  }
  
  .boat-tagline {
    font-size: 18px;
  }
  
  /* Footer on tablet */
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
  }
  
  /* Charter office card - tablet */
  .charter-office-card {
    padding: 20px;
    gap: 20px;
  }
  
  .charter-office-card .office-logo {
    width: 130px;
    height: 130px;
  }
  
  /* Boat carousel - tablet */
  .boat-carousel-card {
    min-width: 280px;
    max-width: 300px;
  }
}

/* ============================================
   ENHANCED MOBILE BREAKPOINT (max-width: 768px)
   Comprehensive mobile optimizations
   ============================================ */

/* Touch-Friendly Filter Buttons */
@media (max-width: 768px) {
  /* Filter buttons - minimum 44px touch targets */
  .filter-btn {
    min-height: 44px;
    padding: 12px 16px !important;
    font-size: 13px !important;
    line-height: 1.2;
    white-space: nowrap;
  }
  
  .filters {
    gap: 10px !important;
    padding: 0 5px;
  }
  
  /* Search input - touch-friendly */
  .filters-container .search-box input {
    padding: 16px 20px !important;
    font-size: 16px !important; /* Prevents iOS zoom */
    width: 100%;
    max-width: 100% !important;
    min-width: 100% !important;
    min-height: 52px;
  }
  
  .filters-container .search-box {
    padding: 0 10px;
    max-width: 100%;
    width: 100%;
  }
  
  /* Navigation - touch-friendly links */
  nav ul {
    gap: 8px 12px;
  }
  
  nav a {
    padding: 12px 8px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  
  /* Hero section - mobile padding and typography */
  .hero {
    padding: 40px 15px !important;
  }
  
  .hero h1 {
    font-size: clamp(24px, 6vw, 32px);
    line-height: 1.3;
    margin-bottom: 12px;
  }
  
  .hero h2 {
    font-size: clamp(22px, 5vw, 28px) !important;
    line-height: 1.3;
  }
  
  .hero p {
    font-size: clamp(15px, 4vw, 18px) !important;
    line-height: 1.7; /* Increased for better mobile readability */
    margin-bottom: 20px;
    max-width: 100%;
  }
  
  /* Boats page hero specific styles */
  .hero.boats-page-hero {
    padding: 35px 15px !important;
  }
  
  .hero.boats-page-hero h1 {
    font-size: clamp(22px, 5.5vw, 28px);
  }
  
  .hero.boats-page-hero h2 {
    font-size: clamp(16px, 4vw, 20px) !important;
    font-weight: normal;
    margin-top: 8px;
  }
  
  .hero.boats-page-hero p {
    font-size: clamp(14px, 3.5vw, 18px) !important;
    margin-top: 12px;
  }
  
  /* Section headers - mobile */
  .section-header {
    margin-bottom: 30px;
  }
  
  .section-header h2 {
    font-size: clamp(24px, 5vw, 32px);
    line-height: 1.3;
  }
  
  .section-header p {
    font-size: clamp(15px, 4vw, 18px);
    line-height: 1.7; /* Increased for better mobile readability */
    max-width: 100%;
    padding: 0 10px;
  }
  
  /* Card images - proportional scaling */
  .card-image {
    height: 180px;
    aspect-ratio: 16 / 10;
  }
  
  /* Booking info - mobile touch targets */
  .booking-info {
    padding: 15px;
  }
  
  .booking-info .btn {
    min-height: 44px;
    padding: 12px 20px;
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
  }
  
  .booking-info .btn:last-child {
    margin-bottom: 0;
  }
  
  /* Buttons - mobile touch targets */
  .btn {
    min-height: 44px;
    padding: 14px 24px;
  }
  
  .btn-secondary {
    min-height: 44px;
    padding: 12px 20px;
  }
  
  /* CTA buttons - stack and center */
  .cta-buttons {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 10px;
  }
  
  .cta-buttons .btn {
    width: 100%;
    max-width: 280px;
    margin: 0 auto; /* Center the button */
  }
  
  /* No results - mobile */
  .no-results {
    padding: 40px 15px;
  }
  
  .no-results h3 {
    font-size: 20px;
  }
  
  /* Loading indicator - mobile */
  .loading-indicator {
    padding: 40px 15px;
  }
  
  .spinner {
    width: 40px;
    height: 40px;
  }
  
  /* Boat cards - mobile layout */
  .boat-card .card-content {
    padding: 15px;
  }
  
  .boat-features {
    gap: 10px;
  }
  
  .feature {
    font-size: 13px;
  }
  
  /* Boat page hero - mobile */
  .boat-hero {
    padding: 50px 15px;
  }
  
  .boat-name {
    font-size: clamp(26px, 6vw, 32px) !important;
    line-height: 1.2;
  }
  
  .boat-tagline {
    font-size: clamp(14px, 4vw, 16px) !important;
  }
  
  /* Contact buttons - mobile touch targets */
  .btn-contact {
    min-height: 48px;
    padding: 14px 16px;
  }
  
  /* Breadcrumb - mobile */
  nav[aria-label="Breadcrumb"] ol {
    font-size: 13px;
    flex-wrap: wrap;
  }
  
  /* SEO intro paragraph - mobile */
  .container > div[style*="max-width: 900px"] {
    padding: 0 10px;
  }
  
  .container > div[style*="max-width: 900px"] p {
    font-size: 16px !important;
    line-height: 1.7;
  }
}

/* ============================================
   SMALL PHONE BREAKPOINT (max-width: 480px)
   Extra adjustments for very small screens
   ============================================ */
@media (max-width: 480px) {
  /* Hero - smaller phones */
  .hero {
    padding: 30px 12px !important;
  }
  
  .hero h2 {
    font-size: 22px !important;
  }
  
  .hero p {
    font-size: 14px !important;
  }
  
  /* Boats page hero - smaller phones */
  .hero.boats-page-hero h1 {
    font-size: 20px;
  }
  
  .hero.boats-page-hero h2 {
    font-size: 14px !important;
  }
  
  /* Filter buttons - wrap text if needed */
  .filter-btn {
    padding: 10px 12px !important;
    font-size: 12px !important;
    flex-shrink: 0;
  }
  
  .filters {
    justify-content: flex-start !important;
    overflow-x: auto;
    flex-wrap: nowrap !important;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Container - tighter padding */
  .container {
    padding: 30px 12px !important;
  }
  
  /* Section headers - smaller phones */
  .section-header h2 {
    font-size: 22px;
  }
  
  .section-header p {
    font-size: 14px;
  }
  
  /* Cards - tighter content */
  .card-content {
    padding: 15px !important; /* Slightly more padding for readability */
  }
  
  .card h3 {
    font-size: clamp(16px, 4vw, 18px);
    line-height: 1.4;
  }
  
  /* Boat name */
  .boat-name {
    font-size: 24px !important;
  }
  
  /* Navigation - smaller spacing */
  nav ul {
    gap: 6px 10px;
  }
  
  nav a {
    font-size: 13px;
    padding: 10px 6px;
  }
}

/* ============================================
   ACCESSIBILITY & FOCUS STATES
   ============================================ */

/* Visible focus states for keyboard navigation */
.filter-btn:focus,
.btn:focus,
.btn-contact:focus,
nav a:focus,
.search-box input:focus {
  outline: 3px solid var(--primary-blue);
  outline-offset: 2px;
}

/* Focus within for filter container */
.filters-container:focus-within {
  outline: none;
}

/* High contrast focus for dark backgrounds */
.hero .btn:focus,
.contact-card .btn-contact:focus {
  outline-color: var(--white);
}

/* Prevent horizontal scroll at all breakpoints */
html, body {
  overflow-x: hidden;
}

.container,
section {
  max-width: 100vw;
}

/* Ensure images don't overflow */
img {
  max-width: 100%;
  height: auto;
}

/* Prevent text from stretching edge-to-edge */
p, li {
  max-width: 75ch;
}

.section-header p,
.hero p {
  max-width: 65ch;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================
   CHAMPIONS SECTION STYLES
   (Moved from inline styles in index.html)
   ============================================ */

.champions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  margin-top: 30px;
  min-height: 500px; /* Reserve space to prevent CLS */
}

.champion-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  animation: fadeInUp 0.6s ease;
  position: relative;
  cursor: pointer;
}

.champion-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

.champion-photo {
  width: 100%;
  height: 220px;
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.champion-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.3s ease;
}

/* Smart orientation handling */
.champion-photo img.img-portrait {
  object-fit: contain;
  object-position: top center; /* Show top portion (faces, fish heads) */
}

.champion-photo img.img-landscape {
  object-fit: cover;
  object-position: center;
}

.champion-photo img.img-square {
  object-fit: cover;
  object-position: center;
}

/* Champion cards: show full image for portrait and square (no face cropping); same logic as trip cards */
.champion-photo:has(.img-portrait),
.champion-photo:has(.img-square),
.champion-photo.has-portrait-image,
.champion-photo.has-square-image {
  height: auto;
  min-height: 220px;
  max-height: 420px;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.champion-photo:has(.img-portrait) img,
.champion-photo:has(.img-square) img,
.champion-photo.has-portrait-image img,
.champion-photo.has-square-image img {
  object-fit: contain !important;
  object-position: top center;
  width: 100%;
  height: auto;
  max-height: 420px;
  display: block;
}
/* Champion cards: landscape also show full image on desktop (no top cropping) */
.champion-photo:has(.img-landscape),
.champion-photo.has-landscape-image {
  height: auto;
  min-height: 220px;
  max-height: 420px;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.champion-photo:has(.img-landscape) img,
.champion-photo.has-landscape-image img {
  object-fit: contain !important;
  object-position: top center;
  width: 100%;
  height: auto;
  max-height: 420px;
  display: block;
}

.champion-photo.no-photo {
  font-size: 60px;
}

.champion-trophy {
  position: absolute;
  bottom: 15px;
  right: 15px;
  background: rgba(255, 215, 0, 0.95);
  color: #333;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 2;
}

.champion-prize-badge {
  position: absolute;
  bottom: 15px;
  left: 15px;
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: white;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 2;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.promo-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 2;
}

.promo-card {
  transition: all 0.3s ease;
}

.promo-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 16px 32px rgba(0,0,0,0.2);
}

.champion-info {
  padding: 20px;
  background: white; /* Ensure solid background for text contrast */
  color: #333; /* Dark text for readability */
}

.champion-species {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Species badge colors - optimized for WCAG AA contrast (4.5:1 minimum) */
.species-lingcod { background: #d63031; color: white; } /* Darker red for contrast */
.species-chinook { background: #0066cc; color: white; } /* Darker blue for contrast */
.species-halibut { background: #c9a227; color: #1a1a1a; } /* Darker gold with dark text */
.species-coho { background: #00a86b; color: white; } /* Darker teal for contrast */
.species-albacore { background: #6c5ce7; color: white; } /* Darker purple for contrast */

.boat-link {
  color: #0066cc;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

.boat-link:hover {
  color: #0052a3;
  border-bottom-color: #0052a3;
}

.champion-name {
  font-size: 22px;
  font-weight: bold;
  color: #003366;
  margin: 8px 0;
}

.champion-location {
  font-size: 14px;
  color: #666;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.champion-stats {
  background: #f8f9fa;
  padding: 12px;
  border-radius: 8px;
  margin-top: 12px;
}

.champion-stat {
  display: flex;
  justify-content: space-between;
  margin: 6px 0;
  font-size: 14px;
}

.champion-stat-label {
  color: #666;
}

.champion-stat-value {
  font-weight: bold;
  color: #003366; /* Dark blue - good contrast on light background */
}

.champion-weight {
  font-size: 28px;
  font-weight: bold;
  color: #b8860b; /* Darker gold for better contrast on white */
  text-align: center;
  margin: 15px 0;
}

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

/* Tie Winner Styles */
.champion-card-tie {
  padding: 20px;
}

.champion-card-tie .champion-prize-badge {
  bottom: auto;
  top: 15px;
  left: 15px;
}

.champion-card-tie .champion-trophy {
  bottom: auto;
  top: 15px;
  right: 15px;
}

.tie-header {
  text-align: center;
  padding-bottom: 15px;
  padding-top: 15px;
  margin-top: 10px;
  border-bottom: 2px solid #f0f0f0;
}

.tie-winners {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 15px;
}

.tie-winner {
  display: flex;
  gap: 15px;
  align-items: center;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
  cursor: pointer;
}

.tie-photo {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tie-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.3s ease;
}

/* Smart orientation for tie photos */
.tie-photo img.img-portrait {
  object-fit: contain;
  object-position: top center; /* Show top portion (faces, fish heads) */
}

.tie-photo img.img-landscape {
  object-fit: cover;
}

.tie-photo img.img-square {
  object-fit: contain;
  object-position: top center;
}

.tie-photo-placeholder {
  font-size: 40px;
}

.tie-info {
  flex: 1;
}

/* Champion Modal/Lightbox Styles */
.champion-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  animation: fadeIn 0.3s ease;
}

.champion-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.champion-modal-content {
  background: white;
  border-radius: 12px;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.3s ease;
}

.champion-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 32px;
  font-weight: bold;
  color: #666;
  cursor: pointer;
  z-index: 10;
  background: white;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: all 0.2s ease;
}

.champion-modal-close:hover {
  background: #f0f0f0;
  transform: scale(1.1);
}

.champion-modal-photo {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border-radius: 12px 12px 0 0;
}

.champion-modal-photo.no-image {
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 100px;
}

.champion-modal-info {
  padding: 30px;
}

.champion-modal-trophy {
  display: inline-block;
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #333;
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 15px;
}

.champion-modal-species {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 10px;
}

.champion-modal-name {
  font-size: 32px;
  font-weight: bold;
  color: #003366;
  margin: 15px 0;
}

.champion-modal-location {
  font-size: 18px;
  color: #666;
  margin-bottom: 20px;
}

.champion-modal-weight {
  font-size: 48px;
  font-weight: bold;
  color: #d4af37;
  text-align: center;
  margin: 20px 0;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 10px;
}

.champion-modal-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.champion-modal-stat {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
}

.champion-modal-stat-label {
  font-size: 14px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}

.champion-modal-stat-value {
  font-size: 18px;
  font-weight: bold;
  color: #003366;
}

/* Champions Section Responsive */
@media (max-width: 768px) {
  .champions-grid {
    grid-template-columns: 1fr;
  }
  
  .champion-modal-content {
    width: 95%;
    max-height: 95vh;
  }
  
  .champion-modal-name {
    font-size: 24px;
  }
  
  .champion-modal-weight {
    font-size: 36px;
  }
}

/* ============================================
   ACCESSIBILITY & UTILITY STYLES
   ============================================ */

/* Skip Navigation Link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--primary-blue);
  color: var(--white);
  padding: 12px 24px;
  z-index: 10000;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 8px 0;
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--ocean-teal);
  outline-offset: 2px;
}

/* Alternative Background Section */
.section-alt-bg {
  background: var(--grey-light);
}

/* Loading States for Dynamic Content */
.champions-loading,
.guides-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: var(--grey-medium);
}

/* Focus Visible for Keyboard Navigation */
*:focus-visible {
  outline: 3px solid var(--primary-blue);
  outline-offset: 2px;
}

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
