/* Shared by all language versions; uses logical properties so RTL and LTR both work. */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --ink: #1b2233;
    --navy-dark: #0a1a33;
    --navy: #102a4c;
    --blue: #163a6b;
    --blue-dark: #0d2747;
    --gold: #b08d3c;
    --gold-light: #d6bd7a;
    --parchment: #f2e8d2;
    --paper: #faf5e9;
    --line: rgba(122, 92, 40, 0.35);
    --text-muted: #4d5668;
    --shadow: 0 6px 18px rgba(10, 26, 51, 0.14);
    --header-height: 80px;
    --font-body: 'David Libre', 'Frank Ruhl Libre', 'Times New Roman', serif;
    --font-display: 'Frank Ruhl Libre', 'David Libre', 'Times New Roman', serif;
    --ornament: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='20' viewBox='0 0 240 20'%3E%3Cg stroke='%23b08d3c' stroke-width='1' fill='none'%3E%3Cpath d='M0 10H96M144 10H240'/%3E%3Cpath d='M20 14H90M150 14H220' opacity='.5'/%3E%3Cpath d='M120 2l8 8-8 8-8-8z'/%3E%3C/g%3E%3Cg fill='%23b08d3c'%3E%3Cpath d='M120 6l4 4-4 4-4-4z'/%3E%3Ccircle cx='103' cy='10' r='2.2'/%3E%3Ccircle cx='137' cy='10' r='2.2'/%3E%3C/g%3E%3C/svg%3E");
}

html {
    scroll-behavior: smooth;
}

/* David Libre's Latin punctuation is Hebrew-styled, so LTR pages use Frank Ruhl Libre throughout */
html[dir="ltr"] {
    --font-body: 'Frank Ruhl Libre', Georgia, 'Times New Roman', serif;
}

body {
    font-family: var(--font-body);
    font-size: 1.15rem;
    line-height: 1.75;
    color: var(--ink);
    background: var(--paper);
}

a {
    color: inherit;
}

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

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

section[id] {
    scroll-margin-top: var(--header-height);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 11px 30px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.03em;
    text-decoration: none;
    border: 1px solid var(--gold);
    outline: 1px solid rgba(176, 141, 60, 0.45);
    outline-offset: 3px;
    transition: background 0.2s ease, color 0.2s ease;
}

.btn-gold {
    background: var(--gold);
    color: var(--navy-dark);
}

.btn-gold:hover {
    background: var(--gold-light);
}

.btn-outline {
    color: var(--gold-light);
}

.btn-outline:hover {
    background: rgba(176, 141, 60, 0.15);
}

.btn-primary {
    background: var(--blue);
    color: var(--paper);
}

.btn-primary:hover {
    background: var(--blue-dark);
}

/* Top info bar */
.topbar {
    background: var(--navy-dark);
    color: rgba(242, 232, 210, 0.8);
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(176, 141, 60, 0.3);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 38px;
}

.topbar-info {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
}

.topbar-info li {
    padding-inline: 14px;
}

.topbar-info li:first-child {
    padding-inline-start: 0;
}

.topbar-info li + li {
    border-inline-start: 1px solid rgba(176, 141, 60, 0.45);
}

.topbar-info a {
    text-decoration: none;
    direction: ltr;
    unicode-bidi: embed;
}

.topbar-info a:hover {
    color: var(--gold-light);
}

.language-switcher {
    display: flex;
    gap: 2px;
}

.lang-link {
    padding: 2px 10px;
    text-decoration: none;
    font-size: 0.9rem;
    color: rgba(242, 232, 210, 0.7);
}

.lang-link:hover {
    color: var(--gold-light);
}

.lang-link.active {
    color: var(--gold-light);
    font-weight: 700;
    border-bottom: 1px solid var(--gold);
}

/* Header & navigation */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--navy);
    border-bottom: 4px double var(--gold);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-height);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--paper);
    text-decoration: none;
}

.brand-logo {
    width: 54px;
    height: 54px;
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 900;
    color: var(--paper);
}

.brand-sub {
    font-size: 0.95rem;
    color: var(--gold-light);
    letter-spacing: 0.06em;
}

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-link {
    display: block;
    padding: 27px 16px;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 500;
    color: rgba(242, 232, 210, 0.88);
    text-decoration: none;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    inset-inline: 16px;
    bottom: 18px;
    height: 1px;
    background: var(--gold);
    transform: scaleX(0);
    transition: transform 0.25s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--gold-light);
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: 1px solid rgba(176, 141, 60, 0.6);
    width: 44px;
    height: 44px;
    cursor: pointer;
    position: relative;
}

