/* France — repo-local styles: theme vars France reads from CSS (--card2, bloc
 * palette), plus France-specific overrides (app-nav flag/brand, its .panel with
 * padding, matrix toolbar, hemicycle group list, 1.5fr sankey grid, tables).
 * Loaded AFTER core/theme/*. Shared shell lives in core. */
:root {
  --card2: var(--surface-2);
  --bloc-EXG: #b91c1c; --bloc-GAU: #ef4444; --bloc-DIV: #a16207;
  --bloc-CENT: #d97706; --bloc-DTE: #2563eb; --bloc-EXD: #4a5f9e; --bloc-ECO: #16a34a;
  --bloc-abstention: #9ca3af; --bloc-blanc: #d1d5db; --bloc-nul: #6b7280; --bloc-blanc_nul: #9ca3af;
}


.subtitle { color: var(--muted); margin-bottom: 32px; font-size: 14px; }

/* Match the shared core panel look, but keep padding since France puts content
   directly in .panel (no .panel-body). */
.panel { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius);
         padding: 20px; margin-bottom: 24px; box-shadow: var(--shadow); }

/* Container matches the shared <main> width/padding so boxes are the same size. */
.wrap { max-width: var(--content-max); margin: 0 auto; padding: 32px 24px 0; }

.panel-header { display: flex; justify-content: space-between; align-items: center;
                margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
@media (max-width: 900px) {
  .scenario-grid { grid-template-columns: 1fr; }
}

.bar-cent { background: var(--bloc-CENT); height: 100%; transition: width .4s; }

.bar-exd  { background: var(--bloc-EXD);  height: 100%; transition: width .4s; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }

th { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border);
     font-weight: 600; color: var(--muted); }

td { padding: 6px; border-bottom: 1px solid rgba(51,65,85,0.5); }

.bloc-pill { display: inline-block; padding: 2px 8px; border-radius: 10px;
             font-size: 11px; font-weight: 600; color: white; }

footer { text-align: center; color: var(--muted); font-size: 12px;
         padding: 24px 0; border-top: 1px solid var(--border); }

.tooltip { position: absolute; background: rgba(0,0,0,.85); color: white;
           padding: 6px 10px; border-radius: 4px; font-size: 12px;
           pointer-events: none; opacity: 0; transition: opacity .2s; }

.svg-container { position: relative; }

.mtx-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 12px;
             font-size: 12px; color: var(--muted); flex-wrap: wrap; }

.mtx-tools button { font-size: 12px; padding: 4px 10px; cursor: pointer;
                    border: 1px solid var(--border); background: var(--panel); color: var(--text); border-radius: 4px; }

.mtx-tools button:hover { background: var(--card2); }

.mtx-status { margin-left: auto; }

.mtx-seg { position: absolute; top: 0; bottom: 0; display: flex; align-items: center;
           justify-content: flex-start; padding: 0 6px; color: white;
           font-size: 11px; font-weight: 600; overflow: hidden; white-space: nowrap;
           transition: background .1s; }

.mtx-row-total { width: 48px; font-size: 11px; color: var(--muted);
                 text-align: right; flex-shrink: 0; }

.mtx-row-total.bad { color: #fca5a5; font-weight: 600; }

.mtx-legend { display: flex; gap: 12px; flex-wrap: wrap; margin: 4px 0 10px;
              font-size: 11px; color: var(--muted); }

.mtx-legend .swatch { width: 10px; height: 10px; border-radius: 2px;
                       display: inline-block; vertical-align: middle; margin-right: 4px; }

.legend-strip { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }

@keyframes rotate-hint {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(90deg); }
}
@media (orientation: portrait) and (max-width: 900px) {
  .rotate-overlay { display: flex; }
}


.app-nav-flag {
  font-size: 20px;
  line-height: 1;
  margin-right: 6px;
  flex-shrink: 0;
}


.app-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity .2s ease;
  flex-shrink: 0;
}

.app-nav-brand:hover { opacity: 1; }

.app-nav-brand img { height: 24px; width: auto; display: block; }

