/* אתר הנצחה למיכל מורחי ז"ל - colors and fonts taken from the original Elementor site */
:root {
    --ink: #334155;          /* text + dark bands */
    --ink-strong: #1e293b;
    --nav: #324a6d;
    --muted: #64748b;
    --band: #334155;
    --paper: #ffffff;
    --soft: #f6f6f6;         /* candle card */
    --footer: #f2f2f2;
    --flame: #d54500;
    --glow: rgba(255, 0, 0, .45);
    --font-head: "Heebo", system-ui, sans-serif;
    --font-text: "Rubik", system-ui, sans-serif;
    --wrap: 1200px;
    --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font: 400 16px/1.65 var(--font-text);
    color: var(--ink);
    background: var(--paper);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); }
a:hover { color: var(--nav); }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.3; margin: 0 0 .5em; color: var(--ink); }
p { margin: 0 0 1em; }
.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -.125em; flex: none; }
:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }

.sr-only {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; top: -40px; right: 8px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 200; border-radius: 0 0 6px 6px; }
.skip-link:focus { top: 0; }

/* ---------- header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 95;
    background: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, .5);
    text-align: center;
    padding: 8px 16px 6px;
}
.site-title { font: 600 clamp(22px, 4vw, 32px)/1.3 var(--font-head); }
.site-title a { color: var(--ink); text-decoration: none; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; }
.main-nav li + li::before { content: ""; display: inline-block; width: 2px; height: 15px; background: var(--nav); vertical-align: middle; margin: 0 14px; }
.main-nav a { display: inline-block; padding: 5px 0; font-size: 14px; line-height: 1; color: var(--ink-strong); text-decoration: none; border-bottom: 1px solid transparent; }
.main-nav a:hover, .main-nav a[aria-current] { color: var(--nav); border-bottom-color: var(--nav); }

/* ---------- page title ---------- */
.page-title { background: var(--band); color: #fff; text-align: center; padding: 22px 16px; }
.page-title h1, .page-title-text { color: #fff; font: 600 clamp(28px, 5vw, 40px)/1.4 var(--font-head); margin: 0; }
.hero + .page-title { background: none; padding-top: 50px; }
.hero + .page-title h1 { color: var(--ink); }

/* ---------- hero (home) ---------- */
.hero { background: var(--band); color: #fff; padding: 0 16px; }
.hero-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 40px; padding: 0 0; }
.hero-photo { flex: 0 0 auto; width: min(460px, 45%); }
.hero-photo img { width: 100%; }
.hero-text { flex: 1; text-align: right; padding: 30px 0; }
.hero-name { font: 600 40px/1.4 var(--font-head); margin: 0 0 24px; }
.hero-years { font: 400 50px/1.26 var(--font-text); margin: 0; }

/* ---------- story ---------- */
.story { max-width: 1100px; margin: 0 auto; padding: 40px 16px 60px; }
.story-row { display: flex; gap: 48px; align-items: center; margin-bottom: 56px; }
.story-row-alt { flex-direction: row-reverse; }
.story-text { flex: 1; }
.story-text h2 { font-size: 32px; }
.story-text h3 { font-size: 24px; margin-bottom: 1em; }
.story-photo { flex: 1; }
.story-row-alt .story-photo img { width: 80%; }

/* ---------- bands + section titles ---------- */
.band { padding: 50px 16px; }
.band-dark { background: var(--band); }
.band-dark .section-title, .band-dark .section-links a { color: #fff; }
.section-title { text-align: center; font-size: clamp(26px, 4.5vw, 32px); margin-bottom: 30px; }
.section-links { max-width: var(--wrap); margin: 24px auto 0; text-align: right; font: 600 15px var(--font-head); }
.section-links a { text-decoration: underline; }
main > .section-links { text-align: center; margin: 30px auto 50px; padding: 0 16px; }

/* ---------- carousel ---------- */
.carousel { position: relative; max-width: var(--wrap); margin: 0 auto; }
.carousel-track {
    display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory;
    padding: 70px 4px 20px; scrollbar-width: none; overscroll-behavior-x: contain;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-slide { flex: 0 0 calc((100% - 40px) / 3); scroll-snap-align: start; display: flex; position: relative; }
.carousel-slide > * { flex: 1; }
.carousel-btn {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
    width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
    background: transparent; color: var(--ink); font-size: 28px; line-height: 0;
}
.band-dark .carousel-btn { color: #fff; }
.carousel-btn:disabled { opacity: .25; cursor: default; }
.carousel-btn .icon { width: 28px; height: 28px; }
.carousel-prev { right: -46px; }
.carousel-next { left: -46px; }
.carousel-eulogies .carousel-track { padding-top: 10px; }

/* ---------- candle card ---------- */
.candle-card {
    position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
    background: var(--soft); border-radius: var(--radius); box-shadow: 0 -3px 10px var(--glow);
    padding: 40px 14px 24px; margin-top: 50px; color: var(--ink); text-decoration: none;
}
a.candle-card:hover { box-shadow: 0 -3px 16px rgba(255, 0, 0, .65); color: var(--ink); }
.candle-flame { position: absolute; top: -56px; left: 50%; transform: translateX(-50%); color: var(--flame); font-size: 80px; line-height: 1; }
.candle-flame .icon { width: 60px; height: 80px; }
.candle-text { font: 600 24px/1.35 var(--font-head); margin: 0 0 14px; white-space: normal; overflow-wrap: anywhere; }
.candle-name { font: 400 17px var(--font-head); margin: auto 0 4px; }
.candle-date { font: 400 13px var(--font-head); color: var(--muted); margin: 0; }
.carousel-candles .candle-card { margin-top: 0; }
.carousel-candles .candle-text { display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }

/* candles page */
.candles-layout { max-width: 1280px; margin: 40px auto 60px; padding: 0 16px; display: flex; gap: 60px; align-items: flex-start; }
.candles-aside { flex: 0 0 30%; position: sticky; top: 110px; }
.candles-grid { flex: 1; display: grid; grid-template-columns: repeat(2, 1fr); gap: 50px 40px; padding-top: 20px; align-items: start; }

.candle-single { max-width: 340px; margin: 70px auto 20px; padding: 0 16px; }

/* ---------- eulogy card ---------- */
.eulogy-card {
    display: flex; flex-direction: column; background: var(--footer); border-radius: 16px;
    padding: 16px 16px 20px; height: 100%;
}
.eulogy-img img { width: 100%; height: 145px; object-fit: cover; object-position: center 25%; border-radius: 4px; transition: filter .3s; }
.eulogy-img:hover img { filter: brightness(1.05) saturate(1.05); }
.eulogy-author { font: 500 16px var(--font-head); margin: 16px 0 6px; display: flex; gap: 6px; align-items: center; }
.eulogy-author a { text-decoration: none; }
.eulogy-meta { font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 12px; padding-bottom: 14px; border-bottom: 1px solid #555; }
.eulogy-meta span { display: inline-flex; gap: 6px; align-items: center; }
.eulogy-summary { font-size: 14px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; margin: 0 0 12px; }
.read-more { margin-top: auto; font: 700 13px var(--font-head); text-decoration: none; color: var(--ink-strong); }
.greg { white-space: nowrap; }

.eulogies-grid { max-width: var(--wrap); margin: 40px auto 60px; padding: 0 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

/* ---------- single eulogy ---------- */
.eulogy-layout { max-width: 1200px; margin: 40px auto 30px; padding: 0 16px; display: flex; gap: 40px; align-items: flex-start; }
.eulogy-main { flex: 0 0 65%; min-width: 0; }
.eulogy-figure { margin: 0 0 30px; }
.eulogy-figure img { max-height: 350px; width: auto; margin: 0 auto; }
.eulogy-body { color: #4a4a4a; font-size: 16px; }
.eulogy-date { color: #4a4a4a; font-size: 14px; margin-top: 20px; }
.eulogy-aside { flex: 1; min-width: 0; position: sticky; top: 110px; }
.share-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; }
.share-row h2 { font-size: 20px; color: #16163f; margin: 0; }
.share-inline { list-style: none; margin: 0; padding: 0; display: flex; gap: 20px; }
.share-inline a { color: var(--ink); font-size: 18px; }
.share-inline a:hover { color: #d3b574; }
.more-title { font-size: 18px; color: #16163f; }
.more-list { list-style: none; margin: 0; padding: 0; }
.more-list li { display: flex; gap: 18px; margin-bottom: 26px; }
.more-img { flex: 0 0 30%; }
.more-img img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.more-list h3 { font-size: 16px; color: #4a4a4a; margin-bottom: 4px; }
.more-list h3 a { text-decoration: none; }
.more-list p { font-size: 13px; color: #4a4a4a; margin: 0 0 4px; }

.post-nav { max-width: 1200px; margin: 0 auto; padding: 20px 16px; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid #e5e7eb; }
.post-nav a { text-decoration: none; color: #54595f; display: flex; flex-direction: column; font-size: 15px; }
.post-nav a span { color: var(--ink); font: 600 14px var(--font-head); }
.post-nav-next { text-align: left; }

.comments { max-width: 600px; margin: 0 auto 60px; padding: 0 16px; }
.comments h2 { text-align: center; }
.comments ol { list-style: none; margin: 0; padding: 0; }
.comment { border-bottom: 1px solid #e5e7eb; padding: 18px 0; }
.comment-author { font: 600 16px var(--font-head); margin: 0; }
.comment-date { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.comment-text { font-size: 15px; }

/* ---------- gallery ---------- */
.gallery { max-width: var(--wrap); margin: 40px auto 60px; padding: 0 16px; columns: 3 260px; column-gap: 12px; }
.gallery.masonry { columns: auto; display: flex; gap: 12px; align-items: flex-start; }
.gallery-col { flex: 1; min-width: 0; }
.gallery-item { display: block; margin-bottom: 12px; overflow: hidden; break-inside: avoid; border-radius: 2px; }
.gallery-item img { width: 100%; transition: transform .4s; }
.gallery-item:hover img { transform: scale(1.05); }

.login-box { max-width: 560px; margin: 40px auto 70px; padding: 0 16px; text-align: center; }
.login-box h2 { font-size: 26px; }
.login-note { color: #c2410c; font: 600 22px/1.4 var(--font-head); }
.login-box form { text-align: right; margin-top: 24px; }
.login-box label { display: block; font-size: 14px; margin-bottom: 4px; }
.login-box input { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #94a3b8; border-radius: 4px; margin-bottom: 14px; }
.login-error { color: #b91c1c; font-weight: 600; }
.button, .login-box button {
    display: inline-flex; gap: 8px; align-items: center; font: 600 15px var(--font-head); color: #fff; background: var(--ink);
    border: 0; border-radius: 4px; padding: 10px 22px; cursor: pointer; text-decoration: none;
}
.login-box button { background: #16a34a; }
.button:hover, .login-box button:hover { color: #fff; filter: brightness(1.12); }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 300; background: rgba(0, 0, 0, .92); display: flex; align-items: center; justify-content: center; border: 0; padding: 0; width: 100%; height: 100%; max-width: none; max-height: none; }
.lightbox img { max-width: 94vw; max-height: 88vh; width: auto; height: auto; }
.lightbox button { position: absolute; background: rgba(0, 0, 0, .4); color: #fff; border: 0; cursor: pointer; font-size: 30px; width: 52px; height: 52px; border-radius: 50%; line-height: 1; }
.lightbox .lb-close { top: 14px; left: 14px; }
.lightbox .lb-prev { right: 14px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { left: 14px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-count { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: #ddd; font-size: 14px; }

/* ---------- pdf + 404 ---------- */
.pdf-page { max-width: 1000px; margin: 30px auto 60px; padding: 0 16px; text-align: center; }
.pdf-frame { width: 100%; height: 80vh; min-height: 600px; border: 1px solid #ddd; }
.notfound { text-align: center; padding: 60px 16px; }

/* ---------- footer ---------- */
.site-footer { background: var(--footer); padding: 50px 16px; margin-top: 0; }
.footer-inner { max-width: var(--wrap); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.footer-col { flex: 1 1 0; min-width: 0; text-align: center; }
.footer-col h2 { font-size: 24px; margin-bottom: 20px; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; }
.footer-nav a { display: inline-block; padding: 6px 0; font-size: 13px; text-decoration: none; color: var(--ink); }
.footer-nav a:hover { color: #000; }
.footer-nav a[aria-current] { font-weight: 700; }
.share-icons, .contact-icons { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; gap: 10px; }
.si, .ci { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; font-size: 22px; }
.si { border: 2px solid currentColor; }
.si-whatsapp { color: #25d366; } .si-facebook { color: #3b5998; } .si-twitter { color: #1da1f2; } .si-envelope { color: #ea4335; }
.ci { color: #fff; width: 42px; height: 42px; }
.ci .icon { width: 22px; height: 22px; }
.ci-whatsapp { background: #25d366; } .ci-phone { background: #69727d; } .ci-envelope { background: #ea4335; }
.si:hover { filter: brightness(.85); } .ci:hover { color: #fff; filter: brightness(.9); }

.to-top { position: fixed; bottom: 20px; left: 20px; width: 44px; height: 44px; border-radius: 6px; background: rgba(51, 65, 85, .85); color: #fff; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 90; }
.to-top svg { width: 16px; height: 16px; }
.to-top.show { opacity: 1; pointer-events: auto; }

/* ---------- responsive ---------- */
@media (max-width: 1300px) {
    .carousel-prev { right: -6px; } .carousel-next { left: -6px; }
    .carousel { padding: 0 34px; }
}
@media (max-width: 1024px) {
    .carousel-slide { flex-basis: calc((100% - 20px) / 2); }
    .eulogies-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-years { font-size: 38px; }
    .candles-layout { gap: 30px; }
}
@media (max-width: 767px) {
    .hero-inner { flex-direction: column; gap: 0; }
    .hero-photo { width: 100%; max-width: 420px; }
    .hero-text { text-align: center; padding: 24px 0 36px; }
    .hero-name { font-size: 30px; margin-bottom: 10px; }
    .hero-years { font-size: 30px; }
    .hero + .page-title { padding-top: 30px; }
    .story { padding-top: 20px; }
    .story-row, .story-row-alt { flex-direction: column; gap: 24px; margin-bottom: 40px; }
    .story-row-alt .story-photo img { width: 100%; }
    .carousel { padding: 0 28px; }
    .carousel-slide { flex-basis: 100%; }
    .carousel-prev { right: -4px; } .carousel-next { left: -4px; }
    .candles-layout { flex-direction: column; align-items: center; }
    .candles-aside { position: static; flex: none; width: 60%; max-width: 260px; }
    .candles-grid { grid-template-columns: 1fr; width: 100%; max-width: 380px; }
    .eulogies-grid { grid-template-columns: 1fr; }
    .eulogy-layout { flex-direction: column; }
    .eulogy-main { flex: none; width: 100%; }
    .eulogy-aside { position: static; width: 100%; }
    .footer-inner { flex-direction: column; gap: 40px; }
    .footer-nav { order: 3; }
    .footer-col { flex: none; width: 100%; }
    .main-nav li + li::before { margin: 0 9px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; }
}
.lightbox[hidden], .carousel-btn[hidden] { display: none; }

/* ---------- "light a candle" / "add eulogy" buttons ---------- */
.action-btn {
    display: inline-flex; align-items: center; gap: 8px; vertical-align: middle;
    font: 600 16px var(--font-head); text-decoration: none; color: #fff; background: var(--ink);
    border-radius: 999px; padding: 10px 22px; box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
    transition: transform .15s, box-shadow .15s;
}
.action-btn .icon { width: 18px; height: 18px; }
.action-candle .icon { color: #ff7a2e; }
.action-btn:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, .2); }
.action-on-dark { background: #fff; color: var(--ink); }
.action-on-dark:hover { color: var(--ink); }
.action-on-dark .icon { color: var(--flame); }
.section-links .action-btn { margin-left: 18px; text-decoration: none; }
.band-dark .section-links .action-on-dark { color: var(--ink); }
.page-actions { max-width: var(--wrap); margin: 30px auto 0; padding: 0 16px; }
.candles-aside .action-btn { margin-bottom: 18px; }
main > .section-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px 0; }

/* ---------- submission forms ---------- */
.form-page { max-width: 640px; margin: 36px auto 70px; padding: 0 16px; }
.form-intro { font-size: 17px; text-align: center; margin-bottom: 26px; }
.memorial-form label { display: block; font: 600 15px var(--font-head); margin: 18px 0 6px; }
.memorial-form input[type=text], .memorial-form textarea {
    width: 100%; font: 16px/1.6 var(--font-text); color: var(--ink); padding: 10px 12px;
    border: 1px solid #94a3b8; border-radius: 6px; background: #fff;
}
.memorial-form textarea { resize: vertical; min-height: 120px; }
.memorial-form input[type=file] { font: 15px var(--font-text); max-width: 100%; }
.memorial-form input:focus, .memorial-form textarea:focus { border-color: var(--ink); outline: 3px solid rgba(245, 158, 11, .6); outline-offset: 0; }
.memorial-form input[aria-invalid=true], .memorial-form textarea[aria-invalid=true] { border-color: #b91c1c; }
.memorial-form .req { color: #b91c1c; }
.field-hint { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.field-error { color: #b91c1c; font-size: 14px; font-weight: 600; margin: 4px 0 0; }
.form-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; padding: 10px 14px; border-radius: 6px; font-weight: 600; }
.memorial-form button {
    display: inline-flex; align-items: center; gap: 8px; margin-top: 26px; font: 600 17px var(--font-head);
    color: #fff; background: var(--ink); border: 0; border-radius: 999px; padding: 12px 30px; cursor: pointer;
}
.memorial-form button .icon { width: 18px; height: 18px; }
.memorial-form button:hover { filter: brightness(1.15); }
.hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.form-sent { text-align: center; background: var(--soft); border-radius: var(--radius); box-shadow: 0 -3px 10px var(--glow); padding: 36px 20px 30px; }
.form-sent-icon { color: var(--flame); font-size: 56px; line-height: 1; }
.form-sent-icon .icon { width: 44px; height: 56px; }
.form-sent h2 { font-size: 30px; margin: 10px 0 6px; }
.form-sent p { font-size: 19px; }
.form-sent-links { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.button-light { background: #e2e8f0; color: var(--ink); }
.button-light:hover { color: var(--ink); }
@media (max-width: 767px) {
    .section-links { text-align: center; }
    .section-links .action-btn { margin: 0 0 12px; display: flex; justify-content: center; max-width: 280px; margin-inline: auto; }
    .page-actions { text-align: center; }
}
