/* ===========================
   ARTS PAGE  |  ZBK PORTFOLIO
   =========================== */
body:has(dialog[open]) {
  overflow: hidden;
}

/* --- Layout Container --- */
body.arts .arts-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

/* --- Kicker (matches about.css) --- */
body.arts .about-kicker {
  text-align: left;
  margin: 48px 0 18px;
  font-family: 'IBM Plex Mono', monospace;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 2px;
  color: var(--text-muted);
}

/* --- Arts Grid Layout --- */
body.arts .arts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  grid-auto-rows: 200px;
  gap: 10px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: 40px;
}

/* Base tile style */
body.arts .work {
  position: relative;
  overflow: hidden;
  background: #0b0c0e;
  height: 100%;
}

body.arts .work img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.25);
  transition: transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: transform;
}

body.arts .work:hover img {
  transform: scale(1.02);
}

/* Overlay info (shown on hover) */
body.arts .overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(0, 0, 0, 0.45);
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease 0.05s;
}

body.arts .work:hover .overlay,
body.arts .work:focus-within .overlay {
  opacity: 1;
  pointer-events: auto;
}

body.arts .overlay .title {
  margin: 0 0 4px;
  font-weight: 600;
  font-size: 0.95rem;
}

body.arts .overlay .meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Clickable area */
body.arts .card-link {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

body.arts .card-link:focus-visible {
  outline: 2px solid var(--accent-violet);
  outline-offset: -2px;
}

/* --- Variable tile sizes --- */
body.arts .work.big {
  grid-column: span 2;
  grid-row: span 2;
}

body.arts .work.wide {
  grid-column: span 2;
}

body.arts .work.tall {
  grid-row: span 2;
}

/* --- Responsive collapse --- */
@media (max-width: 800px) {
  body.arts .arts-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    grid-auto-rows: 180px;
  }

  body.arts .work.big,
  body.arts .work.wide,
  body.arts .work.tall {
    grid-column: span 1;
    grid-row: span 1;
  }
}

/* Hide overlays whenever a lightbox is open */
body:has(dialog.lb[open]) .overlay {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ===========================
   LIGHTBOX — gallery upgrade
   =========================== */

body.arts dialog.lb:not([open]) {
  display: none;
}

/* dialog container */
body.arts dialog.lb {
  width: min(1400px, 94vw);
  max-height: 94vh;
  border: 0;
  padding: 0;
  background: #0b0c0e;
  color: var(--text);
  border-radius: 14px;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.8);
  overflow: auto;
  overscroll-behavior: contain;
  animation: lbFadeIn 0.25s ease;
}

@keyframes lbFadeIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* backdrop */
body.arts dialog.lb::backdrop {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(3px) saturate(110%);
}

/* header */
body.arts .lb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 18, 20, 0.9);
  position: relative;
}

body.arts .lb-title {
  margin: 0;
  font: 600 1.1rem/1.4 'Karla', sans-serif;
  letter-spacing: .3px;
}

body.arts .lb-meta {
  font-size: .85rem;
  color: var(--text-muted);
}

/* ✕ close button */
body.arts .lb-btn-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1rem;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

body.arts .lb-btn-close:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #f5f5f5;
  color: #f5f5f5;
}

/* layout */
body.arts .lb-body {
  display: grid;
  grid-template-columns: 1fr 360px;
  min-height: 600px;
  overflow-y: auto;
  max-height: calc(94vh - 70px);
}

@media (max-width: 940px) {
  body.arts .lb-body {
    grid-template-columns: 1fr;
    max-height: none;
  }
}

/* main image area */
body.arts .lb-view {
  position: relative;
  background: #0d0e10;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.arts .lb-view img {
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
  transition: transform 0.3s ease;
}

/* bottom-centered nav buttons — centered to the image bounds */
body.arts .lb-ctrls {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 3;
  width: min(100%, var(--img-w, 100%));
  pointer-events: none;
  /* allow clicks through except on buttons */
}

