/* =========================
   Variables
   ========================= */
:root {
  --black: #000000;
  --white: #d4d4d4;
  --muted: #858585;
  --line: #555;
  --red: #a72323;
  --gap: clamp(6px, 0.5rem, 12px);
  --page-padding: 20px;

  --font-base: 12px;
  --font-ui: 15px;
  --font-meta: 13px;
  --font-small: 13px;
  --font-mobile-ui: 13px;
  --font-mobile-meta: 10px;
  --font-mobile-small: 9px;
  --footer-font: 11px;

  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: dark;
}

/* =========================
   Base
   ========================= */
* {
  box-sizing: border-box;
}

html {
  background: #181818;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--black);
  color: var(--white);
  font-size: var(--font-base);
  line-height: 1.16;
  padding: 60px 0 38px;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 1px solid #fff;
  outline-offset: 3px;
}

/* =========================
   Header
   ========================= */
.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  padding: 10px var(--page-padding);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: transparent;
}

.site-header nav {
  display: flex;
  gap: 6px;
}

.nav-right {
  justify-content: flex-end;
}

.site-header nav a,
.footer-contact,
.copyright,
.clock {
  border: 1px solid var(--line);
  padding: 5px 8px;
  background: #000;
  text-decoration: none;
  font-size: var(--font-ui);
  line-height: 1.15;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.site-entry {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #000;
  padding: 40px 20px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.site-entry.is-hidden {
  transform: translateY(-100%);
  pointer-events: none;
}

.entry-logo {
  display: block;
  width: min(180px, 44vw);
  max-width: 180px;
  height: auto;
  margin-bottom: 32px;
}

.entry-text {
  text-align: center;
  max-width: 480px;
  color: #fff;
}

.entry-text h1 {
  margin: 0 0 16px;
  font-size: clamp(18px, 5vw, 24px);
  font-weight: 400;
  line-height: 1.2;
}

.entry-text p {
  margin: 0;
  font-size: clamp(12px, 3.5vw, 14px);
  line-height: 1.5;
  color: #999;
}

.site-header a[aria-current="page"] {
  color: #fff;
  border-color: #bbb;
}

.signal-logo {
  display: block;
  width: 128px;
  padding: 4px 8px;
  background: transparent;
}

.signal-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.mobile-label {
  display: none;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -80px;
  background: #fff;
  color: #000;
  padding: 8px;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
}

.skip-link:focus,
.skip-link:focus-visible {
  top: 8px;
  opacity: 1;
  pointer-events: auto;
}

/* =========================
   Footer / Radio
   ========================= */
.site-footer {
  position: fixed;
  z-index: 20;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  gap: 7px;
  align-items: center;
  min-height: 30px;
  padding: 5px var(--page-padding);
  background: transparent;
  font-size: var(--footer-font);
  line-height: 1;
  letter-spacing: 0.01em;
}

.radio {
  margin-left: auto;
  display: flex;
  align-items: center;
  min-width: min(34vw, 520px);
  min-height: 24px;
  border: 1px solid var(--line);
  background: #000;
}

.radio button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 3px 6px;
  font-size: var(--footer-font);
  line-height: 1;
}

.radio-toggle {
  display: flex;
  align-items: center;
  flex: 1;
  text-align: left;
}

.radio-mute {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.radio-light {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--red);
  vertical-align: middle;
}

.radio.is-playing .radio-light {
  background: #ed3030;
  box-shadow: 0 0 8px #ed3030;
}

.radio.is-off .radio-light {
  background: #555;
}

.footer-contact {
  display: none;
}

.soundcloud-widget {
  position: fixed;
  left: -9999px;
  bottom: 0;
  width: 1px;
  height: 1px;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

/* =========================
   Archive
   ========================= */
.archive-grid {
  position: relative;
  columns: auto;
  margin-inline: var(--page-padding);
  padding-inline: 0;
}

.archive-item {
  position: absolute;
  top: 0;
  left: 0;
  break-inside: avoid;
  margin: 0;
  transition: none;
}

.archive-item img {
  display: block;
  width: 100%;
  height: auto;
}

.archive-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.archive-item figcaption {
  padding-top: 4px;
  color: var(--muted);
  font-size: var(--font-small);
  line-height: 1.15;
}

.archive-item figcaption span {
  display: block;
}

.archive-item .meta-type {
  color: var(--muted);
  font-weight: 500;
}

.archive-item .meta-artist {
  color: var(--white);
  font-weight: 500;
}

.archive-item .meta-title {
  color: var(--white);
  font-style: italic;
}

.archive-item .meta-date {
  color: var(--muted);
  font-style: normal;
}

.archive-item .meta-credit {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.9em;
}

.archive-item a {
  text-decoration: none;
}

.archive-item a figcaption span:last-child {
  text-decoration: none;
}

.lightbox {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 20px;
  border: 0;
  background: rgba(0, 0, 0, 0.96);
  color: #fff;
}

.lightbox::backdrop {
  background: #000;
}

.lightbox figure {
  width: 100%;
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox img {
  width: 85vw;
  height: auto;
  max-width: calc(100vw - 40px);
  max-height: 85vh;
  object-fit: contain;
}

.lightbox figcaption {
  margin-top: 10px;
  color: var(--muted);
}

.lightbox-close {
  position: fixed;
  top: 14px;
  right: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--line);
  background: #000;
  color: #fff;
  font: inherit;
  font-size: 0;
  line-height: 0;
  cursor: pointer;
}

.lightbox-close::before,
.lightbox-close::after {
  position: absolute;
  width: 11px;
  height: 1px;
  background: currentColor;
  content: "";
}

.lightbox-close::before {
  transform: rotate(45deg);
}

.lightbox-close::after {
  transform: rotate(-45deg);
}

/* =========================
   Filters
   ========================= */
.filter-tools {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 18px;
  padding: 0;
  margin: 0;
}

.archive-tools {
  margin-inline: var(--page-padding);
}

.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: auto;
  height: auto;
  margin: 0;
  padding: 2px 5px;
  border: 1px solid var(--line);
  background: #000;
  color: var(--muted);
  font: inherit;
  font-size: var(--font-meta);
  line-height: 1;
  opacity: 0.65;
  cursor: pointer;
  vertical-align: middle;
}

.filter-toggle svg {
  display: block;
  width: 9px;
  height: 9px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 0.8;
  stroke-linejoin: miter;
}

.filter-toggle span {
  display: block;
}

.filter-toggle:hover,
.filter-toggle:focus-visible,
.filter-toggle[aria-expanded="true"] {
  color: var(--white);
  opacity: 1;
}

.filter-panel {
  position: absolute;
  z-index: 25;
  top: 100%;
  left: 0;
  width: min(270px, calc(100vw - 40px));
  margin-top: 6px;
  padding: 9px 10px 10px;
  border: 1px solid var(--line);
  background: #000;
  font-size: var(--font-meta);
  line-height: 1.2;
}

.archive-filters[hidden],
.archive-filter-status[hidden],
.archive-item[hidden] {
  display: none;
}

.filter-panel label {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  margin-bottom: 6px;
}

.filter-panel label:last-child {
  margin-bottom: 0;
}

.filter-panel select,
.filter-panel input {
  width: 100%;
  min-width: 0;
  min-height: 22px;
  padding: 2px 4px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #000;
  color: var(--white);
  font: inherit;
}

.archive-filter-status {
  position: fixed;
  z-index: 19;
  top: 70px;
  left: var(--page-padding);
  display: flex;
  gap: 4px;
  align-items: center;
  max-width: calc(100vw - 40px);
  padding: 2px 3px;
  background: #000;
  color: var(--muted);
  font-size: var(--font-meta);
}

.archive-filter-status button {
  padding: 1px 3px;
  border: 1px solid var(--line);
  background: #000;
  color: var(--white);
  font: inherit;
  cursor: pointer;
}

.archive-filter-status > span {
  padding-inline: 3px;
  white-space: nowrap;
}

/* =========================
   Shop
   ========================= */
.shop-list {
  border-top: 1px solid #333;
  margin-inline: var(--page-padding);
}

.shop-item {
  display: grid;
  grid-template-columns: 24% 25% 9% 1fr;
  gap: 1%;
  min-height: 0;
  padding: 8px 0;
  border-bottom: 1px solid #333;
}

.shop-meta,
.shop-description {
  font-size: var(--font-meta);
  line-height: 1.18;
}

.shop-meta {
  display: flex;
  flex-direction: column;
}

.shop-meta strong {
  color: #fff;
  font-weight: 600;
}

.shop-meta span:last-child {
  color: var(--muted);
}

.shop-description {
  margin: 0;
}

.buy-button {
  justify-self: start;
  align-self: start;
  border: 1px solid var(--line);
  padding: 3px 5px;
  text-decoration: none;
  white-space: nowrap;
  font-size: var(--font-small);
}

.buy-button.is-disabled {
  opacity: 0.65;
}

.shop-images {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  align-items: start;
}

.shop-image-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  aspect-ratio: 3 / 4;
}

