/* « Un monde de culture » — carte culturelle. Charte Omnia amplecti. */
:root {
  --ink: #1a1814; --paper: #f5f2eb; --paper-dark: #ede9df; --gold: #b89a5a;
  --muted: #7a7060; --line: #e2ddd1; --card: #fff; --brand: #1a1814;
  --c-peint: #b8433a; --c-opera-cre: #7a4fb0; --c-opera-act: #d08a2a;
  --c-opera-vue: #2f8f6b; --c-film: #2b6ca3;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Montserrat', system-ui, sans-serif; color: var(--ink); background: var(--paper); }

/* Page (mode encadré par défaut) */
.mc-page { max-width: 1180px; margin: 0 auto; padding: calc(var(--nav-h, 72px) + 22px) 18px 60px; }
.mc-head { text-align: center; margin-bottom: 20px; }
.mc-eyebrow { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin: 0 0 6px; }
.mc-head h1 { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 2.5rem; margin: 0; color: var(--ink); }
.mc-head h1 em { font-style: italic; color: var(--gold); }
.mc-intro { max-width: 720px; margin: 8px auto 0; color: var(--muted); font-family: 'Cormorant Garamond', serif; font-size: 1.2rem; line-height: 1.5; }

/* Panneau + carte */
.mc-wrap { display: flex; gap: 16px; align-items: stretch; }
.mc-mapbox { position: relative; flex: 1 1 auto; height: 70vh; min-height: 440px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 8px 26px rgba(26,24,20,.08); }
#map { position: absolute; inset: 0; background: #e9edf2; }

/* Panneau (colonne dans le flux en mode encadré) */
.mc-panel { flex: 0 0 320px; width: 320px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 26px rgba(26,24,20,.08); display: flex; flex-direction: column; overflow: hidden; max-height: 70vh; }
.mc-panel.collapsed { display: none; }
.mc-panel-hd { display: flex; align-items: center; justify-content: flex-start; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.mc-panel-t { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 1.15rem; color: var(--ink); }
.mc-panel-close { background: none; border: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 4px; }
.mc-body { overflow-y: auto; padding: 4px 0 10px; }

.mc-sec { border-bottom: 1px solid var(--line); }
.mc-sec-hd { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; user-select: none; }
.mc-sec-hd .dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }
.mc-sec-hd .ttl { font-weight: 600; font-size: 13.5px; flex: 1; }
.mc-sec-hd .cnt { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mc-sec-hd .chev { color: var(--muted); font-size: 11px; transition: transform .15s; }
.mc-sec.open .chev { transform: rotate(90deg); }
.mc-sec-body { display: none; padding: 4px 14px 12px; }
.mc-sec.open .mc-sec-body { display: block; }

.mc-toggle { display: flex; align-items: center; gap: 8px; font-size: 12.5px; margin: 6px 0; cursor: pointer; }
.mc-toggle input { accent-color: var(--gold); }
.mc-row { margin: 8px 0; }
.mc-row label.lbl { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 3px; }
.mc-row select { width: 100%; font: inherit; font-size: 12.5px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.mc-modes { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.mc-modes button { font: inherit; font-size: 11.5px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 20px; background: #fff; cursor: pointer; color: var(--muted); }
.mc-modes button.on { color: #fff; border-color: transparent; }
.mc-hint { font-size: 11px; color: var(--muted); font-style: italic; font-family: 'Cormorant Garamond', serif; margin-top: 6px; line-height: 1.4; }
#peint-search { width: 100%; font: inherit; font-size: 12.5px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }

/* Sélecteur multi-choix (déroulant à cases) */
.mc-multi { position: relative; }
.mc-multi-btn { width: 100%; text-align: left; font: inherit; font-size: 12.5px; padding: 6px 24px 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); cursor: pointer; position: relative; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-multi-btn::after { content: "▾"; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 10px; }
.mc-multi-pop { display: none; position: fixed; z-index: 1200; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 22px rgba(26,24,20,.16); max-height: 240px; overflow: hidden; }
.mc-multi.open .mc-multi-pop { display: flex; flex-direction: column; }
.mc-multi-tools { display: flex; gap: 6px; padding: 6px; border-bottom: 1px solid var(--line); }
.mc-multi-tools button { flex: 1; font: inherit; font-size: 11px; padding: 4px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); cursor: pointer; color: var(--muted); }
.mc-multi-list { overflow-y: auto; padding: 4px; }
.mc-multi-list label { display: flex; align-items: center; gap: 7px; font-size: 12px; padding: 3px 5px; border-radius: 6px; cursor: pointer; }
.mc-multi-list label:hover { background: var(--paper); }
.mc-multi-list input { accent-color: var(--gold); }

/* Sélecteur de peintres */
.mc-painters { max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px; margin-top: 6px; }
.mc-painters label { display: flex; align-items: center; gap: 7px; font-size: 12px; padding: 3px 5px; border-radius: 6px; cursor: pointer; }
.mc-painters label:hover { background: var(--paper); }
.mc-painters .pn-meta { margin-left: auto; font-size: 10.5px; color: var(--muted); }
.mc-mini { display: flex; gap: 6px; margin-top: 8px; }
.mc-mini button { flex: 1; font: inherit; font-size: 11px; padding: 4px; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; color: var(--muted); }

.mc-op { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-top: 6px; }
.mc-op input[type=range] { flex: 1; accent-color: var(--gold); }

/* Boutons flottants sur la carte */
.mc-fs-btn { position: absolute; z-index: 600; top: 12px; right: 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; font: inherit; font-size: 12.5px; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.14); }
.mc-panel-toggle { position: absolute; z-index: 601; top: 12px; left: 12px; display: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; font: inherit; font-size: 12.5px; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.14); }

/* Plein écran (via classe) */
.mc-wrap.fs { position: fixed; inset: 0; z-index: 2000; gap: 0; max-width: none; background: #e9edf2; }
.mc-wrap.fs .mc-mapbox { height: 100%; border: none; border-radius: 0; box-shadow: none; }
.mc-wrap.fs .mc-panel { position: absolute; z-index: 600; top: 12px; left: 12px; width: min(320px, calc(100vw - 24px)); max-height: calc(100% - 24px); box-shadow: 0 10px 34px rgba(26,24,20,.22); }
/* En plein écran sur mobile, décaler le bouton « Quitter » sous le panneau ouvert
   n'est pas nécessaire : la croix de fermeture est désormais à gauche du panneau. */

/* Popups Leaflet */
.leaflet-popup-content { margin: 10px 12px; font-family: 'Montserrat', sans-serif; }
.mc-pop h4 { margin: 0 0 2px; font-family: 'Cormorant Garamond', serif; font-size: 1.15rem; color: var(--ink); }
.mc-pop .sub { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.mc-pop .plist { max-height: 240px; overflow-y: auto; margin: 0; padding: 0; list-style: none; }
.mc-pop .plist li { font-size: 12px; padding: 3px 0; border-top: 1px solid var(--line); display: flex; gap: 6px; align-items: baseline; }
.mc-pop .plist li:first-child { border-top: none; }
.mc-pop .yr { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 11px; }
.mc-pop .who { color: var(--muted); font-size: 11px; }
.mc-pop .ptitle { cursor: pointer; text-decoration: underline dotted rgba(120,112,96,.5); text-underline-offset: 2px; }
.mc-pop .ptitle:hover { color: var(--gold); }
.mc-pop .seen-btn { margin-left: auto; cursor: pointer; border: 1px solid var(--line); background: #fff; border-radius: 6px; font-size: 11px; padding: 1px 7px; color: var(--muted); flex: 0 0 auto; }
.mc-pop .seen-btn.on { background: var(--c-opera-vue); border-color: transparent; color: #fff; }
.mc-pop .morebtn { margin-top: 6px; font-size: 11px; color: var(--gold); cursor: pointer; background: none; border: none; padding: 0; }

/* Marqueurs pastilles + clusters */
.mc-pin { border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.mc-pin-lbl { color: #fff; font-size: 10px; font-weight: 700; text-align: center; line-height: 1; }
.mc-cluster { border-radius: 50%; border: 2px solid #fff; color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,.35); }

/* Encart détail (fiche Wikipédia) */
.mc-detail { position: absolute; z-index: 650; top: 58px; right: 12px; width: 300px; max-width: calc(100% - 24px); max-height: calc(100% - 72px); overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(26,24,20,.2); padding: 14px 15px; }
.mc-detail .close { position: absolute; top: 8px; right: 10px; background: none; border: none; font-size: 20px; color: var(--muted); cursor: pointer; line-height: 1; }
.mc-detail .d-cat { font-size: 11px; color: var(--gold); letter-spacing: .04em; }
.mc-detail h3 { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 1.3rem; margin: 2px 0 4px; color: var(--ink); }
.mc-detail .d-where { font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }
.mc-detail .d-img { float: right; width: 118px; margin: 0 0 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper-dark); cursor: zoom-in; }
.mc-detail .d-body { font-size: 12.5px; line-height: 1.5; }
.mc-detail .d-link { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--gold); text-decoration: none; }
.mc-detail .d-actions { margin-top: 10px; display: flex; gap: 6px; }
.mc-detail .d-act { flex: 1; font: inherit; font-size: 12px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.mc-detail .d-act.on { background: var(--c-peint); border-color: transparent; color: #fff; }

/* Légende flottante */
.mc-legend { position: absolute; z-index: 600; bottom: 14px; left: 12px; background: rgba(255,255,255,.95); border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; font-size: 11.5px; box-shadow: 0 6px 18px rgba(26,24,20,.12); }
.mc-legend .lg { display: flex; align-items: center; gap: 7px; margin: 3px 0; }
.mc-legend .lg .dot { width: 11px; height: 11px; border-radius: 50%; }

.mc-toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 8px; font-size: 13px; z-index: 4000; box-shadow: 0 6px 20px rgba(0,0,0,.3); opacity: 0; transition: opacity .2s; pointer-events: none; }

#mc-lightbox { position: fixed; inset: 0; background: rgba(20,18,14,.9); z-index: 5000; display: none; align-items: center; justify-content: center; cursor: zoom-out; padding: 24px; }
#mc-lightbox img { max-width: 96%; max-height: 96%; border-radius: 8px; box-shadow: 0 12px 44px rgba(0,0,0,.55); background: #fff; }

@media (max-width: 800px) {
  .mc-wrap { flex-direction: column; }
  .mc-panel { flex-basis: auto; width: 100%; max-height: 300px; }
  .mc-mapbox { height: 60vh; }
  .mc-detail { width: 250px; }
}
