/* =============================================================================
   ERGOTHERAPIEPRAXIS LEA FREIBOTT — Service Detail Pages (service-detail.css)
   Shared stylesheet for: neurologie.php, orthopaedie.php,
                          geriatrie.php, psychiatrie.php
   =============================================================================

   HOW TO USE PER-PAGE ACCENT COLOURS:
   In the <main> element of each service page, set the CSS custom properties:

     <main ... style="
       --svc-color:        #FDB87D;   ← specialty accent (full)
       --svc-color-dark:   #F5A05A;   ← darker shade for text/borders
       --svc-color-subtle: rgba(253,184,125,0.12); ← transparent fill
     ">

   All service-specific colours below reference these variables so the same
   CSS works for every pillar with zero duplication.
   ============================================================================= */

/* =============================================================================
   1. SCROLL ANIMATIONS
   ============================================================================= */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity  0.68s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.68s cubic-bezier(0.16, 1, 0.3, 1);
}
.fade-up.is-visible { opacity: 1; transform: translateY(0); }
.anim-d1 { transition-delay:  80ms; }
.anim-d2 { transition-delay: 160ms; }
.anim-d3 { transition-delay: 240ms; }
.anim-d4 { transition-delay: 320ms; }

/* =============================================================================
   2. SERVICE HERO (Cinematic 50/50)
   ============================================================================= */
.service-hero {
  background: var(--color-bg);
  padding-block: var(--space-12) var(--space-16);
  position: relative;
  overflow: hidden;
}

.service-hero .container {
  position: relative;
  z-index: 1;
}

.service-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(var(--space-10), 5vw, var(--space-16));
  align-items: center;
}

/* ── Breadcrumbs ─────────────────────────────────────────────────────────── */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-5) 0;
  flex-wrap: wrap;
}

.breadcrumbs li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-light);
}

.breadcrumbs li:not(:last-child)::after {
  content: '›';
  font-size: 0.85em;
  color: var(--color-text-light);
  opacity: 0.6;
}

.breadcrumbs a {
  color: var(--color-text-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}
.breadcrumbs a:hover { color: var(--svc-color-dark, var(--color-primary-dark)); }

.breadcrumbs [aria-current="page"] {
  color: var(--svc-color-dark, var(--color-primary-dark));
  font-weight: var(--fw-medium);
  pointer-events: none;
}

/* ── Hero text column ──────────────────────────────────────────────────────── */
.service-hero-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.service-specialty-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--fw-semi);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--svc-color-dark, var(--color-primary-dark));
  background: var(--svc-color-subtle, rgba(253,184,125,0.12));
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  width: fit-content;
  border: 1px solid var(--svc-color, var(--color-primary));
}

.service-hero-content h1 {
  font-size: clamp(2rem, 3.5vw, 3.2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin: 0;
}

.service-intro {
  font-size: var(--text-md);
  line-height: var(--lh-relaxed);
  color: var(--color-text-secondary);
  max-width: 52ch;
  margin: 0;
}

/* Quick stats row */
.service-stats {
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
  padding-top: var(--space-4);
  padding-bottom: var(--space-2);
}

.service-stat {
  display: flex;
  align-items: center;
  gap: 8px;
}

.service-stat svg {
  width: 24px !important;
  height: 24px !important;
  max-width: 24px !important;
  flex-shrink: 0 !important;
  color: var(--svc-color, var(--color-primary));
}

.service-stat__content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.service-stat__num {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--fw-bold);
  color: var(--color-text);
  line-height: 1;
}

.service-stat__label {
  font-size: var(--text-xs);
  color: var(--color-text-light);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
}

.service-stat-divider {
  width: 1px;
  background: var(--color-border);
  align-self: stretch;
  flex-shrink: 0;
}

/* ── Hero figure column (Media-Rich) ───────────────────────────────────────── */
.service-hero-figure {
  margin: 0;
  position: relative;
  width: 100%;
}

/* STRICT #ffffff BACKGROUND */
.service-figure-badge {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: #ffffff;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--fw-semi);
  color: var(--color-text);
  box-shadow: 0 12px 32px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
  border: 1px solid var(--color-border-light);
}

.service-figure-badge svg {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  flex-shrink: 0 !important;
  color: var(--svc-color-dark, var(--color-primary-dark));
}

.service-figure-badge--top-right {
  top: 10%;
  right: -5%;
}

.service-figure-badge--bottom-left {
  bottom: 10%;
  left: -5%;
}

.service-hero-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-2xl);
  background: #ffffff;
  border: 1px solid var(--color-border-light);
  box-shadow: 0 20px 60px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.service-hero-media img,
.service-hero-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =============================================================================
   3. MAIN CONTENT + STICKY SIDEBAR
   ============================================================================= */
.service-content-section {
  background: var(--color-surface-alt);
  padding-block: var(--space-16) var(--space-20);
}

.service-content-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: clamp(var(--space-8), 4vw, var(--space-16));
  align-items: start;
}

