/*
File: content.css
Purpose: Video banners, quote blocks, inspiring sections, and typography-heavy content
Dependencies: style.css (custom properties), animations.css (fade effects)
Load Order: 6th (after cards.css)
*/

/* ===== PARALLAX CONTAINER ===== */
#background-layers {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  pointer-events: none;
  z-index: var(--z-background, -1);
  
  /* Performance: isolate this layer from the rest of the document */
  contain: strict;
  
  /* Ensure it doesn't cause horizontal scroll */
  max-width: 100%;
}

/* ===== PARALLAX LAYERS ===== */
.parallax-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 200vh; /* Extra height to prevent gaps during parallax */
  pointer-events: none;
  
  /* GPU acceleration - applied via CSS for consistency */
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  
  /* Performance: contain layout/paint within layer */
  contain: layout style;
}

/* Layer z-index stacking */
#layer-back {
  z-index: 1;
}

#layer-middle {
  z-index: 2;
  /* Subtle shadow for depth */
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.12));
}

#layer-front {
  z-index: 3;
  /* More pronounced shadow for foreground */
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.15));
}

/* ===== PARALLAX SHAPES ===== */
.parallax-shape {
  position: absolute;
  pointer-events: none;
  
  /* Shapes don't need will-change since they move with their parent layer */
  /* This reduces GPU memory usage */
}

.parallax-shape svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* ===== PERFORMANCE: REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  #background-layers {
    /* Keep visible but disable parallax movement */
    position: fixed;
  }
  
  .parallax-layer {
    /* Remove will-change when not animating */
    will-change: auto;
    transform: none !important;
    
    /* Reset to static height */
    height: 100vh;
  }
}

/* ===== PERFORMANCE: MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
  .parallax-layer {
    /* Slightly reduce extra height on mobile to save memory */
    height: 150vh;
  }
  
  #layer-middle,
  #layer-front {
    /* Simpler shadows on mobile */
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
  }
}

/* ===== PERFORMANCE: LOW-POWER MODE ===== */
@media (prefers-reduced-motion: reduce), (update: slow) {
  .parallax-layer {
    will-change: auto;
    transform: none !important;
  }
  
  #layer-middle,
  #layer-front {
    filter: none;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  #background-layers {
    display: none;
  }
}

/* ===== VIDEO BANNER SECTION ===== */
.video-banner {
  margin: 0 0 var(--section-spacing) 0;
  overflow: hidden;
  position: relative;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
}

/* Semi-transparent overlay for video section */
.video-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(4px);
  z-index: 0;
  pointer-events: none;
}

.video-banner video {
  display: block;
  height: auto;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* ===== VIDEO SUBTITLE OVERLAY ===== */
.video-subtitle {
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.4);
  left: 0;
  opacity: 0;
  padding: 1rem;
  position: absolute;
  right: 0;
  text-align: center;
  transform: translateY(100%);
  transition: all 0.8s cubic-bezier(0.65, 0, 0.35, 1);
  z-index: 5;
}

.video-subtitle.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.video-subtitle.fade-out {
  opacity: 0;
  transition: opacity 0.75s ease-out;
}

.video-subtitle h2 {
  color: var(--forest-green);
  font-family: var(--font-heading);
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 0;
  max-width: 100%;
  word-wrap: break-word;
  hyphens: auto;
  font-size: clamp(1.1rem, 2.5vw, 2.2rem);
  padding: 0 2rem;
}

/* ===== INSPIRING QUOTE SECTION ===== */
.inspiring-section-wrapper {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-top: 0;
  margin-bottom: var(--section-spacing);
  position: relative;
}

.inspiring-background-banner {
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.8);
  bottom: calc(var(--base-spacing) * -0.5);
  left: 0;
  position: absolute;
  right: 0;
  top: calc(var(--base-spacing) * -0.5);
  z-index: 0;
  pointer-events: none;
}

