/* ==========================================================================
   Components — shared across every page
   ========================================================================== */

/* Layout ---------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
  position: relative;
  z-index: var(--z-content);
}

.section-title {
  font-size: var(--fs-2xl);
  text-align: center;
  margin-bottom: var(--space-7);
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.section-lede {
  max-width: 52ch;
  margin: calc(var(--space-7) * -1 + var(--space-4)) auto var(--space-7);
  text-align: center;
}

/* Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease, transform var(--dur-fast) ease, color var(--dur-fast) ease;
}

.btn:hover {
  background: var(--surface-strong);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  background: var(--gradient);
  border-color: transparent;
  color: #fff;
}

.btn--primary:hover {
  background: var(--gradient);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.btn--small {
  min-height: 36px;
  padding: 0.4rem 0.85rem;
  font-size: var(--fs-xs);
}

.btn[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease, transform 100ms ease-out;
}

.icon-btn:hover {
  background: var(--surface-strong);
  border-color: var(--border-strong);
}

.icon-btn:active {
  transform: scale(0.94);
}

.icon-btn .icon {
  width: 20px;
  height: 20px;
}

/* Theme toggle: shows the icon of the theme you will switch to */
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme]) .theme-toggle .icon-moon { display: none; }
}

/* Back link — identical on every inner page ---------------------------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0.55rem 1.1rem 0.55rem 0.85rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-overlay);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}

.back-link:hover {
  color: var(--text);
  border-color: var(--accent);
}

.back-link .icon {
  transition: transform var(--dur-fast) ease;
}

.back-link:hover .icon {
  transform: translateX(-3px);
}

/* Top bar for inner (non-map) pages */
.site-bar {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--gutter);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--border);
}

/* Home navigation ------------------------------------------------------- */
.home-nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--border);
}

.home-nav__inner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--space-3);
}

.home-nav__list {
  display: flex;
  flex: 1;
  justify-content: center;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}

.home-nav__list::-webkit-scrollbar {
  display: none;
}

.home-nav__link {
  position: relative;
  display: block;
  padding: 1.15rem 1.4rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--dur-fast) ease;
}

.home-nav__link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 70%;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient);
  transform: translateX(-50%) scaleX(0);
  transition: transform var(--dur) var(--ease-out);
}

.home-nav__link:hover,
.home-nav__link[aria-current="page"] {
  color: var(--text);
}

.home-nav__link:hover::after,
.home-nav__link[aria-current="page"]::after {
  transform: translateX(-50%) scaleX(1);
}

.home-nav__link:focus-visible {
  outline-offset: -4px;
}

.home-nav .theme-toggle {
  width: 38px;
  height: 38px;
}

@media (max-width: 600px) {
  .home-nav__list {
    flex-wrap: wrap;
    overflow: visible;
  }

  .home-nav__link {
    padding: 0.7rem 0.8rem;
  }
}

/* Glass card ------------------------------------------------------------ */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* Tags & badges ---------------------------------------------------------- */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: var(--accent-text);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}

.badge--award {
  color: #ffd166;
  background: rgba(255, 209, 102, 0.12);
  border-color: rgba(255, 209, 102, 0.4);
}

:root[data-theme="light"] .badge--award { color: #8a5a00; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .badge--award { color: #8a5a00; }
}

.badge--muted {
  color: var(--text-muted);
  background: var(--surface);
  border-color: var(--border);
}

/* Project cards --------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 400px));
  justify-content: center;
  gap: var(--space-6);
  list-style: none;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: transform var(--dur) var(--ease-out), border-color var(--dur) ease, box-shadow var(--dur) ease;
}

.project-card:hover {
  color: inherit;
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--project-accent) 60%, transparent);
  box-shadow: 0 24px 60px color-mix(in srgb, var(--project-accent) 22%, transparent);
}

.project-card:focus-visible {
  outline-offset: 4px;
  border-radius: var(--radius-xl);
}

.project-card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.project-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}

.project-card:hover .project-card__media img {
  transform: scale(1.04);
}

.project-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-5) var(--space-6);
}

.project-card__title {
  font-size: var(--fs-md);
}

.project-card:hover .project-card__title {
  color: var(--project-accent-text);
}

.project-card__text {
  font-size: var(--fs-sm);
}

.project-card .tag-list {
  margin-top: auto;
  padding-top: var(--space-2);
}

.project-card__accent {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--project-accent);
  z-index: 1;
}

/* Research list --------------------------------------------------------- */
.pub-list {
  display: grid;
  gap: var(--space-4);
  list-style: none;
  max-width: 880px;
  margin-inline: auto;
}

.pub {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-3) var(--space-6);
  align-items: start;
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color var(--dur) ease;
}

.pub:hover {
  border-color: var(--border-strong);
}

.pub__title {
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: var(--lh-snug);
}

.pub__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.pub__docs {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
  list-style: none;
  min-width: 11rem;
}

