/* === css/components/parallax.css === */
/* ==========================================================================
   Static Background - Статичний фон для головної сторінки
   ========================================================================== */

   .parallax-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh; /* Fallback */
    height: 100svh; /* На мобільних - стабільна висота при видимому UI браузера */
    z-index: var(--z-parallax-container, -1);
    overflow: hidden;
    pointer-events: none !important;
  
    /* Видалено contain для уникнення проблем з відображенням інших елементів */
  }
  
  /* На мобільних використовуємо svh замість dvh для стабільності */
  @media (width <= 767px) {
    .parallax-container {
      height: 100svh; /* Стабільна висота коли UI браузера видиме */
    }
  }
  
  .parallax-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
  
  .parallax-layer__background {
    position: relative;
    z-index: 0;
  }
  
  /* Псевдоелемент для фону з position: fixed (для коректної роботи на iOS Safari) */
  .parallax-layer__background::before {
    content: '';
    position: fixed;
    /* inset: 0 замість width/height/top/left - прив'язується до країв viewport,
       а не до vh-одиниць. На iOS Safari vh змінюється разом з тулбаром браузера,
       що призводить до масштабування background-size:cover. */
    inset: 0;
    z-index: -1;
  
    /* Перенесені background властивості */
    background-image: url('../../img/mainBackground_opt.webp');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    pointer-events: none !important;
  
    /* Оптимізація для iOS - апаратне прискорення */
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    -webkit-transform: translate3d(0, 0, 0);
  }
  
  /* Темний шар поверх фону для кращої читабельності тексту */
  .parallax-layer__background::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background: rgba(0, 0, 0, 0.55);
    pointer-events: none !important;
  }
  
  /* Fallback для браузерів без WebP */
  @supports not (background-image: url('data:image/webp;base64,')) {
    .parallax-layer__background::before {
      background-image: url('../../img/mainBackground.png');
    }
  }
  
  /* Мобільна версія фону */
  @media (width <= 767px) {
    .parallax-layer__background::before {
      background-image: url('../../img/mainBackground_mob_opt.webp');
    }
  
    /* Fallback для браузерів без WebP на мобільних */
    @supports not (background-image: url('data:image/webp;base64,')) {
      .parallax-layer__background::before {
        background-image: url('../../img/mainBackground_mob.png');
      }
    }
  }
  
  /* Оптимізація для iOS */
  @supports (-webkit-touch-callout: none) {
    .parallax-layer {
      backface-visibility: hidden;
      -webkit-backface-visibility: hidden;
    }
  }
  
  /* ==========================================================================
     Модифікатори для різних сторінок навчання
     Перевизначають тільки background-image, решта стилів від базового класу
     ВАЖЛИВО: модифікатори мають більшу специфічність ніж базові селектори
     ========================================================================== */
  
  /* ==================== ADULTS (Дорослі) ==================== */
  .parallax-container--adults .parallax-layer__background::before {
    background-image: url('../../img/adult_backg_desc.png') !important;
    background-image: -webkit-image-set(
      url('../../img/adult_backg_desc.webp') type('image/webp'),
      url('../../img/adult_backg_desc.png') type('image/png')
    ) !important;
    background-image: image-set(
      url('../../img/adult_backg_desc.webp') type('image/webp'),
      url('../../img/adult_backg_desc.png') type('image/png')
    ) !important;
  }
  
  /* Мобільна версія для дорослих */
  @media (width <= 767px) {
    .parallax-container--adults .parallax-layer__background::before {
      background-image: url('../../img/adult_backg_mb.jpg') !important;
      background-image: -webkit-image-set(
        url('../../img/adult_backg_mb.webp') type('image/webp'),
        url('../../img/adult_backg_mb.jpg') type('image/jpeg')
      ) !important;
      background-image: image-set(
        url('../../img/adult_backg_mb.webp') type('image/webp'),
        url('../../img/adult_backg_mb.jpg') type('image/jpeg')
      ) !important;
    }
  }
  
  /* ==================== KIDS (Діти) ==================== */
  .parallax-container--kids .parallax-layer__background::before {
    background-image: url('../../img/kids_backg_desc.png') !important;
  }
  
  /* Мобільна версія для дітей */
  @media (width <= 767px) {
    .parallax-container--kids .parallax-layer__background::before {
      background-image: url('../../img/kids_backg_mb.png') !important;
    }
  }
  
  /* ==================== PREMIUM (Преміум) ==================== */
  .parallax-container--premium .parallax-layer__background::before {
    background-image: url('../../img/premium_backg_desc.png') !important;
    background-image: -webkit-image-set(
      url('../../img/premium_backg_desc.webp') type('image/webp'),
      url('../../img/premium_backg_desc.png') type('image/png')
    ) !important;
    background-image: image-set(
      url('../../img/premium_backg_desc.webp') type('image/webp'),
      url('../../img/premium_backg_desc.png') type('image/png')
    ) !important;
  }
  
  /* Мобільна версія для преміум */
  @media (width <= 767px) {
    .parallax-container--premium .parallax-layer__background::before {
      background-image: url('../../img/premium_backg_mb.png') !important;
      background-image: -webkit-image-set(
        url('../../img/premium_backg_mb.webp') type('image/webp'),
        url('../../img/premium_backg_mb.png') type('image/png')
      ) !important;
      background-image: image-set(
        url('../../img/premium_backg_mb.webp') type('image/webp'),
        url('../../img/premium_backg_mb.png') type('image/png')
      ) !important;
    }
  }