.inspiring-quote-box {
  align-items: center;
  border-radius: var(--radius-lg);
  display: flex;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.15));
  justify-content: center;
  margin: 0 auto;
  max-width: 90%;
  min-height: 400px;
  overflow: hidden;
  position: relative;
  z-index: var(--z-base);
  aspect-ratio: 16 / 8;
}

/* ===== INSPIRING IMAGE BACKGROUND ===== */
.inspiring-image-bg {
  background-image: url('IMGinspo01.png');
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  bottom: 0;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 1;
  transition: transform 5s cubic-bezier(0.25, 0.8, 0.25, 1);
  will-change: transform;
  transform-origin: center center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  perspective: 1000px;
  -webkit-perspective: 1000px;
}

/* Inspiring vignette overlay */
.inspiring-vignette {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at center, transparent 20%, rgba(0,0,0,0.3) 70%);
  opacity: 0.8;
  transition: opacity 5s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 2;
  pointer-events: none;
  will-change: opacity;
}

.inspiring-text-overlay {
  backdrop-filter: blur(2px);
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-lg);
  position: absolute;
  right: 3%;
  top: 45%;
  transform: translateY(-50%);
  width: 44%; 
  height: 70%; 
  padding: 2rem 1.5rem;
  text-align: center;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}

.inspiring-text-overlay h2 {
  color: var(--text-color);
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 3vw, 3.2rem);
  font-weight: var(--font-weight-medium);
  line-height: 1.5;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  word-wrap: break-word;
  hyphens: auto;
  width: 100%;
}

/* ===== QUOTE BLOCKS ===== */
.quote-card {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: var(--base-spacing) auto var(--base-spacing) auto;
  position: relative;
  max-width: none;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  background-color: transparent;
  backdrop-filter: none;
  border-radius: 0;
  overflow: visible;
}

.quote-card p {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-style: italic;
  font-weight: var(--font-weight-normal);
  margin: 0;
}

.quote-card .author {
  font-style: italic;
  font-size: 30px;
  line-height: 36px;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: var(--font-weight-light);
  margin-top: 1rem;
  opacity: 0.8;
}

.quote-card::before,
.quote-card::after {
  display: none;
}

/* Enhanced quote block styling */
.quote-card,
blockquote.style2 {
  margin: auto;
  width: 98%;
  max-width: 98%;
  box-sizing: border-box;
  font-size: clamp(1rem, 3.5vw, 1.4rem);
  line-height: 1.3;
  padding: clamp(1rem, 4vw, 2.5rem) clamp(1rem, 8vw, 4rem);
}

/* ===== STYLED QUOTE BLOCKS ===== */
blockquote.style2 {
  align-items: center;
  background-color: var(--forest-green);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  font-style: italic;
  font-size: clamp(1rem, 2vw, 2.2rem);
  line-height: 1.4;
  font-family: var(--font-heading);
  font-weight: var(--font-weight-medium);
  justify-content: center;
  min-height: 100px;
  overflow: visible;
  position: relative;
  margin: 0 auto;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  transform: none;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1.5rem, 6vw, 4rem);
  box-sizing: border-box;
}

.blockquote-content {
  text-align: center;
  z-index: 10;
  font-size: clamp(1.1rem, 2.2vw, 2.4rem);
  line-height: 1.4;
  position: relative;
}

/* Quote marks */
blockquote.style2:before {
  color: var(--text-color);
  content: '"';
  font-style: italic;
  font-size: 34px;
  line-height: 36px;
  font-family: var(--font-heading);
  font-size: 108px;
  font-weight: var(--font-weight-light);
  left: 0px;
  opacity: 0.3;
  position: absolute;
  top: 30px;
  z-index: 1;
}

blockquote.style2:after {
  bottom: -20px;
  color: var(--text-color);
  content: '"';
  font-style: italic;
  font-size: 34px;
  line-height: 36px;
  font-family: var(--font-heading);
  font-size: 108px;
  font-weight: var(--font-weight-light);
  opacity: 0.3;
  position: absolute;
  right: 20px;
  z-index: 1;
}

