/* =====================================================================
   Dee Photography
   Layout: editorial single page. Big Bodoni headlines on a quiet ground,
   the photographs carry the colour. Category pages open as a full-screen
   layer (index.html#birthdays and so on) with a photo grid and a viewer.
   ===================================================================== */

:root {
  /* colour (light) */
  --bg: #ffffff;
  --bg-alt: #f5f2f4;
  --ink: #1c1820;
  --ink-soft: #5d5664;
  --line: #e7e1e6;
  --accent: #a8234f;
  --accent-hover: #8b1b40;
  --accent-ink: #ffffff;
  --accent-soft: #f8e7ed;
  --header-bg: rgba(255, 255, 255, 0.92);
  --logo-filter: none;

  /* always-dark surfaces: contact band, footer, photo viewer */
  --shade: #151116;
  --shade-2: #1f1a21;
  --on-shade: #f7f2f6;
  --on-shade-soft: #c4bbc6;
  --shade-line: rgba(255, 255, 255, 0.16);
  --shade-hover: rgba(255, 255, 255, 0.08);
  --accent-on-shade: #f08fb2;
  --scrim: rgba(21, 17, 22, 0.84);

  /* type */
  --font-display: "Bodoni Moda", "Bodoni 72", Didot, "Hoefler Text", Georgia, serif;
  --font-body: "Hanken Grotesk", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --step--1: 0.8125rem;
  --step-0: 1.0625rem;
  --step-1: clamp(1.125rem, 1.05rem + 0.35vw, 1.3rem);
  --step-2: clamp(1.4rem, 1.15rem + 0.9vw, 1.8rem);
  --step-3: clamp(2.15rem, 1.5rem + 2.8vw, 3.6rem);
  --step-4: clamp(2.7rem, 1.5rem + 5.2vw, 5.75rem);

  /* space */
  --wrap: 1280px;
  --gutter-l: max(clamp(16px, 4vw, 40px), env(safe-area-inset-left, 0px));
  --gutter-r: max(clamp(16px, 4vw, 40px), env(safe-area-inset-right, 0px));
  --section: clamp(4rem, 2.5rem + 6vw, 8rem);
  --header-h: 68px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121014;
    --bg-alt: #1a171c;
    --ink: #f3eff4;
    --ink-soft: #aca4b1;
    --line: #2e2932;
    --accent: #e36d95;
    --accent-hover: #ef8aac;
    --accent-ink: #1b0c13;
    --accent-soft: #3a1f2b;
    --header-bg: rgba(18, 16, 20, 0.92);
    --logo-filter: invert(1);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121014;
  --bg-alt: #1a171c;
  --ink: #f3eff4;
  --ink-soft: #aca4b1;
  --line: #2e2932;
  --accent: #e36d95;
  --accent-hover: #ef8aac;
  --accent-ink: #1b0c13;
  --accent-soft: #3a1f2b;
  --header-bg: rgba(18, 16, 20, 0.92);
  --logo-filter: invert(1);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
p, figure { margin: 0; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 200; padding: 10px 14px; background: var(--bg); color: var(--ink); }
.skip:focus { left: var(--gutter-l); }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}
.section { padding-block: var(--section); }
.band { background: var(--bg-alt); }
section[id], #cv-title { scroll-margin-top: calc(var(--header-h) + 12px); }

/* ---------- type ---------- */
h1, h2 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.012em;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h1 em, h2 em { font-style: italic; color: var(--accent); }
h3 { font-size: var(--step-1); font-weight: 600; line-height: 1.3; }
.eyebrow {
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.lead { font-size: var(--step-1); color: var(--ink-soft); max-width: 38em; line-height: 1.55; }
.small { font-size: 0.9375rem; }

.section-head { display: grid; gap: 1rem; max-width: 48rem; margin-bottom: clamp(2rem, 1.5rem + 2.5vw, 3.75rem); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 50px;
  padding: 0 1.5em;
  border: 1.5px solid transparent;
  border-radius: 2px;
  font: 600 1rem/1.1 var(--font-body);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-sm { min-height: 40px; padding: 0 1.1em; font-size: 0.9375rem; }
@media (hover: hover) {
  .btn-primary:hover { background: var(--accent-hover); }
  .btn-ghost:hover { background: var(--ink); color: var(--bg); }
}

/* ---------- header ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 60;
  background: var(--bg);
}
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: var(--header-h); }

.logo { flex: none; display: inline-flex; align-items: center; text-decoration: none; }
/* the logo file is black on see-through; --logo-filter turns it white in dark mode */
.logo-img { display: block; width: auto; height: 50px; filter: var(--logo-filter); }

.site-nav { display: flex; align-items: center; gap: clamp(18px, 2.2vw, 34px); }
.site-nav a:not(.btn) { text-decoration: none; font-weight: 500; font-size: 0.975rem; color: var(--ink-soft); transition: color 0.2s; }
@media (hover: hover) { .site-nav a:not(.btn):hover { color: var(--ink); } }

.menu-btn {
  display: none;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--ink);
  font: 600 0.9375rem/1 var(--font-body);
  cursor: pointer;
}
.menu-icon { position: relative; width: 20px; height: 12px; }
.menu-icon::before, .menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
  transition: transform 0.25s, top 0.25s;
}
.menu-icon::before { top: 0; }
.menu-icon::after { top: 10px; }
.menu-open .menu-icon::before { top: 5px; transform: rotate(45deg); }
.menu-open .menu-icon::after { top: 5px; transform: rotate(-45deg); }

