/* ============================================================
   tur.fbdk.dk — one hour out of Orsara Bormida
   ============================================================ */

:root {
  --ink:      #17151c;
  --ink-2:    #201d26;
  --ink-3:    #2b2733;
  --ink-4:    #383243;
  --sand:     #efe6d6;
  --sand-dim: #cfc4b2;
  --muted:    #948a7d;
  --line:     rgba(239, 230, 214, 0.13);
  --line-2:   rgba(239, 230, 214, 0.26);
  --barbera:  #b4304f;
  --brass:    #c89b3c;

  --c-eat:  #b4304f;
  --c-wine: #8257ae;
  --c-walk: #5c8c3e;
  --c-see:  #c89b3c;
  --c-shop: #d2703a;
  --c-sea:  #2e8b9e;
  --c-serv: #7a8290;

  --rail: 384px;
  --display: 'Bodoni Moda', 'Didot', Georgia, serif;
  --body: 'Archivo', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', monospace;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--ink);
  color: var(--sand);
  font-family: var(--body);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--brass); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ink-4); border-radius: 9px; }
::-webkit-scrollbar-thumb:hover { background: #4a4358; }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---------------------------------------------------- shell */

.shell {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  height: 100dvh;
  width: 100%;
}

/* ---------------------------------------------------- rail */

.rail {
  background: var(--ink);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  z-index: 500;
}

.masthead {
  padding: 26px 24px 18px;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.eyebrow .pip {
  width: 5px; height: 5px;
  background: var(--barbera);
  border-radius: 50%;
  display: inline-block;
  transform: translateY(-1px);
}

.wordmark {
  font-family: var(--display);
  font-weight: 400;
  font-size: 41px;
  line-height: 0.92;
  letter-spacing: -0.015em;
  margin: 0 0 10px;
}

.wordmark em {
  font-style: italic;
  color: var(--brass);
}

.standfirst {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--sand-dim);
  max-width: 30ch;
}

/* ---------------------------------------------------- controls */

.controls {
  padding: 16px 24px 14px;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.field {
  position: relative;
  margin-bottom: 15px;
}

.field input[type="search"] {
  width: 100%;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--sand);
  padding: 10px 12px 10px 32px;
  font-family: var(--body);
  font-size: 13.5px;
  -webkit-appearance: none;
}

.field input[type="search"]::placeholder { color: var(--muted); }
.field input[type="search"]:focus { border-color: var(--line-2); outline: none; }

.field .icon {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
}

.ctrl-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.ctrl-label b {
  color: var(--sand);
  font-weight: 500;
  letter-spacing: 0.05em;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 15px;
}

.chip {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 100px;
  padding: 4.5px 11px 5px;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--sand-dim);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s, border-color .15s, color .15s;
}

.chip .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: .45;
  transition: opacity .15s;
}

.chip[aria-pressed="true"] {
  border-color: currentColor;
  background: rgba(239, 230, 214, 0.06);
  color: var(--sand);
}

.chip[aria-pressed="true"] .dot { opacity: 1; }
.chip:hover { border-color: var(--line-2); }

.slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  height: 22px;
  margin: 0;
}

.slider::-webkit-slider-runnable-track {
  height: 2px;
  background: var(--ink-4);
}

.slider::-moz-range-track { height: 2px; background: var(--ink-4); }

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--brass);
  margin-top: -5.5px;
  border: none;
}

.slider::-moz-range-thumb {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--brass);
  border: none;
}

.tickrow {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
  margin-top: -2px;
}

.daybar {
  display: flex;
  gap: 3px;
  margin-top: 4px;
}

.daybtn {
  flex: 1;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  padding: 6px 0;
  border-radius: 2px;
  transition: all .15s;
}

.daybtn[aria-pressed="true"] {
  background: var(--brass);
  border-color: var(--brass);
  color: var(--ink);
  font-weight: 600;
}

.daybtn.is-today:not([aria-pressed="true"]) { color: var(--brass); border-color: rgba(200,155,60,.35); }
.daybtn:hover { border-color: var(--line-2); }

.toggles {
  display: flex;
  gap: 14px;
  margin-top: 13px;
  font-size: 11.5px;
  color: var(--sand-dim);
  flex-wrap: wrap;
}

.toggles label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.toggles input { accent-color: var(--brass); width: 13px; height: 13px; }

/* ---------------------------------------------------- list */

.listhead {
  padding: 13px 24px 9px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  flex: none;
}

.list {
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 12px 20px;
}

.card {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 12px;
  transition: background .12s;
}

.card:hover, .card.is-active { background: var(--ink-2); }
.card:last-child { border-bottom: none; }

.card .nm {
  font-size: 14px;
  line-height: 1.25;
  font-weight: 500;
  grid-column: 1;
}

.card .mins {
  grid-column: 2;
  grid-row: 1 / span 2;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--sand-dim);
  white-space: nowrap;
  align-self: start;
  padding-top: 2px;
}

.card .meta {
  grid-column: 1;
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
}

.card .swatch {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex: none;
}