blockquote.style2:before,
blockquote.style2:after {
  font-size: clamp(3rem, 12vw, 6rem);
  animation: none;
  opacity: 0.3;
  transform: none;
}

blockquote.style2 .author {
  color: var(--text-color);
  font-style: italic;
  font-size: clamp(0.9rem, 1.9vw, 2rem);
  margin-top: 0.5rem;
  font-family: var(--font-heading);
  opacity: 0.8;
  z-index: 10;
  position: relative;
  text-align: center;
}

/* Quote block decorative lines */
blockquote.style2 .line-top,
blockquote.style2 .line-bottom {
  background: var(--text-color);
  height: 4px;
  opacity: 0.3;
  position: absolute;
  width: calc(100% - 60px);
  z-index: 5; 
}

blockquote.style2 .line-top {
  left: clamp(30px, 8vw, 60px);
  top: 8px;
  width: calc(100% - 80px);
}

blockquote.style2 .line-bottom {
  bottom: 8px;
  right: clamp(30px, 8vw, 60px);
  width: calc(100% - 80px);
}

/* ===== CONTENT UTILITY CLASSES ===== */
/* Typography utilities */
.content-large {
  font-size: clamp(1.1rem, 2.5vw, 1.8rem);
  line-height: 1.6;
}

.content-medium {
  font-size: clamp(1rem, 2vw, 1.4rem);
  line-height: 1.5;
}

.content-small {
  font-size: clamp(0.9rem, 1.8vw, 1.2rem);
  line-height: 1.4;
}

/* Content spacing utilities */
.content-spacing-tight {
  margin-bottom: var(--base-spacing);
}

.content-spacing-normal {
  margin-bottom: var(--section-spacing);
}

.content-spacing-loose {
  margin-bottom: calc(var(--section-spacing) * 1.5);
}

/* Background overlay utilities */
.overlay-light {
  background: rgba(255, 255, 255, 0.9);
}

.overlay-dark {
  background: rgba(0, 0, 0, 0.6);
}

.overlay-accent {
  background: rgba(79, 154, 168, 0.8);
}

/* ===== RESPONSIVE DESIGN ===== */
/* Large desktop (1200px+) */
@media (min-width: 1200px) {
  .inspiring-quote-box {
    min-height: 450px;
  }
  
  .inspiring-text-overlay {
    padding: 2.5rem 2rem;
  }
}