@media (max-width: 759px) {
  :root { --header-h: 60px; }
  .logo-img { height: 42px; }
  .menu-btn { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 4px var(--gutter-r) 20px var(--gutter-l);
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px -24px rgba(0, 0, 0, 0.45);
  }
  .menu-open .site-nav { display: flex; }
  .site-nav a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 1.125rem; color: var(--ink); }
  .site-nav .btn { margin-top: 16px; min-height: 50px; }
}

/* ---------- hero ---------- */
.hero { padding-block: clamp(2rem, 1rem + 4vw, 5rem) clamp(3rem, 2rem + 4vw, 5.5rem); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 1rem + 5vw, 6rem);
  align-items: center;
}
.hero-copy { display: grid; gap: clamp(1.1rem, 0.8rem + 1vw, 1.75rem); justify-items: start; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 0.25rem; }

.hero-photos {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(8px, 0.3rem + 0.6vw, 14px);
}
.hp { position: relative; overflow: hidden; background: var(--bg-alt); }
.hp img { width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; }
.hp-1 { grid-row: span 2; min-height: 240px; }
.hp-1 img { position: absolute; inset: 0; }
.hp-2, .hp-3 { aspect-ratio: 4 / 3.3; }
.hp-2 img { object-position: 64% 50%; }

.facts {
  list-style: none;
  margin: clamp(2.5rem, 2rem + 3vw, 4.5rem) 0 0;
  padding: 1.5rem 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem 2rem;
  border-top: 1px solid var(--line);
}
.facts li { display: grid; gap: 0.35rem; align-content: start; min-width: 0; }
.fact-k { font-size: var(--step--1); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }
.fact-v { font-family: var(--font-display); font-size: var(--step-2); line-height: 1.15; }

@media (max-width: 859px) {
  .hero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 599px) {
  .facts { grid-template-columns: 1fr 1fr; }
  .facts li:last-child { grid-column: 1 / -1; }
}

/* ---------- about ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 1rem + 5vw, 6rem);
  align-items: start;
}
.about-copy { display: grid; gap: 1.25rem; max-width: 40rem; }
.about-copy p { color: var(--ink-soft); }
.about-copy .about-first { color: var(--ink); font-size: var(--step-1); line-height: 1.55; }
.where {
  display: grid;
  gap: 1rem;
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  background: var(--bg);
  border: 1px solid var(--line);
}
.where h3 { font-family: var(--font-display); font-weight: 500; font-size: var(--step-2); }
.where p { color: var(--ink-soft); }
.towns { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.towns li { padding: 0.35rem 0.85rem; border: 1px solid var(--line); border-radius: 999px; font-size: 0.9375rem; font-weight: 500; }
.towns .home { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
@media (max-width: 859px) { .about-grid { grid-template-columns: 1fr; } }

/* ---------- services ---------- */
.service-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.75rem, 1rem + 2vw, 2.75rem) clamp(1rem, 0.5rem + 1.5vw, 1.75rem);
}
.service { display: grid; grid-template-rows: auto 1fr; min-width: 0; }
.service-img { aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-alt); }
.service-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
.service-body { display: grid; gap: 0.5rem; align-content: start; padding-top: 1.1rem; }
.service-body p { color: var(--ink-soft); font-size: 1rem; }
.service-link { justify-self: start; margin-top: 0.15rem; font-weight: 600; color: var(--accent); text-decoration: none; }
.service-link::after { content: " \2192"; }
@media (hover: hover) {
  .service:hover .service-img img { transform: scale(1.04); }
  .service-link:hover { text-decoration: underline; text-underline-offset: 3px; }
}
.service--more { grid-template-rows: auto; align-content: center; padding: clamp(1.5rem, 1rem + 1.5vw, 2.25rem); background: var(--accent-soft); }
.service--more .service-body { padding-top: 0; }
.service--more h3 { font-family: var(--font-display); font-weight: 500; font-size: var(--step-2); }
.service--more p { color: var(--ink); }

