/* Tally Toolkits product page — uses the kalai.one dark palette. */

.product-hero {
  padding: 52px 0 48px;
}

.product-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 38px;
  align-items: center;
}

.product-hero-grid > *,
.gallery > .shot,
.dialog-gallery > .shot,
.shot-img {
  min-width: 0;
}

.product-hero-shot img,
.shot-img img {
  max-width: 100%;
}

.product-hero h1 {
  margin-top: 4px;
}

.product-hero .lead {
  max-width: 58ch;
}

.product-hero-shot {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.product-hero-shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 9px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.dialog-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.shot {
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg2);
  transition: border-color 0.15s, transform 0.15s;
}

.shot:hover {
  border-color: #30363d;
  transform: translateY(-2px);
}

.shot-img {
  position: relative;
  overflow: hidden;
  border-radius: 9px;
  background: var(--bg);
  aspect-ratio: 1800 / 1103;
}

.shot-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shot figcaption {
  padding: 10px 6px 3px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.shot figcaption strong {
  display: block;
  margin-bottom: 2px;
  color: var(--fg);
  font-size: 0.94rem;
}

.dialog-shot .shot-img {
  aspect-ratio: 4 / 3;
  background: radial-gradient(60% 70% at 50% 30%, var(--bg2), var(--bg));
}

.dialog-shot .shot-img img {
  object-fit: contain;
  padding: 18px;
}

.shot-link {
  position: absolute;
  inset: 0;
  display: block;
  text-decoration: none;
  cursor: zoom-in;
}

.shot-link:hover {
  text-decoration: none;
}

.shot-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 9px;
}

.shot-zoom {
  position: absolute;
  right: 9px;
  bottom: 9px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(13, 17, 23, 0.86);
  color: var(--fg);
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.18s, transform 0.18s;
  pointer-events: none;
}

.shot-zoom svg {
  width: 13px;
  height: 13px;
}

.shot-link:hover .shot-zoom,
.shot-link:focus-visible .shot-zoom {
  opacity: 1;
  transform: none;
}

@media (hover: none) {
  .shot-zoom {
    opacity: 1;
    transform: none;
  }
}

body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 10, 0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.lightbox-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(1400px, 100%);
  max-height: 94vh;
  overflow-y: auto;
  padding: 4px;
}

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--fg);
  font-size: 0.8rem;
}

.lightbox-counter {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lightbox-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lightbox-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.lightbox-btn:hover {
  border-color: var(--accent);
  background: rgba(88, 166, 255, 0.12);
}

.lightbox-btn:disabled {
  opacity: 0.32;
  cursor: default;
}

.lightbox-btn svg {
  width: 18px;
  height: 18px;
}

.lightbox-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 0;
}

.lightbox-image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 74vh;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.lightbox-figure figcaption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  max-width: 900px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
  text-align: center;
}

.lightbox-figure strong {
  color: var(--fg);
  font-size: 1rem;
}

.lightbox-original {
  margin-top: 2px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.76rem;
}

@media (max-width: 900px) {
  .product-hero-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .product-hero {
    padding: 44px 0 40px;
  }
}

@media (max-width: 700px) {
  .gallery,
  .dialog-gallery {
    grid-template-columns: 1fr;
  }

  .dialog-shot .shot-img {
    min-height: 0;
  }

  .dialog-shot .shot-img img {
    padding: 12px;
  }

  .lightbox {
    padding: 10px;
  }

  .lightbox-btn {
    width: 34px;
    height: 34px;
  }

  .lightbox-image {
    max-height: 68vh;
  }
}

.lightbox-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

:root[data-theme="light"] .product-hero-shot {
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
}