.burger,
.burger::before,
.burger::after {
    position: absolute;
    left: 11px;
    width: 20px;
    height: 2px;
    background: var(--gold-light);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.burger {
    top: 50%;
    margin-top: -1px;
}

.burger::before,
.burger::after {
    content: '';
    left: 0;
}

.burger::before {
    top: -7px;
}

.burger::after {
    top: 7px;
}

.mobile-menu-toggle[aria-expanded="true"] .burger {
    background: transparent;
}

.mobile-menu-toggle[aria-expanded="true"] .burger::before {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle[aria-expanded="true"] .burger::after {
    transform: translateY(-7px) rotate(-45deg);
}

/* Hero */
.hero {
    position: relative;
    padding: 100px 0 110px;
    color: var(--paper);
    text-align: center;
    background:
        radial-gradient(ellipse at 50% 10%, rgba(176, 141, 60, 0.22), transparent 60%),
        linear-gradient(180deg, #14345f 0%, var(--navy-dark) 100%);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23b08d3c' stroke-width='.8' opacity='.12'%3E%3Cpath d='M32 14l15.6 27H16.4z'/%3E%3Cpath d='M32 50L16.4 23h31.2z'/%3E%3Cpath d='M0 0h64v64H0z'/%3E%3C/g%3E%3C/svg%3E");
}

/* Arch frame evoking the Aron Kodesh */
.hero::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    width: min(780px, 92%);
    height: 88%;
    transform: translateX(-50%);
    border: 1px solid rgba(176, 141, 60, 0.55);
    border-bottom: none;
    border-radius: 390px 390px 0 0;
    box-shadow: 0 0 0 8px rgba(10, 26, 51, 0.4), 0 0 0 9px rgba(176, 141, 60, 0.3);
    pointer-events: none;
}

.bsd {
    position: absolute;
    top: 14px;
    inset-inline-start: 20px;
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--gold-light);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 720px;
}

.hero-eyebrow {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--gold-light);
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6.5vw, 4.4rem);
    font-weight: 900;
    line-height: 1.12;
    color: var(--paper);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.hero-pillars {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px 0;
    margin: 22px 0 18px;
    font-family: var(--font-display);
    font-size: clamp(1.05rem, 2.6vw, 1.4rem);
    font-weight: 700;
    color: var(--gold-light);
    letter-spacing: 0.05em;
}

.hero-pillars span {
    padding: 0 18px;
}

.hero-pillars span + span {
    border-inline-start: 1px solid rgba(176, 141, 60, 0.7);
}

.hero-pillars::before,
.hero-pillars::after {
    content: '';
    width: 60px;
    height: 1px;
    background: var(--gold);
    opacity: 0.6;
}

.hero-description {
    font-size: 1.2rem;
    color: rgba(242, 232, 210, 0.85);
    margin: 0 auto 26px;
    max-width: 600px;
}

.hero-quote {
    margin: 0 auto 34px;
    max-width: 560px;
    padding: 16px 24px;
    border-top: 1px solid rgba(176, 141, 60, 0.5);
    border-bottom: 1px solid rgba(176, 141, 60, 0.5);
}

.hero-quote p {
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 3vw, 1.65rem);
    font-weight: 700;
    color: var(--gold-light);
    line-height: 1.4;
}

.hero-quote cite {
    display: block;
    margin-top: 4px;
    font-style: normal;
    font-size: 0.95rem;
    color: rgba(242, 232, 210, 0.7);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    justify-content: center;
}

/* This Shabbat bar */
.shabbat-bar {
    background: var(--parchment);
    border-bottom: 1px solid var(--line);
    box-shadow: inset 0 4px 0 var(--gold);
}

.shabbat-bar-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 40px;
    padding-top: 26px;
    padding-bottom: 22px;
}

.shabbat-bar-title h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--blue);
    line-height: 1.2;
}

.shabbat-date {
    color: var(--text-muted);
    font-weight: 500;
}

.shabbat-bar-times {
    display: flex;
    gap: 14px;
}

.shabbat-bar-times > div {
    background: var(--blue);
    color: var(--paper);
    padding: 10px 26px;
    text-align: center;
    min-width: 140px;
    border: 1px solid var(--gold);
    outline: 1px solid var(--blue);
    outline-offset: 2px;
}

.shabbat-bar-times dt {
    font-size: 0.95rem;
    color: var(--gold-light);
}

.shabbat-bar-times dd {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
}

/* Generic sections */
.section {
    padding: 80px 0;
}

.section-light {
    background: var(--parchment);
}