/* ── Content column (Left) ────────────────────────────────────────────────── */
.service-main-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.service-main-content h2 {
  font-size: var(--text-2xl);
  color: var(--color-text);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
  margin-bottom: var(--space-8);
  position: relative;
  padding-bottom: var(--space-4);
}

.service-main-content h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 48px;
  height: 3px;
  background: var(--svc-color, var(--color-primary));
  border-radius: var(--radius-full);
}

.service-main-content p {
  font-size: var(--text-md);
  color: var(--color-text-secondary);
  line-height: var(--lh-relaxed);
}

.content-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* 16:9 Image Placeholder (#ffffff) */
.content-placeholder-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #ffffff;
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border-light);
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
  margin-top: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.content-placeholder-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Indications list ─────────────────────────────────────────────────────── */
.indications-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.indications-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: #ffffff;
  border: 1px solid var(--color-border-light);
  border-left: 4px solid var(--svc-color, var(--color-primary));
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.indications-list li:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.04);
  transform: translateX(4px);
}

.indications-list li .indication-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--svc-color-subtle, rgba(253,184,125,0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.indications-list li .indication-icon svg {
  width: 20px;
  height: 20px;
  color: var(--svc-color-dark, var(--color-primary-dark));
}

.indication-text strong {
  display: block;
  font-size: var(--text-md);
  font-weight: var(--fw-semi);
  color: var(--color-text);
  margin-bottom: 4px;
}

/* ── Upgraded Method Cards (Image-Top) ──────────────────────────────────────── */
.methods-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}

.method-card {
  background: #ffffff; /* STRICT: pure white */
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 16px rgba(0,0,0,0.03);
  transition: box-shadow var(--transition-base), transform var(--transition-spring);
  overflow: hidden;
}

.method-card:hover {
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
  transform: translateY(-4px);
}

.method-card__figure {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #ffffff; /* strictly pure white */
  border-bottom: 1px solid var(--color-border-light);
  position: relative;
}

.method-card__figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.method-card__content {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.method-card__name {
  font-size: var(--text-md);
  font-weight: var(--fw-bold);
  color: var(--color-text);
  margin: 0;
}

.method-card__desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--lh-relaxed);
  margin: 0;
}

/* ── Masonry Gallery (Therapie-Ausstattung) ────────────────────────────────── */
.therapy-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.gallery-item {
  width: 100%;
  background: #ffffff; /* strictly pure white */
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.03);
}

/* Masonry look via varied aspect ratios */
.gallery-item:nth-child(1) { aspect-ratio: 1 / 1; }
.gallery-item:nth-child(2) { aspect-ratio: 3 / 4; transform: translateY(var(--space-6)); }
.gallery-item:nth-child(3) { aspect-ratio: 4 / 5; }

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Goal Section (Asymmetric ADL block) ───────────────────────────────────── */
.goal-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  align-items: center;
  background: #ffffff; /* STRICT */
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  box-shadow: 0 10px 40px rgba(0,0,0,0.04);
}

.goal-block__image {
  width: 100%;
  aspect-ratio: 4 / 5;
  background: #ffffff; /* STRICT */
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border-light);
  overflow: hidden;
}

.goal-block__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.goal-block__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.goal-block__content h2 {
  font-size: var(--text-xl);
  margin-bottom: 0;
  padding-bottom: var(--space-3);
}

.goal-points {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  list-style: none;
  padding: 0;
  margin: 0;
}

.goal-points li {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--lh-relaxed);
  font-weight: var(--fw-medium);
}

.goal-points li::before {
  content: '';
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  margin-top: 2px;
  background: var(--svc-color, var(--color-primary));
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E") center / 12px no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E") center / 12px no-repeat;
}

/* ── Sticky Sidebar (Right) ────────────────────────────────────────────────── */
.service-sidebar {
  position: sticky;
  top: 110px; /* clears the fixed header */
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.sidebar-card {
  background: #ffffff; /* STRICT: pure white */
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: 0 10px 40px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  position: relative;
  overflow: hidden;
}

.sidebar-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--svc-color, var(--color-primary));
}

.sidebar-card__label {
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--svc-color-dark, var(--color-primary-dark));
}

.sidebar-card__title {
  font-size: var(--text-xl);
  font-weight: var(--fw-bold);
  color: var(--color-text);
  line-height: var(--lh-snug);
}

.sidebar-card__body {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--lh-relaxed);
}

.sidebar-card .btn {
  width: 100%;
  justify-content: center;
}

.sidebar-card__sub {
  font-size: var(--text-xs);
  color: var(--color-text-light);
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  line-height: var(--lh-relaxed);
}

.sidebar-card__sub svg {
  width: 16px;
  height: 16px;
  color: var(--svc-color-dark, var(--color-primary-dark));
  flex-shrink: 0;
}

/* Back link */
.sidebar-back {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4);
  background: transparent;
  text-decoration: none;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--fw-semi);
  transition: color var(--transition-fast), transform var(--transition-spring);
}

