/* ===== בית הכנסת השמחה שבאופק - עיצוב כללי ===== */
:root {
  --color-bg: #eef5f8;
  --color-bg-alt: #ffffff;
  --color-navy: #1f3a52;
  --color-navy-dark: #14283b;
  --color-teal: #3fa9a4;
  --color-green: #a3c644;
  --color-gold: #c9a24d;
  --color-text: #2b3b47;
  --color-text-soft: #5c7182;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-card: 0 10px 30px rgba(31, 58, 82, 0.10);
  --shadow-card-hover: 0 16px 40px rgba(31, 58, 82, 0.16);
  --max-width: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Heebo", "Segoe UI", Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== רקע מנדלה דקורטיבי ===== */
.mandala-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.mandala-bg svg {
  position: absolute;
  top: -60px;
  left: -60px;
  width: 320px;
  height: 320px;
  opacity: 0.5;
}
[dir="rtl"] .mandala-bg svg { left: auto; right: -60px; }

/* ===== Header ===== */
.site-header {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #eef5f8 100%);
  border-bottom: 1px solid #dce9ef;
  overflow: hidden;
}
.site-header .container {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 16px;
  padding-bottom: 16px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}
.brand img {
  height: 58px;
  width: auto;
}
.brand-text h1 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--color-navy-dark);
  font-weight: 800;
}
.brand-text p {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--color-teal);
  font-weight: 600;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
/* הספן שבתוכו מוזרקים קישורי "דפים נוספים" (SITE_CONFIG) - display:contents כדי
   שהקישורים עצמם ישתתפו ישירות בפריסת ה-flex של הניווט (עם אותו gap/יישור), ולא
   יתקבצו יחד בתא אחד נפרד שגורם לבלגן/חוסר יישור כשהניווט נשבר לכמה שורות */
#extra-nav-links { display: contents; }
.main-nav a {
  text-decoration: none;
  color: var(--color-navy);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 14px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}
.main-nav a:hover { background: #dff1ee; }
.main-nav a.active {
  background: var(--color-teal);
  color: #ffffff;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--color-navy);
  cursor: pointer;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  text-align: center;
  padding: 56px 0 70px;
  background: radial-gradient(circle at 50% 0%, #dff1ee 0%, var(--color-bg) 60%);
  overflow: hidden;
}
.hero .container { position: relative; z-index: 1; }
.hero h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--color-navy-dark);
  margin: 0 0 10px;
  font-weight: 800;
}
.hero p.lead {
  color: var(--color-text-soft);
  font-size: 1.1rem;
  margin: 0 auto 30px;
  max-width: 640px;
}

.divider-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--color-gold);
  margin: 18px auto;
  max-width: 320px;
}
.divider-ornament::before,
.divider-ornament::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-gold));
}
.divider-ornament::after { background: linear-gradient(90deg, var(--color-gold), transparent); }

/* ===== Cards ===== */
.card {
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 28px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover { box-shadow: var(--shadow-card-hover); }

.zman-hero-card {
  max-width: 460px;
  margin: 0 auto;
  text-align: center;
  border-top: 6px solid var(--color-teal);
}
.zman-hero-card .date-line {
  color: var(--color-text-soft);
  font-size: 0.95rem;
  margin-bottom: 6px;
}
.zman-hero-card .hebrew-date {
  color: var(--color-gold);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 18px;
}
.zman-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 6px;
  border-bottom: 1px dashed #dbe6ec;
}
.zman-row:last-child { border-bottom: none; }
.zman-row .label {
  font-weight: 600;
  color: var(--color-navy);
  font-size: 1.05rem;
}
.zman-row .value {
  font-weight: 800;
  color: var(--color-navy-dark);
  font-size: 1.4rem;
  direction: ltr;
  unicode-bidi: isolate;
}
.zman-row.highlight .value { color: var(--color-teal); }

.section {
  padding: 50px 0;
}
.section h3 {
  text-align: center;
  color: var(--color-navy-dark);
  font-size: 1.7rem;
  margin-bottom: 8px;
}
.section .subtitle {
  text-align: center;
  color: var(--color-text-soft);
  margin-bottom: 36px;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
}
/* גרסה קומפקטית (תפילות ימי חול בדף הבית) - כרטיסים צרים יותר כדי שכולם ייכנסו בשורה אחת */
.grid-cards-compact {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}
.grid-cards-compact .icon { font-size: 1.5rem; margin-bottom: 6px; }
.grid-cards-compact h4 { font-size: 0.95rem; margin-bottom: 4px; }
.grid-cards-compact p { font-size: 0.85rem; margin-bottom: 0; }
.info-card {
  text-align: center;
}
.info-card .icon {
  font-size: 2rem;
  margin-bottom: 10px;
}
.info-card h4 {
  margin: 0 0 8px;
  color: var(--color-navy-dark);
}
.info-card p { color: var(--color-text-soft); margin: 0 0 14px; }
.info-card a.btn { display: inline-block; }

