/* ==========================================================================
   L'édition du matin (matin.html) : la une, le lecteur, le mot du jour, la semaine.
   Sable et lin, une grande photo, des lignes nettes ; les animations se coupent
   avec prefers-reduced-motion.
   ========================================================================== */
.mt { max-width: 680px; margin: 0 auto; padding: 28px max(18px, env(safe-area-inset-left, 0px)) 40px max(18px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 20px; }
.mt > * { animation: mt-monte .7s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--n, 0) * 60ms); }
@keyframes mt-monte { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.mt-haut { display: flex; justify-content: space-between; align-items: center; }
.mt-date { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--t3); }
.mt-bonjour { font-size: clamp(38px, 6vw, 52px); }
.mt-titre-bloc { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 8px; }
.mt-titre-bloc h2 { font-size: 24px; }
.mt-eti { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--t3); }
.mt-or { color: var(--or); }
.mt-mention { font-size: 12.5px; color: var(--t3); line-height: 1.55; }

/* la une */
.mt-une { display: block; width: 100%; text-align: left; border: 0; padding: 0; cursor: pointer; background: var(--bg-card); border-radius: 22px; overflow: hidden; box-shadow: 0 1px 0 var(--b2), 0 30px 60px -48px rgba(29, 27, 24, .5); color: inherit; font: inherit; }
.mt-une:active { transform: scale(.99); }
.mt-une.mt-attente { height: 380px; background: linear-gradient(100deg, var(--bg-card) 30%, var(--bg-deep) 50%, var(--bg-card) 70%) 0 0 / 300% 100%; animation: mt-reflet 1.4s linear infinite; }
@keyframes mt-reflet { to { background-position: -100% 0; } }
.mt-une-photo { position: relative; height: clamp(200px, 34vw, 280px); overflow: hidden; }
.mt-une-photo img { position: absolute; inset: -14% 0; width: 100%; height: 128%; object-fit: cover; transform: translateY(calc(var(--par, 0) * 1px)); }
.mt-pastille { position: absolute; left: 14px; top: 14px; z-index: 1; background: rgba(255, 255, 255, .93); color: var(--t0); border-radius: 999px; padding: 5px 11px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.mt-une-corps { padding: 18px 20px 20px; display: grid; gap: 10px; }
.mt-une-corps h2 { font-size: clamp(27px, 4vw, 32px); }
.mt-une-meta { display: flex; justify-content: space-between; align-items: center; color: var(--t3); font-size: 14px; }
.mt-lire { background: var(--t0); color: var(--bg); border-radius: 999px; padding: 9px 18px; font-size: 14px; font-weight: 500; }
.mt-une.lu .mt-lire { background: var(--juste-fond); color: var(--juste); }

/* lignes façon relevé */
.mt-carte { background: var(--bg-card); border-radius: 20px; box-shadow: 0 1px 0 var(--b2); padding: 4px 16px; }
.mt-ligne { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 13px 0; border-top: 1px solid var(--b2); width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-bottom: 0; color: inherit; font: inherit; text-decoration: none; cursor: pointer; }
.mt-carte > .mt-ligne:first-child { border-top: 0; }
.mt-rond { width: 40px; height: 40px; border-radius: 50%; background: var(--bg-deep); display: grid; place-items: center; font-family: var(--display); font-size: 19px; color: var(--t0); }
.mt-ligne b { display: block; font-weight: 500; font-size: 15px; line-height: 1.3; }
.mt-ligne small { display: block; font-size: 13px; color: var(--t3); }
.mt-val { font-variant-numeric: tabular-nums; font-weight: 500; font-size: 15px; text-align: right; }
.mt-val.hausse { color: var(--bull-text); }
.mt-val.baisse { color: var(--bear-text); }
.mt-fleche { color: var(--t3); font-size: 20px; }

/* la semaine (archives) */
.mt-semaine { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -18px; padding: 2px 18px 8px; scrollbar-width: none; }
.mt-semaine::-webkit-scrollbar { display: none; }
.mt-semaine button { flex: 0 0 min(72%, 260px); scroll-snap-align: start; text-align: left; border: 0; padding: 0; border-radius: 20px; overflow: hidden; background: var(--bg-card); box-shadow: 0 1px 0 var(--b2); cursor: pointer; color: inherit; font: inherit; }
.mt-semaine .img { height: 118px; background-size: cover; background-position: center 60%; position: relative; }
.mt-cadenas { position: absolute; right: 10px; top: 10px; width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 255, 255, .93); display: grid; place-items: center; }
.mt-semaine .txt { padding: 10px 14px 14px; display: grid; gap: 3px; }
.mt-semaine .txt span { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--t3); }
.mt-semaine .txt b { font-family: var(--display); font-weight: 500; font-size: 19px; line-height: 1.15; }

