/* ===================================================================
   אתר הנצחה — גלעד (גילי) אלבז ז"ל
   עיצוב: נייר חם, דיו כהה, זהב עדין. RTL, מותאם נייד.
   =================================================================== */

:root {
  --paper: #faf7f0;
  --paper-deep: #f3eee2;
  --card: #fffdf8;
  --ink: #2e2a26;
  --ink-soft: #5a534b;
  --gold: #a8894e;
  --gold-soft: #c9b183;
  --line: #e4dcc9;
  --shadow: 0 2px 14px rgba(62, 50, 30, 0.10);
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Assistant', -apple-system, sans-serif;
  background: var(--paper);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(200, 178, 131, 0.10), transparent 55%),
    radial-gradient(ellipse at 85% 100%, rgba(200, 178, 131, 0.08), transparent 50%);
  color: var(--ink);
  line-height: 1.75;
  font-size: 1.06rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, .serif {
  font-family: 'Frank Ruhl Libre', serif;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.35;
}

a { color: var(--gold); }

img { max-width: 100%; display: block; }

.container { width: min(1060px, 92%); margin: 0 auto; }

/* ---------- כותרת עליונה ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(250, 247, 240, 0.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.masthead {
  text-align: center;
  padding: 1.1rem 1rem 0.4rem;
}

.masthead a { text-decoration: none; }

.masthead .name {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: clamp(1.35rem, 3.5vw, 1.8rem);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.masthead .dates {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-top: 0.05rem;
}

.site-nav {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 0.25rem;
  padding: 0.35rem 0.75rem 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.site-nav::-webkit-scrollbar { display: none; }

/* מרכוז בטוח שמשאיר את כל הפריטים נגישים בגלילה במסכים צרים */
.site-nav a:first-child { margin-inline-start: auto; }
.site-nav a:last-child { margin-inline-end: auto; }

.site-nav a {
  white-space: nowrap;
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.45rem 0.85rem 0.6rem;
  border-bottom: 2.5px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.site-nav a:hover { color: var(--ink); }

.site-nav a.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* ---------- תוכן ---------- */

main { flex: 1; padding: 2.4rem 0 3.5rem; }

.page-title {
  text-align: center;
  font-size: clamp(1.7rem, 4.5vw, 2.4rem);
  margin-bottom: 0.4rem;
}

.page-sub {
  text-align: center;
  color: var(--ink-soft);
  max-width: 46em;
  margin: 0 auto 2.2rem;
}

.ornament {
  text-align: center;
  color: var(--gold-soft);
  font-size: 1.2rem;
  letter-spacing: 0.6em;
  margin: 0.4rem 0 1.8rem;
  user-select: none;
}

section { margin-bottom: 3rem; }

/* ---------- עמוד הבית ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(230px, 330px) 1fr;
  gap: 2.5rem;
  align-items: center;
  margin-bottom: 2.8rem;
}

.hero-portrait {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 6px solid #fff;
  transform: rotate(-1.2deg);
}

.hero-text h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
}

.hero-text .lifespan {
  color: var(--gold);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0.3rem 0 1.1rem;
}

.hero-text .lead {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 34em;
}

.prose {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.4rem, 4vw, 2.6rem);
}

.prose p { margin-bottom: 1.1rem; }
.prose p:last-child { margin-bottom: 0; }

.inline-photo {
  float: left;
  width: min(260px, 42%);
  margin: 0.4rem 0 1rem 1.4rem;
  border-radius: 10px;
  border: 5px solid #fff;
  box-shadow: var(--shadow);
}

.quote {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 1.25rem;
  text-align: center;
  color: var(--ink-soft);
  max-width: 34em;
  margin: 2.6rem auto 0;
  padding: 0 1rem;
}
.quote .by { display: block; font-size: 0.9rem; color: var(--gold); margin-top: 0.5rem; }

/* ---------- כרטיסי ניווט בעמוד הבית ---------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-top: 2.4rem;
}

.tile {
  display: block;
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.tile:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(62, 50, 30, 0.16); }

.tile h3 { font-size: 1.2rem; color: var(--gold); margin-bottom: 0.25rem; }
.tile p { color: var(--ink-soft); font-size: 0.95rem; line-height: 1.55; }

/* ---------- גלריה ---------- */

.photo-grid {
  columns: 4 230px;
  column-gap: 0.8rem;
}

.photo-grid a {
  display: block;
  margin-bottom: 0.8rem;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  break-inside: avoid;
  background: var(--paper-deep);
}

.photo-grid img {
  width: 100%;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.photo-grid a:hover img { transform: scale(1.03); filter: brightness(1.05); }

.video-wrap {
  max-width: 720px;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #000;
}

.video-wrap video { width: 100%; display: block; }

/* ---------- כתביו — שירים ---------- */

.poems-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.2rem;
  align-items: start;
}

.poem {
  background:
    linear-gradient(rgba(255, 253, 246, 0.55), rgba(255, 253, 246, 0.55)),
    repeating-linear-gradient(0deg, #fbf6e8 0 3px, #f7f1df 3px 4px);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 1.6rem 1.5rem 1.2rem;
  position: relative;
}

.poem::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(var(--gold-soft), transparent);
  border-radius: 8px 0 0 8px;
}

.poem h3 {
  font-family: 'Miriam Libre', 'Frank Ruhl Libre', serif;
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 0.8rem;
  color: #4a4033;
}

.poem pre {
  font-family: 'Miriam Libre', monospace;
  font-size: 1.02rem;
  line-height: 1.9;
  white-space: pre-wrap;
  color: #3c362e;
}

.poem .hw-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.88rem;
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px dashed var(--gold-soft);
}

