/* =========================================================
   ברכת הבית לאורנית וגיא — עיצוב
   מובייל-פירסט, עברית RTL, אלגנטי-מודרני
   ========================================================= */

:root{
  --ivory:     #F6F3ED;
  --ivory-2:   #EFE9DF;
  --ivory-3:   #E7DFD2;
  --ink:       #17161A;
  --ink-2:     #221F26;
  --ink-soft:  #4A4550;
  --muted:     #857D74;
  --gold:      #B08D3F;
  --gold-lite: #E3CB92;
  --gold-deep: #8C6E2A;
  --sage:      #8C9A8B;
  --line:      rgba(23,22,26,.12);
  --line-gold: rgba(176,141,63,.34);
  --shadow-s:  0 1px 3px rgba(30,24,14,.06), 0 6px 18px rgba(30,24,14,.05);
  --shadow-m:  0 12px 34px rgba(30,24,14,.10);
  --shadow-l:  0 26px 64px rgba(30,24,14,.18);
  --radius:    4px;
  --serif:     'Frank Ruhl Libre', 'Times New Roman', Georgia, serif;
  --sans:      'Heebo', 'Segoe UI', Arial, sans-serif;
  --hand:      'Amatic SC', 'Frank Ruhl Libre', cursive;
  --maxw:      1120px;
  --tap:       46px;              /* יעד נגיעה מינימלי */
}

*,*::before,*::after{ box-sizing:border-box; }

html{ -webkit-text-size-adjust:100%; scroll-behavior:smooth; }

body{
  margin:0;
  background:var(--ivory);
  color:var(--ink);
  font-family:var(--sans);
  font-size:17px;
  font-weight:300;
  line-height:1.8;
  overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
}

img{ max-width:100%; display:block; }
h1,h2,h3{ font-family:var(--serif); font-weight:400; margin:0; line-height:1.22; }
p{ margin:0 0 1em; }

::selection{ background:var(--gold-lite); color:var(--ink); }
:focus-visible{ outline:2px solid var(--gold); outline-offset:3px; border-radius:3px; }

/* קו זהב דק — חוזר בכל הדף */
.rule{
  width:64px; height:1px; margin:1.6rem auto;
  background:linear-gradient(90deg,transparent,var(--gold),transparent);
}
.rule--hero{ width:88px; margin:1.9rem auto 1.5rem; }
.rule--gold{ width:110px; }

/* ---------- ניצוצות ---------- */
#confetti{
  position:fixed; inset:0; width:100%; height:100%;
  pointer-events:none; z-index:60;
}

/* =========================================================
   פתיח
   ========================================================= */