/* le lecteur (plein écran) */
.mt-lecteur { position: fixed; inset: 0; z-index: 120; background: var(--bg); transform: translateX(100%); transition: transform .45s cubic-bezier(.2, .8, .2, 1); display: block; }
.mt-lecteur.ouvert { transform: none; }
.mt-lecture { position: absolute; top: 0; left: 0; right: 0; height: 3px; z-index: 3; }
.mt-lecture i { display: block; height: 100%; width: 0; background: var(--or); }
.mt-lecteur-defile { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; }
.mt-article { max-width: 680px; margin: 0 auto; padding: 0 max(18px, env(safe-area-inset-left, 0px)) calc(48px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 18px; }
.mt-article-photo { position: relative; height: clamp(240px, 42vh, 380px); margin: 0 calc(-1 * max(18px, env(safe-area-inset-left, 0px))); overflow: hidden; }
.mt-article-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform-origin: 50% 100%; }
.mt-retour { position: absolute; left: max(16px, env(safe-area-inset-left, 0px)); top: calc(14px + env(safe-area-inset-top, 0px)); z-index: 2; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .94); display: grid; place-items: center; cursor: pointer; color: var(--t0); }
.mt-article h1 { font-size: clamp(32px, 5vw, 44px); }
.mt-article h3 { font-size: 23px; margin-top: 6px; }
.mt-article p.txt { font-size: 17px; line-height: 1.7; font-weight: 300; }
.mt-mot-lien { border: 0; background: none; padding: 0 0 1px; font: inherit; font-weight: 500; color: var(--t0); border-bottom: 1px solid var(--or); cursor: pointer; }
.mt-encadre { background: var(--bg-card); border-radius: 18px; padding: 16px; display: grid; gap: 12px; }
.mt-etape { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; font-size: 15.5px; line-height: 1.5; }
.mt-etape i { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--b3); display: grid; place-items: center; font-style: normal; font-family: var(--display); font-size: 17px; }
.mt-q { font-family: var(--display); font-size: 24px; line-height: 1.2; }
.mt-choix { display: grid; gap: 8px; }
.mt-choix button { background: var(--bg-card); border: 1px solid var(--b2); border-radius: 16px; padding: 14px 16px; text-align: left; font: inherit; font-size: 15.5px; color: var(--t0); cursor: pointer; transition: border-color .2s, background .2s; }
.mt-choix button.juste { border-color: var(--juste); background: var(--juste-fond); }
.mt-choix button.faux { border-color: var(--faux); background: var(--faux-fond); }
.mt-reponse { border-radius: 16px; padding: 13px 15px; font-size: 15px; line-height: 1.55; }
.mt-reponse.juste { background: var(--juste-fond); color: var(--juste-texte); }
.mt-reponse.faux { background: var(--faux-fond); color: var(--faux-texte); }
.mt-bouton { display: block; width: 100%; text-align: center; background: var(--t0); color: var(--bg); border: 0; border-radius: 999px; padding: 16px; font: inherit; font-size: 16px; font-weight: 500; cursor: pointer; text-decoration: none; }
.mt-bouton[disabled] { opacity: .35; cursor: default; }
.mt-bouton.clair { background: var(--bg-card); color: var(--t0); box-shadow: 0 1px 0 var(--b2); }
.mt-sources { font-size: 13px; color: var(--t3); line-height: 1.6; }
.mt-sources a { color: inherit; }