.shop-image-button img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
}

.shop-tools {
  display: flex;
  align-items: center;
  min-height: 18px;
  padding: 0;
  margin: 0 0 8px;
}

.filter-panel[hidden],
.shop-filter-status[hidden],
.shop-item[hidden],
.shop-empty[hidden] {
  display: none;
}

.shop-filter-status {
  position: static;
  z-index: auto;
  top: auto;
  left: auto;
  display: flex;
  gap: 4px;
  align-items: center;
  max-width: 100%;
  width: max-content;
  margin: 0 0 8px;
  padding: 2px 3px;
  background: #000;
  color: var(--muted);
  font-size: var(--font-meta);
}

.shop-filter-status button {
  padding: 1px 3px;
  border: 1px solid var(--line);
  background: #000;
  color: var(--white);
  font: inherit;
  cursor: pointer;
}

.shop-filter-status > span {
  padding-inline: 3px;
  white-space: nowrap;
}

.shop-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border: 1px solid var(--line);
  background: #000;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.shop-reset:hover,
.shop-reset:focus-visible {
  color: var(--white);
}

.shop-empty {
  padding: 16px 0;
  color: var(--muted);
}

/* =========================
   Actualités
   ========================= */
.programmes {
  padding: 0 12px;
}

.slider {
  position: relative;
  border-top: 1px solid #333;
}