.hero{
  position:relative;
  min-height:100svh;
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  text-align:center;
  padding:5.5rem 1.5rem 5.5rem;
  overflow:hidden;
  background:
    radial-gradient(115% 70% at 50% 4%, #FFFDF8 0%, var(--ivory) 46%, var(--ivory-2) 100%);
}

.hero__glow{
  position:absolute; inset:auto 50% -34% auto;
  transform:translateX(50%);
  width:min(150vw,980px); aspect-ratio:1;
  background:radial-gradient(circle, rgba(227,203,146,.38) 0%, rgba(227,203,146,0) 63%);
  filter:blur(8px);
  animation:breathe 11s ease-in-out infinite;
}
@keyframes breathe{
  0%,100%{ transform:translateX(50%) scale(1);   opacity:.8; }
  50%    { transform:translateX(50%) scale(1.08); opacity:1; }
}

.hero__inner{ position:relative; z-index:2; max-width:640px; }

.hero__eyebrow{
  font-size:.74rem; font-weight:400;
  letter-spacing:.46em;
  color:var(--gold-deep);
  margin:0 0 2rem;
  padding-inline-start:.46em;
  opacity:0; animation:fadeUp .9s .1s ease forwards;
}

/* סמל הבית */
.crest{
  width:clamp(88px,24vw,118px);
  margin:0 auto 1.9rem;
  cursor:pointer; user-select:none;
  opacity:0; animation:riseIn 1.2s .3s cubic-bezier(.2,.8,.3,1) forwards;
  min-height:var(--tap);
}
.crest svg{
  width:100%; height:auto; display:block;
  transition:transform .5s cubic-bezier(.2,.8,.3,1);
}
.crest:hover svg,.crest:active svg{ transform:translateY(-4px); }

.hero__headline{
  font-size:clamp(2.6rem,11vw,4.4rem);
  font-weight:500;
  letter-spacing:-.015em;
  margin:0;
  opacity:0; animation:fadeUp 1s .55s ease forwards;
}

/* v3 — הסדר בפתיח: כותרת → שורת הנוסח → קו → למי → ילדים → מטא */

/* שורת הפתיחה של נוסח הברכה, ישר מתחת לכותרת */
.hero__sub{
  font-family:var(--serif);
  font-weight:300;
  font-size:clamp(1.12rem,4.7vw,1.5rem);
  line-height:1.9;
  color:var(--ink-soft);
  margin:1.1rem auto 0;
  max-width:30ch;
  opacity:0; animation:fadeUp 1s .7s ease forwards;
}

.rule--hero{ opacity:0; animation:fadeUp 1s .85s ease forwards; }

.hero__forline{
  font-family:var(--serif);
  font-size:clamp(1rem,4.1vw,1.18rem);
  color:var(--ink);
  margin:0;
  opacity:0; animation:fadeUp 1s .95s ease forwards;
}

.hero__names{
  font-family:var(--sans);
  font-weight:300;
  font-size:clamp(.82rem,3.3vw,.94rem);
  letter-spacing:.18em;
  color:var(--muted);
  margin:.55rem 0 1.1rem;
  padding-inline-start:.18em;
  opacity:0; animation:fadeUp 1s 1.05s ease forwards;
}

.hero__meta{
  font-size:.78rem; letter-spacing:.14em;
  color:var(--muted);
  margin:0;
  opacity:0; animation:fadeUp 1s 1.2s ease forwards;
}

.hero__scroll{
  position:absolute; bottom:1.9rem; inset-inline:0;
  display:flex; flex-direction:column; align-items:center; gap:.5rem;
  font-size:.68rem; letter-spacing:.26em; color:var(--muted);
  opacity:0; animation:fadeUp 1s 1.5s ease forwards;
}
/* חץ למטה — מאפיינים פיזיים בכוונה, כדי שיצביע למטה גם ב-RTL */
.chev{
  width:9px; height:9px;
  border-right:1px solid var(--gold);
  border-bottom:1px solid var(--gold);
  transform:rotate(45deg);
  animation:nudge 2.1s ease-in-out infinite;
}
@keyframes nudge{
  0%,100%{ transform:rotate(45deg) translate(0,0); opacity:.45; }
  50%    { transform:rotate(45deg) translate(3px,3px); opacity:1; }
}

@keyframes fadeUp{ from{ opacity:0; transform:translateY(20px);} to{ opacity:1; transform:none; } }
@keyframes riseIn{ from{ opacity:0; transform:translateY(26px) scale(.94);} to{ opacity:1; transform:none; } }

/* =========================================================
   מבנה כללי
   ========================================================= */
.section{
  max-width:var(--maxw);
  margin-inline:auto;
  padding:5rem 1.4rem;
}
/* סקציה שכל התמונות שלה חסרות מוסתרת מ-JS. חייב !important כדי
   שהמחלקה לא תגבר על תכונת hidden — בדיוק כמו בכפתור המוזיקה. */
.section[hidden]{ display:none !important; }

.sec-head{ text-align:center; margin-bottom:2.8rem; }

.sec-title{
  font-size:clamp(1.75rem,6.4vw,2.6rem);
  font-weight:400;
  letter-spacing:-.01em;
  position:relative;
  display:inline-block;
  padding-bottom:.75rem;
}
.sec-title::after{
  content:''; position:absolute; bottom:0; inset-inline:50% auto;
  transform:translateX(50%);
  width:46px; height:1px;
  background:linear-gradient(90deg,transparent,var(--gold),transparent);
}
.sec-sub{
  color:var(--muted);
  font-size:.94rem;
  letter-spacing:.04em;
  margin:.7rem 0 0;
}

/* ---------- מכתב ---------- */
.section--letter{ padding-top:3.6rem; padding-bottom:3.6rem; }

.letter{
  max-width:640px;
  margin-inline:auto;
  background:#FFFDF9;
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow-s);
  padding:2.6rem 1.7rem 2.3rem;
  position:relative;
}
.letter::before{
  content:''; position:absolute; inset:7px;
  border:1px solid var(--line-gold);
  border-radius:2px;
  pointer-events:none;
}
.letter__greeting{
  font-family:var(--serif);
  font-size:clamp(1.35rem,5.4vw,1.7rem);
  margin:0 0 1.2rem;
}
.letter p{
  color:var(--ink-soft);
  font-size:1.02rem;
  line-height:2;
}
.letter p:last-child{ margin-bottom:0; }

