/* ======================================================================
   סגנונות דף בית מדרש ערב — משותפים לעמוד הכללי (shiurim.html)
   ולעמודי היום הבודד (shiur.html)
   ====================================================================== */

:root {
  --paper: #F2F3EF;
  --surface: #FFFFFF;
  --ink: #1C2530;
  --muted: #5B6673;
  --line: #D9DDD6;
  --navy: #1E3F5A;
  --navy-deep: #16304A;
  --brass: #A8812F;
  --brass-soft: #C9A84C;
  --danger: #9E3A2B;
  --ok: #2F6B4A;
  --head: "Frank Ruhl Libre", serif;
  --body: "Assistant", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: 17px; line-height: 1.6;
}
h1, h2, h3 { font-family: var(--head); line-height: 1.2; margin: 0; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; }
.hidden { display: none !important; }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }

/* ---------- כותרת, בשפת הפרסום המודפס ---------- */
/* הלוגו על רקע בהיר, כי אותיותיו כהות */
.brandbar {
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: .9rem 0; text-align: center;
}
.brandbar img { height: 46px; display: inline-block; }

.hero {
  position: relative; isolation: isolate; color: #fff;
  background: #060A14 url("/img/bg/night.jpg") center 40% / cover no-repeat;
  padding: 2.6rem 0 2.9rem;
}
/* הכניסה לבית המדרש, נמסכת אל תוך שמי הלילה — כמו בפרסום */
.hero::before {
  content: ""; position: absolute; inset-inline: 0; bottom: 0; z-index: -2;
  height: 72%; opacity: .92;
  /* גובה מלא ורוחב חופשי, כדי שקשת הכניסה תישאר בתמונה */
  background: url("/img/bg/door.jpg") left bottom / auto 100% no-repeat;
  -webkit-mask-image: linear-gradient(to top, #000 0%, #000 62%, rgba(0,0,0,.45) 85%, transparent 100%);
  mask-image: linear-gradient(to top, #000 0%, #000 62%, rgba(0,0,0,.45) 85%, transparent 100%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(ellipse at 50% 36%,
              rgba(6,10,20,.18) 0%, rgba(6,10,20,.66) 68%, rgba(6,10,20,.8) 100%);
}
/* במסך צר התמונה מוצגת לרוחב, כדי שכל הכניסה תיראה ולא רק פרט ממנה */
@media (max-width: 620px) {
  .hero::before { background-size: 100% auto; height: 52%; }
}
.hero .wrap { text-align: center; }

/* שתי השאלות שפותחות את הפרסום */
.questions { margin: 0 0 1.5rem; display: grid; gap: .35rem; }
.questions span {
  color: #D7D1C8; font-size: clamp(.92rem, 3.4vw, 1.02rem); line-height: 1.45;
  text-shadow: 0 2px 10px rgba(0,0,0,.8);
}
.questions .cta { color: #fff; font-weight: 700; margin-top: .25rem; }

.hero h1 { margin: 0; font-family: "Heebo", var(--body); line-height: 1.04; }
.t1 {
  display: block; font-weight: 900; color: #E6C24F;
  font-size: clamp(2.05rem, 8.6vw, 3.6rem);
  text-shadow: 0 3px 22px rgba(0,0,0,.75);
}
.t2 {
  display: block; font-weight: 800; color: #C85FBE; margin-top: .1em;
  font-size: clamp(1.3rem, 5.4vw, 2.25rem);
  text-shadow: 0 3px 18px rgba(0,0,0,.75);
}

.audience {
  display: inline-block; margin: 1.15rem 0 0; padding: .4rem 1.15rem;
  background: #553AA0; color: #fff; font-weight: 600; border-radius: 999px;
  font-size: clamp(.92rem, 3.4vw, 1.1rem);
}
.facts {
  margin: 1.1rem 0 0; color: #DCE2EA;
  font-size: clamp(.95rem, 3.5vw, 1.05rem);
  text-shadow: 0 2px 10px rgba(0,0,0,.8);
}

/* תחומי הלימוד, ככוכבים בראש הפרסום */
.topics {
  list-style: none; margin: 1.75rem 0 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem 1.3rem;
  font-size: clamp(.85rem, 3.2vw, .95rem); color: #E7DDC5;
  text-shadow: 0 2px 10px rgba(0,0,0,.9);
}
.topics li { display: flex; align-items: center; gap: .45rem; }
.topics li::before { content: "✦"; color: #E6C24F; font-size: .82em; }

/* ---------- שבוע הלימוד ---------- */
main { padding: 2.5rem 0 4rem; }
/* אזור השיעורים רחב יותר, כדי להכיל שלושה כרטיסים בשורה */
.wrap.wide { max-width: 1060px; }
.narrow { max-width: 640px; margin-inline: auto; }
.lead {
  max-width: 54ch; margin: 0 auto 1.9rem; text-align: center;
  color: var(--ink); font-weight: 600; line-height: 1.5;
  font-size: clamp(1.05rem, 3.8vw, 1.25rem);
}

/* שלושה כרטיסים בשורה הראשונה, שניים בשנייה */
.week {
  list-style: none; margin: 0 0 2.25rem; padding: 0;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.1rem;
  align-items: start;
}
.week > li { grid-column: span 2; }
.week > li:nth-child(4), .week > li:nth-child(5) { grid-column: span 3; }

@media (max-width: 920px) {
  .week { grid-template-columns: repeat(2, 1fr); }
  .week > li, .week > li:nth-child(4), .week > li:nth-child(5) { grid-column: span 1; }
  .week > li:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .week { grid-template-columns: 1fr; gap: .9rem; }
  .week > li, .week > li:nth-child(4), .week > li:nth-child(5),
  .week > li:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* כל שיעור הוא כרטיס בצבע משלו, שנקבע ב-shiurim-config.js */
.shiur {
  position: relative;
  display: flex; flex-direction: column; height: 100%;
  background: var(--surface);
  border: 1px solid var(--c);
  border-inline-start-width: 6px;
  border-radius: 18px;
  transition: background-color .15s, box-shadow .15s;
}
.shiur:has(input:checked) { background: var(--tint); box-shadow: 0 2px 14px rgba(0,0,0,.07); }

.pick {
  flex: 1;
  display: grid; grid-template-columns: 1fr auto;
  grid-template-areas: "day mark" "body body" "logo logo";
  align-items: start; align-content: start; gap: .5rem .9rem;
  padding: 1.15rem 1.2rem 1rem; cursor: pointer;
}
.pick input { position: absolute; opacity: 0; width: 0; height: 0; }
.pick:has(input:focus-visible) { outline: 3px solid var(--c); outline-offset: -3px; border-radius: 18px; }

.day-name {
  grid-area: day; font-family: var(--head); font-weight: 700;
  font-size: 1.22rem; color: var(--c);
  display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap;
}
.day-time {
  font-family: var(--body); font-size: .9rem;
  font-weight: 400; color: var(--muted); unicode-bidi: isolate;
}
.mark {
  grid-area: mark; width: 26px; height: 26px; flex: none;
  border: 1.5px solid var(--line); border-radius: 50%;
  display: grid; place-items: center; color: transparent; font-size: .9rem;
}
.shiur:has(input:checked) .mark { background: var(--c); border-color: var(--c); color: #fff; }

.day-body { grid-area: body; }
.day-title {
  font-weight: 600; font-size: 1.06rem; line-height: 1.3;
  display: block; cursor: help; margin-bottom: .3rem;
}
.day-title:focus-visible { outline: 3px solid var(--c); outline-offset: 2px; border-radius: 4px; }
.day-by {
  color: var(--muted); font-size: .94rem;
  display: flex; flex-wrap: wrap; gap: .15rem .9rem;
}
/* נוסח חופשי: שורה רציפה, כדי שהפסיקים וה־ו׳ יישארו צמודים לשמות */
.day-by.by-text { display: block; }

/* בלון עם תיאור השיעור, נפתח כשעומדים על הכותרת.
   רוחבו כרוחב הכרטיס, כדי שלא יחרוג ממנו בתצוגת הרשת */
.tip {
  position: absolute; bottom: calc(100% + 8px); inset-inline: 0;
  background: var(--surface); color: var(--ink);
  font-weight: 400; font-size: .94rem; line-height: 1.5; text-align: start;
  border: 1px solid var(--c); border-top: 4px solid var(--c); border-radius: 12px;
  padding: .75rem .9rem; box-shadow: 0 10px 26px rgba(0,0,0,.16);
  opacity: 0; visibility: hidden; transform: translateY(5px);
  transition: opacity .15s, transform .15s; z-index: 6; pointer-events: none;
}
.day-title:hover .tip, .day-title:focus-visible .tip {
  opacity: 1; visibility: visible; transform: translateY(0);
}

.emblem {
  grid-area: logo; justify-self: start; margin-top: .45rem;
  width: 66px; height: 66px; border-radius: 50%; display: block;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
/* סמל מלבני, כמו של שיחתי */
.emblem-wide {
  width: 78px; height: auto; border-radius: 6px;
  box-shadow: 0 1px 5px rgba(0,0,0,.14);
}

/* תמונת המעביר, נפתחת כשעומדים על שמו */
.lect { position: relative; white-space: nowrap; }
.ava {
  position: absolute; bottom: calc(100% + 9px); inset-inline-start: 50%;
  transform: translate(50%, 5px) scale(.92); transform-origin: bottom center;
  opacity: 0; visibility: hidden;
  transition: opacity .15s, transform .15s; z-index: 7; pointer-events: none;
}
.ava img {
  display: block; width: 84px; height: 84px; border-radius: 50%;
  object-fit: cover; background: var(--tint);
  border: 3px solid var(--c); box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.lect:hover .ava, .lect:focus-visible .ava {
  opacity: 1; visibility: visible; transform: translate(50%, 0) scale(1);
}
/* במסכי מגע אין ריחוף, ולכן התמונה מוצגת תמיד בקטן לצד השם */
@media (hover: none) {
  .tip { display: none; }
  .day-title { cursor: default; }
  .lect { display: inline-flex; align-items: center; gap: .4rem; }
  .ava {
    position: static; opacity: 1; visibility: visible; transform: none; order: -1;
  }
  .lect:hover .ava, .lect:focus-visible .ava { transform: none; }
  .ava img { width: 30px; height: 30px; border-width: 2px; box-shadow: none; }
}

/* על השיעור */
.about { border-top: 1px dashed var(--line); }
.about summary {
  list-style: none; cursor: pointer; padding: .6rem 1.2rem;
  font-size: .93rem; font-weight: 600; color: var(--c);
  display: flex; align-items: center; gap: .4rem;
}
.about summary::-webkit-details-marker { display: none; }
.about summary::before {
  content: ""; width: 0; height: 0; flex: none;
  border-block: 4px solid transparent;
  border-inline-start: 6px solid currentColor;
  transition: transform .15s;
}
.about[open] summary::before { transform: rotate(-90deg); }
.about summary:focus-visible { outline: 3px solid var(--c); outline-offset: -3px; }
.about-body {
  padding: 0 1.2rem 1rem; color: var(--ink);
  font-size: .95rem; max-width: 64ch;
}
.about-lead { display: block; }
.about-lead + .sched-row { margin-top: .6rem; }

/* לוח זמנים בתוך תיאור השיעור */
.sched-row {
  display: grid; grid-template-columns: auto 1fr; gap: .15rem .9rem;
  align-items: baseline; padding: .4rem 0;
}
.sched-row + .sched-row { border-top: 1px dashed var(--line); }
.sched-t { font-weight: 700; color: var(--c); white-space: nowrap; unicode-bidi: isolate; }
@media (max-width: 1050px) {
  .week .sched-row { grid-template-columns: 1fr; gap: .1rem; }
}

/* הודעה מודגשת בין השיעורים לטופס */
.notice {
  max-width: 720px; margin: 0 auto 2rem; text-align: center;
  background: #FBF5E7; border: 1px solid #E6D6A8;
  border-inline-start: 6px solid var(--brass);
  border-radius: 16px; padding: 1rem 1.25rem;
  font-weight: 700; color: var(--ink);
  font-size: clamp(1.02rem, 3.8vw, 1.18rem); line-height: 1.5;
}

/* ---------- טופס ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 1.5rem;
}
.card h2 { font-size: 1.4rem; margin-bottom: .35rem; }
.card > p { margin: 0 0 1.25rem; color: var(--muted); font-size: .95rem; }
.field { margin-bottom: 1rem; }
label.lbl { display: block; font-weight: 600; margin-bottom: .3rem; }
input[type="text"], input[type="tel"], input[type="email"] {
  width: 100%; font: inherit; padding: .65rem .8rem; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
}
input:focus { border-color: var(--navy); outline: none; box-shadow: 0 0 0 3px rgba(30,63,90,.14); }
.req { color: var(--danger); }
.btn {
  font: inherit; font-weight: 700; font-size: 1.05rem; width: 100%;
  padding: .8rem 1.5rem; border: 1px solid var(--navy); border-radius: 999px;
  background: var(--navy); color: #fff; cursor: pointer;
}
.btn:hover { background: var(--navy-deep); }
.btn:disabled { opacity: .55; cursor: default; }
.msg { padding: .65rem .85rem; border-radius: 10px; margin-bottom: 1rem; font-size: .95rem; }
.msg-error { background: #F6E6E3; color: var(--danger); }
.chosen { font-size: .95rem; color: var(--muted); margin: 0 0 1.25rem; }
.chosen strong { color: var(--ink); }

/* ---------- אישור ---------- */
.done { text-align: center; padding: 1rem 0 0; }
.done h2 { font-size: 1.6rem; color: var(--ok); margin-bottom: .6rem; }
.done ul { list-style: none; padding: 0; margin: 1rem auto; max-width: 32ch; text-align: start; }
.done li { padding: .4rem 0; border-bottom: 1px solid var(--line); }
.done li:last-child { border-bottom: 0; }
.done .note { color: var(--muted); font-size: .95rem; }

footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 0 16px 3rem; }
footer a { color: var(--navy); }

/* ======================================================================
   עמוד שיעור בודד (shiur.html)
   ====================================================================== */
.backlink { margin: 0 0 1.25rem; font-size: .95rem; }
.backlink a { color: var(--muted); text-decoration: none; }
.backlink a:hover { color: var(--navy); text-decoration: underline; }

.solo {
  background: var(--surface);
  border: 1px solid var(--c, var(--line));
  border-inline-start: 6px solid var(--c, var(--navy));
  border-radius: 18px;
  padding: 1.6rem 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
}
.solo-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1.25rem; margin-bottom: 1.5rem;
}
.solo-when {
  margin: 0 0 .3rem; font-family: var(--head); font-weight: 700;
  font-size: 1.15rem; color: var(--c, var(--navy)); unicode-bidi: isolate;
}
.solo-title {
  margin: 0; font-family: var(--head); font-weight: 700; line-height: 1.15;
  font-size: clamp(1.5rem, 5.6vw, 2.15rem);
}
.solo-start {
  display: inline-block; margin: .85rem 0 0; padding: .35rem 1rem;
  background: #FBF5E7; border: 1px solid #E6D6A8;
  border-radius: 999px; font-weight: 700; color: var(--ink); font-size: 1.02rem;
}
.solo-logo { width: 92px; height: 92px; border-radius: 50%; flex: none; display: block; }
.solo-logo-wide { width: 104px; height: auto; border-radius: 8px; }

/* תמונות המעבירים, בגדול */
.solo-people {
  display: flex; flex-wrap: wrap; gap: 1.5rem 2rem;
  margin: 0 0 1.5rem;
}
.person { margin: 0; width: 148px; text-align: center; }
.person img {
  width: 148px; height: 148px; border-radius: 50%; object-fit: cover; display: block;
  background: var(--tint, #EEE); border: 3px solid var(--c, var(--line));
}
.person figcaption {
  margin-top: .6rem; font-weight: 600; font-size: .98rem; line-height: 1.3;
}
/* כשיש נוסח חופשי לשורת המעבירים, השמות שמתחת לתמונות מיותרים */
.solo-people.has-by { margin-bottom: .9rem; }
.solo-people.has-by figcaption { display: none; }
.solo-by {
  margin: 0 0 1.5rem; font-weight: 600; font-size: 1.05rem; color: var(--ink);
}

.solo-people.many { gap: 1.25rem 1.5rem; }
.solo-people.many .person, .solo-people.many .person img { width: 116px; }
.solo-people.many .person img { height: 116px; }
.person.no-photo img { display: none; }

.solo-about { font-size: 1.03rem; max-width: 64ch; }
.solo-about .about-lead { display: block; margin-bottom: .4rem; }
.solo-about .sched-row { padding: .5rem 0; }

@media (max-width: 560px) {
  .solo { padding: 1.3rem 1.1rem 1.5rem; }
  .solo-head { gap: .9rem; }
  .solo-logo { width: 64px; height: 64px; }
  .solo-logo-wide { width: 76px; height: auto; }
  .solo-people { gap: 1.1rem 1.4rem; }
  .person, .person img { width: 108px; }
  .person img { height: 108px; }
  .solo-people.many .person, .solo-people.many .person img { width: 92px; }
  .solo-people.many .person img { height: 92px; }
}

/* שורת הפעולות בתחתית הכרטיס */
.more {
  margin: 0; border-top: 1px dashed var(--line);
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem;
  padding: .7rem 1.2rem .85rem;
}
.more a.page-link {
  font-size: .93rem; font-weight: 600; color: var(--c); text-decoration: none;
}
.more a.page-link:hover { text-decoration: underline; }

/* כפתור הצטרפות לקבוצת הוואטסאפ */
.wa {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .9rem; font-weight: 600; text-decoration: none;
  padding: .4rem .95rem; border-radius: 999px;
  color: #11705A; background: #E4F3EC; border: 1px solid #BFE3D3;
}
.wa:hover { background: #D6EDE2; }
.wa svg { width: 15px; height: 15px; flex: none; fill: currentColor; }
.wa-big {
  font-size: 1rem; padding: .7rem 1.4rem; margin-top: 1rem;
}

/* ---------- מודעת הפרסום בתחתית העמוד ---------- */
.poster {
  margin: 2.5rem auto 0;
  max-width: 560px;
}
.poster a {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 22px rgba(16, 32, 52, .16);
}
.poster img {
  display: block;
  width: 100%;
  height: auto;
}
.poster figcaption {
  margin-top: .6rem;
  text-align: center;
  font-size: .85rem;
  color: var(--muted);
}
