/* =========================================================
   directory.css — the ranked guide on Eat & Drink and Things
   to Do (assets/js/directory.js, RULE directory). Built on the
   Concierge tokens in base.css/concierge.css: it adds the group
   tabs, the rank and rating marks on a card, the typographic
   stand-in for a place we have no verified photo of, the live
   status line, and the detail sheet.
   ========================================================= */

/* ---------- groups: Eat · Drink · Music ---------- */
.dir-groups { display: flex; flex-wrap: wrap; gap: 6px; padding: 5px; border-radius: 999px; background: rgba(var(--hl), .04); border: 1px solid var(--line); width: max-content; max-width: 100%; margin-bottom: 18px; }
.dir-group {
  background: transparent; border: 0;
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 20px; border-radius: 999px;
  font-family: var(--display); font-weight: 800; font-stretch: 108%; font-size: 15px; letter-spacing: -.01em; color: var(--text-2);
  transition: background-color .15s, color .15s;
}
.dir-group:hover { color: var(--text); }
.dir-group[aria-selected="true"] { background: var(--text); color: var(--bg); }
.dir-group .n { font-family: var(--mono); font-weight: 500; font-size: 11px; opacity: .6; }

/* ---------- controls ---------- */
.dir-controls { gap: 12px 14px; justify-content: flex-start; }
.dir-controls .search { flex: 1 1 240px; max-width: 360px; }
.dir-select { display: inline-flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 13px; }
.dir-select .select { min-height: 46px; border-radius: 999px; padding: 0 38px 0 16px; font-size: 14px; width: auto; }
.dir-toggles { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.dir-count { margin: -10px 0 18px; }

/* ---------- the menus: Eat & Drink (Oct. 1, 2026) ----------
   The tabs and the search on one row, then four menus that directory.js
   builds from the [data-dir-menu] boxes: a two-line pill (what it is, then
   what it's set to) opening a listbox panel under it. A menu that narrows
   the list wears the gold. Things to Do keeps the chips and selects above. */
.dir-head { display: grid; gap: 28px; } /* more room under the tabs (Oct. 1, 2026; was 12px) */
.dir-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
/* The Eat / Drink / Music tabs, a lot bigger (Oct. 1, 2026; were 38px tall at 14px). */
.dir-top .dir-groups { margin-bottom: 0; gap: 6px; padding: 6px; }
.dir-top .dir-group { min-height: 60px; padding: 0 30px; gap: 10px; font-size: 22px; }
.dir-top .dir-group .n { font-size: 13px; }
.dir-top .search .input { min-height: 54px; }
.dir-top .search { flex: 1 1 280px; max-width: 400px; }
.dir-menus { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.dir-menu { position: relative; min-width: 0; min-height: 54px; } /* the row keeps its height before the script fills it */
.dir-menu-btn {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 8px;
  width: 100%; min-height: 54px; padding: 7px 14px 7px 20px; text-align: left;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--field); color: var(--text);
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.dir-menu-btn:hover { border-color: var(--line-hi); }
.dir-menu.is-open .dir-menu-btn { border-color: var(--line-hi); box-shadow: 0 0 0 3px var(--fill-2); }
.dir-menu-k {
  grid-column: 1; display: flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10px; line-height: 1.3; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3);
}
.dir-menu-v { grid-column: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; font-weight: 600; line-height: 1.4; letter-spacing: -.005em; }
.dir-menu-chev { grid-column: 2; grid-row: 1 / span 2; width: 16px; height: 16px; color: var(--text-3); transition: transform .2s var(--ease), color .15s; }
.dir-menu-btn:hover .dir-menu-chev, .dir-menu.is-open .dir-menu-chev { color: var(--text); }
.dir-menu.is-open .dir-menu-chev { transform: rotate(180deg); }
/* On: the list is narrowed by this menu. */
.dir-menu.is-on .dir-menu-btn { border-color: rgba(var(--gold-rgb), .7); background: linear-gradient(rgba(var(--gold-rgb), .1), rgba(var(--gold-rgb), .1)), var(--field); }
.dir-menu.is-on .dir-menu-btn:hover { border-color: rgb(var(--gold-rgb)); }
.dir-menu.is-on .dir-menu-k { color: var(--gold); }
.dir-menu.is-on .dir-menu-k::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--gold-fill); }

