/* ------------------------------------------------------------------
   Memorial site default theme.
   Everything flows from these variables — override them in
   Admin → Theme (served as /custom.css) to restyle the whole site.
------------------------------------------------------------------- */
:root {
  --bg: #faf8f3;
  --surface: #ffffff;
  --ink: #33312c;
  --muted: #75705f;
  --accent: #7d6939;
  --rule: #e4ddcf;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, 'Segoe UI', sans-serif;
  --max-width: 52rem;
}

* { box-sizing: border-box; }

/* Author display rules outrank the browser's own [hidden] rule, so anything given a
   display value would ignore the attribute. Keep hidden meaning hidden. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.65;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

a { color: var(--accent); }
a:hover { opacity: 0.85; }

h1, h2, h3, .site-title {
  font-family: var(--serif);
  font-weight: 500;
  color: var(--ink);
  line-height: 1.25;
}

/* Header ---------------------------------------------------------- */
.site-header {
  padding: 2.5rem 0 1.25rem;
  text-align: center;
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}

.site-title {
  font-size: 2.1rem;
  text-decoration: none;
  color: var(--ink);
  display: inline-block;
}

.site-tagline {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-family: var(--serif);
  font-style: italic;
}

.site-nav {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1.4rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover { border-bottom-color: var(--accent); opacity: 1; }

.site-nav .nav-cta {
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0.15rem 0.85rem;
}

.site-nav .nav-cta:hover { background: var(--accent); color: var(--surface); border-bottom-color: transparent; }

/* Main ------------------------------------------------------------ */
main.container { padding-top: 2.25rem; padding-bottom: 3rem; }

.page-title { font-size: 1.8rem; margin: 0 0 0.75rem; }
.page-intro { color: var(--muted); margin-top: 0; }
.empty-note { color: var(--muted); font-style: italic; }

.prose img { max-width: 100%; height: auto; border-radius: 6px; }
.prose h1, .prose h2, .prose h3 { margin-top: 1.75em; }
.prose blockquote {
  margin: 1.25rem 0;
  padding: 0.25rem 1.25rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-family: var(--serif);
  font-style: italic;
}

.home-section { margin-top: 3rem; }
.home-section h2 {
  font-size: 1.35rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.4rem;
}

.more-link { text-decoration: none; font-size: 0.95rem; }
.invite {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.5rem;
  font-family: var(--serif);
  font-size: 1.1rem;
}

/* Memories -------------------------------------------------------- */
.memory-card {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
}

.memory-text {
  margin: 0 0 0.75rem;
  white-space: pre-line;
  font-family: var(--serif);
  font-size: 1.1rem;
}

.memory-card footer {
  color: var(--muted);
  font-size: 0.9rem;
}

.memory-card footer time { margin-left: 0.5rem; }

.memory-photo img {
  max-width: 240px;
  max-height: 240px;
  border-radius: 6px;
  float: right;
  margin: 0 0 0.75rem 1rem;
}

.memory-card::after { content: ""; display: block; clear: both; }

.memory-pinned {
  border-color: var(--accent);
  border-width: 2px;
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}

.pinned-label {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.15rem 0.7rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Gallery --------------------------------------------------------- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.photo-grid-small { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

.photo-card { margin: 0; }

.photo-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.photo-card figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

/* Forms ----------------------------------------------------------- */
.form { max-width: 38rem; }
.form-narrow { max-width: 22rem; }

.form label {
  display: block;
  margin: 1.1rem 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.form input[type="text"], .form input[type="password"], .form input[type="number"],
.form input:not([type]), .form textarea {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.55rem 0.7rem;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
}

.form input:focus, .form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.form textarea { resize: vertical; }

.checkbox-label { display: flex; align-items: center; gap: 0.5rem; }
.checkbox-label input { width: auto; }

.field-pair { display: flex; gap: 2rem; align-items: center; }
.field-error { color: #a33; font-size: 0.85rem; }
.hint { color: var(--muted); font-size: 0.9rem; }

/* Honeypot: visually removed but present for bots. */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* Buttons --------------------------------------------------------- */
.btn {
  display: inline-block;
  font: inherit;
  font-size: 0.95rem;
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}

.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-danger { color: #a33; border-color: #d8b5b5; }
.btn-sm { padding: 0.25rem 0.75rem; font-size: 0.85rem; }
.btn-link { border: none; background: none; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }
.btn:hover { opacity: 0.9; }

/* Notices --------------------------------------------------------- */
.notice { border-radius: 6px; padding: 0.9rem 1.2rem; margin: 1rem 0; }
.notice p { margin: 0.25rem 0; }
.notice-success { background: #eef4ea; border: 1px solid #c4d6bb; }
.notice-error { background: #f7ecec; border: 1px solid #ddb9b9; color: #802f2f; }
.notice-error ul { margin: 0.25rem 0; padding-left: 1.25rem; }

/* Footer ---------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 1.5rem 0 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer .footer-meta a { color: var(--muted); }

/* Admin ----------------------------------------------------------- */
.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  align-items: center;
  padding: 0.6rem 1rem;
  margin-bottom: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  font-size: 0.95rem;
}

.admin-nav a { text-decoration: none; }
.admin-nav form { margin-left: auto; }
.inline-form { display: inline; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.stat-tile {
  display: block;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
}

.stat-tile .stat-number { display: block; font-size: 2rem; font-family: var(--serif); }
.stat-tile .stat-label { color: var(--muted); font-size: 0.85rem; }
.stat-attention { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.filter-row { display: flex; gap: 1.25rem; margin: 1.25rem 0; }
.filter-row a { text-decoration: none; color: var(--muted); padding-bottom: 2px; }
.filter-row a.active { color: var(--ink); border-bottom: 2px solid var(--accent); }

.action-row { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.75rem; }

.admin-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.admin-table th, .admin-table td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--rule); }
.admin-table th { color: var(--muted); font-weight: 500; font-size: 0.85rem; }

.admin-photo-grid .caption-form { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.4rem; }
.admin-photo-grid .caption-form input { flex: 1 1 100%; padding: 0.3rem 0.5rem; font-size: 0.85rem; border: 1px solid var(--rule); border-radius: 4px; }
.admin-photo-grid .order-input { flex: 0 0 4rem !important; }

.code-editor, .code-block {
  font-family: Consolas, Menlo, monospace;
  font-size: 0.9rem;
}

.code-block {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
}

@media (max-width: 600px) {
  .site-title { font-size: 1.6rem; }
  .field-pair { flex-direction: column; gap: 0; align-items: flex-start; }
  .memory-photo img { float: none; margin: 0 0 0.75rem; }
}

/* Gallery: captions, memories, pager --------------------------------- */
.photo-card figcaption { display: flex; flex-direction: column; gap: 0.1rem; }
.photo-date { color: var(--accent); font-size: 0.8rem; letter-spacing: 0.02em; }
.photo-caption { color: var(--ink); }
.photo-memory {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--serif);
  font-style: italic;
  cursor: help;
}
.gallery-summary { font-size: 0.95rem; }
.gallery-continue {
  margin: 0 0 1rem;
  padding: 0.6rem 1rem;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-size: 0.95rem;
}
.gallery-continue a { text-decoration: none; }

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  margin: 2rem 0 1rem;
  font-size: 0.95rem;
}
.pager-pages { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.pager-pages a, .pager-current, .pager-gap {
  display: inline-block;
  min-width: 2.2rem;
  padding: 0.3rem 0.5rem;
  text-align: center;
  border-radius: 6px;
  text-decoration: none;
}
.pager-pages a { border: 1px solid var(--rule); background: var(--surface); }
.pager-current { border: 1px solid var(--accent); background: var(--accent); color: #fff; }
.pager-gap { color: var(--muted); }
.pager-step { text-decoration: none; }

/* Full-screen photo viewer ------------------------------------------ */
body.lb-open { overflow: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(8, 7, 5, 0.95);
  color: #f4f1ea;
  font-family: var(--sans);
}

.lb-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.lb-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.85rem 3.75rem 1.5rem 1.25rem;
  background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0));
  pointer-events: none;
  font-size: 1rem;
}
.lb-top h2 { margin: 0; font-weight: 500; line-height: 1.2; }
.lb-date { color: #e8d9b5; letter-spacing: 0.03em; white-space: nowrap; font-size: 1.35rem; }
.lb-caption { text-align: right; font-family: var(--serif); font-size: 1.35rem; color: #f4f1ea; }
.lb-date:empty, .lb-caption:empty { display: none; }

.lb-bottom {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 3rem 4.5rem 1rem;
  background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.85) 45%);
  text-align: center;
  pointer-events: none;
}
.lb-memory {
  margin: 0 auto 0.5rem;
  max-width: 44rem;
  max-height: 40vh;
  overflow-y: auto;
  pointer-events: auto;
  white-space: pre-line;
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.55;
}
.lb-counter { font-size: 0.8rem; color: rgba(244, 241, 234, 0.7); }

.lb-close, .lb-arrow {
  position: absolute;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  border-radius: 999px;
  transition: background 0.15s;
}
.lb-close:hover, .lb-arrow:hover { background: rgba(0, 0, 0, 0.75); }
.lb-close { top: 0.75rem; right: 0.75rem; width: 2.5rem; height: 2.5rem; font-size: 1.8rem; }
.lb-arrow {
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 4.5rem;
  font-size: 2.6rem;
  padding-bottom: 0.3rem;
}
.lb-prev { left: 0.75rem; }
.lb-next { right: 0.75rem; }
.lb-arrow:disabled { opacity: 0.2; cursor: default; }

@media (max-width: 600px) {
  .lb-top { flex-direction: column; gap: 0.15rem; padding-right: 3.5rem; }
  .lb-date { font-size: 1.05rem; }
  .lb-caption { text-align: left; font-size: 1.15rem; }
  .lb-bottom { padding: 2.5rem 1rem 0.75rem; }
  .lb-memory { font-size: 1rem; max-height: 35vh; }
  .lb-arrow { width: 2.4rem; height: 3.6rem; font-size: 2.1rem; }
}

/* Admin photo editor ------------------------------------------------- */
.admin-photo-grid .caption-form textarea {
  flex: 1 1 100%;
  padding: 0.3rem 0.5rem;
  font: inherit;
  font-size: 0.85rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  resize: vertical;
}
.admin-photo-grid .date-input { flex: 1 1 60% !important; }
.admin-photo-grid .mini-check { display: flex; align-items: center; gap: 0.3rem; font-size: 0.8rem; color: var(--muted); }
.admin-photo-grid .mini-check input { flex: 0 0 auto; width: auto; }
.admin-photo-grid .shown-as { flex: 1 1 100%; font-size: 0.8rem; color: var(--muted); }

/* Video items in the gallery grid ------------------------------------ */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.photo-link { display: block; position: relative; }

.play-badge {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 3.25rem; height: 3.25rem;
  border-radius: 50%;
  background: rgba(8, 7, 5, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.9);
  pointer-events: none;
  transition: background 0.15s, transform 0.15s;
}

.play-badge::after {
  content: "";
  position: absolute;
  top: 50%; left: 54%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 0.55rem 0 0.55rem 0.95rem;
  border-color: transparent transparent transparent #fff;
}

.photo-link.is-video:hover .play-badge { background: var(--accent); transform: translate(-50%, -50%) scale(1.06); }

.duration-badge {
  position: absolute;
  right: 0.4rem; bottom: 0.4rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: rgba(8, 7, 5, 0.75);
  color: #fff;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

/* Video inside the full-screen viewer --------------------------------- */
.lb-video-wrap {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-video {
  max-width: 100%;
  max-height: 100%;
  display: block;
  background: #000;
}

.lb-bigplay {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 5rem; height: 5rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: rgba(8, 7, 5, 0.5);
  cursor: pointer;
  transition: background 0.15s;
}

.lb-bigplay::after {
  content: "";
  position: absolute;
  top: 50%; left: 54%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 0.85rem 0 0.85rem 1.45rem;
  border-color: transparent transparent transparent #fff;
}

.lb-bigplay:hover { background: var(--accent); }

/* Player controls ------------------------------------------------------ */
.lb-controls {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: rgba(8, 7, 5, 0.85);
  color: #f4f1ea;
}

/* Keep the memory text clear of the control bar when a video is open. */
.lightbox.has-video .lb-bottom { padding-bottom: 4rem; }

.lb-controls button {
  flex: 0 0 auto;
  width: 2.1rem; height: 2.1rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #f4f1ea;
  cursor: pointer;
  position: relative;
}

.lb-controls button:hover { background: rgba(255, 255, 255, 0.14); }
.lb-controls button:focus-visible, .vp-scrub:focus-visible, .vp-volume:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.vp-play::after {
  content: "";
  position: absolute;
  top: 50%; left: 54%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 0.45rem 0 0.45rem 0.78rem;
  border-color: transparent transparent transparent currentColor;
}

.vp-play.is-playing::after {
  border: none;
  width: 0.72rem; height: 0.85rem;
  left: 50%;
  background: currentColor;
  -webkit-mask: linear-gradient(#000 0 0) left / 0.24rem 100% no-repeat,
                linear-gradient(#000 0 0) right / 0.24rem 100% no-repeat;
  mask: linear-gradient(#000 0 0) left / 0.24rem 100% no-repeat,
        linear-gradient(#000 0 0) right / 0.24rem 100% no-repeat;
}

.vp-time {
  flex: 0 0 auto;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: rgba(244, 241, 234, 0.85);
}

.vp-scrub { flex: 1 1 auto; padding: 0.6rem 0; cursor: pointer; touch-action: none; }

.vp-track {
  position: relative;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
}

.vp-buffered, .vp-played {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  border-radius: 2px;
}

.vp-buffered { background: rgba(255, 255, 255, 0.3); }
.vp-played { background: var(--accent); }

.vp-knob {
  position: absolute;
  top: 50%; left: 0;
  width: 0.75rem; height: 0.75rem;
  margin-left: -0.375rem;
  transform: translateY(-50%);
  border-radius: 50%;
  background: #fff;
  pointer-events: none;
}

.vp-mute::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 1.05rem; height: 1.05rem;
  background: currentColor;
  -webkit-mask: no-repeat center / contain;
  mask: no-repeat center / contain;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9v6h4l5 4V5L8 9H4zm12.5 3a4 4 0 0 0-2-3.46v6.92A4 4 0 0 0 16.5 12zM14.5 3.2v2.06A6.98 6.98 0 0 1 19.5 12a6.98 6.98 0 0 1-5 6.74v2.06A9 9 0 0 0 14.5 3.2z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9v6h4l5 4V5L8 9H4zm12.5 3a4 4 0 0 0-2-3.46v6.92A4 4 0 0 0 16.5 12zM14.5 3.2v2.06A6.98 6.98 0 0 1 19.5 12a6.98 6.98 0 0 1-5 6.74v2.06A9 9 0 0 0 14.5 3.2z'/%3E%3C/svg%3E");
}

.vp-mute.is-muted::after {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9v6h4l5 4V5L8 9H4zm15.5 3 2.2-2.2-1.4-1.4L18 10.6l-2.2-2.2-1.4 1.4L16.6 12l-2.2 2.2 1.4 1.4L18 13.4l2.3 2.2 1.4-1.4L19.5 12z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9v6h4l5 4V5L8 9H4zm15.5 3 2.2-2.2-1.4-1.4L18 10.6l-2.2-2.2-1.4 1.4L16.6 12l-2.2 2.2 1.4 1.4L18 13.4l2.3 2.2 1.4-1.4L19.5 12z'/%3E%3C/svg%3E");
}

.vp-full::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 1rem; height: 1rem;
  background: currentColor;
  -webkit-mask: no-repeat center / contain;
  mask: no-repeat center / contain;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9V4h5V2H2v7h2zm11-7v2h5v5h2V2h-7zM4 15H2v7h7v-2H4v-5zm18 0h-2v5h-5v2h7v-7z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9V4h5V2H2v7h2zm11-7v2h5v5h2V2h-7zM4 15H2v7h7v-2H4v-5zm18 0h-2v5h-5v2h7v-7z'/%3E%3C/svg%3E");
}

.vp-volume { flex: 0 0 5rem; padding: 0.6rem 0; cursor: pointer; touch-action: none; }

.vp-vol-track {
  position: relative;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
}

.vp-vol-level {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  border-radius: 2px;
  background: rgba(244, 241, 234, 0.9);
}

@media (max-width: 600px) {
  .lb-controls { gap: 0.4rem; padding: 0.5rem 0.6rem; }
  .vp-volume { display: none; }
  .lightbox.has-video .lb-bottom { padding-bottom: 3.6rem; }
  .lb-bigplay { width: 4rem; height: 4rem; }
  .play-badge { width: 2.6rem; height: 2.6rem; }
}

/* Admin editing list ---------------------------------------------------- */
.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0 1rem;
  padding: 0.6rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.list-toolbar-bottom { position: static; }
.list-count { color: var(--muted); font-size: 0.9rem; margin-right: auto; }

.edit-list { display: flex; flex-direction: column; gap: 0.6rem; }

.edit-row {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 0.7rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
}

.edit-row.is-featured { border-left: 3px solid var(--accent); }
.edit-row:target { box-shadow: 0 0 0 2px var(--accent); }

.edit-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 126px;
  height: 126px;
  display: block;
}

.edit-thumb img {
  width: 126px;
  height: 126px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.edit-thumb .play-badge { width: 2.6rem; height: 2.6rem; border-width: 1px; }
.edit-thumb .play-badge::after { border-width: 0.44rem 0 0.44rem 0.76rem; }

.edit-fields { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0.4rem; }

.edit-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; }

.edit-field { display: flex; align-items: center; gap: 0.45rem; margin: 0; font-size: 0.85rem; color: var(--muted); }
.edit-field > span { flex: 0 0 auto; }

.edit-field input, .edit-field textarea {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 0.35rem 0.5rem;
  font: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 5px;
}

.edit-field textarea { resize: vertical; line-height: 1.4; }
.edit-date input { flex: 0 0 9rem; width: 9rem; font-variant-numeric: tabular-nums; }
.edit-order input { flex: 0 0 5.5rem; width: 5.5rem; }
.edit-meta { color: var(--muted); font-size: 0.8rem; margin-left: auto; }
.edit-meta strong { color: var(--accent); font-weight: 500; }
.edit-delete { flex: 0 0 auto; align-self: center; }

@media (max-width: 700px) {
  .edit-row { flex-wrap: wrap; }
  .edit-fields { flex: 1 1 100%; order: 3; }
  .edit-meta { margin-left: 0; flex: 1 1 100%; }
  .list-toolbar { position: static; }
}

/* Camera metadata shown under each admin row ---------------------------- */
.edit-exif {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.5rem;
  padding: 0.3rem 0.5rem;
  background: var(--bg);
  border: 1px dashed var(--rule);
  border-radius: 5px;
  font-size: 0.8rem;
  color: var(--muted);
}

.exif-label {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.68rem;
  color: var(--muted);
  opacity: 0.8;
}

.exif-value { color: var(--ink); font-variant-numeric: tabular-nums; }
.exif-value + .exif-label { margin-left: 0.5rem; }
.exif-stale { color: var(--muted); font-style: italic; font-variant-numeric: normal; }
.exif-dim { margin-left: auto; opacity: 0.75; }
.exif-use { padding: 0.1rem 0.5rem; font-size: 0.75rem; }

/* Newly uploaded items, held aside until described ---------------------- */
.awaiting {
  margin: 0 0 1.75rem;
  padding: 0.9rem 1rem 1rem;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  border: 2px solid var(--accent);
  border-radius: 10px;
}

.awaiting-title {
  margin: 0 0 0.3rem;
  font-size: 1.15rem;
  color: var(--accent);
}

.awaiting-hint { margin: 0 0 0.9rem; }
.awaiting .edit-list { gap: 0.6rem; }
.awaiting .edit-row { border-color: color-mix(in srgb, var(--accent) 35%, var(--rule)); }
.awaiting-count { color: var(--accent); }

/* A row still waiting: draw the eye to the empty date field. */
.edit-row.is-new .edit-date input:placeholder-shown {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg));
}
