/* Trésoa Explorer — Clair / Sombre. Les images conservent leurs couleurs. */
html[data-theme="dark"]{
  --explorer-bg:#090908;--surface:#181817;--soft:#242422;--raised:#2c2b28;
  --ink:#f7f5ef;--secondary:#b8b4aa;--muted:#96928a;--line:#484640;
  --line-soft:#33322f;--gold:#eecd6e;--gold-deep:#e2bf67;
  --gold-active:#f0ca62;--gold-ink:#17140b;background:#090908;
}
html[data-theme="dark"] body{background:var(--explorer-bg);color:var(--ink)}
html[data-theme="dark"] .site-header{border-bottom-color:var(--line-soft);background:#090908ed}
html[data-theme="dark"] .brand img{opacity:0;filter:none}
html[data-theme="dark"] .header-search>.brand{position:relative}
html[data-theme="dark"] .header-search>.brand::before,
html[data-theme="dark"] .header-search>.brand::after{position:absolute;inset:0;pointer-events:none;content:"";mask:url("assets/tresoa-logo-on-light.svg") center/contain no-repeat;-webkit-mask:url("assets/tresoa-logo-on-light.svg") center/contain no-repeat}
html[data-theme="dark"] .header-search>.brand::before{background:#fff}
html[data-theme="dark"] .header-search>.brand::after{background:var(--gold);clip-path:inset(0 0 0 77%)}
html[data-theme="dark"] .site-navigation a:hover{color:var(--gold);text-decoration-color:var(--gold)}
html[data-theme="dark"] .location-button{color:var(--secondary)}
html[data-theme="dark"] .menu-toggle{color:var(--ink)}
html[data-theme="dark"] .theme-toggle{border-color:#f7f5ef;background:#090908;color:#f7f5ef;box-shadow:0 8px 28px #0009}
html[data-theme="dark"] .atlas-connected-sidebar{border-right-color:var(--line-soft);background:#090908;box-shadow:8px 0 30px #0008}
html[data-theme="dark"] .atlas-connected-sidebar__brand img{opacity:0}
html[data-theme="dark"] .atlas-connected-sidebar__brand{position:relative}
html[data-theme="dark"] .atlas-connected-sidebar__brand::before,html[data-theme="dark"] .atlas-connected-sidebar__brand::after{position:absolute;inset:0;content:"";mask:url("assets/tresoa-logo-on-light.svg") center/contain no-repeat;-webkit-mask:url("assets/tresoa-logo-on-light.svg") center/contain no-repeat}
html[data-theme="dark"] .atlas-connected-sidebar__brand::before{background:#fff}
html[data-theme="dark"] .atlas-connected-sidebar__brand::after{background:var(--gold);clip-path:inset(0 0 0 77%)}
html[data-theme="dark"] .atlas-connected-sidebar__collapse{border-color:var(--line);background:var(--surface);color:var(--secondary)}
html[data-theme="dark"] .atlas-connected-sidebar nav a:hover{background:var(--soft);color:var(--ink)}
html[data-theme="dark"] .atlas-connected-sidebar nav a[aria-current="page"]{background:var(--raised);color:var(--ink)}
html[data-theme="dark"] .button--gold{border-color:var(--gold);background:var(--gold);color:var(--gold-ink)}
html[data-theme="dark"] .button--gold:hover{background:#f7f5ef;color:#090908}
html[data-theme="dark"] .button--outline{border-color:var(--line);background:var(--surface);color:var(--ink)}

html[data-theme="dark"] .header-search{border-color:var(--line);background:var(--surface)}
html[data-theme="dark"] .header-search__control{border-color:#595750;background:#111110;color:#fff}
html[data-theme="dark"] .header-search__control input{color:#fff}
html[data-theme="dark"] .header-search__control input::placeholder{color:#fffd}
html[data-theme="dark"] .header-search__control button{color:#fff}
html[data-theme="dark"] .header-search__panel{border-color:var(--line);background:#111110;color:var(--ink)}
html[data-theme="dark"] .header-search__guide section+section,
html[data-theme="dark"] .header-search__results section+section{border-color:var(--line)}
html[data-theme="dark"] .header-search__guide button{border-color:var(--line);background:var(--surface);color:var(--ink)}
html[data-theme="dark"] .header-search__guide button:hover,
html[data-theme="dark"] .header-search .header-search__result:hover{background:var(--gold);color:var(--gold-ink)}

html[data-theme="dark"] .hero{background:#090908;color:var(--ink)}
html[data-theme="dark"] .hero .eyebrow{color:var(--gold)}
html[data-theme="dark"] .hero>p:not(.eyebrow){color:var(--secondary)}
html[data-theme="dark"] .filters{border-bottom-color:var(--line)}
html[data-theme="dark"] .filters button{border-color:var(--line);background:var(--surface);color:var(--secondary)}
html[data-theme="dark"] .filters button:hover{border-color:var(--gold);color:var(--ink)}
html[data-theme="dark"] .filters button[aria-pressed="true"]{border-color:var(--gold);background:var(--gold);color:var(--gold-ink);box-shadow:none}
html[data-theme="dark"] .discovery-filterbar{border-color:var(--line)}
html[data-theme="dark"] .discovery-filterbar label{border-color:var(--line)}
html[data-theme="dark"] .discovery-filterbar select{color:var(--ink);color-scheme:dark}
html[data-theme="dark"] .discovery-filterbar label:focus-within{background:var(--surface)}
html[data-theme="dark"] .discovery-filterbar__reset{color:var(--gold)}
html[data-theme="dark"] .territory-summary{border-color:var(--line);background:var(--surface)}
html[data-theme="dark"] .territory-summary button{border-color:var(--line);background:var(--soft);color:var(--ink)}
html[data-theme="dark"] .now-nearby{border-color:var(--line);background:#111110}
html[data-theme="dark"] .now-card{border-color:var(--line);background:var(--surface)}
html[data-theme="dark"] .unified-results .header-search__result{border-color:var(--line);background:var(--surface);color:var(--ink)}
html[data-theme="dark"] .unified-results .header-search__result:hover{border-color:var(--gold);background:#302b20}
html[data-theme="dark"] .unified-results__group{border-color:var(--line)}
html[data-theme="dark"] .unified-results__group h3 small{background:var(--soft)}
html[data-theme="dark"] .section-empty{border-color:var(--line);background:var(--surface)}
html[data-theme="dark"] .territory-dialog{border-color:var(--line);background:var(--surface);color:var(--ink)}
html[data-theme="dark"] .territory-choices button{border-color:var(--line);background:var(--soft);color:var(--ink)}
html[data-theme="dark"] .territory-choices button[aria-pressed="true"]{border-color:var(--gold);background:var(--gold);color:var(--gold-ink)}
html[data-theme="dark"] .territory-dialog__close{border-color:var(--line);background:#090908;color:var(--ink)}

html[data-theme="dark"] .content-section{border-color:var(--line)}
html[data-theme="dark"] .section-header a,
html[data-theme="dark"] .text-link,
html[data-theme="dark"] .card-link,
html[data-theme="dark"] .work-count,
html[data-theme="dark"] .dates{color:var(--gold-deep)}
html[data-theme="dark"] .card,
html[data-theme="dark"] .practice-panel,
html[data-theme="dark"] .artists-page-teaser,
html[data-theme="dark"] .empty-state{border-color:var(--line);background:var(--surface)}
html[data-theme="dark"] .exhibition-card{border:0;box-shadow:none}
html[data-theme="dark"] .exhibition-card .media,
html[data-theme="dark"] .exhibition-card .card-body{border:0;outline:0}
html[data-theme="dark"] .artist-chips__count{background:#2b2a27;color:#f7f5ef!important}
html[data-theme="dark"] .exhibition-card__open{background:#242422;color:var(--gold)}
html[data-theme="dark"] .exhibition-card__open:hover{background:var(--gold);color:var(--gold-ink)}
html[data-theme="dark"] .card-body{background:var(--surface)}
html[data-theme="dark"] .card-meta,
html[data-theme="dark"] .card-description{color:var(--secondary)}
html[data-theme="dark"] .media{background:var(--raised)}
html[data-theme="dark"] .status,
html[data-theme="dark"] .practice-pill{border-color:var(--line);background:var(--soft);color:var(--ink)}
html[data-theme="dark"] .status--media{border-color:#ffffff8c;background:#111110d9;color:#fff}
html[data-theme="dark"] .status--media.status--current{border-color:#38b779;background:#38b779;color:#071a11}
html[data-theme="dark"] .status--media.status--upcoming{border-color:#f59e0b;background:#f59e0b;color:#231404}
html[data-theme="dark"] .mini-portrait,
html[data-theme="dark"] .artist-profile-detail__portrait{border-color:var(--surface)}
html[data-theme="dark"] .practice-button{border:1px solid var(--line);background:var(--soft);color:var(--ink)}
html[data-theme="dark"] .practice-button:hover{border-color:var(--gold);background:#302b20}
html[data-theme="dark"] .practice-button[aria-pressed="true"]{border-color:var(--gold);background:var(--gold);color:var(--gold-ink)}
html[data-theme="dark"] .practice-button__count{border-color:var(--line);background:var(--surface);color:var(--ink)}

html[data-theme="dark"] .card-share{border-color:var(--line);background:var(--surface);color:var(--ink)}
html[data-theme="dark"] .card-share:hover{border-color:var(--gold);background:var(--gold);color:var(--gold-ink)}
html[data-theme="dark"] .ta-artist-portal-card{border-color:var(--line);background:var(--surface);box-shadow:none}
html[data-theme="dark"] .ta-artist-portal-card__portrait{border-color:var(--surface)}
html[data-theme="dark"] .ta-artist-portal-card__bio{color:var(--secondary)}
html[data-theme="dark"] .ta-artist-portal-card__contact{border-color:var(--line);background:var(--surface);color:var(--ink)}
html[data-theme="dark"] .ta-artist-portal-card__action{border-color:var(--gold);background:var(--gold);color:var(--gold-ink)}
html[data-theme="dark"] .ta-artist-portal-card__contact:hover{border-color:var(--gold);background:var(--gold);color:var(--gold-ink)}
html[data-theme="dark"] .ta-artist-portal-card__stats,
html[data-theme="dark"] .ta-artist-portal-card__stats div+div{border-color:var(--line)}
html[data-theme="dark"] .territory-artist-card{border-color:var(--line);background:var(--surface)}
html[data-theme="dark"] .territory-artist-card__portrait{border-color:var(--surface);background:var(--raised)}
html[data-theme="dark"] .territory-artist-card__action{border-color:#fff;background:#fff;color:#090908}
html[data-theme="dark"] .territory-artist-card__contact{border-color:#fff;background:transparent;color:#fff}

html[data-theme="dark"] .archive-card,
html[data-theme="dark"] .place-card{background:var(--surface)}
html[data-theme="dark"] .participation{background:#12110f}
html[data-theme="dark"] .participation>div:first-child .eyebrow{color:var(--gold)}
html[data-theme="dark"] .participation-grid button:nth-child(1){border-color:#b88b2e;background:#8a5b0a;color:#fff}
html[data-theme="dark"] .participation-grid button:nth-child(2){border-color:var(--gold);background:var(--gold);color:var(--gold-ink)}
html[data-theme="dark"] .participation-grid button:nth-child(3){border-color:var(--line);background:var(--surface);color:var(--ink)}
html[data-theme="dark"] .participation-grid button:nth-child(3) small{color:var(--secondary)}

html[data-theme="dark"] .site-footer{background:#090908;color:var(--secondary)}
html[data-theme="dark"] .footer-shell{border-color:var(--line);background:var(--surface)}
html[data-theme="dark"] .footer-actions button:nth-child(1){border-color:#f7f5ef;background:#f7f5ef;color:#090908}
html[data-theme="dark"] .footer-actions button:nth-child(2){border-color:var(--gold);background:var(--gold);color:var(--gold-ink)}
html[data-theme="dark"] .footer-actions button:nth-child(3){border-color:var(--line);background:#090908;color:#fff}
html[data-theme="dark"] .footer-meta{border-color:var(--line)}
html[data-theme="dark"] .footer-meta button{color:var(--secondary)}

html[data-theme="dark"] .detail-dialog{border:1px solid var(--line);background:var(--surface);color:var(--ink)}
html[data-theme="dark"] .dialog-close{border-color:var(--line);background:#090908;color:#fff}
html[data-theme="dark"] .relations,
html[data-theme="dark"] .artist-profile-detail__stats,
html[data-theme="dark"] .artist-profile-detail__stats div+div{border-color:var(--line)}
html[data-theme="dark"] .artist-profile-detail__tags span{border-color:var(--line);background:var(--soft)}
html[data-theme="dark"] .toast{border:1px solid var(--gold);background:#f7f5ef;color:#090908}

/* Protection explicite des visuels éditoriaux. */
html[data-theme="dark"] .sprite,
html[data-theme="dark"] .media,
html[data-theme="dark"] .art-sprite,
html[data-theme="dark"] .people-sprite,
html[data-theme="dark"] .venue-sprite{filter:none}

@media(max-width:760px){html[data-theme="dark"] .site-navigation{border-color:var(--line);background:#111110}}
@media(prefers-reduced-motion:reduce){.theme-toggle{transition:none}}
