/* =========================================================================
   Блок «Ми відкрилися» — головна, одразу під першим екраном.
   Розмітка: opening_block() у build.py. Логіка відео: assets/js/opening.js.
   Десктоп  > 1000px : кадри по боках від відео (колаж).
   Планшет 621–1000px: відео по центру, 4 кадри рядком під ним.
   Мобайл   ≤ 620px  : лише відео, адреса й графік плашками, кнопки на всю ширину.
   ========================================================================= */

.opening { padding: 72px 0 80px; overflow: hidden; }

.opening__head {
  max-width: 680px; margin: 0 auto 44px; text-align: center;
}
.opening__head .eyebrow { margin-bottom: 12px; }
.opening__head h2 { margin: 0 0 16px; font-size: clamp(32px, 3.6vw, 48px); line-height: 1.08; letter-spacing: -.028em; }
.opening__lead { margin: 0; font-size: 17px; line-height: 1.62; color: var(--c-ink-soft); }
.opening__lead-mob { display: none; }

/* --- Колаж ------------------------------------------------------------ */
.opening__grid {
  display: grid;
  grid-template-columns: minmax(0, 230px) auto minmax(0, 230px);
  grid-template-rows: 1fr 1fr;
  justify-content: center;
  column-gap: 28px; row-gap: 20px;
}
.opening__ph {
  margin: 0; border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-md); background: var(--c-bg-soft-2);
}
.opening__ph img { display: block; width: 100%; height: 100%; object-fit: cover; }
.opening__ph--1 { grid-area: 1 / 1; align-self: end;   aspect-ratio: 4 / 5; transform: rotate(-3deg); }
.opening__ph--2 { grid-area: 2 / 1; align-self: start; aspect-ratio: 1 / 1; margin-left: 36px; }
.opening__ph--3 { grid-area: 1 / 3; align-self: end;   aspect-ratio: 1 / 1; margin-right: 36px; }
.opening__ph--4 { grid-area: 2 / 3; align-self: start; aspect-ratio: 4 / 5; transform: rotate(3deg); }

.opening__stage {
  grid-area: 1 / 2 / 3 / 3;
  position: relative; display: flex; justify-content: center; align-items: center;
  padding: 20px 40px;
}
.opening__circle {
  position: absolute; top: 50%; left: 50%; width: 560px; height: 560px;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: linear-gradient(135deg, var(--c-accent-pale) 0%, #e8c39a 100%);
  pointer-events: none;
}
.opening__frame {
  position: relative; width: 360px; max-width: 100%;
  border-radius: var(--r-xl); box-shadow: 0 24px 60px rgba(90, 62, 30, .22);
}
.opening__video {
  display: block; width: 100%; aspect-ratio: 464 / 848; object-fit: cover;
  border-radius: inherit; background: var(--c-bg-soft-2);
}

/* --- Кнопка звуку ----------------------------------------------------- */
.opening__sound {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 18px; white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, .6); border-radius: 999px;
  background: var(--glass-bg); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  color: var(--c-ink); font: 500 14px/1 var(--f-body); cursor: pointer; transition: background .2s;
}
.opening__sound:hover { background: #fff; }
.opening__sound:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 3px; }
.opening__sound svg { width: 16px; height: 16px; flex: none; }
.opening__ico-sound { display: none; }
.opening__sound.is-on .opening__ico-sound { display: block; }
.opening__sound.is-on .opening__ico-muted { display: none; }

/* --- Плашки ----------------------------------------------------------- */
.opening__pill {
  position: absolute; z-index: 1;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px 8px 8px; border-radius: 999px; white-space: nowrap;
  background: var(--glass-bg); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-md); font-size: 14px; font-weight: 500; line-height: 1.2;
}
.opening__pill-ico {
  width: 36px; height: 36px; flex: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--c-accent-pale); color: var(--c-accent-dark);
}
.opening__pill-ico svg { width: 18px; height: 18px; }
.opening__pill--new   { top: 52px; left: -70px; }
.opening__pill--hours { top: 46%; right: -44px; }
.opening__pill--addr  { bottom: 110px; left: -56px; }

/* Адреса й графік списком — лише на мобайлі */
.opening__info { display: none; }