.pub__docs .btn {
  justify-content: flex-start;
}

@media (max-width: 680px) {
  .pub {
    grid-template-columns: 1fr;
    padding: var(--space-5);
  }

  .pub__docs {
    flex-direction: row;
    flex-wrap: wrap;
    min-width: 0;
  }
}

/* Contact --------------------------------------------------------------- */
.contact-list {
  display: grid;
  gap: var(--space-4);
  max-width: 600px;
  margin-inline: auto;
  list-style: none;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color var(--dur) ease, transform var(--dur) var(--ease-out);
}

.contact-item:hover {
  color: var(--text);
  border-color: var(--accent);
  transform: translateX(6px);
}

.contact-item .icon {
  width: 26px;
  height: 26px;
  color: var(--accent-text);
}

.contact-item__label {
  display: block;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 500;
}

.contact-item__value {
  display: block;
  font-size: clamp(1rem, 0.6rem + 2.2vw, var(--fs-md));
  font-weight: 600;
  overflow-wrap: anywhere;
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: var(--space-5);
  max-width: 900px;
  margin: var(--space-5) auto 0;
  list-style: none;
}

.social-card {
  --brand: var(--accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color var(--dur) ease, transform var(--dur) var(--ease-out);
}

.social-card:hover {
  color: var(--text);
  border-color: var(--brand);
  transform: translateY(-6px);
}

.social-card .icon {
  width: 44px;
  height: 44px;
  color: var(--brand);
}

.social-card__name {
  font-weight: 600;
  font-size: var(--fs-md);
}

.social-card__handle {
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.social-card--instagram { --brand: #e1306c; }
.social-card--telegram { --brand: #229ed9; }
.social-card--vk { --brand: #0077ff; }

/* Footer ---------------------------------------------------------------- */
.site-footer {
  position: relative;
  z-index: var(--z-content);
  padding: var(--space-7) var(--gutter) var(--space-6);
  text-align: center;
  color: var(--text-faint);
  font-size: var(--fs-xs);
}

.site-footer p {
  color: inherit;
}

/* Modal (native <dialog>) ------------------------------------------------ */
.modal {
  width: min(760px, calc(100vw - 2rem));
  max-height: min(88vh, 960px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
  color: var(--text);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}

.modal[open] {
  display: flex;
  flex-direction: column;
  animation: modal-in var(--dur) var(--ease-out);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
}

.modal__title {
  font-size: var(--fs-lg);
}

.modal__subtitle {
  margin-top: var(--space-1);
  font-size: var(--fs-sm);
}

.modal__body {
  overflow-y: auto;
  padding: var(--space-5) var(--space-6) var(--space-7);
  overscroll-behavior: contain;
}

@media (max-width: 600px) {
  .modal {
    width: 100vw;
    max-width: 100vw;
    max-height: 92vh;
    margin: auto 0 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .modal__head,
  .modal__body {
    padding-inline: var(--space-4);
  }
}

/* Long-form prose (modal bodies, story intros) -------------------------- */
.prose {
  max-width: var(--measure);
}

.modal__body.prose {
  max-width: none;
}

.prose > * + * {
  margin-top: var(--space-4);
}

.prose h2 {
  margin-top: var(--space-7);
  font-size: var(--fs-lg);
}

.prose h3 {
  margin-top: var(--space-6);
  font-size: var(--fs-md);
}

.prose h4 {
  margin-top: var(--space-5);
  font-size: var(--fs-base);
  color: var(--project-accent-text);
}

.prose > :first-child {
  margin-top: 0;
}

.prose p,
.prose li {
  color: var(--text-muted);
  line-height: 1.7;
}

.prose ul,
.prose ol {
  padding-left: 1.25rem;
}

.prose li + li {
  margin-top: var(--space-2);
}

.prose li::marker {
  color: var(--project-accent);
}

.callout {
  padding: var(--space-4) var(--space-5);
  border-left: 3px solid var(--project-accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: color-mix(in srgb, var(--project-accent) 9%, transparent);
}

.callout p {
  color: var(--text);
}

.note {
  font-size: var(--fs-xs);
  color: var(--text-faint);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3);
}

.stat {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
}

.stat__value {
  display: block;
  font-size: var(--fs-xl);
  font-weight: 700;
  line-height: 1.1;
  color: var(--project-accent-text);
  font-variant-numeric: tabular-nums;
}

.stat__label {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}

.data-table caption {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--fs-xs);
  color: var(--text-faint);
  caption-side: bottom;
  border-top: 1px solid var(--border);
}

.data-table th,
.data-table td {
  padding: 0.6rem var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table th {
  color: var(--text);
  font-weight: 600;
  background: var(--surface);
}

.data-table td {
  color: var(--text-muted);
}

.data-table td.num,
.data-table th.num {
  text-align: right;
}

.data-table .is-peak {
  color: var(--project-accent-text);
  font-weight: 600;
}

.chart-box {
  position: relative;
  height: 280px;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.level {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.level--low { color: #38ef7d; background: rgba(56, 239, 125, 0.12); }
.level--mid { color: #ffd166; background: rgba(255, 209, 102, 0.12); }
.level--high { color: #ff8a8a; background: rgba(255, 107, 107, 0.14); }

:root[data-theme="light"] .level--low { color: #11823b; }
:root[data-theme="light"] .level--mid { color: #8a5a00; }
:root[data-theme="light"] .level--high { color: #c23434; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .level--low { color: #11823b; }
  :root:not([data-theme="dark"]) .level--mid { color: #8a5a00; }
  :root:not([data-theme="dark"]) .level--high { color: #c23434; }
}

/* Photo story (fieldwork) ----------------------------------------------- */
.story-hero {
  position: relative;
  display: grid;
  align-items: end;
  min-height: min(78vh, 720px);
  overflow: hidden;
  isolation: isolate;
}

.story-hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.story-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.35) 45%, var(--bg) 100%);
}

.story-hero__content {
  padding-block: var(--space-9) var(--space-7);
}

.story-hero__kicker {
  color: rgba(255, 255, 255, 0.85);
  font-size: var(--fs-sm);
  font-weight: 500;
  margin-bottom: var(--space-3);
}

.story-hero__title {
  max-width: 16ch;
  font-size: var(--fs-display);
  color: #fff;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.4);
}

:root[data-theme="light"] .story-hero__kicker,
:root[data-theme="light"] .story-hero__title { color: var(--text); text-shadow: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .story-hero__kicker,
  :root:not([data-theme="dark"]) .story-hero__title { color: var(--text); text-shadow: none; }
}

.story-section {
  padding-block: var(--space-7);
}

.story-section > h2 {
  font-size: var(--fs-xl);
  margin-bottom: var(--space-5);
}

.story-intro {
  font-size: var(--fs-md);
  line-height: 1.55;
}

.story-intro p {
  color: var(--text);
}

.story-intro p + p {
  margin-top: var(--space-4);
}

.story-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: var(--space-4);
  list-style: none;
}

.story-fact {
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}

.story-fact .icon {
  width: 28px;
  height: 28px;
  margin-bottom: var(--space-3);
  color: var(--accent-text);
}

.story-fact h3 {
  font-size: var(--fs-base);
  margin-bottom: var(--space-2);
}

.story-fact p {
  font-size: var(--fs-sm);
}

.figure {
  margin: 0;
}

.figure img {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.figure figcaption {
  margin-top: var(--space-3);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  text-align: center;
}

.timeline {
  position: relative;
  display: grid;
  gap: var(--space-5);
  list-style: none;
  padding-left: var(--space-6);
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 2px;
  background: var(--gradient);
}

.timeline li {
  position: relative;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: calc(var(--space-6) * -1 + 1px);
  top: 0.45em;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--c-indigo);
}

.timeline h3 {
  font-size: var(--fs-base);
}

.timeline p {
  margin-top: var(--space-1);
  font-size: var(--fs-sm);
}

/* Gallery + lightbox */
.gallery {
  columns: 3 260px;
  column-gap: var(--space-4);
  list-style: none;
}

.gallery figure {
  margin: 0;
}

.gallery__item {
  break-inside: avoid;
  margin-bottom: var(--space-4);
}

.gallery__button {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: left;
  cursor: zoom-in;
}

.gallery__button img {
  width: 100%;
  transition: transform var(--dur-slow) var(--ease-out);
}

.gallery__button:hover img {
  transform: scale(1.03);
}

.gallery__button:focus-visible {
  border-radius: var(--radius-lg);
}

.gallery__caption {
  padding: var(--space-3) var(--space-2) var(--space-2);
}

.gallery__caption strong {
  display: block;
  font-size: var(--fs-sm);
}

.gallery__caption span {
  display: block;
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.94);
  color: #f5f5f7;
}

.lightbox[open] {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.lightbox__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  color: #a1a1a6;
  font-size: var(--fs-sm);
}

.lightbox__stage {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-3);
  min-height: 0;
  padding-inline: var(--space-3);
}

.lightbox__stage img {
  justify-self: center;
  max-width: 100%;
  max-height: calc(100vh - 9rem);
  width: auto;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.lightbox__caption {
  padding: var(--space-3) var(--space-4) var(--space-5);
  text-align: center;
}

.lightbox__caption strong {
  color: #f5f5f7;
}

.lightbox__caption span {
  display: block;
  color: #a1a1a6;
  font-size: var(--fs-sm);
}

.lightbox .icon-btn {
  color: #f5f5f7;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

@media (max-width: 600px) {
  .lightbox__stage {
    grid-template-columns: 1fr;
  }

  .lightbox__stage .icon-btn {
    display: none;
  }
}
