/* ==========================================================================
   13-glassmorphism | layout.css
   Architecture-specific LAYOUT ONLY — no colors, fonts, or visual decoration.
   Glass-effect panels with backdrop-filter blur layering.
   ========================================================================== */

/* ---------- Glass Background ---------- */
.glass-body {
  position: relative;
  min-height: 100vh;
}

/* Page hero banner background — image only sits behind the page title,
   not behind the rest of the page. */
.glass-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 60vh;
  max-height: 520px;
  z-index: 0;
  overflow: hidden;
}

.glass-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.glass-bg::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.55) 70%, rgba(0,0,0,0.75) 100%);
  z-index: 1;
}

/* Page-hero (banner) section sits over the .glass-bg image */
.glass-section--page-hero {
  position: relative;
  min-height: 40vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: 4rem;
}

.glass-section--page-hero .glass-panel--hero {
  background: rgba(15, 20, 30, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  color: #fff;
}

.glass-section--page-hero .glass-panel--hero h1,
.glass-section--page-hero .glass-panel--hero p,
.glass-section--page-hero .glass-panel--hero a {
  color: #ffffff !important;
  text-shadow: 0 1px 4px rgba(0,0,0,0.45);
}

/* ---------- Glass Main (above background) ---------- */
.glass-main {
  position: relative;
  z-index: 1;
}

/* ---------- Glass Header ---------- */
.glass-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.5rem 2rem;
}

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

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

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

/* ---------- Glass Panel (core layout) ---------- */
.glass-panel {
  position: relative;
  z-index: 2;
  padding: 2rem;
  overflow: hidden;
}

.glass-panel--nav {
  padding: 0.75rem 1.5rem;
}

/* ---------- Glass Panel Variants ---------- */
.glass-panel--hero {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  padding: 4rem 3rem;
}

.glass-panel--centered {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem;
}

.glass-panel--cta {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  padding: 4rem 3rem;
}

.glass-panel--prose {
  max-width: 800px;
  margin: 0 auto;
}

.glass-panel--footer {
  max-width: 100%;
  padding: 0;
}

.glass-panel--wide {
  flex: 2;
}

.glass-panel--image {
  flex: 1;
  padding: 0;
  overflow: hidden;
}

.glass-panel--image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.glass-panel--full-image {
  max-width: 1200px;
  margin: 0 auto;
  flex: none;
}

/* ---------- Glass Panel Row (side by side) ---------- */
.glass-panel-row {
  display: flex;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* ---------- Glass Panel Grid ---------- */
.glass-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

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

/* Why Choose Us grid — featured hero card + 2-col grid with numbered accents */
.why-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  max-width: 1200px;
  margin: 2rem auto 0;
  counter-reset: why-counter;
}

.why-grid .why-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 2.75rem 1.75rem 1.75rem 1.75rem;
  border-radius: 18px;
  counter-increment: why-counter;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  border: 1px solid rgba(var(--color-primary-rgb), 0.18);
}

/* Featured hero card — first card spans full width */
.why-grid .why-card:first-child {
  grid-column: 1 / -1;
  padding: 3rem 2.5rem 2.25rem 2.5rem;
  background: linear-gradient(
    135deg,
    rgba(var(--color-primary-rgb), 0.10),
    rgba(var(--color-secondary-rgb), 0.04)
  );
  border-color: rgba(var(--color-primary-rgb), 0.35);
}

/* Decorative top accent line */
.why-grid .why-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 1.5rem;
  right: 50%;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), transparent);
  border-radius: 0 0 2px 2px;
  transition: right 0.35s ease;
}

/* Large faded number badge */
.why-grid .why-card::before {
  content: counter(why-counter, decimal-leading-zero);
  position: absolute;
  top: 0.75rem;
  right: 1.25rem;
  font-family: var(--font-heading, 'DM Sans', sans-serif);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--color-primary);
  opacity: 0.35;
  pointer-events: none;
}

.why-grid .why-card:first-child::before {
  font-size: 4rem;
  opacity: 0.4;
  top: 1rem;
  right: 2rem;
}

/* Hover state — lift and glow */
.why-grid .why-card:hover {
  transform: translateY(-4px);
  border-color: rgba(var(--color-primary-rgb), 0.45);
  box-shadow: 0 12px 40px rgba(var(--color-primary-rgb), 0.18);
}
.why-grid .why-card:hover::after {
  right: 1.5rem;
}

/* Typography */
.why-grid .why-card h3 {
  font-size: clamp(1.05rem, 1.3vw + 0.5rem, 1.5rem);
  line-height: 1.3;
  margin-top: 0.5rem;
  margin-bottom: 0.85rem;
  padding-right: 3rem;
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}
.why-grid .why-card:first-child h3 {
  font-size: clamp(1.4rem, 2.2vw + 0.5rem, 2.1rem);
  padding-right: 5rem;
  max-width: 80%;
}
.why-grid .why-card p {
  font-size: 0.95rem;
  line-height: 1.65;
  margin: 0;
}

