:root {
  --bg: #f6f7fb;
  --surface: rgba(255, 255, 255, 0.8);
  --surface-solid: #fff;
  
  --text: #0f172a;
  --muted: #475569;
  --line: rgba(15, 23, 42, 0.12);
  --dot: #0f172a;
  --accent: #2563eb;

  --max: 900px;
  --pad: 18px;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(2, 6, 23, 0.08);
  --shadow: 5px 5px 5px rgba(2, 6, 23, 0.08);

  --gutter-left: 28px;
  --line-x: 12px;
  --dot-size: 10px;
}

html.dark {
  --bg: #0b1220;
  --surface-solid: #111827;
  --surface: rgba(17, 24, 39, 0.7);
  --surface: rgba(17, 24, 39, 0.85);
  --text: #e5e7eb;
  --muted: #d1d5db;
  --line: rgba(229, 231, 235, 0.14);
  --dot: #e5e7eb;
  --accent: #60a5fa;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

html.dark body::before {
  background:
    linear-gradient(
      180deg,
      #0b1220 0%,
      #1e293b 35%,
      #334155 70%,
      #475569 100%
    ),
    radial-gradient(
      800px 400px at 50% -200px,
      rgba(96, 165, 250, 0.15),
      transparent 70%
    );
}

html.dark .timeline::before {
  background: linear-gradient(to bottom, transparent, rgba(96, 165, 250, 0.3) 10%, rgba(96, 165, 250, 0.3) 90%, transparent);
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    "Noto Sans";
  color: var(--text);
  background: var(--bg);   /* kun fallback */
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before{
  content:"";
  position: fixed;
  inset: 0;
  z-index: -1;

  /* Din smooth baggrund (ingen repeat) */
  background:
    linear-gradient(
      180deg,
      #ffffff 0%,
      #eef2ff 35%,
      #e0e7ff 70%,
      #dbeafe 100%
    ),
    radial-gradient(
      800px 400px at 50% -200px,
      rgba(37, 99, 235, 0.12),
      transparent 70%
    );

  background-repeat: no-repeat;
  background-size: cover;
}


.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 44px) var(--pad);
}

header {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

/* --- Stats section --- */
.stats {
  margin-bottom: 15px;
  /* overflow: hidden; */
  max-height: 500px;
  opacity: 1;
  transition: max-height 400ms cubic-bezier(0.4, 0, 0.2, 1),
              opacity 350ms ease,
              margin-bottom 400ms ease;
}

.stats.is-collapsed {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
  pointer-events: none;
}

.stats-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto 24px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--accent);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 200ms ease;
  backdrop-filter: blur(12px);
}

.stats-toggle:hover {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
}

.stats-toggle-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 300ms ease;
}

.stats-toggle.is-open .stats-toggle-icon {
  transform: rotate(180deg);
}

.stats-toggle.is-open {
  margin-bottom: 32px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.stat-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  backdrop-filter: blur(12px);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
  cursor: pointer;
}

.stat-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}

.stat-icon {
  font-size: 28px;
  line-height: 1;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.3;
}

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .stat-item {
    padding: 12px;
  }
  
  .stat-icon {
    font-size: 24px;
  }
  
  .stat-value {
    font-size: 1.1rem;
  }
  
  .stat-label {
    font-size: 0.8rem;
  }
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}
.kicker .pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
}

h1 {
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  letter-spacing: -0.02em;
  margin: 0;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 60ch;
}

.timeline {
  position: relative;
  margin-top: 22px;
  padding-left: calc(var(--gutter-left) + 6px);
}

.timeline::before {
  content: "";
  position: absolute;
  left: var(--line-x);
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--line) 10%, var(--line) 90%, transparent);
  border-radius: 999px;
}

.year {
  margin: 26px 0 10px;
  position: relative;
}

.year span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  /* font-weight: 700; */
  letter-spacing: 0.02em;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 1.3rem;
}

.year span::before {
  content: "";
  width: 14px;
  height: 2px;
  background: var(--line);
  display: inline-block;
  border-radius: 999px;
}

.item {
  position: relative;
  margin: 14px 0;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);

  /* fade-in start */
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 500ms ease,
    transform 500ms ease;
  will-change: opacity, transform;
}

