/* ================================ 
🕊️ СТОРІНКА ГЕРОЯ — hero.html Оптимізований hero.css 
================================ */
/* 🔤 Шрифти */
@font-face {
  font-family: "Philosopher";
  src: url("../../fonts/philosopher/Philosopher-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Philosopher";
  src: url("../../fonts/philosopher/Philosopher-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

/* 🎨 Змінні */
:root {
  --accent-yellow: #ffd65a;
  --accent-blue: #0057b7;
  --accent-yellow-soft: rgba(255, 214, 90, 0.12);
  --card-bg: rgba(0, 0, 0, 0.85);
  --card-border: rgba(255, 214, 90, 0.4);
  --text-main: #e6e6e6;
  --text-muted: #b8bdc9;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.85);
  --radius-lg: 18px;
  --radius-xl: 24px;
  --gutter: 20px;
}

/* ================================ 
🧱 БАЗА 
================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

/* 🌌 Сторінка героя */
body.hero-page {
  font-family:
    "Philosopher",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top, #151b2b 0, #050609 60%, #000 100%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Основний контент */
.hero-content {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 1.2rem var(--gutter) 4rem;
  flex: 1 1 auto;
}

/* Заголовок сторінки */
.hero-header {
  text-align: center;
  margin-bottom: 0.5rem;
  margin-top: 0;
  animation: fadeUp 0.8s ease-out 0.1s both;
}

.hero-sup {
  font-size: clamp(14px, 2vw, 18px);
  color: var(--text-main);
  margin: 0 0 0.3rem;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}

.hero-title {
  font-size: clamp(26px, 4vw, 40px);
  margin: 0 0 0 0;
  font-weight: 700;
  color: var(--accent-yellow);
  text-shadow:
    0 3px 10px rgba(0, 0, 0, 0.9),
    0 0 18px rgba(255, 214, 90, 0.35);
}

/* Перемикач секцій */
.hero-section {
  display: none;
  animation: fadeUp 0.5s ease-out;
}

.hero-section--active {
  display: block;
}
.hero-content {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 1.2rem var(--gutter) 1rem;

  /* ГОЛОВНЕ — дає блоку extended можливість жити між header і footer */
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/* ================================ 
🟡 КОРОТКА ІНФОРМАЦІЯ (fixed) 
================================ */
.hero-short-layout {
  display: grid;
  grid-template-columns: minmax(260px, 1.05fr) minmax(0, 1.45fr);
  gap: 1.6rem;
  background: linear-gradient(135deg, rgba(20, 22, 30, 0.92), rgba(10, 12, 18, 0.92));
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-soft);
  padding: 1.2rem 1.4rem;
  position: relative;
  overflow: hidden;
  /* align-items: start;*/
}

.hero-short-layout::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: calc(var(--radius-xl) - 6px);
  border: 1px solid var(--card-border);
  opacity: 0.4;
  pointer-events: none;
}

/* Фото (коротка) */
.hero-short__photo-wrapper {
  position: relative;
  border-radius: calc(var(--radius-lg) - 4px);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-soft);
  /* Пропорція фото */
  aspect-ratio: 5/6;
  /* 🛡 Фото не підсвічується */
  isolation: isolate;
  mix-blend-mode: normal;
  /*  margin-left: auto;
  margin-right: auto;*/
}

.hero-short__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Текст (коротка) */
.hero-short__info {
  position: relative;
  z-index: 1;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.55);
}

/* 🔱 Золоте тиснення заголовку (короткий блок) */
.hero-short__name {
  font-size: clamp(26px, 3.6vw, 40px);
  margin: 0 0 0.3rem;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 0.03em;
  /* Такий самий градієнт, як у розширеній */
  background: linear-gradient(180deg, #ffe8a8, #d2a84c 60%, #8a6c2c);
  /* webkit clipping для золотого тексту */
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  /* Тиснення і глибина */
  text-shadow:
    0 0 10px rgba(255, 214, 90, 0.35),
    0 2px 4px rgba(0, 0, 0, 0.85),
    0 0 25px rgba(255, 214, 90, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.hero-short__dates {
  font-size: 20px;
  margin: 0 0 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  text-align: center;
}

.hero-short__meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Рядок */
.hero-short__row {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 6px;
  font-size: 20px;
  line-height: 1.55;
  margin-bottom: 6px;
}

.hero-short__label {
  color: var(--accent-yellow);
  font-weight: 700;
  white-space: nowrap;
}

.hero-short__value {
  color: var(--text-main);
}

.hero-short__row {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 6px;
  font-size: 20px;
  line-height: 1.55;
  margin-bottom: 6px;
}

.hero-short__label {
  color: var(--accent-yellow);
  font-weight: 700;
  white-space: nowrap;
}

.hero-short__value {
  color: var(--text-main);
}
/* ==================================================
   🟡 SHORT BLOCK — АДАПТИВ (ФІНАЛЬНИЙ)
   ================================================== */

/* ============================
   ⭐ Планшети ≤ 900px
   ============================ */
@media (max-width: 900px) {
  .hero-short-layout {
    grid-template-columns: 1fr;
    padding: 1.1rem 1rem;
    gap: 1rem;
    align-items: start;
  }

  .hero-short__photo-wrapper {
    max-width: 320px;
    margin: 0 auto;
    aspect-ratio: 4/5;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-short__name {
    font-size: clamp(24px, 4vw, 32px);
    margin-bottom: 0.25rem;
  }

  .hero-short__dates {
    font-size: 18px;
    margin-bottom: 0.7rem;
  }

  .hero-short__row {
    font-size: 18px;
    margin-bottom: 6px;
  }
}

/* ============================
   ⭐ Телефони ≤ 600px (ВИПРАВЛЕНО)
   ============================ */
@media (max-width: 600px) {
  /* 1. РАМКА (БАТЬКІВСЬКИЙ БЛОК) — ВОНА ЗАМЕРЛА */
  .hero-short-layout {
    display: flex;
    flex-direction: column;
    padding: 0.9rem;
    gap: 0.8rem;
    align-items: center;

    /* 🔥 Фіксуємо висоту рамки на екрані */
    height: calc(100vh - 140px); /* Підбираємо, щоб влазило між хедером і футером */
    max-height: calc(100vh - 140px);

    /* 🔥 ЗАБОРОНЯЄМО скрол рамки */
    overflow: hidden;

    /* Прибираємо нижній паддінг контейнера, він буде у текста */
    padding-bottom: 0 !important;
  }

  /* 2. ФОТО — ЗАВЖДИ ЗВЕРХУ */
  .hero-short__photo-wrapper {
    max-width: 180px; /* Трохи компактніше */
    margin-bottom: 0; /* Відступ через gap */
    flex-shrink: 0; /* Щоб фото не сплющило */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  }

  /* 3. БЛОК З ТЕКСТОМ — ОСЬ ВІН БУДЕ СКРОЛИТИСЯ */
  .hero-short__info {
    width: 100%;
    text-align: left;

    /* 🔥 Вмикаємо скрол ТІЛЬКИ ТУТ */
    overflow-y: auto;
    flex-grow: 1; /* Займає все місце, що лишилося до низу рамки */

    /* Додаємо "подушку" всередині, щоб текст не обривався різко */
    padding-bottom: 60px;
    padding-right: 4px; /* Щоб скролбар не перекривав літери */
  }

  /* --- Твої стилі тексту (без змін) --- */
  .hero-short__name {
    font-size: clamp(20px, 6vw, 26px);
    text-align: center;
    margin-bottom: 10px;
  }

  .hero-short__dates {
    font-size: 16px;
    text-align: center;
    margin-bottom: 15px;
  }

  .hero-short__row {
    font-size: 16px;
    line-height: 1.45;
    display: block !important;
    margin-bottom: 14px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08); /* Легкий розділювач для краси */
    padding-bottom: 8px;
  }

  .hero-short__label {
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap;
    color: var(--accent-yellow); /* Нагадую про колір */
  }

  .hero-short__value {
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
    text-indent: 0 !important;
  }

  .hero-short__value br {
    display: block !important;
    content: "";
    margin-top: 3px;
  }
}

/* ============================
   ⭐ Дуже маленькі екрани ≤ 390px
   ============================ */
@media (max-width: 390px) {
  .hero-short__photo-wrapper {
    max-width: 220px;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-short__name {
    font-size: clamp(18px, 6vw, 24px);
  }

  .hero-short__row {
    font-size: 15px;
  }
}

/* ==================================================
   📟 ГОРИЗОНТАЛЬНИЙ РЕЖИМ (телефони у landscape)
   ================================================== */
@media (max-height: 500px) and (min-width: 600px) {
  .hero-short-layout {
    grid-template-columns: 0.8fr 1.2fr;
    padding: 0.8rem 1rem;
    gap: 1rem;
    align-items: start;
  }

  .hero-short__photo-wrapper {
    height: 70vh;
    max-height: 70vh;
    aspect-ratio: 5/6;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-short__photo {
    object-fit: cover;
  }

  .hero-short__info {
    overflow-y: auto;
    max-height: 70vh;
    padding-right: 10px;
  }

  .hero-short__row {
    font-size: 18px;
  }
}
/* Ховати рядок, якщо нема значення (value порожнє) */
.hero-short__row:has(.hero-short__value:empty) {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ==================================================
   ⭐ Надмалі екрани в горизонталі (iPhone 14 Pro Max)
   ================================================== */
@media (max-height: 430px) {
  .hero-short-layout {
    transform: scale(0.8);
    transform-origin: top center;
  }
}

/* ================================ 
🔵 РОЗШИРЕНА ІНФОРМАЦІЯ — ФІНАЛЬНИЙ FIX
================================ */

/* Головний блок */
.hero-extended-layout {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(0, 1.5fr);
  gap: 1.6rem;
  background: linear-gradient(135deg, rgba(20, 22, 30, 0.92), rgba(10, 12, 18, 0.92));
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-soft);
  padding: 1.4rem 1.6rem;
  position: relative;
  max-width: 100%;

  /* ✨ БЛОК ПОВНІСТЮ ВСЕРЕДИНІ viewport */
  height: calc(100vh - 60px - 120px); /* футер + хедер */
  max-height: none;

  overflow: hidden;
  min-height: 0;
}

/* Внутрішній контур */
.hero-extended-layout::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: calc(var(--radius-xl) - 6px);
  border: 1px solid var(--card-border);
  opacity: 0.4;
  pointer-events: none;
}

/* Ліва колонка */
.hero-extended__left {
  display: flex;
  flex-direction: column;
  min-height: 0; /* дозволяє коректно стискатись */
}

/* Фото */
.hero-extended__photo-wrapper {
  border-radius: calc(var(--radius-lg) - 4px);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-soft);
  aspect-ratio: 5/6;
  width: 100%;

  /* 🔥 Не дозволяємо фото вибитись за межі блоку */
  height: 100%;
  max-height: calc(100vh - 60px - 40px); /* запас під заголовок і падінги */
  min-height: 0;
}

.hero-extended__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Права колонка */
.hero-extended__right {
  display: flex;
  flex-direction: column;
  min-height: 0; /* 🔥 дає можливість біографії скролитись */
  overflow: hidden;
}

/* Заголовок */
.hero-extended__name {
  font-size: clamp(28px, 3.7vw, 42px);
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  text-align: center;
  background: linear-gradient(180deg, #ffe8a8, #d2a84c 60%, #8a6c2c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 0 10px rgba(255, 214, 90, 0.35),
    0 2px 4px rgba(0, 0, 0, 0.85),
    0 0 25px rgba(255, 214, 90, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* Дати */
.hero-extended__dates {
  font-size: 20px;
  text-align: center;
  margin: 0 0 0.8rem;
  color: rgba(255, 230, 160, 0.9);
  text-shadow: 0 0 8px rgba(255, 214, 90, 0.3);
}

/* Біографія — ЄДИНЕ, що може скролитись */
.hero-extended__bio {
  font-size: 20px;
  line-height: 1.58;
  padding-right: 0.7rem;
  color: rgba(255, 255, 255, 0.92);
  font-feature-settings: "kern", "liga", "lnum";

  flex: 1 1 auto;
  overflow-y: auto; /* 🔥 скрол */
  min-height: 0;
}

.hero-extended__bio p {
  margin: 0 0 1.25rem;
  text-align: justify;
  text-indent: 28px;
  letter-spacing: 0.1px;
  word-spacing: 0.5px;
}

.hero-extended__bio p:last-child {
  margin-bottom: 0.4rem;
}

/* Скролбар */
.hero-extended__bio::-webkit-scrollbar {
  width: 6px;
}

.hero-extended__bio::-webkit-scrollbar-thumb {
  background: linear-gradient(#ffd873, #caa443);
  border-radius: 999px;
}

/* ================================================== 
📟 DESKTOP FIX (901px+)
================================================== */
@media (min-width: 901px) {
  .hero-extended-layout {
    grid-template-columns: minmax(300px, 0.95fr) minmax(0, 1.05fr);
    max-height: none;
    overflow: hidden;
  }

  .hero-extended__photo-wrapper {
    height: 100%;
  }

  .hero-extended__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .hero-extended__right {
    overflow: hidden;
  }

  .hero-extended__bio {
    overflow-y: auto;
    max-height: calc(100vh - 280px);
    padding-right: 10px;
  }
}

/* ================================================== 
📱 ТАБЛЕТИ (до 900px)
================================================== */
@media (max-width: 900px) {
  .hero-extended-layout {
    grid-template-columns: 0.9fr 1.1fr;
    padding: 1.2rem;
    gap: 1.2rem;
  }

  .hero-extended__name {
    font-size: clamp(26px, 4vw, 36px);
  }

  .hero-extended__bio {
    font-size: 18px;
  }
}

/* ================================================== 
📱 СМАРТФОНИ (до 650px) — ФІНАЛЬНЕ ФОТО 4:5
================================================== */
@media (max-width: 650px) {
  .hero-extended-layout {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 1rem 1.1rem;
  }

  .hero-extended__photo-wrapper {
    max-width: 300px;
    margin: 0 auto;
    aspect-ratio: 4 / 5;
    height: auto !important;
    overflow: hidden;
    background: transparent !important;
  }

  .hero-extended__photo {
    width: auto !important;
    height: 100% !important;
    object-fit: cover;
    border-radius: var(--radius-lg) !important;
  }

  .hero-extended__name {
    font-size: clamp(20px, 5vw, 28px);
    margin-top: 0.4rem;
  }

  .hero-extended__dates {
    font-size: 16px;
  }

  /* 🔥 ВСЯ ПРАВА КОЛОНКА ТЕПЕР СКРОЛИТЬСЯ */
  .hero-extended__right {
    overflow-y: auto;
    max-height: 60vh;
    padding-right: 10px;
    margin-top: 0.6rem;
  }

  /* ❗️ Біографія більше НЕ скролиться сама */
  .hero-extended__bio {
    font-size: 16px;
    line-height: 1.55;
    max-height: none !important;
    overflow: visible !important;
    padding-right: 0;
  }
  .hero-short-layout::after,
  .hero-extended-layout::after {
    display: none;
  }
}

/* ================================================== 
📱 СУПЕР-ВУЗЬКІ (до 390px)
================================================== */
@media (max-width: 390px) {
  .hero-extended__photo-wrapper {
    max-width: 220px;
  }

  .hero-extended__name {
    font-size: clamp(18px, 5vw, 24px);
  }

  .hero-extended__bio {
    font-size: 14px;
  }
  .hero-short-layout::after,
  .hero-extended-layout::after {
    display: none;
  }
}

/* ==================================================
📱 ГОРИЗОНТАЛЬНИЙ РЕЖИМ (landscape) — ФІКС БЕЗ РОЗТЯГУВАННЯ
================================================== */
@media (max-height: 500px) and (min-width: 600px) {
  /* Контейнер */
  .hero-extended-layout {
    grid-template-columns: 0.88fr 1.12fr;
    padding: 0.6rem 0.9rem;
    gap: 0.9rem;

    height: calc(100vh - 160px); /* основний фікс */
    max-height: calc(100vh - 160px);

    overflow: hidden;
  }

  /* ЛІВА СТОРОНА — фото */
  .hero-extended__photo-wrapper {
    height: calc(100vh - 180px) !important; /* ← ідеально під твоє фото */
    max-height: calc(100vh - 180px) !important;
    width: auto;

    aspect-ratio: auto;
    margin: 0 auto;
    overflow: hidden;
  }

  .hero-extended__photo {
    width: auto;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }

  /* ПРАВА КОЛОНКА */
  .hero-extended__right {
    overflow-y: auto;
    height: calc(100vh - 180px);
    max-height: calc(100vh - 180px);
    padding-right: 12px;
    min-height: 0;
  }

  /* Біографія */
  .hero-extended__bio {
    overflow: visible !important;
    max-height: none !important;
    padding-right: 5px;
    padding-bottom: 5px;
  }

  /* Шрифти */
  .hero-extended__name {
    font-size: 22px !important;
    margin-bottom: 0.2rem;
  }

  .hero-extended__dates {
    font-size: 15px !important;
    margin-bottom: 0.4rem;
  }

  .hero-extended__bio,
  .hero-extended__line {
    font-size: 14px !important;
    line-height: 1.35 !important;
  }
  .hero-short-layout::after,
  .hero-extended-layout::after {
    display: none;
  }
}

/* ================================
   🔴 ФОТОГАЛЕРЕЯ 
================================ */

/* Головний контейнер */
.hero-photos {
  background: linear-gradient(135deg, rgba(20, 22, 30, 0.92), rgba(10, 12, 18, 0.92));
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-soft);
  padding: 1.2rem 1.4rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.hero-photos::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: calc(var(--radius-xl) - 6px);
  border: 1px solid var(--card-border);
  opacity: 0.4;
  pointer-events: none;
}

/* Контейнер великого фото */
.hero-photos__viewer {
  margin-bottom: 1rem;
}

/* Фіксована висота фото-контейнера */
.hero-photos__frame {
  position: relative;
  border-radius: calc(var(--radius-lg) - 4px);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-soft);

  height: 70vh;
  max-height: 650px;
  min-height: 280px;

  display: flex;
  align-items: center;
  justify-content: center;
}

/* Фото */
.hero-photos__main {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
  cursor: zoom-in;
}

/* Лічильник */
.hero-photos__counter {
  position: absolute;
  bottom: 8px;
  left: 12px;
  margin-top: 0px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  font-size: 12px;
  color: var(--text-main);
}

/* Стрілки навігації галереї */
.hero-photos__nav {
  position: absolute;
  top: 50%;
  /* 🔥 Центрування по вертикалі */
  transform: translateY(-50%);

  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 40px;
  height: 40px;
  border-radius: 50%;

  background: rgba(0, 0, 0, 0.6); /* Напівпрозорий чорний */
  color: #fff;

  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  z-index: 10;

  transition: all 0.2s ease;
  outline: none; /* Прибираємо синю обводку */
}

/* Позиції стрілок */
.hero-photos__nav--prev {
  left: 10px;
}
.hero-photos__nav--next {
  right: 10px;
}

/* 🔥 HOVER: Виправляємо стрибок і колір */
.hero-photos__nav:hover {
  /* Головне: зберігаємо -50%, щоб не падало вниз, і додаємо збільшення */
  transform: translateY(-50%) scale(1.15);

  background: rgba(255, 214, 90, 0.9); /* Жовтий акцент */
  color: #000; /* Чорна стрілка */
  border-color: rgba(255, 214, 90, 1);
  box-shadow: 0 0 15px rgba(255, 214, 90, 0.6);
}

/* ACTIVE: Ефект натискання */
.hero-photos__nav:active {
  transform: translateY(-50%) scale(0.95);
  background: rgba(255, 214, 90, 0.7);
}

/* Скрол мініатюр */
.hero-photos__thumbs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  overflow-x: auto;
  padding-top: 0.4rem;
}

.hero-photos__thumbs::-webkit-scrollbar {
  height: 6px;
}
.hero-photos__thumbs::-webkit-scrollbar-track {
  background: transparent;
}
.hero-photos__thumbs::-webkit-scrollbar-thumb {
  background: rgba(255, 214, 90, 0.6);
  border-radius: 999px;
}

/* Окремий thumb */
.hero-thumb {
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  overflow: hidden;
  min-width: 80px;
  max-width: 110px;
  cursor: pointer;
  opacity: 0.7;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
  background: #000;
}

.hero-thumb--active {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 0 14px rgba(255, 214, 90, 0.4);
  border-color: rgba(255, 214, 90, 0.8);
}

.hero-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ================================
   🔵 ДЕСKTOP: фото + скрол між заголовком і футером
================================ */
@media (min-width: 992px) {
  .hero-photos {
    display: flex;
    flex-direction: column;

    /* вся доступна висота екрану */
    max-height: calc(100vh - 200px);
    height: calc(100vh - 200px);
  }

  .hero-photos__viewer {
    flex: 1 1 auto;
    min-height: 0; /* 🔥 важливо: щоб flex працював коректно */
  }

  .hero-photos__frame {
    height: 100%;
  }

  /* === ОНОВЛЕНИЙ БЛОК ТАМБНЕЙЛІВ (мініатюр) === */
  .hero-photos__thumbs {
    flex-shrink: 0;
    margin-top: 12px;

    /* Вирівнюємо ліворуч */
    justify-content: flex-start !important;
    align-items: center !important;

    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
  }

  /* Єдина висота мініатюр */
  .hero-thumb {
    height: 70px;
    min-height: 70px;
    width: auto;
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Фото всередині — однакова висота, красиве обрізання */
  .hero-thumb img {
    height: 100%;
    width: auto;
    object-fit: cover;
    display: block;
  }
}

/* ================================
   🟢 МОБІЛЬНИЙ ПОРТРЕТ (VERTICAL)
================================ */
@media (max-width: 600px) and (orientation: portrait) {
  .hero-photos__frame {
    height: 55vh;
  }

  .hero-photos__thumbs {
    margin-top: 0.6rem;
  }
}

/* ================================
   🟣 HORIZONTAL (LANDSCAPE)
================================ */
@media (orientation: landscape) and (max-width: 992px) {
  .hero-photos {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;

    /* 🟡 фіксуємо висоту галереї на весь вільний простір */
    height: calc(100vh - 160px);
    max-height: calc(100vh - 160px);

    overflow: hidden;
  }

  .hero-photos__viewer {
    height: 100%;
    margin-bottom: 0;
    min-height: 0;
  }

  .hero-photos__frame {
    height: 100%;
    max-height: 100%;
    min-height: 0;

    display: flex;
    justify-content: center;
    align-items: center;
  }

  .hero-photos__main {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  /* 🟣 ПРАВА КОЛОНКА З МІНІАТЮРАМИ */
  .hero-photos__thumbs {
    display: flex;
    flex-direction: column;

    justify-content: flex-start !important;
    align-items: flex-start !important;

    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    gap: 10px;
  }

  .hero-thumb {
    width: 85%;
    height: 65px;
    min-height: 65px;
    flex-shrink: 0;
  }
}

/* ================================
   🔍 FULLSCREEN LIGHTBOX — UNIVERSAL
================================ */
.hero-lightbox {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: none;
  align-items: center;
  justify-content: center;
}

.hero-lightbox--open {
  display: flex;
}

.hero-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(6px);
}

/* Центрований контейнер */
.hero-lightbox__dialog {
  position: relative;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 100vw;
  height: 100vh;

  max-width: 100vw;
  max-height: 100vh;

  z-index: 1;
}

/* ГОЛОВНА МАГІЯ — завжди вміщується */
.hero-lightbox__img {
  display: block;

  /* фото НІКОЛИ не виходить за межі */
  max-width: 100vw;
  max-height: 100vh;

  width: auto;
  height: auto;

  object-fit: contain;
}

/* Кнопка закриття (Переїхала вліво, щоб не сваритися з Місяцем) */
.hero-lightbox__close {
  position: absolute;
  top: 20px; /* Трохи більше відступ зверху */
  left: 20px; /* 🔥 ТЕПЕР ЗЛІВА */
  right: auto; /* Скасовуємо прив'язку до права */

  border: none;
  background: rgba(0, 0, 0, 0.6); /* Трохи темніше */
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);

  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  z-index: 5000; /* Піднімаємо вище всього */

  transition: background 0.2s;
}

.hero-lightbox__close:hover {
  background: rgba(200, 50, 50, 0.8); /* Червоний при наведенні (як danger zone) */
  border-color: rgba(200, 50, 50, 1);
}

/* ================================
   🔘 КНОПКИ НАВІГАЦІЇ В ЛАЙТБОКСІ
================================ */
.hero-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10; /* Поверх фото */

  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);

  width: 50px;
  height: 50px;
  border-radius: 50%;

  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 4px; /* центрування символу */
  transition: all 0.2s ease;
}

/* Розміщення з боків */
.hero-lightbox__nav--prev {
  left: 20px;
}
.hero-lightbox__nav--next {
  right: 20px;
}

/* Ефекти */
.hero-lightbox__nav:hover {
  background: rgba(255, 214, 90, 0.9);
  color: #000;
  border-color: #ffd65a;
  transform: translateY(-50%) scale(1.1);
}

/* Мобільна адаптація (кнопки трохи менші і ближче до країв) */
@media (max-width: 600px) {
  .hero-lightbox__nav {
    width: 40px;
    height: 40px;
    font-size: 22px;
    background: rgba(0, 0, 0, 0.3); /* Прозоріші, щоб не заважали фото */
  }
  .hero-lightbox__nav--prev {
    left: 10px;
  }
  .hero-lightbox__nav--next {
    right: 10px;
  }
}

/* ================================
   🟢 MOBILE PORTRAIT (JUST SMALLER UI)
================================ */
@media (max-width: 600px) and (orientation: portrait) {
  .hero-lightbox__close {
    top: 10px;
    right: 10px;
    font-size: 20px;
    padding: 4px 10px;
  }
}

/* ================================
   🟣 MOBILE LANDSCAPE (FULL FIT)
================================ */
@media (max-width: 900px) and (orientation: landscape) {
  .hero-lightbox__close {
    top: 8px;
    right: 12px;
    font-size: 18px;
    padding: 4px 10px;
  }
}

/* ================================ 
⚓ ФУТЕР-НАВІГАЦІЯ
================================ */
.hero-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  border-top: 1px solid rgba(255, 214, 90, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.6rem;
  z-index: 3000;
}

.hero-tabs {
  display: flex;
  gap: 0.5rem;
}

.hero-tab {
  border: 1px solid rgba(255, 214, 90, 0.35);
  background: rgba(10, 15, 25, 0.92);
  color: var(--text-main);
  font-size: 14px;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    transform 0.15s ease;
}

.hero-tab--active {
  background: radial-gradient(circle at top, rgba(255, 214, 90, 0.4), transparent 65%);
  color: #000;
  border-color: rgba(255, 214, 90, 0.95);
  box-shadow: 0 0 14px rgba(255, 214, 90, 0.5);
  transform: translateY(-1px);
}

.hero-back-btn {
  border: 1px solid rgba(255, 214, 90, 0.7);
  background: radial-gradient(circle at top, rgba(255, 214, 90, 0.25), transparent 60%);
  color: var(--text-main);
  font-size: 14px;
  padding: 0.35rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease,
    border-color 0.2s ease;
}

.hero-back-btn:hover {
  background: radial-gradient(circle at top, rgba(255, 214, 90, 0.45), transparent 65%);
  box-shadow: 0 0 16px rgba(255, 214, 90, 0.55);
  border-color: rgba(255, 214, 90, 0.95);
  transform: translateY(-1px);
}
/* ================================
   📱 MOBILE PORTRAIT (VERTICAL)
   Футер у два ряди
================================ */
@media (max-width: 600px) and (orientation: portrait) {
  .hero-footer {
    height: auto; /* футер підлаштовується по висоті */
    padding: 0.6rem 1rem;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .hero-tabs {
    width: 100%;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .hero-tab {
    flex: 1 1 30%; /* 3 кнопки в один ряд */
    max-width: 140px;
    text-align: center;
    padding: 0.4rem 0.6rem;
    font-size: 13px;
  }

  .hero-back-btn {
    width: 100%; /* кнопка "Повернутись" окремим рядом */
    max-width: 260px;
    text-align: center;
    padding: 0.45rem 1rem;
    font-size: 14px;
  }
}

/* ================================ 
✨ Анімації 
================================ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================================ 
🔱 ТРИЗУБ У ФОНІ 
================================ */
.hero-short-layout::after,
.hero-extended-layout::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 40px;
  transform: translateY(-50%);
  width: 280px;
  height: 340px;
  background-image: url("../img/tryzub.png");
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.07;
  pointer-events: none;
}

/* ================================ 
🌟 ОДНАКОВА ВИСОТА БЛОКІВ (DESKTOP) 
================================ */
@media (min-width: 901px) {
  .hero-short-layout {
    min-height: 280px; /* не менше 280px */
    height: auto; /* але може рости вниз */
  }
}
/* ================================
   🌟 ПІДСВІТЛЕННЯ ФОТО У ГЕРОЇ
================================ */

/* Головне фото у галереї */
.hero-photos__main {
  filter: brightness(1.12) contrast(1.05);
}

/* Мініатюри */
.hero-thumb img {
  filter: brightness(1.12);
}

/* Фото у короткій інформації */
.hero-short__photo {
  filter: brightness(1.1);
}

/* Фото у розширеній інформації */
.hero-extended__photo {
  filter: brightness(1.1);
}

/* Фото у лайтбоксі (fullscreen) */
.hero-lightbox__img {
  filter: brightness(1.12) contrast(1.06);
}
