/*
 * The themes to try (lot « Les thèmes à essayer », 27/11/2026; App\Theme\Charte, docs/CHARTE.md): the three
 * directions of the charte over today's look, chosen by html[data-charte] (« Actuel »: no attribute, nothing here
 * applies). Each one sets EasyAdmin's own tokens, so every screen follows: its greys (--true-gray-*, a slight hue of
 * its own), its main colour (--ea-primary, from which EasyAdmin works out its buttons, focus rings and soft
 * backgrounds), its fonts (--font-family-sans-serif, its titles' face), light on html, dark on body.ea-dark-scheme
 * (where EasyAdmin declares its dark ones); then the few places app.css writes indigo by hand. The gold and the
 * toque of the offers never change. Every text colour here reaches WCAG AA on its background.
 * Its fonts: SIL Open Font License, latin, from the @fontsource npm packages, served by the app (assets/lib/fonts),
 * a browser downloading only those of the theme shown.
 */

@font-face { font-family: "Charte Bricolage Grotesque"; src: url("../lib/fonts/bricolage-grotesque-5.3.0/bricolage-grotesque-latin-wght-normal-XEJcKrT.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Charte Figtree"; src: url("../lib/fonts/figtree-5.3.0/figtree-latin-wght-normal-Dj9csJy.woff2") format("woff2"); font-weight: 300 900; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Charte Archivo"; src: url("../lib/fonts/archivo-5.3.0/archivo-latin-wdth-normal-Wa7z_Iw.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Charte Public Sans"; src: url("../lib/fonts/public-sans-5.3.0/public-sans-latin-wght-normal-29KbApT.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Charte Young Serif"; src: url("../lib/fonts/young-serif-5.3.0/young-serif-latin-400-normal-67MOM3I.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Charte Source Sans 3"; src: url("../lib/fonts/source-sans-3-5.3.1/source-sans-3-latin-wght-normal-u4wvMPu.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- 1 · Terracotta: the vitrine's cream and terracotta, rounder titles ---------- */
html[data-charte="terracotta"] {
    --true-gray-50: oklch(0.983 0.007 75); --true-gray-100: oklch(0.966 0.009 75); --true-gray-200: oklch(0.92 0.012 75);
    --true-gray-300: oklch(0.868 0.014 75); --true-gray-400: oklch(0.706 0.014 70); --true-gray-500: oklch(0.556 0.013 70);
    --true-gray-600: oklch(0.44 0.012 65); --true-gray-700: oklch(0.372 0.011 65); --true-gray-800: oklch(0.27 0.01 60);
    --true-gray-900: oklch(0.205 0.008 60); --true-gray-950: oklch(0.147 0.006 60);
    --ea-primary: #a8461f; --ea-primary-foreground: #ffffff;
    --charte-link: #a8461f; --charte-soft: #f5e6dc; --charte-on-soft: #8a3818;
    --charte-page: #faf7f2; --charte-panel: #ffffff;
    --font-family-sans-serif: "Charte Figtree", var(--font-family-system-sans-serif, system-ui, sans-serif);
    --charte-title-font: "Charte Bricolage Grotesque", var(--font-family-system-sans-serif, system-ui, sans-serif);
    --charte-title-weight: 700; --charte-title-stretch: 100%;
}
html[data-charte="terracotta"] body.ea-dark-scheme {
    --font-family-sans-serif: "Charte Figtree", var(--font-family-system-sans-serif, system-ui, sans-serif);
    --ea-primary: #e0804f; --ea-primary-foreground: #1a0d06;
    --charte-link: #e0804f; --charte-soft: #33241b; --charte-on-soft: #f0a57d;
}

/* ---------- 2 · Cuivre et fonte: porcelain, cast-iron buttons and menu, copper links, narrow titles ---------- */
html[data-charte="cuivre"] {
    --true-gray-50: oklch(0.977 0.003 70); --true-gray-100: oklch(0.962 0.004 70); --true-gray-200: oklch(0.918 0.006 70);
    --true-gray-300: oklch(0.866 0.007 65); --true-gray-400: oklch(0.705 0.008 65); --true-gray-500: oklch(0.553 0.008 60);
    --true-gray-600: oklch(0.437 0.008 60); --true-gray-700: oklch(0.37 0.007 60); --true-gray-800: oklch(0.268 0.006 60);
    --true-gray-900: oklch(0.204 0.005 60); --true-gray-950: oklch(0.146 0.004 60);
    --ea-primary: #2b2825; --ea-primary-foreground: #ffffff;
    --charte-link: #a4531f; --charte-soft: #f6e8dd; --charte-on-soft: #8c4519;
    --charte-page: #f5f4f2; --charte-panel: #ffffff;
    --font-family-sans-serif: "Charte Public Sans", var(--font-family-system-sans-serif, system-ui, sans-serif);
    --charte-title-font: "Charte Archivo", "Arial Narrow", var(--font-family-system-sans-serif, system-ui, sans-serif);
    --charte-title-weight: 750; --charte-title-stretch: 78%;
}
html[data-charte="cuivre"] body.ea-dark-scheme {
    --font-family-sans-serif: "Charte Public Sans", var(--font-family-system-sans-serif, system-ui, sans-serif);
    --ea-primary: #e8e2da; --ea-primary-foreground: #1a1816;
    --charte-link: #e59a62; --charte-soft: #33251b; --charte-on-soft: #eeae7e;
}
/* Its menu in cast iron, light or dark: EasyAdmin's dark menu tokens, its logo's light version */
html[data-charte="cuivre"] body:not(.ea-dark-scheme) {
    --sidebar-bg: #2b2825; --sidebar-border-color: #2b2825; --sidebar-menu-color: #ece8e2; --sidebar-menu-icon-color: #b9b2a9;
    --sidebar-item-hover-bg: rgba(255, 255, 255, .07); --sidebar-menu-hover-color: #ffffff; --sidebar-logo-color: #ece8e2;
    --sidebar-menu-active-item-bg: rgba(255, 255, 255, .12); --sidebar-menu-active-item-color: #ffffff;
    --sidebar-menu-header-color: #b9b2a9; --sidebar-menu-badge-bg: rgba(255, 255, 255, .14); --sidebar-menu-badge-color: #ece8e2;
}
/* Inside its dark menu, the tokens its own pieces read (the organisation's name and offer, the badges) */
html[data-charte="cuivre"] body:not(.ea-dark-scheme) aside.ea-sidebar {
    --text-color: #ece8e2; --text-muted: #c2bbb2; --body-bg: #3a3632; --border-color: #4a4540;
    color: #ece8e2;
}
html[data-charte="cuivre"] body:not(.ea-dark-scheme) aside.ea-sidebar .ea-sidebar-badge.badge-danger { background: #f08a80; color: #1d1b19; }
html[data-charte="cuivre"] body:not(.ea-dark-scheme) #header-logo .brand-logo-on-light { display: none; }
html[data-charte="cuivre"] body:not(.ea-dark-scheme) #header-logo .brand-logo-on-dark { display: block; }

/* ---------- 3 · Bordeaux et or: a table linen, wine red, menu-card titles ---------- */
html[data-charte="bordeaux"] {
    --true-gray-50: oklch(0.981 0.004 20); --true-gray-100: oklch(0.966 0.006 20); --true-gray-200: oklch(0.92 0.009 15);
    --true-gray-300: oklch(0.868 0.011 15); --true-gray-400: oklch(0.706 0.012 10); --true-gray-500: oklch(0.556 0.012 10);
    --true-gray-600: oklch(0.44 0.012 10); --true-gray-700: oklch(0.372 0.011 10); --true-gray-800: oklch(0.27 0.01 10);
    --true-gray-900: oklch(0.206 0.009 10); --true-gray-950: oklch(0.147 0.007 10);
    --ea-primary: #7a1f35; --ea-primary-foreground: #ffffff;
    --charte-link: #7a1f35; --charte-soft: #f3e3e7; --charte-on-soft: #64182b;
    --charte-page: #f9f7f4; --charte-panel: #ffffff;
    --font-family-sans-serif: "Charte Source Sans 3", var(--font-family-system-sans-serif, system-ui, sans-serif);
    --charte-title-font: "Charte Young Serif", Georgia, serif;
    --charte-title-weight: 400; --charte-title-stretch: 100%;
}
html[data-charte="bordeaux"] body.ea-dark-scheme {
    --font-family-sans-serif: "Charte Source Sans 3", var(--font-family-system-sans-serif, system-ui, sans-serif);
    --ea-primary: #e8899d; --ea-primary-foreground: #2a0c14;
    --charte-link: #e8899d; --charte-soft: #3a2229; --charte-on-soft: #f0a3b3;
}

/* ---------- What every theme does with its tokens ---------- */
/* A light page with its panels in white (EasyAdmin: white on white) */
html[data-charte]:not([data-charte="actuel"]) body:not(.ea-dark-scheme) {
    --body-bg: var(--charte-page); --content-bg: var(--charte-page); --form-fieldset-panel-bg: var(--charte-panel);
    --responsive-header-bg: var(--charte-page);
}
/* Its links in its colour (EasyAdmin: the text's), its titles in its face */
html[data-charte]:not([data-charte="actuel"]) body { --link-color: var(--charte-link); }
html[data-charte]:not([data-charte="actuel"]) :is(.content-header-title .title, .form-fieldset-title-content, .bq-plan-head strong, .login-card h2, .modal-title) {
    font-family: var(--charte-title-font); font-weight: var(--charte-title-weight); font-stretch: var(--charte-title-stretch); font-synthesis: none;
}

/* What app.css writes in indigo by hand: in the theme's colour */
html[data-charte]:not([data-charte="actuel"]) :is(table.datagrid td a.ea-row-link, table.datagrid tbody td a.contact-name, span.bq-check-more a, a.bq-check-more, .stage-quote) { color: var(--charte-link); }
html[data-charte]:not([data-charte="actuel"]) :is(.contact-pro, .bq-step-num) { background: var(--charte-soft); color: var(--charte-on-soft); }
html[data-charte]:not([data-charte="actuel"]) :is(.fu-filter.active, .bq-lost-reason[aria-checked="true"], .bq-lost-reason[aria-pressed="true"]) { background: var(--ea-primary); border-color: var(--ea-primary); color: var(--ea-primary-foreground); }
html[data-charte]:not([data-charte="actuel"]) .bq-hint { border-color: var(--charte-link); background: var(--charte-soft); color: var(--charte-on-soft); }
html[data-charte]:not([data-charte="actuel"]) :is(.call-recent-pill:hover, .stage-btn:hover:not([disabled])) { border-color: var(--charte-link); color: var(--charte-link); }
html[data-charte]:not([data-charte="actuel"]) .qt-line:focus { border-color: var(--charte-link); box-shadow: 0 0 0 3px var(--charte-soft); }
html[data-charte]:not([data-charte="actuel"]) .bq-chip-add { border-color: var(--charte-link); color: var(--charte-link); }

/* The sign-in page (security/_layout.html.twig): its slate background and button in the theme's */
html[data-charte="terracotta"] body:has(.login-container) { background: #8e3a18; }
html[data-charte="cuivre"] body:has(.login-container) { background: #2b2825; }
html[data-charte="bordeaux"] body:has(.login-container) { background: #5a1627; }
html[data-charte]:not([data-charte="actuel"]) body:has(.login-container) { font-family: var(--font-family-sans-serif); }
html[data-charte]:not([data-charte="actuel"]) .btn-login { background: var(--charte-login-button, var(--ea-primary)); color: var(--charte-login-ink, var(--ea-primary-foreground)); }
html[data-charte]:not([data-charte="actuel"]) .btn-login:hover { background: var(--charte-login-button, var(--ea-primary)); filter: brightness(.92); }
/* Cuivre et fonte: its copper button on its cast-iron page */
html[data-charte="cuivre"] { --charte-login-button: #a4531f; --charte-login-ink: #ffffff; }

/* ---------- The picker (admin/components/_charte_picker.html.twig) ---------- */
.charte-picker {
    position: fixed; z-index: 1040; left: max(12px, env(safe-area-inset-left, 0px));
    bottom: calc(12px + var(--bq-tabbar-h, env(safe-area-inset-bottom, 0px)));
    display: flex; align-items: center; gap: 2px; padding: 3px 3px 3px 10px; border-radius: 999px;
    background: var(--content-bg, #fff); color: var(--text-color, #1f2937); border: 1px solid var(--border-color, #e5e7eb);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .12); font: 500 12px/1 var(--font-family-system-sans-serif, system-ui, sans-serif);
}
.charte-picker-label { margin-right: 4px; color: var(--text-muted, #6b7280); }
.charte-picker button {
    border: 0; background: none; color: inherit; font: inherit; padding: 6px 9px; border-radius: 999px; cursor: pointer; min-width: 28px;
}
.charte-picker button[aria-pressed="true"] { background: var(--text-color, #1f2937); color: var(--content-bg, #fff); }
.charte-picker button:focus-visible { outline: 2px solid var(--ea-primary, #2563eb); outline-offset: 1px; }
@media (prefers-reduced-motion: no-preference) { .charte-picker button { transition: background .15s, color .15s; } }
/* Floating on a computer (over the menu's foot); at the menu's end on a phone, never over its pages' bottom bars */
.charte-picker--menu {
    position: static; box-shadow: none; margin: 12px 10px 16px; width: max-content; max-width: calc(100% - 20px);
    /* In the menu's own colours (Cuivre et fonte: its cast iron), never the page's */
    background: transparent; color: var(--sidebar-menu-color, inherit); border-color: var(--sidebar-border-color, var(--border-color, #e5e7eb));
}
.charte-picker--menu .charte-picker-label { color: inherit; opacity: .75; }
.charte-picker--menu button[aria-pressed="true"] { background: var(--sidebar-menu-active-item-bg, rgba(0, 0, 0, .08)); color: var(--sidebar-menu-active-item-color, inherit); }
@media (min-width: 992px) { .charte-picker--menu { display: none; } }
@media (max-width: 991.98px) { .charte-picker--floating { display: none; } }
@media print { .charte-picker { display: none; } }
