/* The one Therapy menu (Nov 2026).
   Body markup: templates/_partials/therapy_menu_body.html (.tsm-*).
   Shells: #brandMenu (header dropdown) and #tsbbMnSheet (bottom-bar sheet)
   both get this look, so the two never differ.

   Look = the header's night half (therapy_head_cream.html, /map, /schedule
   hero): night slate, stone text, condensed Archivo caps, DM Serif italic
   notes, teal for the top line, underlines and accents. Square corners,
   hairline rows with a go-arrow. No row numbers, no orange (Sam, 8 Nov
   2026: "too much orange", "remove the little numbers"). No cream/yellow
   paper (Sam, 8 Nov 2026: "looks yellow", "looks old"). */

#brandMenu.brand-menu, #tsbbMnSheet[data-tone="night"]{
  --tsm-night:#13161B;
  --tsm-night-2:#1A1E24;
  --tsm-stone:#F2F1EE;
  --tsm-stone-dim:rgba(242,241,238,.62);
  --tsm-stone-faint:rgba(242,241,238,.40);
  --tsm-line:rgba(242,241,238,.14);
  --tsm-line-soft:rgba(242,241,238,.08);
  --tsm-teal:#1F8C8C;
  --tsm-teal-lt:#6FAFAE;
  --tsm-display:'Archivo','Hanken Grotesk',sans-serif;
  --tsm-serif:'DM Serif Display',Georgia,serif;
  --tsm-sans:'Hanken Grotesk',system-ui,sans-serif;
}

/* ── Shells ─────────────────────────────────────────────────────────── */
#brandMenu.brand-menu{
  background:var(--tsm-night);
  color:var(--tsm-stone);
  border:1px solid var(--tsm-line);
  border-top:2px solid var(--tsm-teal);
  border-radius:0;
  box-shadow:0 30px 60px -20px rgba(0,0,0,.7);
  font-family:var(--tsm-sans);
  padding:6px 22px calc(20px + env(safe-area-inset-bottom,0));
}
@media (min-width:768px){
  #brandMenu.brand-menu{
    width:400px; max-width:calc(100vw - 36px); border-radius:0;
    box-shadow:0 30px 60px -20px rgba(0,0,0,.7);
  }
}

#tsbbMnSheet[data-tone="night"]{
  background:var(--tsm-night);
  color:var(--tsm-stone);
  border-top:2px solid var(--tsm-teal);
  border-radius:20px 20px 0 0;
  height:auto; max-height:min(82vh, 660px);
  box-shadow:0 -24px 60px -20px rgba(0,0,0,.85);
}
/* Head (label + title + X) comes from therapy-bottom-bar.css, shared by
   every sheet (Sam, 9 Nov 2026: one style for all slide-ups). */
#tsbbMnSheet[data-tone="night"] .tsbb-mn-list{ display:block; padding:0 22px 34px; }  /* clears the Events badge crest */

/* ── Body ───────────────────────────────────────────────────────────── */
.tsm{ display:flex; flex-direction:column; font-family:var(--tsm-sans); color:var(--tsm-stone); }
.tsm *{ box-sizing:border-box; }
.tsm a{ text-decoration:none; -webkit-tap-highlight-color:transparent; }

.tsm-label{
  margin:22px 0 10px;
  font-size:10.5px; font-weight:700; letter-spacing:.24em; text-transform:uppercase;
  color:var(--tsm-stone-faint);
}

