/*
 * Music Concierge skin for the Playlist Selector (2026).
 * Colours from the Music Concierge visual identity (Dec 2025 draft):
 * Black, Sand, Terra, Terra Dark, White. Marcellus stands in for Bauhaus Rati,
 * which is a licensed font.
 * The customer's own background (img/swv.index-bg.jpg) sits behind every page,
 * tinted dark at night and sand by day. <html data-theme="day|night"> is set by
 * js/theme.js.
 */

@font-face {
  font-family: 'Marcellus';
  src: url('../../fonts/Marcellus/Marcellus-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --black: #000000;
  --sand: #F0ECE5;
  --terra: #CEB39B;
  --terra-dark: #A86B41;
  --white: #FFFFFF;

  /* night (default) */
  --tint: rgba(0, 0, 0, 0.3);
  --title-shadow: 0 1px 14px rgba(0, 0, 0, 0.65);
  --text: var(--sand);
  --text-muted: rgba(240, 236, 229, 0.72);
  --line: rgba(240, 236, 229, 0.22);
  --line-strong: rgba(240, 236, 229, 0.5);
  --surface: rgba(0, 0, 0, 0.46);
  --surface-press: rgba(240, 236, 229, 0.14);
  --panel: rgba(0, 0, 0, 0.5);
  --dock: rgba(12, 10, 9, 0.72);
  --accent: var(--terra);
  --accent-soft: rgba(206, 179, 155, 0.18);
  --accent-text: var(--terra);
  --accent-ink: var(--black);
  --track: rgba(240, 236, 229, 0.32);
  --primary-bg: var(--sand);
  --primary-fg: var(--black);
  --primary-press: var(--accent);
  color-scheme: dark;

  --display: 'Marcellus', 'Didot', 'Bodoni 72', Georgia, serif;
  --body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --gutter: clamp(16px, 4vw, 40px);
  --radius: 3px;
  --tap: 48px;
}

:root[data-theme="day"] {
  --tint: rgba(240, 236, 229, 0.38);
  --title-shadow: 0 1px 14px rgba(240, 236, 229, 0.9);
  --text: var(--black);
  --text-muted: rgba(0, 0, 0, 0.62);
  --line: rgba(0, 0, 0, 0.14);
  --line-strong: rgba(0, 0, 0, 0.4);
  --surface: rgba(250, 248, 244, 0.7);
  --surface-press: rgba(0, 0, 0, 0.07);
  --panel: rgba(255, 255, 255, 0.55);
  --dock: rgba(244, 241, 236, 0.84);
  --accent: var(--terra-dark);
  --accent-soft: rgba(168, 107, 65, 0.12);
  /* a deeper Terra Dark so small text stays readable on sand */
  --accent-text: #7A4A2A;
  --accent-ink: var(--white);
  --track: rgba(0, 0, 0, 0.22);
  --primary-bg: var(--black);
  --primary-fg: var(--sand);
  --primary-press: var(--terra-dark);
  color-scheme: light;
}

/* day/night artwork: each page carries both and shows one */
:root[data-theme="day"] .for-night,
:root:not([data-theme="day"]) .for-day {
  display: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--black);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* the customer's background photo, fixed behind the page, with the day or night tint over it */
body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: -2;
  background: var(--black) url('../../img/swv.index-bg.jpg') center / cover no-repeat;
}