/* The panel: rows with a check on the choice and the count at the right. */
.dir-pop {
  position: absolute; z-index: 40; top: calc(100% + 8px); left: 0;
  display: grid; align-content: start; gap: 2px; width: max-content; min-width: 100%; max-width: min(600px, calc(100vw - 24px)); max-height: 460px;
  padding: 6px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  background: var(--surface-hi); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow-pop);
  transform-origin: top left; animation: dir-pop .16s var(--ease);
}
.dir-pop:focus-visible { outline: none; } /* the highlighted row shows where the keys are */
.dir-pop.is-cols { grid-template-columns: repeat(2, minmax(190px, 1fr)); grid-template-rows: repeat(var(--rows), auto); grid-auto-flow: column; column-gap: 4px; }
@keyframes dir-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.dir-pop [role="option"] {
  display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  min-height: 40px; padding: 8px 12px 8px 10px; border-radius: 10px;
  font-size: 14.5px; line-height: 1.3; color: var(--text-2); cursor: pointer; user-select: none;
}
.dir-pop .is-active { background: var(--fill-2); color: var(--text); }
.dir-pop [aria-selected="true"] { color: var(--text); font-weight: 600; }
.dir-pop .is-none { color: var(--text-3); } /* nothing there with the other filters as they are */
.dir-pop .is-none .dir-opt-n { opacity: .55; }
.dir-opt-tick { width: 16px; height: 16px; color: var(--gold); visibility: hidden; }
.dir-pop [aria-selected="true"] > .dir-opt-tick { visibility: visible; }
.dir-opt-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir-opt-n { font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* The count, and Clear filters while anything narrows the list. */
.dir-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 20px 0 18px; }
.dir-status .dir-count { margin: 0; }
.dir-clear {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 0; border: 0; background: none;
  font-size: 14px; font-weight: 600; color: var(--text);
  text-decoration: underline; text-decoration-color: var(--line-hi); text-underline-offset: 4px; transition: text-decoration-color .15s;
}
.dir-clear:hover { text-decoration-color: currentColor; }
.dir-clear .ic { width: 14px; height: 14px; }
.dir-status + .grid > .empty { grid-column: 1 / -1; } /* nothing found: the note spans the row */