@media (max-width: 999px) { .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) {
  .service-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .service { grid-template-columns: 112px minmax(0, 1fr); grid-template-rows: auto; gap: 16px; align-items: start; }
  .service-img { aspect-ratio: 1; }
  .service-body { padding-top: 0; }
  .service--more { grid-template-columns: 1fr; }
}

.price-note {
  margin-top: clamp(2.5rem, 2rem + 2vw, 4rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2.5rem;
  padding: clamp(1.5rem, 1rem + 2vw, 2.75rem);
  border: 1px solid var(--ink);
}
.price-note > div { flex: 1 1 22rem; min-width: 0; display: grid; gap: 0.5rem; }
.price-note h3 { font-family: var(--font-display); font-weight: 500; font-size: var(--step-2); }
.price-note p { color: var(--ink-soft); max-width: 54ch; }

/* ---------- portfolio categories ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(10px, 0.4rem + 0.9vw, 20px); }
.cat-card {
  position: relative;
  display: block;
  grid-column: span 2;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--shade);
  color: var(--on-shade);
  text-decoration: none;
  isolation: isolate;
}
.cat-card--wide { grid-column: span 3; aspect-ratio: 3 / 2; }
.cat-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.cat-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, var(--scrim) 0%, transparent 58%);
}
.cat-info { position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: 2px; padding: clamp(14px, 0.6rem + 1.2vw, 30px); }
.cat-title { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.45rem, 1rem + 1.8vw, 2.6rem); line-height: 1.05; }
.cat-meta { font-size: 0.875rem; color: var(--on-shade-soft); }
.cat-go {
  justify-self: start;
  margin-top: 0.6rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}
.cat-go::after { content: " \2192"; }
@media (hover: hover) { .cat-card:hover img { transform: scale(1.045); } }
.cat-card:focus-visible { outline-offset: 4px; }

@media (max-width: 759px) {
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat-card, .cat-card--wide { grid-column: span 1; aspect-ratio: 4 / 5; }
  .cat-card:first-child { grid-column: 1 / -1; aspect-ratio: 3 / 2; }
  .cat-go { display: none; }
}

/* ---------- contact ---------- */
.contact { background: var(--shade); color: var(--on-shade); border-top: 1px solid var(--line); }
.contact .eyebrow { color: var(--accent-on-shade); }
.contact .lead { color: var(--on-shade-soft); }
.contact :focus-visible { outline-color: var(--on-shade); }
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 1rem + 5vw, 6rem);
  align-items: end;
}
.contact-grid > div:first-child { display: grid; gap: 1.1rem; }
.contact-buttons { display: grid; gap: 12px; margin-top: 1rem; max-width: 32rem; }
.contact-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid var(--shade-line);
  color: var(--on-shade);
  text-decoration: none;
  transition: background-color 0.2s, border-color 0.2s;
}
.contact-btn svg { flex: none; width: 28px; height: 28px; fill: currentColor; }
.contact-btn strong { display: block; font-weight: 600; font-size: 1.0625rem; line-height: 1.3; }
.contact-btn span { min-width: 0; }
.contact-btn small { display: block; color: var(--on-shade-soft); font-size: 0.875rem; overflow-wrap: anywhere; }
.contact-btn::after { content: "\2197"; margin-left: auto; color: var(--on-shade-soft); font-size: 1.1rem; }
@media (hover: hover) { .contact-btn:hover { background: var(--shade-hover); border-color: var(--on-shade-soft); } }

.contact-card { display: grid; gap: 1.1rem; padding: clamp(1.5rem, 1rem + 2vw, 2.25rem); background: var(--shade-2); border: 1px solid var(--shade-line); }
.contact-card h3 { font-family: var(--font-display); font-weight: 500; font-size: var(--step-2); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.65rem; }
.checklist li { display: flex; gap: 0.8rem; }
.checklist li::before { content: ""; flex: none; width: 7px; height: 7px; margin-top: 0.62em; border-radius: 50%; background: var(--accent-on-shade); }
.contact-where { padding-top: 1rem; border-top: 1px solid var(--shade-line); color: var(--on-shade-soft); font-size: 0.9375rem; }
@media (max-width: 859px) { .contact-grid { grid-template-columns: 1fr; align-items: start; } }