.btn {
  display: inline-block;
  background: var(--color-teal);
  color: #fff;
  text-decoration: none;
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 700;
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn:hover { background: #34918d; transform: translateY(-1px); }
.btn.outline {
  background: transparent;
  border: 2px solid var(--color-teal);
  color: var(--color-teal);
}
.btn.outline:hover { background: var(--color-teal); color: #fff; }

/* ===== טבלת לוח זמנים ===== */
.month-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 24px;
}
.month-nav button {
  background: var(--color-bg-alt);
  border: 1px solid #dce9ef;
  color: var(--color-navy);
  border-radius: 999px;
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: var(--shadow-card);
}
.month-nav button:hover { background: #dff1ee; }
.month-nav .current-month {
  font-weight: 800;
  color: var(--color-navy-dark);
  font-size: 1.2rem;
  min-width: 160px;
  text-align: center;
}

.zman-table-wrap {
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
table.zman-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
}
table.zman-table th {
  background: var(--color-navy);
  color: #fff;
  padding: 12px 10px;
  font-weight: 700;
  text-align: center;
}
table.zman-table td {
  padding: 10px;
  text-align: center;
  border-bottom: 1px solid #eef3f6;
  color: var(--color-text);
}
table.zman-table tr:last-child td { border-bottom: none; }
table.zman-table tr.today {
  background: #dff1ee;
  font-weight: 800;
}
table.zman-table tr.shabbat td { color: var(--color-gold); font-weight: 700; }
table.zman-table tr.yom-tov td { color: var(--color-teal); }
table.zman-table td.time { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.no-tefila {
  color: #a3a9ae;
  font-style: italic;
  font-weight: 400;
  font-size: 0.9em;
}
.zman-hero-card .no-tefila { font-size: 1rem; }

.note-box {
  margin-top: 18px;
  background: #fff9ec;
  border: 1px solid #f0e2bd;
  color: #8a6d1f;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 0.92rem;
}

/* ===== שבת קודש ===== */
.shabbat-poster {
  background: linear-gradient(160deg, #eaf4fb 0%, #ffffff 45%, #eaf4fb 100%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  max-width: 760px;
  margin: 0 auto;
}
.shabbat-poster .parasha-header {
  text-align: center;
  padding: 30px 20px 18px;
  background: transparent;
}
.shabbat-poster .parasha-header h3 {
  margin: 0 0 10px;
  color: #1a1a1a;
  font-size: 1.8rem;
  display: inline-block;
  padding-bottom: 8px;
  border-bottom: 3px solid #2e6da4;
}
.shabbat-poster .candle-times {
  display: flex;
  justify-content: center;
  gap: 18px;
  font-weight: 700;
  color: #1a1a1a;
}
.shabbat-poster .candle-times span.value { color: #1a1a1a; }
.kippur-section-title {
  text-align: center;
  color: #2e6da4;
  font-size: 1.3rem;
  margin: 4px 0 0;
}

.shabbat-cols {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  align-items: stretch;
}
.shabbat-cols .col { padding: 24px 28px; }
.col-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 14px;
}
.col-divider .ornament-tip { font-size: 1.1rem; line-height: 1; color: #3a3a6e; }
.col-divider .divider-line { width: 1px; flex: 1; min-height: 30px; background: #b8c9d9; }
.col-divider .divider-dot { width: 6px; height: 6px; border-radius: 50%; background: #3a3a6e; }
.shabbat-cols h4 {
  color: #2e6da4;
  margin: 0 0 14px;
  font-size: 1.1rem;
  text-align: center;
}
.shabbat-list { list-style: none; margin: 0; padding: 0; }
.shabbat-list li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed #e6edf1;
}
.shabbat-list li:last-child { border-bottom: none; }
.shabbat-list li .time {
  direction: ltr;
  unicode-bidi: isolate;
  font-weight: 700;
  color: var(--color-navy-dark);
}
.shabbat-list li.note-line {
  justify-content: center;
  border-bottom: none;
  padding: 3px 0;
  color: var(--color-text-soft);
  font-size: 0.85rem;
  font-style: italic;
}
/* גרסת 3 טורים (ליום/ימי חג עם 3 ימים, כמו ראש השנה) */
.holiday-cols { grid-template-columns: 1fr auto 1fr auto 1fr; }
.holiday-cols .col { padding: 20px 18px; }
@media (max-width: 900px) {
  .holiday-cols { grid-template-columns: 1fr; }
  .holiday-cols .col-divider { flex-direction: row; padding: 6px 0; }
  .holiday-cols .col-divider .divider-line { width: auto; height: 1px; flex: 1; min-height: 0; }
}
.shabbat-footer {
  text-align: center;
  background: #cfe6f5;
  color: #16324a;
  padding: 16px;
  font-size: 0.95rem;
}
.shabbat-shalom {
  text-align: center;
  padding: 14px 16px 22px;
  font-size: 1.6rem;
  font-weight: 800;
  color: #14283b;
}

.shabbat-poster {
  position: relative;
}
.poster-deco {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px 24px 0;
  margin-bottom: -30px;
  position: relative;
  z-index: 1;
}
.poster-deco .poster-logo { height: 60px; width: auto; order: 2; }
.poster-deco .poster-mandala { width: 130px; height: 130px; opacity: 0.5; order: 1; margin-top: -20px; }

.print-btn-wrap { max-width: 760px; margin: 18px auto 0; text-align: center; }

@media print {
  @page { size: 297mm 210mm; margin: 8mm; } /* A4 לרוחב מפורש (לא רק מילת מפתח landscape, כדי שדפדפנים יכבדו את זה) */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }
  .no-print, .site-header, .site-footer, .print-btn-wrap { display: none !important; }
  body { background: #fff; }
  main .section { padding: 0; }
  .container { max-width: 100%; padding: 0; }
  .shabbat-poster {
    --print-scale: 1; /* מוגדר/מעודכן ע"י JS (ראו shabbat.html, לפי ספירת שורות) כדי שהלוז יכנס לדף אחד */
    box-shadow: none;
    max-width: 100%;
    width: 100%;
    page-break-inside: avoid;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .shabbat-poster .parasha-header {
    padding: calc(14px * var(--print-scale)) calc(20px * var(--print-scale)) calc(10px * var(--print-scale));
  }
  .shabbat-poster .parasha-header h3 {
    font-size: calc(1.8rem * var(--print-scale));
    margin-bottom: calc(10px * var(--print-scale));
    padding-bottom: calc(8px * var(--print-scale));
  }
  .shabbat-poster .candle-times { font-size: calc(1rem * var(--print-scale)); gap: calc(18px * var(--print-scale)); }
  .shabbat-cols .col { padding: calc(14px * var(--print-scale)) calc(22px * var(--print-scale)); }
  .shabbat-cols h4 { font-size: calc(1.1rem * var(--print-scale)); margin-bottom: calc(14px * var(--print-scale)); }
  .col-divider { padding: calc(10px * var(--print-scale)) calc(14px * var(--print-scale)); }
  .shabbat-list li { padding: calc(5px * var(--print-scale)) 0; font-size: calc(1rem * var(--print-scale)); }
  .shabbat-footer { padding: calc(16px * var(--print-scale)); font-size: calc(0.95rem * var(--print-scale)); }
  .shabbat-shalom { padding: calc(10px * var(--print-scale)) calc(16px * var(--print-scale)) calc(14px * var(--print-scale)); font-size: calc(1.3rem * var(--print-scale)); }
}

@media (max-width: 640px) {
  .shabbat-cols { grid-template-columns: 1fr; }
  .col-divider { flex-direction: row; padding: 6px 0; }
  .col-divider .divider-line { width: auto; height: 1px; flex: 1; min-height: 0; }
}

/* ===== Footer ===== */
.site-footer {
  margin-top: auto;
  background: var(--color-navy-dark);
  color: #cfe0e8;
  padding: 30px 0;
  text-align: center;
  font-size: 0.9rem;
}
.site-footer strong { color: #fff; }
.site-footer .address { margin-top: 6px; }
.site-footer .admin-link { margin-top: 10px; font-size: 0.78rem; opacity: 0.6; }
.site-footer .admin-link a { color: inherit; text-decoration: underline; }
.footer-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
}
.footer-qr img { border-radius: 6px; background: #fff; padding: 4px; }
.footer-qr span { font-size: 0.78rem; opacity: 0.8; }
@media print { .footer-qr { display: none !important; } }

.brand-group {
  display: flex;
  align-items: center;
  gap: 14px;
}
.header-whatsapp-qr img {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  display: block;
}
@media (max-width: 780px) {
  .header-whatsapp-qr img { width: 44px; height: 44px; }
}

.whatsapp-share-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 500;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  transition: transform 0.15s ease;
}
.whatsapp-share-btn:hover { transform: scale(1.08); }
@media print { .whatsapp-share-btn { display: none !important; } }

/* ===== Mobile ===== */
@media (max-width: 780px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    order: 3;
  }
  .main-nav.open { display: flex; }
  .main-nav a { text-align: center; }
}