@media (max-width: 900px) { .dir-menus { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }
@media (max-width: 760px) {
  .dir-top { flex-direction: column; align-items: stretch; row-gap: 20px; }
  .dir-top .dir-group { min-height: 54px; padding: 0 10px; font-size: 18px; }
  .dir-top .search { flex: none; max-width: none; }
  .dir-menu, .dir-menu-btn { min-height: 52px; }
  .dir-menu-btn { padding: 6px 10px 6px 14px; column-gap: 4px; }
  .dir-menu-v { font-size: 13.5px; }
  .dir-pop { min-width: min(calc(100vw - 2 * var(--gut)), 420px); } /* on a phone, the width of the row of menus */
  .dir-pop.is-cols { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-flow: row; }
  .dir-pop [role="option"] { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .dir-pop { animation: none; } .dir-menu-chev { transition: none; } }

/* ---------- the card ---------- */
.dir-card .card-media { aspect-ratio: 4 / 3; }
.dir-card .card-body { gap: 7px; }
.dir-rank {
  position: absolute; z-index: 1; left: 12px; bottom: 12px; display: inline-flex; align-items: baseline; gap: 6px;
  padding: 5px 10px 5px 8px; border-radius: 999px; background: rgba(5, 8, 13, .78); color: #F3EFE5; backdrop-filter: blur(6px);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; border: 1px solid rgba(255, 255, 255, .12);
}
.dir-rank b { font-family: var(--display); font-size: 15px; letter-spacing: -.01em; color: var(--gold-hi); }
.dir-pick { left: auto !important; right: 12px; }
.card-media .tag-featured.dir-pick { background: var(--gold-fill); color: var(--ink); border-color: var(--gold-fill); }
.dir-credit {
  position: absolute; z-index: 1; right: 8px; bottom: 6px; max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 9.5px; color: rgba(243, 239, 229, .72); text-shadow: 0 1px 2px rgba(0, 0, 0, .8);
}
.dir-ph {
  position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden;
  background:
    radial-gradient(120% 90% at 20% 0%, rgba(var(--gold-rgb), .22), transparent 60%),
    repeating-linear-gradient(135deg, rgba(var(--hl), .03) 0 10px, rgba(var(--hl), .06) 10px 11px),
    var(--surface-hi);
}
.dir-ph span { font-family: var(--display); font-weight: 900; font-stretch: 112%; font-size: clamp(54px, 7vw, 82px); letter-spacing: -.04em; color: rgba(var(--hl), .16); }
.dir-ph[data-g="drink"] { background-color: #16141c; }
.dir-ph[data-g="music"] { background-color: #121820; }
.dir-ph[data-g="wellness"] { background-color: #121a17; }

.dir-ratings { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13.5px; color: var(--text-2); }
.dir-r { display: inline-flex; align-items: baseline; gap: 4px; font-variant-numeric: tabular-nums; }
.dir-r b { font-weight: 600; color: var(--text-3); font-size: 11px; font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.dir-star { color: var(--gold); }
.dir-r small { color: var(--text-3); font-size: 12px; }
.dir-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.dir-badge {
  display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: rgba(var(--gold-rgb), .1); border: 1px solid rgba(var(--gold-rgb), .3); color: var(--gold-hi);
}
.dir-line { font-size: 14px; line-height: 1.5; color: var(--text-2); }
.dir-line span, .dir-now span {
  margin-right: 8px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold);
}
.dir-now { font-size: 13.5px; color: var(--text-2); }
.dir-now.is-live span { color: var(--live); }
.dir-now.is-live span::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--live); vertical-align: 1px; animation: dir-pulse 1.8s ease-out infinite; }
.dir-now.is-closed span { color: var(--text-3); }
@keyframes dir-pulse { 0% { box-shadow: 0 0 0 0 rgba(74, 222, 155, .6); } 70%, 100% { box-shadow: 0 0 0 7px rgba(74, 222, 155, 0); } }
.dir-acts { display: inline-flex; flex-wrap: wrap; gap: 6px 14px; }

/* ---------- how we rank ---------- */
.dir-how { margin-top: 34px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.dir-how > summary { cursor: pointer; padding: 16px 20px; font-weight: 600; color: var(--text); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.dir-how > summary::-webkit-details-marker { display: none; }
.dir-how > summary::after { content: "+"; color: var(--gold); font-size: 20px; line-height: 1; }
.dir-how[open] > summary::after { content: "–"; }
.dir-how-body { padding: 0 20px 20px; color: var(--text-2); font-size: 15px; line-height: 1.6; display: grid; gap: 10px; }
.dir-how-body b { color: var(--text); }

/* ---------- the detail sheet ---------- */
dialog.dir-sheet {
  width: min(980px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; margin: auto; overflow: auto;
  border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-float);
}
dialog.dir-sheet::backdrop { background: rgba(4, 6, 9, .72); backdrop-filter: blur(4px); }
.dir-sheet-close { position: sticky; top: 0; z-index: 3; display: flex; justify-content: flex-end; height: 0; }
.dir-x {
  margin: 12px 12px 0 0; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 15px;
  background: rgba(5, 8, 13, .78); color: #F3EFE5; border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(6px);
}
.dir-x:hover { background: rgba(5, 8, 13, .92); }
.dir-sheet-media { position: relative; aspect-ratio: 21 / 8; background: var(--fill); overflow: hidden; }
.dir-sheet-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dir-sheet-media .dir-credit { display: none; }
.dir-sheet-media:has(.dir-ph) { aspect-ratio: 21 / 5; }
.dir-sheet-media::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to top, var(--surface) 0%, rgba(var(--surface-rgb), .2) 40%, transparent 70%); }
.dir-photo-credit { margin: 6px 26px 0; font-size: 11.5px; color: var(--text-3); }
.dir-photo-credit a { color: inherit; text-decoration: underline; }
.dir-sheet-body { display: grid; gap: 12px; padding: 10px clamp(18px, 3vw, 30px) 28px; }
.dir-sheet-title { font-family: var(--display); font-weight: 900; font-stretch: 112%; font-size: clamp(30px, 4vw, 44px); line-height: 1; letter-spacing: -.03em; }
.dir-sheet-ranks { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.dir-sheet-lede { font-size: 17px; line-height: 1.55; color: var(--text-lede); max-width: 70ch; }
.dir-feature { padding: 10px 14px; border-radius: var(--r-sm); background: rgba(var(--gold-rgb), .1); border: 1px solid rgba(var(--gold-rgb), .3); font-size: 14.5px; }
.dir-sheet-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 36px); margin-top: 8px; }
.dir-sheet-main, .dir-sheet-side { display: grid; gap: 20px; align-content: start; }
.dir-sheet-body h3 { font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }
.dir-sheet-body section p { font-size: 15px; line-height: 1.6; color: var(--text-2); }
.dir-sheet-body a:not(.btn) { color: var(--gold); }
.dir-timing { color: var(--text) !important; }
.dir-timing small { display: block; font-size: 12px; color: var(--text-3); }
.dir-list { display: grid; gap: 6px; padding-left: 18px; color: var(--text-2); font-size: 15px; line-height: 1.5; list-style: disc; }
.dir-list li::marker { color: var(--gold); }
.dir-windows { display: grid; gap: 8px; font-size: 14.5px; color: var(--text-2); }
.dir-windows b { color: var(--text); font-weight: 600; margin-right: 6px; }
.dir-windows a { font-size: 12px; }
.dir-facts { display: grid; gap: 8px; }
.dir-facts > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; font-size: 14.5px; }
.dir-facts dt { color: var(--text-3); }
.dir-facts dd { color: var(--text-2); overflow-wrap: anywhere; }
.dir-facts + .btn { margin-top: 12px; }
.dir-hours { width: 100%; border-collapse: collapse; font-size: 14px; }
.dir-hours th { text-align: left; font-weight: 500; color: var(--text-3); padding: 4px 10px 4px 0; width: 42%; }
.dir-hours td { color: var(--text-2); padding: 4px 0; font-variant-numeric: tabular-nums; }
.dir-scores { display: grid; gap: 12px; }
.dir-score { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 2px 10px; align-items: center; }
.dir-score dt { font-size: 13.5px; color: var(--text-2); }
.dir-score dd { display: flex; gap: 10px; align-items: center; }
.dir-score dd b { font-variant-numeric: tabular-nums; font-size: 13px; min-width: 2ch; text-align: right; }
.dir-bar { flex: 1; height: 7px; border-radius: 99px; background: rgba(var(--hl), .08); overflow: hidden; }
.dir-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, rgba(var(--gold-rgb), .55), var(--gold)); }
.dir-score-note { grid-column: 2; font-size: 11.5px; line-height: 1.4; color: var(--text-3); }
.dir-small { font-size: 12.5px; color: var(--text-3); line-height: 1.5; }
.dir-sheet-foot { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 6px; }
.dir-sheet .card-tip { margin-top: 0; font-size: 15px; }

@media (max-width: 760px) {
  .dir-sheet-grid { grid-template-columns: minmax(0, 1fr); }
  .dir-sheet-media { aspect-ratio: 16 / 9; }
  dialog.dir-sheet { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
  .dir-groups { width: 100%; }
  .dir-group { flex: 1 1 0; justify-content: center; padding: 0 10px; }
  .dir-controls .search { max-width: none; }
  .dir-select { flex: 1 1 45%; }
  .dir-select .select { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .dir-now.is-live span::before { animation: none; } }

/* day theme: the cream ground */
:root[data-theme="light"] .dir-group[aria-selected="true"], :root:has(> body.is-cream) .dir-group[aria-selected="true"] { background: var(--ink); color: #F3EFE5; }
:root[data-theme="light"] .dir-ph, :root:has(> body.is-cream) .dir-ph { background-color: #f1eadc; }
:root[data-theme="light"] .dir-ph span, :root:has(> body.is-cream) .dir-ph span { color: rgba(8, 9, 11, .12); }
:root[data-theme="light"] .dir-badge, :root:has(> body.is-cream) .dir-badge { color: var(--ink); }
