*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.65;
    color: #2d2a26;
    background-color: #f5f0e8;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E"),
        linear-gradient(90deg, rgba(200,180,150,0.04) 1px, transparent 1px),
        linear-gradient(rgba(200,180,150,0.04) 1px, transparent 1px),
        linear-gradient(170deg, #f5f0e8 0%, #ede6da 40%, #f0ebe3 70%, #f5f0e8 100%);
    background-size: 200px 200px, 24px 24px, 24px 24px, 100% 100%;
    background-attachment: fixed;
    font-size: 16px;
}

a { color: #8b6914; font-weight: 500; text-decoration: underline; text-decoration-color: #d4b96a; text-underline-offset: 2px; transition: color 0.15s; }
a:hover { color: #1a2744; text-decoration-color: #1a2744; }
a:visited { color: #7a5c12; }

/* ── Header ── */
.site-header {
    background: linear-gradient(180deg, #faf8f4 0%, #f5f0e8 100%);
    border-bottom: 1px solid #ddd3c4;
    padding: 0;
}
.header-inner {
    max-width: 1060px;
    margin: 0 auto;
    padding: 0.9rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.site-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}
.site-brand a.brand-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}
.site-brand img.site-logo {
    display: block;
    height: 38px;
    width: auto;
}
.site-tagline {
    font-size: 0.82rem;
    color: #7a7062;
    font-weight: 400;
}

/* ── Language switcher ── */
.lang-switch {
    display: flex;
    gap: 0.15rem;
    align-items: center;
    font-size: 0.72rem;
}
.lang-switch a {
    color: #7a7062;
    text-decoration: none;
    padding: 0.15rem 0.35rem;
    border-radius: 3px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}
.lang-switch a:hover { background: #ece5d9; color: #1a2744; }
.lang-switch a:visited { color: #7a7062; }
.lang-switch a.active {
    background: #1a2744;
    color: #f5f0e8;
    font-weight: 600;
}
.lang-switch a.active:visited { color: #f5f0e8; }

/* ── Navigation ── */
.site-nav {
    background: #1a2744;
}
.nav-inner {
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: stretch;
    gap: 0;
}

/* Hamburger */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #ddd3c4;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.6rem 1rem;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

/* Nav links */
.nav-links {
    display: flex;
    align-items: stretch;
    gap: 0;
    flex-wrap: wrap;
}
.nav-links > a,
.nav-dropdown > .nav-dropdown-label {
    color: #c4b5a4;
    padding: 0.55rem 0.85rem;
    display: flex;
    align-items: center;
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
    white-space: nowrap;
    background: none;
    border: none;
    font-family: inherit;
}
.nav-links > a:visited,
.nav-dropdown > .nav-dropdown-label:visited { color: #c4b5a4; }
.nav-links > a:hover,
.nav-dropdown:hover > .nav-dropdown-label { background: #263858; color: #f5f0e8; text-decoration: none; }
.nav-links > a.active { color: #f5f0e8; border-bottom: 2px solid #b8860b; }

/* Dropdown */
.nav-dropdown {
    position: relative;
}
.nav-dropdown-label::after {
    content: ' \25BE';
    font-size: 0.7em;
    margin-left: 0.3rem;
    opacity: 0.7;
}
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #faf8f4;
    border: 1px solid #ddd3c4;
    border-top: 2px solid #b8860b;
    min-width: 240px;
    z-index: 100;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}
.nav-dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    color: #2d2a26;
    font-size: 0.88rem;
    text-decoration: none;
    font-weight: 400;
    border-bottom: 1px solid #ece5d9;
    transition: background 0.1s;
}
.nav-dropdown-menu a:last-child { border-bottom: none; }
.nav-dropdown-menu a:hover { background: #ece5d9; color: #1a2744; }
.nav-dropdown-menu .dropdown-heading {
    padding: 0.4rem 1rem 0.2rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #7a7062;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: default;
}
.nav-dropdown-menu .dropdown-heading:hover { background: transparent; }

/* ── Main content ── */
.site-main {
    max-width: 1060px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
    min-height: 60vh;
}
.site-main h1 {
    font-family: 'Lora', Georgia, serif;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #1a2744;
    line-height: 1.3;
}
.site-main h2 {
    font-family: 'Lora', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.75rem 0 0.75rem;
    color: #3d3428;
    border-bottom: 1px solid #ddd3c4;
    padding-bottom: 0.35rem;
}
.site-main h3 {
    font-family: 'Lora', Georgia, serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: #1a2744;
    margin-bottom: 0.3rem;
}
.site-main p {
    margin-bottom: 0.85rem;
    color: #3d3428;
}
.site-main ul, .site-main ol {
    margin: 0.5rem 0 1rem 1.5rem;
}
.site-main li {
    margin-bottom: 0.3rem;
}

/* ── Cards ── */
.card {
    background: #faf8f4;
    border: 1px solid #ddd3c4;
    border-radius: 4px;
    padding: 1.1rem 1.35rem;
    margin-bottom: 0.85rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.02);
    position: relative;
    transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.04);
    transform: translateY(-1px);
}
.card h3 {
    margin-bottom: 0.3rem;
}
.card h3 a { text-decoration: none; color: #1a2744; }
.card h3 a:hover { text-decoration: underline; text-decoration-color: #b8860b; color: #b8860b; }
/* An h2 (for a correct outline) that looks like the standard h3. */
.site-main h2.subhead {
    font-size: 1.05rem;
    color: #1a2744;
    margin: 0 0 0.3rem;
    padding-bottom: 0;
    border-bottom: 0;
}
.card p {
    font-size: 0.92rem;
    color: #5b4a3f;
    margin-bottom: 0.3rem;
}
.card .meta {
    font-size: 0.8rem;
    color: #9a8d7e;
}

/* ── Forms ── */
label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    color: #3d3428;
}
input[type="text"],
input[type="email"],
input[type="date"],
select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #c4b5a4;
    border-radius: 4px;
    font-size: 0.92rem;
    font-family: inherit;
    background: #fff;
    color: #2d2a26;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
    /* Date inputs render their inner text centered by default in
       some browsers; force left-align so they match text/email. */
    text-align: left;
}
/* ── iOS Safari date-input left alignment ──
   iOS renders date inputs as a centering flex container with
   internal pseudo-elements that ignore text-align. We need
   !important to override the UA stylesheet. */
input[type="date"] {
    -webkit-appearance: none !important;
    appearance: none !important;
    display: block !important;
    text-align: left !important;
    min-height: 2.4rem;
}
input[type="date"]::-webkit-datetime-edit {
    text-align: left !important;
    display: block !important;
    padding: 0;
}
input[type="date"]::-webkit-datetime-edit-fields-wrapper {
    text-align: left !important;
    display: flex !important;
    justify-content: flex-start !important;
}
input[type="date"]::-webkit-date-and-time-value {
    text-align: left !important;
    margin: 0;
}
input:focus, select:focus {
    outline: none;
    border-color: #b8860b;
    box-shadow: 0 0 0 3px rgba(184,134,11,0.12);
}
.form-group {
    margin-bottom: 0.85rem;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}
.help-text {
    font-size: 0.78rem;
    color: #9a8d7e;
    margin-top: 0.2rem;
}

/* ── Type-ahead combobox (translation picker) ── */
.combobox {
    position: relative;
}
.combobox-input {
    width: 100%;
    padding-right: 2rem !important;
}
.combobox-caret {
    position: absolute;
    right: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #7a7062;
    font-size: 0.8rem;
}
.combobox-list {
    position: absolute;
    z-index: 9999;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    margin: 0;
    padding: 0.25rem 0;
    list-style: none;
    background: #fff;
    border: 1px solid #c4b5a4;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.combobox-list[hidden] { display: none; }
.combobox-group {
    padding: 0.3rem 0.75rem 0.15rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9a8d7e;
    font-weight: 600;
    background: #faf8f4;
    border-top: 1px solid #ece5d9;
}
.combobox-list li:first-child.combobox-group { border-top: none; }
.combobox-option {
    padding: 0.4rem 0.75rem;
    font-size: 0.92rem;
    color: #2d2a26;
    cursor: pointer;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}
.combobox-option:hover,
.combobox-option[aria-selected="true"] {
    background: #fdf8ec;
}
.combobox-option .combobox-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.78rem;
    color: #8b6914;
    font-weight: 600;
}
.combobox-option mark {
    background: #fdf0c9;
    color: inherit;
    padding: 0;
}

/* ── Buttons ── */
.btn {
    display: inline-block;
    padding: 0.55rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
    background: linear-gradient(180deg, #b8860b 0%, #9a7209 100%);
    color: #fff;
    box-shadow: 0 2px 4px rgba(184,134,11,0.3);
}
.btn-primary:hover { background: linear-gradient(180deg, #c99610 0%, #b8860b 100%); color: #fff; }
.btn-primary:visited { color: #fff; }
.badge-new {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: #b8860b;
    color: #fff;
    padding: 0.12em 0.45em;
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 0.25rem;
}
.btn-secondary {
    background: #ddd3c4;
    color: #3d3428;
}
.btn-secondary:hover { background: #c4b5a4; color: #1a2744; }
.btn-danger {
    background: #8b3a3a;
    color: #f5f0e8;
}
.btn-danger:hover { background: #6e2d2d; color: #f5f0e8; }
.btn-danger:visited { color: #f5f0e8; }
.btn-small {
    padding: 0.3rem 0.8rem;
    font-size: 0.82rem;
}

/* ── Alerts ── */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 0.85rem;
    font-size: 0.9rem;
}
.alert-success {
    background: #e8f0e4;
    border: 1px solid #b8cfae;
    color: #3d5a32;
}
.alert-error {
    background: #f0e4e4;
    border: 1px solid #cfaeae;
    color: #8b3a3a;
}
.alert-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
}
.alert-info {
    background: #e4eaf0;
    border: 1px solid #aebfcf;
    color: #2c4a6e;
}

/* ── FAQ ── */
dt {
    font-family: 'Lora', Georgia, serif;
    font-weight: 600;
    color: #1a2744;
    margin-top: 1.1rem;
    font-size: 1rem;
}
dd {
    margin: 0.3rem 0 0 0;
    color: #3d3428;
}

/* ── Footer ── */
.site-footer {
    background: #2d2a26;
    color: #a39171;
    padding: 1.75rem 1.5rem;
    margin-top: 2.5rem;
    font-size: 0.82rem;
}
.footer-inner {
    max-width: 1060px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
}
.footer-col h2 {
    font-family: 'Lora', Georgia, serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #ddd3c4;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.footer-col a {
    color: #c4b5a4;
    text-decoration: none;
    display: block;
    padding: 0.15rem 0;
    font-weight: 400;
}
.footer-col a:hover { color: #f5f0e8; }
.footer-col a:visited { color: #c4b5a4; }
.footer-col p { color: #a39171; margin-bottom: 0.3rem; font-size: 0.82rem; }
.footer-bottom {
    max-width: 1060px;
    margin: 1rem auto 0;
    padding-top: 0.75rem;
    border-top: 1px solid #4a453d;
    text-align: center;
    font-size: 0.78rem;
    color: #7a7062;
}

/* ── Layout helpers ── */
.page-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 2.5rem;
    align-items: start;
}
.sidebar {
    position: sticky;
    top: 1rem;
}
.sidebar h2 {
    font-family: 'Lora', Georgia, serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #3d3428;
    margin: 0 0 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #ddd3c4;
}
.sidebar-plan-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.sidebar-plan-list li {
    margin-bottom: 0;
}
.sidebar-plan-list a {
    display: block;
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
    text-decoration: none;
    color: #5b4a3f;
    border-bottom: 1px solid #ece5d9;
    border-radius: 2px;
    transition: background 0.1s;
}
.sidebar-plan-list a:hover { color: #1a2744; background: #ece5d9; }
.sidebar-cat-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #9a8d7e;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.7rem;
    margin-bottom: 0.15rem;
}

/* ── Ornamental divider ── */
.ornament-divider {
    text-align: center;
    margin: 1.5rem 0;
    color: #c4b5a4;
    font-size: 1.2rem;
    line-height: 1;
    overflow: hidden;
}
.ornament-divider::before,
.ornament-divider::after {
    content: '';
    display: inline-block;
    width: 40%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #c4b5a4);
    vertical-align: middle;
    margin: 0 0.75rem;
}
.ornament-divider::after {
    background: linear-gradient(90deg, #c4b5a4, transparent);
}

/* ── Utility ── */
.text-center { text-align: center; }
.text-muted { color: #9a8d7e; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none; }

/* Screen reader only (skip link) */
.sr-only {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    background: #faf8f4;
    padding: 0.5rem 1rem;
    z-index: 1000;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid #ddd3c4;
    border-top-color: #b8860b;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-left: 0.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 768px) {
    .page-with-sidebar {
        grid-template-columns: minmax(0, 1fr);
    }
    .sidebar {
        position: static;
        margin-top: 2rem;
    }
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    /* Reading schedule: scroll inside the box if a row is ever too wide */
    .month-body {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}
@media (max-width: 640px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.7rem 1rem;
        position: relative;
    }
    .site-tagline { display: none; }
    .lang-switch {
        position: absolute;
        top: 0.7rem;
        right: 1rem;
    }
    .nav-toggle { display: block; }
    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
    }
    .nav-links.open { display: flex; }
    .nav-links > a,
    .nav-dropdown > .nav-dropdown-label {
        padding: 0.5rem 1rem;
        border-top: 1px solid rgba(255,255,255,0.08);
    }
    .nav-dropdown-menu {
        position: static;
        border: none;
        border-top: none;
        box-shadow: none;
        background: #263858;
        min-width: 0;
    }
    .nav-dropdown-menu a {
        color: #c4b5a4;
        padding-left: 2rem;
        border-bottom-color: rgba(255,255,255,0.05);
    }
    .nav-dropdown-menu a:hover { background: #1a2744; color: #f5f0e8; }
    .nav-dropdown-menu .dropdown-heading { color: #7a7062; padding-left: 2rem; }
    .nav-dropdown:hover .nav-dropdown-menu { display: none; }
    .nav-dropdown.open .nav-dropdown-menu { display: block; }
    .form-row { grid-template-columns: 1fr; }
    .site-main { padding: 1.25rem 1rem; }
    .site-main h1 { font-size: 1.4rem; }
    /* Cards single column */
    .plan-grid { grid-template-columns: 1fr; }
    /* How-it-works steps stack */
    .how-it-works { grid-template-columns: 1fr; }
}
/* Touch device support for nav dropdowns */
@media (hover: none) {
    .nav-dropdown:hover .nav-dropdown-menu {
        display: none;
    }
    .nav-dropdown.open .nav-dropdown-menu {
        display: block;
    }
}

/* ── Embed mode (iframe) ── */
body.embed-mode .site-header,
body.embed-mode .site-nav,
body.embed-mode .site-footer,
body.embed-mode .sidebar,
body.embed-mode .amazon-section,
body.embed-mode .amazon-support,
body.embed-mode .resources-aside,
body.embed-mode .sidebar-subscribe,
body.embed-mode .plan-nav-links { display: none !important; }
body.embed-mode .page-with-sidebar { grid-template-columns: minmax(0, 1fr); gap: 0; }
body.embed-mode .site-main { padding: 1rem; }
body.embed-mode { background: #fff; }
/* Embed-mode subtle affiliate strip (only in embed mode) */
.embed-affiliate { display: none; }
body.embed-mode .embed-affiliate {
    display: block;
    text-align: center;
    font-size: 0.72rem;
    color: #9a8d7e;
    padding: 0.6rem 0.5rem 0.2rem;
    margin-top: 0.8rem;
    border-top: 1px solid #ece5d9;
}
body.embed-mode .embed-affiliate a { color: #b8860b; text-decoration: underline; }

/* Screen-only helpers (hidden when printing) */
.screen-only { display: inline-block; }

/* ── Print styles ── */
@media print {
    .site-header, .site-nav, .site-footer, .sidebar,
    .subscribe-card, .amazon-section, .amazon-support,
    .resources-aside, .nav-toggle, .screen-only,
    .tab-nav, .tab-panel:not(.active) { display: none !important; }

    body {
        background: white !important;
        color: black !important;
        font-size: 11pt;
    }
    .site-main { max-width: none; padding: 0; }
    .page-with-sidebar { display: block; }

    a { color: black !important; text-decoration: none !important; }
    a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #666; }

    .reading-schedule { page-break-inside: auto; }
    .month-section { page-break-inside: avoid; }
}
