/* ==========================================================================
   15-layered-depth | layout.css
   Architecture-specific LAYOUT ONLY — no colors, fonts, or visual decoration.
   Z-axis layered design with parallax depth planes and overlapping sections.
   ========================================================================== */

/* ---------- Header Layout (highest z-index, floating) ---------- */
.depth-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.depth-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
}

.depth-header .nav-list {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.depth-header .mobile-toggle {
  display: none;
}

/* ---------- Depth Main ---------- */
.depth-main {
  padding-top: 80px; /* Account for fixed header */
  overflow-x: hidden;
}

/* ---------- Depth Section ---------- */
.depth-section {
  position: relative;
  min-height: 50vh;
  overflow: hidden;
  background-color: var(--color-bg);
}

.depth-section--hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  background-color: transparent;
}

.depth-section--page-hero {
  min-height: 50vh;
  display: flex;
  align-items: center;
  background-color: transparent;
}

.depth-section--cta {
  min-height: 40vh;
  display: flex;
  align-items: center;
  background-color: transparent;
}

/* Overlapping: sections pull up into the previous section */
.depth-section--overlap {
  margin-top: -4rem;
  position: relative;
}

/* Decorative image-only sections (aria-hidden) should be transparent */
.depth-section[aria-hidden="true"] {
  background-color: transparent;
  min-height: 30vh;
}

/* ---------- Depth Layers ---------- */
.depth-layer {
  position: relative;
}

.depth-layer--bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
  will-change: transform;
}

.depth-layer--bg img {
  width: 100%;
  height: 120%;
  object-fit: cover;
  display: block;
}

.depth-layer--mid {
  position: relative;
  z-index: 5;
  will-change: transform;
}

.depth-layer--fg {
  position: relative;
  z-index: 10;
}

/* ---------- Depth Planes (elevated content containers) ---------- */
.depth-plane {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
  position: relative;
  z-index: 10;
}

.depth-plane--elevated {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem;
}

.depth-plane--narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* ---------- Depth Content ---------- */
.depth-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
  position: relative;
  z-index: 10;
}

.depth-content--centered {
  text-align: center;
  max-width: 800px;
}

/* ---------- Depth Split (side by side) ---------- */
.depth-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.depth-split__media img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* ---------- Depth Grid ---------- */
.depth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.depth-grid--2col {
  grid-template-columns: repeat(2, 1fr);
}

/* ---------- Depth Card ---------- */
.depth-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.depth-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.depth-card__body {
  padding: 1.5rem;
  flex: 1;
}

/* ---------- Depth Actions ---------- */
.depth-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.depth-content--centered .depth-actions {
  justify-content: center;
}

/* ---------- Section Title ---------- */
.section-title {
  text-align: center;
  margin-bottom: 2rem;
}

/* ---------- Map ---------- */
.map-embed {
  width: 100%;
  min-height: 400px;
}

.map-embed iframe {
  width: 100%;
  height: 100%;
  min-height: 400px;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  position: relative;
  z-index: 20;
}

.breadcrumb ol {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ---------- Footer Layout ---------- */
.site-footer {
  position: relative;
  z-index: 50;
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
}

.social-links {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 1rem;
}

/* ---------- Skip Nav ---------- */
/* Defined in base.css — no override needed */

/* .sr-only — defined in base.css */

/* ---------- Responsive: Tablet ---------- */

/* ---------- Mobile Menu Toggle ---------- */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
}

.mobile-menu-toggle span,
.hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 1024px) {
  .depth-split {
    grid-template-columns: 1fr;
  }

  .depth-grid--2col {
    grid-template-columns: 1fr;
  }

  .depth-section--overlap {
    margin-top: -2rem;
  }

  .footer-inner {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- Responsive: Mobile ---------- */
@media (max-width: 640px) {
  .depth-header .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 999;
  }

  .depth-header .main-nav.is-open {
    display: block;
  }

  .depth-header .nav-list {
    flex-direction: column;
    gap: 0;
    padding: 1rem;
  }

  .depth-header .mobile-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 0.5rem;
  }

  .depth-main {
    padding-top: 60px;
  }

  .depth-section--hero {
    min-height: 70vh;
  }

  .depth-section--overlap {
    margin-top: -1rem;
  }

  .depth-plane,
  .depth-plane--elevated {
    padding: 2rem 1rem;
  }

  .depth-content {
    padding: 2rem 1rem;
  }

  .depth-grid {
    grid-template-columns: 1fr;
  }

  .depth-actions {
    flex-direction: column;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

/* ---------- Visual Fixes (depth architecture + theme integration) ---------- */

/* Fix 1: Header background — fixed header needs its own glassmorphism */
.depth-header {
  background: color-mix(in oklch, var(--color-bg, #ffffff) 75%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid color-mix(in oklch, white 40%, transparent);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
}

/* Fix 2: depth-card visual styling — matches theme card appearance */
.depth-card {
  background: color-mix(in oklch, white 80%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid color-mix(in oklch, white 60%, transparent);
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-md, 0 8px 40px rgba(0, 0, 0, 0.07));
  padding: clamp(1rem, 2vw, 2rem);
  transition: box-shadow 0.35s ease, transform 0.35s ease;
}

.depth-card:hover {
  box-shadow: var(--shadow-xl, 0 24px 80px rgba(0, 0, 0, 0.12));
}

/* depth-card with image: remove top padding, image takes full width */
.depth-card > img:first-child {
  margin: calc(-1 * clamp(1rem, 2vw, 2rem));
  margin-bottom: 1rem;
  width: calc(100% + 2 * clamp(1rem, 2vw, 2rem));
  max-width: none;
  border-radius: var(--radius-lg, 16px) var(--radius-lg, 16px) 0 0;
}

/* Fix 3: Elevated plane background for readability */
.depth-plane--elevated {
  background: color-mix(in oklch, var(--color-bg, #ffffff) 88%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-lg, 0 16px 60px rgba(0, 0, 0, 0.09));
}

/* Fix 4: Hero & CTA dark overlay for text readability over bg images */
.depth-section--hero .depth-layer--bg::after,
.depth-section--cta .depth-layer--bg::after,
.depth-section--page-hero .depth-layer--bg::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(15, 22, 48, 0.45), rgba(15, 22, 48, 0.62));
  z-index: 1;
}

.depth-section--hero .depth-content h1,
.depth-section--hero .depth-content p,
.depth-section--cta .depth-content h2,
.depth-section--cta .depth-content p,
.depth-section--page-hero .depth-content h1,
.depth-section--page-hero .depth-content p {
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.depth-section--hero .btn-secondary,
.depth-section--cta .btn-secondary,
.depth-section--page-hero .btn-secondary {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
}

.depth-section--hero .btn-secondary:hover,
.depth-section--cta .btn-secondary:hover,
.depth-section--page-hero .btn-secondary:hover {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
}

/* Dark mode overrides */
@media (prefers-color-scheme: dark) {
  .depth-header {
    background: color-mix(in oklch, var(--color-bg, #0F1630) 85%, transparent);
    border-bottom-color: color-mix(in oklch, var(--color-primary, #6C7CE0) 10%, transparent);
  }

  .depth-card {
    background: color-mix(in oklch, var(--color-bg-alt, #1a1f3d) 75%, transparent);
    border-color: color-mix(in oklch, var(--color-primary, #6C7CE0) 12%, transparent);
  }

  .depth-plane--elevated {
    background: color-mix(in oklch, var(--color-bg-alt, #1a1f3d) 80%, transparent);
  }
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .depth-layer--bg,
  .depth-layer--mid {
    will-change: auto;
  }
}