/* =========================================================
   ברכת הבית — הסקציה הכהה, לב הדף
   ========================================================= */
.blessing{
  background:
    radial-gradient(120% 90% at 50% 0%, #2A2632 0%, var(--ink) 62%),
    var(--ink);
  color:var(--ivory);
  padding:5.5rem 1.4rem;
  position:relative;
}
.blessing::before,
.blessing::after{
  content:''; position:absolute; inset-inline:0; height:1px;
  background:linear-gradient(90deg,transparent,var(--gold),transparent);
  opacity:.55;
}
.blessing::before{ top:0; }
.blessing::after{ bottom:0; }

.blessing__card{
  max-width:640px;
  margin-inline:auto;
  text-align:center;
  padding:2.8rem 1.5rem;
  border:1px solid rgba(227,203,146,.26);
  border-radius:var(--radius);
  position:relative;
}
.blessing__card::before{
  content:''; position:absolute; inset:8px;
  border:1px solid rgba(227,203,146,.13);
  border-radius:2px;
  pointer-events:none;
}

.blessing__seal{
  font-size:.68rem; letter-spacing:.42em;
  color:var(--gold-lite);
  opacity:.8;
  margin:0 0 1.2rem;
  padding-inline-start:.42em;
}

.blessing__title{
  font-size:clamp(1.9rem,7.6vw,2.9rem);
  font-weight:500;
  color:#EBD7A4;
  margin:0;
}

.blessing .rule--gold{ margin:1.5rem auto 2rem; }

.blessing__lines p,
.blessing__extra p{
  font-family:var(--serif);
  font-weight:300;
  font-size:clamp(1.05rem,4.6vw,1.42rem);
  line-height:2.15;
  color:#F2EDE2;
  margin:0 0 .35rem;
}
.blessing__extra{
  margin-top:1.7rem;
  padding-top:1.6rem;
  border-top:1px solid rgba(227,203,146,.16);
}
.blessing__extra p{ color:var(--gold-lite); }

/* בלי letter-spacing — הוא מנתק את הניקוד מהאותיות */
.blessing__amen{
  font-family:var(--serif);
  font-size:1.15rem;
  color:var(--gold-lite);
  opacity:.85;
  margin:2rem 0 0;
}

/* ---------- גלריה ---------- */
.grid{
  display:grid;
  grid-template-columns:1fr;
  gap:1.8rem;
}
@media (min-width:640px){ .grid{ grid-template-columns:repeat(2,1fr); gap:2rem; } }
@media (min-width:980px){ .grid{ grid-template-columns:repeat(3,1fr); } }

.card{ margin:0; }

/* מסגרות ישרות ונקיות — בלי הטיות */
.frame{
  position:relative;
  background:#fff;
  padding:9px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow-s);
  overflow:hidden;
  transition:transform .5s cubic-bezier(.2,.8,.3,1), box-shadow .5s ease;
}
.frame:hover{ transform:translateY(-6px); box-shadow:var(--shadow-m); }

.frame__box{
  position:relative;
  aspect-ratio:4/5;
  background:var(--ivory-2);
  border-radius:2px;
  overflow:hidden;
}

.frame__box img{
  position:absolute; inset:0;
  width:100%; height:100%;
  object-fit:cover;
  opacity:0;
  transition:opacity .7s ease, transform 7s ease;
}
.frame__box img.is-loaded{ opacity:1; cursor:zoom-in; }
.frame:hover .frame__box img.is-loaded{ transform:scale(1.04); }

