/* =========================================================
   HOME ZONES
   "Choose Your Zone" section for home.html

   Includes:
   - Section wrapper
   - Section heading
   - Zone grid
   - Zone cards
   - Card media and content
   - Zone reveal state
   - Responsive rules
   ========================================================= */


/* =========================================================
   1. SECTION WRAPPER
   Outer section spacing and clipping
   ========================================================= */

.home-zones {
  position: relative;
  padding: 2rem 0;
  overflow: hidden;
}

.home-zones .container {
  width: min(100% - 2rem, 1320px);
  margin: 0 auto;
}


/* =========================================================
   2. SECTION HEADER
   Title and supporting copy above the cards
   ========================================================= */

.home-zones .section-header {
  max-width: 760px;
  margin: 0 0 1rem;
  padding-bottom: 1rem;
  text-align: left;
}

.home-zones .section-title {
  margin: 0;
  font-family: "Luckiest Guy", cursive;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1;
  letter-spacing: 0.02em;
  color: #ff2d2d;
  -webkit-text-stroke: 2px #ffd93d;
  text-shadow:
    0 3px 0 #1f49ff,
    0 6px 0 rgba(0, 0, 0, 0.22),
    0 10px 24px rgba(0, 0, 0, 0.45);
}

.home-zones .section-title span {
  color: #ffd93d;
  -webkit-text-stroke: 2px #ff2d2d;
  text-shadow:
    0 3px 0 #1f49ff,
    0 6px 0 rgba(0, 0, 0, 0.22),
    0 10px 24px rgba(0, 0, 0, 0.45);
}

.home-zones .section-desc {
  margin: 0.85rem 0 0;
  max-width: 42rem;
  font-family: "Outfit", sans-serif;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
}


/* =========================================================
   3. ZONE GRID
   Pac-Man board surface only. Card styling remains unchanged.
   ========================================================= */