body.arts .lb-ctrls .lb-btn {
  pointer-events: auto;
}

body.arts .lb-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1rem;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

body.arts .lb-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #f5f5f5;
  color: #f5f5f5;
}

/* side description */
body.arts .lb-aside {
  background: #0b0c0e;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

body.arts .lb-desc {
  font-size: .95rem;
  line-height: 1.7;
  color: var(--text-muted);
  letter-spacing: 0.1px;
}

/* thumbnails (grid style inside aside) */
body.arts .lb-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
}

body.arts .lb-thumbs button {
  border: none;
  background: transparent;
  cursor: pointer;
  transition: transform 0.2s ease;
}

body.arts .lb-thumbs img {
  width: 100%;
  height: 70px;
  object-fit: cover;
  border-radius: 8px;
  filter: brightness(0.85);
  transition: filter 0.2s ease, transform 0.2s ease;
}

body.arts .lb-thumbs button:hover img {
  filter: brightness(1);
  transform: scale(1.03);
}

/* responsive tweaks */
@media (max-width: 640px) {
  body.arts .lb-aside {
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 18px;
  }

  body.arts .lb-thumbs img {
    height: 60px;
  }
}

@media (max-width: 700px) {
  body.arts .lb-btn {
    padding: 10px 16px;
    font-size: 1.05rem;
  }
}

/* ===== Lightbox template modifiers ===== */

/* A) With explanation (default) */
body.arts dialog.lb.lb--with-desc .lb-body {
  grid-template-columns: 1fr 360px;
}

@media (max-width: 940px) {
  body.arts dialog.lb.lb--with-desc .lb-body {
    grid-template-columns: 1fr;
  }
}

/* B) Gallery-only: no aside, full-width image */
body.arts dialog.lb.lb--gallery-only .lb-body {
  grid-template-columns: 1fr;
}

body.arts dialog.lb.lb--gallery-only .lb-aside {
  display: none !important;
}

/* --- Minimal overview gallery for lb--gallery-only (bottom strip) --- */
body.arts .lb--gallery-only .lb-overview {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 14px 0 18px;
  background: transparent;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

body.arts .lb--gallery-only .lb-overview button {
  background: transparent;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  flex: 0 0 auto;
}

body.arts .lb--gallery-only .lb-overview img {
  width: 90px;
  height: 70px;
  object-fit: cover;
  border-radius: 6px;
  opacity: 0.8;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

body.arts .lb--gallery-only .lb-overview button:hover img {
  transform: scale(1.05);
  opacity: 1;
}

@media (max-width: 700px) {
  body.arts .lb--gallery-only .lb-overview img {
    width: 70px;
    height: 55px;
  }
}

/* === Vertical thumbnail rail (gallery-only) === */
body.arts .lb-view--with-rail {
  position: relative;
  padding-right: 96px;
  /* space for the rail */
}

body.arts .lb-rail-v {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px;
  border-radius: 10px;
  backdrop-filter: blur(6px);
}

body.arts .lb-rail-v button {
  background: transparent;
  border: 0;
  cursor: pointer;
}

body.arts .lb-rail-v img {
  width: 66px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  opacity: 0.85;
  transition: opacity .2s ease, transform .2s ease;
}

body.arts .lb-rail-v button:hover img {
  opacity: 1;
  transform: scale(1.03);
}

/* active thumb highlight (works for any [data-thumbs]) */
body.arts [data-thumbs] button[aria-current="true"] img {
  outline: 2px solid rgba(255, 255, 255, .65);
  outline-offset: 2px;
  opacity: 1;
}

/* collapse rail on narrow screens (and remove any ghost offsets) */
@media (max-width: 940px) {
  body.arts .lb-view--with-rail {
    padding-right: 0;
  }

  body.arts .lb-rail-v {
    display: none;
  }
}