/* מסגרת ריקה — עד שהתמונה האמיתית תועלה */
.ph{
  position:absolute; inset:0;
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  gap:.6rem;
  padding:1rem;
  text-align:center;
  background:
    repeating-linear-gradient(45deg,
      rgba(176,141,63,.045) 0 11px,
      transparent 11px 22px),
    var(--ivory-2);
  border:1px dashed var(--line-gold);
  border-radius:2px;
}
.ph__icon{ font-size:1.5rem; opacity:.45; line-height:1; }
.ph__txt{ font-size:.76rem; color:var(--muted); letter-spacing:.04em; }
.ph__file{
  font-family:ui-monospace,'Courier New',monospace;
  font-size:.7rem;
  direction:ltr;
  color:var(--gold-deep);
  background:rgba(255,255,255,.8);
  padding:.2rem .5rem;
  border-radius:3px;
}

.cap{
  margin:1rem .2rem 0;
  font-size:.9rem;
  font-weight:300;
  color:var(--ink-soft);
  text-align:center;
  line-height:1.65;
  letter-spacing:.02em;
}

/* ---------- כשהם היו קטנים ---------- */
.section--kids{
  max-width:none;
  background:linear-gradient(180deg,var(--ivory) 0%,var(--ivory-3) 24%,var(--ivory-3) 76%,var(--ivory) 100%);
  padding-block:5.2rem;
}
.section--kids > *{ max-width:var(--maxw); margin-inline:auto; }

.polaroids{
  display:grid;
  grid-template-columns:1fr;
  gap:2rem;
  padding-inline:1.4rem;
}
@media (min-width:700px){ .polaroids{ grid-template-columns:repeat(3,1fr); } }