.item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .item {
    transition: none;
    transform: none;
  }
}

.item::before {
  content: "";
  position: absolute;
  left: calc(-1 * (var(--gutter-left) - var(--line-x)) - (var(--dot-size) / 2) - 6px);
  top: 22px;
  width: var(--dot-size);
  height: var(--dot-size);
  border-radius: 999px;
  background: var(--dot);
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.1);
}

.item-head {
  display: grid;
  gap: 0;
  margin: -16px -18px 12px -18px;
}

@media (max-width: 720px) {
  .item-head {
  margin: -14px -14px 12px -14px;
}
}

.title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  /* background: rgba(248, 250, 252, 0.95); */
  background: rgba(196, 226, 255, 0.52);
  padding: 12px 16px;
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 2px solid var(--line);
}

.title h2 {
  font-size: 1.05rem;
  margin: 0;
  letter-spacing: -0.01em;
}

.title-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

time {
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.days-since {
  font-size: 0.85rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.18);
  white-space: nowrap;
  display: inline-block;
}

.secondary {
  color: var(--muted);
  font-size: 0.88rem;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  background: rgba(241, 245, 249, 0.85);
  padding: 10px 16px;
  border-bottom: 0.5px solid rgba(15, 23, 42, 0.08);
  border-radius: 0;
}

.secondary .sep {
  width: 8px;
  height: 1px;
  display: inline-block;
  background: var(--line);
  border-radius: 1px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tag {
  font-size: 0.82rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.18);
}

.desc {
  margin: 0;
  opacity: 0.95;
  white-space: pre-line;
}

.to-top {
  position: fixed;
  right: 14px;
  bottom: 76px;
  z-index: 50;
  border: none;
  background: linear-gradient(135deg, var(--accent) 0%, #3b82f6 100%);
  color: white;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
  cursor: pointer;
  font-size: 0;

  opacity: 0;
  transform: translateY(10px) scale(0.9);
  pointer-events: none;
  transition:
    opacity 250ms ease,
    transform 250ms ease,
    box-shadow 250ms ease;
}

.to-top:hover {
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.5);
  transform: translateY(-2px) scale(1);
}

.to-top svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.to-top.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.to-bottom {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 50;
  border: none;
  background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
  color: white;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
  cursor: pointer;
  font-size: 0;

  opacity: 0;
  transform: translateY(10px) scale(0.9);
  pointer-events: none;
  transition:
    opacity 250ms ease,
    transform 250ms ease,
    box-shadow 250ms ease;
}

.to-bottom:hover {
  box-shadow: 0 6px 24px rgba(139, 92, 246, 0.5);
  transform: translateY(-2px) scale(1);
}

.to-bottom svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.to-bottom.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.theme-toggle {
  position: fixed;
  right: 14px;
  bottom: 140px;
  z-index: 50;
  border: none;
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
  color: white;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
  cursor: pointer;
  font-size: 0;
  opacity: 1;
  transform: scale(1);
  transition:
    transform 250ms ease,
    box-shadow 250ms ease;
}

.theme-toggle:hover {
  box-shadow: 0 6px 24px rgba(245, 158, 11, 0.5);
  transform: translateY(-2px) scale(1.05);
}

.theme-toggle svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =========================================================
   Music Player
   ========================================================= */

/* FAB toggle button */
.music-fab {
  position: fixed;
  right: 14px;
  bottom: 204px;
  z-index: 50;
  border: none;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
  cursor: pointer;
  font-size: 0;
  opacity: 1;
  transform: scale(1);
  transition:
    transform 250ms ease,
    box-shadow 250ms ease,
    background 250ms ease;
}

.music-fab:hover {
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.55);
  transform: translateY(-2px) scale(1.05);
}

.music-fab.is-playing {
  animation: music-fab-pulse 2s ease-in-out infinite;
}

@keyframes music-fab-pulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4); }
  50%       { box-shadow: 0 4px 28px rgba(16, 185, 129, 0.75); }
}

