/* =============================================================
   RideWild — Homepage (index.html)
   Dark & Gold Premium
   ============================================================= */

:root {
  --gold:        #d4a853;
  --gold-light:  #f0c878;
  --gold-dark:   #a07830;
  --bg:          rgba(0, 0, 0, 0.80);
  --glass:       rgba(0, 0, 0, 0.60);
  --glass-dark:  rgba(0, 0, 0, 0.88);
  --text:        #f0ebe0;
  --text-dim:    #9a8868;
  --radius:      12px;
  --maxw:        1200px;
}

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

html, body { margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: #0a0a0a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text); text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Navigation (homepage — transparent sur vidéo) ── */
header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 120;
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid rgba(212, 168, 83, 0.14);
  transform: translateY(0);
  transition: transform 0.34s ease, opacity 0.2s ease;
  opacity: 1;
}

header.is-top-collapsed {
  transform: translateY(calc(-100% + 12px));
  opacity: 0.98;
}

header.is-top-pinned { opacity: 1; }

.top-edge-trigger {
  position: fixed;
  left: 0; right: 0; top: 0;
  height: 28px;
  z-index: 119;
  background: transparent;
}

.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.6rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  justify-content: flex-start;
}

.nav-left { display: flex; align-items: center; gap: 0.5rem; }

.logo-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  box-shadow: 0 0 14px rgba(212, 168, 83, 0.5);
  object-fit: cover;
  display: block;
  transition: box-shadow 0.2s ease;
}
.logo-dot:hover { box-shadow: 0 0 24px rgba(212, 168, 83, 0.8); }

.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.32rem;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.36rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: transparent;
  color: rgba(240, 235, 224, 0.65);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.nav-links a:hover {
  background: rgba(212, 168, 83, 0.1);
  border-color: rgba(212, 168, 83, 0.38);
  color: var(--gold);
}

.nav-links a.active {
  background: rgba(212, 168, 83, 0.1);
  border-color: rgba(212, 168, 83, 0.35);
  color: var(--gold);
}

.nav-links a.cta {
  background: var(--gold);
  border-color: var(--gold);
  color: #0a0a0a;
  font-weight: 900;
  padding: 0.36rem 0.9rem;
}
.nav-links a.cta:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
  color: #0a0a0a;
}

/* ── Main ── */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 16px 180px;
  position: relative;
  z-index: 2;
}

/* ── Video full-screen ── */
.featured-videos {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  max-width: none;
  margin: 0;
  display: block;
  pointer-events: none;
}

.MAXIVID-container {
  position: absolute;
  inset: 0;
  border-radius: 0;
  overflow: hidden;
  background: #000;
  border: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
}

.MAXIVID-container > img.logo {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  max-width: clamp(72px, 8vw, 130px);
  height: auto;
  z-index: 1;
  opacity: 0.92;
  filter: drop-shadow(0 0 12px rgba(212, 168, 83, 0.4));
}

.MAXIVID-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ── Thumbnails ── */
.MINIVID-navigation {
  width: 100%;
  max-width: var(--maxw);
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  padding: 8px;
  margin: 0;
  position: relative;
  z-index: 3;
}

.MINIVID-container { max-width: 900px; margin: 0 auto; overflow: hidden; }

.MINIVID-thumbnails {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  overflow-x: auto;
  padding: 6px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(212,168,83,0.3) transparent;
}

.MINIVID-thumbnails img {
  width: 96px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.MINIVID-thumbnails img:hover {
  transform: translateY(-2px);
  border-color: rgba(212, 168, 83, 0.6);
  box-shadow: 0 4px 16px rgba(212, 168, 83, 0.25);
}

/* ── Bottom dock ── */
.bottom-dock {
  position: fixed;
  left: 50%;
  bottom: max(0px, env(safe-area-inset-bottom));
  width: min(var(--maxw), calc(100vw - 20px));
  display: grid;
  gap: 10px;
  z-index: 6;
  transform: translateX(-50%) translateY(0);
  transition: transform 0.34s ease, opacity 0.2s ease;
  opacity: 1;
}

.bottom-dock.is-collapsed {
  transform: translateX(-50%) translateY(calc(100% + 24px));
  opacity: 0;
  pointer-events: none;
}

.bottom-dock.is-pinned { opacity: 1; }

.dock-edge-trigger {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 28px;
  z-index: 5;
  background: transparent;
}

/* ── Newsletter form ── */
.newsletter {
  width: 100%;
  max-width: var(--maxw);
  background: rgba(10, 10, 10, 0.75);
  border-radius: var(--radius);
  border: 1px solid rgba(212, 168, 83, 0.15);
  backdrop-filter: blur(10px);
  padding: 10px 14px;
  margin: 0;
  position: relative;
  z-index: 3;
}

.newsletter-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: center;
}

.newsletter-form input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}

.newsletter-form input::placeholder { color: var(--text-dim); }

.newsletter-form input:focus {
  border-color: rgba(212, 168, 83, 0.45);
}

.newsletter-form button {
  padding: 9px 16px;
  border-radius: 8px;
  border: none;
  background: var(--gold);
  color: #0a0a0a;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.15s ease;
}

.newsletter-form button:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
}

