/* Concept: plateforme de cours façon médiathèque. Bandeau bleu profond avec onglets défilants, tuiles de raccourcis, grille de vidéos à vignettes. Audace : les vignettes illustrées par de grandes lettres hébraïques. */
:root {
  --bg: #f3f5fa;
  --card: #ffffff;
  --ink: #0f1a33;
  --muted: #5a647c;
  --blue: #0f2c75;
  --blue-2: #1c48a8;
  --gold: #f2b93b;
  --line: #dde2ee;
  --font-display: "Frank Ruhl Libre", "Times New Roman", serif;
  --font-body: "Assistant", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.45; padding-block: 0 40px; }
.wrap { max-width: 1120px; margin-inline: auto; padding-inline: 16px; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

/* Bandeau */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: linear-gradient(rgba(15, 44, 117, 0.86), rgba(15, 44, 117, 0.92)), url(images/yechiva.jpg) center 35% / cover, var(--blue); color: #fff; box-shadow: 0 4px 18px rgba(15, 44, 117, 0.25); }
.bar { display: grid; grid-template-columns: 52px 1fr 52px; align-items: center; padding-block: 12px 6px; }
.round { width: 48px; height: 48px; border-radius: 50%; background: var(--blue-2); display: grid; place-items: center; transition: background 0.2s, transform 0.2s; }
.round:hover { background: #2a5cc9; transform: scale(1.05); }
.avatar { padding: 0; overflow: hidden; border: 2px solid var(--gold); background: var(--blue-2); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.round svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; }
.logo { justify-self: center; text-align: center; line-height: 1; }
.logo b { display: block; font-family: var(--font-display); font-weight: 900; font-size: 2rem; letter-spacing: 0.01em; }
.logo b i { font-style: normal; color: var(--gold); }
.logo small { display: block; margin-top: 3px; font-size: 0.62rem; letter-spacing: 0.3em; font-weight: 700; color: #b9c8ee; }
.searchbox { padding-bottom: 10px; }
.searchbox input { width: 100%; border: 0; border-radius: 999px; padding: 12px 20px; font: inherit; font-size: 1rem; background: #fff; color: var(--ink); }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-inline: 16px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: 10px 14px 13px; font-weight: 600; font-size: 1.02rem; color: #cbd6f3; border-bottom: 4px solid transparent; transition: color 0.2s; }
.tab:hover { color: #fff; }
.tab[aria-pressed="true"] { color: #fff; border-bottom-color: var(--gold); }

/* Menu */
.drawer { background: var(--blue-2); }
.drawer ul { list-style: none; margin: 0; padding: 8px 0 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 4px; }
.drawer button { width: 100%; text-align: left; padding: 11px 14px; border-radius: 10px; font-weight: 600; color: #fff; }
.drawer button:hover { background: rgba(255, 255, 255, 0.14); }

/* Raccourcis */
.tiles { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); gap: 12px; overflow-x: auto; scrollbar-width: none; padding-block: 18px 6px; }
.tiles::-webkit-scrollbar { display: none; }
.tile { position: relative; height: 92px; border-radius: 12px; overflow: hidden; display: flex; align-items: flex-end; padding: 10px 12px; color: #fff; font-weight: 700; font-size: 1.02rem; text-align: left; box-shadow: 0 3px 10px rgba(15, 26, 51, 0.16); transition: transform 0.2s; }
.tile:hover { transform: translateY(-2px); }
.tile::before { content: attr(data-l); position: absolute; right: 8px; top: -10px; font-family: var(--font-display); font-weight: 900; font-size: 5.2rem; line-height: 1; color: rgba(255, 255, 255, 0.22); direction: rtl; }
.tile span { position: relative; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35); }
.g1 { background: linear-gradient(135deg, #7a3a14, #d9962b); }
.g2 { background: linear-gradient(135deg, #123a73, #2f7fd0); }
.g3 { background: linear-gradient(135deg, #5b1e55, #c24a86); }
.g4 { background: linear-gradient(135deg, #0f5a56, #2fb59b); }
.g5 { background: linear-gradient(135deg, #3b2a85, #7a63e0); }

/* Grille */
.head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-block: 22px 12px; }
.head h1 { margin: 0; font-family: var(--font-display); font-size: clamp(1.5rem, 5vw, 2rem); font-weight: 900; }
.head span { color: var(--muted); font-size: 0.92rem; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 20px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.vid { display: flex; flex-direction: column; gap: 10px; min-width: 0; text-align: left; }
.thumb { position: relative; aspect-ratio: 16 / 10; max-width: 100%; border-radius: 12px; overflow: hidden; display: grid; place-items: center; box-shadow: 0 3px 12px rgba(15, 26, 51, 0.18); transition: transform 0.25s, box-shadow 0.25s; }
.vid:hover .thumb { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(15, 26, 51, 0.24); }
.thumb::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 80% 10%, rgba(255, 255, 255, 0.28), transparent 55%); }
.thumb .l { position: relative; z-index: 1; font-family: var(--font-display); font-weight: 900; font-size: clamp(3.6rem, 12vw, 5.6rem); line-height: 1; color: rgba(255, 255, 255, 0.34); direction: rtl; }
.thumb img { object-position: center 18%; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.thumb .cat { position: absolute; z-index: 2; left: 8px; top: 8px; background: rgba(8, 14, 32, 0.62); color: #fff; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; }
.thumb .pl { position: absolute; z-index: 2; right: 8px; bottom: 8px; width: 36px; height: 36px; border-radius: 50%; background: var(--gold); display: grid; place-items: center; }
.thumb .pl::after { content: ""; border-left: 11px solid #1b1303; border-top: 7px solid transparent; border-bottom: 7px solid transparent; margin-left: 3px; }
.vid h2 { margin: 0; font-size: 1.05rem; font-weight: 800; line-height: 1.25; text-wrap: balance; }
.vid .ex { font-size: 0.74rem; color: var(--muted); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.ask { margin-top: 22px; max-width: 760px; background: linear-gradient(120deg, #0f2c75, #1c48a8); color: #fff; border-radius: 16px; padding: clamp(20px, 4vw, 30px); display: flex; flex-direction: column; gap: 10px; }
.ask h2 { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: clamp(1.4rem, 5vw, 1.9rem); line-height: 1.15; }
.ask > p { margin: 0; color: rgba(255, 255, 255, 0.85); }
.ask form { display: grid; gap: 12px; margin-top: 6px; }
.ask label { display: grid; gap: 5px; font-weight: 700; font-size: 0.92rem; }
.ask input, .ask textarea { font: inherit; font-size: 1rem; padding: 12px 14px; border: 0; border-radius: 12px; color: var(--ink); background: #fff; width: 100%; }
.ask textarea { resize: vertical; }
.ask button { justify-self: start; border: 0; border-radius: 999px; background: var(--gold); color: #1b1303; font: inherit; font-weight: 800; padding: 13px 24px; cursor: pointer; }
.ask button[disabled] { opacity: 0.6; cursor: default; }
.ask .hp { position: absolute; left: -9999px; }
.ask .askmsg { margin: 0; font-weight: 700; }
.hdj { margin-top: 22px; display: grid; gap: 12px; max-width: 760px; }
.hdj h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hdj h1x { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: clamp(1.5rem, 5vw, 2rem); }
.hdj .hdate { margin: 0; color: #b57c0b; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.8rem; }
.hposter { container-type: inline-size; width: 100%; max-width: 560px; margin: 0 auto; aspect-ratio: 1122 / 1402; background: #fffdf6 url(images/fond-halakha.jpg) center / 100% 100% no-repeat; border-radius: 16px; box-shadow: 0 10px 30px rgba(15, 26, 51, 0.18); position: relative; overflow: hidden; }
.hposter .hin { position: absolute; left: 14%; right: 12%; top: 24%; bottom: 16%; overflow-y: auto; color: #0f1a33; display: flex; flex-direction: column; justify-content: center; }
.hposter .hin h2 { margin: 0 0 3.5cqw; font-family: var(--font-display); font-weight: 900; font-size: 5.4cqw; line-height: 1.15; color: #0f2c75; text-align: center; }
.hposter .hin p { margin: 0 0 2.2cqw; font-size: 3.6cqw; line-height: 1.48; }
.hposter .hin .hsrc { font-size: 3.4cqw; text-align: center; color: #6b5a2a; margin-top: 1cqw; }
.hposter .empty { padding: 0; text-align: center; font-size: 5cqw; }
.hdj article h2 { color: var(--ink); font-size: 1.4rem; }
.hdj article p { margin: 0 0 0.9em; font-size: 1.05rem; line-height: 1.65; }
.hdj .hsrc { color: var(--muted); font-size: 0.9rem; font-style: italic; margin: 0; }
.horaires { margin-top: 22px; display: grid; gap: 16px; max-width: 760px; }
.horaires h1 { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: clamp(1.5rem, 5vw, 2rem); }
.hcard { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: clamp(18px, 4vw, 28px); }
.hcard h2 { margin: 0 0 10px; font-family: var(--font-display); font-weight: 900; font-size: 1.35rem; color: var(--blue); }
.hcard h2 span { color: #b57c0b; }
.hgold { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(242, 185, 59, 0.25); }
.hsub { margin: 0 0 6px; color: var(--muted); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; }
.hlist { list-style: none; margin: 0; padding: 0; }
.hlist li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 1.05rem; }
.hlist li:first-child { border-top: 0; }
.hlist b { color: var(--blue); font-weight: 800; white-space: nowrap; }
.hmoment { margin: 16px 0 2px; font-weight: 800; color: #b57c0b; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; }
.hmoment:first-child { margin-top: 0; }
.evbar { margin-top: 18px; width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; cursor: pointer; border: 1px solid var(--gold); border-radius: 16px; padding: 10px 14px 10px 10px; background: linear-gradient(120deg, #fff8e6, #fff); box-shadow: 0 3px 12px rgba(242, 185, 59, 0.25); font: inherit; color: var(--ink); }
.evbar[hidden] { display: none; }
.evbar img { width: 58px; height: 76px; object-fit: cover; object-position: top; border-radius: 8px; flex: none; }
.evtxt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.evtxt small { color: #b57c0b; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.72rem; }
.evtxt b { font-family: var(--font-display); font-weight: 900; font-size: 1.15rem; line-height: 1.2; }
.evtxt i { font-style: normal; color: var(--blue); font-weight: 700; font-size: 0.9rem; }
.souv { margin-top: 18px; display: flex; gap: 14px; align-items: center; background: #0b1230; color: #fff; border-radius: 16px; padding: 14px 18px; border: 1px solid #2a3566; }
.souv[hidden] { display: none; }
.souv .flame { font-size: 1.8rem; line-height: 1; }
.souv b { font-family: var(--font-display); font-weight: 900; font-size: 1.1rem; display: block; margin-bottom: 2px; }
.souv p { margin: 0; color: rgba(255, 255, 255, 0.85); font-size: 0.95rem; line-height: 1.45; }
.hbar { margin-top: 12px; width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; cursor: pointer; border: 1px solid var(--blue-2); border-radius: 16px; padding: 12px 16px; background: #fff; box-shadow: 0 3px 12px rgba(15, 44, 117, 0.15); font: inherit; color: var(--ink); }
.hbar[hidden] { display: none; }
.hdot { width: 14px; height: 14px; border-radius: 50%; background: var(--gold); flex: none; animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(242, 185, 59, 0.7); } 70% { box-shadow: 0 0 0 12px rgba(242, 185, 59, 0); } 100% { box-shadow: 0 0 0 0 rgba(242, 185, 59, 0); } }
.tab .tdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); margin-left: 6px; vertical-align: middle; animation: pulse 1.6s infinite; }
@media (prefers-reduced-motion: reduce) { .hdot, .tab .tdot { animation: none; } }
.inst { margin-top: 12px; display: flex; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; position: relative; }
.inst[hidden] { display: none; }
.inst img { border-radius: 12px; flex: none; }
.insttxt b { font-family: var(--font-display); font-weight: 900; font-size: 1.05rem; }
.insttxt p { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; line-height: 1.4; }
.insttxt button { margin-top: 8px; border: 0; border-radius: 999px; background: var(--blue); color: #fff; font: inherit; font-weight: 800; padding: 9px 20px; cursor: pointer; }
.insttxt button[hidden] { display: none; }
.inst .instx { position: absolute; top: 6px; right: 8px; border: 0; background: none; font-size: 1.4rem; line-height: 1; color: var(--muted); cursor: pointer; }
.event { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; }
.event .eback { position: absolute; inset: 0; background: rgba(8, 14, 32, 0.78); }
.event .ebox { position: relative; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.event img { max-width: 100%; max-height: calc(100vh - 100px); border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); display: block; }
.event .eclose { align-self: flex-end; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff; color: #0f1a33; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.event .ebtn { border: 0; border-radius: 999px; background: var(--gold); color: #1b1303; font: inherit; font-weight: 800; padding: 10px 22px; cursor: pointer; }
.empty { grid-column: 1 / -1; padding: 40px 0; text-align: center; color: var(--muted); }

/* Présentation */
.intro { margin-top: 22px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: clamp(20px, 4vw, 36px); display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.intro { background: linear-gradient(rgba(10, 28, 78, 0.78), rgba(10, 28, 78, 0.88)), url(images/yechiva.jpg) center / cover; border: 0; color: #fff; }
.intro .bsd { color: rgba(255, 255, 255, 0.75) !important; }
.intro .sign { color: var(--gold) !important; }
.intro[hidden] { display: none; }
.intro h2 { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: clamp(1.6rem, 5vw, 2.2rem); line-height: 1.15; text-wrap: balance; }
.intro p { margin: 0; font-size: 1.05rem; line-height: 1.6; max-width: 40em; }
.intro .bsd { font-family: var(--font-display); color: var(--muted); font-size: 0.95rem; }
.intro .sign { font-weight: 800; color: var(--blue); }

/* Lecteur vidéo */
.player { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.player[hidden] { display: none; }
.pback { position: absolute; inset: 0; background: rgba(6, 12, 32, 0.82); }
.pbox { position: relative; width: min(100%, 440px); max-height: 100%; display: flex; flex-direction: column; background: #0b1230; border-radius: 14px; overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.phead { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 8px 10px 16px; color: #fff; font-weight: 700; }
.phead span { min-width: 0; }
.pclose { width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 1.6rem; line-height: 1; flex: none; }
.pclose:hover { background: rgba(255, 255, 255, 0.24); }
.thumb .pt { position: absolute; z-index: 2; right: 8px; bottom: 8px; background: var(--gold); color: #1b1303; font-size: 0.7rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; }
.pyt { width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; display: block; }
.pyt.tall { aspect-ratio: 9 / 16; max-height: calc(100vh - 120px); max-height: calc(100svh - 120px); width: auto; margin: 0 auto; max-width: 100%; }
.ptext { padding: 4px 18px 22px; overflow-y: auto; color: #fff; font-size: 1.02rem; line-height: 1.65; }
.ptext p { margin: 0 0 1em; }
.pbox video { width: 100%; max-height: calc(100vh - 120px); max-height: calc(100svh - 120px); background: #000; display: block; }

/* À propos */
.about { margin-top: 44px; display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: clamp(20px, 4vw, 34px); }
.about-l { font-family: var(--font-display); font-weight: 900; font-size: clamp(3rem, 12vw, 5.5rem); line-height: 1; color: var(--blue); direction: rtl; }
.about h3 { margin: 0 0 6px; font-family: var(--font-display); font-weight: 900; font-size: 1.5rem; }
.about p { margin: 0; color: var(--muted); max-width: 40em; }
@media (max-width: 560px) { .about { grid-template-columns: 1fr; gap: 8px; } }

/* Bandeau bas */
.cta { margin-top: 44px; background: linear-gradient(120deg, var(--blue), var(--blue-2)); color: #fff; border-radius: 16px; padding: clamp(22px, 5vw, 40px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.cta h3 { margin: 0 0 4px; font-family: var(--font-display); font-weight: 900; font-size: clamp(1.4rem, 4.5vw, 2rem); }
.cta p { margin: 0; color: #cbd6f3; }
.cta button { background: var(--gold); color: #1b1303; font-weight: 800; padding: 13px 26px; border-radius: 999px; }
footer { padding-block: 30px 6px; color: var(--muted); font-size: 0.88rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .round, .tile, .thumb, .tab { transition: none; }
}