.section-title {
    font-family: var(--font-display);
    text-align: center;
    font-size: clamp(2.1rem, 4vw, 2.7rem);
    font-weight: 900;
    color: var(--blue);
    margin-bottom: 46px;
}

.section-title::after {
    content: '';
    display: block;
    width: 240px;
    height: 20px;
    margin: 10px auto 0;
    background: var(--ornament) center / contain no-repeat;
}

.eyebrow {
    font-family: var(--font-display);
    color: var(--gold);
    font-weight: 700;
    letter-spacing: 0.06em;
    margin-bottom: 2px;
}

/* Framed panel shared by schedule cards and contact card */
.schedule-card,
.contact-card {
    background: var(--paper);
    border: 1px solid var(--gold);
    outline: 1px solid var(--line);
    outline-offset: 5px;
    box-shadow: var(--shadow);
}

/* Prayer schedule */
.schedule-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    align-items: start;
}

.schedule-grid .schedule-card {
    grid-column: 1;
}

.schedule-grid .zmanim-card {
    grid-column: 2;
    grid-row: 1 / span 2;
}

.schedule-heading {
    background: var(--blue);
    color: var(--paper);
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 700;
    text-align: center;
    padding: 12px;
    border-bottom: 3px double var(--gold);
}

.schedule-list {
    list-style: none;
    padding: 8px 28px 16px;
}

.schedule-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 20px;
    padding: 14px 0;
    border-bottom: 1px dotted var(--line);
}

.schedule-list li:last-child {
    border-bottom: none;
}

.schedule-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--navy);
}

.schedule-time {
    text-align: end;
}

.schedule-time small {
    display: block;
    font-size: 0.95rem;
    color: var(--blue);
    font-weight: 700;
}

.zmanim-date {
    text-align: center;
    color: var(--text-muted);
    padding: 12px 20px 0;
    min-height: 2.5em;
}

.zmanim-list li {
    padding: 9px 0;
}

.zmanim-list .schedule-name {
    font-size: 1.1rem;
}

.zmanim-list .schedule-time {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--blue);
    font-variant-numeric: tabular-nums;
}

/* Rabbi */
.rabbi-section {
    background: var(--paper);
}

.rabbi-inner {
    display: grid;
    grid-template-columns: minmax(260px, 400px) 1fr;
    gap: 60px;
    align-items: center;
}

.rabbi-photo {
    padding: 10px;
    border: 1px solid var(--gold);
    outline: 1px solid var(--line);
    outline-offset: 6px;
    border-radius: 200px 200px 0 0;
    background: var(--parchment);
    box-shadow: var(--shadow);
}

.rabbi-photo img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 190px 190px 0 0;
    filter: contrast(1.02);
}

.rabbi-text h2 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 3.6vw, 2.6rem);
    font-weight: 900;
    color: var(--blue);
    line-height: 1.2;
    margin-bottom: 16px;
}

.rabbi-text h2::after {
    content: '';
    display: block;
    width: 160px;
    height: 20px;
    margin-top: 10px;
    background: var(--ornament) center / contain no-repeat;
}

.rabbi-text p:not(.eyebrow) {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 30px;
    max-width: 540px;
}

/* Lessons */
.daily-study {
    max-width: 860px;
    margin: 0 auto 30px;
    background: var(--navy);
    color: var(--parchment);
    padding: 28px 36px;
    border: 1px solid var(--gold);
    outline: 1px solid var(--line);
    outline-offset: 5px;
    text-align: center;
}

.daily-study h3 {
    font-family: var(--font-display);
    font-size: 1.7rem;
    color: var(--gold-light);
    margin-bottom: 6px;
}

.lessons-list {
    list-style: none;
    max-width: 860px;
    margin: 0 auto;
    display: grid;
    gap: 16px;
}

.lesson-item {
    display: flex;
    align-items: center;
    gap: 28px;
    background: var(--paper);
    padding: 20px 28px;
    border: 1px solid var(--line);
    border-inline-start: 4px solid var(--blue);
}

.lesson-when {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
    padding-inline-end: 26px;
    border-inline-end: 1px solid var(--gold);
}

.lesson-day {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--navy);
}

.lesson-time {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--blue);
    line-height: 1.2;
}

.lesson-details h4 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--navy);
}

.lesson-meta {
    color: var(--text-muted);
}

.lesson-featured {
    border-color: var(--gold);
    border-inline-start-color: var(--gold);
    background: #fffaf0;
}

.badge {
    display: inline-block;
    vertical-align: middle;
    margin-inline-start: 10px;
    padding: 0 10px;
    border: 1px solid var(--blue);
    color: var(--blue);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.6;
}