/* Floating panel */
.music-panel {
  position: fixed;
  right: 14px;
  bottom: 268px;          /* sits above the FAB */
  z-index: 50;
  width: min(320px, calc(100vw - 28px));
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;

  /* hidden by default */
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  pointer-events: none;
  transition:
    opacity 280ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
}

.music-panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Close button */
.music-panel-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  line-height: 1;
  transition: color 150ms ease, background 150ms ease;
  z-index: 1;
}

.music-panel-close:hover {
  color: var(--text);
  background: var(--line);
}

/* Track info */
.music-track-info {
  padding: 14px 40px 10px 16px;
}

.music-track-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-track-artist {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Visualizer canvas */
.music-visualizer {
  width: 100%;
  height: 64px;
  display: block;
  background: transparent;
}

/* Progress */
.music-progress-wrap {
  padding: 6px 16px 4px;
}

.music-progress-bg {
  height: 4px;
  background: var(--line);
  border-radius: 99px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.music-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: 99px;
  transition: width 500ms linear;
  pointer-events: none;
}

.music-time {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 4px;
}

/* Volume */
.music-volume-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 10px;
}

.music-volume-wrap svg {
  flex-shrink: 0;
  color: var(--muted);
}

.music-volume {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 99px;
  background: var(--line);
  outline: none;
  cursor: pointer;
}

.music-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #10b981;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(16,185,129,0.4);
  transition: transform 150ms ease;
}

.music-volume::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.music-volume::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: none;
  border-radius: 50%;
  background: #10b981;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(16,185,129,0.4);
}

/* Controls */
.music-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px 16px;
}

.music-btn {
  border: none;
  background: var(--line);
  color: var(--text);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease, color 150ms ease;
  flex-shrink: 0;
}

.music-btn:hover {
  background: var(--accent);
  color: #fff;
  transform: scale(1.08);
}

.music-btn--main {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.music-btn--main:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.55);
  transform: scale(1.1);
}

.music-btn:disabled {
  opacity: 0.35;
  cursor: default;
  transform: none;
}

/* =========================================================*/

.error {
  margin-top: 18px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.35);
  color: var(--muted);
  font-size: 0.95rem;
}

@media (min-width: 720px) {
  :root {
    --gutter-left: 40px;
    --line-x: 16px;
    --dot-size: 11px;
  }
  .item {
    padding: 16px 18px;
  }
  .title h2 {
    font-size: 1.1rem;
  }
}

/* Top-højre: dato + tags */
.title-right {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Meta/tags når de ligger i title-right */
.title-right .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0; /* vigtigt når meta flyttes op */
}

/* --- Thumbnails --- */
.thumbs {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 2px;
}

.thumb {
  flex: 0 0 auto;
  width: 61px;
  height: 61px;
  border-radius: 12px;
  border: 1px solid var(--accent);
  background: rgba(255, 255, 255, 0.18);
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
  overflow: hidden;
}

.thumb:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.thumb img {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  object-fit: cover;
  display: block;
}

/* --- Thumbnail collapse --- */
.thumbs-wrapper {
  position: relative;
}

.thumbs.is-collapsed {
  max-height: 226px;
  overflow: hidden;
  position: relative;
}

.thumbs.is-collapsed::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to bottom, transparent, var(--surface));
  pointer-events: none;
}

