/* ==========================================================================
   Littérature.ca — habillage commun : barre supérieure, en-tête, menus et pied de page.
   Chargé par le site ET par le module PRO.
   Charte « Érable & Encre » : blanc neige · bleu marine · rouge érable
   ========================================================================== */
:root {
  --paper: #FFFFFF; --ivoire: #F6F7F9; --ivoire-2: #E9EDF2; --ivoire-3: #D9DEE5;
  --or: #C8211B; --or-2: #A91A15; --or-light: #FF9A8F; --terre: #A91A15; --vert: #22344A; --vert-2: #2C4560;
  --encre: #16222F; --encre-2: #1E2B3A; --encre-3: #2A3A4E; --gris: #5B6776; --gris-2: #6F7A88; --rule: #D9DEE5;
  --brun: #16222F; --brun-2: #22344A; --brun-3: #3A4A5E; --brun-dark: #101A24;
  --rouge: #C8211B; --marine: #16222F; --marine-2: #22344A;
  --font-display: 'Cormorant Garamond', 'Times New Roman', Georgia, serif;
  --font-body: Inter, 'Helvetica Neue', Arial, sans-serif;
  --font-ui: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --radius: 2px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ivoire); }

/* ---------- remise à zéro limitée à l'habillage ---------- */
.topbar, .masthead, .footer { font: 400 16px/1.55 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(--rouge); outline-offset: 2px; }
.footer :focus-visible, .topbar :focus-visible { outline-color: var(--or-light); }
.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); }

/* ---------- cadre de contenu ---------- */
.site-w { width: 100%; max-width: 1264px; margin-inline: auto; padding-inline: clamp(18px, 4vw, 32px); }
.site { width: 100%; background: var(--ivoire); }

