/* BahtBeat — editorial night guide. One accent (baht-bus blue), one highlight (gold), flat surfaces, hairline borders. */
:root {
  --bg: #0e0f11;
  --surface: #16181b;
  --surface-2: #1d2024;
  --line: #2a2e34;
  --line-strong: #3b4048;
  --text: #ecebe6;
  --muted: #9b9c97;
  --faint: #6f716d;
  --accent: #5b8cff;        /* links, focus, selected text */
  --accent-solid: #2d63e0;  /* filled buttons (white text passes contrast) */
  --accent-soft: rgba(91, 140, 255, .12);
  --gold: #d9a441;
  --live: #2fbf71;
  --c-fest: #d9a441;
  --c-thai: #e2674c;
  --c-dj: #4fb0d8;
  --c-intl: #a58be0;
  --c-band: #2fbf71;
  --radius: 10px;
  --radius-sm: 6px;
  --font: "IBM Plex Sans", "IBM Plex Sans Thai", system-ui, -apple-system, sans-serif;
  --font-head: "IBM Plex Sans Condensed", "IBM Plex Sans Thai", system-ui, sans-serif;
  font-family: var(--font);
  color-scheme: dark;
}
:lang(th) { --font-head: "IBM Plex Sans Thai", system-ui, sans-serif; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5; font-size: 15px; -webkit-font-smoothing: antialiased; }
:lang(th) body, body:lang(th) { line-height: 1.6; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
small { color: var(--muted); font-weight: 400; font-size: .8em; }
h2 { font-family: var(--font-head); font-size: 1.15rem; font-weight: 700; letter-spacing: .005em; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
h2 small { font-family: var(--font); font-size: .78rem; }
.eyebrow { font-family: var(--font); font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
:lang(th) .eyebrow { letter-spacing: .02em; font-size: .8rem; }

/* header */
.top { padding: 18px 16px 10px; max-width: 1180px; margin: 0 auto; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { border-radius: 9px; }
.wordmark { font-family: "IBM Plex Sans Condensed", sans-serif; font-weight: 700; font-size: 1.7rem; letter-spacing: -.01em; line-height: 1; }
.wordmark span { color: var(--accent); }
.lang { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.lang button { border: 0; background: transparent; padding: 7px 12px; font-size: .8rem; font-weight: 600; color: var(--muted); min-height: 36px; min-width: 48px; }
.lang button + button { border-left: 1px solid var(--line-strong); }
.lang button.on { background: var(--text); color: var(--bg); }
.tagline { margin: 12px 0 0; font-size: .95rem; color: var(--text); max-width: 60ch; }
.meta { margin: 4px 0 0; font-size: .75rem; color: var(--faint); }

/* filters: sticky so they stay under the thumb */
.filters { position: sticky; top: 0; z-index: 1100; background: rgba(14, 15, 17, .94); backdrop-filter: blur(8px); padding: 10px 16px; display: grid; gap: 8px; border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); }
.filters > * { max-width: 1180px; width: 100%; margin: 0 auto; }
.seg, .chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.seg::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
.seg button { flex: none; border: 1px solid var(--line); background: transparent; border-radius: var(--radius-sm); padding: 6px 11px; font-size: .8rem; font-weight: 500; white-space: nowrap; min-height: 36px; color: var(--muted); }
.seg button:hover { color: var(--text); border-color: var(--line-strong); }
.seg button.on { background: var(--accent-solid); border-color: var(--accent-solid); color: #fff; }
.seg button.on small { color: rgba(255, 255, 255, .78); }
.chip { flex: none; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: transparent; border-radius: var(--radius-sm); padding: 6px 11px; font-size: .78rem; white-space: nowrap; min-height: 34px; color: var(--faint); }
.chip .dot { opacity: .35; }
.chip.on { color: var(--text); border-color: var(--line-strong); background: var(--surface); }
.chip.on .dot { opacity: 1; }
.chip.toggle .star { color: var(--faint); }
.chip.toggle.on { border-color: var(--gold); color: var(--text); }
.chip.toggle.on .star { color: var(--gold); }
.seg.small { margin-bottom: 12px; }

/* layout */
main { max-width: 1180px; margin: 0 auto; padding: 16px 16px 28px; display: grid; gap: 16px; grid-template-columns: 1fr; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
@media (min-width: 900px) {
  main { grid-template-columns: 1.15fr 1fr; align-items: start; }
  .pick, .feed-card, .list-card { grid-column: 1 / -1; }
  .cal { grid-row: span 2; }
}

/* top pick */
.pick { border-left: 3px solid var(--gold); padding-left: 18px; }
.pick-title { font-family: var(--font-head); font-size: 1.45rem; font-weight: 700; line-height: 1.2; margin: 0; }
.pick-title a { text-decoration: none; }
.pick-title a:hover { color: var(--accent); }
.pick p { margin: 6px 0 0; color: var(--muted); font-size: .9rem; }

/* calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cal-head h2 { margin: 0; font-size: 1.25rem; }
.cal-head button { width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: transparent; font-size: 1.3rem; line-height: 1; color: var(--text); }
.cal-head button:hover:not(:disabled) { border-color: var(--line-strong); background: var(--surface-2); }
.cal-head button:disabled { opacity: .3; cursor: default; }
.dow, .grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.dow span { text-align: center; font-size: .68rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding-bottom: 6px; }
.day-cell { aspect-ratio: 1; border-radius: var(--radius-sm); border: 1px solid var(--line); background: transparent; padding: 5px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; min-width: 0; text-align: left; }
.day-cell.blank { border-color: transparent; pointer-events: none; }
.day-cell.past { opacity: .4; }
.day-cell.has { background: var(--surface-2); }
.day-cell.today { border-color: var(--accent); }
.day-cell.today .day-num { color: var(--accent); }
.day-cell:hover:not(.blank) { border-color: var(--line-strong); background: var(--surface-2); }
.day-num { font-size: .8rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.dots { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.more { font-size: .6rem; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: .72rem; color: var(--muted); margin: 12px 0 0; }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.c-Festival { background: var(--c-fest); }
.c-Thai-Artist { background: var(--c-thai); }
.c-International-DJ { background: var(--c-dj); }
.c-International-Artist { background: var(--c-intl); }
.c-Live-Band { background: var(--c-band); }

/* tags: small labels, square corners */
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: .68rem; font-weight: 500; padding: 2px 7px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); background: transparent; vertical-align: middle; line-height: 1.5; }
.tag .dot { width: 6px; height: 6px; }
.tag.cat { color: var(--text); }
.tag.status-expected { color: var(--gold); border-color: rgba(217, 164, 65, .45); border-style: dashed; }
.tag.top { color: var(--gold); border-color: rgba(217, 164, 65, .45); }
.tag.zone { color: var(--muted); }
.live-tag { display: inline-flex; align-items: center; gap: 6px; font-size: .68rem; font-weight: 600; color: var(--live); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.live-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 rgba(47, 191, 113, .6); animation: livepulse 2s infinite; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(47, 191, 113, .55); } 70% { box-shadow: 0 0 0 6px rgba(47, 191, 113, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 191, 113, 0); } }
:lang(th) .live-tag, :lang(th) .dow span { text-transform: none; letter-spacing: 0; }
.live-pill:empty { display: none; }

/* map */
#map { height: 360px; border-radius: var(--radius-sm); background: #0b0c0e; border: 1px solid var(--line); }
@media (min-width: 900px) { #map { height: 420px; } }
.tiles-night { filter: invert(1) hue-rotate(190deg) brightness(.82) contrast(.92) saturate(.35); }
.pin { width: 13px; height: 13px; border-radius: 50%; background: var(--accent-solid); border: 2px solid #fff; }
.pin.featured { width: 16px; height: 16px; background: var(--gold); }
.pin.live { background: var(--live); animation: livepulse 2s infinite; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
.leaflet-popup-content { margin: 12px 14px; font-family: var(--font); font-size: .82rem; line-height: 1.5; }
.leaflet-popup-content b { font-size: .95rem; }
.leaflet-popup-content a { color: var(--accent); }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-control-attribution { background: rgba(14, 15, 17, .75) !important; color: var(--muted) !important; }
.leaflet-control-attribution a { color: var(--text) !important; }
.leaflet-bar a { background: var(--surface) !important; color: var(--text) !important; border-color: var(--line) !important; }
.approx { color: var(--faint); font-size: .7rem; }
.venue-links { font-size: .78rem; }
.venue-links a { color: var(--accent); text-decoration: none; }
.venue-links a:hover { text-decoration: underline; }

/* residencies */
.res-feature { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.res-card { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; border: 1px solid var(--line); }
.res-card h3 { margin: 0 0 4px; font-family: var(--font-head); font-size: 1.05rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.res-card p { margin: 4px 0 0; font-size: .82rem; color: var(--muted); }
.res-card .hours { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.res-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.res-list li { font-size: .84rem; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; padding: 9px 0; border-bottom: 1px solid var(--line); }
.res-list .hours, .day-res .hours { color: var(--muted); font-variant-numeric: tabular-nums; }

/* feed */
.feed-item { border-left: 2px solid var(--accent); padding: 4px 0 4px 12px; margin-bottom: 12px; }
.feed-item p { margin: 2px 0; font-size: .84rem; }
.feed-item a { color: var(--accent); }
.feed-empty { font-size: .85rem; color: var(--muted); margin: 0 0 10px; max-width: 70ch; }
.feed-tonight { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 14px; }
.feed-tonight h3 { margin: 0 0 6px; font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
:lang(th) .feed-tonight h3 { letter-spacing: 0; font-size: .8rem; }
.feed-tonight ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.feed-tonight li { font-size: .86rem; }
.feed-tonight a { text-decoration: none; }
.feed-tonight a:hover { color: var(--accent); }
.feed-tonight b { font-variant-numeric: tabular-nums; }
.feed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.feed-grid.collapsed .feed-venue:nth-child(n+7) { display: none; }
.feed-more { margin-top: 10px; width: 100%; min-height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: transparent; font-size: .84rem; font-weight: 500; color: var(--muted); }
.feed-more:hover { border-color: var(--line-strong); color: var(--text); }
.feed-venue { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 12px; display: grid; gap: 4px; }
.fv-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: .9rem; }
.fv-zone { font-size: .74rem; color: var(--muted); }
.fv-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.sbtn { font-size: .74rem; font-weight: 500; padding: 5px 10px; border-radius: 4px; text-decoration: none; color: var(--text); border: 1px solid var(--line-strong); min-height: 30px; display: inline-flex; align-items: center; gap: 6px; }
.sbtn::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.sbtn.fb::before { background: #4c7dff; }
.sbtn.ig::before { background: #e1306c; }
.sbtn:hover { border-color: var(--text); }

/* listings */
.results, .day-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.ev { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: start; padding: 12px 6px; text-decoration: none; border-bottom: 1px solid var(--line); }
.ev:hover { background: var(--surface-2); }
.ev .when { font-weight: 600; font-size: .85rem; line-height: 1.25; font-variant-numeric: tabular-nums; }
.ev .when small { display: block; font-weight: 400; color: var(--muted); }
.ev .artist { font-weight: 600; display: block; }
.ev:hover .artist { color: var(--accent); }
.ev .venue { color: var(--muted); font-size: .82rem; }
.ev .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.ev .note { display: block; font-size: .74rem; color: var(--gold); margin-top: 4px; }
.group-h { font-size: .7rem; font-weight: 600; color: var(--faint); padding: 16px 6px 6px; text-transform: uppercase; letter-spacing: .12em; border-bottom: 1px solid var(--line); }
:lang(th) .group-h { letter-spacing: .02em; text-transform: none; font-size: .8rem; }
.empty { color: var(--muted); font-size: .88rem; padding: 8px 0; }

/* dialogs: bottom sheet on phones */
dialog { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 14px 14px 0 0; padding: 18px; width: 100%; max-width: 560px; max-height: 88vh; margin: auto auto 0; }
dialog::backdrop { background: rgba(0, 0, 0, .65); }
@media (min-width: 640px) { dialog { border-radius: var(--radius); margin: auto; } }
.day-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; position: sticky; top: -18px; background: var(--surface); padding: 4px 0 10px; z-index: 1; }
.day-head h2 { margin: 0; font-size: 1.25rem; }
.close { width: 38px; height: 38px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: transparent; color: var(--muted); }
.close:hover { color: var(--text); border-color: var(--line-strong); }
dialog h3 { font-size: .7rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin: 18px 0 6px; }
:lang(th) dialog h3 { letter-spacing: .02em; text-transform: none; font-size: .8rem; }
.day-res { list-style: none; padding: 0; margin: 0; display: grid; font-size: .84rem; }
.day-res li { padding: 8px 0; border-bottom: 1px solid var(--line); }

footer { max-width: 1180px; margin: 0 auto; padding: 8px 16px 36px; font-size: .75rem; color: var(--faint); }
footer a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .live-tag::before, .pin.live { animation: none; }
}

/* text pages (about, 404) */
main.prose { display: block; max-width: 760px; }
.prose h1 { font-family: var(--font-head); font-size: 1.8rem; margin: 0 0 14px; line-height: 1.2; }
.prose h2 { font-size: 1.1rem; margin: 26px 0 8px; display: block; }
.prose p, .prose li { color: var(--text); font-size: .95rem; }
.prose a { color: var(--accent); }

/* suggest an event */
.suggest-wrap { display: flex; justify-content: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.suggest-btn { border: 1px solid var(--line-strong); color: var(--text); background: transparent; border-radius: var(--radius-sm); padding: 8px 16px; font-size: .85rem; font-weight: 500; min-height: 40px; }
.suggest-btn:hover { border-color: var(--accent); color: var(--accent); }
.suggest-link { margin-top: 16px; background: none; border: none; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; font-size: .85rem; padding: 6px 0; }
.suggest-form { display: grid; gap: 12px; }
.suggest-form label { display: grid; gap: 5px; font-size: .82rem; font-weight: 500; }
.suggest-form input, .suggest-form textarea { font: inherit; font-weight: 400; color: var(--text); background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 10px 11px; min-height: 42px; width: 100%; color-scheme: dark; }
.suggest-form input::placeholder, .suggest-form textarea::placeholder { color: var(--faint); }
.suggest-form input:focus, .suggest-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.req { color: var(--accent); }
.opt { color: var(--faint); font-weight: 400; font-size: .74rem; }
.form-note { margin: 0; font-size: .84rem; color: var(--muted); }
.form-note b, .form-fallback b { color: var(--text); font-weight: 600; }
.form-error { margin: 0; color: #f08a7a; font-size: .82rem; }
.form-send { min-height: 46px; border: none; border-radius: var(--radius-sm); background: var(--accent-solid); color: #fff; font-weight: 600; font-size: .95rem; }
.form-send:hover { background: #2556c7; }
.form-fallback { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 8px; }
.form-fallback p { margin: 0; font-size: .8rem; color: var(--muted); }
.form-fallback textarea { font-size: .75rem; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.form-actions button, .form-actions a { min-height: 38px; padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: transparent; font-size: .82rem; text-decoration: none; display: inline-flex; align-items: center; }
.form-actions button:hover, .form-actions a:hover { border-color: var(--text); }
