/* ===========================
   VISUAL HIERARCHY OPTIMIZATION
   60% Imagery, 40% Text Balance
   Costa Rica Adventure Tourism Focus
   =========================== */

/* ===========================
   CONTENT RATIO MANAGEMENT
   =========================== */

/* Section content distribution */
.content-60-40 {
  display: grid;
  grid-template-columns: 3fr 2fr; /* 60% visual, 40% text */
  gap: var(--space-2xl);
  align-items: center;
  min-height: 60vh;
}

.content-60-40.reverse {
  grid-template-columns: 2fr 3fr; /* 40% text, 60% visual */
}

/* Mobile-first: stack vertically */
@media (max-width: 767px) {
  .content-60-40,
  .content-60-40.reverse {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    min-height: auto;
  }
}

/* Visual content area */
.visual-content {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.visual-primary {
  flex: 1;
  min-height: 400px;
  border-radius: var(--radius-organic-1);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-xl);
}

.visual-secondary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-sm);
}

.visual-secondary .mini-visual {
  aspect-ratio: 4/3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

.visual-secondary .mini-visual:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

/* Text content area */
.text-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-lg);
  padding: var(--space-lg);
}

/* ===========================
   ENHANCED TYPOGRAPHY HIERARCHY
   =========================== */

/* Primary headings - Adventure focus */
.heading-primary {
  font-family: var(--heading-font);
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--earth-brown);
  margin-bottom: var(--space-lg);
  position: relative;
  display: inline-block;
}

.heading-primary::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 60px;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--primary-green) 0%,
    var(--secondary-green) 100%
  );
  border-radius: 2px;
}

/* Secondary headings - Section focus */
.heading-secondary {
  font-family: var(--heading-font);
  font-size: clamp(1.75rem, 6vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--earth-brown);
  margin-bottom: var(--space-md);
  position: relative;
}

.heading-secondary::before {
  content: '🌿';
  position: absolute;
  left: -40px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8em;
  opacity: 0.6;
}

/* Tertiary headings - Component focus */
.heading-tertiary {
  font-family: var(--heading-font);
  font-size: clamp(1.25rem, 4vw, 2rem);
  font-weight: 600;
  line-height: 1.3;
  color: var(--primary-green);
  margin-bottom: var(--space-sm);
}

/* Body text optimization */
.text-primary {
  font-family: var(--body-font);
  font-size: clamp(1.125rem, 3vw, 1.25rem);
  line-height: 1.7;
  color: var(--volcano-gray);
  margin-bottom: var(--space-md);
}

.text-secondary {
  font-family: var(--body-font);
  font-size: clamp(1rem, 2.5vw, 1.125rem);
  line-height: 1.6;
  color: rgba(66, 66, 66, 0.8);
  margin-bottom: var(--space-sm);
}

/* Accent text - Pura Vida style */
.text-accent {
  font-family: var(--accent-font);
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  font-weight: 600;
  color: var(--sunset-orange);
  font-style: italic;
  margin-bottom: var(--space-md);
  position: relative;
}

.text-accent::before,
.text-accent::after {
  content: '"';
  color: var(--primary-green);
  font-size: 1.5em;
  font-style: normal;
  opacity: 0.6;
}

/* ===========================
   CONTENT PRIORITY SYSTEM
   =========================== */

/* High priority content */
.priority-high {
  order: -1;
  padding: var(--space-lg);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(245, 230, 211, 0.8) 100%
  );
  border-radius: var(--radius-xl);
  border: 2px solid rgba(0, 168, 89, 0.1);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 2;
}

.priority-high::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(
    135deg,
    var(--primary-green) 0%,
    var(--secondary-green) 50%,
    var(--accent-blue) 100%
  );
  border-radius: var(--radius-xl);
  z-index: -1;
  opacity: 0.3;
}

/* Medium priority content */
.priority-medium {
  padding: var(--space-md);
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0, 168, 89, 0.05);
  backdrop-filter: blur(5px);
}

/* Low priority content */
.priority-low {
  padding: var(--space-sm);
  color: rgba(66, 66, 66, 0.7);
  font-size: 0.9em;
}

/* ===========================
   ADVENTURE-SPECIFIC LAYOUTS
   =========================== */

/* Hero section optimization */
.hero-content-optimized {
  display: grid;
  grid-template-areas:
    "title title"
    "description stats"
    "cta cta";
  gap: var(--space-lg);
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
}

.hero-title-area {
  grid-area: title;
}

.hero-description-area {
  grid-area: description;
  text-align: left;
}

.hero-stats-area {
  grid-area: stats;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.hero-cta-area {
  grid-area: cta;
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 767px) {
  .hero-content-optimized {
    grid-template-areas:
      "title"
      "description"
      "stats"
      "cta";
  }
  
  .hero-description-area {
    text-align: center;
  }
}

/* Adventure cards layout optimization */
.adventures-optimized {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--space-2xl);
  margin-top: var(--space-3xl);
}