.slide {
  display: none;
  margin: 0;
}

.slide.is-active {
  display: block;
}

.slide img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 165px);
  object-fit: contain;
  object-position: top center;
}

.slide figcaption {
  position: absolute;
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.slider-button {
  position: absolute;
  z-index: 3;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font: inherit;
  padding: 0.5em;
  opacity: 0.15;
  cursor: pointer;
}

.slider:hover .slider-button,
.slider-button:focus-visible {
  opacity: 1;
}

.slider-prev {
  left: 8px;
}

.slider-next {
  right: 8px;
}

.slide-status {
  margin: 0.4em 0;
  color: var(--muted);
  text-align: center;
  font-size: var(--font-small);
}

/* =========================
   Contact
   ========================= */
.contact-page {
  padding: 20px;
  min-height: calc(100vh - 158px);
  margin-inline: var(--page-padding);
  padding-inline: 0;
}

.contact-card {
  max-width: 850px;
  border: 1px solid var(--line);
  padding: 20px;
}

.contact-card h1,
.contact-card p {
  margin: 0 0 1em;
  font: inherit;
}

.contact-card address {
  margin-top: 2em;
  font-style: normal;
  color: var(--muted);
}

.load-error {
  padding: 20px;
  color: var(--muted);
}

.contact-dialog {
  position: fixed;
  top: 20px;
  left: 20px;
  right: 20px;
  width: auto;
  max-width: min(430px, calc(100vw - 40px));
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.94);
  color: var(--white);
  font-size: var(--font-base);
  line-height: 1.18;
  box-sizing: border-box;
}

.contact-dialog::backdrop {
  background: rgba(0, 0, 0, 0.12);
}

.contact-dialog .contact-card {
  position: relative;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 10px 28px 11px 11px;
  border: 0;
}

.contact-dialog .contact-card h1,
.contact-dialog .contact-card p {
  margin: 0 0 12px;
  font: inherit;
}

.contact-dialog .contact-card address {
  margin-top: 24px;
  font: inherit;
  font-style: normal;
  color: var(--muted);
}

.contact-close {
  position: absolute;
  top: 5px;
  right: 6px;
  padding: 2px 5px;
  border: 0;
  background: none;
  color: var(--muted);
  font: 400 13px/1 inherit;
  cursor: pointer;
}

.contact-close:hover {
  color: #fff;
}

/* =========================
   Responsive
   ========================= */
