/* =============================================
   COCOCURE PHOTO GALLERIES
   Any page whose content has a .coco-gallery-grid (e.g.
   /cococure-haus-stratford-gallery/). Sits inside the editorial
   .coco-content-page / .cp-container layout from coco-content.css.
   The lightbox is js/coco-gallery.js.
   ============================================= */

/* ── Grid ─────────────────────────────────────── */
.coco-content-page .coco-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  grid-auto-rows: 210px;
  grid-auto-flow: dense;
  gap: 12px;
  margin: 8px 0 0;
}
.coco-content-page .coco-gallery-grid .coco-gg-item {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: zoom-in;
}
.coco-content-page .coco-gallery-grid .coco-gg-item--tall { grid-row: span 2; }
.coco-content-page .coco-gallery-grid .coco-gg-link {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  cursor: zoom-in;
}
.coco-content-page .coco-gallery-grid .coco-gg-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.97) contrast(1.04);
  transition: transform .5s ease, filter .3s ease;
}
.coco-content-page .coco-gallery-grid .coco-gg-item:hover img { transform: scale(1.035); filter: saturate(1.05) contrast(1.05); }
.coco-content-page .coco-gallery-grid .coco-gg-item:focus-within,
.coco-content-page .coco-gallery-grid .coco-gg-item:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.coco-content-page .coco-gallery-grid .coco-gg-link:focus { outline: none; }

/* ── 3D tour ──────────────────────────────────── */
.coco-content-page .coco-gallery-tour { padding-top: 0; }
.coco-content-page .coco-gallery-tour-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
}
.coco-content-page .coco-gallery-tour-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Gallery CTA: buttons sit side by side and wrap cleanly on a phone. */
.coco-content-page .cp-close .cp-btn { margin: 6px; }

@media (max-width: 640px) {
  .coco-content-page .coco-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 160px;
    gap: 8px;
  }
  .coco-content-page .coco-gallery-grid .coco-gg-item { border-radius: 10px; }
  .coco-content-page .coco-gallery-tour-frame { aspect-ratio: 4 / 5; }
}

/* ── Lightbox ─────────────────────────────────── */
html.coco-lb-open { overflow: hidden; }
dialog.coco-lb {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(6,6,6,0.96);
  color: #FAF7F0;
  overflow: hidden;
}
dialog.coco-lb::backdrop { background: rgba(0,0,0,0.85); }
dialog.coco-lb[open] { display: flex; align-items: center; justify-content: center; }
.coco-lb-stage {
  margin: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 84px;
  box-sizing: border-box;
}
.coco-lb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  user-select: none;
  -webkit-user-drag: none;
}
.coco-lb-btn {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(250,247,240,0.3);
  background: rgba(10,10,10,0.55);
  color: #FAF7F0;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.coco-lb-btn:hover,
.coco-lb-btn:focus-visible { border-color: #c9a96e; color: #c9a96e; outline: none; }
.coco-lb-btn svg { width: 20px; height: 20px; }
.coco-lb-close { top: 16px; right: 16px; }
.coco-lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.coco-lb-next { right: 20px; top: 50%; transform: translateY(-50%); }
.coco-lb-count {
  position: absolute;
  top: 30px;
  left: 24px;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: rgba(250,247,240,0.6);
}
@media (max-width: 640px) {
  .coco-lb-stage { padding: 64px 10px 88px; }
  .coco-lb-prev,
  .coco-lb-next { top: auto; bottom: 20px; transform: none; }
  .coco-lb-prev { left: calc(50% - 60px); }
  .coco-lb-next { right: calc(50% - 60px); }
}

/* ── Venue galleries: /gallery/ hub + /gallery/<venue>/ (inc/venue-galleries.php) ── */
.coco-content-page.coco-vgal .coco-vgal-head { padding-top: 48px; }
.coco-content-page .coco-vgal-crumbs {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 18px;
}
.coco-content-page .coco-vgal-crumbs a { border-bottom: 0; color: var(--gold); }

.coco-content-page .coco-vgal-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
}
.coco-content-page button.coco-vgal-tab {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid rgba(250,247,240,0.2);
  background: transparent;
  color: var(--cream);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, color .2s ease;
}
.coco-content-page button.coco-vgal-tab:hover { border-color: var(--gold); }
.coco-content-page button.coco-vgal-tab[aria-selected="true"] {
  background: var(--gold);
  border-color: var(--gold);
  color: #120d08;
}
.coco-content-page button.coco-vgal-tab:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.coco-content-page .coco-vgal-count {
  font-family: var(--mono);
  font-size: 11px;
  opacity: 0.7;
}
/* Without JS every set is shown with its own heading; with tabs the heading
   is the selected tab, so it is hidden. */
.coco-content-page .coco-vgal-panel + .coco-vgal-panel { margin-top: 48px; }
.coco-content-page .coco-vgal-panel-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 28px;
  margin: 0 0 16px;
  color: var(--cream);
}
.coco-content-page.coco-vgal--tabbed .coco-vgal-panel-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.coco-content-page.coco-vgal--tabbed .coco-vgal-panel + .coco-vgal-panel { margin-top: 0; }
.coco-content-page .coco-vgal-panel[hidden] { display: none; }
.coco-content-page .coco-vgal-others {
  margin: 28px auto 0 !important;
  font-size: 14px;
}

/* Hub cards */
.coco-content-page .coco-vgal-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.coco-content-page a.coco-vgal-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  color: var(--cream);
  border-bottom: 1px solid var(--border);
  transition: border-color .2s ease, transform .2s ease;
}
.coco-content-page a.coco-vgal-card:hover { border-color: rgba(201,169,110,0.5); transform: translateY(-2px); }
.coco-vgal-card__img { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #1a1612; }
.coco-vgal-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.coco-content-page a.coco-vgal-card:hover .coco-vgal-card__img img { transform: scale(1.04); }
.coco-vgal-card__body { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px 20px; }
.coco-vgal-card__name { font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 1.1; color: var(--cream); }
.coco-vgal-card__meta { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.coco-vgal-card__cta { margin-top: 6px; font-size: 14px; color: var(--gold); }

@media (max-width: 760px) {
  .coco-content-page.coco-vgal .coco-vgal-head { padding-top: 28px; }
  .coco-content-page .coco-vgal-cards { grid-template-columns: 1fr; gap: 14px; }
  .coco-vgal-card__img { aspect-ratio: 16 / 9; }
  .coco-content-page .coco-vgal-tabs { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; margin-left: -4px; padding: 0 4px 4px; scrollbar-width: none; }
  .coco-content-page .coco-vgal-tabs::-webkit-scrollbar { display: none; }
  .coco-content-page button.coco-vgal-tab { flex: none; padding: 0 16px; }
}
