/* ============================================================
   rc-loisir.fr — app.css
   Thème 100 % variables CSS — AUCUN hex hardcodé dans les pages
   ============================================================ */

:root {
  --bg: #12100d;
  --bg2: #1a1712;
  --surface: rgba(255,255,255,.055);
  --surface-2: rgba(255,255,255,.09);
  --border: rgba(255,255,255,.13);
  --text: #f5f1ea;
  --text-muted: #b3aca0;
  --primary: #f97316;
  --primary-strong: #ea580c;
  --primary-soft: rgba(249,115,22,.14);
  --green: #4ade80;
  --red: #f87171;
  --yellow: #facc15;
  --blue: #60a5fa;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(0,0,0,.35);
  --nav-h: 60px;
}

html[data-theme="light"] {
  --bg: #f5f2ec;
  --bg2: #ffffff;
  --surface: rgba(255,255,255,.92);
  --surface-2: rgba(0,0,0,.045);
  --border: rgba(0,0,0,.12);
  --text: #1c1917;
  --text-muted: #57534e;
  --shadow: 0 8px 30px rgba(0,0,0,.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scrollbar-gutter: stable; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Nav ─────────────────────────────────────────────────── */
.topnav {
  position: sticky; top: 0; z-index: 5000;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topnav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 16px;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand-badge {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.brand-name { font-weight: 800; font-size: 1.1rem; letter-spacing: -.02em; }
.brand-name span { color: var(--primary); }
.mainnav { display: flex; align-items: center; gap: 4px; }
.mainnav a {
  display: flex; align-items: center; gap: 7px;
  color: var(--text-muted); font-weight: 600; font-size: .92rem;
  padding: 8px 12px; border-radius: 9px;
  transition: color .15s, background .15s;
}
.mainnav a:hover { color: var(--text); background: var(--surface-2); }
.mainnav a.nav-cta {
  background: var(--primary); color: #fff;
}
.mainnav a.nav-cta:hover { background: var(--primary-strong); color: #fff; }
.nav-burger {
  display: none; background: none; border: none; color: var(--text); cursor: pointer;
  padding: 8px;
}
.nav-icon-btn {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  padding: 8px; border-radius: 9px; display: inline-flex; align-items: center;
  transition: color .15s, background .15s;
}
.nav-icon-btn:hover { color: var(--primary); background: var(--surface-2); }

/* ── Bannière installation PWA ───────────────────────────── */
.pwa-install {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  z-index: 6000; display: flex; align-items: center; gap: 12px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); padding: 10px 12px 10px 10px; max-width: min(94vw, 440px);
}
.pwa-install-txt { font-size: .9rem; font-weight: 600; flex: 1; }
.pwa-install-x { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; }
@media (max-width: 860px) {
  .nav-burger { display: block; }
  .mainnav {
    display: none;
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    background: var(--bg2); border-bottom: 1px solid var(--border);
    padding: 10px 16px 16px; gap: 6px;
    box-shadow: var(--shadow);
  }
  .mainnav.open { display: flex; }
  .mainnav a { padding: 12px 14px; font-size: 1rem; }
}

/* ── Layout ──────────────────────────────────────────────── */
.main-container { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 28px 16px 56px; }
.main-fullbleed { flex: 1; width: 100%; position: relative; }
body.fullbleed .footer { display: none; }

/* ── Flash ───────────────────────────────────────────────── */
.flash {
  position: fixed; top: calc(var(--nav-h) + 12px); left: 50%; transform: translateX(-50%);
  z-index: 9000; padding: 12px 22px; border-radius: 12px; font-weight: 600; font-size: .92rem;
  box-shadow: var(--shadow); max-width: min(92vw, 480px); text-align: center;
  transition: opacity .4s, transform .4s;
}
.flash-success { background: var(--green); color: #052e16; }
.flash-error   { background: var(--red);   color: #450a0a; }
.flash-info    { background: var(--blue);  color: #172554; }
.flash.hide { opacity: 0; transform: translateX(-50%) translateY(-12px); pointer-events: none; }

/* ── Boutons / formulaires ───────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 11px; border: 1px solid transparent;
  font-weight: 700; font-size: .95rem; cursor: pointer; text-align: center;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-strong); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: transparent; color: var(--red); border-color: var(--border); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: .85rem; border-radius: 9px; }

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; color: var(--text-muted); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 11px 14px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: .95rem; font-family: inherit;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--primary);
}
.form-select option { background: var(--bg2); color: var(--text); }
.form-textarea { min-height: 110px; resize: vertical; }
.form-hint { font-size: .8rem; color: var(--text-muted); margin-top: 5px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .form-grid-2 { grid-template-columns: 1fr; } }

.check-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.check-pill { position: relative; }
.check-pill input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.check-pill span {
  display: inline-block; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: .87rem; font-weight: 600; color: var(--text-muted);
  transition: all .15s; cursor: pointer;
}
.check-pill input:checked + span {
  background: var(--primary-soft); border-color: var(--primary); color: var(--primary);
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
}
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card-hover { transition: border-color .15s, transform .15s; }
.card-hover:hover { border-color: var(--primary); transform: translateY(-2px); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 999px; font-size: .76rem; font-weight: 700;
  background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border);
}
.badge-primary { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.badge-green { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); border-color: transparent; }
.badge-red { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); border-color: transparent; }
.badge-yellow { background: color-mix(in srgb, var(--yellow) 14%, transparent); color: var(--yellow); border-color: transparent; }

/* ── Titres / sections ───────────────────────────────────── */
.page-title { font-size: clamp(1.5rem, 4vw, 2.1rem); font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; }
.page-sub { color: var(--text-muted); margin-bottom: 26px; max-width: 640px; }
.section-title { font-size: 1.25rem; font-weight: 800; margin: 34px 0 16px; display: flex; align-items: center; gap: 10px; }
.section-title svg { color: var(--primary); }

/* ── Hero (home) ─────────────────────────────────────────── */
.hero { padding: 40px 0 28px; text-align: center; }
.hero h1 { font-size: clamp(1.7rem, 5vw, 2.8rem); font-weight: 900; letter-spacing: -.03em; line-height: 1.15; max-width: 780px; margin: 0 auto 14px; }
.hero h1 em { color: var(--primary); font-style: normal; }
.hero p { color: var(--text-muted); font-size: 1.05rem; max-width: 560px; margin: 0 auto 24px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 28px; justify-content: center; margin-top: 34px; flex-wrap: wrap; }
.hero-stat { text-align: center; }
.hero-stat b { display: block; font-size: 1.6rem; font-weight: 900; color: var(--primary); }
.hero-stat span { font-size: .84rem; color: var(--text-muted); }

/* ── Carte Leaflet ───────────────────────────────────────── */
#map-home { height: 440px; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; z-index: 1; }
#map-full { position: absolute; inset: 0; z-index: 1; }
.map-toolbar {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 1000; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  max-width: 94vw;
}
.map-filter {
  padding: 8px 15px; border-radius: 999px; font-size: .84rem; font-weight: 700;
  background: var(--bg2); color: var(--text-muted); border: 1px solid var(--border);
  cursor: pointer; box-shadow: var(--shadow);
}
.map-filter.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.map-legend {
  position: absolute; bottom: 22px; left: 14px; z-index: 1000;
  background: color-mix(in srgb, var(--bg2) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
  padding: 10px 14px; display: flex; flex-direction: column; gap: 7px;
}
.map-legend .mlg { display: flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 600; color: var(--text-muted); }
.map-legend .mlg i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); flex-shrink: 0; }
@media (max-width: 560px) {
  .map-legend { flex-direction: row; flex-wrap: wrap; bottom: 14px; left: 14px; right: 14px; gap: 6px 14px; padding: 8px 12px; }
  .map-legend .mlg { font-size: .76rem; }
}
.leaflet-popup-content-wrapper { background: var(--bg2); color: var(--text); border-radius: 12px; }
.leaflet-popup-tip { background: var(--bg2); }
.leaflet-popup-content { margin: 14px 16px; font-family: inherit; }
.popup-title { font-weight: 800; font-size: 1rem; margin-bottom: 3px; }
.popup-meta { font-size: .8rem; color: var(--text-muted); margin-bottom: 8px; }
.popup-link { font-weight: 700; font-size: .86rem; }

/* ── Fiche spot ──────────────────────────────────────────── */
.spot-layout { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .spot-layout { grid-template-columns: 1fr; } }
.spot-aside { position: sticky; top: calc(var(--nav-h) + 16px); display: flex; flex-direction: column; gap: 16px; }
.spot-map-mini { height: 240px; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; z-index: 1; }
.spot-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.spot-photos img { border-radius: 10px; aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.meta-list { display: flex; flex-direction: column; gap: 10px; }
.meta-row { display: flex; align-items: flex-start; gap: 10px; font-size: .92rem; }
.meta-row svg { color: var(--primary); flex-shrink: 0; margin-top: 3px; }
.meta-row b { font-weight: 700; }

.stars { display: inline-flex; gap: 2px; color: var(--yellow); }
.stars .off { color: var(--border); }

.review { border-top: 1px solid var(--border); padding: 14px 0; }
.review-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; font-size: .88rem; }
.review-head b { font-weight: 700; }
.review-head time { color: var(--text-muted); font-size: .8rem; }
.review p { font-size: .93rem; color: var(--text-muted); }

/* ── Météo ───────────────────────────────────────────────── */
.weather-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.weather-day { text-align: center; padding: 12px 6px; border-radius: 11px; background: var(--surface-2); }
.weather-day .wd-name { font-size: .78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
.weather-day .wd-temp { font-size: 1.05rem; font-weight: 800; margin: 4px 0; }
.weather-day .wd-wind { font-size: .78rem; color: var(--text-muted); display: flex; align-items: center; justify-content: center; gap: 4px; }
.weather-day .wd-wind.strong { color: var(--red); font-weight: 700; }

/* ── Listes spots/clubs ──────────────────────────────────── */
.list-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.item-card { display: flex; flex-direction: column; gap: 10px; color: var(--text); }
.item-card .ic-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.item-card h3 { font-size: 1.05rem; font-weight: 800; line-height: 1.3; }
.item-card .ic-city { color: var(--text-muted); font-size: .86rem; display: flex; align-items: center; gap: 6px; }
.item-card .ic-badges { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Alertes info ────────────────────────────────────────── */
.notice {
  display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px;
  font-size: .9rem; border: 1px solid var(--border); background: var(--surface);
  margin: 16px 0;
}
.notice svg { flex-shrink: 0; margin-top: 2px; }
.notice-warn { border-color: color-mix(in srgb, var(--yellow) 45%, transparent); }
.notice-warn svg { color: var(--yellow); }

/* ── Auth ────────────────────────────────────────────────── */
.auth-box { max-width: 440px; margin: 30px auto; }
.auth-box .card { padding: 30px; }
.auth-title { font-size: 1.4rem; font-weight: 800; margin-bottom: 4px; }
.auth-sub { color: var(--text-muted); font-size: .9rem; margin-bottom: 22px; }
.auth-alt { text-align: center; margin-top: 18px; font-size: .9rem; color: var(--text-muted); }

/* ── Footer ──────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--border); background: var(--bg2); margin-top: auto; }
.footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 40px 16px 26px;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px;
}
@media (max-width: 760px) { .footer-inner { grid-template-columns: 1fr 1fr; } }
.footer-brand { font-weight: 900; font-size: 1.1rem; margin-bottom: 8px; }
.footer-col p { font-size: .85rem; color: var(--text-muted); }
.footer-title { font-weight: 800; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; color: var(--text-muted); }
.footer-col a { display: block; color: var(--text-muted); font-size: .88rem; padding: 3px 0; }
.footer-col a:hover { color: var(--primary); }
.footer-legal {
  border-top: 1px solid var(--border); padding: 14px 16px; text-align: center;
  font-size: .78rem; color: var(--text-muted);
}

/* ── Bannières publicitaires ─────────────────────────────── */
.ad-slot { position: relative; display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); line-height: 0; }
.ad-slot img { width: 100%; height: auto; display: block; }
.ad-tag {
  position: absolute; top: 6px; right: 6px; line-height: 1;
  background: color-mix(in srgb, var(--bg) 70%, transparent); color: var(--text-muted);
  font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  padding: 3px 6px; border-radius: 5px; backdrop-filter: blur(4px);
}
.ad-slot-wrap { margin: 16px 0; }

/* ── Tables (modération) ─────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
table.data th { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }

/* ── Corps d'article (guides, nouveautés) : aération lecture ─ */
.article-body { line-height: 1.8; font-size: 1.02rem; color: var(--text); margin-top: 1.6rem; }
.article-body > *:first-child { margin-top: 0; }
.article-body h2 { margin: 2.4rem 0 .85rem; font-size: 1.4rem; line-height: 1.3; font-weight: 800; }
.article-body h3 { margin: 1.7rem 0 .6rem; font-size: 1.15rem; line-height: 1.35; font-weight: 700; }
.article-body p { margin: 0 0 1.2rem; }
.article-body ul, .article-body ol { margin: 0 0 1.3rem; padding-left: 1.4rem; }
.article-body li { margin-bottom: .5rem; }
.article-body a { color: var(--primary); text-decoration: underline; }
.article-body strong { color: var(--text); font-weight: 700; }