@media (max-width: 1099px) {
  :root {
    --page-padding: 12px;
    --font-ui: var(--font-mobile-ui);
    --font-meta: var(--font-mobile-meta);
    --font-small: var(--font-mobile-small);
  }

  body {
    padding-top: 0px;
    padding-bottom: 48px;
    font-size: var(--font-base);
  }

  .site-header,
  .site-footer {
    padding-left: calc(var(--page-padding) + env(safe-area-inset-left));
    padding-right: calc(var(--page-padding) + env(safe-area-inset-right));
  }

  .site-header {
    position: relative;
    height: 48px;
    min-height: 48px;
    padding: 6px var(--page-padding);
  }

  .site-header nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 4px;
    align-items: center;
    min-width: 0;
    max-width: 38vw;
  }

  .nav-left {
    left: calc(var(--page-padding) + env(safe-area-inset-left));
    justify-content: flex-start;
  }

  .nav-right {
    right: calc(var(--page-padding) + env(safe-area-inset-right));
    justify-content: flex-end;
  }

  .signal-logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(112px, 32vw);
    max-width: 112px;
    margin: 0;
  }

  .site-header nav a {
    padding: 4px 6px;
    font-size: var(--font-ui);
    white-space: nowrap;
  }

  .desktop-label {
    display: none;
  }

  .mobile-label {
    display: inline;
  }

  .site-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    padding-top: 5px;
    padding-bottom: calc(5px + env(safe-area-inset-bottom));
    font-size: 9px;
  }

  .copyright {
    justify-self: start;
    white-space: nowrap;
  }

  .clock {
    justify-self: end;
    white-space: nowrap;
  }

  .radio {
    display: none;
  }

  .archive-grid {
    columns: auto;
    margin-inline: var(--page-padding);
    padding-inline: 0;
  }

  .archive-item {
    margin: 0;
  }

  .archive-item figcaption {
    font-size: var(--font-small);
  }

  .shop-list {
    margin-inline: var(--page-padding);
  }

  .shop-item {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 0;
  }

  .shop-meta,
  .shop-description,
  .buy-button {
    margin: 0;
  }

  .buy-button {
    justify-self: start;
  }

  .shop-images {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .shop-image-button img {
    max-height: none;
    min-height: auto;
  }

  .contact-dialog {
    top: 28px;
    left: 12px;
    right: 12px;
    width: auto;
    max-width: min(430px, calc(100vw - 24px));
    font-size: 11px;
  }

  .contact-dialog .contact-card {
    padding: 9px 26px 10px 10px;
  }

  .contact-dialog .contact-card h1,
  .contact-dialog .contact-card p {
    margin-bottom: 11px;
  }

  .contact-dialog .contact-card address {
    margin-top: 20px;
  }

  .lightbox {
    padding: calc(20px + env(safe-area-inset-top)) calc(18px + env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) calc(18px + env(safe-area-inset-left));
  }

  .lightbox img {
    width: calc(100vw - 36px);
    max-width: calc(100vw - 36px);
    max-height: calc(100dvh - 80px);
  }

  .archive-tools,
  .shop-tools {
    margin-inline: var(--page-padding);
  }

  .shop-tools {
    margin-inline: 0;
  }

  .filter-panel {
    width: min(300px, calc(100vw - 24px));
    font-size: 10px;
  }

  .archive-filter-status,
  .shop-filter-status {
    top: 68px;
    left: var(--page-padding);
    max-width: calc(100vw - 24px);
    overflow-x: auto;
  }

  .shop-filter-status {
    position: static;
    top: auto;
    left: auto;
    max-width: 100%;
    width: max-content;
    overflow-x: visible;
  }

  .archive-filter-toggle,
  .shop-filter-toggle {
    font-size: 10px;
  }

  body {
    width: 100%;
    margin: 0;
    padding-inline: 0;
    border: 0;
    border-radius: 0;
  }

  .site-header {
    left: 0;
    width: 100%;
    border: 0;
    border-radius: 0;
  }

  .site-footer {
    left: 0;
    width: 100%;
    border: 0;
    border-radius: 0;
  }
}

@media (max-width: 767px) {
  :root {
    --font-ui: 12px;
    --font-meta: 11px;
    --font-small: 10px;
  }

  .filter-panel {
    width: min(270px, calc(100vw - 20px));
  }

  .archive-item figcaption {
    font-size: var(--font-small);
  }
}

@media (max-width: 430px) {
  .site-header nav a {
    padding: 4px 5px;
  }

  .signal-logo {
    max-width: 96px;
  }

  .archive-filter-status,
  .shop-filter-status {
    max-width: calc(100vw - 20px);
  }
}

@media (max-width: 359px) {
  .signal-logo {
    max-width: 84px;
  }

  .site-footer {
    font-size: 8px;
  }

  .filter-panel {
    width: min(240px, calc(100vw - 18px));
  }
}