.poem .hw-link:hover { color: var(--ink); }

.hw-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.9rem;
}

.hw-gallery a {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* ---------- ספרים ---------- */

.books-list { display: grid; gap: 1.3rem; }

.book {
  display: grid;
  grid-template-columns: minmax(120px, 170px) 1fr;
  gap: 1.4rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.3rem;
  align-items: center;
}

.book.wide { grid-template-columns: 1fr; }
.book.wide img { max-width: 640px; margin: 0 auto; }

.book img { border-radius: 8px; box-shadow: 0 2px 10px rgba(62, 50, 30, 0.18); }

.book h3 { font-size: 1.25rem; margin-bottom: 0.35rem; }
.book .byline { color: var(--gold); font-size: 0.92rem; font-weight: 600; margin-bottom: 0.5rem; }
.book p { color: var(--ink-soft); font-size: 1rem; }

/* ---------- מוסיקה ---------- */

.music-embed {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-top: 1rem;
}

.music-embed iframe { display: block; width: 100%; border: 0; }

.artists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.artist {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
}

.artist h3 { font-size: 1.1rem; margin-bottom: 0.2rem; }
.artist h3 a { color: var(--ink); text-decoration: none; border-bottom: 1px dashed var(--gold-soft); }
.artist h3 a:hover { color: var(--gold); }
.artist p { font-size: 0.93rem; color: var(--ink-soft); line-height: 1.6; }

.note-box {
  background: var(--paper-deep);
  border: 1px dashed var(--gold-soft);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

/* ---------- הסתלקותו ---------- */

.eulogy {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.5rem, 4vw, 2.8rem);
  max-width: 760px;
  margin: 0 auto;
}

.eulogy h3 { font-size: 1.4rem; margin-bottom: 1.2rem; text-align: center; }

.eulogy p { margin-bottom: 1rem; }

.eulogy .sig { text-align: left; color: var(--ink-soft); font-style: italic; }

.eulogy blockquote {
  font-family: 'Frank Ruhl Libre', serif;
  border-inline-start: 3px solid var(--gold-soft);
  padding-inline-start: 1.2rem;
  margin: 1.4rem 0;
  color: var(--ink-soft);
  font-size: 1.15rem;
}

.candle-line {
  text-align: center;
  font-size: 1.6rem;
  margin: 2.2rem 0 0.6rem;
}

/* ---------- פוטר ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--paper-deep);
  text-align: center;
  padding: 1.6rem 1rem 2rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.site-footer .memorial {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 1.1rem;
  color: var(--ink);
  margin-bottom: 0.2rem;
}

/* ---------- לייטבוקס ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 10, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 2.5rem 1rem 1rem;
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: 100%;
  max-height: 92vh;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

.lightbox .lb-close,
.lightbox .lb-prev,
.lightbox .lb-next {
  position: fixed;
  background: none;
  border: none;
  color: #f3ead6;
  font-size: 2.1rem;
  cursor: pointer;
  padding: 0.4rem 0.9rem;
  line-height: 1;
  opacity: 0.85;
}

.lightbox button:hover { opacity: 1; }

.lb-close { top: 0.5rem; inset-inline-end: 0.6rem; }
.lb-prev { inset-inline-start: 0.3rem; top: 50%; transform: translateY(-50%); }
.lb-next { inset-inline-end: 0.3rem; top: 50%; transform: translateY(-50%); }

.lb-caption {
  position: fixed;
  bottom: 0.8rem;
  inset-inline: 0;
  text-align: center;
  color: #d8cdb4;
  font-size: 0.95rem;
}

/* ---------- כפתור נעימת הרקע ---------- */

.music-toggle {
  position: fixed;
  bottom: 1.1rem;
  inset-inline-start: 1.1rem;
  z-index: 90;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--gold-soft);
  background: var(--card);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 14px rgba(62, 50, 30, 0.22);
  transition: transform 0.15s ease;
}

.music-toggle:not(.playing) { color: var(--ink-soft); }

.music-toggle:hover { transform: scale(1.07); }

@media (prefers-reduced-motion: no-preference) {
  .music-toggle.playing { animation: music-pulse 2.4s ease-in-out infinite; }
  @keyframes music-pulse {
    0%, 100% { box-shadow: 0 3px 14px rgba(62, 50, 30, 0.22); }
    50% { box-shadow: 0 3px 22px rgba(168, 137, 78, 0.55); }
  }
}

/* ---------- אנימציית הופעה עדינה ---------- */

@media (prefers-reduced-motion: no-preference) {
  .fade-in {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.7s ease, transform 0.7s ease;
  }
  .fade-in.visible { opacity: 1; transform: none; }
}

/* ---------- נייד ---------- */

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero-portrait { margin: 0 auto; max-width: 280px; }
  .hero-text .lead { margin: 0 auto; }
  .inline-photo { float: none; width: 70%; margin: 0.5rem auto 1.2rem; }
  .book { grid-template-columns: 100px 1fr; align-items: start; }
  main { padding-top: 1.6rem; }
}