.thumbs-expand {
  margin-top: 8px;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  background: var(--surface);
  color: var(--accent);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 200ms ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.thumbs-expand:hover {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.thumbs-expand svg {
  width: 16px;
  height: 16px;
  transition: transform 200ms ease;
}

.thumbs-expand.is-expanded svg {
  transform: rotate(180deg);
}

/* --- Modal --- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none; /* toggles to grid */
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
}

.modal.is-open {
  display: grid;
}

.modal-panel {
  position: relative;
  width: min(1400px, 100%);
  height: 90vh;
  height: 90dvh;
  margin-top: 5vh;
  margin-top: 5dvh;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-solid, #fff);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-img-container {
  width: 100%;
  flex: 1 1 0;
  min-height: 0;
  background: #000;
  overflow: hidden;
  position: relative;
  cursor: grab;
  touch-action: none;  /* we handle all gestures via JS */
}

.modal-img-container.is-dragging {
  cursor: grabbing;
}

.modal-img-container.is-zoomed {
  cursor: move;
}

/* ---- Swipe track: 3 slides side-by-side, positioned via translate3d ---- */
.swipe-track {
  display: flex;
  width: 300%;
  height: 100%;
  will-change: transform;
}

/* Snap-back / snap-forward easing after finger release */
.swipe-track.is-animating {
  transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.swipe-slide {
  flex: 0 0 33.3333%;
  width: 33.3333%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Allow zoomed image to paint beyond its slide */
.modal-img-container.is-zoomed .swipe-slide {
  overflow: visible;
}

.modal-img {
  max-width: 100%;
  max-height: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  transform-origin: 0 0;
  user-select: none;
  -webkit-user-drag: none;
  flex-shrink: 0;
  will-change: transform;
}

.modal-close {
  position: fixed;
  top: 20px;
  right: 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border-radius: 999px;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  z-index: 110;
  transition: background 200ms ease, opacity 200ms ease, transform 200ms ease;
  backdrop-filter: blur(10px);
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.85);
  transform: scale(1.1);
}

/* Zoom controls */
.modal-zoom-controls {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 110;
  display: flex;
  gap: 8px;
}

.modal-zoom-btn {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border-radius: 999px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background 200ms ease, opacity 200ms ease;
  backdrop-filter: blur(10px);
  font-weight: 400;
}

.modal-zoom-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.85);
}

.modal-zoom-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.modal-zoom-btn svg {
  display: block;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.85);
}

html.dark .modal-close {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

html.dark .modal-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

html.dark .modal-zoom-btn {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

html.dark .modal-zoom-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.25);
}

/* Navigation arrows */
.modal-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 110;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border-radius: 999px;
  padding: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 200ms ease, opacity 200ms ease;
  backdrop-filter: blur(10px);
}

.modal-nav:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.85);
}

.modal-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.modal-prev {
  left: 20px;
}

.modal-next {
  right: 20px;
}

.modal-nav svg {
  display: block;
  width: 24px;
  height: 24px;
}

html.dark .modal-nav {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

html.dark .modal-nav:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.25);
}

html.dark .modal {
  background: rgba(0, 0, 0, 0.85);
}

html.dark .title {
  background: rgba(30, 41, 59, 0.8);
  border-bottom-color: rgba(229, 231, 235, 0.2);
}

html.dark .secondary {
  background: rgba(15, 23, 42, 0.85);
  border-bottom-color: rgba(229, 231, 235, 0.06);
}

@media (max-width: 640px) {
  .modal-close {
    top: 10px;
    right: 10px;
    padding: 10px 12px;
    font-size: 16px;
  }
  .modal-zoom-controls {
    top: 10px;
    gap: 6px;
  }
  .modal-zoom-btn {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
  .modal-nav {
    display: none !important;
  }
  
  /* Horizontal button layout for mobile */
  .theme-toggle {
    bottom: 14px;
    right: 76px;
    width: 46px;
    height: 46px;
  }
  
  .to-top {
    bottom: 14px;
    right: 196px;
    width: 46px;
    height: 46px;
  }
  
  .to-bottom {
    bottom: 14px;
    right: 136px;
    width: 46px;
    height: 46px;
  }

  .music-fab {
    bottom: 14px;
    right: 14px;
    width: 46px;
    height: 46px;
  }

  .music-panel {
    bottom: 74px;
    right: 6px;
    left: 6px;
    width: auto;
    border-radius: 14px;
  }
  
  .theme-toggle svg,
  .to-top svg,
  .to-bottom svg {
    width: 20px;
    height: 20px;
  }
}

/* Respektér reduce motion */
@media (prefers-reduced-motion: reduce) {
  .modal {
    background: rgba(0, 0, 0, 0.7);
  }
}

.modal-caption {
  padding: 14px 18px;
  font-size: 0.95rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: var(--surface);
  white-space: pre-line;
  max-height: 300px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 300ms cubic-bezier(0.4, 0, 0.2, 1),
              padding 300ms ease;
}

.modal-caption.is-hidden {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-top-width: 0;
}
