/* ==========================================================================
   Vinyl Resistance - Dubplate cutting directory
   ========================================================================== */

:root {
  --bg:          #0b0b0c;
  --bg-panel:    #131315;
  --bg-raised:   #1a1a1d;
  --line:        #2a2a2e;
  --line-soft:   #202024;
  --text:        #f1efec;
  --text-muted:  #9a978f;
  --text-dim:    #6d6a64;
  --accent:      #ff5a1f;
  --accent-soft: rgba(255, 90, 31, 0.14);
  --focus:       #ffd166;

  --radius: 4px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
a:hover { color: #ff7d4d; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.wrap {
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
  padding-inline: 20px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #120b06;
  padding: 10px 16px;
  z-index: 1000;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

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

.site-header {
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(900px 340px at 12% -40%, rgba(255, 90, 31, 0.10), transparent 70%),
    var(--bg);
  padding-block: 34px 26px;
}

.brand {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.site-header h1 {
  margin: 0;
  font-size: clamp(1.7rem, 4.6vw, 2.9rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  font-weight: 800;
}

/* Introduction text with the photograph alongside it on wider screens. */
.header-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
}

.intro {
  margin: 0;
  max-width: 66ch;
}

.header-photo {
  margin: 0;
}

.header-photo img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-panel);
}

.header-photo figcaption {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-dim);
}

.intro p {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.intro p:nth-child(-n + 2) { color: var(--text); }
.intro p:last-child { margin-bottom: 0; }

.intro__submit {
  margin-top: 14px !important;
  color: var(--text) !important;
}
.intro__submit a {
  font-weight: 600;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

.intro__how {
  margin-top: 14px !important;
  padding-left: 12px;
  border-left: 2px solid var(--accent);
  font-size: 0.88rem !important;
  color: var(--text-dim) !important;
}

/* --- Toolbar -------------------------------------------------------------- */

.toolbar-wrap { padding-block: 18px 0; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: flex-end;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field--search { flex: 1 1 260px; min-width: 0; }

.field__label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.toolbar input,
.toolbar select {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  padding: 9px 12px;
  width: 100%;
  max-width: 100%;
}
.toolbar input::placeholder { color: var(--text-dim); }
.toolbar input:focus,
.toolbar select:focus { border-color: var(--accent); }

.count {
  margin: 0 0 9px auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

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

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 22px;
  padding-block: 18px 40px;
  align-items: start;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
}

.panel--map {
  position: sticky;
  top: 18px;
  overflow: hidden;
}

#map {
  height: clamp(420px, calc(100vh - 200px), 760px);
  width: 100%;
  background: #101014;
}

/* OpenStreetMap's tiles are light. Inverting them and rotating the hue back
   gives a dark basemap without needing a keyed tile service. The filter is
   confined to the tile pane so that markers, tooltips, popups and the
   attribution control keep their intended colours. */
#map.map--darkened .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.86) saturate(0.55);
}

.map-note {
  margin: 0;
  padding: 9px 14px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  min-height: 34px;
}
.map-note--warn { color: var(--focus); }

.panel--list {
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  scrollbar-width: thin;
}

/* --- Directory listing ---------------------------------------------------- */

.list { padding: 6px 0 10px; }

.status {
  margin: 0;
  padding: 22px 18px;
  color: var(--text-muted);
  font-size: 0.93rem;
}

.group-head {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0;
  padding: 11px 18px;
  background: var(--bg-raised);
  border-block: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.group-head span { color: var(--text-dim); }

.entry {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.entry:last-child { border-bottom: 0; }

.entry__name {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.entry__place {
  margin: 3px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
}
.entry__place .pc { color: var(--text-dim); }

.entry__notes {
  margin: 8px 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.entry__links {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  display: inline-block;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}
.btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.entry--unmapped .entry__name::after {
  content: "not on map";
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  vertical-align: middle;
}

/* --- Map markers ---------------------------------------------------------- */

.vr-pin {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #0b0b0c;
  box-shadow: 0 0 0 1px rgba(255, 90, 31, 0.55), 0 0 12px rgba(255, 90, 31, 0.45);
  position: relative;
  cursor: pointer;
}
.vr-pin::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #0b0b0c;
}

.leaflet-marker-icon:focus-visible .vr-pin,
.leaflet-marker-icon.vr-pin-wrap:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.leaflet-tooltip.vr-tip {
  background: #17171a;
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  padding: 5px 9px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}
.leaflet-tooltip.vr-tip::before { border-top-color: var(--line); }
.leaflet-tooltip.vr-tip .vr-tip__sub {
  display: block;
  color: var(--text-dim);
  font-size: 11px;
}

.leaflet-popup-content-wrapper {
  background: #17171a;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.leaflet-popup-tip { background: #17171a; border: 1px solid var(--line); }
.leaflet-popup-content { margin: 12px 14px; font-size: 0.92rem; }
.leaflet-popup-content strong { display: block; font-size: 1rem; }
.leaflet-popup-content .vr-pop__place {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
}
a.leaflet-popup-close-button { color: var(--text-dim) !important; }

.leaflet-container { background: #101014; font-family: var(--sans); }
.leaflet-control-attribution {
  background: rgba(11, 11, 12, 0.82) !important;
  color: var(--text-dim) !important;
  font-size: 10px !important;
}
.leaflet-control-attribution a { color: var(--text-muted) !important; }
.leaflet-bar a {
  background: #17171a;
  color: var(--text);
  border-bottom-color: var(--line);
}
.leaflet-bar a:hover { background: var(--bg-raised); color: var(--accent); }

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

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 24px 42px;
  color: var(--text-dim);
  font-size: 0.85rem;
}
.site-footer p { margin: 0 0 8px; }
.site-footer .fine { color: var(--text-dim); font-size: 0.8rem; }

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

@media (max-width: 900px) {
  .header-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .header-photo img { max-width: 300px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .panel--map { position: static; }
  #map { height: 60vh; min-height: 340px; }
  .panel--list { max-height: none; overflow: visible; }
  .count { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
