/* Archives lyriques 5.19.0 — recherche patrimoniale + largeur de navigation */

html,body{max-width:100%;overflow-x:hidden}
.site-header{
  width:100%;
  max-width:100vw;
  box-sizing:border-box;
  grid-template-columns:minmax(190px,.78fr) minmax(330px,1.18fr) minmax(250px,.82fr) minmax(430px,1.55fr)!important;
  gap:clamp(6px,.65vw,12px)!important;
  padding-left:clamp(10px,1vw,18px)!important;
  padding-right:clamp(10px,1vw,18px)!important;
}
.site-header>*{min-width:0}
.site-brand{min-width:0}
.site-brand>span:last-child{min-width:0}
.site-brand strong,.site-brand small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.top-nav{
  min-width:0;
  display:flex!important;
  flex-wrap:nowrap;
  align-items:center;
  gap:4px!important;
  overflow:visible!important;
}
.top-nav button,
.heritage-nav-button{
  flex:1 1 0;
  width:auto;
  min-width:0!important;
  min-height:38px;
  height:38px;
  padding:5px clamp(6px,.55vw,10px)!important;
  display:flex!important;
  align-items:center;
  justify-content:center;
  gap:4px;
  line-height:1.05;
  text-align:center;
  white-space:normal!important;
  font-size:clamp(.57rem,.63vw,.7rem)!important;
  border-radius:var(--control-radius);
}
.header-theme-switcher{
  width:100%;
  max-width:100%!important;
  min-width:0;
  justify-content:center;
  box-sizing:border-box;
}
.theme-switcher-label{min-width:0!important;flex:1 1 82px}
.theme-switcher-label strong{max-width:100%!important}