.card.is-shut .nm { color: var(--muted); }
.card.is-shut .shut {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--barbera);
}

.empty {
  padding: 34px 14px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.empty b { color: var(--sand); font-weight: 500; display: block; margin-bottom: 5px; }

.footnote {
  flex: none;
  margin: 0;
  padding: 11px 24px 14px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--muted);
  background: var(--ink);
}

/* ---------------------------------------------------- map */

.stage { position: relative; min-width: 0; }
#map { position: absolute; inset: 0; background: #dcd7cd; }

.leaflet-container { font-family: var(--body); background: #dcd7cd; }
.leaflet-control-attribution {
  background: rgba(23,21,28,.78) !important;
  color: var(--muted) !important;
  font-size: 9.5px !important;
  padding: 2px 6px !important;
}
.leaflet-control-attribution a { color: var(--sand-dim) !important; }
.leaflet-bar a {
  background: var(--ink-2);
  color: var(--sand);
  border-bottom-color: var(--line);
}
.leaflet-bar a:hover { background: var(--ink-3); color: var(--sand); }

.mapfail {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 40px;
  text-align: center;
  background: var(--ink-2);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  max-width: 46ch;
  margin: 0 auto;
}

.mapfail b { color: var(--sand); font-weight: 500; font-size: 15px; }

/* pins */

.pin {
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(23,21,28,.85);
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
  transition: transform .12s;
}

.pin.is-approx { border-style: dotted; }
.pin.is-planned { box-shadow: 0 0 0 3px var(--brass), 0 1px 4px rgba(0,0,0,.4); }
.pin.is-hot { transform: scale(1.55); z-index: 900; }

.basepin {
  width: 17px; height: 17px;
  border-radius: 50%;
  background: var(--ink);
  border: 3px solid var(--brass);
  box-shadow: 0 0 0 4px rgba(23,21,28,.5);
}

.ringlabel {
  font-family: var(--display);
  font-style: italic;
  font-size: 13px;
  color: #6d6357;
  white-space: nowrap;
  text-shadow: 0 0 4px rgba(255,255,255,.85), 0 0 10px rgba(255,255,255,.7);
}

/* popup */

.leaflet-popup-content-wrapper {
  background: var(--ink-2);
  color: var(--sand);
  border-radius: 3px;
  border: 1px solid var(--line-2);
  box-shadow: 0 14px 40px rgba(0,0,0,.5);
}

.leaflet-popup-content { margin: 0; }
.leaflet-popup-tip { background: var(--ink-2); border: 1px solid var(--line-2); }
.leaflet-popup-close-button { color: var(--muted) !important; padding: 7px 8px 0 0 !important; }
.leaflet-popup-close-button:hover { color: var(--sand) !important; }

.pop { padding: 15px 16px 14px; }

.pop .kicker {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .17em;
  text-transform: uppercase;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pop h3 {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.12;
  margin: 0 0 7px;
  color: var(--sand);
}

.pop .facts {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .04em;
  margin-bottom: 9px;
}

.pop p {
  margin: 0 0 11px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--sand-dim);
}

.pop .warn {
  border-left: 2px solid var(--barbera);
  padding: 6px 0 6px 9px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--sand-dim);
  margin-bottom: 11px;
}

.pop .acts { display: flex; gap: 6px; flex-wrap: wrap; }

.act {
  border: 1px solid var(--line-2);
  background: transparent;
  border-radius: 2px;
  padding: 6px 10px;
  font-size: 11.5px;
  color: var(--sand);
  text-decoration: none;
  display: inline-block;
  transition: background .13s;
}

.act:hover { background: var(--ink-3); }
.act.primary { background: var(--brass); border-color: var(--brass); color: var(--ink); font-weight: 600; }
.act.primary:hover { background: #d9ab48; }
.act.on { background: var(--barbera); border-color: var(--barbera); color: #fff; }

/* ---------------------------------------------------- plan tray */

.tray {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 316px;
  max-width: calc(100% - 36px);
  background: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: 3px;
  box-shadow: 0 18px 50px rgba(0,0,0,.55);
  z-index: 600;
  overflow: hidden;
}

.tray-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  user-select: none;
}

.tray-head h2 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  margin: 0;
  color: var(--sand);
  font-weight: 500;
}

.tray-head .count {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink);
  background: var(--brass);
  border-radius: 100px;
  padding: 1px 7px;
  font-weight: 600;
}

.tray-head .count.zero { background: var(--ink-3); color: var(--muted); }

.tray-body { max-height: 46vh; overflow-y: auto; }
.tray[data-open="false"] .tray-body,
.tray[data-open="false"] .tray-foot { display: none; }

.stop {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 9px;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
}

.stop .idx {
  font-family: var(--display);
  font-style: italic;
  font-size: 15px;
  color: var(--brass);
  text-align: center;
}

.stop .txt { min-width: 0; }
.stop .txt b { display: block; font-size: 12.5px; font-weight: 500; }
.stop .txt span { font-family: var(--mono); font-size: 9.5px; color: var(--muted); }
.stop .btns { display: flex; gap: 2px; }

