/* Archive des « Hadith du jour » (kaayxol.ma/Al-quran-H24 et babousalam/live.php). Script : hadiths.js, données : api.php?hadiths */
.hx { --hx-fond: transparent; --hx-carte: rgba(12, 38, 28, .55); --hx-encre: #f2f6f3; --hx-doux: #a9bdb3; --hx-trait: rgba(255, 255, 255, .09);
  --hx-or: #e3b04b; --hx-or2: #f6d27e; --hx-accent: #14a374; --hx-champ: rgba(255, 255, 255, .06); --hx-ombre: 0 24px 50px -30px rgba(0, 0, 0, .8);
  --hx-arabe: "Amiri", "Noto Naskh Arabic", "Traditional Arabic", "Sakkal Majalla", serif; --hx-ease: cubic-bezier(.2, .8, .2, 1);
  position: relative; color: var(--hx-encre); background: var(--hx-fond); }
.hx--vert { --hx-fond: linear-gradient(180deg, #f3faf6, #fff 30%); --hx-carte: #fff; --hx-encre: #14231c; --hx-doux: #55645c; --hx-trait: #d9e2dc;
  --hx-or: #b9862a; --hx-or2: #8a6115; --hx-accent: #147a50; --hx-champ: #f3f8f5; --hx-ombre: 0 18px 40px -28px rgba(12, 74, 52, .45);
  padding-block: 3rem 3.4rem; border-bottom: 1px solid var(--hx-trait); }
.hx--nuit { margin: 44px auto 0; }
.hx * { box-sizing: border-box; }

.hx-tete { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 24px; margin-bottom: 22px; }
.hx-k { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 6px; color: var(--hx-or); font-size: .74rem; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
.hx-k::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: currentColor; transform-origin: left; }
.hx-tete h2 { margin: 0; font-size: clamp(1.45rem, 3vw, 2.1rem); line-height: 1.1; letter-spacing: -.02em; color: var(--hx-encre); }
.hx-lede { margin: 6px 0 0; max-width: 46rem; color: var(--hx-doux); font-size: .95rem; }
.hx-total { display: flex; align-items: baseline; gap: 8px; color: var(--hx-doux); font-size: .88rem; }
.hx-total b { font-size: 2rem; line-height: 1; color: var(--hx-or2); font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.hx--vert .hx-total b { color: var(--hx-accent); }

.hx-corps { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 64rem) { .hx-corps { grid-template-columns: 290px minmax(0, 1fr); gap: 28px; align-items: start; } .hx-rail { position: sticky; top: 16px; } }

/* Rail : recherche + calendrier */
.hx-rail { padding: 16px; border-radius: 18px; background: var(--hx-carte); border: 1px solid var(--hx-trait); box-shadow: var(--hx-ombre); }
.hx--nuit .hx-rail { backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.hx-cherche { display: flex; gap: 6px; margin: 0 0 14px; }
.hx-cherche input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--hx-trait); background: var(--hx-champ); color: var(--hx-encre); font: inherit; font-size: .92rem; }
.hx-cherche input:focus { outline: 2px solid var(--hx-or); outline-offset: 1px; }
.hx-cherche button, .hx-mois button, .hx-tout { border: 1px solid var(--hx-trait); background: var(--hx-champ); color: var(--hx-encre); font: inherit; cursor: pointer; border-radius: 10px; transition: background .2s, border-color .2s, transform .2s var(--hx-ease); }
.hx-cherche button { padding: 0 12px; display: grid; place-items: center; }
.hx-cherche button:hover, .hx-mois button:hover:not(:disabled), .hx-tout:hover { border-color: var(--hx-or); }
.hx-cherche svg { width: 18px; height: 18px; }
.hx-mois { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.hx-mois b { font-size: 1rem; text-transform: capitalize; }
.hx-mois button { width: 34px; height: 34px; font-size: 1.1rem; line-height: 1; }
.hx-mois button:disabled { opacity: .3; cursor: default; }
.hx-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.hx-cal > span { font-size: .68rem; font-weight: 700; color: var(--hx-doux); letter-spacing: .06em; padding-bottom: 2px; }
.hx-cal i { font-style: normal; aspect-ratio: 1; display: grid; place-items: center; border-radius: 9px; font-size: .82rem; color: var(--hx-doux); opacity: .45; font-variant-numeric: tabular-nums; }
.hx-cal button { aspect-ratio: 1; border: 0; padding: 0; border-radius: 9px; font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; color: var(--hx-encre); font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--hx-or) 22%, transparent); position: relative; transition: transform .25s var(--hx-ease), background .2s; }
.hx-cal button::after { content: ""; position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--hx-or); }
.hx-cal button:hover { transform: scale(1.08); }
.hx-cal button[aria-pressed="true"] { background: var(--hx-or); color: #1b1305; }
.hx-cal button[aria-pressed="true"]::after { background: #1b1305; }
.hx-tout { display: block; width: 100%; margin-top: 12px; padding: 8px; font-size: .85rem; font-weight: 600; }
.hx-tout[hidden] { display: none; }
.hx-note { margin: 12px 0 0; font-size: .76rem; line-height: 1.45; color: var(--hx-doux); }
.hx-note a { color: inherit; }

/* Cartes */
.hx-liste { display: grid; grid-template-columns: 1fr; gap: 16px; min-width: 0; }
@media (min-width: 90rem) { .hx--nuit .hx-liste, .hx--vert .hx-liste { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.hx-etat { grid-column: 1 / -1; margin: 0; padding: 28px 18px; border-radius: 18px; border: 1px dashed var(--hx-trait); color: var(--hx-doux); text-align: center; }
.hx-carte { position: relative; margin: 0; padding: 20px 22px 18px; border-radius: 18px; background: var(--hx-carte); border: 1px solid var(--hx-trait); box-shadow: var(--hx-ombre); overflow: hidden; scroll-margin-top: 20px; }
.hx--nuit .hx-carte { backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.hx-carte::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: linear-gradient(var(--hx-or), var(--hx-accent)); transform-origin: top; }
.hx-carte.hx-cible { border-color: var(--hx-or); }
.hx-date { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 8px; }
.hx-date time { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 99px; font-size: .78rem; font-weight: 700; color: var(--hx-or2); background: color-mix(in srgb, var(--hx-or) 14%, transparent); }
.hx-date time::first-letter { text-transform: uppercase; }
.hx--vert .hx-date time { color: var(--hx-accent); background: color-mix(in srgb, var(--hx-accent) 10%, transparent); }
.hx-titre { margin: 0 0 12px; font-size: 1.08rem; line-height: 1.35; letter-spacing: -.01em; color: var(--hx-encre); }
.hx-texte { position: relative; max-height: 22rem; overflow: hidden; transition: max-height .6s var(--hx-ease); }
.hx-texte.hx-ouvert { max-height: none; }
.hx-texte.hx-long:not(.hx-ouvert)::after { content: ""; position: absolute; inset: auto 0 0; height: 5rem; background: linear-gradient(transparent, var(--hx-carte-fin, #0b241b)); pointer-events: none; }
.hx--vert .hx-texte.hx-long:not(.hx-ouvert)::after { --hx-carte-fin: #fff; }
.hx-ar { margin: 0 0 12px; font-family: var(--hx-arabe); font-size: 1.32rem; line-height: 2; text-align: right; color: var(--hx-encre); white-space: pre-line; }
.hx-fr { margin: 0; font-size: .97rem; line-height: 1.65; color: var(--hx-encre); opacity: .92; white-space: pre-line; }
.hx-plus { margin-top: 8px; padding: 0; border: 0; background: none; color: var(--hx-or2); font: inherit; font-size: .86rem; font-weight: 700; cursor: pointer; }
.hx--vert .hx-plus { color: var(--hx-accent); }
.hx-ref { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--hx-trait); font-size: .84rem; color: var(--hx-doux); }
.hx-liens { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 10px; font-size: .84rem; }
.hx-liens a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--hx-or2); text-decoration: none; }
.hx--vert .hx-liens a { color: var(--hx-accent); }
.hx-liens a:hover { text-decoration: underline; }
.hx-liens svg { width: 16px; height: 16px; flex: none; }
.hx-liens .hx-yt { padding: 5px 11px; border-radius: 99px; background: rgba(229, 72, 77, .14); color: #ff9a9d; }
.hx--vert .hx-liens .hx-yt { background: #fdecec; color: #a3262f; }
mark.hx-m { background: color-mix(in srgb, var(--hx-or) 40%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

/* Motion design : entrée des cartes, du rail, des jours */
@media (prefers-reduced-motion: no-preference) {
  .hx-anim .hx-carte { opacity: 0; transform: translateY(26px) scale(.985); filter: blur(4px); transition: opacity .7s var(--hx-ease), transform .8s var(--hx-ease), filter .7s var(--hx-ease); transition-delay: calc(var(--n, 0) * 70ms); }
  .hx-anim .hx-carte::before { transform: scaleY(0); transition: transform 1s .25s var(--hx-ease); }
  .hx-anim .hx-carte.hx-vu { opacity: 1; transform: none; filter: none; }
  .hx-anim .hx-carte.hx-vu::before { transform: none; }
  .hx-anim .hx-cal button { animation: hx-pop .5s var(--hx-ease) both; animation-delay: calc(var(--n, 0) * 18ms); }
  .hx-anim .hx-k::before { animation: hx-trait 1.2s var(--hx-ease) both; }
  .hx-carte.hx-cible { animation: hx-cible 1.6s var(--hx-ease); }
}
@keyframes hx-pop { from { opacity: 0; transform: scale(.6); } }
@keyframes hx-trait { from { transform: scaleX(0); } }
@keyframes hx-cible { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--hx-or) 60%, transparent); } 100% { box-shadow: 0 0 0 18px transparent; } }

/* Calendrier à taille humaine quand le rail n'est pas en colonne latérale */
@media (max-width: 63.99rem) {
  .hx-mois, .hx-cal { max-width: 360px; margin-inline: auto; width: 100%; }
}
@media (min-width: 40rem) and (max-width: 63.99rem) {
  .hx-rail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; column-gap: 28px; align-items: start;
    grid-template-areas: "f m" "n c" "t c" ". c"; }
  .hx-cherche { grid-area: f; } .hx-mois { grid-area: m; margin-bottom: 6px; } .hx-cal { grid-area: c; }
  .hx-tout { grid-area: t; } .hx-note { grid-area: n; margin-top: 0; }
}

/* Partage */
.hx-partage { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--hx-trait); }
.hx-partage-k { margin-right: 4px; font-size: .74rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--hx-doux); }
.hx-pb { position: relative; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border-radius: 50%; border: 1px solid var(--hx-trait); background: var(--hx-champ); color: var(--hx-encre); cursor: pointer;
  transition: transform .25s var(--hx-ease), background .2s, color .2s, border-color .2s; }
.hx-pb svg { width: 17px; height: 17px; }
.hx-pb:hover { transform: translateY(-2px) scale(1.06); }
.hx-pb-wa:hover { background: #1faa52; border-color: #1faa52; color: #fff; }
.hx-pb-fb:hover { background: #1877f2; border-color: #1877f2; color: #fff; }
.hx-pb-tg:hover { background: #2aa3df; border-color: #2aa3df; color: #fff; }
.hx-pb-x:hover { background: #000; border-color: #000; color: #fff; }
.hx-pb-lien:hover, .hx-pb-natif:hover { border-color: var(--hx-or); }
.hx-pb.hx-copie { background: var(--hx-accent); border-color: var(--hx-accent); color: #fff; }
.hx-pb.hx-copie::after { content: "Lien copié"; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 3px 8px; border-radius: 6px; font: 600 .72rem Inter, system-ui, sans-serif; background: var(--hx-accent); color: #fff; }

/* Page de partage d'un hadith (hadith.php) */
.hx-seul { width: min(100% - 32px, 760px); margin: 18px auto 40px; }
.hx-seul .hx-k { justify-content: center; display: flex; }
.hx-seul .hx-titre { font-size: clamp(1.3rem, 3.4vw, 1.75rem); }
.hx-seul .hx-ar { font-size: 1.5rem; }
.hx-seul .hx-fr { font-size: 1.05rem; }
.hx-suite { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 22px 0 0; }
.hx-bouton { display: inline-flex; align-items: center; padding: 12px 20px; border-radius: 99px; font-weight: 700; text-decoration: none; color: #1b1305; background: linear-gradient(100deg, var(--hx-or2), var(--hx-or)); transition: transform .25s var(--hx-ease); }
.hx-bouton:hover { transform: translateY(-2px); color: #1b1305; }
.hx-bouton-clair { color: var(--hx-encre); background: var(--hx-champ); border: 1px solid var(--hx-trait); }
.hx-bouton-clair:hover { color: #fff; }
.hx-seul > .hx-note { text-align: center; }
@media (prefers-reduced-motion: no-preference) { .hx-seul .hx-carte { animation: hx-entre .9s var(--hx-ease) both; } }
@keyframes hx-entre { from { opacity: 0; transform: translateY(24px) scale(.98); filter: blur(4px); } }
