/* ==========================================================================
   AI Terakoya — Dojo top-page shared stylesheet (dojo.css)
   Consolidated from the inline <style> blocks of the 10 dojo index pages.
   Self-sufficient: the dojo index pages link ONLY this file (plus the
   separately-handled locale-switcher styles). Breadcrumb rules are included
   here on purpose because these pages do NOT link knowledge-base.css.

   Two structural "skins" exist across the pages:
     - LIST skin  (MI-family): dark category headers, list rows, outlined links,
                   feedback notice.  Used by: dojo-mi, dojo-ml, dojo-ms, dojo-pi
     - CARD skin  (FM-family): padded card categories, underlined text headers,
                   gradient link buttons, intro block.  Used by: dojo-fm, dojo-ms-en

   Per-dojo accent is set via a body class (see the custom-property blocks).
   ========================================================================== */

/* -------------------------------------------------------------------------
   Reset + base (identical across all 10 pages)
   Font-family uses the fuller Hiragino/Meiryo stack (superset; Latin text is
   unaffected because the system fonts precede it).
   ------------------------------------------------------------------------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

/* -------------------------------------------------------------------------
   Per-dojo accent custom properties
     --accent-grad : header gradient
     --accent      : link/back-link accent (LIST: series-link color;
                     CARD: back-link + category-header text color)
     --accent-2    : CARD category-header border-bottom color
     --accent-shadow : CARD series-item:hover shadow tint
   ------------------------------------------------------------------------- */
body.dojo-fm {
    --accent-grad: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --accent: #667eea;
    --accent-text: #5b52e0;
    --accent-2: #764ba2;
    --accent-shadow: rgba(102, 126, 234, 0.2);
}
body.dojo-mi {
    --accent-grad: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --accent: #3498db;
    --accent-text: #1a6aa8;
}
body.dojo-ml {
    --accent-grad: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent: #3498db;
    --accent-text: #1a6aa8;
}
body.dojo-ms {
    --accent-grad: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent: #f5576c;
    --accent-text: #c22b41;
}
body.dojo-pi {
    --accent-grad: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --accent: #11998e;
    --accent-text: #0e7a72;
}
/* en/MS uses the CARD skin with the pink accent (see note in report). */
body.dojo-ms-en {
    --accent-grad: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent: #f093fb;
    --accent-text: #c22b41;
    --accent-2: #f5576c;
    --accent-shadow: rgba(240, 147, 251, 0.2);
}

/* -------------------------------------------------------------------------
   Header + globally-shared components
   ------------------------------------------------------------------------- */
header {
    background: var(--accent-grad);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
}

h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.subtitle { opacity: 0.9; margin-bottom: 1rem; }
.stats { font-size: 0.9rem; opacity: 0.85; }

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.series-info { flex: 1; }