/* --- Кнопки ----------------------------------------------------------- */
.opening__btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 48px; }

/* ===================================================== Планшет */
@media (max-width: 1000px) {
  .opening { padding: 56px 0 64px; }
  .opening__head { margin-bottom: 36px; max-width: 560px; }
  .opening__lead { font-size: 16px; }

  .opening__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: auto auto;
    column-gap: 14px; row-gap: 40px; align-items: center;
  }
  .opening__stage { grid-area: 1 / 1 / 2 / -1; padding: 16px 64px; }
  .opening__circle { width: 480px; height: 480px; }
  .opening__frame { width: 300px; border-radius: 24px; }
  .opening__ph { border-radius: 16px; aspect-ratio: 4 / 5; margin: 0; align-self: center; }
  .opening__ph--1 { grid-area: 2 / 1; }
  .opening__ph--2 { grid-area: 2 / 2; }
  .opening__ph--3 { grid-area: 2 / 3; }
  .opening__ph--4 { grid-area: 2 / 4; }

  .opening__pill { font-size: 13px; padding: 7px 14px 7px 7px; }
  .opening__pill-ico { width: 34px; height: 34px; }
  .opening__pill-ico svg { width: 17px; height: 17px; }
  .opening__pill--new   { top: 48px; left: -64px; }
  /* сцена тут на всю ширину — рахуємо від центру (відео 300px) */
  .opening__pill--hours { right: auto; left: calc(50% + 150px - 56px); }
  .opening__pill--addr  { bottom: 96px; left: auto; right: min(calc(50% + 150px - 64px), calc(100% - 236px)); }

  .opening__btns { margin-top: 40px; }
}

/* ===================================================== Мобайл */
@media (max-width: 620px) {
  .opening { padding: 48px 0 56px; }
  .opening__head { margin-bottom: 28px; }
  .opening__head .eyebrow { margin-bottom: 10px; }
  .opening__head h2 { font-size: 32px; line-height: 1.12; margin-bottom: 12px; }
  .opening__lead { font-size: 15px; line-height: 1.6; }
  .opening__lead-full { display: none; }
  .opening__lead-mob { display: inline; }

  .opening__grid { display: block; }
  .opening__ph { display: none; }
  .opening__stage { padding: 8px 0; }
  .opening__circle { width: 380px; height: 380px; }
  .opening__frame { width: 280px; border-radius: 22px; box-shadow: 0 20px 50px rgba(90, 62, 30, .22); }

  /* Звук — кругла кнопка-іконка у правому верхньому куті */
  .opening__sound {
    left: auto; right: 12px; top: 12px; bottom: auto; transform: none;
    width: 44px; height: 44px; padding: 0; justify-content: center;
  }
  .opening__sound svg { width: 18px; height: 18px; }
  .opening__sound-txt {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }

  /* «Новий простір» — всередині відео, внизу зліва; решта плашок — списком нижче */
  .opening__pill--new { top: auto; left: 12px; bottom: 12px; box-shadow: none; padding: 6px 12px 6px 6px; }
  .opening__pill--new .opening__pill-ico { width: 30px; height: 30px; }
  .opening__pill--new .opening__pill-ico svg { width: 15px; height: 15px; }
  .opening__pill--hours,
  .opening__pill--addr { display: none; }

  .opening__info {
    display: flex; flex-direction: column; gap: 8px;
    list-style: none; margin: 28px 0 0; padding: 0;
  }
  .opening__info li {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: 16px; background: #fff;
    font-size: 14px; font-weight: 500; line-height: 1.35;
  }
  .opening__info .opening__pill-ico { width: 34px; height: 34px; }
  .opening__info .opening__pill-ico svg { width: 17px; height: 17px; }

  /* Кнопки — однакові, на всю ширину, текст по центру */
  .opening__btns { flex-direction: column; gap: 10px; margin-top: 28px; }
  .opening__btns .btn,
  .opening__btns .btn--arrow {
    width: 100%; min-height: 48px; padding: 0 24px; justify-content: center; gap: 12px;
    box-sizing: border-box;
  }
  .opening__btns .btn__arrow { width: 28px; height: 28px; }
  .opening__btns .btn__arrow svg { width: 12px; height: 12px; }
}

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