.adventure-card-optimized {
  display: grid;
  grid-template-rows: 250px 1fr auto;
  gap: 0;
  background: var(--cloud-white);
  border-radius: var(--radius-organic-1);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-base);
  position: relative;
}

.adventure-card-optimized:hover {
  transform: translateY(-8px) rotate(1deg);
  box-shadow: var(--shadow-xl), 0 20px 40px rgba(0, 168, 89, 0.15);
}

.adventure-image-area {
  position: relative;
  overflow: hidden;
}

.adventure-image-area img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-base);
}

.adventure-card-optimized:hover .adventure-image-area img {
  transform: scale(1.1);
}

.adventure-content-area {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  flex: 1;
}

.adventure-cta-area {
  padding: 0 var(--space-lg) var(--space-lg);
}

/* ===========================
   VISUAL WEIGHT BALANCE
   =========================== */

/* Image prominence system */
.image-hero {
  position: relative;
  z-index: 2;
  box-shadow: var(--shadow-xl);
  border-radius: var(--radius-organic-1);
  overflow: hidden;
}

.image-supporting {
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-lg);
  opacity: 0.9;
}

.image-accent {
  position: relative;
  z-index: 0;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
  opacity: 0.7;
}

/* Text weight balancing */
.text-hero {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--earth-brown);
}

.text-supporting {
  font-size: clamp(1.125rem, 3vw, 1.375rem);
  font-weight: 400;
  line-height: 1.6;
  color: var(--volcano-gray);
}

.text-accent {
  font-size: clamp(0.875rem, 2vw, 1rem);
  font-weight: 500;
  line-height: 1.5;
  color: rgba(66, 66, 66, 0.7);
}

/* ===========================
   INTERACTIVE HIERARCHY
   =========================== */

/* Focus states for better accessibility */
.interactive-element {
  position: relative;
  transition: all var(--transition-base);
}

.interactive-element:focus,
.interactive-element:hover {
  z-index: 10;
  transform: scale(1.02);
}

.interactive-element:focus::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border: 2px solid var(--accent-blue);
  border-radius: inherit;
  pointer-events: none;
}

/* Call-to-action hierarchy */
.cta-primary {
  background: var(--sunset-orange);
  color: var(--cloud-white);
  padding: var(--space-md) var(--space-xl);
  font-size: 1.125rem;
  font-weight: 600;
  border-radius: 50px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 3;
}

.cta-secondary {
  background: transparent;
  color: var(--earth-brown);
  border: 2px solid var(--earth-brown);
  padding: var(--space-sm) var(--space-lg);
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--radius-lg);
  position: relative;
  z-index: 2;
}

.cta-tertiary {
  background: transparent;
  color: var(--primary-green);
  text-decoration: underline;
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.9rem;
  font-weight: 400;
  position: relative;
  z-index: 1;
}

/* ===========================
   RESPONSIVE HIERARCHY
   =========================== */

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
  .content-60-40 {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }
  
  .adventures-optimized {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
  }
}

/* Desktop optimizations */
@media (min-width: 1024px) {
  .content-60-40 {
    gap: var(--space-3xl);
  }
  
  .hero-content-optimized {
    grid-template-areas:
      "title title title"
      "description stats cta";
    gap: var(--space-2xl);
  }
  
  .hero-description-area {
    text-align: left;
  }
  
  .hero-cta-area {
    justify-content: flex-end;
    align-items: center;
  }
  
  .adventures-optimized {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2xl);
  }
}

/* Large desktop enhancements */
@media (min-width: 1440px) {
  .content-60-40 {
    gap: var(--space-4xl);
  }
  
  .adventures-optimized {
    gap: var(--space-3xl);
  }
}

/* ===========================
   ACCESSIBILITY ENHANCEMENTS
   =========================== */

/* High contrast mode */
@media (prefers-contrast: high) {
  .heading-primary,
  .heading-secondary,
  .heading-tertiary {
    color: #000000;
    font-weight: 800;
  }
  
  .text-primary,
  .text-secondary {
    color: #000000;
  }
  
  .priority-high {
    border-width: 3px;
    border-color: #000000;
  }
  
  .cta-primary,
  .cta-secondary,
  .cta-tertiary {
    border-width: 3px;
    font-weight: 700;
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .adventure-card-optimized:hover,
  .interactive-element:hover,
  .interactive-element:focus {
    transform: none;
  }
  
  .adventure-image-area img {
    transition: none;
  }
  
  .adventure-card-optimized:hover .adventure-image-area img {
    transform: none;
  }
}

/* Focus visible for keyboard navigation */
@media (prefers-reduced-motion: no-preference) {
  .interactive-element:focus-visible {
    animation: focusPulse 0.5s ease-in-out;
  }
}

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