/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ──────────────────────────────────────────────────────────────────── */
html, body { max-width: 100%; overflow-x: hidden; }
body {
    font-family: 'Heebo', sans-serif;
    direction: rtl;
    background: #fdfbf7;
    color: #1a1a1a;
    line-height: 1.7;
}

a { color: #a6804a; text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ── Header ────────────────────────────────────────────────────────────────── */
.site-header {
    background: #fff;
    border-bottom: 2px solid #a6804a;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.site-logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: #a6804a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.main-nav a {
    margin-inline-start: 1.5rem;
    color: #444;
    font-weight: 600;
}

/* ── Main ──────────────────────────────────────────────────────────────────── */
.main-content {
    max-width: 1100px;
    margin: 2.5rem auto;
    padding: 0 1.5rem;
}

/* ── Footer ────────────────────────────────────────────────────────────────── */
.site-footer {
    background: #f0ebe0;
    border-top: 1px solid #d4b896;
    margin-top: 4rem;
    padding: 2rem;
    text-align: center;
    color: #888;
    font-size: 0.9rem;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; text-decoration: none; }
.btn-primary  { background: #a6804a; color: #fff; }
.btn-outline  { background: transparent; border: 2px solid #a6804a; color: #a6804a; }
.btn-danger   { background: #c0392b; color: #fff; }

/* ── Forms ─────────────────────────────────────────────────────────────────── */
input, textarea, select {
    font-family: inherit;
    font-size: 1rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    color: #1a1a1a;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #a6804a;
    box-shadow: 0 0 0 3px rgba(166,128,74,.15);
}

label { display: block; font-weight: 600; margin-bottom: 0.35rem; }

.form-group { margin-bottom: 1.25rem; }

/* ── Flash messages ─────────────────────────────────────────────────────────── */
.flash {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-weight: 600;
}
.flash-success { background: #d4edda; color: #155724; }
.flash-error   { background: #f8d7da; color: #721c24; }

/* ── Nav (מובייל: תפריט המבורגר) ──────────────────────────────────────────── */
.main-nav a { padding-bottom: 2px; border-bottom: 2px solid transparent; }
.main-nav a.active { border-bottom-color: #a6804a; color: #a6804a; }
.nav-toggle {
    display: none;
    background: none; border: none; font-size: 1.4rem; color: #a6804a; cursor: pointer;
}

/* ── Hero: תאריך + מיקום ───────────────────────────────────────────────────── */
.hero-card {
    text-align: center;
    padding: 2rem 1rem 1.5rem;
}
.hero-date { display: flex; flex-direction: column; gap: .25rem; margin-bottom: 1rem; }
.hero-hebrew-date { font-size: 2rem; font-weight: 800; color: #5a2318; }
.hero-parasha { font-size: 1.1rem; color: #8b6938; font-weight: 600; }

.location-pill {
    display: inline-flex; align-items: center; gap: .5rem;
    background: #fff; border: 2px solid #a6804a; border-radius: 999px;
    padding: .5rem 1.25rem; font-size: 1rem; font-weight: 600; color: #5a2318;
    cursor: pointer; font-family: inherit;
}
.location-pill:hover { background: #f7f1e3; }

/* ── רשת הזמנים ────────────────────────────────────────────────────────────── */
.zmanim-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: .9rem;
    margin: 1.5rem 0 2.5rem;
}
.zman-card {
    background: #fff;
    border: 1px solid #ecdfc7;
    border-radius: .9rem;
    padding: 1rem 1.1rem;
    display: flex; flex-direction: column; gap: .35rem;
    box-shadow: 0 1px 3px rgba(90,35,24,.05);
    transition: transform .15s, box-shadow .15s;
}
.zman-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(90,35,24,.08); }
.zman-card-highlight { background: #fdf6e8; border-color: #d4b06a; }
.zman-label { font-size: .85rem; color: #8a7a5c; font-weight: 600; }
.zman-time { font-size: 1.5rem; font-weight: 800; color: #1a1a1a; font-variant-numeric: tabular-nums; }

/* ── כרטיס שבת ─────────────────────────────────────────────────────────────── */
.shabbat-card {
    background: linear-gradient(135deg, #5a2318, #7a3520);
    color: #fdf6e8;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}
.shabbat-card h2 { font-size: 1.3rem; margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem; }
.shabbat-times { display: flex; gap: 2rem; flex-wrap: wrap; }
.shabbat-time-item { display: flex; flex-direction: column; gap: .25rem; }
.shabbat-time-label { font-size: .85rem; opacity: .85; }
.shabbat-time-value { font-size: 1.6rem; font-weight: 800; }

/* ── בורר מיקום (dialog) ───────────────────────────────────────────────────── */
.location-dialog {
    border: none; border-radius: 1rem; padding: 1.5rem;
    max-width: 400px; width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,.2);
}
.location-dialog::backdrop { background: rgba(26,26,26,.5); }
.location-dialog h3 { margin-bottom: 1rem; color: #5a2318; }
.location-list { list-style: none; max-height: 260px; overflow-y: auto; margin-top: .75rem; }
.location-list li {
    padding: .65rem .5rem; cursor: pointer; border-radius: .5rem; font-weight: 600;
}
.location-list li:hover { background: #f7f1e3; }
.location-list li[hidden] { display: none; }

/* ── לוח שנה ────────────────────────────────────────────────────────────────── */
.calendar-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .25rem; flex-wrap: wrap; }
.calendar-title { font-size: 1.6rem; color: #5a2318; text-align: center; flex: 1; }
.calendar-subtitle { text-align: center; color: #8a7a5c; margin-bottom: 1.5rem; }
.calendar-grid-header {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: .4rem;
    text-align: center; font-weight: 700; color: #8b6938; margin-bottom: .4rem; font-size: .85rem;
}
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .4rem; }
.calendar-cell {
    background: #fff; border: 1px solid #ecdfc7; border-radius: .6rem;
    min-height: 80px; padding: .4rem; font-size: .78rem;
    display: flex; flex-direction: column; gap: .15rem;
}
.calendar-cell-empty { background: transparent; border: none; }
.calendar-cell-today { border: 2px solid #a6804a; background: #fdf6e8; }
.calendar-cell-heb { font-weight: 800; color: #5a2318; font-size: .95rem; }
.calendar-cell-greg { color: #aaa; font-size: .7rem; }
.calendar-cell-holiday { color: #b5443a; font-weight: 700; }
.calendar-cell-parasha { color: #a6804a; font-weight: 600; }
.calendar-cell-omer { color: #6b8f52; }

/* ── תוכן טקסטואלי (אודות/נגישות) ─────────────────────────────────────────── */
.prose { max-width: 760px; margin: 0 auto; }
.prose h1 { font-size: 1.9rem; color: #5a2318; margin-bottom: 1.25rem; }
.prose h2 { font-size: 1.3rem; color: #8b6938; margin: 1.75rem 0 .75rem; }
.prose p { margin-bottom: 1rem; }
.prose ul { margin: 0 0 1rem 0; padding-inline-start: 1.5rem; }
.prose li { margin-bottom: .4rem; }
.footer-links { margin-top: .5rem; font-size: .85rem; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
    .nav-toggle { display: block; flex-shrink: 0; }
    .site-logo { font-size: 1.05rem; max-width: 65vw; }
    .main-nav {
        display: none; flex-direction: column; width: 100%; gap: .75rem;
        padding-top: .75rem; border-top: 1px solid #ecdfc7; margin-top: .75rem;
    }
    .main-nav.open { display: flex; }
    .nav-container { flex-wrap: wrap; }
    .hero-hebrew-date { font-size: 1.5rem; }
    .zmanim-grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
    .zman-time { font-size: 1.25rem; }
    .calendar-cell { min-height: 60px; font-size: .68rem; }
}

/* ── Dark mode (מכבד prefers-color-scheme) ───────────────────────────────────── */
@media (prefers-color-scheme: dark) {
    body { background: #1a1611; color: #f0e9dc; }
    .site-header { background: #241f18; border-bottom-color: #8b6938; }
    .zman-card, .location-dialog, .calendar-cell { background: #241f18; border-color: #3a3226; color: #f0e9dc; }
    .zman-card-highlight { background: #2e2517; }
    .zman-time { color: #f0e9dc; }
    .location-pill { background: #241f18; }
    .location-pill:hover { background: #2e2517; }
    .calendar-cell-today { background: #2e2517; }
    .site-footer { background: #14110d; border-top-color: #3a3226; color: #a89a80; }
}