/* Shared styles for the standalone Torah-reading article pages
   (torah-reading.<lang>.html). Extracted from torahreading.html so the
   six language pages can be served as real, indexable HTML documents. */

:root {
    --bg: #ffffff;
    --fg: #1a1a1a;
    --muted: #5e6a73;
    --accent: #2b6cb0;
    --border: #e5e7eb;
    --callout: #f8fafc;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
    color: var(--fg);
    background: var(--bg);
    line-height: 1.65;
}

.wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}

header {
    margin-bottom: 1.5rem;
}

h1 {
    font-size: clamp(1.8rem, 3.5vw, 2.4rem);
    line-height: 1.2;
    margin: 0 0 .5rem;
}

p.lead {
    color: var(--muted);
    font-size: 1.05rem;
}

nav.toc {
    margin: 1.25rem 0 2rem;
    padding: 1rem;
    background: var(--callout);
    border: 1px solid var(--border);
    border-radius: 12px;
}

nav.toc a {
    color: var(--accent);
    text-decoration: none;
}

nav.toc a:hover {
    text-decoration: underline;
}

section {
    margin: 2.25rem 0;
}

h2 {
    font-size: clamp(1.4rem, 2.5vw, 1.8rem);
    margin: 0 0 .75rem;
}

h3 {
    font-size: 1.15rem;
    margin: 1.25rem 0 .5rem;
}

ul,
ol {
    padding-left: 1.2rem;
}

li+li {
    margin-top: .35rem;
}

.callout {
    background: var(--callout);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin: 1rem 0 1.25rem;
}

.glossary {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.term {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .9rem;
    background: #fff;
}

.term h4 {
    margin: 0 0 .35rem;
    font-size: 1rem;
}

footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: .95rem;
}

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

.rtl-article {
    direction: rtl;
    /* correct character flow */
    text-align: right;
    /* align blocks to the right */
    unicode-bidi: isolate;
    /* keep RTL inside from affecting the rest of the page */
}

.hero {
    margin: 1rem 0 0;
}

.hero img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}

.hero figcaption {
    color: var(--muted);
    font-size: .9rem;
    margin-top: .5rem;
}

.deep-dive-cta {
    max-width: 860px;
    margin: 1.5rem auto;
    padding: 0 1rem
}

.deep-dive-btn {
    display: flex;
    align-items: center;
    gap: .6rem;
    justify-content: center;
    padding: 1rem 1.25rem;
    border-radius: 14px;
    background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: .2px;
    box-shadow: 0 8px 20px rgba(29, 78, 216, .25), inset 0 1px 0 rgba(255, 255, 255, .25);
    border: 1px solid rgba(255, 255, 255, .15);
    transition: transform .12s ease, box-shadow .12s ease
}

.deep-dive-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(29, 78, 216, .32), inset 0 1px 0 rgba(255, 255, 255, .3)
}

.deep-dive-btn:active {
    transform: translateY(0);
    box-shadow: 0 6px 16px rgba(29, 78, 216, .2), inset 0 1px 0 rgba(255, 255, 255, .25)
}

.deep-dive-btn:focus {
    outline: 3px solid #93c5fd;
    outline-offset: 3px
}

.deep-dive-btn .deeparrow {
    width: 22px;
    height: 22px;
    flex: 0 0 22px
}

@media (prefers-reduced-motion: reduce) {
    .deep-dive-btn {
        transition: none
    }
}

.deep-dive-btn,
.deep-dive-btn:visited,
.deep-dive-btn:hover,
.deep-dive-btn:active,
.deep-dive-btn:focus {
    color: #fff !important;
    text-decoration: none;
}

.deep-dive-btn span {
    color: inherit;
}

.deep-dive-btn .deeparrow {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
}

.deep-dive-btn .deeparrow path {
    stroke: currentColor;
}

/* Layout */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg, #fff);
    border-bottom: 1px solid var(--border, #e5e7eb);
    backdrop-filter: saturate(140%) blur(6px);
}

.site-nav {
    max-width: 1100px;
    margin: 0 auto;
    padding: .65rem clamp(.75rem, 2.5vw, 1rem);
    display: flex;
    align-items: center;
    gap: .75rem;
}

.site-logo {
    font-weight: 700;
    letter-spacing: .2px;
    text-decoration: none;
    color: var(--fg, #111827) !important;
}

.nav-toggle {
    margin-inline-start: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border, #e5e7eb);
    background: #fff;
    color: var(--fg, #111827);
}

.nav-toggle:hover {
    background: #f8fafc
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: none;
    flex-direction: column;
    gap: .25rem;
    position: absolute;
    inset-inline: 0;
    top: 58px;
    /* below header */
    background: var(--bg, #fff);
    border-bottom: 1px solid var(--border, #e5e7eb);
    padding: .5rem clamp(.75rem, 2.5vw, 1rem) 1rem;
}

.nav-links a {
    display: block;
    padding: .5rem .25rem;
    border-radius: 8px;
    color: var(--fg, #111827) !important;
    text-decoration: none;
}

.nav-links a:hover {
    background: #f3f4f6;
    color: var(--fg, #111827) !important;
}

.nav-actions {
    display: none;
    /* hidden on mobile, shown on wide screens */
}

.nav-actions select {
    padding: .45rem .6rem;
    border-radius: 10px;
    border: 1px solid var(--border, #e5e7eb);
    background: #fff;
}

/* Wide screens */
@media (min-width: 860px) {
    .nav-toggle {
        display: none;
    }

    .nav-links {
        position: static;
        display: flex;
        flex-direction: row;
        gap: .75rem;
        border: 0;
        background: transparent;
        padding: 0;
        margin-inline-start: 1rem;
    }

    .nav-actions {
        display: block;
        margin-inline-start: auto;
    }
}

/* When menu is open on mobile */
.site-nav.open .nav-links {
    display: flex;
}

.site-nav.open .nav-actions {
    display: block;
    padding: .5rem clamp(.75rem, 2.5vw, 1rem) 1rem;
    margin-inline-start: 0;
}

/* Helpers */
/* Clipped rather than pushed off-canvas with a negative offset: in RTL,
   an off-canvas offset becomes real scrollable overflow and the page loads
   scrolled away from its content. */
.skip-link {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip-link:focus {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    clip-path: none;
    display: inline-block;
    margin: .5rem;
    padding: .5rem .75rem;
    border-radius: .5rem;
    background: #111827;
    color: #fff;
    text-decoration: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* RTL-friendly spacing via logical properties */
.site-nav {
    padding-inline: clamp(.75rem, 2.5vw, 1rem);
}

.nav-links a {
    padding-inline: .5rem;
}