.polaroid{ margin:0; }
.polaroid .frame{ padding:11px 11px 13px; background:#FFFEFB; }
.polaroid .frame__box{ aspect-ratio:1/1; }

.kids-note{
  text-align:center;
  font-family:var(--serif);
  font-size:1.1rem;
  color:var(--ink-soft);
  margin:2.6rem 1.4rem 0;
}

/* ---------- ברכות לבית ---------- */
.wishes{
  list-style:none;
  margin:0; padding:0;
  display:grid;
  grid-template-columns:1fr;
  gap:1rem;
  counter-reset:w;
}
@media (min-width:760px){ .wishes{ grid-template-columns:repeat(2,1fr); gap:1.2rem; } }

.wishes li{
  counter-increment:w;
  position:relative;
  background:#FFFDF9;
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:1.5rem 1.5rem 1.4rem;
  box-shadow:var(--shadow-s);
  transition:transform .4s cubic-bezier(.2,.8,.3,1), box-shadow .4s ease;
}
.wishes li:hover{ transform:translateY(-4px); box-shadow:var(--shadow-m); }
.wishes li::after{
  content:counter(w,decimal-leading-zero);
  position:absolute;
  inset-inline-end:1.3rem; inset-block-start:1.25rem;
  font-family:var(--serif);
  font-size:.82rem;
  letter-spacing:.08em;
  color:var(--gold);
  opacity:.5;
}
.wish__head{
  font-family:var(--serif);
  font-size:1.2rem;
  font-weight:500;
  margin:0 0 .35rem;
  padding-inline-end:2.4rem;
}
.wish__text{
  margin:0;
  font-size:.97rem;
  color:var(--ink-soft);
  line-height:1.8;
}

/* ---------- סיום ---------- */
.section--closing{ padding-block:5rem 3.2rem; text-align:center; }

.closing__lines p{
  font-family:var(--serif);
  font-size:clamp(1.3rem,5.2vw,1.9rem);
  font-weight:400;
  color:var(--ink);
  margin:0 0 .5rem;
  line-height:1.6;
}
.closing__sig{
  font-family:var(--hand);
  font-weight:700;
  font-size:clamp(2.6rem,11vw,3.8rem);
  color:var(--gold-deep);
  line-height:1.25;
  margin:0;
}
.closing__hearts{
  font-family:var(--serif);
  font-size:1.7rem;
  color:var(--gold); opacity:.55;
  margin-top:1.2rem;
}

/* ---------- תחתית ---------- */
.foot{
  border-top:1px solid var(--line);
  padding:2.6rem 1.4rem 3rem;
  text-align:center;
}
.foot__actions{
  display:flex; flex-wrap:wrap;
  gap:.7rem; justify-content:center;
  margin-bottom:1.8rem;
}

.btn{
  appearance:none;
  display:inline-flex; align-items:center; justify-content:center;
  min-height:var(--tap);
  font-family:var(--sans); font-size:.9rem; font-weight:400;
  letter-spacing:.03em;
  border:1px solid var(--gold);
  background:var(--gold); color:#fff;
  border-radius:999px;
  padding:.7rem 1.6rem;
  cursor:pointer;
  text-decoration:none;
  transition:transform .3s cubic-bezier(.2,.8,.3,1), box-shadow .3s ease, background .3s ease;
}
.btn:hover{ transform:translateY(-2px); box-shadow:0 10px 24px rgba(176,141,63,.28); }
.btn--ghost{ background:transparent; color:var(--gold-deep); }
.btn--ghost:hover{ background:rgba(176,141,63,.08); }

.foot__credit{
  font-size:.7rem; color:var(--muted); opacity:.65; margin:0;
}
/* חותמת גרסה — כדי לדעת במבט אחד מה באוויר */
.foot__ver{
  font-family:ui-monospace,'Courier New',monospace;
  font-size:.62rem; letter-spacing:.14em;
  color:var(--gold); opacity:.5;
  margin:.5rem 0 0;
}

/* ---------- כפתור מוזיקה ---------- */
.music{
  position:fixed;
  inset-block-end:1rem; inset-inline-start:1rem;
  z-index:50;
  display:inline-flex; align-items:center; gap:.55rem;
  min-height:var(--tap);
  background:rgba(255,253,249,.92);
  backdrop-filter:blur(10px);
  border:1px solid var(--line);
  border-radius:999px;
  padding:.6rem 1.1rem;
  font-family:var(--sans); font-size:.8rem; font-weight:400;
  color:var(--ink-soft);
  cursor:pointer;
  box-shadow:var(--shadow-s);
}
/* חייב לגבור על display:inline-flex כשאין קובץ מוזיקה */
.music[hidden]{ display:none !important; }
.music__icon{
  width:12px; height:12px;
  border-radius:50%;
  background:var(--muted);
  transition:background .3s ease, box-shadow .3s ease;
}
.music.is-on .music__icon{
  background:var(--sage);
  box-shadow:0 0 0 4px rgba(140,154,139,.22);
  animation:pulse 2s ease-in-out infinite;
}
@keyframes pulse{ 0%,100%{ box-shadow:0 0 0 3px rgba(140,154,139,.2);} 50%{ box-shadow:0 0 0 7px rgba(140,154,139,.07);} }

/* ---------- לייטבוקס ---------- */
.lb{
  position:fixed; inset:0; z-index:80;
  background:rgba(15,14,17,.95);
  display:flex; align-items:center; justify-content:center;
  padding:4rem 1rem;
  animation:lbIn .28s ease;
}
@keyframes lbIn{ from{opacity:0} to{opacity:1} }
.lb[hidden]{ display:none; }

.lb__fig{ margin:0; max-width:100%; max-height:100%; text-align:center; }
.lb__fig img{
  max-width:100%; max-height:76svh;
  margin-inline:auto;
  border-radius:3px;
  box-shadow:0 30px 70px rgba(0,0,0,.55);
}
.lb__fig figcaption{
  color:#EFE7DA; font-size:.95rem; margin-top:1.1rem; padding-inline:1rem;
}

.lb__close,.lb__nav{
  position:absolute;
  background:rgba(255,255,255,.09);
  border:1px solid rgba(255,255,255,.18);
  color:#fff;
  width:48px; height:48px;
  border-radius:50%;
  font-size:1.5rem; line-height:1;
  display:grid; place-items:center;
  cursor:pointer;
  transition:background .25s ease;
}
.lb__close:hover,.lb__nav:hover{ background:rgba(255,255,255,.2); }
.lb__close{ inset-block-start:1rem; inset-inline-end:1rem; font-size:1.9rem; }
.lb__nav{ inset-block-start:50%; transform:translateY(-50%); font-size:0; }

/* חץ מצויר בגבולות פיזיים — לא בתו טקסט. תווי הזווית מסומנים
   כ-mirrored ב-Unicode והדפדפן הופך אותם ב-RTL. */
.lb__nav::before{
  content:'';
  width:11px; height:11px;
  border-top:1.5px solid #fff;
  border-right:1.5px solid #fff;
}
/* RTL: "הקודם" יושב בימין ומצביע ימינה, "הבא" בשמאל ומצביע שמאלה */
.lb__nav--prev{ inset-inline-start:.8rem; }
.lb__nav--prev::before{ transform:rotate(45deg);   margin-left:-3px; }
.lb__nav--next{ inset-inline-end:.8rem; }
.lb__nav--next::before{ transform:rotate(-135deg); margin-right:-3px; }
@media (max-width:520px){
  .lb__nav{ inset-block-start:auto; inset-block-end:1rem; transform:none; }
}

/* ---------- אנימציית חשיפה בגלילה ---------- */
.reveal{ opacity:0; transform:translateY(28px); }
.reveal.is-in{
  opacity:1; transform:none;
  transition:opacity .9s ease, transform .9s cubic-bezier(.2,.8,.3,1);
}

/* ---------- העדפת תנועה מופחתת ---------- */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{
    animation-duration:.001ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.001ms !important;
    scroll-behavior:auto !important;
  }
  .reveal{ opacity:1; transform:none; }
  .hero__eyebrow,.crest,.hero__headline,.hero__sub,.rule--hero,
  .hero__forline,.hero__names,
  .hero__meta,.hero__scroll{ opacity:1; }
}