/* === css/components/program-detail.css === */
/* ==========================================================================
   Program Detail Page - Layout тільки (glass/button/form стилі вже є)
   ========================================================================== */

/* === КОНТЕЙНЕР КОНТЕНТУ === */

.program-detail {
  position: relative;
  z-index: var(--z-content, 1);
  contain: layout style;
}

/* === СЕКЦІЯ HERO (заголовок програми) === */

.program-detail__hero {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  margin-top: calc(var(--header-height, 80px) + 1rem);
  margin-bottom: var(--section-spacing-desktop);
  padding: var(--section-padding-desktop);
  box-sizing: border-box;
}

/* Фото дитячих програм під заголовком */
.program-detail__photo {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto var(--section-spacing-desktop);
}

.program-detail__photo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 460px;
  object-fit: cover;
  border-radius: 10px;
}

.program-detail__hero h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 1rem 0;
  line-height: 1.2;
  text-wrap: balance;
}

.program-detail__description {
  font-size: var(--font-size-xl);
  color: var(--ink-light);
  line-height: 1.6;
  margin: 0;
}

/* === СЕКЦІЇ КОНТЕНТУ === */

.program-detail__section {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto var(--section-spacing-desktop);
  padding: var(--section-padding-desktop);
  box-sizing: border-box;
}

.program-detail__section h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 1.5rem 0;
  line-height: 1.3;
}

.program-detail__section p {
  color: var(--ink-light);
  line-height: 1.7;
  margin: 0 0 1rem 0;
  font-size: var(--font-size-lg);
}

/* === СПИСКИ === */

.program-detail__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.program-detail__list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: var(--ink-light);
  font-size: var(--font-size-lg);
  line-height: 1.6;
}

.program-detail__list li::before {
  content: '✓';
  color: var(--color-primary);
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* === М'ЯКА ПІДКАЗКА МІЖ СЕКЦІЯМИ === */

.program-detail__hint {
  display: flex;
  justify-content: center;
  margin: calc(-1 * var(--section-spacing-desktop) / 2) auto var(--section-spacing-desktop);
  max-width: 1200px;
  padding: 0 var(--section-padding-desktop);
  box-sizing: border-box;
}

.program-detail__hint-link {
  color: var(--graphite-soft);
  font-size: var(--font-size-sm);
  text-decoration: none;
  border-bottom: 1px dashed var(--border);
  transition: color var(--transition-fast), border-color var(--transition-fast);
  touch-action: manipulation;
}

@media (hover: hover) and (pointer: fine) {
  .program-detail__hint-link:hover {
    color: var(--ink);
    border-color: var(--graphite-soft);
  }
}

.program-detail__hint-link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 2px;
}

