/*
 * Shared site chrome + new-page components for the reorganized site.
 * Loaded on every page AFTER css/styles.min.css; reuses its :root vars.
 */

/* ---------- Header bar (injected by js/layout.js) ---------- */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 24px;
    padding: 0.8em 1.5em;
    text-align: left;
}
.site-brand {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 10px;
}
.site-header h1 {
    font-size: 1.35em;
    letter-spacing: 0.5px;
    margin: 0;
}
.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    flex: 1;
    min-width: 0;
}
.site-nav a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92em;
    padding: 7px 11px;
    border-radius: 18px;
    white-space: nowrap;
    transition:
        background 0.2s ease,
        color 0.2s ease;
}
.site-nav a:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}
.site-nav a[aria-current="page"] {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-weight: 600;
}
.site-header .language-selector {
    margin-bottom: 0;
}
@media (max-width: 900px) {
    .site-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0.9em 0.75em;
    }
    .site-nav {
        justify-content: center;
    }
}

/* ---------- Footer sitemap (injected by js/layout.js) ---------- */
.site-footer {
    text-align: left;
    padding: 2.5em 1.5em 1.5em;
}
.site-footer-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 24px;
    max-width: 960px;
    margin: 0 auto;
}
.site-footer-columns h4 {
    margin: 0 0 0.6em;
    font-size: 1em;
    letter-spacing: 0.5px;
    color: #fff;
}
.site-footer-columns ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.site-footer-columns li {
    margin: 0.35em 0;
}
.site-footer-columns a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.92em;
}
.site-footer-columns a:hover {
    color: #fff;
    text-decoration: underline;
}
.site-footer .footer-copyright {
    text-align: center;
    margin: 2em 0 0;
    padding-top: 1.2em;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.8);
}

/* ---------- CTA buttons ---------- */
.cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    margin-top: 1.5em;
}
.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 28px;
    border-radius: 28px;
    font-weight: 600;
    font-size: 1.05em;
    text-decoration: none;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}
.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}
.cta-primary {
    background: var(--accent-color);
    color: #fff;
}
.cta-primary:hover {
    background: var(--hover-color);
}
.cta-secondary {
    background: #fff;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
}

/* ---------- Landing: how it works ---------- */
.page-section {
    max-width: 1080px;
    margin: 0 auto;
    padding: 40px 20px;
}
.page-section > h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 0.4em;
}
.page-section > .section-lead {
    text-align: center;
    max-width: 680px;
    margin: 0 auto 1.8em;
    color: var(--text-color);
    opacity: 0.85;
}
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 20px;
}
.step-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
    padding: 24px 20px;
    text-align: center;
}
.step-card .step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--accent-color);
    color: #fff;
    font-weight: 700;
    margin-bottom: 12px;
}
.step-card i {
    color: var(--accent-color);
    font-size: 1.5em;
    margin-bottom: 10px;
    display: block;
}
.step-card h3 {
    margin: 0 0 0.4em;
    font-size: 1.05em;
    color: var(--primary-color);
}
.step-card p {
    margin: 0;
    font-size: 0.92em;
    opacity: 0.85;
}

/* ---------- Continue-learning strip (returning users) ---------- */
.continue-strip {
    background: var(--primary-color);
    color: #fff;
    border-radius: 12px;
    padding: 18px 24px;
    margin: 24px auto 0;
    max-width: 860px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.continue-strip .streak-flame {
    color: #f39c12;
}
.continue-strip p {
    margin: 0;
}
.continue-strip .continue-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.continue-strip a.cta-btn {
    padding: 9px 20px;
    font-size: 0.95em;
}
a.section-card {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* ---------- Level badges ---------- */
.level-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 14px;
    font-size: 0.78em;
    font-weight: 600;
    letter-spacing: 0.4px;
    background: var(--accent-color);
    color: #fff;
    white-space: nowrap;
}
.level-badge.badge-section-1 {
    background: #1e8449;
}
.level-badge.badge-section-2 {
    background: #1a5c8f;
}
.level-badge.badge-section-3 {
    background: #996600;
}
.level-badge.badge-section-4 {
    background: #7d3c98;
}
.level-badge.badge-section-5 {
    background: #c0392b;
}

/* ---------- Stories index ---------- */
.story-group {
    max-width: 1080px;
    margin: 0 auto;
    padding: 26px 20px 6px;
}
.story-group-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 12px;
    border-bottom: 2px solid rgba(26, 92, 143, 0.2);
    padding-bottom: 10px;
    margin-bottom: 18px;
}
.story-group-header h2 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.3em;
}
.story-group-header .story-group-desc {
    flex-basis: 100%;
    margin: 4px 0 0;
    font-size: 0.95em;
    opacity: 0.85;
}
.story-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 16px;
}
.story-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
    padding: 18px;
    text-decoration: none;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}