/* ---------- footer ---------- */
.site-footer {
  background: var(--shade);
  color: var(--on-shade-soft);
  border-top: 1px solid var(--shade-line);
  padding-block: 2rem calc(2rem + env(safe-area-inset-bottom, 0px));
  font-size: 0.9375rem;
}
.footer-grid { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; }
.site-footer .logo-img { height: 64px; filter: invert(1); }
@media (max-width: 759px) { .site-footer .logo-img { height: 56px; } }
.site-footer :focus-visible { outline-color: var(--on-shade); }
.footer-social { display: flex; gap: 10px; }
.footer-social a { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--shade-line); border-radius: 50%; color: var(--on-shade); }
.footer-social svg { width: 18px; height: 18px; fill: currentColor; }
@media (hover: hover) { .footer-social a:hover { background: var(--shade-hover); } }
.copy { flex-basis: 100%; font-size: 0.8125rem; }

/* ---------- category page ---------- */
.cv-open, .cv-open body { overflow: hidden; }
.catview {
  position: fixed;
  inset: 0;
  z-index: 80;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.cv-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.cv-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.cv-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; text-decoration: none; }
.cv-back svg { width: 20px; height: 20px; }
.logo--small .logo-img { height: 38px; }
.cv-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.cv-tabs::-webkit-scrollbar { display: none; }
.cv-tabs a {
  flex: none;
  padding: 7px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.cv-tabs a.is-active { background: var(--ink); border-color: var(--ink); color: var(--bg); }
@media (hover: hover) { .cv-tabs a:not(.is-active):hover { border-color: var(--ink-soft); color: var(--ink); } }
@media (max-width: 519px) { .logo--small { display: none; } }

.cv-head { display: grid; gap: 0.8rem; max-width: 46rem; padding-block: clamp(1.75rem, 1rem + 3vw, 3.75rem) clamp(1.25rem, 1rem + 1.5vw, 2.5rem); }
.cv-head h2:focus { outline: none; }
.cv-meta { font-size: 0.9375rem; font-weight: 500; color: var(--ink-soft); }

.masonry { --m-gap: clamp(6px, 0.2rem + 0.7vw, 14px); display: flex; align-items: flex-start; gap: var(--m-gap); }
.m-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--m-gap); }
.tile {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: var(--bg-alt);
  cursor: zoom-in;
}
.tile img { width: 100%; height: auto; transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); -webkit-user-drag: none; -webkit-touch-callout: none; }
@media (hover: hover) { .tile:hover img { transform: scale(1.03); } }

.cv-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  margin-top: clamp(2.5rem, 2rem + 2vw, 4rem);
  padding-block: clamp(2rem, 1.5rem + 2vw, 3rem) clamp(3rem, 2rem + 3vw, 5rem);
  border-top: 1px solid var(--line);
}
.cv-foot h3 { font-family: var(--font-display); font-weight: 500; font-size: var(--step-2); }
.cv-foot p { color: var(--ink-soft); }
.cv-foot-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- photo viewer ---------- */
.lb-open, .lb-open body { overflow: hidden; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  background: var(--shade);
  color: var(--on-shade);
}
.lightbox :focus-visible { outline-color: var(--on-shade); }
.lb-stage {
  display: grid;
  /* fixed tracks so the photo's max-width/max-height have a real size to resolve against */
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
  min-height: 0;
  padding: max(64px, calc(env(safe-area-inset-top, 0px) + 56px)) max(8px, env(safe-area-inset-right, 0px)) 8px max(8px, env(safe-area-inset-left, 0px));
}
.lb-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  transition: opacity 0.25s;
}
.lb-img.is-loading { opacity: 0.35; }
.lb-bar {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 12px;
  padding: 10px max(12px, env(safe-area-inset-right, 0px)) max(14px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
}
.lb-caption { grid-column: 2; display: grid; gap: 2px; text-align: center; }
.lb-label { font-weight: 500; }
.lb-count { font-size: 0.8125rem; letter-spacing: 0.08em; color: var(--on-shade-soft); font-variant-numeric: tabular-nums; }
.lb-btn {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--shade-hover);
  color: var(--on-shade);
  cursor: pointer;
  transition: background-color 0.2s;
}
.lb-btn svg { width: 24px; height: 24px; }
@media (hover: hover) { .lb-btn:hover { background: var(--shade-line); } }
.lb-prev { grid-column: 1; grid-row: 1; }
.lb-next { grid-column: 3; grid-row: 1; }
.lb-close { position: absolute; top: max(12px, env(safe-area-inset-top, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); }

@media (min-width: 760px) {
  .lb-stage { padding-inline: max(96px, env(safe-area-inset-left, 0px)) max(96px, env(safe-area-inset-right, 0px)); }
  .lb-prev, .lb-next { position: absolute; top: 50%; width: 56px; height: 56px; transform: translateY(-50%); }
  .lb-prev { left: max(20px, env(safe-area-inset-left, 0px)); }
  .lb-next { right: max(20px, env(safe-area-inset-right, 0px)); }
}

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