/* === CTA БЛОК === */

.program-detail__cta {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto var(--section-spacing-desktop);
  padding: var(--section-padding-desktop);
  box-sizing: border-box;
  text-align: center;
}

.program-detail__cta-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.75rem 0;
}

.program-detail__cta-subtitle {
  font-size: var(--font-size-base);
  color: var(--ink-light);
  margin: 0 0 2rem 0;
  line-height: 1.5;
}

.program-detail__cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.program-detail__cta-form {
  max-width: 420px;
  margin: 0 auto;
  padding: 1.5rem;
  box-sizing: border-box;
  text-align: left;
}

.program-detail__cta-form-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.5rem 0;
  text-align: center;
}

.program-detail__cta-form-subtitle {
  font-size: var(--font-size-sm);
  color: var(--ink-light);
  margin: 0 0 1.25rem 0;
  text-align: center;
  line-height: 1.4;
}

/* === АДАПТАЦІЯ: TABLET === */

@media (width >= 768px) and (width < 1024px) {
  .program-detail__hero {
    padding: 2rem 1.5rem;
    margin-top: calc(var(--header-height, 80px) + 0.5rem);
  }

  .program-detail__section {
    padding: 2rem 1.5rem;
    margin-bottom: 2rem;
  }

  .program-detail__cta {
    padding: 2rem 1.5rem;
  }

  .program-detail__cta-buttons {
    flex-direction: row;
  }
}

/* === АДАПТАЦІЯ: MOBILE === */

@media (width < 768px) {
  .program-detail__hero {
    padding: var(--section-padding-mobile);
    margin-top: calc(var(--header-height, 80px) + 0.5rem);
    margin-bottom: var(--section-spacing-mobile);
  }

  .program-detail__hero h1 {
    font-size: clamp(1.6rem, 6vw, 2.25rem);
  }

  .program-detail__description {
    font-size: var(--font-size-base);
  }

  .program-detail__section {
    padding: var(--section-padding-mobile);
    margin-bottom: var(--section-spacing-mobile);
    border-radius: var(--radius-md);
  }

  .program-detail__section h2 {
    font-size: clamp(1.2rem, 5vw, 1.5rem);
  }

  .program-detail__hint {
    margin-bottom: var(--section-spacing-mobile);
    padding: 0 var(--section-padding-mobile);
  }

  .program-detail__cta {
    padding: var(--section-padding-mobile);
    margin-bottom: var(--section-spacing-mobile);
  }

  .program-detail__cta-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .program-detail__cta-buttons .button {
    width: 100%;
    box-sizing: border-box;
  }

  .program-detail__cta-form {
    max-width: 100%;
    padding: 1.25rem 1rem;
  }
}

/* === АДАПТАЦІЯ: SMALL MOBILE === */

@media (width < 360px) {
  .program-detail__hero {
    padding: 1rem 0.75rem;
  }

  .program-detail__section {
    padding: 1rem 0.75rem;
  }

  .program-detail__cta {
    padding: 1rem 0.75rem;
  }

  .program-detail__cta-form {
    padding: 1rem 0.75rem;
  }
}

/* === iOS SAFARI FALLBACK === */

@supports (-webkit-touch-callout: none) {
  .program-detail__cta-form {
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
  }
}

/* === NO BACKDROP FILTER FALLBACK === */

@supports not (backdrop-filter: blur(8px)) {
  .program-detail__cta-form {
    background: rgba(0, 0, 0, 0.75);
  }
}

/* === REDUCED MOTION === */

@media (prefers-reduced-motion: reduce) {
  .program-detail__hint-link {
    transition: none;
  }
}