body::after {
  z-index: -1;
  background: var(--tint);
  transition: background-color 0.4s ease;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- top bar */

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 14px var(--gutter);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.topbar__start {
  justify-self: start;
  min-width: 0;
}

.topbar__end {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* day / night switch */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.theme-toggle svg {
  width: 15px;
  height: 15px;
}

.theme-toggle__icon {
  display: none;
}

:root:not([data-theme-mode]) .theme-toggle__icon--auto,
:root[data-theme-mode="auto"] .theme-toggle__icon--auto,
:root[data-theme-mode="day"] .theme-toggle__icon--day,
:root[data-theme-mode="night"] .theme-toggle__icon--night {
  display: inline-flex;
}

.wordmark {
  width: clamp(150px, 26vw, 260px);
  height: auto;
}

.venue-logo {
  height: 36px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  padding-right: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 15px;
}

.back-link svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.back-link:hover,
.back-link:active {
  color: var(--text);
}

/* ---------------------------------------------------------------- headings */

.page-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.1;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.page-title,
.page-intro {
  text-shadow: var(--title-shadow);
}

.page-intro {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 15px;
}

/* ---------------------------------------------------------------- channel list (index.php) */

.channels {
  padding: 28px var(--gutter) 48px;
}

.channel-grid {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 14px;
}

.channel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  padding: 20px 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

/*
 * Keep "Playlist / Now playing" level across a row of tiles even when a channel
 * name wraps: each tile shares two rows (name, details) with its neighbours.
 * Browsers without subgrid leave room for a two-line name instead.
 */
.channel__name {
  min-height: 2.4em;
}

@supports (grid-template-rows: subgrid) {
  .channel-grid > li {
    display: grid;
    grid-row: span 2;
    grid-template-rows: subgrid;
    row-gap: 0;
  }

  .channel {
    display: grid;
    grid-row: span 2;
    grid-template-rows: subgrid;
    row-gap: 14px;
    align-content: start;
  }

  .channel__name {
    min-height: 0;
    align-self: start;
  }
}

.channel:hover {
  border-color: var(--line-strong);
}

.channel:active {
  background: var(--surface-press);
}

.channel__name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--display);
  font-size: 24px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.channel__name svg {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--accent);
}

.channel__facts {
  display: grid;
  gap: 8px;
  margin: 0;
}

.channel__facts dt {
  color: var(--text-muted);
  font-size: 13px;
}