/* Blog list — stacked vertically with image+content split, alternating sides */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 1100px;
  margin: 2rem auto 0;
}

.blog-list .blog-post {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(var(--color-primary-rgb), 0.18);
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  position: relative;
}

.blog-list .blog-post::after {
  content: '';
  position: absolute;
  top: 0;
  left: 1.5rem;
  right: 50%;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), transparent);
  border-radius: 0 0 2px 2px;
  transition: right 0.35s ease;
  z-index: 3;
}

.blog-list .blog-post:hover {
  transform: translateY(-3px);
  border-color: rgba(var(--color-primary-rgb), 0.45);
  box-shadow: 0 12px 40px rgba(var(--color-primary-rgb), 0.18);
}
.blog-list .blog-post:hover::after {
  right: 1.5rem;
}

.blog-list .blog-post img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
  display: block;
}

.blog-list .blog-post-body {
  padding: 2rem 2.25rem 2rem 2.25rem;
  display: flex;
  flex-direction: column;
}

/* Alternating image position — even posts have image on the right */
.blog-list .blog-post:nth-child(even) {
  grid-template-columns: 1fr 340px;
}
.blog-list .blog-post:nth-child(even) .blog-post-body {
  order: -1;
}
.blog-list .blog-post:nth-child(even)::after {
  right: 1.5rem;
  left: 50%;
  background: linear-gradient(270deg, var(--color-primary), transparent);
}
.blog-list .blog-post:nth-child(even):hover::after {
  left: 1.5rem;
}

/* Category pill badge */
.blog-list .blog-category {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  border: 1px solid rgba(var(--color-primary-rgb), 0.5);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-primary);
  margin-bottom: 1rem;
  align-self: flex-start;
  background: rgba(var(--color-primary-rgb), 0.06);
}

.blog-list .blog-post h3 {
  font-size: clamp(1.25rem, 1.6vw + 0.5rem, 1.7rem);
  line-height: 1.3;
  margin: 0 0 0.75rem 0;
  overflow-wrap: break-word;
  hyphens: auto;
}

.blog-list .blog-meta {
  font-size: 0.82rem;
  color: var(--color-text-light, #94A3B8);
  font-style: italic;
  margin: 0 0 1.25rem 0;
  opacity: 0.85;
}

.blog-list .blog-post p:not(.blog-meta) {
  font-size: 0.93rem;
  line-height: 1.7;
  margin: 0 0 1rem 0;
}

.blog-list .blog-post p:last-child {
  margin-bottom: 0;
}

/* Treatment Philosophy pillars — top full-width, bottom 2-column */
.pillar-top {
  margin-top: 1.5rem;
}
.pillar-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-top: 1.5rem;
}
.pillar-col h3 {
  margin-top: 0;
  font-size: clamp(1.05rem, 1.4vw + 0.5rem, 1.5rem);
  line-height: 1.3;
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

.glass-panel--card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.glass-panel--card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.glass-panel--card h3,
.glass-panel--card p,
.glass-panel--card a {
  padding: 0 1.5rem;
}

.glass-panel--card h3 {
  padding-top: 1.5rem;
}

.glass-panel--card a:last-child {
  padding-bottom: 1.5rem;
}

/* ---------- Glass Section ---------- */
.glass-section {
  padding: 3rem 2rem;
  position: relative;
  z-index: 1;
}

.glass-section--hero {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.glass-section--cta {
  padding: 4rem 2rem;
}

.section-title {
  text-align: center;
  max-width: 1200px;
  margin: 0 auto 2rem;
}

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

.glass-panel--hero .glass-actions,
.glass-panel--cta .glass-actions {
  justify-content: center;
}

/* ---------- 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: 2;
}

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

/* ---------- Footer Layout ---------- */
.glass-footer {
  position: relative;
  z-index: 1;
}

.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) {
  .glass-panel-row {
    flex-direction: column;
  }

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

  .why-grid {
    grid-template-columns: 1fr;
  }
  .why-grid .why-card:first-child {
    grid-column: 1;
  }

  .pillar-row {
    grid-template-columns: 1fr;
  }

  .blog-list .blog-post,
  .blog-list .blog-post:nth-child(even) {
    grid-template-columns: 1fr;
  }
  .blog-list .blog-post:nth-child(even) .blog-post-body {
    order: 0;
  }
  .blog-list .blog-post img {
    min-height: 220px;
    max-height: 280px;
  }

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

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

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

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

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

  .glass-section {
    padding: 2rem 1rem;
  }

  .glass-panel--hero,
  .glass-panel--cta {
    padding: 2.5rem 1.5rem;
  }

  .glass-panel-grid {
    grid-template-columns: 1fr;
  }

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

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

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