/* Application « Villiers-en-Lieu – Actualités » */
@font-face { font-family: "Bitter"; font-weight: 800; font-display: swap; src: url("/fonts/bitter-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-display: swap; src: url("/fonts/source-sans-3-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 600; font-display: swap; src: url("/fonts/source-sans-3-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 700; font-display: swap; src: url("/fonts/source-sans-3-latin-700-normal.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --fond: #f4f4ee; --surface: #ffffff; --texte: #1e2420; --doux: #59605a; --ligne: #dfe2d6;
  --bordeaux: #9b3835; --olive: #a5a928; --ocre: #e8a813; --lien: #9b3835;
  --titre: "Bitter", "Roboto Slab", Georgia, serif;
  --police: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --fond: #121613; --surface: #1d231e; --texte: #eceee5; --doux: #a8b0a5; --ligne: #303830;
  --bordeaux: #e58d87; --olive: #c7cc4f; --ocre: #f3bd3d; --lien: #f0a49f;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--fond); color: var(--texte);
  font: 400 17px/1.55 var(--police); -webkit-tap-highlight-color: transparent;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
img { max-width: 100%; height: auto; }
a { color: var(--lien); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--ocre); outline-offset: 2px; border-radius: 4px; }

/* Barre du haut */
.barre {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 4px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px; background: #9b3835; color: #fff;
}
.barre__logo { display: flex; align-items: center; gap: 10px; margin-right: auto; color: #fff; text-decoration: none; min-width: 0; }
.barre__logo img { height: 30px; width: auto; flex: none; }
.barre__logo span { font: 800 1.2rem/1 var(--titre); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barre__btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; flex: none; }
.barre__btn:active { background: rgba(255,255,255,.15); }
.barre__btn svg { width: 24px; height: 24px; }
#theme .ic-soleil { display: none; }
:root[data-theme="dark"] #theme .ic-soleil { display: block; }
:root[data-theme="dark"] #theme .ic-lune { display: none; }
.barre__btn.tourne svg { animation: tourne .8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
.tri { display: flex; height: 4px; }
.tri span { flex: 1; } .tri span:nth-child(1) { background: #a5a928; } .tri span:nth-child(2) { background: #6f2826; } .tri span:nth-child(3) { background: #e8a813; }

/* Bandeaux */
.bandeau { display: flex; align-items: center; gap: 10px; margin: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--ligne); border-left: 5px solid var(--ocre); border-radius: 12px; }
.bandeau p { margin: 0; flex: 1; font-size: .95rem; line-height: 1.4; }
.bandeau__x { border: 0; background: none; color: var(--doux); font-size: 1.6rem; line-height: 1; width: 36px; height: 36px; cursor: pointer; }
.hors-ligne { margin: 12px; padding: 10px 14px; border-radius: 10px; background: #fff3d1; color: #5c4400; font-size: .95rem; }
:root[data-theme="dark"] .hors-ligne { background: #3b3112; color: #f3dc98; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: #9b3835; color: #fff; font: 700 1rem var(--police); text-decoration: none; cursor: pointer; }
.btn--contour { background: transparent; color: var(--texte); border: 2px solid var(--ligne); }
.btn svg { width: 18px; height: 18px; }

main { max-width: 760px; margin: 0 auto; padding: 4px 12px 32px; outline: none; }

/* Catégories */
.puces { display: flex; gap: 8px; overflow-x: auto; padding: 12px 2px 8px; margin: 0 -12px; padding-left: 12px; padding-right: 12px; scrollbar-width: none; }
.puces::-webkit-scrollbar { display: none; }
.puce { flex: none; min-height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--ligne); background: var(--surface); color: var(--texte); font: 600 .95rem var(--police); cursor: pointer; }
.puce[aria-pressed="true"] { background: var(--texte); color: var(--fond); border-color: var(--texte); }

/* Liste */
.liste { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.carte { display: grid; grid-template-columns: 112px 1fr; min-height: 104px; background: var(--surface); border-radius: 14px; overflow: hidden; color: inherit; text-decoration: none; border: 1px solid var(--ligne); }
.carte:active { transform: scale(.99); }
.carte__img { position: relative; background: var(--ligne); border-right: 4px solid var(--c, var(--olive)); }
.carte__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.carte__corps { padding: 10px 12px; min-width: 0; }
.carte__meta { display: block; font-size: .8rem; font-weight: 700; color: var(--doux); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.carte h2 { margin: 0 0 4px; font: 800 1.05rem/1.25 var(--titre); }
.carte p { margin: 0; color: var(--doux); font-size: .95rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.liste li:nth-child(3n+2) .carte { --c: #9b3835; } .liste li:nth-child(3n) .carte { --c: var(--ocre); }
/* La plus récente en grand */
.liste li:first-child .carte { grid-template-columns: 1fr; }
.liste li:first-child .carte__img { aspect-ratio: 16/10; border-right: 0; border-bottom: 5px solid var(--olive); }
.liste li:first-child .carte__corps { padding: 14px 16px 16px; }
.liste li:first-child h2 { font-size: 1.4rem; }
.liste li:first-child p { -webkit-line-clamp: 3; font-size: 1rem; }
.plus { display: flex; justify-content: center; margin-top: 18px; }
.vide { text-align: center; color: var(--doux); padding: 40px 16px; }

/* Article */
.article { background: var(--surface); border-radius: 16px; overflow: hidden; margin-top: 12px; border: 1px solid var(--ligne); }
.article__img img { display: block; width: 100%; max-height: 52vh; object-fit: cover; }
.article__corps { padding: 18px 18px 22px; }
.article__meta { font-size: .85rem; font-weight: 700; color: var(--doux); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 6px; }
.article h1 { font: 800 1.6rem/1.2 var(--titre); margin: 0 0 14px; }
.article__texte { overflow-wrap: break-word; }
.article__texte img { border-radius: 10px; display: block; margin: 12px auto; height: auto !important; }
.article__texte table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.article__texte td, .article__texte th { padding: 6px 8px; border: 1px solid var(--ligne); }
.article__texte h1, .article__texte h2, .article__texte h3 { font-family: var(--titre); line-height: 1.25; }
.article__texte .externe { display: block; padding: 12px 14px; border: 1px dashed var(--ligne); border-radius: 10px; }
.mots { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 0; padding: 0; list-style: none; }
.mots li { padding: 4px 12px; border-radius: 999px; background: var(--fond); font-size: .9rem; font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* Chargement */
.chargement { display: flex; justify-content: center; gap: 8px; padding: 60px 0; }
.chargement span { width: 12px; height: 12px; border-radius: 50%; background: var(--olive); animation: saut 1s infinite ease-in-out; }
.chargement span:nth-child(2) { background: #9b3835; animation-delay: .15s; } .chargement span:nth-child(3) { background: var(--ocre); animation-delay: .3s; }
@keyframes saut { 0%, 80%, 100% { transform: scale(.6); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (min-width: 700px) { .carte { grid-template-columns: 180px 1fr; min-height: 130px; } .carte h2 { font-size: 1.15rem; } }

/* Notifications */
#cloche .ic-cloche-on { display: none; }
#cloche[aria-pressed="true"] .ic-cloche-on { display: block; }
#cloche[aria-pressed="true"] .ic-cloche { display: none; }
.bandeau--notif { border-left-color: #a5a928; }
.carte--sans-image { grid-template-columns: 6px 1fr; min-height: 0; }
.carte--sans-image .carte__img { border-right-width: 6px; background: none; }
.liste li:first-child .carte--sans-image { grid-template-columns: 1fr; }
.liste li:first-child .carte--sans-image .carte__img { display: none; }
.liste li:first-child .carte--sans-image .carte__corps { border-top: 5px solid var(--olive); }
@media (max-width: 420px) { .barre__logo span { display: none; } }
