
/* =========================================================
   Common
   ========================================================= */
.kiokugaku-article-body,
.brain-os-article-body {
    --atama-navy: #173654;
    --atama-muted: #5e7184;
    --atama-line: #d8e5ec;
    line-height: 1.9;
}

.kiokugaku-top-image {
    margin: 0 0 2rem !important;
    padding: 0;
}
.kiokugaku-top-image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 12px 34px rgba(35, 69, 99, .12);
}

.kiokugaku-series-top {
    margin: 0 0 2rem;
    padding: .8rem 1rem;
    border: 1px solid #d6e7e7;
    border-radius: 12px;
    background: #f5fbfa;
    text-align: center;
}
.kiokugaku-series-top a {
    color: #287a73;
    font-weight: 700;
    text-decoration: none;
}
.kiokugaku-series-top a:hover {
    text-decoration: underline;
}

/* =========================================================
   Kiokugaku headings
   ========================================================= */
.kiokugaku-article-body h2 {
    position: relative;
    margin: 2.8em 0 1.15em !important;
    padding: .82em 1em .82em 1.15em !important;
    border: 0 !important;
    border-left: 8px solid #45bfae !important;
    border-radius: 10px !important;
    background: linear-gradient(100deg, #e9f8f5 0%, #f1f4ff 100%) !important;
    color: #173654 !important;
    box-shadow: 0 5px 16px rgba(41, 91, 111, .08);
    font-size: clamp(1.28rem, 2.4vw, 1.65rem) !important;
    line-height: 1.55 !important;
}
.kiokugaku-article-body h2::after {
    content: "";
    position: absolute;
    right: 18px;
    bottom: 12px;
    width: 46px;
    height: 5px;
    border-radius: 999px;
    background: linear-gradient(90deg, #45bfae, #7b6fe2);
    opacity: .8;
}

.kiokugaku-article-body h3 {
    margin: 2.1em 0 .9em !important;
    padding: .32em .2em .4em .85em !important;
    border: 0 !important;
    border-left: 4px solid #72cfc1 !important;
    border-bottom: 1px solid #cfe6e3 !important;
    background: transparent !important;
    color: #24475b !important;
    font-size: clamp(1.1rem, 2vw, 1.35rem) !important;
    line-height: 1.55 !important;
}

.kiokugaku-context-link {
    margin: -0.35rem 0 1.8rem;
    padding: .9rem 1rem;
    border: 1px solid #dce7f0;
    border-radius: 12px;
    background: #fbfdff;
}
.kiokugaku-context-label {
    display: inline-block;
    margin: 0 .7rem .45rem 0;
    color: #65778a;
    font-size: .82rem;
    font-weight: 700;
}
.kiokugaku-context-links {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
}
.kiokugaku-context-links a {
    display: inline-flex;
    align-items: center;
    padding: .48rem .75rem;
    border: 1px solid #cfe2e8;
    border-radius: 999px;
    background: #fff;
    color: #246e72;
    font-size: .9rem;
    font-weight: 700;
    line-height: 1.45;
    text-decoration: none;
}
.kiokugaku-context-links a::after {
    content: "→";
    margin-left: .38rem;
}
.kiokugaku-context-links a:hover {
    border-color: #65bfb2;
    background: #eefaf8;
}

.kiokugaku-series-nav {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(150px,.62fr) minmax(0,1fr);
    gap: .75rem;
    margin: 3.2rem 0 1rem;
}
.kiokugaku-series-nav a,
.kiokugaku-nav-empty {
    min-height: 98px;
    border: 1px solid #d9e4ed;
    border-radius: 14px;
    background: #fff;
}
.kiokugaku-series-nav a {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: .85rem 1rem;
    color: #173654;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(43, 76, 104, .06);
}
.kiokugaku-series-nav a:hover {
    border-color: #70c7ba;
    background: #f4fbfa;
}
.kiokugaku-series-nav span {
    margin-bottom: .25rem;
    color: #6c7d8d;
    font-size: .78rem;
    font-weight: 700;
}
.kiokugaku-series-nav strong {
    font-size: .92rem;
    line-height: 1.5;
}
.kiokugaku-nav-next {
    text-align: right;
}
.kiokugaku-nav-index {
    text-align: center;
    background: linear-gradient(145deg, #eef9f7, #f2f1ff) !important;
}

/* Tables converted from the manuscript */
.kiokugaku-table-wrap {
    margin: 1.6rem 0;
    overflow-x: auto;
}
.kiokugaku-table {
    width: 100%;
    min-width: 620px;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid #d7e4eb;
    border-radius: 12px;
}
.kiokugaku-table th,
.kiokugaku-table td {
    padding: .75rem .85rem;
    border-right: 1px solid #e2ebf0;
    border-bottom: 1px solid #e2ebf0;
    vertical-align: top;
}
.kiokugaku-table th {
    background: #edf8f6;
    color: #24475b;
}
.kiokugaku-table tr:last-child td {
    border-bottom: 0;
}
.kiokugaku-table th:last-child,
.kiokugaku-table td:last-child {
    border-right: 0;
}

/* =========================================================
   Brain OS placeholder style (future use)
   ========================================================= */
.brain-os-article-body h2 {
    margin: 2.8em 0 1.15em !important;
    padding: .82em 1em !important;
    border: 1px solid #d9dcf1 !important;
    border-left: 8px solid #5667ca !important;
    border-radius: 4px !important;
    background: linear-gradient(100deg, #f0f2fb 0%, #f6f4ff 100%) !important;
    color: #1d2947 !important;
    box-shadow: 5px 5px 0 rgba(86, 103, 202, .10);
}
.brain-os-article-body h3 {
    margin: 2.1em 0 .9em !important;
    padding: .35em .2em .42em .85em !important;
    border: 0 !important;
    border-left: 4px solid #796dd6 !important;
    border-bottom: 1px solid #d9d6ef !important;
    background: transparent !important;
    color: #302e58 !important;
}

@media (max-width: 767px) {
    .kiokugaku-top-image img {
        border-radius: 10px;
    }
    .kiokugaku-article-body h2 {
        margin-top: 2.3em !important;
        padding: .75em .82em .75em .95em !important;
        border-left-width: 6px !important;
    }
    .kiokugaku-context-links {
        display: block;
    }
    .kiokugaku-context-links a {
        display: flex;
        width: 100%;
        margin-top: .45rem;
        border-radius: 10px;
    }
    .kiokugaku-series-nav {
        grid-template-columns: 1fr;
    }
    .kiokugaku-series-nav a,
    .kiokugaku-nav-empty {
        min-height: 76px;
    }
    .kiokugaku-nav-empty {
        display: none;
    }
    .kiokugaku-nav-next {
        text-align: left;
    }
}