.mini {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 3px 5px;
  font-size: 12px;
  line-height: 1;
  border-radius: 2px;
}

.mini:hover { color: var(--sand); background: var(--ink-3); }
.mini.kill:hover { color: var(--barbera); }

.tray-foot { padding: 12px 14px 14px; }

.legtotal {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .05em;
  margin-bottom: 10px;
  line-height: 1.7;
}

.legtotal b { color: var(--sand); font-weight: 500; }

.tray-foot .acts { display: flex; gap: 6px; }
.tray-foot .act { flex: 1; text-align: center; }

.tray-empty {
  padding: 18px 14px 20px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------------------------------------------------- responsive */

.railtoggle { display: none; }

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: 48vh 1fr;
  }
  .rail {
    border-right: none;
    border-top: 1px solid var(--line);
    grid-row: 2;
    min-height: 0;
  }
  .stage { grid-row: 1; }
  .masthead { padding: 16px 18px 13px; }
  .wordmark { font-size: 30px; }
  .standfirst { display: none; }
  .controls { padding: 13px 18px 11px; }
  .listhead { padding: 11px 18px 7px; }
  .footnote { padding: 9px 18px 12px; font-size: 10px; }
  .tray {
    right: 10px;
    bottom: 10px;
    width: 260px;
  }
  .tray-body { max-height: 30vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .leaflet-fade-anim .leaflet-tile { transition: none !important; }
}

@media print {
  .stage, .controls, .masthead .standfirst { display: none; }
  .shell { display: block; height: auto; }
  body { background: #fff; color: #000; }
}

/* ---------------------------------------------------- cellar notes */

.cellarbtn {
  margin-top: 14px;
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 100px;
  color: var(--sand-dim);
  font-size: 11.5px;
  padding: 5px 13px 6px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background .15s, color .15s, border-color .15s;
}

.cellarbtn::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--c-wine);
}

.cellarbtn:hover { background: rgba(239,230,214,.06); color: var(--sand); border-color: var(--sand-dim); }
.cellarbtn[aria-expanded="true"] { background: var(--c-wine); border-color: var(--c-wine); color: #fff; }
.cellarbtn[aria-expanded="true"]::before { background: #fff; }

.cellar {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 380px;
  max-width: 100%;
  background: var(--ink);
  border-left: 1px solid var(--line-2);
  box-shadow: -20px 0 60px rgba(0,0,0,.5);
  z-index: 700;
  display: flex;
  flex-direction: column;
  animation: slidein .22s ease-out;
}

.cellar[hidden] {
  display: none;
}

@keyframes slidein { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

.cellar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 15px;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.cellar-head h2 {
  font-family: var(--display);
  font-size: 27px;
  font-weight: 400;
  line-height: 1;
  margin: 0;
}

.cellar-body { overflow-y: auto; flex: 1 1 auto; min-height: 0; padding: 4px 0 8px; }

.vingroup {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 16px 20px 7px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
}

.vingroup i { width: 6px; height: 6px; border-radius: 50%; background: var(--c-wine); flex: none; }
.vingroup.white i { background: #d8cf9a; }
.vingroup.sparkling i { background: #cf7f9c; }

.vin { padding: 12px 20px; border-bottom: 1px solid var(--line); }

.vin h3 {
  font-family: var(--display);
  font-size: 16.5px;
  font-weight: 500;
  margin: 0 0 3px;
  line-height: 1.2;
}

.vin .vinmeta {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted);
  letter-spacing: .04em;
  margin-bottom: 6px;
}

.vin p { margin: 0; font-size: 12px; line-height: 1.55; color: var(--sand-dim); }

.cellar-foot {
  flex: none;
  margin: 0;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--muted);
}

@media (max-width: 900px) {
  .cellar { width: 100%; }
  .cellarbtn { margin-top: 10px; font-size: 11px; }
}

/* ---------------------------------------------------- denomination filter */

.docbanner {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 12px;
  padding: 8px 10px 8px 12px;
  background: rgba(130, 87, 174, .16);
  border-left: 2px solid var(--c-wine);
  font-size: 12px;
  color: var(--sand-dim);
}

.docbanner[hidden] { display: none; }
.docbanner b { color: var(--sand); font-weight: 500; }

.badges { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }

.badge {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 7px 3.5px;
  border-radius: 2px;
  border: 1px solid var(--line-2);
  color: var(--sand-dim);
}

.badge.doc { border-color: rgba(130,87,174,.55); color: #c3a6e0; }
.badge.bk-walkin { border-color: rgba(92,140,62,.6); color: #9dc57c; }
.badge.bk-callahead { border-color: rgba(200,155,60,.6); color: var(--brass); }
.badge.bk-bookahead { border-color: rgba(180,48,79,.7); color: #e0808f; }

.vinbtn {
  margin-top: 9px;
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  color: var(--sand-dim);
  font-size: 11px;
  padding: 5px 10px;
  transition: background .13s, color .13s, border-color .13s;
}

.vinbtn:hover { background: var(--c-wine); border-color: var(--c-wine); color: #fff; }