/* Contact */
.contact-grid {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 1.4fr;
    gap: 36px;
}

.contact-card {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.contact-row h3 {
    font-family: var(--font-display);
    color: var(--blue);
    font-size: 1.3rem;
}

.phone-link {
    color: var(--navy);
    font-weight: 700;
    font-size: 1.25rem;
    text-decoration: none;
    direction: ltr;
    unicode-bidi: embed;
}

.phone-link:hover {
    color: var(--blue);
}

.navigation-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
}

.nav-btn {
    flex: 1;
    padding: 12px;
    text-align: center;
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--paper);
    background: var(--navy);
    border: 1px solid var(--gold);
    transition: background 0.2s ease;
}

.nav-btn:hover {
    background: var(--blue);
}

.map-wrapper {
    min-height: 360px;
    border: 1px solid var(--gold);
    padding: 6px;
    background: var(--paper);
    box-shadow: var(--shadow);
}

.map-wrapper iframe {
    width: 100%;
    height: 100%;
    min-height: 346px;
    border: 0;
    display: block;
    filter: saturate(0.9);
}

/* Footer */
.footer {
    background: var(--navy-dark);
    color: rgba(242, 232, 210, 0.75);
    border-top: 4px double var(--gold);
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
    padding-top: 46px;
    padding-bottom: 36px;
}

.footer-brand {
    display: flex;
    gap: 16px;
    align-items: center;
}

.footer-brand h3 {
    font-family: var(--font-display);
    font-size: 1.55rem;
    color: var(--paper);
}

.footer-contact a {
    color: var(--gold-light);
    text-decoration: none;
}

.footer-bottom {
    border-top: 1px solid rgba(176, 141, 60, 0.25);
    padding: 16px 20px;
    text-align: center;
    font-size: 0.95rem;
    opacity: 0.7;
}

.footer-credit {
    margin-top: 4px;
    font-size: 0.85rem;
}

.footer-credit a {
    color: var(--gold-light);
    text-decoration: none;
}

.footer-credit a:hover {
    text-decoration: underline;
}

/* Scroll reveal (class added by script.js) */
.reveal {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.reveal.visible {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .reveal {
        opacity: 1;
        transition: none;
    }
}

/* Responsive */
@media (max-width: 900px) {
    .rabbi-inner,
    .contact-grid,
    .schedule-grid {
        grid-template-columns: 1fr;
    }

    .schedule-grid .schedule-card,
    .schedule-grid .zmanim-card {
        grid-column: auto;
        grid-row: auto;
    }

    .rabbi-photo {
        max-width: 360px;
        margin: 0 auto;
    }

    .rabbi-text {
        text-align: center;
    }

    .rabbi-text h2::after {
        margin-inline: auto;
    }

    .rabbi-text p:not(.eyebrow) {
        margin-inline: auto;
    }
}

@media (max-width: 820px) {
    :root {
        --header-height: 66px;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .nav {
        position: absolute;
        top: 100%;
        inset-inline: 0;
        background: var(--navy);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .nav.open {
        max-height: 400px;
        border-bottom: 4px double var(--gold);
    }

    .nav-menu {
        flex-direction: column;
    }

    .nav-link {
        padding: 14px 20px;
        border-top: 1px solid rgba(176, 141, 60, 0.2);
        text-align: center;
    }

    .nav-link::after {
        display: none;
    }

    .brand-logo {
        width: 44px;
        height: 44px;
    }

    .brand-name {
        font-size: 1.25rem;
    }

    .hebrew-date-item {
        display: none;
    }
}

@media (max-width: 600px) {
    .topbar-inner {
        flex-direction: column;
        padding-top: 8px;
        padding-bottom: 8px;
        gap: 4px;
    }

    .topbar-info {
        justify-content: center;
    }

    .hero {
        padding: 76px 0 86px;
    }

    .hero-pillars::before,
    .hero-pillars::after {
        display: none;
    }

    .shabbat-bar-inner {
        justify-content: center;
        text-align: center;
    }

    .shabbat-bar-times {
        width: 100%;
    }

    .shabbat-bar-times > div {
        min-width: 0;
        flex: 1;
        padding: 10px 14px;
    }

    .section {
        padding: 56px 0;
    }

    .schedule-list {
        padding: 6px 18px 12px;
    }

    .lesson-item {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .lesson-when {
        flex-direction: row;
        gap: 12px;
        padding-inline-end: 0;
        padding-bottom: 10px;
        border-inline-end: none;
        border-bottom: 1px solid var(--gold);
    }
}
