:root {
  --bg: #0d0d0f;
  --panel: #17171b;
  --panel-soft: #202026;
  --text: #f5f3ef;
  --muted: #aaa6a0;
  --muted-2: #7f7a73;
  --line: rgba(255, 255, 255, 0.11);
  --accent: #f0d28a;
  --accent-text: #1a1305;
  --danger: #ff6b6b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --max-width: 1320px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(240, 210, 138, 0.12), transparent 34rem),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.06), transparent 30rem),
    var(--bg);
}

body.lightbox-open {
  overflow: hidden;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

.page-shell {
  width: min(100% - 32px, var(--max-width));
  margin: 0 auto;
  padding: 56px 0 80px;
}

.gallery-header {
  display: grid;
  gap: 16px;
  margin-bottom: 34px;
}

.gallery-kicker {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gallery-title {
  max-width: 980px;
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 5.8rem);
  line-height: 0.94;
  letter-spacing: -0.065em;
}

.gallery-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
}

.gallery-description {
  max-width: 720px;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  line-height: 1.55;
}

.gallery-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.gallery-link {
  display: grid;
  gap: 4px;
  min-width: min(100%, 280px);
  max-width: 360px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.045);
  text-decoration: none;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.gallery-link:hover {
  transform: translateY(-2px);
  border-color: rgba(240, 210, 138, 0.55);
  background: rgba(255, 255, 255, 0.075);
}

.gallery-link-label {
  font-weight: 750;
}

.gallery-link-description {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.status-panel {
  margin: 22px 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
}

.status-panel[hidden] {
  display: none;
}

.status-panel.is-error {
  color: var(--danger);
  border-color: rgba(255, 107, 107, 0.36);
  background: rgba(255, 107, 107, 0.08);
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 18px;
}

.image-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.22);
}

.image-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: zoom-in;
}

.image-thumb-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--panel-soft);
}

.image-thumb {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition:
    transform 220ms ease,
    opacity 220ms ease;
}

.image-card:hover .image-thumb {
  transform: scale(1.035);
}

.image-footer {
  display: grid;
  gap: 10px;
  padding: 14px 14px 16px;
}

.image-name {
  overflow: hidden;
  font-size: 0.95rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted-2);
  font-size: 0.78rem;
}

.image-actions {
  display: flex;
  gap: 10px;
  margin-top: 2px;
}

.button,
.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 150ms ease,
    background 150ms ease,
    border-color 150ms ease;
}

.button:hover,
.small-button:hover {
  transform: translateY(-1px);
}

.small-button {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 700;
}

.button {
  min-height: 42px;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 750;
}

.button-primary,
.small-button-primary {
  color: var(--accent-text);
  background: var(--accent);
}

.button-secondary,
.small-button-secondary {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.075);
}

.lightbox[hidden] {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(18px);
  cursor: zoom-out;
}

.lightbox-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 1180px);
  max-height: min(92vh, 980px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(18, 18, 22, 0.96);
  box-shadow: var(--shadow);
}

.lightbox-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.lightbox-title {
  max-width: 70vw;
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lightbox-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.84rem;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
  cursor: pointer;
  font-size: 1.7rem;
  line-height: 1;
}

.lightbox-image-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 18px;
  background: #070708;
}

.lightbox-image {
  max-width: 100%;
  max-height: calc(92vh - 180px);
  display: block;
  object-fit: contain;
}

.nav-button {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 44px;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.38);
  cursor: pointer;
  font-size: 2.5rem;
  line-height: 1;
  transform: translateY(-50%);
}

.nav-button-left {
  left: 16px;
}

.nav-button-right {
  right: 16px;
}

.lightbox-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 22px, var(--max-width));
    padding-top: 34px;
  }

  .gallery-title {
    letter-spacing: -0.045em;
  }

  .gallery-link {
    max-width: none;
  }

  .lightbox {
    padding: 10px;
  }

  .lightbox-panel {
    max-height: 96vh;
  }

  .lightbox-image-wrap {
    padding: 10px;
  }

  .lightbox-image {
    max-height: calc(96vh - 190px);
  }

  .nav-button {
    width: 38px;
    height: 54px;
    font-size: 2rem;
  }

  .lightbox-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }
}

.media-card-video .image-thumb-wrap {
  background: #050506;
}

.video-thumb {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.media-type-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-text);
  background: var(--accent);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
}

.media-card-video .image-thumb-wrap::before {
  content: "▶";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.46);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.media-card-video:hover .video-thumb {
  transform: scale(1.035);
}

.lightbox-video {
  max-width: 100%;
  max-height: calc(92vh - 180px);
  display: block;
  object-fit: contain;
  background: #000;
}

.lightbox-video[hidden] {
  display: none;
}

@media (max-width: 720px) {
  .lightbox-video {
    max-height: calc(96vh - 190px);
  }
}

.gallery-sections {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.gallery-sections[hidden] {
  display: none;
}

.gallery-section-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.88rem;
  font-weight: 750;
  text-decoration: none;
  transition:
    transform 150ms ease,
    color 150ms ease,
    background 150ms ease,
    border-color 150ms ease;
}

.gallery-section-link:hover {
  transform: translateY(-1px);
  color: var(--text);
  border-color: rgba(240, 210, 138, 0.48);
  background: rgba(255, 255, 255, 0.075);
}

.gallery-section-link.is-active {
  color: var(--accent-text);
  border-color: transparent;
  background: var(--accent);
}