/* ---------- barre supérieure ---------- */
.topbar { background: var(--marine); color: #C9D2DD; font-size: .8125rem; }
.topbar-in { display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: 40px; }
.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 #3A4A5E; color: #fff !important; }
.topbar-memo span { color: var(--or-light); text-transform: uppercase; letter-spacing: .1em; font-size: .6875rem; font-weight: 600; margin-right: 6px; }
.topbar-links { display: flex; gap: 22px; flex-shrink: 0; }
.topbar a:hover { color: var(--or-light); }

/* ---------- en-tête : logo, actions, menu ---------- */
.masthead { position: relative; z-index: 20; background: #fff; border-bottom: 1px solid var(--rule); color: var(--encre); }
.masthead-brand { display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; padding-block: 20px; }
.masthead .brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.masthead .brand-logo { width: 56px; height: 56px; object-fit: contain; flex-shrink: 0; }
.masthead .brand-custom { width: auto; height: 56px; }
.brand-word { font: 600 1.625rem/1 var(--font-ui); letter-spacing: .04em; color: var(--marine-2); white-space: nowrap; }
.brand-word b { font-weight: 600; color: var(--rouge); }
.masthead-actions { display: flex; align-items: center; gap: 12px; }
.masthead .btn-search { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; background: #fff; border: 1px solid #C3CAD4; border-radius: var(--radius); font-size: .875rem; font-weight: 500; color: var(--encre); cursor: pointer; }
.masthead .btn-search:hover { border-color: var(--encre); }
.masthead .btn-sub { display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; background: var(--rouge); color: #fff; border-radius: var(--radius); font-size: .875rem; font-weight: 600; white-space: nowrap; }
.masthead .btn-sub:hover { background: var(--or-2); color: #fff; }
.masthead .icon-btn { width: 44px; min-height: 44px; display: none; place-items: center; background: none; border: 1px solid #C3CAD4; border-radius: var(--radius); cursor: pointer; color: inherit; flex-shrink: 0; padding: 0; }
.masthead .nav-toggle { gap: 5px; align-content: center; }
.masthead .nav-toggle span { display: block; width: 20px; height: 2px; background: currentColor; }
.masthead .searchbar { background: var(--ivoire); border-top: 1px solid var(--rule); margin: 0; }
.masthead .searchbar[hidden] { display: none; }
.masthead .searchbar-in { display: flex; gap: 10px; padding-block: 14px; }
.masthead .searchbar input { flex: 1; min-width: 0; height: 52px; padding: 0 16px; border: 1.5px solid var(--encre); border-radius: var(--radius); background: #fff; color: var(--encre); }
.masthead .searchbar button { background: var(--encre); color: #fff; border: 0; border-radius: var(--radius); padding: 0 1.6em; font-weight: 600; font-size: .9375rem; cursor: pointer; }
.masthead-bars { border-top: 1px solid #E6E9EE; }
.masthead .nav { flex: 1; min-width: 0; }
.masthead .nav-list { display: flex; flex-wrap: wrap; gap: 0 30px; }
.masthead .nav-list > li { position: relative; }
.masthead .nav-list > li > a { display: block; padding: 16px 0; font: 500 .875rem/1.5 var(--font-ui); letter-spacing: .02em; color: var(--encre); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.masthead .nav-list > li > a:hover, .masthead .nav-list > li:focus-within > a { color: var(--rouge); }
.masthead .nav-list > li > a[aria-current] { color: var(--rouge); font-weight: 600; border-bottom-color: var(--rouge); }
.masthead .has-sub > a::after { content: ''; display: inline-block; width: 5px; height: 5px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translateY(-3px); margin-left: 8px; opacity: .7; }
.masthead .sub-toggle { display: none; }
.masthead .sub { position: absolute; top: 100%; left: -20px; min-width: 280px; background: #fff; color: var(--encre-2); border: 1px solid var(--rule); border-top: 2px solid var(--rouge); box-shadow: 0 18px 40px rgba(22, 34, 47, .14); 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: -20px; }
.masthead .sub a { display: block; padding: 8px 20px; font-size: .9rem; }
.masthead .sub a:hover { background: var(--ivoire); color: var(--rouge); }
.masthead .sub ul a { padding-left: 36px; color: var(--gris); font-size: .86rem; }

/* ---------- pied de page ---------- */
.footer { background: var(--marine); color: #C9D2DD; font-size: .875rem; }
.footer .wrap { max-width: 1264px; margin-inline: auto; padding-inline: clamp(18px, 4vw, 32px); }
.footer .footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: clamp(28px, 4vw, 56px); padding-block: clamp(40px, 6vw, 64px) clamp(32px, 4vw, 48px); }
.footer h2 { font: 600 .75rem/1.2 var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: #fff; margin: 0 0 16px; }
.footer h2.mt { margin-top: 28px; }
.footer .footer-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.footer .footer-logo img { width: 44px; height: 44px; object-fit: contain; }
.footer .brand-word { font-size: 1.25rem; color: #fff; }
.footer .brand-word b { color: var(--or-light); }
.footer a:hover { color: var(--or-light); }
.footer nav ul { display: grid; gap: 9px; }
.footer .footer-cats li { display: flex; justify-content: space-between; gap: 12px; }
.footer .footer-cats span { color: #A9B4C2; 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%; height: 46px; padding: 0 .85em; border: 1px solid #3A4A5E; border-radius: var(--radius); background: #1E2B3A; color: #fff; }
.footer .newsletter input::placeholder { color: #A9B4C2; }
.footer .newsletter button { background: var(--rouge); 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: #EEF2F7; margin: 0 0 18px; font-size: .92rem; color: var(--encre); }
.footer .notice-err { border-color: var(--terre); background: #FBECEB; }
.footer .footer-base { border-top: 1px solid #3A4A5E; padding-block: 20px; font-size: .8125rem; color: #C9D2DD; }
.footer .footer-base .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 24px; }
.footer .footer-base p { margin: 0; }

/* ---------- adaptatif ---------- */
@media (max-width: 1080px) { .footer .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) {
  .topbar-memo, .topbar-links li:nth-child(n+3) { display: none; }
  .masthead .btn-sub { display: none; }
  .masthead .btn-search { padding: 0 12px; font-size: 0; gap: 0; }
  .masthead .icon-btn.nav-toggle { display: grid; }
  .brand-word { font-size: 1.25rem; }
  .masthead .brand-logo { width: 44px; height: 44px; }
  .masthead-brand { padding-block: 14px; }
  .masthead .nav { display: none; max-height: calc(100vh - 160px); overflow-y: auto; }
  .masthead .nav.is-open { display: block; }
  .masthead .nav-list { display: block; padding: 4px 0 10px; }
  .masthead .nav-list > li { border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 1fr 48px; }
  .masthead .nav-list > li > a { padding: 14px 0; border: 0; margin: 0; }
  .masthead .has-sub > a::after { display: none; }
  .masthead .sub-toggle { display: block; background: none; border: 0; cursor: pointer; position: relative; min-height: 44px; }
  .masthead .sub-toggle::before { content: '+'; font: 400 1.5rem var(--font-display); color: var(--rouge); }
  .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; min-width: 0; }
  .masthead .sub.is-open { display: block; }
  .masthead .sub a { padding: 9px 14px; }
}
@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; } .topbar, .masthead, .footer, .skip { display: none !important; } }