.sidebar-back:hover {
  color: var(--svc-color-dark, var(--color-primary-dark));
  transform: translateX(-4px);
}

.sidebar-back svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* =============================================================================
   4. FAQ ACCORDION SECTION
   ============================================================================= */
.service-faq-section {
  background: var(--color-bg);
  padding-block: var(--space-16) var(--space-20);
  border-top: 1px solid var(--color-border-light);
}

.faq-container {
  max-width: 800px;
  margin: 0 auto;
}

.faq-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.faq-header h2 {
  font-size: var(--text-2xl);
  color: var(--color-text);
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Accordion Element */
.faq-accordion {
  background: #ffffff; /* STRICT: pure white */
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px rgba(0,0,0,0.02);
  overflow: hidden;
  transition: box-shadow var(--transition-base);
}

.faq-accordion:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.05);
}

.faq-accordion[open] {
  border-color: var(--svc-color, var(--color-primary));
}

.faq-summary {
  padding: var(--space-5) var(--space-6);
  font-size: var(--text-md);
  font-weight: var(--fw-semi);
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none; /* remove default marker */
  transition: background var(--transition-fast);
}

.faq-summary::-webkit-details-marker {
  display: none;
}

.faq-summary:hover {
  background: var(--color-surface-alt);
}

/* Chevron icon for accordion */
.faq-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--svc-color-subtle, rgba(253,184,125,0.12));
  color: var(--svc-color-dark, var(--color-primary-dark));
  flex-shrink: 0;
  transition: transform var(--transition-spring), background var(--transition-fast);
}

.faq-accordion[open] .faq-icon {
  transform: rotate(180deg);
  background: var(--svc-color, var(--color-primary));
  color: #ffffff;
}

.faq-content {
  padding: 0 var(--space-6) var(--space-6) var(--space-6);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--lh-relaxed);
}

/* =============================================================================
   5. INTERNAL SERVICE NAVIGATION (bottom bar)
   ============================================================================= */
.service-nav-section {
  background: var(--color-surface-alt);
  padding-block: var(--space-16);
  border-top: 1px solid var(--color-border-light);
}

.service-nav-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-top: var(--space-10);
}

.service-nav-card {
  background: #ffffff;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  box-shadow: 0 4px 16px rgba(0,0,0,0.03);
  transition: box-shadow var(--transition-base), transform var(--transition-base), border-color var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.service-nav-card:hover {
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
  transform: translateY(-4px);
}

.service-nav-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
}

.service-nav-card--ortho::before { background: var(--color-accent); }
.service-nav-card--geria::before { background: var(--color-secondary); }
.service-nav-card--psych::before { background: var(--color-info); }

.service-nav-card:hover.service-nav-card--ortho { border-color: var(--color-accent); }
.service-nav-card:hover.service-nav-card--geria { border-color: var(--color-secondary); }
.service-nav-card:hover.service-nav-card--psych { border-color: var(--color-info); }

.service-nav-card__label {
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--color-text-light);
}

.service-nav-card__title {
  font-size: var(--text-lg);
  font-weight: var(--fw-bold);
  color: var(--color-text);
}

.service-nav-card__desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--lh-relaxed);
  flex: 1;
}

.service-nav-card__icon {
  margin-bottom: var(--space-4);
  color: var(--color-text-light);
}

.service-nav-card__icon svg {
  width: 32px !important;
  height: 32px !important;
  max-width: 32px !important;
  flex-shrink: 0 !important;
}

.service-nav-card__arrow {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--fw-bold);
  margin-top: auto;
  transition: gap var(--transition-spring);
}

.service-nav-card__arrow svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.service-nav-card--ortho .service-nav-card__arrow { color: #4a9989; }
.service-nav-card--geria .service-nav-card__arrow { color: #c0506a; }
.service-nav-card--psych .service-nav-card__arrow { color: #3a7ba0; }

.service-nav-card:hover .service-nav-card__arrow {
  gap: var(--space-3);
}

/* =============================================================================
   6. RESPONSIVE BREAKPOINTS
   ============================================================================= */
@media (max-width: 1024px) {
  .service-hero-grid {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }
  .service-content-layout {
    grid-template-columns: 1fr;
  }
  .service-sidebar {
    position: static;
  }
  .methods-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .therapy-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery-item:nth-child(3) { display: none; } /* Hide 3rd image on tablet for symmetric 2x1 grid */
  .goal-block {
    grid-template-columns: 1fr;
  }
  .service-nav-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .methods-grid {
    grid-template-columns: 1fr;
  }
  .therapy-gallery {
    grid-template-columns: 1fr;
  }
  .gallery-item:nth-child(2) { transform: none; }
  .gallery-item:nth-child(3) { display: block; }
  .service-hero-content h1 {
    font-size: 2.25rem;
  }
  .service-stats { gap: var(--space-4); }
  .goal-block {
    padding: var(--space-5);
  }
}
