/* Takase — Phase 1 styles */

:root {
    --color-text: #1a1a1a;
    --color-bg: #fff;
    --color-bg-warm: #f8f7f5;
    --color-accent: #800000;
    --color-link: #2c5282;
    --color-muted: #666;
    --color-border: #eee;
    --font-serif: Georgia, 'Times New Roman', Times, serif;
    --font-heading: 'Exo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-sans: 'Oxygen', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Radii */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;

    /* Shadows */
    --shadow-card-hover: 0 4px 20px rgba(0,0,0,0.10);
    --shadow-btn: 0 2px 4px rgba(0,0,0,0.18), 0 4px 8px rgba(0,0,0,0.06),
                  inset 0 1px 0 rgba(255,255,255,0.2);

    /* Heading scale */
    --h1-size: 2rem;
    --h2-size: 1.5rem;
    --h3-size: 1.1rem;

    /* Button palette — primary (maroon) */
    --btn-primary-from: #a03030;
    --btn-primary-to: #800000;
    --btn-primary-border: #600;
    --btn-primary-border-bottom: #400;

    /* Button palette — secondary (dark) */
    --btn-secondary-from: #333;
    --btn-secondary-to: #1a1a1a;
    --btn-secondary-border: #111;
    --btn-secondary-border-bottom: #000;
}

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

body {
    font-family: var(--font-sans);
    color: #1a1a1a;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg-warm) url('/static/images/bg_body-repeat.jpg') repeat;
}

/* Header */
header {
    background: var(--color-bg-warm) url('/static/images/bg-header-japanese-paper.jpg') center / cover no-repeat;
    padding: 1rem 2rem;
    border-bottom: 2px solid var(--color-accent);
}
.header-inner {
    position: relative;
    max-width: 920px;
    margin: 0 auto;
}
.logo {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    text-decoration: none;
}
.logo img {
    height: 50px;
    width: auto;
}
.header-catchphrase {
    flex: 1;
    text-align: center;
}
.catchphrase-main {
    font-family: 'Times New Roman', Times, var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-accent);
    line-height: 1.2;
}
.catchphrase-sub {
    font-size: 1rem;
    color: var(--color-text);
    margin-top: 0.15rem;
}

/* Site navigation bar */
.site-nav {
    background: #1a1a1a;
    text-align: center;
    padding: 0.6rem 2rem;
}
.site-nav a {
    color: #fff;
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    margin: 0 1.4rem;
    white-space: nowrap;
}
.site-nav a:hover {
    color: #ccc;
}

/* Breadcrumb */
.breadcrumb {
    max-width: 920px;
    margin: 0 auto;
    padding: 0.5rem 2rem;
    font-size: 0.82rem;
    color: var(--color-muted);
}
.breadcrumb a {
    color: var(--color-link);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.breadcrumb a:hover {
    color: var(--color-accent);
}

/* Global headings */
h1, h2, h3 {
    font-family: var(--font-heading);
    color: var(--color-accent);
}

/* Main */
main {
    flex: 1;
    max-width: 920px;
    margin: 0 auto;
    padding: 0 2rem 2rem;
    width: 100%;
    min-height: 800px;
    background: url('/static/images/bg_body.jpg') center top no-repeat;
}

/* Hero / Index */
.hero {
    text-align: center;
    padding: 0.5rem 0 0.5rem;
}
.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.25rem;
}
.hero p {
    color: var(--color-text);
    margin-bottom: 2rem;
    text-align: left;
    line-height: 1.65;
}
.hero-intro {
    margin: 0 auto 1rem;
}
.hero-intro p {
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
}
.hero-intro p:last-child {
    margin-bottom: 1rem;
}
.hero p.hero-byline {
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.4;
    text-wrap: balance;
}
.what-we-offer {
    margin: 1.5rem auto 0;
    text-align: left;
    line-height: 1.65;
}
.what-we-offer p {
    margin-bottom: 0.75rem;
}
.name-form {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    max-width: 340px;
    margin: 0 auto;
}
.name-form input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    max-width: 200px;
}
.name-form input:focus {
    outline: none;
    border-color: #1a1a1a;
}
/* .name-form button base + hover/active: provided by .btn-secondary (components.css) */

/* Name page */
.name-page {
    text-align: center;
    padding: 2rem 0;
}
.name-page h1 {
    font-size: 2.5rem;
    margin-bottom: 0.25rem;
}
.name-page > p {
    color: #666;
    margin-bottom: 2rem;
}