.story-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.14);
}
.story-card .story-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.story-card h3 {
    margin: 0;
    font-size: 1em;
    color: var(--primary-color);
}
.story-card p {
    margin: 0;
    font-size: 0.88em;
    opacity: 0.8;
}
.story-card .story-card-done {
    color: var(--success-color);
    font-size: 1.05em;
}
.story-card.completed {
    border-left: 4px solid var(--success-color);
}

/* ---------- Breadcrumb + story header (day.html) ---------- */
.breadcrumb {
    font-size: 0.88em;
    margin-bottom: 14px;
    color: var(--text-color);
    opacity: 0.85;
}
.breadcrumb a {
    color: var(--accent-color);
    text-decoration: none;
}
.breadcrumb a:hover {
    text-decoration: underline;
}
.breadcrumb .crumb-sep {
    margin: 0 6px;
    opacity: 0.6;
}
.story-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 6px 0 4px;
    font-size: 0.92em;
}
.story-meta .story-duration {
    opacity: 0.75;
}
.lesson-secondary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin: 18px 0;
}
.lesson-secondary-actions a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--accent-color);
    background: rgba(26, 92, 143, 0.08);
    border-radius: 20px;
    padding: 8px 16px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95em;
}
.lesson-secondary-actions a:hover {
    background: rgba(26, 92, 143, 0.16);
}

/* ---------- FAQ accordion ---------- */
.faq-list {
    max-width: 820px;
    margin: 0 auto;
}
.faq-item {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.07);
    margin-bottom: 12px;
    overflow: hidden;
}
.faq-item summary {
    cursor: pointer;
    padding: 16px 20px;
    font-weight: 600;
    color: var(--primary-color);
    list-style: none;
    position: relative;
    padding-right: 44px;
}
.faq-item summary::-webkit-details-marker {
    display: none;
}
.faq-item summary::after {
    content: "\002B";
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3em;
    color: var(--accent-color);
}
.faq-item[open] summary::after {
    content: "\2212";
}
.faq-item .faq-answer {
    padding: 0 20px 16px;
    line-height: 1.6;
}
.faq-item .faq-answer a {
    color: var(--accent-color);
}

/* ---------- Article pages (learn guides, teachers, course) ---------- */
.article-container {
    max-width: 780px;
    margin: 0 auto;
    padding: 36px 20px 60px;
    line-height: 1.7;
}
.article-container h2 {
    color: var(--primary-color);
    margin-top: 1.6em;
}
.article-container h3 {
    color: var(--primary-color);
    margin-top: 1.3em;
}
.article-container ul,
.article-container ol {
    padding-left: 1.4em;
}
.article-container li {
    margin: 0.35em 0;
}
.article-container a {
    color: var(--accent-color);
}
.article-hero {
    text-align: center;
    padding: 44px 20px 8px;
}
.article-hero h2 {
    font-size: 1.9em;
    color: var(--primary-color);
    margin: 0 0 0.3em;
}
.article-hero p {
    max-width: 640px;
    margin: 0 auto;
    opacity: 0.85;
}
.guide-demo {
    background: #fff;
    border: 1px solid rgba(26, 92, 143, 0.25);
    border-radius: 12px;
    padding: 20px;
    margin: 1.4em 0;
    text-align: center;
}
.guide-demo .demo-caption {
    font-size: 0.85em;
    opacity: 0.7;
    margin-top: 10px;
}

/* ---------- Course syllabus ---------- */
.syllabus-item {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.07);
    margin-bottom: 12px;
    overflow: hidden;
}
.syllabus-item summary {
    cursor: pointer;
    padding: 16px 20px;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--primary-color);
}
.syllabus-item summary::-webkit-details-marker {
    display: none;
}
.syllabus-item .syllabus-days {
    margin-left: auto;
    font-size: 0.85em;
    font-weight: 500;
    opacity: 0.7;
}
.syllabus-item .syllabus-body {
    padding: 0 20px 16px;
    line-height: 1.6;
}

/* ---------- Card grid for hubs (learn.html etc.) ---------- */
.hub-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}
.hub-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
    padding: 26px 22px;
    text-decoration: none;
    color: var(--text-color);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}
.hub-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.14);
}
.hub-card i {
    color: var(--accent-color);
    font-size: 1.6em;
    margin-bottom: 12px;
    display: block;
}
.hub-card h3 {
    margin: 0 0 0.4em;
    color: var(--primary-color);
    font-size: 1.1em;
}
.hub-card p {
    margin: 0;
    font-size: 0.92em;
    opacity: 0.85;
}

/* ---------- Misc ---------- */
.text-center {
    text-align: center;
}
.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;
}
.page-hero {
    background: linear-gradient(135deg, var(--primary-color), #34495e);
    color: #fff;
    text-align: center;
    padding: 56px 20px;
}
.page-hero h2 {
    font-size: 2em;
    margin: 0 0 0.4em;
}
.page-hero p {
    max-width: 660px;
    margin: 0 auto;
    opacity: 0.9;
    font-size: 1.08em;
}
