/* ========================================
   LagunForge Website - Responsive Redesign
   2-page HTML5 standalone website
   ======================================== */

/* ========================================
   CSS Variables & Reset
   ======================================== */

:root {
  /* Layout heights for header and footer */
  --header-height: 80px;
  --footer-height: 100px;
  
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  
  /* Transitions */
  --transition-normal: 0.3s ease;
}

/* Reset & Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  
  /* Background image setup */
  background-image: url('img/background.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  
  /* Layout structure */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* Focus Styles for Accessibility */
a:focus-visible,
button:focus-visible {
  outline: 3px solid #4da6ff;
  outline-offset: 2px;
}

/* ========================================
   Header
   ======================================== */

.header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-sm);
  flex-shrink: 0;
}

.header .logo {
  max-height: 36px; /* Reduced by 40%: 60px * 0.6 = 36px */
  width: auto;
  object-fit: contain;
}

/* Header with Home button for BlueLung page */
.header-with-home {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-button {
  position: absolute;
  left: var(--spacing-md);
  top: 50%;
  transform: translateY(-50%);
  padding: 10px 24px;
  background-color: rgba(255, 255, 255, 0.9);
  color: #0d4a73;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  transition: all var(--transition-normal);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.home-button:hover {
  background-color: #ffffff;
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ========================================
   Main Content Area
   ======================================== */

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
  min-height: calc(100vh - var(--header-height) - var(--footer-height));
}

/* ========================================
   Button Grid
   ======================================== */

.button-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-lg);
  max-width: 720px; /* Increased by 20%: 600px * 1.20 = 720px */
  width: 100%;
  margin: 0 auto;
}

/* Image Buttons */
.image-button {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 12px;
  transition: all var(--transition-normal);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.image-button img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform var(--transition-normal);
}

/* Hover effect for active buttons */
.image-button:not(.inactive):hover {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 30px rgba(77, 166, 255, 0.4);
}

.image-button:not(.inactive):hover img {
  transform: scale(1.02);
}

.image-button:not(.inactive):focus {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 30px rgba(77, 166, 255, 0.6);
}

/* Inactive buttons styling */
.image-button.inactive {
  opacity: 1.0; /* Changed from 0.55 to 1.0 (100%) */
  cursor: not-allowed;
  filter: grayscale(20%);
}

.image-button.inactive img {
  pointer-events: none;
}

/* ========================================
   BlueLung Page Specific
   ======================================== */

/* BlueLung title image */
.bluelung-title {
  text-align: center;
  margin-bottom: var(--spacing-lg);
  max-width: 800px;
  width: 100%;
}

.bluelung-title img {
  width: 100%;
  max-width: 600px;
  height: auto;
  margin: 0 auto;
}

/* BlueLung background */
body.bluelung-page {
  background-image: url('img/bluelung/background.webp');
}

/* BlueLung buttons adjustment */
.bluelung-buttons {
  max-width: 911px; /* Increased by 35%: 675px * 1.35 = 911.25px */
}

/* ========================================
   Footer
   ======================================== */

.footer {
  height: var(--footer-height);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0; /* Remove padding to allow image to touch sides */
}

.footer img {
  height: auto; /* Use natural height of image (174px) */
  width: 100%; /* Make footer image full width to touch sides */
  object-fit: contain; /* Preserve aspect ratio */
}

/* ========================================
   Responsive Design
   ======================================== */

/* Tablet: 601-1024px */
@media (max-width: 1024px) and (min-width: 601px) {
  :root {
    --spacing-lg: 1.5rem;
    --header-height: 70px;
    --footer-height: 90px;
  }
  
  .button-grid {
    gap: var(--spacing-md);
    max-width: 540px; /* Increased by 20%: 450px * 1.20 = 540px */
  }
  
  .header .logo {
    max-height: 30px; /* Reduced by 40%: 50px * 0.6 = 30px */
  }
  
  .footer img {
    max-height: 120px; /* Scale down for tablet while maintaining aspect ratio */
  }
  
  .bluelung-title img {
    max-width: 500px;
  }
  
  .bluelung-buttons {
    max-width: 683px; /* Increased by 35%: 506px * 1.35 = 683.1px */
  }
}

/* Mobile: ≤600px */
@media (max-width: 600px) {
  :root {
    --spacing-lg: 1rem;
    --spacing-md: 0.75rem;
    --header-height: 60px;
    --footer-height: 70px;
  }
  
  body {
    background-attachment: scroll;
  }
  
  .main-content {
    padding: var(--spacing-md);
  }
  
  /* Stack buttons vertically on mobile */
  .button-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    max-width: 300px; /* Increased by 20%: 250px * 1.20 = 300px */
  }
  
  .header .logo {
    max-height: 24px; /* Reduced by 40%: 40px * 0.6 = 24px */
  }
  
  .footer img {
    max-height: 80px; /* Scale down for mobile while maintaining aspect ratio */
  }
  
  .home-button {
    padding: 8px 16px;
    font-size: 0.875rem;
    left: var(--spacing-sm);
  }
  
  .bluelung-title {
    margin-bottom: var(--spacing-md);
  }
  
  .bluelung-title img {
    max-width: 100%;
  }
  
  /* Ensure tap targets are at least 44px */
  .image-button {
    min-height: 44px;
  }
  
  .image-button:not(.inactive):active {
    transform: scale(0.98);
  }
  
  .bluelung-buttons {
    max-width: 456px; /* Increased by 35%: 338px * 1.35 = 456.3px */
  }
}

/* Very small mobile: ≤400px */
@media (max-width: 400px) {
  :root {
    --spacing-md: 0.5rem;
    --header-height: 50px;
    --footer-height: 60px;
  }
  
  .header .logo {
    max-height: 21px; /* Reduced by 40%: 35px * 0.6 = 21px */
  }
  
  .footer img {
    max-height: 60px; /* Scale down for very small screens while maintaining aspect ratio */
  }
  
  .home-button {
    padding: 6px 12px;
    font-size: 0.8125rem;
  }
}

/* Landscape orientation adjustments */
@media (max-width: 900px) and (orientation: landscape) {
  .button-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
  }
  
  .main-content {
    padding: var(--spacing-sm);
  }
}

/* ========================================
   Accessibility & Print
   ======================================== */

/* High contrast mode support */
@media (prefers-contrast: high) {
  .image-button:not(.inactive):focus {
    outline: 4px solid #ffffff;
    outline-offset: 4px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}

/* Print styles */
@media print {
  body {
    background: white;
  }
  
  .image-button:hover {
    transform: none;
    box-shadow: none;
  }
}