/* Main rows: EVENTS  What's on  → */
.tsm-tiles{ display:flex; flex-direction:column; }
.tsm-tile{
  display:flex; align-items:baseline; gap:14px;
  padding:14px 0 13px;
  border-bottom:1px solid var(--tsm-line-soft);
  color:var(--tsm-stone);
}
.tsm-tx{ flex:1; min-width:0; display:flex; align-items:baseline; gap:12px; flex-wrap:wrap; }
.tsm-tile b{
  font-family:var(--tsm-display); font-stretch:72%; font-weight:800;
  font-size:38px; line-height:.92; letter-spacing:.005em; text-transform:uppercase;
}
.tsm-tile small{
  font-family:var(--tsm-serif); font-style:italic; font-size:15px;
  color:var(--tsm-stone-dim);
}
.tsm-go{
  flex-shrink:0; align-self:center;
  font-size:18px; color:var(--tsm-stone-faint);
  transition:transform .18s, color .18s;
}
.tsm-tile:hover .tsm-go, .tsm-tile:focus-visible .tsm-go{ color:var(--tsm-teal-lt); transform:translateX(4px); }
.tsm-tile:hover b, .tsm-tile:focus-visible b{ color:#fff; }
.tsm-tile:focus-visible{ outline:none; }
.tsm-tile:active b{ color:var(--tsm-teal-lt); }

/* Find a night: plain caps links with a teal underline. */
.tsm-chips{ display:flex; flex-wrap:wrap; gap:8px 22px; }
.tsm-chip{
  display:inline-flex; align-items:center; gap:7px;
  padding:4px 0 6px;
  border-bottom:2px solid var(--tsm-teal);
  font-size:12.5px; font-weight:800; letter-spacing:.12em; text-transform:uppercase;
  color:var(--tsm-stone);
}
.tsm-chip i{ display:none; }
.tsm-chip:hover, .tsm-chip:focus-visible{ color:var(--tsm-teal-lt); outline:none; }

/* Signed-in account row + its links. */
.tsm-acct{ padding:12px 0 4px; border-bottom:1px solid var(--tsm-line-soft); }
.tsm-acct-btn{
  display:flex; align-items:center; gap:12px; width:100%;
  padding:6px 0 10px; cursor:pointer; text-align:left;
  background:transparent; color:var(--tsm-stone);
  border:0; font-family:var(--tsm-sans);
}
.tsm-avatar{
  width:34px; height:34px; flex-shrink:0;
  display:grid; place-items:center;
  border:1px solid var(--tsm-teal); color:var(--tsm-teal-lt);
  font-family:var(--tsm-display); font-stretch:72%; font-weight:800; font-size:17px;
}
.tsm-acct-name{
  flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  font-family:var(--tsm-display); font-stretch:72%; font-weight:800; font-size:22px;
  text-transform:uppercase; line-height:1;
}
.tsm-acct-name small{
  display:block; margin-bottom:3px;
  font-family:var(--tsm-sans); font-stretch:100%; font-size:10px; font-weight:700;
  letter-spacing:.2em; color:var(--tsm-stone-faint);
}
.tsm-chev{ font-size:13px; color:var(--tsm-stone-dim); transition:transform .2s; }
.tsm-acct-btn[aria-expanded="true"] .tsm-chev{ transform:rotate(180deg); }
.tsm-acct-links{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 16px; padding-bottom:8px; }
.tsm-acct-links[hidden]{ display:none; }
.tsm-acct-links a, .tsm-admin a{
  display:flex; align-items:center; gap:8px; min-width:0;
  padding:9px 0; border-bottom:1px solid var(--tsm-line-soft);
  font-size:13px; font-weight:600; color:var(--tsm-stone-dim);
}
.tsm-acct-links a i, .tsm-admin a i{ font-size:13px; color:var(--tsm-stone-faint); }
.tsm-acct-links a:hover, .tsm-admin a:hover{ color:var(--tsm-stone); }
.tsm-acct-links a.tsm-out, .tsm-acct-links a.tsm-out i{ color:var(--tsm-teal-lt); }
.tsm-admin{ display:flex; flex-direction:column; }

/* Footer: Instagram + email. */
.tsm-foot{
  display:flex; gap:22px; margin-top:24px; padding-top:14px;
  border-top:1px solid var(--tsm-line-soft);
}
.tsm-foot a{
  display:inline-flex; align-items:center; gap:7px;
  font-size:11px; font-weight:700; letter-spacing:.16em; text-transform:uppercase;
  color:var(--tsm-stone-faint);
}
.tsm-foot a:hover{ color:var(--tsm-stone); }
.tsm-foot a i{ font-size:14px; }

@media (prefers-reduced-motion: reduce){
  .tsm-go, .tsm-chev{ transition:none; }
}

/* ── Phone swipe rows (Sam, 27 Nov 2026: "on mobile I don't want any rows
   break into 2. Always a scroll"). Site-wide utility, kept here because this
   file loads on every public therapysound.ca page (main site, venue and
   artist subdomains). Any new row of chips, tags, links or buttons: add the
   class `ts-swipe` and it stays one line on phones, swiping sideways when it
   doesn't fit. The named selectors are the existing rows that used to wrap.
   Rules: hidden scrollbar, snap, no vertical scroll inside the row (Sam,
   9 Nov: a vertical swipe always moves the page), edge fade only while there
   is more to swipe. */
@media (max-width:600px){
  .ts-swipe,
  .ta .tags,
  .hp-more,
  .ts-sfoot-legal,
  .tsm-chips,
  .dz-hub-ctas, .dz-ev-meta, .dz-dates, .dz-hub-genres,
  .web-djs ul, .share:has(.sic),
  .tj .ar-by,
  .ab-ctas,
  .mp-e .ty{
    flex-wrap:nowrap !important;
    overflow-x:auto; overflow-y:hidden;
    scrollbar-width:none; -webkit-overflow-scrolling:touch;
    overscroll-behavior-x:contain;
    scroll-snap-type:x proximity;
  }
  .ts-swipe::-webkit-scrollbar,
  .ta .tags::-webkit-scrollbar,
  .hp-more::-webkit-scrollbar,
  .ts-sfoot-legal::-webkit-scrollbar,
  .tsm-chips::-webkit-scrollbar,
  .dz-hub-ctas::-webkit-scrollbar, .dz-ev-meta::-webkit-scrollbar, .dz-dates::-webkit-scrollbar, .dz-hub-genres::-webkit-scrollbar,
  .web-djs ul::-webkit-scrollbar, .share:has(.sic)::-webkit-scrollbar,
  .tj .ar-by::-webkit-scrollbar,
  .ab-ctas::-webkit-scrollbar,
  .mp-e .ty::-webkit-scrollbar{ display:none; }
  .ts-swipe > *,
  .ta .tags > *,
  .hp-more > *,
  .ts-sfoot-legal > *,
  .tsm-chips > *,
  .dz-hub-ctas > *, .dz-ev-meta > *, .dz-dates > *, .dz-hub-genres > *,
  .web-djs ul > *, .share:has(.sic) > *,
  .tj .ar-by > *,
  .ab-ctas > *,
  .mp-e .ty > *{
    flex:0 0 auto !important; white-space:nowrap; scroll-snap-align:start;
  }
  /* Edge fade, only on rows that actually scroll: the scroll timeline is
     inactive when the row fits, so no mask is applied then. */
  @supports (animation-timeline: scroll()){
    .ts-swipe,
    .ta .tags,
    .hp-more,
    .ts-sfoot-legal,
    .tsm-chips,
    .dz-hub-ctas, .dz-ev-meta, .dz-dates, .dz-hub-genres,
    .web-djs ul, .share:has(.sic),
    .tj .ar-by,
    .ab-ctas,
    .mp-e .ty{
      -webkit-mask:linear-gradient(90deg,transparent 0,#000 var(--ts-fl),#000 calc(100% - var(--ts-fr) - var(--ts-fs)),transparent calc(100% - var(--ts-fs))),url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='11' viewBox='0 0 7 11'%3E%3Cpath d='M1.5 1.2 5.8 5.5 1.5 9.8' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 2px center/7px 11px no-repeat;
      mask:linear-gradient(90deg,transparent 0,#000 var(--ts-fl),#000 calc(100% - var(--ts-fr) - var(--ts-fs)),transparent calc(100% - var(--ts-fs))),url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='11' viewBox='0 0 7 11'%3E%3Cpath d='M1.5 1.2 5.8 5.5 1.5 9.8' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 2px center/7px 11px no-repeat;
      animation:ts-swipe-fade linear both;
      animation-timeline:scroll(self inline);
      scroll-timeline:--ts-swipe inline;
    }
    /* Very tiny arrow (Sam, 27 Nov 2026) pinned to the right edge while
       there is more to swipe; gone when the row fits or at the end. */
    .ts-swipe::after,
    .ta .tags::after,
    .hp-more::after,
    .ts-sfoot-legal::after,
    .tsm-chips::after,
    .dz-hub-ctas::after,
    .dz-ev-meta::after,
    .dz-dates::after,
    .dz-hub-genres::after,
    .web-djs ul::after,
    .share:has(.sic)::after,
    .tj .ar-by::after,
    .ab-ctas::after,
    .mp-e .ty::after{
      content:""; position:sticky; right:0; align-self:stretch;
      flex:0 0 14px; width:14px; margin-left:-14px;
      background:currentColor; opacity:0; pointer-events:none;
      animation:ts-swipe-arrow linear both;
      animation-timeline:--ts-swipe;
    }
  }
}
@property --ts-fl{ syntax:'<length>'; inherits:false; initial-value:0px; }
@property --ts-fr{ syntax:'<length>'; inherits:false; initial-value:0px; }
@property --ts-fs{ syntax:'<length>'; inherits:false; initial-value:0px; }
@keyframes ts-swipe-fade{
  0%   { --ts-fl:0px;  --ts-fr:28px; --ts-fs:14px; }
  8%   { --ts-fl:28px; }
  92%  { --ts-fr:28px; --ts-fs:14px; }
  100% { --ts-fl:28px; --ts-fr:0px; --ts-fs:0px; }
}
@keyframes ts-swipe-arrow{
  0%, 92% { opacity:.8; }
  100%    { opacity:0; }
}

/* ── Card-row arrows (Sam, 28 Nov 2026: the More House artist row was cut off
   at the right edge on desktop, "needs arrow"). One shared component for every
   sideways card row on desktop only. static/js/therapy-menu.js wraps a
   row that really overflows in .ts-rail and adds a previous and a next button.
   Phones and tablets (≤1024px) keep the plain swipe, no buttons. Teal-outlined round
   buttons with cream icons so they read on dark bands; .ts-rail--light flips
   them for off-white sections. Disabled at each end (hidden, not greyed). */
.ts-rail{position:relative;min-width:0;--tsr-ink:#13161B;--tsr-icon:#EBC794;--tsr-line:#1F8C8C}
.ts-rail--light{--tsr-ink:#fff;--tsr-icon:#1F8C8C}
.ts-rail-btn{
  position:absolute;top:var(--tsr-top,40%);z-index:3;
  width:44px;height:44px;margin-top:-22px;padding:0;border-radius:50%;
  border:2px solid var(--tsr-line);background:var(--tsr-ink);color:var(--tsr-icon);
  display:none;align-items:center;justify-content:center;cursor:pointer;
  box-shadow:0 6px 18px -6px rgba(0,0,0,.55);
  transition:opacity .2s,transform .2s,background .2s;
}
.ts-rail-btn svg{width:18px;height:18px;display:block;pointer-events:none}
.ts-rail-btn:hover{background:var(--tsr-line)}
.ts-rail-btn:focus-visible{outline:3px solid var(--tsr-icon);outline-offset:3px}
.ts-rail-prev{left:8px}
.ts-rail-next{right:8px}
.ts-rail-btn[disabled]{opacity:0;pointer-events:none;transform:scale(.9)}
@media (min-width:1025px){
  .ts-rail.is-scrollable>.ts-rail-btn{display:flex}
  .ts-rail.is-scrollable>[data-ts-rail-row]{scroll-behavior:smooth}
}
@media (prefers-reduced-motion:reduce){
  .ts-rail-btn{transition:none}
  .ts-rail.is-scrollable>[data-ts-rail-row]{scroll-behavior:auto}
}

/* Phones and tablets: no buttons, the last visible card just fades out at the
   right edge while there is more to swipe (Sam, 28 Nov 2026). Gone at the end. */
@media (max-width:1024px){
  .ts-rail.has-more>[data-ts-rail-row]{
    -webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 72px),transparent);
    mask-image:linear-gradient(90deg,#000 calc(100% - 72px),transparent);
  }
}
