/* Maamar du jour (templates/maamar_du_jour.html) : thème pnimi du prototype validé. */
@font-face { font-family: "Frank Ruhl Libre"; font-weight: 500; font-display: swap;
  src: url("fonts/frank-ruhl-libre-hebrew-500-normal.woff2") format("woff2");
  unicode-range: U+0307-0308,U+0590-05FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F; }
@font-face { font-family: "Frank Ruhl Libre"; font-weight: 500; font-display: swap;
  src: url("fonts/frank-ruhl-libre-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+2000-206F; }
@font-face { font-family: "Frank Ruhl Libre"; font-weight: 700; font-display: swap;
  src: url("fonts/frank-ruhl-libre-hebrew-700-normal.woff2") format("woff2");
  unicode-range: U+0307-0308,U+0590-05FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F; }
@font-face { font-family: "Frank Ruehl CLM"; font-weight: 700; font-display: swap;
  src: url("fonts/frank-ruehl-clm-bold.woff2") format("woff2"); }
@font-face { font-family: Assistant; font-weight: 400; font-display: swap;
  src: url("fonts/assistant-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: Assistant; font-weight: 400; font-display: swap;
  src: url("fonts/assistant-hebrew-400-normal.woff2") format("woff2");
  unicode-range: U+0590-05FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F; }
@font-face { font-family: Assistant; font-weight: 600 800; font-display: swap;
  src: url("fonts/assistant-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: Assistant; font-weight: 600 800; font-display: swap;
  src: url("fonts/assistant-hebrew-600-normal.woff2") format("woff2");
  unicode-range: U+0590-05FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F; }
@font-face { font-family: Inter; font-weight: 400 500; font-display: swap;
  src: url("fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: Inter; font-weight: 600; font-display: swap;
  src: url("fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: Inter; font-weight: 700; font-display: swap;
  src: url("fonts/inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: Inter; font-weight: 800; font-display: swap;
  src: url("fonts/inter-latin-800-normal.woff2") format("woff2"); }

:root {
  --head: linear-gradient(180deg, #132a52, #1a3463 45%, #1e3a6e 80%);
  --dock: linear-gradient(180deg, #1e3a6e 15%, #1a3463 55%, #132a52);
  --sq: linear-gradient(160deg, #15294f, #2f5490);
  --chipbg: rgba(255,255,255,.16);
  --acc: #fa5b3d;
  --deep: #132a52;
  --bleu: #1e3a6e;
  --curbg: #fdebe5;
  --numbg: #ecebe7;
  --paper: #fbfaf8;
  --line: #e2dfda;
  --gris: #1b1b1d;
  --onacc: #fff;
  --fort: var(--acc);
  --encre: #16305e;
  --dedc: #5873a3;
  --titre: #fff;
  --num: var(--bleu);
  --secb: var(--bleu);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--deep); }
body { font-family: Assistant, sans-serif; color: #fff; overflow: hidden; }
.app { height: 100dvh; display: flex; flex-direction: column; }
@media (min-width: 600px) {
  .app { max-width: 520px; margin: 0 auto; box-shadow: 0 0 40px rgba(0,0,0,.35); }
}
.view { flex: 1; min-height: 0; display: none; flex-direction: column; }
.view.on { display: flex; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

/* en-tête */
.head, .lhead { flex: none; padding: calc(env(safe-area-inset-top) + 8px) 20px 12px; background: var(--head); }
.brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; direction: rtl;
  padding: 0 20px 5px; margin: 0 -20px 5px; border-bottom: .5px solid rgba(255,255,255,.3); }
.brand a { display: flex; align-items: center; gap: 7px; color: #fff; text-decoration: none;
  font-family: "Frank Ruhl Libre", serif; font-weight: 700; font-size: 23px; line-height: 1; }
.brand img { height: 34px; width: auto; display: block; }
.brand span { white-space: nowrap; }
.bd { display: flex; flex-direction: column; align-items: flex-start; direction: ltr; line-height: 1.05; gap: 1px; }
.cd { font-weight: 600; font-size: 13px; opacity: .9; }
.hdte { font-family: "Frank Ruhl Libre", serif; font-weight: 500; font-size: 15px; direction: rtl; opacity: .9; }
.he { font-family: "Frank Ruehl CLM", "Frank Ruhl Libre", serif; font-weight: 700; font-size: 35px;
  line-height: 1.05; direction: rtl; text-align: center; color: var(--titre); }
.yr { font-family: "Frank Ruehl CLM", "Frank Ruhl Libre", serif; font-weight: 700; font-size: 18px;
  line-height: 1.2; direction: rtl; text-align: center; opacity: .85; color: var(--titre); }
.chip { display: block; width: max-content; margin: 4px auto 0; font-size: 12.5px; line-height: 14px;
  font-weight: 700; letter-spacing: .3px; padding: 3px 9px; border-radius: 20px; background: var(--acc); color: #fff; }
@media (max-width: 380px) {
  .brand a { font-size: 20px; gap: 5px; }
  .brand img { height: 30px; }
  .bd .hdte { font-size: 13.5px; }
  .bd .cd { font-size: 12px; }
  .he { font-size: 33px; }
}

/* texte du cours */
.text { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; background: var(--paper);
  color: var(--encre); padding: 8px 18px 20px; font-family: "Frank Ruhl Libre", serif; font-weight: 500;
  direction: rtl; text-align: justify; font-size: 25px; line-height: 1.35; }
.ded { font-size: 15px; text-align: center; color: var(--dedc); margin: 0 0 6px; }

/* lecteur */
.dock { flex: none; padding: 8px 16px calc(env(safe-area-inset-bottom) + 5px); background: var(--dock); }
.np { display: flex; gap: 11px; align-items: center; margin-bottom: 2px; }
.npt { min-width: 0; }
.cov { width: 40px; height: 40px; border-radius: 50%; background: url("rav-rond.jpg") center/cover;
  flex: none; box-shadow: 0 3px 10px rgba(0,0,0,.35); }
.np b { display: block; font-size: 13.5px; }
.np span { display: block; font-size: 11.5px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seek { position: relative; height: 26px; margin: -5px 0 -8px; touch-action: none; cursor: pointer; }
.seek .tr { position: absolute; left: 0; right: 0; top: 11px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.28); }
.seek .fi { position: absolute; left: 0; top: 11px; height: 4px; border-radius: 2px; background: var(--acc); width: 0; }
.seek .th { position: absolute; top: 6px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%;
  background: var(--acc); left: 0; transition: transform .1s; }
.seek.drag .th { transform: scale(1.35); }
.seek.drag .tr, .seek.drag .fi { height: 6px; top: 10px; }
.times { display: flex; justify-content: space-between; font-size: 11px; line-height: 1.1; opacity: .8; margin-bottom: -2px; }
/* cinq colonnes égales : lecture exactement au centre, ±10 symétriques, vitesse et menu de même largeur aux bords */
.ctrls { display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; justify-items: center; }
.ctrls .speed { justify-self: start; }
.ctrls .menu { justify-self: end; }
.skip { font-size: 12px; font-weight: 700; width: 34px; height: 34px; border-radius: 50%; border: 2px solid currentColor; }
.play { width: 42px; height: 42px; border-radius: 50%; background: var(--acc); color: var(--onacc);
  display: flex; align-items: center; justify-content: center; }
.play svg { width: 20px; height: 20px; fill: currentColor; }
.speed { font-size: 12.5px; font-weight: 800; height: 29px; padding: 0 9px; border-radius: 14px; color: var(--acc);
  background: var(--chipbg); min-width: 52px; }
.menu { font-size: 18px; line-height: 1; width: 52px; height: 29px; border-radius: 14px; background: var(--chipbg); }
.row { display: flex; justify-content: space-between; font-size: 12px; line-height: 1.2; margin-top: 1px;
  text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.row button { opacity: .85; }
.minip { display: none; }
.mini .full { display: none; }
.mini .np { margin: 0; }
.mini .minip { display: flex; width: 38px; height: 38px; margin-left: auto; }

/* bibliothèque */
.lhead button { font-size: 13px; font-weight: 600; opacity: .9; }
.h1 { font-size: 24px; font-weight: 800; margin-top: 6px; }
.list { flex: 1; min-height: 0; overflow-y: auto; background: var(--paper); color: #1a1612; }
.sec { padding: 14px 18px 4px; font-size: 11.5px; font-weight: 800; letter-spacing: .8px; color: var(--bleu);
  text-transform: uppercase; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.sec b { font-family: "Frank Ruehl CLM", "Frank Ruhl Libre", serif; font-size: 19px; letter-spacing: 0;
  text-transform: none; color: var(--secb); direction: rtl; }
.c, .a { display: flex; align-items: center; gap: 12px; padding: 9px 18px; border-bottom: 1px solid var(--line);
  color: inherit; text-decoration: none; cursor: pointer; width: 100%; text-align: left; }
.c.cur { background: var(--curbg); }
.num { width: 34px; height: 34px; border-radius: 50%; flex: none; display: flex; align-items: center;
  justify-content: center; font-weight: 800; font-size: 13px; background: var(--numbg); color: var(--num); }
.cur .num { background: var(--fort); color: #fff; }
.mid { flex: 1; min-width: 0; }
.deb { font-family: "Frank Ruhl Libre", serif; font-weight: 500; font-size: 18px; direction: rtl; text-align: right;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub, .dt { font-size: 12px; color: var(--gris); margin-top: 1px; }
.rt { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.dur { font-size: 12px; font-weight: 700; color: var(--num); }
.tag { font-size: 10.5px; font-weight: 800; color: #fff; background: var(--fort); padding: 2px 7px; border-radius: 10px; }
.more { display: block; width: 100%; text-align: center; font-size: 13px; font-weight: 700; color: var(--bleu); padding: 10px; }
.sq { width: 54px; height: 54px; border-radius: 8px; flex: none; background: var(--sq); display: flex;
  align-items: center; justify-content: center; color: #fff; font-family: "Frank Ruehl CLM", serif; font-size: 15px; direction: rtl; }
.ahe { font-family: "Frank Ruehl CLM", "Frank Ruhl Libre", serif; font-size: 20px; direction: rtl; text-align: right; }
.ahe small { font-size: 15px; opacity: .7; }
.chev { font-size: 22px; color: var(--acc); }

/* Seconde version (?theme=bordeaux) : thème 4 du prototype, bordeaux et camel, sans l'identité pnimi */
html[data-theme="bordeaux"] {
  --head: linear-gradient(180deg, #22030a, #460614 50%, #720a23);
  --dock: linear-gradient(180deg, #5a081b, #3a0510 45%, #22030a);
  --sq: linear-gradient(160deg, #5a0718, #9a0f2e);
  --chipbg: rgba(219,188,145,.18);
  --acc: #dbbc91;
  --onacc: #2a020a;
  --fort: #6e0a20;
  --deep: #2a020a;
  --bleu: #8a0f2a;
  --secb: #2e0610;
  --num: #5a0718;
  --curbg: #f7e9e8;
  --numbg: #f1dedd;
  --paper: #faf2e6;
  --line: #ecdcc8;
  --gris: #7a6a58;
  --encre: #1a1612;
  --dedc: #8a7a68;
  --titre: var(--acc);
}
html[data-theme="bordeaux"] body { font-family: Inter, Assistant, sans-serif; }
html[data-theme="bordeaux"] .head, html[data-theme="bordeaux"] .lhead { padding-top: calc(env(safe-area-inset-top) + 12px); }
.dates { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding-bottom: 6px;
  margin-bottom: 7px; border-bottom: 1px solid rgba(255,255,255,.2); }
.dates span { white-space: nowrap; }
html[data-theme="bordeaux"] .he { font-size: 31px; }
html[data-theme="bordeaux"] .chip { font-size: 10.5px; line-height: normal; letter-spacing: .4px; padding: 3px 10px;
  background: var(--chipbg); }