/* Difficulty badges — identical across every page */
.badge-beginner { background: #d4edda; color: #155724; }
.badge-intermediate { background: #fff3cd; color: #856404; }
.badge-advanced { background: #f8d7da; color: #721c24; }

/* Footer base (skin sets margin-top) */
footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem 1rem;
}

/* -------------------------------------------------------------------------
   Breadcrumb (constant purple accent on 9/10 pages; en/MS overrides below)
   ------------------------------------------------------------------------- */
.breadcrumb {
    background: #f7fafc;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9rem;
}
.breadcrumb-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.breadcrumb a {
    color: var(--accent-text);
    text-decoration: none;
    transition: color 0.2s;
}
.breadcrumb a:hover {
    color: #764ba2;
    text-decoration: underline;
}
.breadcrumb-separator {
    color: #a0aec0;
    margin: 0 0.25rem;
}
.breadcrumb-current {
    color: #4a5568;
    font-weight: 500;
}

/* ==========================================================================
   LIST skin  (MI-family) — dojo-mi, dojo-ml, dojo-ms, dojo-pi
   ========================================================================== */
body.dojo-mi .back-link,
body.dojo-ml .back-link,
body.dojo-ms .back-link,
body.dojo-pi .back-link {
    display: inline-block;
    margin-bottom: 2rem;
    padding: 0.5rem 1rem;
    background: white;
    color: var(--accent-text);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s;
}
body.dojo-mi .back-link:hover,
body.dojo-ml .back-link:hover,
body.dojo-ms .back-link:hover,
body.dojo-pi .back-link:hover {
    background: var(--accent);
    color: white;
}

body.dojo-mi .category,
body.dojo-ml .category,
body.dojo-ms .category,
body.dojo-pi .category {
    background: white;
    margin-bottom: 2rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body.dojo-mi .category-header,
body.dojo-ml .category-header,
body.dojo-ms .category-header,
body.dojo-pi .category-header {
    background: #2c3e50;
    color: white;
    padding: 1rem 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
}

body.dojo-mi .series-list,
body.dojo-ml .series-list,
body.dojo-ms .series-list,
body.dojo-pi .series-list {
    padding: 1rem;
}

body.dojo-mi .series-item,
body.dojo-ml .series-item,
body.dojo-ms .series-item,
body.dojo-pi .series-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    gap: 1rem;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #e0e0e0;
    align-items: center;
    transition: background 0.2s;
}
body.dojo-mi .series-item:last-child,
body.dojo-ml .series-item:last-child,
body.dojo-ms .series-item:last-child,
body.dojo-pi .series-item:last-child { border-bottom: none; }
body.dojo-mi .series-item:hover,
body.dojo-ml .series-item:hover,
body.dojo-ms .series-item:hover,
body.dojo-pi .series-item:hover { background: #f8f9fa; }

body.dojo-mi .series-icon,
body.dojo-ml .series-icon,
body.dojo-ms .series-icon,
body.dojo-pi .series-icon { font-size: 1.5rem; }

body.dojo-mi .series-title,
body.dojo-ml .series-title,
body.dojo-ms .series-title,
body.dojo-pi .series-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.2rem;
}
body.dojo-mi .series-desc,
body.dojo-ml .series-desc,
body.dojo-ms .series-desc,
body.dojo-pi .series-desc {
    font-size: 0.85rem;
    color: #666;
}

body.dojo-mi .series-meta,
body.dojo-ml .series-meta,
body.dojo-ms .series-meta,
body.dojo-pi .series-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.85rem;
}

body.dojo-mi .badge,
body.dojo-ml .badge,
body.dojo-ms .badge,
body.dojo-pi .badge {
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

body.dojo-mi .time-badge,
body.dojo-ml .time-badge,
body.dojo-ms .time-badge,
body.dojo-pi .time-badge {
    background: #e3f2fd;
    color: #1976d2;
}
body.dojo-mi .chapters-badge,
body.dojo-ml .chapters-badge,
body.dojo-ms .chapters-badge,
body.dojo-pi .chapters-badge {
    background: #f3e5f5;
    color: #7b1fa2;
}

body.dojo-mi .series-link,
body.dojo-ml .series-link,
body.dojo-ms .series-link,
body.dojo-pi .series-link {
    color: var(--accent-text);
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border: 2px solid var(--accent);
    border-radius: 6px;
    transition: all 0.2s;
}
body.dojo-mi .series-link:hover,
body.dojo-ml .series-link:hover,
body.dojo-ms .series-link:hover,
body.dojo-pi .series-link:hover {
    background: var(--accent);
    color: white;
}

body.dojo-mi .series-link.coming-soon,
body.dojo-ml .series-link.coming-soon,
body.dojo-ms .series-link.coming-soon,
body.dojo-pi .series-link.coming-soon {
    color: #999;
    border-color: #999;
    cursor: not-allowed;
}
body.dojo-mi .series-link.coming-soon:hover,
body.dojo-ml .series-link.coming-soon:hover,
body.dojo-ms .series-link.coming-soon:hover,
body.dojo-pi .series-link.coming-soon:hover {
    background: transparent;
    color: #999;
}

body.dojo-mi .feedback-notice,
body.dojo-ml .feedback-notice,
body.dojo-ms .feedback-notice,
body.dojo-pi .feedback-notice {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 2rem;
    margin: 3rem auto;
    max-width: 900px;
}
body.dojo-mi .feedback-notice h3,
body.dojo-ml .feedback-notice h3,
body.dojo-ms .feedback-notice h3,
body.dojo-pi .feedback-notice h3 {
    color: #856404;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    text-align: center;
}
body.dojo-mi .feedback-notice p,
body.dojo-ml .feedback-notice p,
body.dojo-ms .feedback-notice p,
body.dojo-pi .feedback-notice p {
    color: #856404;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
}
body.dojo-mi .feedback-options,
body.dojo-ml .feedback-options,
body.dojo-ms .feedback-options,
body.dojo-pi .feedback-options {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}
body.dojo-mi .feedback-button,
body.dojo-ml .feedback-button,
body.dojo-ms .feedback-button,
body.dojo-pi .feedback-button {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s;
}
body.dojo-mi .feedback-button:hover,
body.dojo-ml .feedback-button:hover,
body.dojo-ms .feedback-button:hover,
body.dojo-pi .feedback-button:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

body.dojo-mi footer,
body.dojo-ml footer,
body.dojo-ms footer,
body.dojo-pi footer { margin-top: 3rem; }

/* footer link — only the ML pages carry a styled footer link */
body.dojo-ml footer a {
    color: #3498db;
    text-decoration: none;
}
body.dojo-ml footer a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    body.dojo-mi .series-item,
    body.dojo-ml .series-item,
    body.dojo-ms .series-item,
    body.dojo-pi .series-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    body.dojo-mi .series-meta,
    body.dojo-ml .series-meta,
    body.dojo-ms .series-meta,
    body.dojo-pi .series-meta {
        flex-wrap: wrap;
    }
    body.dojo-mi h1,
    body.dojo-ml h1,
    body.dojo-ms h1,
    body.dojo-pi h1 { font-size: 1.5rem; }
}

/* ==========================================================================
   CARD skin  (FM-family) — dojo-fm, dojo-ms-en
   ========================================================================== */
body.dojo-fm .back-link,
body.dojo-ms-en .back-link {
    display: inline-block;
    margin-bottom: 2rem;
    padding: 0.5rem 1rem;
    background: white;
    color: var(--accent-text);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
}

body.dojo-fm .intro,
body.dojo-ms-en .intro {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body.dojo-fm .category,
body.dojo-ms-en .category {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body.dojo-fm .category-header,
body.dojo-ms-en .category-header {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--accent-text);
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--accent-2);
}

body.dojo-fm .series-list,
body.dojo-ms-en .series-list {
    display: grid;
    gap: 1.5rem;
}

body.dojo-fm .series-item,
body.dojo-ms-en .series-item {
    display: grid;
    grid-template-columns: 60px 1fr auto auto;
    gap: 1rem;
    align-items: center;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s;
}
body.dojo-fm .series-item:hover,
body.dojo-ms-en .series-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px var(--accent-shadow);
}