.designs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}
.purchase-section {
    margin-top: 2rem;
}
.price {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
/* .buy-button base + hover/active/disabled: provided by .btn-primary (components.css) */
.buy-button-loading {
    background: linear-gradient(to bottom, #700000, #600000);
    border-color: #400;
    border-bottom-color: #300;
    cursor: wait;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.08);
}
/* a.buy-button: provided by .btn-primary (components.css) */
.buy-button-free {
    background: linear-gradient(to bottom, #333, #1a1a1a);
    border-color: #111;
    border-bottom-color: #000;
}
.buy-button-free:hover {
    background: linear-gradient(to bottom, #444, #222);
    border-color: #222;
    border-bottom-color: #111;
}
.buy-button-free:active {
    background: linear-gradient(to bottom, #111, #000);
}
.design-card .buy-button {
    margin-top: auto;
    /* padding, font-size, border-radius, border-bottom-width: provided by .btn-sm */
}
.more-designs-button {
    display: block;
    padding: 0.4rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    background: #222;
    color: #fff;
    border-radius: 4px;
    margin-top: 0.3rem;
    letter-spacing: 0.04em;
}
.more-designs-button:hover {
    background: #444;
    color: #fff;
}

/* Success page */
.success-page {
    text-align: center;
    padding: 3rem 0;
}
.success-page h1 {
    margin-bottom: 1rem;
    color: #34A853;
}
.downloads {
    margin: 2rem auto;
    max-width: 400px;
}
.downloads h2 {
    margin-bottom: 1rem;
}
.download-link {
    display: block;
    padding: 1rem;
    margin: 0.5rem 0;
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
    /* gradient, border, shadow, hover: provided by .btn-secondary (components.css) */
}
.download-note {
    margin-top: 1rem;
    color: #999;
    font-size: 0.875rem;
}

/* Error page */
.error-page {
    text-align: center;
    padding: 3rem 0;
}
.error-page h1 {
    color: #EA4335;
}

/* Design showcase grid (Section 2) */
.showcase-grid {
    display: flex;
    justify-content: center;
    gap: 1rem;
}
.showcase-grid figure {
    text-align: center;
}
.showcase-grid img {
    width: 150px;
    height: 150px;
    border-radius: 4px;
}
.showcase-grid figcaption {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: var(--color-muted);
}

/* Landing page sections */
.landing-section {
    padding: 1.5rem 0;
    border-top: 1px solid #eee;
}
.landing-section h2 {
    margin-bottom: 0.5rem;
}
.landing-section p {
    margin-bottom: 1rem;
    color: #333;
}
.landing-section p:last-child {
    margin-bottom: 0;
}
.landing-section figure.float-left {
    float: left;
    max-width: 45%;
    margin: 0.25em 1.5em 1em 0;
}
.landing-section figure.float-right {
    float: right;
    max-width: 45%;
    margin: 0.25em 0 1em 1.5em;
}
.landing-section figure img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}
.landing-section figcaption {
    font-size: 0.85rem;
    color: var(--color-muted);
    margin-top: 0.35rem;
    line-height: 1.4;
}
.landing-section::after {
    content: "";
    display: table;
    clear: both;
}

/* Design type blocks (About Our Designs) */
.design-type {
    margin-bottom: 1.5rem;
}
.design-type:last-child {
    margin-bottom: 0;
}
.design-type h2 {
    margin-bottom: 0.25rem;
}
.design-type-body {
    overflow: hidden;
}
.design-type-body img {
    float: left;
    width: 120px;
    height: auto;
    margin: 0.25rem 1.25rem 0.5rem 0;
    border-radius: 4px;
}
.design-type-body p {
    color: #333;
    margin-bottom: 0;
}
.customer-photo {
    text-align: center;
    margin: 1.5rem auto 0;
}
.customer-photo img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    float: none;
    transition: transform 0.2s, box-shadow 0.2s;
}
.customer-photo a:hover img {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.customer-photo figcaption {
    margin-top: 0.35rem;
}
.customer-photo-thanks {
    font-size: 0.8rem;
    color: var(--color-muted);
}
.samples-tagline {
    margin-top: 1.5rem;
}
.landing-cta {
    text-align: center;
}
.name-form-bottom {
    margin-top: 1.5rem;
}

/* About section (Section 7) */
.about-section {
    text-align: center;
}
.about-section blockquote {
    font-style: italic;
    margin: 1.5rem 0;
    color: #444;
}
.about-section blockquote cite {
    display: block;
    font-style: normal;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}
.about-section a {
    color: #1a1a1a;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Article typography & layout                                               */
/* ═══════════════════════════════════════════════════════════════════════════ */

article {
    font-family: var(--font-serif);
    font-size: 18px;
    line-height: 1.6;
    color: var(--color-text);
    padding: 1rem 0 2rem;
}

/* Headings */
article h1 {
    font-size: 2.25rem;
    font-weight: 500;
    line-height: 1.25;
    margin-bottom: 1rem;
}
article h2 {
    font-weight: 500;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
}
article h3 {
    font-size: 1.25rem;
    font-weight: 500;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

/* Body text */
article p {
    margin-bottom: 0.75rem;
}

/* Links */
article a {
    color: var(--color-link);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}
article a:hover {
    color: var(--color-accent);
}

/* Blockquotes */
article blockquote {
    border-left: 3px solid var(--color-accent);
    padding: 0.5rem 0 0.5rem 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #444;
}
article blockquote p {
    margin-bottom: 0.5rem;
}
article blockquote p:last-child {
    margin-bottom: 0;
}

/* Lists */
article ul, article ol {
    margin: 0.5rem 0 0.75rem 1.5rem;
}
article li {
    margin-bottom: 0.2rem;
}

/* Tables */
article table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    line-height: 1.5;
}
article th, article td {
    border: 1px solid #ccc;
    padding: 0.5rem 0.75rem;
    text-align: left;
}
article th {
    background: #f5f4f2;
    font-weight: 600;
    font-size: 0.85rem;
    color: #444;
}
article tr:nth-child(even) {
    background: #fafaf8;
}

/* Horizontal rules */
article hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 2.5rem 0;
}

/* Images — default centered block */
article img {
    display: block;
    margin: 2em auto;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Float classes for attr_list usage */
article .float-left {
    float: left;
    max-width: 45%;
    margin: 0.5em 1.5em 1em 0;
}
article .float-right {
    float: right;
    max-width: 45%;
    margin: 0.5em 0 1em 1.5em;
}

/* Figures with figcaptions */
article figure { margin: 2rem auto; text-align: center; }
article figure img { margin: 0 auto 0.5rem; }
article figcaption { font-size: 0.875rem; color: var(--color-muted); line-height: 1.4; }

/* Captions: em-only paragraph adjacent to an image paragraph */
article p:has(> img) + p:has(> em:only-child) {
    text-align: center;
    font-size: 0.875rem;
    color: var(--color-muted);
    margin-top: -1rem;
    margin-bottom: 1.5rem;
}
article p:has(> em:only-child):has(+ p > img) {
    text-align: center;
    font-size: 0.875rem;
    color: var(--color-muted);
    margin-bottom: 0.5rem;
}

/* Bold interview questions */
article p > strong:first-child:last-child {
    font-family: var(--font-sans);
    font-size: 0.95rem;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Content index (Library, Blog)                                             */
/* ═══════════════════════════════════════════════════════════════════════════ */

.content-index {
    padding: 1rem 0 2rem;
}
.content-index h1 {
    font-family: var(--font-heading);
    font-weight: 500;
    margin-bottom: 2rem;
}
.article-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.article-entry {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--color-border);
}
.article-entry:first-child {
    padding-top: 0;
}
.article-entry:last-child {
    border-bottom: none;
}
.article-entry h2 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    line-height: 1.35;
}
.article-entry h2 a {
    color: var(--color-text);
    text-decoration: none;
}
.article-entry h2 a:hover {
    color: var(--color-link);
}
.article-date {
    font-size: 0.875rem;
    color: var(--color-muted);
}
.article-desc {
    margin-top: 0.5rem;
    color: #444;
    line-height: 1.6;
}

/* Library index — flowing text layout */
.library-intro {
    margin-bottom: 2rem;
    color: #444;
    line-height: 1.7;
}
.library-category {
    margin-bottom: 2rem;
}
.library-category h2 {
    font-family: var(--font-heading);
    font-weight: 500;
    margin-bottom: 0.25rem;
}
.library-entry {
    margin-bottom: 0.5rem;
    line-height: 1.4;
}
.library-entry a {
    color: var(--color-link);
    text-decoration: none;
}
.library-entry a:hover {
    text-decoration: underline;
}
.library-subtitle {
    color: #666;
    font-style: italic;
    margin-top: -0.25rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}
.library-date {
    color: #888;
    font-family: var(--font-sans);
    font-size: 0.9rem;
}
.library-separator {
    border: none;
    border-top: 2px dashed #ccc;
    margin: 2.5rem 0 2rem;
}


/* Contact form */
.contact-prefill-note {
    background: #f0f4f8;
    border-left: 3px solid #2c5282;
    padding: 0.6rem 0.9rem;
    margin: 1rem 0 0.5rem;
    font-size: 0.9rem;
    color: #2c5282;
    max-width: 500px;
}
.contact-hp {
    position: absolute;
    left: -9999px;
    opacity: 0;
}
.contact-form {
    max-width: 500px;
    margin: 1.5rem 0;
}
.contact-field {
    margin-bottom: 1rem;
}
.contact-field label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    font-size: 0.95rem;
}
.contact-field .optional-label {
    font-weight: 400;
    color: #888;
    font-size: 0.85rem;
}
.contact-field input,
.contact-field textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
}
.contact-field input:focus,
.contact-field textarea:focus {
    outline: none;
    border-color: #1a1a1a;
}
.contact-submit {
    padding: 0.75rem 1.5rem;
    font-size: 1.125rem;
    border: none;
    transition: background 0.15s, transform 0.1s;
    /* gradient, hover, active: provided by .btn-secondary (components.css) */
}
.contact-success {
    background: #f0f9f0;
    border: 1px solid #c3e6c3;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
}
.contact-error {
    background: #fdf0f0;
    border: 1px solid #e6c3c3;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--color-muted);
    font-size: 0.875rem;
    border-top: 2px solid var(--color-accent);
    background: var(--color-bg-warm) url('/static/images/bg-header-japanese-paper.jpg') center / cover no-repeat;
}
footer p {
    margin-bottom: 0.35rem;
}
footer p:last-child {
    margin-bottom: 0;
}
.footer-links a {
    color: #888;
    text-decoration: none;
}
.footer-links a:hover {
    color: var(--color-text);
}


/* ═══════════════════════════════════════════════════════════════════
   Calligraphy Lessons
   ═══════════════════════════════════════════════════════════════════ */

/* === Two-column layout (sidebar + content) — matches original CD layout === */
.lessons-hub, .lesson-page { padding: 0; }
.lessons-hub-layout, .lesson-layout { display: flex; align-items: flex-start; }

/* Sidebar — narrow, matching original CD width="1%" nav */
.lesson-sidebar {
    width: 144px;
    min-width: 144px;
    padding: 0.25rem;
    position: sticky;
    top: 0;
    font-size: 0.85rem;
}
.lesson-sidebar img { display: block; margin-bottom: 0.25rem; }
.lesson-sidebar-heading { font-weight: 700; font-size: 0.85rem; margin: 0.15rem 0; }
.lesson-sidebar-heading a { color: var(--color-text); text-decoration: none; }
.lesson-sidebar-link { margin: 0; padding: 0; line-height: 1.4; }
.lesson-sidebar-link a { color: var(--color-text); text-decoration: none; font-weight: 600; font-size: 0.85rem; }
.lesson-sidebar-link a:hover { color: var(--color-accent); }
.lesson-sidebar-active a { color: var(--color-accent); }
.sidebar-kanji { font-size: 1.05rem; }

/* Main content */
.lessons-hub-content, .lesson-content { flex: 1; min-width: 0; padding: 0 1rem 1rem 1.5rem; }

/* Hub page */
.lessons-hub-title { font-family: var(--font-heading); font-size: 1.6rem; color: var(--color-accent); text-align: center; margin-bottom: 0.25rem; }
.lessons-section-title { font-family: var(--font-heading); font-size: 1.3rem; color: var(--color-accent); text-align: center; margin-bottom: 1rem; }
.lessons-hub-content blockquote { margin: 0 0 1rem 2.5rem; padding: 0; border: none; line-height: 1.5; }

/* Roadmap */
.lessons-roadmap h2 { font-family: var(--font-heading); font-size: 1.3rem; margin-bottom: 0.5rem; }
.roadmap-year { margin-bottom: 1.5rem; }
.roadmap-year h3 { font-family: var(--font-heading); font-size: 1rem; margin-bottom: 0.5rem; color: var(--color-accent); }
.roadmap-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.roadmap-table th { text-align: left; padding: 0.3rem 0.5rem; border-bottom: 2px solid var(--color-border); font-weight: 600; }
.roadmap-table td { padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--color-border); }
.roadmap-coming-soon td { color: #aaa; }
.roadmap-available td { font-weight: 500; }
.roadmap-badge { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 3px; font-size: 0.75rem; font-weight: 600; }
.roadmap-badge--available { background: #e6f4ea; color: #137333; }
.roadmap-badge--soon { background: #f0f0f0; color: #999; }

/* Lesson page */
.lesson-title { font-family: var(--font-heading); font-size: 1.4rem; color: var(--color-accent); text-align: center; margin-bottom: 1rem; }
.section-heading { font-family: var(--font-heading); font-size: 1.2rem; text-align: center; margin: 1rem 0 0.75rem; }
.section-divider { border: none; border-top: 1px solid #999; margin: 1rem auto; width: 70%; }

/* Prose — compact, matching original */
.lesson-prose { line-height: 1.6; }
.lesson-prose p { margin-bottom: 0.75rem; }
.lesson-prose img { max-width: 100%; height: auto; display: block; margin: 0.75rem auto; }
.lesson-prose ol, .lesson-prose ul { margin: 0.5rem 0; padding-left: 1.5rem; }
.lesson-prose li { margin-bottom: 0; line-height: 1.5; }
.lesson-prose hr { border: none; border-top: 1px solid #999; margin: 1rem auto; width: 100%; }

/* Vocabulary table — compact rows matching original cellpadding="0" */
.vocab-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; border: 1px solid #111; }
.vocab-table td, .vocab-table th { padding: 0.1rem 0.35rem; border: 1px solid #111; line-height: 1.3; }
.vocab-table td b, .vocab-table th b { font-weight: 600; }
.vocab-japanese { font-size: 1.05rem; }
.audio-link { text-decoration: none; color: var(--color-link); cursor: pointer; }
.audio-link:hover { text-decoration: underline; }
.glossary-table tr:target { background: #fffde0; }

/* Images */
.lesson-images { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }
.lesson-figure { text-align: center; }
.lesson-figure img { max-width: 100%; height: auto; }
.lesson-figure figcaption { font-size: 0.8rem; color: var(--color-muted); margin-top: 0.25rem; }

/* Sample images table */
.samples-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.samples-heading { text-align: center; padding: 0.25rem; }
.sample-cell { width: 50%; text-align: center; padding: 0.25rem; vertical-align: top; }
.sample-cell img { max-width: 200px; height: auto; display: block; margin: 0 auto; }

/* Videos */
.lesson-video-item { margin-bottom: 1rem; text-align: center; }
.lesson-video { max-width: 320px; width: 100%; background: #000; }

/* Frame-by-frame analysis — 2-column table */
.frames-table { width: 100%; border-collapse: collapse; border: 1px solid #111; margin: 1rem 0; }
.frame-cell { width: 50%; padding: 0.5rem; vertical-align: top; text-align: center; border: 1px solid #111; }
.frame-cell img { max-width: 320px; width: 100%; height: auto; display: block; margin: 0 auto; }
.frame-cell p { font-size: 0.85rem; margin-top: 0.3rem; line-height: 1.4; text-align: left; }

/* ── Books ─────────────────────────────────────────── */
.book-card { margin-bottom: 1.5rem; }
.book-card h2 { margin-bottom: 0.25rem; }
.book-card .book-meta { color: var(--color-muted); margin-bottom: 0.5rem; }

.book-landing { max-width: 48rem; margin: 0 auto; }
.book-landing .book-meta { color: var(--color-muted); margin-bottom: 1.5rem; }
.book-landing .book-front-matter { margin-bottom: 2rem; line-height: 1.7; }
.book-front-matter .text-center { text-align: center; }
.book-front-matter .text-right { text-align: right; }
.book-front-matter img { max-width: 100%; height: auto; }
.book-toc { padding-left: 1.5rem; }
.book-toc li { margin-bottom: 0.75rem; }
.book-toc li em { color: var(--color-muted); font-size: 0.9rem; }

.book-chapter { max-width: 48rem; margin: 0 auto; }
.book-chapter .chapter-body { line-height: 1.7; }
.book-chapter .chapter-body p { margin-bottom: 1rem; }
.book-chapter .chapter-body .text-center { text-align: center; }
.book-chapter .chapter-body img { max-width: 100%; height: auto; }
.book-chapter .chapter-body table { margin: 1rem 0; }

.chapter-nav { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 1rem 0; border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); margin: 1rem 0; font-size: 0.9rem; flex-wrap: wrap; }
.chapter-nav a { color: var(--color-link); text-decoration: none; }
.chapter-nav a:hover { text-decoration: underline; }
.chapter-nav--top { margin-top: 0; }

/* ── Gallery ──────────────────────────────────────── */
.gallery-table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; table-layout: fixed; }
.gallery-table th { text-align: left; font-size: 0.85rem; color: var(--color-muted); padding: 0.5rem 1.5rem; border-bottom: 2px solid var(--color-border); vertical-align: top; }
.gallery-table td { padding: 1rem 1.5rem; vertical-align: top; border-bottom: 1px solid var(--color-border); word-wrap: break-word; overflow-wrap: break-word; }
.gallery-col-art { width: 220px; }
.gallery-col-info { width: 28%; }
.gallery-col-notes { }
.gallery-col-art img { max-width: 200px; max-height: 250px; width: auto; height: auto; border: 1px solid var(--color-border); }
.gallery-work-num { font-size: 0.8rem; color: var(--color-muted); margin: 0 0 0.25rem 0; }
.gallery-title { font-size: 1rem; margin: 0 0 0.25rem 0; }
.gallery-date { color: var(--color-muted); font-size: 0.85rem; margin: 0 0 0.25rem 0; }
.gallery-japanese { font-size: 0.85rem; color: var(--color-muted); margin: 0 0 0.5rem 0; }
.gallery-description { font-size: 0.85rem; line-height: 1.5; margin: 0 0 0.5rem 0; }
.gallery-meta { font-size: 0.8rem; color: var(--color-muted); margin: 0.15rem 0; }

.gallery-nav { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 0; font-size: 0.9rem; }
.gallery-nav a { color: var(--color-link); text-decoration: none; }
.gallery-nav a:hover { text-decoration: underline; }
.gallery-nav-disabled { color: var(--color-muted); }
.gallery-nav-info { color: var(--color-muted); }
.gallery-nav--bottom { border-top: 1px solid var(--color-border); margin-top: 1.5rem; }

/* ═══ Responsive ═══ */
@media (max-width: 768px) {
    .hero {
        padding: 1rem 0;
    }
    .hero h1 {
        font-size: 1.75rem;
    }
    .hero p.hero-byline {
        font-size: 0.9rem;
    }
    .name-form {
        flex-direction: column;
    }
    .name-form button {
        width: 100%;
    }
    .showcase-grid {
        flex-wrap: wrap;
    }
    .showcase-grid figure {
        flex: none;
    }
    .header-inner {
        text-align: center;
    }
    .logo {
        position: static;
        transform: none;
        display: inline-flex;
        margin-bottom: 0.5rem;
    }
    .catchphrase-main {
        font-size: 1.4rem;
    }
    .catchphrase-sub {
        font-size: 0.85rem;
    }
    .site-nav a {
        margin: 0 0.8rem;
    }
    article {
        font-size: 16px;
    }
    article h1 {
        font-size: 1.75rem;
    }
    article h2 {
        font-size: 1.25rem;
    }
    article .float-left,
    article .float-right {
        float: none;
        max-width: 100%;
        margin: 2em auto;
    }
    .landing-section figure.float-left,
    .landing-section figure.float-right {
        float: none;
        max-width: 100%;
        margin: 1em auto;
        text-align: center;
    }
    .lessons-hub-layout, .lesson-layout { flex-direction: column; }
    .lesson-sidebar {
        width: 100%; min-width: 0; position: static;
        display: flex; flex-wrap: wrap; gap: 0.15rem 0.75rem;
        padding-bottom: 0.5rem; border-bottom: 1px solid var(--color-border); margin-bottom: 0.5rem;
    }
    .lesson-sidebar img { display: none; }
    .lesson-sidebar-heading { margin-bottom: 0; }
    .lesson-sidebar-link { margin: 0; padding: 0; }
    .roadmap-table th:nth-child(3), .roadmap-table td:nth-child(3) { display: none; }
    .frame-cell img { max-width: 100%; }
}

@media (max-width: 600px) {
    .gallery-table, .gallery-table thead, .gallery-table tbody, .gallery-table tr, .gallery-table th, .gallery-table td { display: block; }
    .gallery-table thead { display: none; }
    .gallery-table td { padding: 0.5rem 0; border-bottom: none; }
    .gallery-table tr { border-bottom: 1px solid var(--color-border); padding: 1rem 0; }
    .gallery-col-art img { width: 100%; max-width: 300px; }
}