.header-actions{
  min-width:0;
  display:flex!important;
  flex-wrap:wrap;
  align-items:center;
  justify-content:flex-end;
  gap:4px!important;
}
.header-actions>a,
.header-actions>button,
.header-actions>form,
.header-actions .header-action-button,
.header-actions .beta-lab-button,
.header-actions .guide-button,
.header-actions .deposit-button,
.header-actions .user-menu{
  flex:1 1 46px;
  min-width:0!important;
  width:auto;
  max-width:none!important;
  min-height:38px;
  height:38px;
  box-sizing:border-box;
  margin:0!important;
}
.header-actions>a,
.header-actions>button,
.header-actions .header-action-button,
.header-actions .beta-lab-button,
.header-actions .guide-button,
.header-actions .deposit-button{
  padding:5px 7px!important;
  display:flex!important;
  align-items:center;
  justify-content:center;
  gap:4px;
  text-align:center;
  font-size:clamp(.55rem,.62vw,.68rem)!important;
  line-height:1.05;
}
.header-actions .user-menu{
  padding:3px 6px!important;
}
.header-actions .user-menu>div{min-width:0}
.header-actions .user-menu strong,
.header-actions .user-menu small{
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.header-actions .logout-form{display:block}
.header-actions .logout-form button{width:100%;height:38px;padding:5px!important}
.header-action-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

body.header-compact .site-header{
  grid-template-columns:minmax(160px,.72fr) minmax(300px,1.2fr) minmax(205px,.72fr) minmax(390px,1.48fr)!important;
}
.header-compact .site-header .top-nav button,
.header-compact .site-header .heritage-nav-button,
.header-compact .site-header .header-actions>*,
.header-compact .site-header .header-actions button,
.header-compact .site-header .header-actions a{min-height:32px;height:32px!important}
.header-compact .site-header .header-action-label,
.header-compact .site-header .beta-lab-button,
.header-compact .site-header .guide-button,
.header-compact .site-header .deposit-button{font-size:.55rem!important}


body.header-compact .site-header .header-actions{flex-wrap:nowrap}
body.header-compact .site-header .header-actions>*{flex:1 1 0}

@media(max-width:1450px){
  .site-header{
    grid-template-columns:minmax(170px,.75fr) minmax(285px,1.08fr) minmax(220px,.72fr) minmax(360px,1.35fr)!important;
  }
  .header-actions{flex-wrap:wrap}
  .header-action-label{display:none}
  .beta-lab-button{font-size:0!important}
  .beta-lab-button span{font-size:.78rem}
  .guide-button{font-size:.56rem!important}
  .deposit-button{font-size:.56rem!important}
}
@media(max-width:1180px){
  .site-header{
    grid-template-columns:minmax(160px,.7fr) minmax(300px,1.3fr) minmax(350px,1.4fr)!important;
    grid-template-areas:"brand nav actions" "theme theme theme";
    height:auto!important;
    min-height:var(--header-height);
  }
  .site-brand{grid-area:brand}.top-nav{grid-area:nav}.header-theme-switcher{grid-area:theme;justify-self:stretch!important}.header-actions{grid-area:actions}
}
@media(max-width:820px){
  .site-header{
    grid-template-columns:minmax(145px,.75fr) minmax(0,1.25fr)!important;
    grid-template-areas:"brand actions" "nav nav" "theme theme";
  }
  .top-nav{display:flex!important;flex-wrap:wrap}
  .header-actions{flex-wrap:wrap}
}
@media(max-width:560px){
  .site-header{grid-template-columns:1fr!important;grid-template-areas:"brand" "nav" "actions" "theme"}
  .site-brand{justify-self:center}
  .top-nav{display:flex!important;flex-wrap:wrap}.top-nav button,.heritage-nav-button{flex:1 1 45%}
  .header-actions{display:flex!important;flex-wrap:wrap}.header-actions>*{flex:1 1 30%}
}

/* Thème intégré : Chrome Cinématique */
html[data-design="chrome-cinema"] body{
  background:
    radial-gradient(circle at 70% -10%,rgba(123,165,190,.15),transparent 36%),
    linear-gradient(145deg,#0a0f14 0%,#111923 42%,#080c10 100%);
}
html[data-design="chrome-cinema"] .site-header{
  border-bottom:1px solid rgba(220,236,246,.2);
  background:
    linear-gradient(180deg,rgba(255,255,255,.07),transparent 25%),
    linear-gradient(105deg,#0a1016 0%,#263540 48%,#0c1218 100%);
  box-shadow:0 12px 38px rgba(0,0,0,.52),inset 0 1px rgba(255,255,255,.11);
}
html[data-design="chrome-cinema"] .source-sidebar,
html[data-design="chrome-cinema"] .media-controls,
html[data-design="chrome-cinema"] .gallery-toolbar,
html[data-design="chrome-cinema"] .video-filmstrip{
  background:linear-gradient(145deg,rgba(35,49,60,.92),rgba(13,20,27,.96));
  border-color:rgba(166,188,202,.27);
  box-shadow:inset 0 1px rgba(255,255,255,.07),0 10px 26px rgba(0,0,0,.24);
}
html[data-design="chrome-cinema"] button,
html[data-design="chrome-cinema"] .secondary-button,
html[data-design="chrome-cinema"] .guide-button,
html[data-design="chrome-cinema"] .beta-lab-button{
  border-color:rgba(172,197,213,.38);
  background:linear-gradient(180deg,#354653 0%,#17222b 52%,#0d151c 100%);
  color:#edf4f8;
  box-shadow:inset 0 1px rgba(255,255,255,.16),0 3px 8px rgba(0,0,0,.28);
}
html[data-design="chrome-cinema"] button:hover,
html[data-design="chrome-cinema"] .secondary-button:hover{
  border-color:#e4a94f;
  box-shadow:inset 0 1px rgba(255,255,255,.22),0 0 14px rgba(228,169,79,.22);
}
html[data-design="chrome-cinema"] .deposit-button,
html[data-design="chrome-cinema"] .primary-button{
  background:linear-gradient(180deg,#ffd07a,#c8842d);
  color:#111820;
  border-color:#ffd98e;
  text-shadow:0 1px rgba(255,255,255,.35);
}
html[data-design="chrome-cinema"] .media-card{
  border-color:#3e4e5a;
  background:linear-gradient(150deg,#1a242d,#0b1117);
  box-shadow:0 10px 24px rgba(0,0,0,.44),inset 0 1px rgba(255,255,255,.06);
}
html[data-design="chrome-cinema"] .content-area{
  background:
    repeating-linear-gradient(90deg,rgba(255,255,255,.012) 0,rgba(255,255,255,.012) 1px,transparent 1px,transparent 7px),
    linear-gradient(140deg,#121a21,#0b1116);
}
html[data-design="chrome-cinema"] .brand-mark{
  border-color:#e4a94f;
  color:#ffd17f;
  box-shadow:0 0 18px rgba(228,169,79,.25),inset 0 0 12px rgba(255,255,255,.08);
}

/* Recherche patrimoniale */
.heritage-page{position:fixed;inset:0;z-index:920;display:grid;grid-template-rows:auto minmax(0,1fr);background:var(--paper);color:var(--ink)}
.heritage-page.hidden{display:none!important}.heritage-page-open{overflow:hidden}
.heritage-page-header{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:15px clamp(16px,3vw,42px);background:var(--wine-dark);color:#fff;border-bottom:1px solid var(--line)}
.heritage-page-header h1{margin:2px 0;color:#fff;font-size:clamp(1.2rem,2vw,2rem)}.heritage-page-header p{margin:0}
.heritage-page-layout{display:grid;grid-template-columns:minmax(250px,320px) minmax(0,1fr);min-height:0}
.heritage-search-sidebar{overflow:auto;padding:18px;border-right:1px solid var(--line);background:var(--ivory)}
.heritage-results-area{overflow:auto;padding:18px}.heritage-results-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px;margin-top:12px}
.heritage-result-card{overflow:hidden;border:1px solid var(--line);border-radius:var(--card-radius);background:var(--paper);box-shadow:var(--card-shadow)}
.heritage-result-card button{display:grid;width:100%;height:100%;padding:0;border:0;background:transparent;color:var(--ink);text-align:left}
.heritage-result-card button>span:last-child{display:grid;gap:3px;padding:8px}.heritage-result-card small{color:var(--muted)}
.heritage-result-visual{display:grid;aspect-ratio:4/3;place-items:center;background:#10151a;overflow:hidden}.heritage-result-visual img{width:100%;height:100%;object-fit:cover}
.heritage-detail-overlay{z-index:960}.heritage-detail-modal{width:min(1400px,96vw);max-width:none;height:min(900px,94vh);overflow:auto}
.heritage-detail-layout{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(300px,.6fr);gap:14px}
.heritage-region-stage{position:relative;display:grid;min-height:360px;place-items:center;background:#111;overflow:hidden;touch-action:none}
.heritage-region-stage img{display:block;max-width:100%;max-height:70vh;object-fit:contain}.heritage-region-stage.drawing{cursor:crosshair}
.heritage-region-overlays{position:absolute;pointer-events:none}.heritage-region-highlight{position:absolute;border:1px solid rgba(255,255,255,.5);border-radius:45%;opacity:.08;transition:.2s}
.heritage-region-highlight.active{opacity:1;transform:scale(1.05);border-color:#fff;box-shadow:0 0 0 3px rgba(255,215,110,.35),0 0 22px 8px rgba(255,219,109,.75)}
.heritage-draw-region{position:absolute;border:2px solid #ffe18a;background:rgba(255,220,110,.18);pointer-events:none}
#heritage-region-toolbar,.heritage-people-list{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-top:8px}.heritage-people-list>div{display:flex;flex-wrap:wrap;gap:4px}
.heritage-people-list button{border:1px solid var(--line);border-radius:999px;padding:4px 8px;background:var(--ivory)}
#heritage-metadata-panel pre{max-height:220px;overflow:auto;padding:8px;background:#111820;color:#e9f1f5;white-space:pre-wrap;word-break:break-word;font-size:.62rem}
@media(max-width:900px){.heritage-page-layout,.heritage-detail-layout{grid-template-columns:1fr}.heritage-search-sidebar{max-height:38vh;border-right:0;border-bottom:1px solid var(--line)}}

.heritage-admin-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px}.heritage-admin-grid>section{padding:12px;border:1px solid var(--line);border-radius:var(--card-radius);background:var(--paper)}.heritage-admin-grid article{display:flex;justify-content:space-between;gap:8px;padding:6px;border-bottom:1px solid var(--line)}.heritage-admin-grid article small,.heritage-authority-list small{color:var(--muted)}.heritage-authority-list{display:flex;flex-wrap:wrap;gap:5px;margin-top:8px}.heritage-authority-list>span{padding:4px 7px;border:1px solid var(--line);border-radius:999px;background:var(--ivory)}


/* 5.23.2 — résultats vidéo et localisation du visage. */
.heritage-result-visual.is-video{position:relative}
.heritage-result-visual video{width:100%;height:100%;object-fit:cover;background:#080b0e}
.heritage-video-play{
  position:absolute;display:grid;width:42px;height:42px;place-items:center;border-radius:50%;
  background:rgba(0,0,0,.62);color:#fff;font-size:18px;box-shadow:0 3px 12px rgba(0,0,0,.35)
}
.heritage-video-badge{
  position:absolute;right:6px;bottom:6px;padding:3px 6px;border-radius:999px;
  background:rgba(0,0,0,.7);color:#fff;font-size:9px;font-weight:800
}
.heritage-detail-video{display:grid;width:min(100%,960px);gap:10px;place-items:center;padding:14px}
.heritage-detail-video :is(video,iframe){display:block;width:min(100%,900px);aspect-ratio:16/9;border:0;background:#000}
.heritage-video-open{justify-self:center}
.heritage-face-help{flex:1 1 360px;line-height:1.35;color:var(--muted)}
#heritage-region-toolbar.locating .heritage-face-help{color:var(--ink);font-weight:600}
.heritage-region-stage.drawing::after{
  content:"1er clic : angle de départ · déplacement : taille · 2e clic : valider · Échap : annuler";
  position:absolute;z-index:5;left:50%;bottom:10px;transform:translateX(-50%);
  max-width:calc(100% - 20px);padding:6px 10px;border-radius:999px;
  background:rgba(0,0,0,.78);color:#fff;font-size:10px;white-space:nowrap;pointer-events:none
}


/* 5.24.0 — survol global des identifications patrimoniales. */
.heritage-identifications-title{
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-height:30px;
  padding:4px 9px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--paper);
  color:var(--ink);
  font-weight:900;
  cursor:help;
}
.heritage-identifications-title b{
  display:grid;
  min-width:20px;
  height:20px;
  place-items:center;
  border-radius:999px;
  background:var(--wine);
  color:#fff;
  font-size:.58rem;
}
.heritage-identifications-title:hover,
.heritage-identifications-title:focus-visible{
  border-color:var(--gold);
  box-shadow:0 0 0 2px color-mix(in srgb,var(--gold) 22%,transparent);
}
.heritage-people-list>small{
  display:block;
  margin-top:6px;
  color:var(--muted);
  font-size:.62rem;
}