/* le mot du jour (feuille) */
.mt-voile { position: fixed; inset: 0; z-index: 130; background: rgba(22, 20, 15, .38); opacity: 0; transition: opacity .3s; }
.mt-voile.ouvert { opacity: 1; }
.mt-feuille { position: fixed; left: 0; right: 0; bottom: 0; z-index: 131; max-width: 680px; margin: 0 auto; max-height: 88vh; overflow-y: auto; background: var(--bg); border-radius: 28px 28px 0 0; padding: 12px 22px calc(24px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 14px; transform: translateY(105%); transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
.mt-feuille.ouvert { transform: none; }
.mt-poignee { width: 42px; height: 4px; border-radius: 4px; background: var(--b3); justify-self: center; }
.mt-feuille .illus { height: 120px; border-radius: 18px; background-size: cover; background-position: center 65%; }
.mt-feuille h2 { font-size: 34px; }
.mt-feuille p { font-size: 16.5px; line-height: 1.65; font-weight: 300; }

/* message bref */
.mt-toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); z-index: 140; transform: translate(-50%, 20px); opacity: 0; transition: transform .4s cubic-bezier(.2, .8, .2, 1), opacity .3s; background: var(--t0); color: var(--bg); border-radius: 16px; padding: 13px 18px; font-size: 14.5px; width: min(92vw, 420px); pointer-events: none; }
.mt-toast.vu { transform: translate(-50%, 0); opacity: 1; }
.mt-toast a { color: inherit; }

body.mt-fige { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .mt > *, .mt-une.mt-attente { animation: none; }
  .mt-lecteur, .mt-feuille, .mt-voile, .mt-toast { transition: none; }
  .mt-une-photo img { transform: none; }
}

/* Ordinateur : centré dans l'espace à droite de la barre latérale */
@media (min-width: 1000px) {
  .app-shell > main.mt { margin-left: max(var(--barre-g), calc((100vw + var(--barre-g) - 680px) / 2)); margin-right: 0; }
}

/* ==========================================================================
   Thème vif (body[data-theme="vif"]) : la une en grande carte photo, cartes blanches à 24 px
   ========================================================================== */
body[data-theme="vif"] .mt { max-width: 520px; gap: 22px; padding-top: 18px; }
body[data-theme="vif"] .mt-date { align-self: flex-start; padding: 6px 12px; border-radius: 999px; background: var(--carte); border: 1px solid var(--line); font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--t3); }
body[data-theme="vif"] .mt-bonjour { font-size: 27px; font-weight: 600; line-height: 1.2; text-wrap: balance; }
body[data-theme="vif"] .mt-eti { font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--or); }
body[data-theme="vif"] .mt-titre-bloc h2 { font-size: 20px; font-weight: 600; }
body[data-theme="vif"] .mt-titre-bloc .mt-eti { color: var(--t3); }
body[data-theme="vif"] .mt-mention { font-size: 12.5px; }

