/* ==========================================================================
   Littérature.ci — habillage commun : fond, barre supérieure, bandeau des écrivains,
   menus et pied de page. Chargé par le site ET par le module PRO.
   Toutes les règles sont limitées à l'habillage : rien ne déborde sur les contenus.
   ========================================================================== */
:root {
  --paper: #FCF9F3; --ivoire: #F7F0E3; --ivoire-2: #EDE3D0; --ivoire-3: #E0D3BC;
  --or: #B8760A; --or-2: #D4920E; --or-light: #F0C060; --terre: #9B3E1E; --vert: #1A4A2E; --vert-2: #245E3A;
  --encre: #0E0C08; --encre-2: #1A1712; --encre-3: #2A2520; --gris: #6B6358; --gris-2: #9A9088; --rule: #E4DAC8;
  --brun: #2E1508; --brun-2: #4A2A18; --brun-3: #6B4A36; --brun-dark: #241006;
  --font-display: 'Cormorant Garamond', 'Times New Roman', Georgia, serif;
  --font-body: 'Libre Baskerville', Georgia, serif;
  --font-ui: 'DM Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 4px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #1B1A18 center top / cover no-repeat fixed; }

/* ---------- remise à zéro limitée à l'habillage ---------- */
.topbar, .masthead, .footer { font: 400 16px/1.6 var(--font-ui); -webkit-font-smoothing: antialiased; }
.topbar ul, .masthead ul, .footer ul { margin: 0; padding: 0; list-style: none; }
.topbar a, .masthead a, .footer a { color: inherit; text-decoration: none; }
.topbar p, .footer p { margin: 0 0 1em; }
.masthead img, .footer img { display: block; max-width: 100%; height: auto; }
.masthead button, .masthead input, .footer button, .footer input { font: inherit; }
.masthead :focus-visible, .footer :focus-visible, .topbar :focus-visible { outline: 2px solid var(--or-2); outline-offset: 2px; }
.masthead .sr, .footer .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.footer .hp { position: absolute; left: -9999px; }
.skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 100; background: var(--encre); color: #fff; padding: 10px 16px; font: 600 14px var(--font-ui); }
.flag { height: 4px; background: linear-gradient(90deg, #F77F00 0 33.33%, #fff 33.33% 66.66%, #009E60 66.66%); }

/* ---------- cadre de contenu ---------- */
.site-w, .site { width: 100%; max-width: 1180px; margin-inline: auto; }
.site { background: var(--paper); box-shadow: 0 0 60px rgba(0, 0, 0, .55); }

/* ---------- barre supérieure ---------- */
.topbar { background: var(--encre); color: #CFC6B6; font-size: .78rem; }
.topbar-in { display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: 36px; padding-inline: 16px; }
.topbar .topbar-date { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-memo { margin-left: 14px; padding-left: 14px; border-left: 1px solid #3a342c; color: #fff !important; }
.topbar-memo span { color: var(--or-light); text-transform: uppercase; letter-spacing: .1em; font-size: .68rem; margin-right: 6px; }
.topbar-links { display: flex; gap: 18px; flex-shrink: 0; }
.topbar a:hover { color: var(--or-light); }

/* ---------- bandeau des écrivains, logo, menus ---------- */
.masthead { position: relative; z-index: 20; }
.masthead-hero { display: flex; flex-direction: column; justify-content: space-between; min-height: clamp(250px, 21vw, 400px); background-color: var(--brun); background-size: cover; background-position: center 28%; background-repeat: no-repeat; }
.masthead-brand { padding: clamp(14px, 2vw, 30px) 20px 10px; }
.masthead .brand { display: inline-block; }
.masthead .brand-logo { width: clamp(84px, 9vw, 130px); height: auto; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .55)); transition: transform .25s; }
.masthead .brand:hover .brand-logo { transform: scale(1.04); }
.masthead-bars { background: var(--brun); color: #F3E9DA; box-shadow: 0 -8px 30px rgba(0, 0, 0, .35); }
.masthead .navbar { display: flex; align-items: stretch; }
.masthead .icon-btn { width: 46px; min-height: 46px; display: grid; place-items: center; background: none; border: 0; cursor: pointer; color: inherit; flex-shrink: 0; padding: 0; }
.masthead .icon-btn:hover { background: var(--brun-2); color: var(--or-light); }
.masthead .nav-toggle { display: none; gap: 5px; align-content: center; }
.masthead .nav-toggle span { display: block; width: 20px; height: 2px; background: currentColor; }
.masthead .nav { flex: 1; min-width: 0; }
.masthead .nav-list { display: flex; flex-wrap: wrap; }
.masthead .nav-list > li { position: relative; }
.masthead .nav-list > li > a { display: block; padding: 17px 13px; font: 700 .78rem/1.6 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: #F3E9DA; }
.masthead .nav-list > li > a:hover, .masthead .nav-list > li:focus-within > a { background: var(--brun-2); color: #fff; }
.masthead .nav-list > li > a[aria-current] { background: var(--brun-3); color: #fff; }
.masthead .has-sub > a::after { content: ''; display: inline-block; width: 5px; height: 5px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-3px); margin-left: 7px; opacity: .8; }
.masthead .sub-toggle { display: none; }
.masthead .sub { position: absolute; top: 100%; left: 0; min-width: 270px; background: #fff; color: var(--encre-2); border-top: 3px solid var(--or); box-shadow: 0 14px 30px rgba(14, 12, 8, .25); padding: 10px 0; opacity: 0; visibility: hidden; transform: translateY(6px); transition: .16s; z-index: 30; }
.masthead .nav-list > li:hover > .sub, .masthead .nav-list > li:focus-within > .sub { opacity: 1; visibility: visible; transform: none; }
.masthead .nav-list > li:nth-last-child(-n+3) > .sub { left: auto; right: 0; }
.masthead .sub a { display: block; padding: 7px 20px; font-size: .9rem; }
.masthead .sub a:hover { background: var(--ivoire); color: var(--encre); }
.masthead .sub ul a { padding-left: 36px; color: var(--gris); font-size: .86rem; }
.masthead .searchbar { display: flex; gap: 10px; padding: 12px 16px; background: var(--brun-2); margin: 0; }
.masthead .searchbar[hidden] { display: none; }
.masthead .searchbar input { flex: 1; min-width: 0; width: auto; padding: .7em 1em; border: 1px solid var(--ivoire-3); border-radius: var(--radius); background: #fff; color: var(--encre); }
.masthead .searchbar button { background: var(--or); color: #fff; border: 0; border-radius: var(--radius); padding: 0 1.4em; font-weight: 600; font-size: .85rem; cursor: pointer; }
.subbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 26px; padding: 11px 16px; background: var(--brun-dark); font-size: .8rem; color: #CDBFAE; }
.subbar ul { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.subbar-social { padding-right: 26px; border-right: 1px solid rgba(255, 255, 255, .15); }
.subbar a:hover { color: #fff; }
.subbar a[aria-current] { color: var(--or-light); }

/* ---------- pied de page ---------- */
.footer { background: var(--encre); color: #B9B0A0; font-size: .9rem; }
.footer .wrap { max-width: 1280px; margin-inline: auto; padding-inline: clamp(18px, 4vw, 40px); }
.footer .footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: clamp(28px, 4vw, 56px); padding-block: clamp(40px, 6vw, 72px); }
.footer h2 { font: 600 .72rem/1.2 var(--font-ui); letter-spacing: .16em; text-transform: uppercase; color: var(--or-light); margin: 0 0 16px; }
.footer h2.mt { margin-top: 28px; }
.footer .brand-name { display: block; font: 600 2.2rem/1 var(--font-display); letter-spacing: -.01em; color: #fff; }
.footer .brand-name i { color: var(--or-light); font-style: italic; font-weight: 500; }
.footer .footer-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.footer .footer-logo img { width: 72px; height: 72px; }
.footer a:hover { color: var(--or-light); }
.footer nav ul { display: grid; gap: 8px; }
.footer .footer-cats li { display: flex; justify-content: space-between; gap: 12px; }
.footer .footer-cats span { color: #6f675b; font-size: .78rem; }
.footer .footer-social { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 18px; color: #fff; }
.footer .newsletter { display: flex; gap: 8px; margin-top: 14px; }
.footer .newsletter input { width: 100%; padding: .65em .85em; border: 1px solid #3a342c; border-radius: var(--radius); background: #1f1b15; color: #fff; }
.footer .newsletter button { background: var(--or); border: 0; color: #fff; font-weight: 600; padding: 0 1.1em; border-radius: var(--radius); cursor: pointer; white-space: nowrap; }
.footer .newsletter button:hover { background: var(--or-2); }
.footer .notice { padding: 12px 16px; border-left: 3px solid var(--vert-2); background: #EEF4EE; margin: 0 0 18px; font-size: .92rem; color: var(--encre); }
.footer .notice-err { border-color: var(--terre); background: #F9ECE6; }
.footer .footer-base { border-top: 1px solid #2a2520; padding-block: 18px; font-size: .78rem; color: #8a8173; }
.footer .footer-base .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 24px; }
.footer .footer-base p { margin: 0; }

/* ---------- adaptatif ---------- */
@media (min-width: 1000px) { .site-w, .site { width: 92%; } }
@media (min-width: 1300px) { .site-w, .site { width: 80%; } }
@media (max-width: 999px) { body { background-image: none !important; } }
@media (max-width: 1080px) { .footer .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) {
  .topbar-memo, .topbar-links li:not(:last-child) { display: none; }
  .masthead .nav-toggle { display: grid; }
  .masthead-hero { min-height: 0; }
  .masthead-brand { min-height: 130px; padding: 14px 16px; }
  .masthead .navbar { justify-content: space-between; flex-wrap: wrap; }
  .masthead .nav { display: none; order: 3; flex: 0 0 100%; max-height: calc(100vh - 220px); overflow-y: auto; border-top: 1px solid rgba(255, 255, 255, .12); }
  .masthead .nav.is-open { display: block; }
  .masthead .nav-list { display: block; padding: 4px 16px 10px; }
  .masthead .nav-list > li { border-bottom: 1px solid rgba(255, 255, 255, .1); display: grid; grid-template-columns: 1fr 48px; }
  .masthead .nav-list > li > a { padding: 14px 0; }
  .masthead .nav-list > li > a:hover, .masthead .nav-list > li > a[aria-current], .masthead .nav-list > li:focus-within > a { background: none; color: var(--or-light); }
  .masthead .has-sub > a::after { display: none; }
  .masthead .sub-toggle { display: block; background: none; border: 0; cursor: pointer; position: relative; }
  .masthead .sub-toggle::before { content: '+'; font: 400 1.5rem var(--font-display); color: var(--or-light); }
  .masthead .sub-toggle[aria-expanded=true]::before { content: '–'; }
  .masthead .sub { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; grid-column: 1 / -1; display: none; padding: 0 0 12px; background: none; color: #E6D9C8; min-width: 0; }
  .masthead .sub.is-open { display: block; }
  .masthead .sub a { padding: 8px 14px; }
  .masthead .sub a:hover { background: none; color: #fff; }
  .masthead .sub ul a { color: #B9A994; }
  .subbar-social { display: none; }
  .subbar { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; }
  .subbar ul { flex-wrap: nowrap; }
}
@media (max-width: 620px) { .footer .footer-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .masthead *, .footer * { transition: none !important; } }
@media print { body { background: #fff !important; } .site { box-shadow: none; width: auto; max-width: none; } .topbar, .masthead, .footer, .flag, .skip { display: none !important; } }
