/* =====================================================
   jg-jos.css -- JewishGen Online Services (JOS) section
   Shared styles for the JOS landing page and tool pages
   (calendar converter, festival dates, soundex, Hebrew
   year converter). Loaded AFTER jg-global.css.
   Navy/white/cream backgrounds hardcoded per JG40 rules
   (var(--navy)/(--white)/(--cream) flip in dark mode).
   CHW
   ===================================================== */

/* == Shared content shell ============================== */
.jos-shell {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem 3rem;
}
.jos-outer {
    background-color: var(--ecru);   /* --ecru does not flip */
    min-height: 50vh;
    padding-top: 1.5rem;
}

/* == Intro snippet + read-more ========================= */
.jos-intro {
    max-width: 760px;
    margin: 0 auto 1.5rem;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--charcoal);
    text-align: center;
}
body.dark-mode .jos-intro { color: #c8c0b0; }
.jos-readmore {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.9375rem;
    font-weight: bold;
    color: var(--navy);
    text-decoration: none;
    border-bottom: 1px dotted var(--sage);
}
body.dark-mode .jos-readmore { color: #8ab4d4; }
.jos-readmore:hover { border-bottom-style: solid; }
.jos-readmore .jos-arrow {
    display: inline-block;
    transition: transform 0.15s;
}
.jos-readmore:hover .jos-arrow { transform: translateY(2px); }

/* == Calculator / tool card =========================== */
.jos-tool-card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    padding: 28px 32px;
    margin: 0 auto 2rem;
    max-width: 760px;
}
body.dark-mode .jos-tool-card {
    background-color: #1e1e1e;
    box-shadow: none;
    border: 1px solid #2a2a2a;
}
.jos-tool-card h2 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.5rem;
    font-weight: normal;
    color: var(--navy);
    margin: 0 0 6px;
    text-align: center;
}
body.dark-mode .jos-tool-card h2 { color: #8ab4d4; }
.jos-tool-card .jos-tool-note {
    font-size: 13px;
    color: var(--charcoal);
    opacity: 0.7;
    text-align: center;
    margin: 0 0 18px;
}
body.dark-mode .jos-tool-card .jos-tool-note { color: #a0a0a0; opacity: 1; }

/* Form controls inside a tool card */
.jos-tool-card label { font-weight: bold; font-size: 0.9375rem; }
.jos-tool-card select,
.jos-tool-card input[type="text"],
.jos-tool-card input[type="number"] {
    font-size: 14px;
    padding: 6px 8px;
    border: 1px solid #c5bca8;
    border-radius: 4px;
    background-color: #ffffff;
    color: var(--charcoal);
    font-family: inherit;
    margin: 3px 2px;
}
body.dark-mode .jos-tool-card select,
body.dark-mode .jos-tool-card input[type="text"],
body.dark-mode .jos-tool-card input[type="number"] {
    background-color: #121212;
    color: #e0e0e0;
    border-color: #444;
}
.jos-tool-card select:focus-visible,
.jos-tool-card input:focus-visible {
    outline: 2px solid #09497a;
    outline-offset: 1px;
}
body.dark-mode .jos-tool-card select:focus-visible,
body.dark-mode .jos-tool-card input:focus-visible { outline-color: #8ab4d4; }

.jos-submit {
    display: inline-block;
    margin-top: 14px;
    background-color: var(--sage);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    padding: 9px 22px;
    font-size: 14px;
    font-weight: bold;
    font-family: inherit;
    transition: filter 0.15s;
}
.jos-submit:hover { filter: brightness(1.1); }
.jos-submit:focus-visible { outline: 2px solid #09497a; outline-offset: 2px; }
body.dark-mode .jos-submit { color: #121212; }
body.dark-mode .jos-submit:focus-visible { outline-color: #8ab4d4; }

/* A horizontal rule used inside tool cards to divide inputs */
.jos-tool-card hr {
    border: none;
    border-top: 1px solid var(--cream);
    margin: 18px 0;
}
body.dark-mode .jos-tool-card hr { border-top-color: #333; }

/* Live-output line (e.g. soundex result) */
.jos-output {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.375rem;
    color: var(--navy);
    text-align: center;
    margin: 0 0 12px;
    min-height: 1.6em;
}
body.dark-mode .jos-output { color: #8ab4d4; }

/* == About section (ported InfoFile, bottom of page) === */
.jos-about {
    max-width: 820px;
    margin: 2.5rem auto 0;
    padding-top: 1.75rem;
    border-top: 2px solid var(--sage);
    scroll-margin-top: 1rem;   /* so the anchor jump clears the top edge */
}
.jos-about__eyebrow {
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--sage);
    text-align: center;
    margin: 0 0 4px;
}
body.dark-mode .jos-about__eyebrow { color: #a8b361; }
.jos-about h2 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.75rem;
    font-weight: normal;
    color: var(--navy);
    text-align: center;
    margin: 0 0 1.25rem;
}
body.dark-mode .jos-about h2 { color: #8ab4d4; }
.jos-about h3 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.25rem;
    color: var(--navy);
    margin: 1.5rem 0 0.5rem;
}
body.dark-mode .jos-about h3 { color: #8ab4d4; }
.jos-about p,
.jos-about li {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--charcoal);
}
body.dark-mode .jos-about p,
body.dark-mode .jos-about li { color: #c8c0b0; }
.jos-about a { color: var(--navy); text-decoration: underline; }
body.dark-mode .jos-about a { color: #8ab4d4; }
.jos-about table {
    border-collapse: collapse;
    margin: 1rem auto;
}
.jos-about table td,
.jos-about table th {
    border: 1px solid #c8d8e2;
    padding: 5px 12px;
    font-size: 0.875rem;
    color: var(--charcoal);
}
body.dark-mode .jos-about table td,
body.dark-mode .jos-about table th { border-color: #333; color: #c8c0b0; }
.jos-about table th {
    background-color: #09497a;
    color: #ffffff;
}
body.dark-mode .jos-about table th { background-color: #0d2a45; }
.jos-about dl { margin: 1.1rem 0; }
.jos-about dt {
    font-weight: bold;
    color: var(--navy);
    margin-top: 10px;
    font-size: 0.9375rem;
}
body.dark-mode .jos-about dt { color: #8ab4d4; }
.jos-about dd {
    margin: 2px 0 0 1.5rem;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--charcoal);
}
body.dark-mode .jos-about dd { color: #c8c0b0; }
.jos-hebrew { font-size: 1.15em; unicode-bidi: isolate; }
.jos-about__attribution {
    margin-top: 2rem;
    font-size: 12px;
    font-style: italic;
    color: var(--charcoal);
    opacity: 0.7;
}
body.dark-mode .jos-about__attribution { color: #a0a0a0; opacity: 1; }
.jos-backtop {
    display: block;
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    font-weight: bold;
    color: var(--navy);
    text-decoration: none;
}
body.dark-mode .jos-backtop { color: #8ab4d4; }
.jos-backtop:hover { text-decoration: underline; }

/* == Inline results panel (fragment injected from backend) == */
.jos-results {
    max-width: 760px;
    margin: 0 auto 2rem;
}
.jos-results__state {
    text-align: center;
    padding: 34px 20px;
    color: var(--charcoal);
    font-size: 0.9375rem;
}
body.dark-mode .jos-results__state { color: #c8c0b0; }
.jos-results__spinner {
    display: inline-block;
    width: 26px; height: 26px;
    border: 3px solid #e8edf0;
    border-top-color: var(--navy);
    border-radius: 50%;
    animation: jos-spin 0.7s linear infinite;
    margin-bottom: 10px;
}
@keyframes jos-spin { to { transform: rotate(360deg); } }
.jos-results__error { color: #b03030; }
body.dark-mode .jos-results__error { color: #e08080; }

/* Restyle the injected legacy results markup into JG40.
   CSS background beats the inline BGCOLOR attributes. */
.jos-results-card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    padding: 24px 28px;
}
body.dark-mode .jos-results-card {
    background-color: #1e1e1e;
    box-shadow: none;
    border: 1px solid #2a2a2a;
}
.jos-results-card h1 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.5rem; font-weight: normal;
    color: var(--navy); text-align: center; margin: 0 0 10px;
}
body.dark-mode .jos-results-card h1 { color: #8ab4d4; }
.jos-results-card h2,
.jos-results-card h3 {
    font-family: Georgia, 'Times New Roman', serif;
    color: var(--navy); font-weight: normal;
    margin: 1.1rem 0 0.4rem;
}
body.dark-mode .jos-results-card h2,
body.dark-mode .jos-results-card h3 { color: #8ab4d4; }
.jos-results-card hr {
    border: none; border-top: 1px solid var(--cream); margin: 14px 0;
}
body.dark-mode .jos-results-card hr { border-top-color: #333; }
.jos-results-card table {
    width: 100%;
    border-collapse: collapse;
    background-color: #ffffff;
    margin: 0.5rem 0;
}
body.dark-mode .jos-results-card table { background-color: #1e1e1e; }
.jos-results-card table th {
    background-color: #09497a;
    color: #ffffff;
    font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.5px;
    padding: 7px 10px; text-align: left;
}
body.dark-mode .jos-results-card table th { background-color: #0d2a45; }
.jos-results-card table td {
    border: 1px solid #c8d8e2;
    padding: 6px 10px;
    font-size: 0.875rem;
    color: var(--charcoal);
    background-color: transparent;
}
body.dark-mode .jos-results-card table td { border-color: #333; color: #c8c0b0; }
.jos-results-card a { color: var(--navy); font-weight: bold; text-decoration: none; }
body.dark-mode .jos-results-card a { color: #8ab4d4; }
.jos-results-card a:hover { text-decoration: underline; }
.jos-results-card img { vertical-align: middle; }
.jos-results-card cite { font-size: 12px; color: var(--charcoal); opacity: 0.7; }
body.dark-mode .jos-results-card cite { color: #a0a0a0; opacity: 1; }

/* == Landing page tile grid =========================== */
.jos-lede {
    max-width: 760px;
    margin: 0 auto 2rem;
    text-align: center;
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--charcoal);
}
body.dark-mode .jos-lede { color: #c8c0b0; }
.jos-tile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}
.jos-tile {
    display: block;
    background-color: #ffffff;
    border-radius: 8px;
    border-left: 4px solid var(--sage);
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    padding: 22px 24px;
    text-decoration: none;
    transition: box-shadow 0.15s, transform 0.15s;
}
body.dark-mode .jos-tile {
    background-color: #1e1e1e;
    box-shadow: none;
    border: 1px solid #2a2a2a;
    border-left: 4px solid #a8b361;
}
.jos-tile:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    transform: translateY(-2px);
    text-decoration: none;
}
.jos-tile__title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.25rem;
    color: var(--navy);
    margin: 0 0 6px;
}
body.dark-mode .jos-tile__title { color: #8ab4d4; }
.jos-tile__desc {
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--charcoal);
    margin: 0;
}
body.dark-mode .jos-tile__desc { color: #c8c0b0; }
.jos-tile__cta {
    display: inline-block;
    margin-top: 12px;
    font-size: 0.875rem;
    font-weight: bold;
    color: var(--sage);
}
body.dark-mode .jos-tile__cta { color: #a8b361; }
.jos-tile.is-soon { opacity: 0.72; }
.jos-tile.is-soon .jos-tile__cta { color: #999; }
.jos-tile-soon-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #999;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 2px 7px;
    margin-left: 8px;
    vertical-align: middle;
}
body.dark-mode .jos-tile-soon-badge { color: #666; border-color: #444; }

/* == Responsive ======================================= */
@media (max-width: 700px) {
    .jos-tile-grid { grid-template-columns: 1fr; }
    .jos-shell { padding: 0 1rem 2rem; }
    .jos-tool-card { padding: 20px 18px; }
}