.app-nav-brand .brand-wordmark {
  font-family: 'SF Mono', ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px; font-weight: 300; letter-spacing: 0.06em;
  color: var(--text-muted); line-height: 1; white-space: nowrap;
}

.app-nav-brand .brand-wordmark strong { color: var(--text-strong); font-weight: 700; }
@media (max-width: 720px) { .app-nav-brand .brand-wordmark { display: none; } }
@media (max-width: 680px) { .two-col { grid-template-columns: 1fr; } }
@media (max-width: 750px) { .sankey-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .hemi-layout { grid-template-columns: 1fr; } }


.gc-reset-btn, .reset-btn {
  font-size: 11px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 4px;
  cursor: pointer;
  color: var(--muted);
  margin-top: 8px;
  display: inline-block;
}

.gc-reset-btn:hover, .reset-btn:hover { background: var(--card2); color: var(--text); }


.majority-meter { margin-bottom: 12px; }

.majority-count-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}


.group-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 380px;
  overflow-y: auto;
}

.grp-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11.5px;
}

.grp-adj {
  display: flex;
  align-items: center;
  gap: 2px;
}

.adj-btn {
  width: 20px;
  height: 20px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 3px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--text);
}

.grp-count {
  width: 28px;
  text-align: right;
  font-weight: 600;
  font-size: 12px;
}

.grp-count.excluded { color: #6b7280; }
@media (orientation: landscape) and (max-height: 520px) {
  .wrap { padding: 10px 12px; }
  h1 { font-size: 20px; }
  h2 { font-size: 15px; margin-bottom: 10px; }
  .panel { padding: 12px; margin-bottom: 12px; }
  .panel-header { margin-bottom: 10px; }
  .sankey-matrix-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 10px; }
  .scenario-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  footer { padding: 12px 0; }
}

/* France's cross-page app-nav, restyled to read like the shared section-nav
   tabs (underline-active, no filled pill) so the menu matches UK & Italy. */
.app-nav { background: color-mix(in srgb, var(--surface-bg) 92%, transparent);
           backdrop-filter: blur(10px); z-index: 100; }
.app-nav-inner { height: auto; max-width: var(--content-max); }
.app-nav-link { border-radius: 0; border-bottom: 2px solid transparent;
                padding: 11px 16px; font-size: 0.8rem; }
.app-nav-link:hover  { background: transparent; color: var(--text); }
.app-nav-link.active { background: transparent; color: var(--accent);
                       border-bottom-color: var(--accent); }

/* Poll panel: current-poll bars (+ candidate dropdowns) on the left,
   time series on the right — mirrors the UK/Italy two-column poll layout. */
.polls-2col { display: grid; grid-template-columns: 360px minmax(0, 1fr);
              gap: 20px; align-items: start; }
.polls-col { min-width: 0; }
@media (max-width: 900px) { .polls-2col { grid-template-columns: 1fr; } }

/* Poll standings: each row = coloured party-code pill (with candidate dropdown)
   + horizontal bar + %, matching the UK/Italy standings look. */
#poll-standings .polls-bar-row { margin-bottom: 8px; }
#poll-standings .party-pick { width: 172px; flex-shrink: 0; justify-content: flex-start; }
#poll-standings .party-pick > span { flex-shrink: 0; }
#poll-standings .party-pick select { flex: 1 1 auto; min-width: 0; max-width: none; }

/* Single-candidate slot: fixed label styled like the dropdown it replaces. */
#poll-standings .party-pick .party-fixed {
  flex: 1 1 auto; min-width: 0; padding-left: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 600; color: #fff;
}

/* Dashboard (synthesis) nav button — custom mask icon, inherits link colour */
#nav-synthese-link::before{
  content:"";display:inline-block;width:13px;height:13px;vertical-align:-2px;margin-right:6px;
  background-color:currentColor;
  -webkit-mask:url(icon-dashboard.svg) center/contain no-repeat;
          mask:url(icon-dashboard.svg) center/contain no-repeat;
}
