@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Noto+Serif:wght@400;500;600;700&display=swap');

:root {
    color-scheme: light;
    --ink: #17243a;
    --muted: #68758a;
    --blue: #234db8;
    --blue-dark: #183a91;
    --line: #e2e7f0;
    --paper: #ffffff;
    --canvas: #f5f7fb;
    --soft-blue: #edf2ff;
    --shadow: 0 18px 50px rgba(26, 43, 79, .07);
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; color: var(--ink); font-family: "DM Sans", Arial, sans-serif; line-height: 1.6; }
a { color: var(--blue); }
.site-header { height: 82px; padding: 0 max(24px, calc((100vw - 1120px)/2)); display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 6px;  }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; letter-spacing: -.3px; }
.brand small { color: var(--muted); font-size: 12px; }
.header-note { color: var(--muted); font-size: 13px; }
.page-shell { width: min(100% - 40px, 1000px); margin: 0 auto; }
.hero { padding: 58px 0 35px; max-width: 720px; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 11px; font-weight: 700; letter-spacing: .16em; }
h1, h2, h3, p { margin-top: 0; }
.hero h1 { margin-bottom: 12px; font: 600 clamp(32px, 5vw, 48px)/1.15 "Noto Serif", Georgia, serif; letter-spacing: -1.4px; }
.intro { max-width: 630px; margin: 0; color: var(--muted); font-size: 16px; }
.search-panel { margin-top: 24px; padding: 25px; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.search-panel label { display: block; margin-bottom: 10px; font-size: 13px; font-weight: 700; }
.search-row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 7px 6px 16px; border: 1px solid #cfd7e6; border-radius: 12px; background: #fff;}
.search-row:focus-within { border-color: #7391e6; box-shadow: 0 0 0 4px rgba(35,77,184,.09); }
.search-symbol-bailly { color: var(--blue); font-size: 27px; line-height: 1; transform: rotate(-20deg); }
.search-symbol-gaffiot { color: #c00; font-size: 27px; line-height: 1; transform: rotate(-20deg); }
.search-row input { flex: 1; width: 100%; min-width: 0; height: 36px; padding: 5px 0; border: 0; outline: 0; color: var(--ink); background: transparent; font: 17px "Noto Serif", Georgia, serif; }
.search-row input::placeholder { color: #929caf; }
.bailly { min-height: 35px; padding: 0 17px; border: 0; border-radius: 9px; background: #2C2CCC; color: white; font: 600 13px "DM Sans", sans-serif; cursor: pointer; transition: background .15s, transform .15s; }
.bailly:hover { background: #c00; }
.gaffiot { min-height: 35px; padding: 0 17px; border: 0; border-radius: 9px; background: #c00; color: white; font: 600 13px "DM Sans", sans-serif; cursor: pointer; transition: background .15s, transform .15s; }
.gaffiot:hover { background: #2C2CCC; }
.search-row button:active { transform: translateY(1px); }
.search-help { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.results-section, .article-card { margin: 28px 0 45px; padding: 28px; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.results-heading { display: flex; justify-content: space-between; align-items: end; gap: 15px; margin-bottom: 17px; }
.results-heading h2 { margin: 0; font: 600 24px "Noto Serif", Georgia, serif; }
.query-chip { max-width: 45%; overflow-wrap: anywhere; padding: 7px 12px; color: var(--blue); background: var(--soft-blue); border-radius: 9px; font: 16px "Noto Serif", serif; }
.result-list { border-top: 1px solid var(--line); }
.result-item { display: grid; grid-template-columns: minmax(0, 1fr) auto 20px; gap: 16px; align-items: center; padding: 16px 6px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.result-item:hover { background: #f8faff; }
.result-greek { font: 600 21px "Noto Serif", Georgia, serif; overflow-wrap: anywhere; }
.result-meta { color: var(--muted); font-size: 11px; }
.result-arrow { color: #8a96ab; font-size: 18px; }
.empty-state { padding: 45px 10px 30px; text-align: center; }
.empty-icon { display: inline-grid; place-items: center; width: 50px; height: 50px; margin-bottom: 12px; color: var(--blue); background: var(--soft-blue); border-radius: 50%; font-size: 29px; }
.empty-state h3 { margin-bottom: 5px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 13px; }
.article-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 17px; border-bottom: 1px solid var(--line); color: var(--blue); font-size: 10px; font-weight: 700; letter-spacing: .15em; }
.article-topline a { letter-spacing: 0; font-size: 12px; font-weight: 500; }
.article-lemma { margin: 24px 0; color: var(--blue-dark); font: 600 clamp(30px, 5vw, 42px)/1.2 "Noto Serif", Georgia, serif; overflow-wrap: anywhere; }
.article-content { font-family: "Noto Serif", Georgia, serif; font-size: 16px; line-height: 1.85; overflow-wrap: anywhere; }
.article-content p { margin: 0 0 1em; }
.article-content table { max-width: 100%; border-collapse: collapse; }
.article-content td, .article-content th { padding: 4px 8px; border: 1px solid var(--line); }
.notice { margin: 24px 0; padding: 18px 20px; border-radius: 12px; }
.notice p { margin: 7px 0 0; }
.notice.error { color: #7d2632; background: #fff0f1; border: 1px solid #f1cbd0; }
.notice code { overflow-wrap: anywhere; }
.site-footer { padding: 25px 0 35px; color: var(--muted); border-top: 1px solid var(--line); font-size: 11px; text-align: center;}
.site-footer p { margin: 0 0 8px; }
.site-footer a { color: var(--blue); }
.footer-small { opacity: .85; color: #4351D0;}
@media (max-width: 720px) {
    .site-header { height: 72px; padding: 0 20px; }
    .header-note { display: none; }
    .page-shell { width: min(100% - 28px, 1000px); }
    .hero { padding: 38px 0 27px; }
    .hero h1 { letter-spacing: -.7px; }
    .intro { font-size: 14px; }
    .search-panel { padding: 17px; }
    .search-row { flex-wrap: wrap; padding: 8px; gap: 8px; }
    .search-symbol { padding-left: 5px; }
    .search-row input { width: calc(100% - 55px); flex: 1; font-size: 16px; }
    .search-row button { width: 100%; }
    .results-section, .article-card { padding: 19px; }
    .results-heading { align-items: start; flex-direction: column; }
    .query-chip { max-width: 100%; }
    .result-item { grid-template-columns: minmax(0,1fr) 20px; gap: 4px 10px; }
    .result-meta { grid-column: 1; }
    .result-arrow { grid-column: 2; grid-row: 1 / span 2; }
}


/* Navigation entre les deux dictionnaires */
.tabs { display: flex; gap: 8px; margin-top: 8px; }
.tabs a { border: 1px solid #ABABAB; border-bottom: none;}
.tabs a { position: relative; padding: 13px 18px; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; border-radius: 10px 10px 0 0; }
.tab1 a:hover { color: var(--blue); background: #edf1f9; }
.tab2 a:hover { color: #c00; background: #FDF1F3; }
.tabs a.active { color: var(--blue); background: var(--paper); border-color: #8084F5; }
.tabs a.active2 { color: #c00; background: var(--paper); border-color: #FF5C5C; }
.tabs a.active::after { position: absolute; right: 16px; bottom: -1px; left: 16px; height: 3px; background: var(--blue); border-radius: 3px 3px 0 0; content: ""; }
.tabs a.active2::after { position: absolute; right: 16px; bottom: -1px; left: 16px; height: 3px; background: #c00; border-radius: 3px 3px 0 0; content: ""; }
/* Bailly : bordure bleue */
.search-row.search-bailly { border-color: #0B58CC;}
.search-row.search-bailly:focus-within { border-color: #0B58CC; box-shadow: 0 0 0 4px rgba(11, 88, 204, .12);}
/* Gaffiot : bordure rouge */
.search-row.search-gaffiot { border-color: #c00;}
.search-row.search-gaffiot:focus-within { border-color: #c00; box-shadow: 0 0 0 4px rgba(204, 0, 0, .12);}
/* L'input ne possède plus sa propre bordure */
.search-row input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;}
.search-row input.input-bailly::placeholder {color: #0B58CC; opacity: 0.7;}
.search-row input.input-gaffiot::placeholder { color: #c00; opacity: 0.7;}
.gaffiot-content { font-family: "Noto Serif", Georgia, serif; }
.gaffiot-content .entry { margin: 0; }
.gaffiot-content img { display: block; max-width: 100%; height: auto; margin: 1.25rem auto; border-radius: 8px; }
.gaffiot-content img[width], .gaffiot-content img[height] { height: auto; }
.gaffiot-content .lemma { color: var(--blue-dark); font-weight: 700; font-size: 1.12em; }
.gaffiot-content .sublemma { font-weight: 600; }
.gaffiot-content .latin { font-style: italic; }
.gaffiot-content .auth, .gaffiot-content .title, .gaffiot-content .refno { color: #58657a; font-size: .92em; }
.gaffiot-content p { margin: .65em 0; }
.gaffiot-content .level1 { margin-top: 1.2em; font-weight: 500; }
.gaffiot-content .level2 { margin-left: 1.2em; }
.gaffiot-content .level3 { margin-left: 2.4em; }
.gaffiot-content .levelar { margin: 1.2em 0; text-align: center; color: var(--muted); }
@media (max-width: 720px) {
    .tabs a { flex: 1; padding: 12px 8px; text-align: center; font-size: 12px; }
}


/* Mise en forme des définitions Gaffiot issues du JSON */
.gaffiot-definition { line-height: 1.75; overflow-wrap: anywhere; }
.gaffiot-definition .g-section { display: inline-block; margin: 0.7rem 0 0.25rem; color: var(--ink); }
.gaffiot-definition .g-number, .gaffiot-definition .g-subsection { color: var(--muted); }
.gaffiot-definition .g-example { font-style: italic; }
.gaffiot-definition .g-author, .gaffiot-definition .g-reference { color: var(--muted); font-size: .92em; }
.gaffiot-definition .g-comment { color: var(--muted); }
.gaffiot-definition .g-final-continuation { margin-top: .75em; }
.gaffiot-definition .g-crossref { text-decoration: underline; text-decoration-style: dotted; }
.gaffiot-definition .g-image-sense { margin: 1rem auto 1.25rem; text-align: center; }
.gaffiot-definition .g-illustration { display: block; max-width: min(100%, 520px); max-height: 420px; width: auto; height: auto; object-fit: contain; margin: 0 auto .35rem; }
.gaffiot-definition .g-image-sense figcaption { color: var(--muted); font: 500 11px/1.4 system-ui, sans-serif; }