.newsletter-feedback {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-dim);
  min-height: 16px;
}
.newsletter-feedback.ok     { color: #7dd3a8; }
.newsletter-feedback.error  { color: #f08080; }

/* ── Rail (lateral galleries, hidden by default) ── */
.rail {
  background: var(--bg);
  border: 1px solid rgba(212, 168, 83, 0.15);
  border-radius: var(--radius);
  padding: 8px;
  overflow-y: auto;
  max-height: clamp(250px, 60vh, 560px);
  width: clamp(92px, 10vw, 128px);
  min-width: 0;
}

#WEARLIB { overflow-y: auto !important; scrollbar-width: none; -ms-overflow-style: none; }
#WEARLIB::-webkit-scrollbar { width: 0; height: 0; display: none; }

.rail img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.rail img:hover { transform: scale(1.03); box-shadow: 0 4px 14px rgba(212, 168, 83, 0.2); }

/* ── Modal ── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.97);
  padding: 20px;
  align-items: center;
  justify-content: center;
}

.modal-content {
  margin: auto;
  display: block;
  max-width: min(1200px, 96vw);
  max-height: 90vh;
  border: 0;
  border-radius: 8px;
}

.close {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 36px;
  font-weight: 700;
  color: var(--text-dim);
  cursor: pointer;
  border: 0;
  background: transparent;
  line-height: 1;
  transition: color 0.2s ease;
}
.close:hover { color: var(--gold); }

/* ── Footer ── */
footer {
  margin-top: 26px;
  background: rgba(0, 0, 0, 0.92);
  border-top: 1px solid rgba(212, 168, 83, 0.1);
  color: var(--text-dim);
  padding: 0;
  text-align: center;
  font-size: 0.76rem;
}

/* ── Site mode desktop ── */
html[data-site-mode="desktop"] .nav {
  max-width: min(1260px, 96vw);
  gap: 12px;
  padding: 0.55rem 14px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}
html[data-site-mode="desktop"] .nav-links {
  width: auto !important;
  justify-content: flex-end !important;
  flex-wrap: wrap;
  gap: 6px;
}
html[data-site-mode="desktop"] main { padding: 6px 12px 180px; }
html[data-site-mode="desktop"] .featured-videos { position: fixed; inset: 0; z-index: 0; width: 100vw; max-width: none; margin: 0; display: block; pointer-events: none; }
html[data-site-mode="desktop"] .rail { display: none !important; }
html[data-site-mode="desktop"] .MAXIVID-container { min-height: 100vh; height: 100%; border-radius: 0; }
html[data-site-mode="desktop"] .MINIVID-navigation { padding: 6px; margin-top: 0; }
html[data-site-mode="desktop"] .MINIVID-container { max-width: 100%; }
html[data-site-mode="desktop"] .MINIVID-thumbnails { justify-content: flex-start; }
html[data-site-mode="desktop"] .MINIVID-thumbnails img { width: 100px; height: 56px; }
html[data-site-mode="desktop"] .newsletter { padding: 10px 12px; }
html[data-site-mode="desktop"] .newsletter-form { grid-template-columns: minmax(180px, 1fr) minmax(230px, 1fr) auto; gap: 8px; }

/* ── Site mode mobile ── */
html[data-site-mode="mobile"] body { background-attachment: scroll; }
html[data-site-mode="mobile"] main { padding: 8px 10px 22px; }
html[data-site-mode="mobile"] .nav { padding: 8px 10px 10px; gap: 8px; flex-direction: column; align-items: stretch; }
html[data-site-mode="mobile"] .nav-left { justify-content: center; }
html[data-site-mode="mobile"] .nav-links { width: 100%; display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
html[data-site-mode="mobile"] .nav-links a { width: 100%; justify-content: center; text-align: center; font-size: 0.66rem; padding: 8px 6px; white-space: normal; min-height: 42px; }
html[data-site-mode="mobile"] .nav-links a.cta { grid-column: 1 / -1; }
html[data-site-mode="mobile"] .featured-videos { position: fixed; inset: 0; z-index: 0; width: 100vw; max-width: none; margin: 0; display: block; pointer-events: none; }
html[data-site-mode="mobile"] .rail { display: none; }
html[data-site-mode="mobile"] .MAXIVID-container { width: 100%; height: 100%; min-height: 100vh; border-radius: 0; }
html[data-site-mode="mobile"] .MAXIVID-container > img.logo { max-width: 20%; }
html[data-site-mode="mobile"] .MINIVID-navigation { margin-top: 0; padding: 6px; }
html[data-site-mode="mobile"] .MINIVID-container { max-width: 100%; }
html[data-site-mode="mobile"] .MINIVID-thumbnails { justify-content: flex-start; padding: 5px 4px; }
html[data-site-mode="mobile"] .MINIVID-thumbnails img { width: 84px; height: 47px; }
html[data-site-mode="mobile"] .newsletter { padding: 10px; }
html[data-site-mode="mobile"] .newsletter-form { grid-template-columns: 1fr; gap: 8px; }

/* ── Touch devices ── */
@media (hover: none), (pointer: coarse) {
  header { transform: translateY(0) !important; opacity: 1 !important; }
  .top-edge-trigger { display: none; }
  .bottom-dock { bottom: max(0px, env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(0) !important; opacity: 1 !important; }
  .dock-edge-trigger { display: none; }
}

/* ── Responsive fallback ── */
@media (max-width: 768px) {
  .rail { display: none; }
  .MINIVID-thumbnails img { width: 86px; height: 48px; }
  .newsletter-form { grid-template-columns: 1fr; }
}
