/* Masquer les barres de défilement visuelles tout en gardant le défilement à la molette et au toucher. */
html, body, * { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar, *::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* Shared visual system: calmer surfaces, clearer focus, and consistent controls. */
:root { --pa-surface: rgba(17, 18, 18, .88); --pa-stroke: rgba(255, 255, 255, .12); --pa-gold: #d6b987; }
body { font-family: Inter, "SF Pro Display", "Segoe UI", Arial, sans-serif !important; line-height: 1.58; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
nav { background: rgba(8, 9, 9, .82) !important; border-bottom-color: rgba(255,255,255,.1) !important; box-shadow: 0 8px 28px rgba(0,0,0,.16); }
.links { gap: clamp(10px, 1.8vw, 24px); }
.links a { transition: color .18s ease, opacity .18s ease; }
.links a:hover, .links a[aria-current="page"] { color: var(--pa-gold) !important; }
.card, .media-card, .about-box, .reader-link, .chat-card, .playlist-panel, .dj-panel, .photo-card, .video-card, .artist-card {
  border-radius: 14px !important;
  border-color: var(--pa-stroke) !important;
  box-shadow: 0 12px 32px rgba(0,0,0,.16);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.btn, button, .account-btn { transition: transform .18s ease, background-color .18s ease, border-color .18s ease, color .18s ease; }
.btn { border-radius: 999px !important; }
.btn:hover, .account-btn:hover { transform: translateY(-1px); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--pa-gold) !important; outline-offset: 3px;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea {
  border-radius: 9px;
}
@media (hover: hover) and (pointer: fine) {
  .card:hover, .media-card:hover, .reader-link:hover, .playlist-panel:hover, .video-card:hover, .artist-card:hover {
    transform: translateY(-2px); border-color: rgba(214,185,135,.3) !important; box-shadow: 0 16px 38px rgba(0,0,0,.23);
  }
}

/* Shared sizing rules for narrow phones, tablets, and short screens. */
*,
*::before,
*::after { box-sizing: border-box; }

html { width: 100%; max-width: 100%; overflow-x: clip; scroll-padding-top: 76px; }
body { width: 100%; max-width: 100%; min-width: 0; overflow-x: clip; }
img, video, audio, canvas, iframe, svg { max-width: 100%; }
img, video { height: auto; }
button, input, select, textarea { max-width: 100%; }
main, section, header, footer, nav, form, article, aside { min-width: 0; }
p, h1, h2, h3, h4, a, label, button { overflow-wrap: anywhere; }

section { width: min(100%, 1180px); padding-left: clamp(14px, 4vw, 32px); padding-right: clamp(14px, 4vw, 32px); }
.nav { width: 100%; max-width: 1180px; padding-left: clamp(12px, 3vw, 28px); padding-right: clamp(12px, 3vw, 28px); gap: clamp(8px, 2vw, 24px); }
.links { min-width: 0; }
.links a { overflow-wrap: normal; }
.links.is-open { max-height: calc(100svh - 88px); overflow-y: auto; overscroll-behavior: contain; }

.grid, .about, .photo-grid, .media-grid, .reader-choices, .genre-grid, .video-grid, .add-video-fields {
  min-width: 0;
}
.grid > *, .about > *, .photo-grid > *, .media-grid > *, .reader-choices > *, .genre-grid > *, .video-grid > *, .add-video-fields > * { min-width: 0; }
.photo-grid, .media-grid, .reader-choices, .video-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.media-card, .card, .reader-link, .chat-card, .playlist-panel, .dj-panel { max-width: 100%; }
.media-card audio, .media-card video, .track-row audio, .video-thumbnail video { width: 100%; max-width: 100%; }
.track-row, .track-meta, .track-name, .dj-panel-heading, .dj-now-playing { min-width: 0; }
.track-name, .dj-now-playing strong { overflow-wrap: anywhere; }

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { min-width: 0; }
input, select, textarea { font-size: max(16px, 1em); }
button, .btn, .send { touch-action: manipulation; }
.lightbox { padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.video-lightbox { padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
.video-lightbox-dialog, .add-video-dialog { width: min(100%, 920px); max-width: calc(100vw - 16px); max-height: calc(100svh - 16px); }
.video-lightbox-stage, .video-lightbox-player { max-width: 100%; max-height: calc(100svh - 24px); }
.pa-dj-float { right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); max-width: calc(100vw - 24px); }
.pa-scroll-top { position: fixed; z-index: 35; left: max(18px, env(safe-area-inset-left)); bottom: max(18px, env(safe-area-inset-bottom)); display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 1px solid rgba(214,185,135,.68); border-radius: 50%; background: rgba(10,11,11,.88); color: var(--pa-gold); font-size: 22px; line-height: 1; box-shadow: 0 8px 26px rgba(0,0,0,.3); backdrop-filter: blur(12px); cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease, visibility .2s ease, background .2s ease; }
.pa-scroll-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.pa-scroll-top:hover { background: rgba(214,185,135,.16); }
.pa-dj-actions { max-width: calc(100vw - 82px); flex-wrap: nowrap; white-space: nowrap; }
.pa-dj-actions button { flex: 0 0 auto; }
.chat-body, .chat-compose, .add-video-content { min-width: 0; }
.chat-body { overflow-wrap: anywhere; }
pre, code, table { max-width: 100%; }
table { display: block; overflow-x: auto; }
body[data-page="lecteurs"] #lecteurs { padding-top: max(108px, calc(78px + 3vw)); }

/* Slightly tighter layout when the browser window is reduced to tablet size. */
@media (max-width: 1024px) {
  section { padding-top: clamp(58px, 7vw, 82px); padding-bottom: clamp(58px, 7vw, 82px); }
  .hero { padding-left: clamp(18px, 3vw, 28px); padding-right: clamp(18px, 3vw, 28px); }
  .hero-logo { width: min(240px, 48vw); }
  #logoMain { width: min(540px, 78vw); max-height: 42svh; }
  .title { font-size: clamp(28px, 3.7vw, 38px); }
  .card, .media-card, .about-box, .reader-link { padding: clamp(20px, 2.5vw, 27px); }
  .grid, .photo-grid, .media-grid { gap: clamp(12px, 1.8vw, 18px); }
}

@media (max-width: 640px) {
  .hero { min-height: 100svh; min-height: 100dvh; padding: 96px 14px 44px; }
  .hero-inner { width: 100%; max-width: 100%; }
  .hero-logo { width: min(175px, 43vw); margin-bottom: 16px; }
  #logoMain { width: min(430px, 78vw); max-height: 34svh; }
  .hero h1 { font-size: clamp(29px, 8.5vw, 52px); overflow-wrap: anywhere; }
  .hero p { font-size: clamp(14px, 3.8vw, 17px); }
  .kicker { max-width: 100%; letter-spacing: clamp(.12em, 2vw, .24em); }
  section { padding-top: clamp(42px, 8vw, 58px); padding-bottom: clamp(42px, 8vw, 58px); }
  body[data-page="lecteurs"] #lecteurs { padding-top: max(94px, calc(70px + 5vw)); }
  .title { font-size: clamp(24px, 6.2vw, 32px); }
  .nav { min-height: 64px; }
  .page-back { max-width: 34vw; padding: 8px 10px; font-size: 12px; }
  .links { left: 10px; right: 10px; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chat-card { border-radius: 14px; }
  .chat-head, .chat-compose { padding-left: 14px; padding-right: 14px; }
  .chat-body { padding: 18px 14px; }
  .send-row { flex-direction: column; align-items: stretch; }
  .send { width: 100%; min-height: 48px; }
  .dj-controls { flex-wrap: wrap; }
  .dj-panel { padding: 16px 12px; }
  .card, .media-card, .about-box, .reader-link { padding: 19px; }
  .dj-panel.is-compact .dj-controls { flex-wrap: nowrap; gap: 3px; }
  .add-video-dialog { overflow: auto; }
  .video-lightbox-dialog, .video-lightbox-stage { width: 100%; }
  .chat-body { max-height: min(52dvh, 520px); }
  footer { padding-left: 16px; padding-right: 16px; line-height: 1.7; }
}

@media (max-width: 380px) {
  .nav { padding-left: 10px; padding-right: 10px; }
  .nav img, #logoSmall { width: 42px; height: 42px; }
  .page-back { max-width: 31vw; padding: 7px 8px; font-size: 11px; }
  .menu-toggle { flex: 0 0 40px; width: 40px; height: 40px; }
  .photo-grid { grid-template-columns: 1fr; }
  .photo-card { aspect-ratio: 4 / 3; }
  .dj-panel.is-compact { padding: 10px 7px; }
  .dj-panel.is-compact .dj-action { width: 28px; min-width: 28px; height: 28px; }
  .dj-panel.is-compact .dj-main-action { width: 30px; min-width: 30px; height: 30px; flex-basis: 30px; }
}

@media (max-height: 560px) {
  .hero { min-height: 100svh; padding-top: 90px; padding-bottom: 34px; }
  .hero-logo, #logoMain { max-height: 34svh; width: auto; }
  .video-lightbox-dialog, .add-video-dialog { max-height: calc(100svh - 10px); }
  .add-video-dialog form { max-height: calc(100svh - 10px); }
}

@media (max-width: 340px) {
  .nav { gap: 6px; }
  .nav img, #logoSmall { width: 38px; height: 38px; }
  .photo-grid { gap: 8px; }
  .dj-mixer-layout { grid-template-columns: 38px minmax(0, 1fr) 38px; gap: 5px; }
  .dj-side-control { padding-inline: 2px; }
  .dj-panel.is-compact .dj-controls { gap: 2px; }
  .dj-panel.is-compact .dj-action { width: 26px; min-width: 26px; height: 28px; padding-inline: 2px; }
  .dj-panel.is-compact .dj-main-action { width: 28px; min-width: 28px; height: 28px; flex-basis: 28px; padding-inline: 2px; }
  .pa-dj-float { right: 8px; bottom: 8px; gap: 5px; }
  .pa-dj-logo { width: 44px; height: 44px; flex-basis: 44px; }
  .pa-dj-actions { max-width: calc(100vw - 64px); }
  .pa-dj-actions button { width: 26px; height: 28px; }
  .pa-dj-mini-title { display: none; }
}

@media (max-width: 320px) {
  .nav { gap: 5px; }
  .message-nav { min-height: 36px; padding-inline: 8px; font-size: 11px; }
  .account-btn { padding-inline: 10px; font-size: 12px; }
  .hero-actions .btn { min-width: 0; width: 100%; }
  .section, section { padding-inline: 12px; }
  .media-card, .card, .about-box { padding: 15px; }
}

@media (max-height: 460px) and (orientation: landscape) {
  body.home-page > header.hero { padding-top: 68px; padding-bottom: 10px; }
  body.home-page .hero-logo, body.home-page #logoMain { max-height: 20dvh; margin-bottom: 8px; }
  body.home-page .hero h1 { font-size: clamp(30px, 7vw, 52px); margin: 6px 0; }
  body.home-page .hero p { margin: 7px auto; font-size: 13px; line-height: 1.35; }
  body.home-page .hero-actions { margin-top: 9px; gap: 8px; }
  body.home-page .hero-actions .btn { min-height: 36px; padding: 8px 13px; }
}

@media (max-width: 260px) {
  .pa-dj-actions { gap: 2px; padding: 4px; }
  .pa-dj-actions button { width: 22px; height: 26px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
