/**
 * Hero Bridges Section Block Styles
 * 
 * Mobile-first responsive design for the "31 Covered Bridges" hero section
 * Pixel-perfect replication with performance optimizations
 */

/* ==========================================================================
   Base Styles (Mobile First - 320px+)
   ========================================================================== */

.bridges-hero-bridges-section {
  position: relative;
  width: 100%;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #000;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: scroll;
}

/* Background image optimization */
.bridges-hero-bridges-section.has-background-image {
  background-attachment: scroll; /* Better performance on mobile */
}

/* Hidden background image for SEO */
.bridges-hero-bridges-bg-image {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Overlay */
.bridges-hero-bridges-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #292929;
  opacity: 0.15;
  pointer-events: none;
  z-index: 1;
}

/* Container */
.bridges-hero-bridges-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Content wrapper */
.bridges-hero-bridges-content {
  width: 100%;
  text-align: center;
  padding: 2rem 0;
}

/* Heading styles - Mobile */
.bridges-hero-bridges-heading {
  font-family: "henderson-slab-basic", Georgia, serif;
  font-weight: 400;
  color: #ffffff;
  margin: 0;
  padding: 0;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);

  /* Mobile typography */
  font-size: 2rem; /* 32px */
  line-height: 2.2rem; /* 35.2px */
}

/* Height variations */
.bridges-hero-bridges-height-auto {
  min-height: auto;
}

.bridges-hero-bridges-height-viewport {
  min-height: 100vh;
  min-height: 100dvh; /* Dynamic viewport height for mobile */
}

.bridges-hero-bridges-height-custom {
  min-height: 300px; /* Mobile fallback */
}

/* Text alignment variations */
.bridges-hero-bridges-text-left .bridges-hero-bridges-content {
  text-align: left;
}

.bridges-hero-bridges-text-center .bridges-hero-bridges-content {
  text-align: center;
}

.bridges-hero-bridges-text-right .bridges-hero-bridges-content {
  text-align: right;
}

/* Vertical alignment variations */
.bridges-hero-bridges-vertical-top {
  align-items: flex-start;
  padding-top: 2rem;
}

.bridges-hero-bridges-vertical-center {
  align-items: center;
}

.bridges-hero-bridges-vertical-bottom {
  align-items: flex-end;
  padding-bottom: 2rem;
}

/* ==========================================================================
   Tablet Styles (768px+)
   ========================================================================== */

@media (min-width: 768px) {
  .bridges-hero-bridges-section {
    min-height: 400px;
  }

  .bridges-hero-bridges-container {
    padding: 0 2rem;
  }

  .bridges-hero-bridges-content {
    padding: 3rem 0;
  }

  /* Tablet typography */
  .bridges-hero-bridges-heading {
    font-size: 3.5rem; /* 56px */
    line-height: 3.85rem; /* 61.6px */
  }

  .bridges-hero-bridges-height-custom {
    min-height: 400px;
  }

  /* Enable background attachment on larger screens */
  .bridges-hero-bridges-section.has-background-image {
    background-attachment: fixed;
  }
}

/* ==========================================================================
   Desktop Styles (1024px+)
   ========================================================================== */

@media (min-width: 1024px) {
  .bridges-hero-bridges-section {
    min-height: 487px; /* Pixel-perfect match */
  }

  .bridges-hero-bridges-container {
    padding: 0 3rem;
  }

  .bridges-hero-bridges-content {
    padding: 4rem 0;
  }

  /* Desktop typography - Pixel perfect */
  .bridges-hero-bridges-heading {
    font-size: 4.9875rem; /* 79.8px - exact match */
    line-height: 5.31668rem; /* 85.0668px - exact match */
  }

  .bridges-hero-bridges-height-custom {
    min-height: 487px; /* Exact pixel match */
  }

  /* Add top padding to account for header */
  .bridges-hero-bridges-vertical-center {
    padding-top: 147.984px; /* Exact match from original */
  }
}

/* ==========================================================================
   Large Desktop Styles (1200px+)
   ========================================================================== */

@media (min-width: 1200px) {
  .bridges-hero-bridges-container {
    max-width: 1200px;
    padding: 0 4rem;
  }

  /* Maintain exact typography at large sizes */
  .bridges-hero-bridges-heading {
    font-size: 4.9875rem; /* 79.8px */
    line-height: 5.31668rem; /* 85.0668px */
  }
}

/* ==========================================================================
   Performance Optimizations
   ========================================================================== */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .bridges-hero-bridges-section {
    background-attachment: scroll;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .bridges-hero-bridges-overlay {
    opacity: 0.3;
  }

  .bridges-hero-bridges-heading {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .bridges-hero-bridges-section {
    background-color: #000;
  }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
  .bridges-hero-bridges-section {
    background: none !important;
    color: #000 !important;
    min-height: auto !important;
    page-break-inside: avoid;
  }

  .bridges-hero-bridges-overlay {
    display: none;
  }

  .bridges-hero-bridges-heading {
    color: #000 !important;
    text-shadow: none !important;
    font-size: 2rem !important;
    line-height: 2.2rem !important;
  }

  .bridges-hero-bridges-bg-image {
    position: static;
    width: 100%;
    height: auto;
    clip: auto;
    margin: 1rem 0;
  }
}

/* ==========================================================================
   Editor Styles (Gutenberg)
   ========================================================================== */

.wp-block-bridges-hero-bridges {
  margin: 0;
}

.editor-styles-wrapper .bridges-hero-bridges-section {
  margin: 0;
}

/* Editor preview adjustments */
.block-editor-block-list__layout .bridges-hero-bridges-section {
  min-height: 300px;
}

/* ==========================================================================
   Accessibility Enhancements
   ========================================================================== */

/* Screen reader only class */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Focus styles for keyboard navigation */
.bridges-hero-bridges-section:focus-within {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* High contrast focus indicators */
@media (prefers-contrast: high) {
  .bridges-hero-bridges-section:focus-within {
    outline: 3px solid #ffffff;
    outline-offset: 3px;
  }
}

/* ==========================================================================
   Loading States & Performance
   ========================================================================== */

/* Skeleton loading state */
.bridges-hero-bridges-section.is-loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Optimize for GPU acceleration */
.bridges-hero-bridges-overlay,
.bridges-hero-bridges-content {
  transform: translateZ(0);
  will-change: transform;
}

/* ==========================================================================
   Browser-specific Optimizations
   ========================================================================== */

/* Safari-specific optimizations */
@supports (-webkit-appearance: none) {
  .bridges-hero-bridges-section {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }
}

/* Firefox-specific optimizations */
@-moz-document url-prefix() {
  .bridges-hero-bridges-section {
    background-attachment: scroll; /* Better performance in Firefox */
  }
}
