/* Shared stylesheet for Minna no Nihongo lesson pages: Part 1 (lessons 1-25) and Part 2 (lessons 26-50). */

:root {
    --lesson-dark: #212529;
    --lesson-soft: #f8f9fa;
}

body {
    background: var(--lesson-soft);
    color: #212529;
    line-height: 1.82;
}

.hero {
    background: linear-gradient(135deg, #212529, #495057);
    color: #fff;
    padding: 64px 0;
}
.hero h1,
.hero .lead,
.hero p {
    color: #fff;
}
/* rirekisho.css sets `header h1 { color: black !important }` site-wide. The hero is now a <section>
   (so that rule no longer matches) and the h1 also has an inline white style — belt and braces. */
.hero h1 {
    color: #fff !important;
}
/* Grammar ⇄ vocabulary buttons in the lesson hero */
.mn-hero-links { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.4rem; }
.mn-hero-links a {
    display: inline-flex; align-items: center; gap: .45rem; padding: .55rem 1rem; border-radius: 999px;
    font-weight: 600; font-size: .92rem; text-decoration: none; color: #212529; background: #fff;
}
.mn-hero-links a:hover { background: #ffc107; color: #212529; }
.mn-hero-links a.alt { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.45); }
.mn-hero-links a.alt:hover { background: rgba(255,255,255,.12); color: #fff; }

.grammar-card {
    border: 0;
    box-shadow: 0 .35rem 1rem rgba(0,0,0,.07);
    margin-bottom: 28px;
}

.jp {
    font-size: 1.14rem;
    font-weight: 600;
    line-height: 2.25;
}

.jp-lg {
    font-size: 1.38rem;
    font-weight: 700;
    line-height: 2.3;
}

.romaji {
    color: #6c757d;
    font-style: italic;
}

.teacher-note,
.warning-note,
.real-life,
.comparison-note,
.extra-note,
.extension-note,
.usage-note {
    padding: 16px 18px;
    border-radius: 8px;
}

.teacher-note { border-left: 5px solid #0d6efd; background: #eef5ff; }
.warning-note { border-left: 5px solid #dc3545; background: #fff1f2; }
.real-life { border-left: 5px solid #198754; background: #eefaf3; }
.comparison-note,
.usage-note { border-left: 5px solid #6f42c1; background: #f5f0ff; }
.extra-note,
.extension-note { border-left: 5px solid #fd7e14; background: #fff7ed; }

.pattern {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    background: #212529;
    color: #fff;
    padding: 12px 14px;
    border-radius: 8px;
    display: block;
    overflow-x: auto;
}

.sticky-nav {
    position: sticky;
    top: 0;
    z-index: 1020;
}

.section-title { scroll-margin-top: 110px; }

/* Table of contents: a normal list at the top of the main content column. */
.mn-toc {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 32px;
}

.mn-toc-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #6c757d;
    margin-bottom: 10px;
}

.mn-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 2px 10px;
}

.mn-toc-list a {
    display: block;
    padding: 6px 10px;
    border-left: 2px solid transparent;
    border-radius: 0 6px 6px 0;
    font-size: .86rem;
    line-height: 1.4;
    color: #495057;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.mn-toc-list a:hover {
    background: #f1f3f5;
    color: #212529;
}

.mn-toc-list a.active {
    background: #eef5ff;
    border-left-color: #0d6efd;
    color: #0d6efd;
    font-weight: 600;
}

@media (max-width: 575.98px) {
    .mn-toc-list { grid-template-columns: 1fr; }
    .mn-toc-list a { white-space: normal; }
}

.example-block {
    border-bottom: 1px solid #e9ecef;
    padding: 17px 0;
}
.example-block:last-child { border-bottom: 0; }

.mini-title {
    font-weight: 700;
    color: #495057;
    margin-bottom: 4px;
}

.meaning {
    color: #495057;
    margin-top: -4px;
}

.answer { display: none; }

table td,
table th {
    vertical-align: middle;
}

ruby { ruby-position: over; }

ruby rt {
    font-size: .58em;
    font-weight: 500;
    color: #6c757d;
    line-height: 1;
}

.hero ruby rt,
.table-dark ruby rt,
.bg-dark ruby rt,
.pattern ruby rt,
footer ruby rt {
    color: #dee2e6;
}

.badge-soft,
.soft-badge {
    background: #e9ecef;
    color: #212529;
    font-weight: 600;
}

.formula-arrow {
    font-weight: 700;
    color: #0d6efd;
}

.good { color: #146c43; font-weight: 700; }
.bad { color: #b02a37; font-weight: 700; }
code { color: #b02a37; }

.pair-arrow {
    font-size: 1.2rem;
    font-weight: 700;
    color: #6c757d;
}

.flow-arrow,
.timeline-arrow {
    font-size: 1.5rem;
    font-weight: 700;
}

.arrow {
    font-weight: 700;
    color: #6c757d;
    padding: 0 .35rem;
}

.state-box,
.flow-box,
.rule-box {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 16px;
    height: 100%;
}

.formula-box {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 14px 16px;
}

.level {
    font-size: .82rem;
    font-weight: 700;
    padding: .25rem .55rem;
    border-radius: 999px;
    background: #e9ecef;
    display: inline-block;
}

.mini-badge { font-size: .8rem; }

.key-idea { font-size: 1.05rem; }

.key-point {
    font-weight: 700;
    color: #0d6efd;
}

/* ------------------------------------------------------------------
   Readable text on dark blocks (e.g. "Final memory map").
   assets/css/rirekisho.css sets `p { color: black; }` site-wide, which
   overrides Bootstrap's .text-white inheritance and made paragraph
   text black-on-black inside .bg-dark cards. Re-assert white here.
   ------------------------------------------------------------------ */
.bg-dark p,
.bg-dark li,
.bg-dark strong,
.bg-dark b,
.bg-dark h2,
.bg-dark h3,
.bg-dark h4,
.bg-dark h5,
.text-white p,
.text-white li,
.text-white strong {
    color: #fff;
}

.bg-dark .meaning,
.bg-dark .romaji {
    color: #dee2e6;
}