/* La une : photo plein cadre, voile sombre, titre blanc gras italique centré */
body[data-theme="vif"] .mt-une { position: relative; height: 440px; border-radius: 24px; background: var(--bg-deep); box-shadow: var(--vif-ombre); }
body[data-theme="vif"] .mt-une-photo { position: absolute; inset: 0; height: auto; }
body[data-theme="vif"] .mt-une-photo::after { content: ""; position: absolute; inset: 0; background: var(--vif-voile); }
body[data-theme="vif"] .mt-pastille { left: 16px; top: 16px; background: rgba(255, 255, 255, .92); color: var(--t0); font-weight: 700; letter-spacing: .06em; }
body[data-theme="vif"] .mt-une-corps { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 24px 24px; justify-items: center; text-align: center; gap: 12px; }
body[data-theme="vif"] .mt-une-corps .mt-eti { padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, .2); color: #FFFFFF; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
body[data-theme="vif"] .mt-une-corps h2 { color: #FFFFFF; font-size: 23px; font-weight: 800; font-style: italic; line-height: 1.2; text-wrap: balance; }
body[data-theme="vif"] .mt-une-corps p { color: rgba(255, 255, 255, .88) !important; }
body[data-theme="vif"] .mt-une-meta { gap: 14px; justify-content: center; color: rgba(255, 255, 255, .88); font-size: 13px; font-weight: 500; }
body[data-theme="vif"] .mt-lire { background: #FFFFFF; color: var(--t0); font-weight: 700; padding: 9px 20px; }
body[data-theme="vif"] .mt-une.lu .mt-lire { background: var(--vif-ciel); color: var(--t0); }
body[data-theme="vif"] .mt-une.mt-attente { background: linear-gradient(100deg, #FFFFFF 30%, var(--bg-deep) 50%, #FFFFFF 70%) 0 0 / 300% 100%; }

/* Lignes et cartes */
body[data-theme="vif"] .mt-carte { border-radius: 24px; border: 1px solid var(--line); box-shadow: var(--vif-ombre); padding: 4px 18px; }
body[data-theme="vif"] .mt-ligne { border-top-color: var(--line); min-height: 64px; }
body[data-theme="vif"] .mt-rond { background: var(--vif-ciel); color: var(--vif-bleu); font: 700 17px var(--font); }
body[data-theme="vif"] .mt-ligne b { font-weight: 700; }
body[data-theme="vif"] .mt-fleche { color: var(--t3); }

/* La semaine */
body[data-theme="vif"] .mt-semaine { margin: 0 -18px; padding: 2px 18px 10px; }
body[data-theme="vif"] .mt-semaine button { border-radius: 20px; border: 1px solid var(--line); box-shadow: var(--vif-ombre); }
body[data-theme="vif"] .mt-semaine .txt span { font-weight: 700; color: var(--or); }
body[data-theme="vif"] .mt-semaine .txt b { font: 700 16px/1.3 var(--font); }

/* Le lecteur et la feuille */
body[data-theme="vif"] .mt-lecteur { background: var(--bg); }
body[data-theme="vif"] .mt-lecture i { background: var(--vif-orange); }
body[data-theme="vif"] .mt-article { max-width: 560px; }
body[data-theme="vif"] .mt-article h1 { font-size: 30px; font-weight: 700; line-height: 1.15; }
body[data-theme="vif"] .mt-article h3 { font-size: 19px; font-weight: 700; }
body[data-theme="vif"] .mt-article p.txt { font-size: 17px; font-weight: 400; color: var(--t2); }
body[data-theme="vif"] .mt-article-photo { border-radius: 0 0 24px 24px; }
body[data-theme="vif"] .mt-mot-lien { font-weight: 700; color: var(--vif-bleu); border-bottom-color: var(--vif-bleu); }
body[data-theme="vif"] .mt-encadre { border-radius: 20px; border: 1px solid var(--line); }
body[data-theme="vif"] .mt-etape i { border-color: var(--vif-bleu); color: var(--vif-bleu); font: 700 15px var(--font); }
body[data-theme="vif"] .mt-q { font: 700 22px/1.3 var(--font); }
body[data-theme="vif"] .mt-choix button { border-radius: 16px; min-height: 52px; font-weight: 600; }
body[data-theme="vif"] .mt-bouton { min-height: 56px; background: var(--vif-bleu); color: #FFFFFF; font-weight: 700; box-shadow: 0 12px 28px -14px rgba(45, 91, 227, .8); }
body[data-theme="vif"] .mt-bouton.clair { background: var(--carte); color: var(--t0); border: 1px solid var(--line); box-shadow: none; }
body[data-theme="vif"] .mt-feuille { background: var(--bg); }
body[data-theme="vif"] .mt-feuille h2 { font-size: 30px; font-weight: 700; }
body[data-theme="vif"] .mt-feuille p { font-weight: 400; color: var(--t2); }
body[data-theme="vif"] .mt-feuille .illus { border-radius: 20px; }
body[data-theme="vif"] .mt-toast { background: var(--t0); border-radius: 999px; text-align: center; }
body[data-theme="vif"] .mt-voile { background: rgba(11, 28, 52, .4); }

@media (min-width: 1000px) {
  body[data-theme="vif"].app-shell > main.mt { margin-left: max(var(--barre-g), calc((100vw + var(--barre-g) - 520px) / 2)); }
}