body.dojo-fm .series-icon,
body.dojo-ms-en .series-icon {
    font-size: 2rem;
    text-align: center;
}

body.dojo-fm .series-title,
body.dojo-ms-en .series-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}
body.dojo-fm .series-desc,
body.dojo-ms-en .series-desc {
    font-size: 0.9rem;
    color: #666;
}

body.dojo-fm .series-meta,
body.dojo-ms-en .series-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

body.dojo-fm .badge,
body.dojo-ms-en .badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

body.dojo-fm .time-badge,
body.dojo-ms-en .time-badge { background: #e7f3ff; color: #004085; }
body.dojo-fm .chapters-badge,
body.dojo-ms-en .chapters-badge { background: #f8d7da; color: #721c24; }

body.dojo-fm .series-link,
body.dojo-ms-en .series-link {
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s;
    background: var(--accent-grad);
    color: white;
}

body.dojo-fm .coming-soon,
body.dojo-ms-en .coming-soon {
    background: #e9ecef;
    color: #6c757d;
}

body.dojo-fm footer,
body.dojo-ms-en footer { margin-top: 4rem; }

/* en/MS themes its breadcrumb with the pink accent (unlike the purple default) */
body.dojo-ms-en .breadcrumb a { color: var(--accent-text); }
body.dojo-ms-en .breadcrumb a:hover { color: #f5576c; }

@media (max-width: 768px) {
    body.dojo-fm .series-item,
    body.dojo-ms-en .series-item {
        grid-template-columns: 1fr;
        text-align: center;
    }
}
