:root {
  --bg: #0c0c10;
  --bg-elevated: #15151b;
  --border: #242430;
  --text: #e8e6e3;
  --text-dim: #9b98a3;
  --accent: #b9a6ff;
  --accent-dim: #6b5fa3;
  --accent-hover: #cabaff;
  --on-accent: #15121f;
  --bg-rgb: 12, 12, 16;
  --tag-green: #8be0b0;
  --tag-green-line: #2f5540;
  --tag-gold: #e0c98b;
  --tag-gold-line: #554a2f;
  --tag-teal: #8fd3d9;
  --tag-teal-line: #2f5560;
  --tag-violet-line: #4a3f7a;
  color-scheme: dark;
  --radius: 2px;
  --max-width: 1200px;
}

/* Light theme. The hero photo, the photo viewer and the labels floating over photos
   keep the dark colours in both themes, so the art always looks its best. */
:root[data-theme="light"] {
  --bg: #f6f4f0;
  --bg-elevated: #ffffff;
  --border: #dcd8e3;
  --text: #1d1b24;
  --text-dim: #5d5968;
  --accent: #6a4fd1;
  --accent-dim: #b3a6ea;
  --accent-hover: #7b61e0;
  --on-accent: #ffffff;
  --bg-rgb: 246, 244, 240;
  --tag-green: #1f7a46;
  --tag-green-line: #a8d5b9;
  --tag-gold: #8a6a10;
  --tag-gold-line: #e0cf9c;
  --tag-teal: #1d7a86;
  --tag-teal-line: #a3d3d9;
  --tag-violet-line: #cfc4f2;
  color-scheme: light;
}
:root[data-theme="light"] .hero,
:root[data-theme="light"] .lightbox,
:root[data-theme="light"] .uv-toggle,
:root[data-theme="light"] .video-badge,
:root[data-theme="light"] .photo-badge {
  --bg: #0c0c10;
  --bg-elevated: #15151b;
  --border: #242430;
  --text: #e8e6e3;
  --text-dim: #9b98a3;
  --accent: #b9a6ff;
  --accent-dim: #6b5fa3;
  --accent-hover: #cabaff;
  --on-accent: #15121f;
  --bg-rgb: 12, 12, 16;
  color-scheme: dark;
  color: var(--text);
}
:root[data-theme="light"] .hero { background: #0c0c10; }

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Visible keyboard focus (works in dark and light theme). */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.lightbox :focus-visible,
.art-open:focus-visible {
  outline-offset: -3px;
}
.lightbox-close:focus-visible { outline-offset: 2px; }

/* Skip link: hidden until focused with the keyboard. */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 1000;
  padding: 10px 16px;
  background: var(--bg-elevated);
  color: var(--text);
  border: 2px solid var(--accent);
  border-radius: 6px;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }
main:focus { outline: none; }