/* Tablet/transition range (769px - 900px) */
@media (min-width: 769px) and (max-width: 900px) {
  .video-subtitle {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.4rem 1.5rem;
  }
  
  blockquote.style2 {
    width: calc(100% - (var(--side-margin) * 2));
    max-width: calc(100% - (var(--side-margin) * 2));
    margin: 0 auto;
  }

  .video-subtitle h2 {
    line-height: 1.3;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

/* Desktop subtitle (901px+) */
@media (min-width: 901px) {
  .video-subtitle {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 1.5rem;
  }
  
  .video-subtitle h2 {
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Desktop quote alignment */
@media (min-width: 769px) {
  .quote-card {
    width: calc(100% - (var(--side-margin) * 2));
    max-width: calc(100% - (var(--side-margin) * 2));
    margin: var(--base-spacing) auto;
    padding: 0;
  }
  
  blockquote.style2 {
    width: calc(100% - 2rem);
    max-width: calc(100% - 2rem);
    margin: 0 auto;
  }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
  .video-banner {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: 0;
    position: relative;
    left: 0;
    right: 0;
  }

  .video-banner::before {
    width: 100vw;
    left: 0;
    right: 0;
    margin: 0;
  }
  
  .video-banner video {
    width: 100vw;
    max-width: 100vw;
    margin: 0;
    padding: 0;
  }
  
  .video-subtitle {
    position: relative;
    bottom: auto;
    top: auto;
    left: auto;
    right: auto;
    margin: 1rem auto 0.5rem auto;
    max-width: 95%;
    padding: 1.5rem 1rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.9);
  }
  
  .video-subtitle h2 {
    line-height: 1.4;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  .quote-card {
    width: 100%;
    max-width: 100%;
    margin: var(--base-spacing) 0;
    padding: 0 1rem;
    overflow: hidden;
  }
  
  blockquote.style2 {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
  }
  
  .inspiring-quote-box {
    max-width: 95%;
    min-height: 250px;
  }
  
  .inspiring-text-overlay {
    margin: 1rem;
    padding: 2rem 1.5rem;
  }
  
  .inspiring-text-overlay h2 {
    font-size: clamp(1rem, 2vw, 2rem);
  }
}

/* Small mobile (max-width: 480px) */
@media (max-width: 480px) {
  .video-subtitle { 
    padding: 1.2rem 0.8rem; 
  }
  
  .inspiring-text-overlay { 
    padding: 1.5rem; 
  }
  
  blockquote.style2 {
    padding: 20px 25px;
  }
  
  blockquote.style2 .line-top,
  blockquote.style2 .line-bottom {
    width: calc(100% - 50px);
  }
  
  blockquote.style2 .line-top {
    left: 25px;
  }
  
  blockquote.style2 .line-bottom {
    right: 25px;
  }

  blockquote.style2:before {
    top: 10px;
    left: 10px;
  }

  blockquote.style2:after {
    bottom: -14px;
  }
}

/* Tablet quote styling improvements */
@media (min-width: 481px) and (max-width: 768px) {
  blockquote.style2 {
    padding: 2rem 2.5rem;
    margin: 2rem auto;
  }
  
  blockquote.style2 .blockquote-content {
    padding: 2rem 2.5rem;
    margin: 2rem auto;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  }
  
  blockquote.style2 .author {
    font-size: clamp(1rem, 2vw, 1.4rem);
  }
  
  blockquote.style2:before {
    left: -3px;
    top: 18px;
    font-size: 5rem;
  }
  
  blockquote.style2:after {
    right: 10px;
    bottom: -16px;
    font-size: 5rem;
  }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
/* Mobile optimizations */
@media (max-width: 768px) {
  .inspiring-image-bg {
    transition: transform 4s ease-out;
  }
  
  .inspiring-vignette {
    transition: opacity 4s ease-out;
  }
}

/* Small mobile optimizations */
@media (max-width: 480px) {
  .inspiring-image-bg {
    transition: transform 2s ease-out;
  }
  
  .inspiring-vignette {
    transition: opacity 2s ease-out;
    background: radial-gradient(circle at center, transparent 40%, rgba(0,0,0,0.3) 80%);
  }
}

/* Very small screens */
@media (max-width: 320px) {
  .inspiring-image-bg {
    transition: opacity 0.5s ease;
    transform: scale(1);
  }
  
  .inspiring-vignette {
    opacity: 0.1;
    transition: opacity 1s ease;
  }
}

/* ===== ACCESSIBILITY FEATURES ===== */
/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .inspiring-image-bg,
  .inspiring-vignette {
    transition: none;
    transform: none;
    animation: none;
  }
  
  .inspiring-vignette {
    opacity: 0.2;
  }
  
  .video-subtitle {
    transition: opacity var(--transition-fast);
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  blockquote.style2 {
    border: 2px solid var(--text-color);
  }
  
  .inspiring-background-banner {
    background: rgba(255, 255, 255, 0.95);
  }
  
  .inspiring-vignette {
    opacity: 0.1;
  }
}

/* Focus states */
blockquote.style2:focus-visible {
  outline: 3px solid var(--highlight-color);
  outline-offset: 4px;
}

/* ===== PRINT STYLES ===== */
@media print {
  .video-banner {
    display: none;
  }
  
  .inspiring-image-bg,
  .inspiring-vignette {
    display: none;
  }
  
  .inspiring-quote-box {
    background: #f9f9f9;
    border: 1px solid #ccc;
  }
  
  blockquote.style2 {
    background: #f0f0f0;
    color: #000;
    box-shadow: none;
    border: 1px solid #333;
  }
  
  blockquote.style2:before,
  blockquote.style2:after {
    color: #666;
  }
}