:root {
  --ink: #050505;
  --paper: #f8f8f6;
  --blue: #087cff;
  --line: 5px;
  --heading-font: "TP Vorzeit Grotesk 40 P", "TP Vorzeit Grotesk", Arial, Helvetica, sans-serif;
  --text-font: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; }
body { background: var(--paper); color: var(--ink); font-family: var(--text-font); }
button, input { font: inherit; }
button { color: inherit; font-family: var(--text-font); }

#aegina-sound-map {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: var(--paper);
  font-weight: 700;
}

.map-shell { height: 100vh; padding-top: 49px; transition: padding-right 360ms cubic-bezier(.2,.8,.2,1); }
.map-shell.panel-open { padding-right: min(50vw, 44rem); }
.map-header {
  position: absolute; inset: 0 0 auto; z-index: 4; display: flex; height: 49px;
  align-items: center; justify-content: space-between; border-bottom: var(--line) solid var(--ink); background: var(--paper);
}
.map-header h1 { margin: 0; padding: 0 7px; font-family: var(--heading-font); font-size: clamp(1.2rem, 2.4vw, 2.1rem); line-height: 1; letter-spacing: -.06em; }
.header-close { display: none; margin-right: 5px; border: 0; border-left: var(--line) solid var(--ink); background: var(--blue); color: white; padding: 4px 8px; font-weight: 700; cursor: pointer; }
.map-stage { position: relative; height: 100%; overflow: hidden; }
#map-svg { display: block; width: 100%; height: 100%; touch-action: none; background: var(--paper); cursor: grab; }
#map-svg.dragging { cursor: grabbing; }
.water { fill: var(--paper); }
.island { fill: none; stroke: var(--ink); stroke-width: 5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.river { fill: none; stroke: var(--ink); stroke-opacity: .85; stroke-width: 2.4; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.ferry { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-dasharray: 9 8; vector-effect: non-scaling-stroke; }
.ferry-lane { stroke-opacity: .72; }
.ferry-label { fill: var(--ink); font-family: var(--text-font); font-size: 13px; font-weight: 700; letter-spacing: .03em; paint-order: stroke; stroke: var(--paper); stroke-width: 2px; stroke-linejoin: round; }
.pin { cursor: pointer; outline: none; }
.pin-hit { fill: transparent; stroke: none; pointer-events: all; }
.pin-marker { fill: var(--blue); stroke: none; transition: fill .15s ease, stroke .15s ease; }
.pin:hover .pin-marker, .pin:focus .pin-marker, .pin.selected .pin-marker { fill: var(--paper); stroke: var(--ink); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.map-tools { position: absolute; z-index: 3; top: 14px; left: 12px; display: grid; border: 3px solid var(--ink); background: var(--paper); }
.map-tools button { width: 41px; height: 37px; border: 0; border-bottom: 3px solid var(--ink); background: var(--paper); font-size: 1.65rem; font-weight: 700; line-height: 1; cursor: pointer; }
.map-tools button:last-child { border-bottom: 0; font-size: 1.35rem; }
.map-tools button:hover, .map-tools button:focus-visible { background: var(--blue); color: white; }
.map-hint { position: absolute; z-index: 2; bottom: 14px; left: 13px; margin: 0; padding: 4px 6px; background: var(--paper); border: 2px solid var(--ink); font-size: .8rem; }
.attribution { position: absolute; z-index: 2; right: 8px; bottom: 3px; margin: 0; font-size: .65rem; font-weight: 400; }
.attribution a { color: var(--ink); }
.map-version { position: absolute; z-index: 2; right: 8px; bottom: 22px; margin: 0; color: var(--ink); font-size: .78rem; line-height: 1; }

.detail-panel {
  position: absolute; z-index: 5; top: 0; right: 0; bottom: 0; width: min(50vw, 44rem); border-left: var(--line) solid var(--ink);
  background: var(--paper); transform: translateX(105%); transition: transform 360ms cubic-bezier(.2,.8,.2,1); overflow-y: auto;
}
.detail-panel.open { transform: translateX(0); }
.panel-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; height: 49px; border-bottom: var(--line) solid var(--ink); background: var(--paper); }
.panel-bar p { margin: 0; padding: 5px 8px; font-size: 1.05rem; }
.close-button { width: 49px; min-height: 49px; border: 0; border-left: var(--line) solid var(--ink); background: var(--paper); font-size: 2.2rem; line-height: .8; cursor: pointer; }
.close-button:hover, .close-button:focus-visible { background: var(--blue); color: white; }
.panel-content { padding: 6px 8px 24px; }
.panel-content h2 { margin: 0 0 12px; max-width: 15ch; font-family: var(--heading-font); font-size: clamp(2rem, 4vw, 4.2rem); line-height: .89; letter-spacing: -.065em; }
.panel-content p { margin: 0 0 18px; max-width: 52ch; font-size: clamp(1rem, 1.45vw, 1.35rem); line-height: 1.02; letter-spacing: -.035em; }
.content-image { display: block; width: calc(100% + 16px); max-height: 55vh; margin: 0 -8px 18px; object-fit: cover; border-top: var(--line) solid var(--ink); border-bottom: var(--line) solid var(--ink); }
.media-block { margin: 18px -8px 0; padding: 0 8px 12px; border-top: var(--line) solid var(--ink); border-bottom: var(--line) solid var(--ink); }
.media-label { margin: 0 -8px 8px; padding: 3px 8px; border-bottom: 3px solid var(--ink); font-size: .85rem; }
.media-label span { color: var(--blue); }
.player { display: grid; grid-template-columns: auto 1fr auto; gap: 7px; align-items: center; }
.player button { border: 3px solid var(--ink); background: var(--paper); min-height: 34px; padding: 2px 8px; font-weight: 700; cursor: pointer; }
.player button:hover, .player button:focus-visible, .player button.playing { background: var(--blue); color: white; }
.player input[type="range"] { width: 100%; accent-color: var(--blue); cursor: pointer; }
.player .time { min-width: 2.8rem; text-align: right; font-size: .78rem; }
.volume-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: .8rem; }
.volume-row input { width: min(12rem, 50%); accent-color: var(--blue); }
.video-frame { display: block; width: 100%; max-height: 38vh; background: var(--ink); }

@media (max-width: 720px) {
  .map-shell { padding-top: 44px; }
  .map-shell.panel-open { padding-right: 0; }
  .map-header { height: 44px; }
  .map-header h1 { font-size: 1.24rem; }
  .map-shell.panel-open .header-close { display: block; }
  .detail-panel { top: auto; width: 100%; height: 55vh; border-top: var(--line) solid var(--ink); border-left: 0; transform: translateY(105%); }
  .detail-panel.open { transform: translateY(0); }
  .panel-bar { height: 44px; }
  .close-button { min-height: 44px; width: 44px; }
  .panel-content h2 { font-size: clamp(2rem, 11vw, 3.2rem); }
  .panel-content p { font-size: 1.08rem; }
  .map-hint { display: none; }
  .attribution, .map-version { right: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  .map-shell, .detail-panel { transition: none; }
}
