/*
 * Announcement window and maintenance banner (chantier
 * canal-news-notifications, phase 2), opened by notices.js on every page.
 * The window is a 600 px card on a dark veil on desktop and a sheet rising
 * from the bottom on phones, where the tab bar hides while it is open.
 * Tokens of Docs/identite-visuelle; dark mode follows body.darkClass.
 */
:root {
    --cwm-card: #FFFFFF;
    --cwm-strong: #15171A;
    --cwm-text: #495057;
    --cwm-muted: #ADB6BD;
    --cwm-sep: #E9ECEF;
    --cwm-blue: #4672D6;
    --cwm-blue-border: #2D4B91;
    --cwm-hero: #4672D6;
    --cwm-raised: #F1F3F5;
}
body.darkClass {
    --cwm-card: #343A40;
    --cwm-strong: #FFFFFF;
    --cwm-text: #B0BEC5;
    --cwm-muted: #77838F;
    --cwm-sep: #21252A;
    --cwm-hero: #495057;
    --cwm-raised: #495057;
}

/* Veil and card */
.cwm-overlay { position: fixed; inset: 0; z-index: 100000; background: rgba(21,23,26,.6); display: flex; align-items: center; justify-content: center; padding: 20px; animation: cwm-fade .2s ease-out; }
@keyframes cwm-fade { from { opacity: 0; } to { opacity: 1; } }
.cwm { position: relative; width: 600px; max-width: 100%; max-height: calc(100vh - 40px); overflow: auto; background: var(--cwm-card); border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.35); animation: cwm-up .25s ease-out; text-align: left; }
@keyframes cwm-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.cwm-close { position: absolute; top: 10px; right: 10px; z-index: 2; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(21,23,26,.45); color: #FFFFFF; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cwm-close:hover { background: rgba(21,23,26,.7); }
.cwm-img { background: var(--cwm-hero); aspect-ratio: 1200 / 630; overflow: hidden; }
.cwm-img img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: left top; }
.cwm-body { padding: 24px 28px 26px; }
.cwm-pill { display: inline-block; background: var(--cwm-blue); color: #FFFFFF; font-size: 10px; font-weight: 900; letter-spacing: 1.4px; text-transform: uppercase; border-radius: 4px; padding: 5px 9px; margin-bottom: 12px; }
body.darkClass .cwm-pill { background: #495057; }
.cwm-pill i { margin-right: 5px; }
.cwm h2 { margin: 0 0 10px; font-size: 24px; line-height: 1.2; font-weight: 900; color: var(--cwm-strong); text-transform: none; letter-spacing: 0; float: none; }
.cwm p { margin: 0 0 14px; font-size: 15px; line-height: 1.55; color: var(--cwm-text); }
.cwm ul { margin: 0 0 18px; padding: 0; list-style: none; }
.cwm li { position: relative; padding: 4px 0 4px 28px; font-size: 14px; line-height: 1.5; color: var(--cwm-text); list-style: none; }
.cwm li i { position: absolute; left: 0; top: 7px; width: 18px; text-align: center; font-size: 14px; color: var(--cwm-blue); }
body.darkClass .cwm li i { color: #FFFFFF; }
.cwm-actions { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.cwm-btn, body.lightClass .cwm-btn, body.darkClass .cwm-btn { display: inline-block; background: var(--cwm-blue); color: #FFFFFF !important; font-size: 13px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; padding: 12px 22px; border-radius: 6px; border: 0; border-bottom: 3px solid var(--cwm-blue-border); text-decoration: none; cursor: pointer; line-height: 1.2; }
.cwm-btn:hover { background: #3256A0; }
.cwm-later { background: none; border: 0; padding: 8px 4px; font-size: 12px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--cwm-text); cursor: pointer; }
.cwm-later:hover { color: var(--cwm-strong); }
.cwm-count { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--cwm-muted); letter-spacing: .5px; }
.cwm-date { display: block; margin-top: 16px; font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--cwm-muted); }

/* Sheet on phones; the tab bar leaves while it is open */
@media (max-width: 767px) {
    .cwm-overlay { align-items: flex-end; padding: 0; }
    .cwm { width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; animation: cwm-sheet .3s ease-out; }
    @keyframes cwm-sheet { from { transform: translateY(40%); } to { transform: none; } }
    .cwm-img { aspect-ratio: auto; height: 170px; }
    .cwm-body { padding: 20px 20px 28px; }
    .cwm h2 { font-size: 21px; }
    .cwm-actions { flex-wrap: wrap; }
    .cwm-btn { flex: 1 0 100%; text-align: center; }
    .cwm-later { order: 2; }
    .cwm-count { order: 3; }
    body.cwm-open .footer-mob-nav { display: none !important; }
    body.cwm-open { overflow: hidden; }
}

/* Maintenance banner: under the header, above everything else */
.cwm-banner { position: fixed; top: 70px; left: 0; right: 0; z-index: 99990; display: flex; align-items: center; gap: 14px; padding: 12px 20px; background: #343A40; color: #FFFFFF; font-size: 13.5px; line-height: 1.4; box-shadow: 0 4px 14px rgba(0,0,0,.2); animation: cwm-fade .2s ease-out; }
.cwm-banner .cwm-banner-ico { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; background: #F0A92E; color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.cwm-banner .cwm-banner-txt { flex: 1; min-width: 0; }
.cwm-banner strong { color: #FFFFFF; font-weight: 900; margin-right: 6px; }
.cwm-banner span { color: #DEE2E6; }
.cwm-banner a.cwm-banner-link, body.darkClass .cwm-banner a.cwm-banner-link { flex: 0 0 auto; font-size: 11px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; color: #FFFFFF !important; text-decoration: none; padding: 8px 12px; border-radius: 5px; background: #21252A; border-bottom: 3px solid #000000; }
.cwm-banner .cwm-banner-close { flex: 0 0 auto; background: none; border: 0; color: #ADB6BD; font-size: 16px; cursor: pointer; padding: 4px; line-height: 1; }
.cwm-banner .cwm-banner-close:hover { color: #FFFFFF; }
@media (max-width: 980px) {
    .cwm-banner { top: auto; bottom: 62px; padding: 12px 40px 12px 14px; gap: 10px; font-size: 13px; flex-wrap: wrap; }
    .cwm-banner .cwm-banner-txt { flex: 1 1 200px; }
    .cwm-banner .cwm-banner-link { order: 3; margin-left: 44px; }
    .cwm-banner .cwm-banner-close { position: absolute; top: 8px; right: 8px; }
}