/* Invisible button covering a piece's photo: makes the card keyboard-openable. */
.art-open {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ---------- Layout ---------- */

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Header ---------- */

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(var(--bg-rgb), 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 32px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.logo {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.logo span {
  color: var(--accent);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-tools { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.lang-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  flex-shrink: 0;
}

.lang-toggle button {
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 6px 12px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s ease, color 0.2s ease;
}

.lang-toggle button.active {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.lang-toggle button:not(.active):hover {
  color: var(--text);
}

.nav-links a {
  font-size: 0.92rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.nav-toggle {
  display: none;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  /* A floor, not a fixed height — on a short screen (or a longer heading,
     in either language) the box grows to fit its content instead of
     clipping it. "height" alone would cap it and silently cut off
     whatever doesn't fit; min-height never does that. */
  min-height: max(480px, 86vh);
  display: flex;
  align-items: flex-end;
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.85;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(12,12,16,0.1) 0%, rgba(12,12,16,0.3) 55%, var(--bg) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  /* Top padding matters most in the edge case the box has just grown to
     fit a long heading with no slack left — it keeps the text from
     sitting flush against the very top edge of the photo. */
  padding: 48px 32px 64px;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  margin: 0 0 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  max-width: 720px;
}

.hero p {
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 480px;
  margin: 0 0 28px;
}

.hero-links {
  display: flex;
  gap: 16px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 12px 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-ghost {
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Section headings ---------- */

.section {
  padding: 90px 0;
}

.section-tight {
  padding: 60px 0;
}

.section-head {
  margin-bottom: 48px;
}

.section-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  color: var(--accent);
  margin-bottom: 10px;
}

.section-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  margin: 0 0 12px;
  font-weight: 600;
}

.section-head p {
  color: var(--text-dim);
  max-width: 560px;
  margin: 0;
}

/* ---------- Gallery grid ---------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}

.art-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.art-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-3px);
}

.art-thumb {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--bg-elevated);
}

.art-thumb img {
  width: 100%;
  height: 100%;
  /* Default: the whole photo is shown inside the frame. Pieces ticked "Crop this photo in the overview" in the admin fill the frame instead. */
  object-fit: contain;
  padding: 6px;
  transition: transform 0.5s ease, opacity 0.3s ease;
}

.art-card[data-crop="true"] .art-thumb img {
  object-fit: cover;
  padding: 0;
}

.art-card:hover .art-thumb img {
  transform: scale(1.04);
}

/* UV / normal light toggle */

.uv-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: flex;
  background: rgba(12, 12, 16, 0.92);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  backdrop-filter: blur(4px);
}

.uv-toggle button {
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 12px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s ease, color 0.2s ease;
}

.uv-toggle button.active {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.uv-toggle button:not(.active):hover {
  color: var(--text);
}

.art-info {
  padding: 16px 18px 18px;
}

.art-title {
  font-size: 0.98rem;
  font-weight: 600;
  margin: 0 0 4px;
}

.art-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.tag {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.tag-available {
  color: var(--tag-green);
  border-color: var(--tag-green-line);
}

.tag-unavailable {
  color: var(--text-dim);
  border-color: var(--border);
}

.tag-outcome {
  margin-left: 6px;
}

.tag-sold {
  color: var(--tag-gold);
  border-color: var(--tag-gold-line);
}

.tag-collab {
  color: var(--tag-teal);
  border-color: var(--tag-teal-line);
}

.tag-gift {
  color: var(--accent);
  border-color: var(--tag-violet-line);
}

.empty-note {
  color: var(--text-dim);
  font-size: 0.95rem;
  border: 1px dashed var(--border);
  padding: 28px;
  border-radius: var(--radius);
}

.gallery-grid .empty-note {
  grid-column: 1 / -1;
  margin: 0;
}

/* ---------- Category filter bar ---------- */

.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.filter-btn {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-dim);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  padding: 8px 20px;
  border-radius: 20px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.filter-btn.active {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
  font-weight: 600;
}

.filter-btn:not(.active):hover {
  border-color: var(--accent-dim);
  color: var(--text);
}

/* Size dropdown, next to the category buttons. */
.size-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 6px;
  color: var(--text-dim);
  font-size: 0.82rem;
}

.size-filter[hidden] {
  display: none;
}

.size-filter select {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  color-scheme: dark;
}

:root[data-theme="light"] .size-filter select {
  color-scheme: light;
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 10, 0.94);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.lightbox.open {
  display: flex;
}

.lightbox-inner {
  max-width: 1000px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

/* The stage is a fixed-size box the photo is centred in, so rotating it
   never makes the caption and buttons jump around. js/main.js sets the
   photo's max size each time it rotates, so a turned photo always fits. */
.lightbox-stage {
  position: relative;
  width: 100%;
  height: min(66vh, 800px);
  overflow: hidden;      /* a zoomed photo stays inside its box, never over the caption */
  touch-action: pan-x pan-y; /* no page pinch-zoom here: pinching zooms the photo (see js/main.js) */
  cursor: zoom-in;
  user-select: none;
  -webkit-user-select: none;
}
.lightbox-stage.is-zoomed { cursor: grab; }
.lightbox-stage.is-zoomed.gesture { cursor: grabbing; }
/* Follow the finger/cursor directly while pinching or dragging. */
.lightbox-stage.gesture img { transition: none !important; }

.lightbox img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border: 1px solid var(--border);
  transition: transform 0.25s ease;
}

.lightbox-rotate {
  display: flex;
  gap: 10px;
}

.lightbox-rotate button,
.lightbox-share {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-dim);
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
}

.lightbox-rotate button:hover,
.lightbox-share:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Previous / next piece: round arrows at the left and right edge of the photo area. */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  background: rgba(8, 8, 10, 0.72);
  color: var(--text);
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.lightbox-nav:hover { color: var(--accent); border-color: var(--accent); }
.lightbox-prev { left: 4px; }
.lightbox-next { right: 4px; }

/* Video: the piece's MP4 plays in the viewer in place of the photo. */
.lightbox-video-player {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  background: #000;
  object-fit: contain;
}
.lightbox.video-on .lightbox-video-player { display: block; }
.lightbox.video-on .lightbox-stage { cursor: default; touch-action: auto; }
.lightbox.video-on .lightbox-stage img { visibility: hidden; }
/* Nothing to turn or zoom while a video is showing, and the caption text would cover the controls. */
.lightbox.video-on [data-rotate],
.lightbox.video-on .lightbox-zoom { display: none; }
.lightbox.video-on .lightbox-desc-text { display: none; }
.lightbox-video-btn.on { color: var(--accent); border-color: var(--accent); }

/* Small play badge on the thumbnail of a piece that has a video. */
.video-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(12, 12, 16, 0.78);
  color: #fff;
  pointer-events: none;
}

/* Small badge on the thumbnail of a piece with several photos: how many. */
.photo-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 9px;
  border-radius: 14px;
  background: rgba(12, 12, 16, 0.78);
  color: #fff;
  font-size: 0.72rem;
  pointer-events: none;
}

/* Description over the photo: white text with a black glow, no box. Fixed in
   place (doesn't turn or zoom with the photo) and never blocks pinch/drag. */
.lightbox-desc-text {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 100%;
  overflow: hidden;
  z-index: 4;
  padding: 0 18px 16px;
  text-align: center;
  white-space: pre-line;
  overflow-wrap: anywhere;
  font-size: 1.05rem;
  line-height: 1.45;
  color: #fff;
  text-shadow:
    0 0 3px #000, 0 0 6px #000, 0 0 10px #000,
    0 0 16px rgba(0, 0, 0, 0.95), 0 0 26px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}
.lightbox-desc-text.show { opacity: 1; visibility: visible; }

.lightbox-desc.on { color: var(--accent); border-color: var(--accent); }

/* "?" tips: a dark panel in the middle of the photo. Never blocks pinch/drag. */
.lightbox-help-text {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  width: min(440px, calc(100% - 32px));
  max-height: calc(100% - 24px);
  overflow: hidden;
  padding: 14px 18px;
  background: rgba(12, 12, 16, 0.9);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.5;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}
.lightbox-help-text.show { opacity: 1; visibility: visible; }
.lightbox-help-text ul { list-style: none; margin: 0; padding: 0; }
.lightbox-help-text li { padding: 3px 0; }
.lightbox-help-text strong { color: var(--accent); font-weight: 600; }
.lightbox.video-on .lightbox-help-text { display: none; }
.lightbox.help-on .lightbox-desc-text { display: none; }
.lightbox-help.on { color: var(--accent); border-color: var(--accent); }

/* Zoom button: magnifier with a plus; shows a minus while zoomed in. */
.lightbox-zoom .icon-out { display: none; }
.lightbox-zoom.zoomed .icon-in { display: none; }
.lightbox-zoom.zoomed .icon-out { display: block; }
.lightbox-zoom.zoomed { color: var(--accent); border-color: var(--accent); }

/* Share button: shows a tick for a moment after the link has been copied. */
.lightbox-share .icon-done { display: none; }
.lightbox-share.done .icon-share { display: none; }
.lightbox-share.done .icon-done { display: block; }
.lightbox-share.done { color: var(--accent); border-color: var(--accent); }

.lightbox-caption {
  text-align: center;
}

.lightbox-caption h3 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.lightbox-caption p {
  color: var(--text-dim);
  font-size: 0.88rem;
  margin: 0;
}

.lightbox-uv-toggle {
  display: none;
  gap: 10px;
}

.lightbox-uv-toggle.show {
  display: flex;
}

.lightbox-uv-toggle button {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-dim);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.lightbox-uv-toggle button.active {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
  font-weight: 600;
}

/* Numbered buttons for a piece's extra photos (built by js/main.js). */
.lightbox-photos {
  display: none;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.lightbox-photos.show {
  display: flex;
}

.lightbox-photos button {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-dim);
  font-size: 0.78rem;
  border-radius: 50%;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.lightbox-photos button.active {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
  font-weight: 600;
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 10; /* above the photo, so a tap on the X is never swallowed by it */
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--text-dim);
  cursor: pointer;
  line-height: 1;
  background: rgba(8, 8, 10, 0.6);
  border: 0;
  padding: 0;
  font-family: inherit;
  border-radius: 50%;
}

.lightbox-close:hover {
  color: var(--text);
}

/* ---------- About / Contact content ---------- */

.prose {
  max-width: 680px;
  color: var(--text-dim);
  font-size: 1.02rem;
}

.prose p {
  margin: 0 0 20px;
}

.prose strong {
  color: var(--text);
}

/* Blog page */
.blog-intro { color: var(--text-dim); max-width: 680px; margin: 0 0 32px; }
.blog-subhead { font-size: 1.05rem; margin: 0 0 16px; color: var(--text); }
.blog-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 44px;
}
.blog-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.blog-link:hover { border-color: var(--accent-dim); transform: translateY(-2px); }
.blog-link-title { font-weight: 600; }
.blog-link-desc { color: var(--text-dim); font-size: 0.92rem; }
.blog-link-url { color: var(--accent); font-size: 0.78rem; margin-top: auto; }
.blog-entry {
  max-width: 1000px;
  margin-bottom: 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.blog-main { display: flex; align-items: flex-start; }
.blog-photo-wrap { flex: 0 0 40%; max-width: 40%; padding: 22px 0 22px 22px; }
.blog-photo { display: block; width: 100%; height: auto; border-radius: 3px; }
.blog-photo-open { display: block; width: 100%; padding: 0; margin: 0; border: 0; background: none; cursor: zoom-in; border-radius: 3px; }
.blog-more a { cursor: zoom-in; }
.blog-main .blog-body { flex: 1; min-width: 0; }
@media (max-width: 640px) {
  .blog-main { flex-direction: column; }
  .blog-photo-wrap { flex: none; max-width: 100%; width: 100%; padding: 16px 16px 0; }
}
.blog-video { position: relative; background: #000; }
.blog-video-play {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0;
  border: 0; background: #0b0b0e; cursor: pointer; overflow: hidden;
}
.blog-video-play img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.85; transition: opacity 0.2s; }
.blog-video-play:hover img, .blog-video-play:focus-visible img { opacity: 1; }
.blog-video-icon {
  position: absolute; top: 50%; left: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px;
  border-radius: 50%; background: rgba(0, 0, 0, 0.6); border: 2px solid var(--accent);
}
.blog-video-icon::after {
  content: ""; position: absolute; top: 50%; left: 50%; margin: -11px 0 0 -7px;
  border-style: solid; border-width: 11px 0 11px 18px; border-color: transparent transparent transparent var(--accent);
}
.blog-video-player { display: block; width: 100%; max-height: 75vh; background: #000; }
.blog-more { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; margin-top: 18px; }
.blog-more a { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 2px; }
.blog-more img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s; }
.blog-more a:hover img { transform: scale(1.04); }
.blog-body { padding: 22px 26px; }
.blog-date { color: var(--text-dim); font-size: 0.8rem; letter-spacing: 0.04em; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.blog-share { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 1px solid transparent; border-radius: 50%; background: none; color: var(--text-dim); cursor: pointer; transition: color 0.2s ease, border-color 0.2s ease; }
.blog-share:hover { color: var(--accent); border-color: var(--accent); }
.blog-share-note { color: var(--accent); font-size: 0.78rem; letter-spacing: 0; }
.blog-entry { scroll-margin-top: 16px; }
.blog-entry.is-linked { box-shadow: 0 0 0 2px var(--accent); transition: box-shadow 0.6s ease; }
.blog-body h3 { margin: 0 0 12px; font-size: 1.2rem; }
.blog-body p { color: var(--text-dim); margin: 0 0 14px; overflow-wrap: anywhere; }
.blog-body p:last-child { margin-bottom: 0; }
/* Formatted blog texts (made with the visual editor in the admin) */
.blog-text { color: var(--text-dim); margin: 0 0 14px; overflow-wrap: anywhere; }
.blog-text ul, .blog-text ol { margin: 0.6em 0; padding-left: 1.4em; }
.blog-text ul { list-style: disc; }
.blog-text ol { list-style: decimal; }
.blog-text blockquote { margin: 0.8em 0; padding: 0.1em 1em; border-left: 3px solid var(--accent); }
.blog-text h2, .blog-text h3 { color: var(--text); margin: 0.8em 0 0.3em; line-height: 1.25; }
.blog-text h2 { font-size: 1.15rem; }
.blog-text h3 { font-size: 1.02rem; }
.blog-text hr { border: 0; border-top: 1px solid currentColor; opacity: 0.3; margin: 1em 0; }
.blog-text a { color: var(--accent); }
.blog-text sup, .blog-text sub { font-size: 0.75em; line-height: 0; }
.blog-body a { color: var(--accent); }

/* Help page */
.help-intro { color: var(--text-dim); margin: 0 0 14px; }
.help-tabs { display: flex; gap: 10px; margin-bottom: 28px; }
.help-block { margin-bottom: 26px; }
.help-block h3 { color: var(--text); font-size: 1.05rem; margin: 0 0 10px; }
.help-block ul { margin: 0; padding-left: 20px; }
.help-block li { margin-bottom: 8px; }
.help-panel[hidden] { display: none; }

/* Contact form */
.contact-form { max-width: 640px; display: grid; gap: 20px; }
.contact-form[hidden], .cf-done[hidden] { display: none; }
.cf-field { display: grid; gap: 8px; }
.cf-field label { font-size: 0.9rem; color: var(--text-dim); }
.cf-field input, .cf-field select, .cf-field textarea {
  width: 100%; padding: 12px 14px; font: inherit; color: var(--text);
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
}
.cf-field textarea { resize: vertical; min-height: 150px; }
.cf-field input:focus, .cf-field select:focus, .cf-field textarea:focus { outline: none; border-color: var(--accent); }
.cf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cf-note { margin: 0; font-size: 0.85rem; color: var(--text-dim); }
.cf-note a { color: var(--accent); }
.cf-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.cf-actions .btn { cursor: pointer; font: inherit; }
.cf-actions .btn:disabled { opacity: 0.6; cursor: wait; }
.cf-status { margin: 0; font-size: 0.92rem; color: var(--text-dim); }
.cf-status.error { color: #e58a8a; }
:root[data-theme="light"] .cf-status.error { color: #b3342f; }
.cf-done { max-width: 640px; padding: 20px 24px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); }

.contact-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 36px;
  border-radius: var(--radius);
  max-width: 480px;
}

.contact-card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.contact-card p {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin: 0 0 20px;
}

.contact-email {
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 600;
  word-break: break-all;
}

/* ---------- Footer ---------- */

footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  margin-top: 40px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-note {
  color: var(--text-dim);
  font-size: 0.82rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links a {
  color: var(--text-dim);
  font-size: 0.82rem;
}

.footer-links a:hover {
  color: var(--accent);
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .nav {
    padding: 18px 20px;
    flex-wrap: wrap;
    gap: 12px;
  }
  .nav-right {
    width: 100%;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
  }
  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 20px;
  }
  .wrap {
    padding: 0 20px;
  }
  .hero {
    min-height: max(480px, 70vh);
  }
  .lightbox {
    padding-top: 64px;
    padding-bottom: 20px;
  }
  .lightbox-stage {
    /* leave room below the photo for the caption and the buttons */
    height: max(200px, calc(100vh - 300px));
  }
  .section {
    padding: 56px 0;
  }
}

/* Phones: no arrow buttons in the photo viewer — swiping does the job. */
@media (max-width: 640px) {
  .lightbox-nav { display: none; }
  .lightbox-desc-text { padding: 0 12px 10px; font-size: 0.9rem; }
}

/* Text only for screen readers. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* The piece a contact question is about (from the photo viewer). */
.cf-piece { display: flex; align-items: center; gap: 14px; padding: 10px 14px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); }
.cf-piece[hidden] { display: none; }
.cf-piece img { width: 56px; height: 70px; object-fit: cover; border-radius: 4px; flex: none; }
.cf-piece-text { flex: 1; min-width: 0; }
.cf-piece-remove { background: none; border: 0; padding: 4px; color: var(--accent); font: inherit; font-size: 0.9rem; text-decoration: underline; cursor: pointer; }

/* Switch "Oldest first" in the filter bar (same look as in the admin). */
.order-toggle { background: none; border: none; color: var(--text-dim); font: inherit; font-size: 0.9rem; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; padding: 0 4px; }
.order-toggle .sw { width: 34px; height: 18px; border-radius: 9px; background: var(--border); position: relative; transition: background 0.15s; }
.order-toggle .knob { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-dim); transition: left 0.15s, background 0.15s; }
.order-toggle[aria-checked=true] { color: var(--accent); }
.order-toggle[aria-checked=true] .sw { background: var(--accent-dim, #5b4a99); }
.order-toggle[aria-checked=true] .knob { left: 18px; background: var(--accent); }

/* Filter buttons with nothing in them (count 0) are greyed out. */
.filter-btn:disabled, .filter-btn.is-empty { opacity: 0.4; cursor: not-allowed; }
.filter-btn:disabled:hover { border-color: var(--border); color: var(--text-dim); }
.filter-count { opacity: 0.8; }

/* Formatting that can be added in the Site text editor (lists, quotes, headings, lines) */
[data-i18n] ul, [data-i18n] ol { margin: 0.6em 0; padding-left: 1.4em; text-align: left; }
[data-i18n] ul { list-style: disc; }
[data-i18n] ol { list-style: decimal; }
[data-i18n] li { margin: 0.2em 0; }
[data-i18n] blockquote { margin: 0.8em 0; padding: 0.1em 1em; border-left: 3px solid currentColor; opacity: 0.9; }
[data-i18n] h2, [data-i18n] h3 { margin: 0.8em 0 0.3em; line-height: 1.25; }
[data-i18n] hr { border: 0; border-top: 1px solid currentColor; opacity: 0.3; margin: 1em 0; }
[data-i18n] sup, [data-i18n] sub { font-size: 0.75em; line-height: 0; }

/* Blog photo viewer: dark backdrop, the photo as large as fits (never bigger than itself), arrows, X, counter. */
html.bv-open { overflow: hidden; }
.bv { position: fixed; inset: 0; z-index: 1100; display: flex; flex-direction: column; background: rgba(8, 8, 10, 0.97); overscroll-behavior: contain; touch-action: pan-y pinch-zoom; }
.bv[hidden] { display: none; }
.bv-stage { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 56px 64px 8px; }
.bv-img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 2px; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.bv-bar { flex: 0 0 auto; display: flex; justify-content: center; align-items: baseline; gap: 14px; padding: 6px 64px 16px; color: var(--text-dim); font-size: 0.85rem; text-align: center; }
.bv-title { color: var(--text); }
.bv-close, .bv-nav { position: absolute; z-index: 2; display: flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--border); background: rgba(8, 8, 10, 0.72); color: var(--text); border-radius: 50%; cursor: pointer; transition: color 0.2s ease, border-color 0.2s ease; }
.bv-close { top: 12px; right: 12px; width: 44px; height: 44px; }
.bv-nav { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; }
.bv-prev { left: 10px; }
.bv-next { right: 10px; }
.bv-close:hover, .bv-nav:hover { color: var(--accent); border-color: var(--accent); }
.bv-close:focus-visible, .bv-nav:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bv [hidden] { display: none; }
@media (max-width: 640px) {
  .bv-stage { padding: 56px 8px 6px; }
  .bv-bar { padding: 4px 64px 14px; min-height: 56px; align-items: center; }
  .bv-nav { top: auto; bottom: 8px; transform: none; width: 44px; height: 44px; }
  .bv-prev { left: 10px; }
  .bv-next { right: 10px; }
}
