/* ─── Спільні стилі: скидання, лайтбокс, анімації ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }
a, button, [role="button"] { -webkit-tap-highlight-color: transparent; }
body { overflow-x: clip; }
input, select, textarea { font: inherit; color: inherit; }
section { scroll-margin-top: 84px; }

.container { width: min(1200px, 100% - 48px); margin-inline: auto; }
@media (max-width: 640px) { .container { width: calc(100% - 32px); } }

/* Поява при скролі */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ─── Лайтбокс галереї · «Журнал»: фото зліва, колонка з підписами й мініатюрами справа ─── */
.lb { position: fixed; inset: 0; z-index: 1000; background: var(--bg);
      display: grid; grid-template-columns: 1fr 300px;
      opacity: 0; pointer-events: none; transition: opacity .28s ease; }
.lb.open { opacity: 1; pointer-events: auto; }

.lb-stage { position: relative; display: flex; align-items: center; justify-content: center;
            padding: 46px 46px 46px 60px; min-width: 0; }
.lb-stage img { max-width: 100%; max-height: calc(100vh - 92px); max-height: calc(100dvh - 92px); object-fit: contain;
                box-shadow: 0 30px 90px rgba(0,0,0,.55); user-select: none; -webkit-user-drag: none;
                transition: opacity .28s ease; }
.lb-stage img.swap { opacity: 0; }
/* половинки-клікалки поверх фото: ліва — назад, права — вперед */
.lb-hit { position: absolute; top: 0; bottom: 0; width: 50%; z-index: 3; background: none; border: 0; }
.lb-hit.prev { left: 0; cursor: w-resize; }
.lb-hit.next { right: 0; cursor: e-resize; }

.lb-side { border-left: 1px solid var(--line); padding: 40px 34px 26px;
           display: flex; flex-direction: column; min-height: 0; }
.lb-close { position: absolute; top: 22px; right: 24px; z-index: 5; width: 40px; height: 40px;
            color: var(--text); font-size: 18px; opacity: .6; transition: .2s; border: 0; background: none; }
.lb-close:hover { opacity: 1; }
.lb-eyebrow { font-size: 10.5px; letter-spacing: .3em; text-transform: uppercase; color: var(--accent); }
.lb-title { font-family: var(--serif); font-size: 38px; font-style: italic; font-weight: 500;
            margin: 14px 0 6px; color: var(--text); line-height: 1.1; }
.lb-meta { font-size: 12.5px; color: var(--muted); letter-spacing: .04em; }
.lb-num { margin: 32px 0 24px; font-family: var(--serif); display: flex; align-items: baseline; gap: 8px; }
.lb-num b { font-size: 58px; font-weight: 500; color: var(--accent); line-height: 1;
            font-variant-numeric: tabular-nums; }
.lb-num span { font-size: 17px; color: var(--muted); }

/* дві колонки — смужка на всю ширину виходила зрізом 4:1, по ньому не впізнати кадр */
.lb-thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; overflow-y: auto; min-height: 0;
             align-content: start; padding-right: 6px;
             scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.lb-thumbs::-webkit-scrollbar { width: 5px; }
.lb-thumbs::-webkit-scrollbar-thumb { background: rgba(245,234,221,.2); border-radius: 3px; }
.lb-thumbs button { height: 78px; opacity: .4; transition: .2s; padding: 0; background: none;
                    border: 1px solid transparent; }
.lb-thumbs button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-thumbs button.act { opacity: 1; border-color: var(--accent); }
.lb-thumbs button:hover { opacity: .8; }

.lb-nav { display: flex; gap: 10px; padding-top: 20px; margin-top: 18px; border-top: 1px solid var(--line); }
.lb-arrow { flex: 1; height: 46px; border: 1px solid var(--line); background: none; color: var(--text);
            font-size: 17px; transition: .2s; }
.lb-arrow:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 900px) {
  .lb { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .lb-stage { padding: 52px 14px 14px; }
  .lb-stage img { max-height: calc(100vh - 220px); max-height: calc(100dvh - 220px); }
  .lb-side { border-left: none; border-top: 1px solid var(--line);
             padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
             display: grid; grid-template-columns: auto 1fr; grid-template-areas: "num thumbs" "nav nav";
             gap: 12px 14px; align-items: center; }
  .lb-eyebrow, .lb-meta { display: none; }
  .lb-title { position: absolute; top: 18px; left: 18px; font-size: 20px; margin: 0; }
  .lb-num { grid-area: num; margin: 0; }
  .lb-num b { font-size: 30px; }
  .lb-thumbs { grid-area: thumbs; display: flex; overflow-x: auto; overflow-y: hidden; gap: 8px; }
  .lb-thumbs button { flex: none; width: 66px; height: 48px; }
  .lb-nav { grid-area: nav; margin: 0; padding-top: 12px; }
  .lb-arrow { height: 42px; }
}
/* Низький альбомний екран (телефон боком): панель не знизу, а вузькою колонкою збоку,
   інакше фото лишається смужкою заввишки ~150px */
@media (max-height: 500px) and (orientation: landscape) {
  .lb { grid-template-columns: 1fr 230px; grid-template-rows: none; }
  .lb-stage { padding: 18px; }
  .lb-stage img { max-height: calc(100vh - 36px); max-height: calc(100dvh - 36px); }
  .lb-side { display: flex; flex-direction: column; border-top: none; border-left: 1px solid var(--line);
             padding: 16px 18px calc(12px + env(safe-area-inset-bottom)); }
  .lb-eyebrow, .lb-meta { display: none; }
  .lb-title { position: static; font-size: 21px; margin: 20px 0 10px; }
  .lb-num { margin: 0 0 12px; }
  .lb-num b { font-size: 28px; }
  .lb-num span { font-size: 14px; }
  .lb-thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; flex: 1; overflow: hidden auto; }
  .lb-thumbs button { width: auto; height: 52px; }
  .lb-nav { margin: 12px 0 0; padding-top: 12px; }
  .lb-arrow { height: 40px; }
}
body.lb-lock { overflow: hidden; }
body.nav-lock { overflow: hidden; }
/* якщо з відкритим меню повернути/розтягти екран за 1024px, меню зникає — не лишати сторінку замкненою */
@media (min-width: 1025px) { body.nav-lock { overflow: visible; } }

/* ─── Мобільне меню (спільна механіка) ─── */
.burger { display: none; flex-direction: column; gap: 5px; padding: 10px; z-index: 60; }
.burger span { display: block; width: 22px; height: 1.6px; background: currentColor; transition: .25s; }
.burger.open span:nth-child(1) { transform: translateY(6.6px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-6.6px) rotate(-45deg); }