.zones-grid {
  --zone-dot-size: 20px;
  position: relative;
  min-height: 0;
  margin: 0 auto;
  padding: 0;
  overflow: visible;
  border-radius: 0;
  background-color: #000;
  background-image: radial-gradient(#ffd93d 2px, transparent 3px);
  background-size: var(--zone-dot-size) var(--zone-dot-size);
  background-position: 0 0;
  max-width: 100%;
  box-sizing: border-box;
  padding-bottom:.5rem;
}


/* =========================================================
   4. ZONE CARD
   Base interactive card shell
   Includes hidden state for reveal animation
   ========================================================= */

.zone-card {
  position: relative;
  display: block;
  min-height: 320px;
  border: none;
  border-radius: .9rem;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(180deg, rgba(8, 12, 30, 0.96) 0%, rgba(3, 6, 18, 0.98) 100%);
  box-shadow:
    0 0 0 1px rgba(255, 59, 48, 0.1),
    0 0 18px rgba(31, 73, 255, 0.18),
    0 12px 26px rgba(0, 0, 0, 0.24);
  opacity: 0;
  transform: translateY(28px);
  transform: translateY(28px) translateZ(0); /* Adds hardware acceleration */
  backface-visibility: hidden;
  will-change: transform, opacity;
  transition:
    opacity 0.55s ease,
    transform 0.55s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

/* Visible state added by JS / observer */
.zone-card.is-visible {
  opacity: 1;
  transform: translateY(0)translateZ(0);
}

/* Gradient border ring */
.zone-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  padding: 2px;
  border-radius: inherit;
  background: linear-gradient(180deg, #ff0000 0%, #0015ff 100%);
  -webkit-mask:
    linear-gradient(#ffffff 0 0) content-box,
    linear-gradient(#ffffff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Dark overlay for media readability */
.zone-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.08) 0%,
    rgba(0, 0, 0, 0.14) 35%,
    rgba(0, 0, 0, 0.62) 100%
  );
  pointer-events: none;
}



/* =========================================================
   5. CARD MEDIA
   Full-card media layer behind content
   ========================================================= */

.zone-card-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%),
    linear-gradient(180deg, #1a214f 0%, #0b102a 100%);
}

.zone-card-media img {
  width: 100%;
  height: 100%;
  background: #d9d9d9;
  object-fit: cover;
  object-position: center;
  transform: scale(1);
  transition: transform 0.45s ease;
}


/* =========================================================
   6. CARD CONTENT
   Text content pinned at bottom center of card
   ========================================================= */

.zone-card-body {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  min-height: 34%;
  padding: 1.15rem 0.95rem 1rem;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.zone-card-title {
  margin: 0;
  color: #ffffff;
  font-family: "Press Start 2P", cursive;
  font-size: 0.84rem;
  line-height: 1.45;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  word-break: break-word;
}

.zone-card-subtitle {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-family: "Outfit", sans-serif;
  font-size: 0.83rem;
  font-weight: 500;
  line-height: 1.4;
}

/* =========================================================
   7. TABLET (Breakpoints: 768px - 1199px)
   Focus: Adjust container and section headers
   ========================================================= */

@media (max-width: 1000.98px) {
  .home-zones {
    padding: 1rem 0; /* Reduced from 4.5rem for better flow */
  }

  .home-zones .container {
    width: min(100% - 3rem, 1000px); /* Slightly tighter for tablet */
  }


  .home-zones .section-header {
    margin-bottom: 2rem;
    text-align: left; /* Center-aligned works best for 1-column layouts */
    padding: 0 1rem;
  }

  .home-zones .section-title {
    font-size: clamp(3rem, 8vw, 2.5rem);
    margin-bottom: 0.75rem; /* Gap between title and desc */
  }

  .home-zones .section-desc {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--text-faint); /* Using your global variable for consistency */
  }

  /* Adjust card height for mobile visibility */
  .zone-card {
    min-height: 320px; 
    border-radius: var(--radius-md);
  }

  .zone-card-body {
    padding: 1.25rem;
  }

  .zone-card-title {
    font-size: 0.85rem; /* Slightly larger for mobile readability */
  }

  .zone-card-subtitle {
    font-size: 0.75rem;
    margin-top: 0.25rem;
  }

}

/* =========================================================
   8. MOBILE (Breakpoints: < 767.98px)
   Focus: Card spacing and typography balance
   ========================================================= */

@media (max-width: 767.98px) {
  .home-zones {
    padding: 3rem 0 0 0;
  }

  .home-zones .container {
    width: min(100% - 2rem, 600px); /* Tighter container for 1-column stack */
  }

  /* 1. Turn the grid into a native CSS stacked column */
  .zones-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem; /* Gap between cards */
    background-image: none; /* Hide the pacman dot background */
    background-color: transparent;
  }

  .home-zones .section-header {
    margin-bottom: 2rem;
    text-align: left; /* Center-aligned works best for 1-column layouts */
    padding: 0 1rem;
  }

  .home-zones .section-title {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    text-align: left; /* Gap between title and desc */
  }

  .home-zones .section-desc {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-faint); /* Using your global variable for consistency */
  }

  /* Adjust card height for mobile visibility */
  .zone-card {
    position: relative !important; /* Overrides any lingering JS absolute positioning */
    width: 100% !important;        /* Makes the card nice and wide */
    min-height: 280px; 
    border-radius: var(--radius-md);
    margin: 0; 
  }

  .zone-card-body {
    padding: 1.25rem;
  }

  .zone-card-title {
    font-size: 0.95rem; /* Slightly larger for mobile readability */
  }

  .zone-card-subtitle {
    font-size: 0.85rem;
    margin-top: 0.25rem;
  }
}

@media (min-width: 1001px) {
  .home-zones {
    padding: 3rem 0;
  }

  .home-zones .container {
    width: min(100% - 2rem, 1320px); /* Tighter container for 1-column stack */
  }

  .home-zones .section-header {
    margin-bottom: 2rem;
    text-align: left; /* Center-aligned works best for 1-column layouts */
    padding: 0 1rem;
  }
}