.channel__facts dd {
  margin: 0;
  min-height: 1.45em;
  font-size: 15px;
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- channel page (profiles.php) */

/* playlists fill the page; the control panel floats at the bottom of the screen */
.page-channel {
  display: flex;
  flex-direction: column;
}

.channel-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.playlists {
  flex: 1;
  padding: 28px var(--gutter) 28px;
}

.playlist-grid {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 12px;
}

/* state label (top right) / name (bottom left) / play button (bottom right): no overlaps however long the name */
.playlist {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "state state"
    "name  icon";
  column-gap: 12px;
  row-gap: 10px;
  width: 100%;
  height: 100%;
  min-height: 104px;
  padding: 10px 12px 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.playlist:hover {
  border-color: var(--line-strong);
}

.playlist:active {
  background: var(--surface-press);
}

.playlist__state {
  grid-area: state;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 14px;
  color: var(--accent-text);
  font-size: 11px;
  line-height: 14px;
  letter-spacing: 0.02em;
  visibility: hidden;
}

.playlist__state::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.playlist__name {
  grid-area: name;
  align-self: end;
  font-family: var(--display);
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.playlist__icon {
  grid-area: icon;
  align-self: end;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.playlist__icon svg {
  width: 9px;
  height: 9px;
  margin-left: 1px;
}

/* the accent tint sits on top of the normal tile backing so the tile stays as solid as the others */
.playlist.is-playing {
  border-color: var(--accent);
  background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--surface);
}

.playlist.is-playing .playlist__state {
  visibility: visible;
}

.playlist.is-playing .playlist__icon {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.playlist.is-starting .playlist__state {
  visibility: visible;
  color: var(--text-muted);
}

/* control panel: now playing, skip / back to schedule, volume */

.panel {
  position: sticky;
  bottom: 12px;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px 32px;
  align-items: center;
  width: calc(100% - 2 * var(--gutter));
  max-width: 1080px;
  margin: 0 auto calc(12px + env(safe-area-inset-bottom));
  padding: 14px 18px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--dock);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
}

.np-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.now-playing {
  display: grid;
  gap: 2px;
  min-width: 0;
  margin: 0;
}

.now-playing dt {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.now-playing dd {
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.now-playing__playlist {
  font-family: var(--display);
  font-size: 19px;
  line-height: 1.25;
  min-height: 1.25em;
}

.now-playing__track,
.now-playing__artist {
  font-size: 13px;
}

.now-playing__artist {
  color: var(--text-muted);
}

.now-playing__artist:not(:empty)::before {
  content: ' \2013  ';
}

.actions {
  flex: none;
  display: flex;
  gap: 8px;
}

/* an on-demand track is playing: the panel takes the accent colour and says so */
.now-playing__badge {
  display: none;
}

.panel.is-on-demand {
  border-color: var(--accent);
  background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--dock);
}

.panel.is-on-demand .now-playing__badge {
  display: inline-flex;
  justify-self: start;
  align-items: center;
  gap: 5px;
  margin: 0 0 3px;
  padding: 2px 8px 2px 7px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  line-height: 14px;
  letter-spacing: 0.02em;
}

.panel.is-on-demand .now-playing__badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.panel.is-on-demand .now-playing__playlist {
  color: var(--accent-text);
}

/* small round control buttons */
.ctrl {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ctrl svg {
  width: 13px;
  height: 13px;
}

.ctrl:hover {
  border-color: var(--text);
}

.ctrl:active {
  background: var(--surface-press);
}

.ctrl span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* general buttons (error page) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: transparent;
  font-size: 15px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  border-color: var(--text);
}

.btn:active {
  background: var(--surface-press);
}

/* volume: a fine line with a small knob; the touch area stays finger-sized */

.volume__head {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.volume__value {
  font-family: var(--display);
  font-size: 17px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.fader {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 30px 30px;
  align-items: center;
  gap: 4px;
}

.fader__step {
  display: grid;
  place-items: center;
  width: 30px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease;
}

.fader__step svg {
  width: 12px;
  height: 12px;
}

.fader__step svg path {
  stroke-width: 1.2;
}

.fader__step:hover,
.fader__step:active {
  color: var(--text);
}

/* --l is the level from 0 to 1; the fill stops at the centre of the knob */
.fader__input {
  --l: 0;
  --knob: 13px;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 40px;
  margin: 0;
  background:
    linear-gradient(var(--accent), var(--accent)) 0 50% / calc(var(--knob) / 2 + (100% - var(--knob)) * var(--l)) 2px no-repeat,
    linear-gradient(var(--track), var(--track)) 0 50% / 100% 1px no-repeat;
  cursor: pointer;
  touch-action: pan-y;
}

.fader__input::-webkit-slider-runnable-track {
  height: 40px;
  background: transparent;
}

.fader__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: var(--knob);
  height: var(--knob);
  margin-top: calc((40px - var(--knob)) / 2);
  border: 0;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 4px var(--accent-soft);
  transition: transform 0.12s ease;
}

.fader__input:active::-webkit-slider-thumb {
  transform: scale(1.25);
}

.fader__input::-moz-range-track {
  height: 40px;
  background: transparent;
}

.fader__input::-moz-range-thumb {
  width: var(--knob);
  height: var(--knob);
  border: 0;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.fader__input:focus-visible {
  outline-offset: 0;
}

.volume.is-unknown .volume__value {
  color: var(--text-muted);
}

/* status messages float just above the panel, so the panel never changes height */
.status {
  position: absolute;
  left: 18px;
  bottom: calc(100% + 8px);
  max-width: calc(100% - 36px);
  margin: 0;
  padding: 6px 12px;
  border-radius: 14px;
  background: var(--dock);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  color: var(--text);
  font-size: 13px;
}

.status:empty {
  display: none;
}

.status.is-error {
  color: var(--accent-text);
}

/* tablets and desktops: now playing and controls on the left, volume on the right */
@media (min-width: 760px) {
  .panel {
    grid-template-columns: minmax(0, 1fr) minmax(200px, 340px);
    padding: 14px 22px;
  }
}

/* phones */
@media (max-width: 759px) {
  .playlist-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .playlist {
    min-height: 96px;
    padding: 9px 10px 12px 12px;
    column-gap: 8px;
  }

  .playlist__name {
    font-size: 16px;
  }

  .playlist__icon {
    width: 26px;
    height: 26px;
  }

  .panel {
    bottom: 8px;
    margin-bottom: calc(8px + env(safe-area-inset-bottom));
    padding: 12px 14px 8px;
    width: calc(100% - 16px);
  }

  .now-playing__playlist {
    font-size: 17px;
  }

  .ctrl {
    width: 36px;
    height: 36px;
  }

  .topbar {
    gap: 10px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .venue-logo {
    height: 28px;
    max-width: 72px;
  }

  .topbar__end {
    gap: 8px;
  }

  .theme-toggle {
    width: 36px;
    padding: 0;
    justify-content: center;
  }

  .theme-toggle__label,
  .topbar .back-link span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
}

/* Playlists / Tracks tabs (only when cores.xml has PlayTracks="YES") */
.tabs {
  display: flex;
  gap: 26px;
  margin-top: 16px;
  border-bottom: 1px solid var(--line);
}

.tab {
  margin-bottom: -1px;
  padding: 10px 0 9px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-muted);
  font-size: 15px;
  text-shadow: var(--title-shadow);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.tab:hover {
  color: var(--text);
}

.tab[aria-selected="true"] {
  border-bottom-color: var(--accent);
  color: var(--text);
}

.tab-panel {
  padding-top: 14px;
}

.tab-panel[hidden] {
  display: none;
}

.tab-panel .page-intro {
  margin-top: 0;
}

/* track tiles: artist under the title */
.playlist__artist {
  display: block;
  margin-top: 4px;
  font-family: var(--body);
  font-size: 13px;
  line-height: 1.3;
  color: var(--text-muted);
}

/* ---------------------------------------------------------------- PIN screen */

.pin-page {
  display: grid;
  grid-template-rows: auto 1fr;
}

.pin {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 22px;
  padding: 40px var(--gutter) 64px;
  text-align: center;
}

.pin__mark {
  width: 56px;
  height: auto;
}

.pin__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(26px, 5vw, 34px);
}

.pin__hint {
  margin: -10px 0 0;
  color: var(--text-muted);
}

.pin__digits {
  display: flex;
  gap: 12px;
}

.pin__digits input {
  width: 56px;
  height: 64px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: var(--display);
  font-size: 28px;
  text-align: center;
  caret-color: var(--accent);
}

.pin__digits input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ---------------------------------------------------------------- error / empty pages */

.message {
  display: grid;
  gap: 12px;
  max-width: 34rem;
  padding: 48px var(--gutter);
}

.message h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(26px, 5vw, 34px);
}

.message p {
  margin: 0;
  color: var(--text-muted);
}

.message .btn {
  justify-self: start;
  margin-top: 8px;
  text-decoration: none;
}

/* the site's own offline artwork, with the specific problem underneath */
.message__artwork {
  width: 100%;
  max-width: 26rem;
  max-height: 62vh;
  height: auto;
  object-fit: contain;
  object-position: left top;
  margin-bottom: 8px;
  border-radius: var(--radius);
}

.message--artwork h1 {
  font-size: 22px;
}

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

/* PIN error banner from js/notify.js (notify.css loads after this file) */
body .jquery-notify-bar,
body .jquery-notify-bar.error {
  padding: 18px var(--gutter);
  border: 0;
  background: var(--terra-dark);
  background-image: none;
  box-shadow: none;
  color: var(--white);
  font-family: var(--body);
  font-size: 16px;
  text-shadow: none;
}

/* the plugin's icon file was never shipped; drop it */
body .jquery-notify-bar .notify-bar-text-wrapper,
body .jquery-notify-bar.error .notify-bar-text-wrapper {
  padding: 0;
  background: none;
}

/* nothing reported yet */
.channel__facts dd:empty::before,
.now-playing__playlist:empty::before,
.now-playing__track:empty::before {
  content: '\2013';
  color: var(--text-muted);
}