/* =========================================================
   הדפסה / שמירה כ-PDF של דף הברכה המלא
   (הגרסה למסגור היא קובץ נפרד: print.html)
   ========================================================= */
@media print{
  @page{ size:A4; margin:14mm; }

  html,body{ background:#fff !important; font-size:11.5pt; color:#000; }
  .no-print,#confetti,.hero__scroll,.hero__glow{ display:none !important; }

  .reveal{ opacity:1 !important; transform:none !important; }
  *{ animation:none !important; transition:none !important; }
  /* בלי זה הפתיח יוצא ריק בהדפסה — האטימות ההתחלתית שלו היא 0
     והיא מתוקנת רק ע"י אנימציה, שכיביתי כאן */
  .hero__eyebrow,.crest,.hero__headline,.hero__sub,.rule--hero,
  .hero__forline,.hero__names,
  .hero__meta{ opacity:1 !important; }

  .hero{
    min-height:auto;
    padding:0 0 10mm;
    background:#fff !important;
    break-after:avoid;
  }
  .crest{ width:70px; }

  .section{ padding:6mm 0; max-width:none; }
  .section--kids{ background:#fff !important; }

  /* הסקציה הכהה — נשמרת כהה גם בהדפסה, זה הלב של הדף */
  .blessing{
    background:var(--ink) !important;
    -webkit-print-color-adjust:exact; print-color-adjust:exact;
    padding:10mm 6mm;
    break-inside:avoid;
  }
  .blessing__title{ color:#EBD7A4 !important; -webkit-text-fill-color:#EBD7A4; }

  .sec-head,.letter,.card,.polaroid,.wishes li,.closing,.blessing__card{ break-inside:avoid; }
  .letter{ box-shadow:none; }

  .grid{ grid-template-columns:repeat(2,1fr); gap:8mm; }
  .polaroids{ grid-template-columns:repeat(3,1fr); gap:6mm; padding:0; }
  .wishes{ grid-template-columns:repeat(2,1fr); gap:5mm; }

  .frame,.wishes li{ box-shadow:none !important; transform:none !important; }
  .frame__box img{ opacity:1 !important; }
  .ph{ border-style:solid; }

  .foot{ border:none; padding-top:8mm; }
}
