/* ===================================
   kaitori-base.css
   CSS Custom Properties / Reset / Typography
   Mobile First (375px base)
   ALL properties use !important to override LiteWord parent theme
   =================================== */

/* ===== CSS Custom Properties (reference only, NOT used in rules) ===== */
:root {
    --kj-main: #1B5E7D;
    --kj-main-light: #2a7a9e;
    --kj-main-dark: #154d67;
    --kj-sub: #F5F0E8;
    --kj-accent: #C4873B;
    --kj-accent-hover: #b3762f;
    --kj-text: #2D2D2D;
    --kj-text-light: #555;
    --kj-text-muted: #888;
    --kj-bg: #FAFAF7;
    --kj-white: #fff;
    --kj-line-green: #06C755;
    --kj-border: #f0ebe3;
    --kj-border-light: #f0f0f0;
    --kj-negative: #d93025;
    --kj-font-heading: 'Noto Serif JP', serif;
    --kj-font-body: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', sans-serif;
    --kj-font-number: 'Montserrat', sans-serif;
    --kj-sp-section: 56px;
    --kj-sp-section-pc: 100px;
    --kj-sp-side: 16px;
    --kj-sp-side-pc: 40px;
    --kj-shadow-sm: 0 2px 8px rgba(0,0,0,.04);
    --kj-shadow-md: 0 4px 20px rgba(0,0,0,.06);
    --kj-shadow-lg: 0 4px 24px rgba(0,0,0,.08);
    --kj-shadow-cta: 0 4px 16px rgba(196,135,59,.3);
    --kj-shadow-line: 0 4px 16px rgba(6,199,85,.3);
    --kj-shadow-main: 0 4px 16px rgba(27,94,125,.25);
    --kj-radius-sm: 6px;
    --kj-radius-md: 8px;
    --kj-radius-lg: 12px;
    --kj-radius-xl: 16px;
    --kj-radius-pill: 50px;
    --kj-max-w: 1200px;
    --kj-max-w-content: 1100px;
    --kj-max-w-article: 720px;
}

/* ===== Override LiteWord parent theme CSS variables ===== */
:root {
    --color-main: #1B5E7D !important;
    --color-accent: #C4873B !important;
    --color-bg: #FAFAF7 !important;
    --color-text: #2D2D2D !important;
}

/* ===== Body Reset ===== */
body,
body.kj-page {
    font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', sans-serif !important;
    color: #2D2D2D !important;
    background: #FAFAF7 !important;
    line-height: 1.8 !important;
    -webkit-text-size-adjust: 100% !important;
    padding-bottom: 72px !important;
}

/* ===== Reset (scoped to kj- elements) ===== */
[class*="kj-"],
[class*="kj-"] *,
[class*="kj-"] *::before,
[class*="kj-"] *::after {
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* kj- scoped link reset (exclude buttons) */
[class*="kj-"] a:not([class*="kj-btn"]):not([class*="kj-fc-"]):not([class*="kj-worry-link"]):not([class*="kj-all-link"]):not([class*="kj-voices-all-link"]):not([class*="kj-column-all-link"]) {
    color: inherit !important;
    text-decoration: none !important;
}

[class*="kj-"] img {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
}

/* ===== Typography (override parent theme headings) ===== */
[class*="kj-"] h1,
[class*="kj-"] h2,
[class*="kj-"] h3,
[class*="kj-"] h4 {
    font-family: 'Noto Serif JP', serif !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
}

/* ===== Section Common ===== */
.kj-section {
    padding: 48px 16px !important;
    background: #FAFAF7 !important;
}

/* 狭小スマホ（iPhone SE等 ≤375px）: 余白をさらに最適化 */
@media (max-width: 375px) {
    .kj-section { padding: 40px 14px !important; }
}

.kj-section--warm {
    background: #F5F0E8 !important;
}

.kj-section--white {
    background: #fff !important;
}

.kj-section-inner {
    max-width: 1100px !important;
    margin: 0 auto !important;
}

/* ===== Section Title ===== */
.kj-section-title {
    font-family: 'Noto Serif JP', serif !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: #1B5E7D !important;
    text-align: center !important;
    margin-bottom: 10px !important;
    line-height: 1.5 !important;
    letter-spacing: .02em !important;
    word-break: keep-all !important;
    overflow-wrap: break-word !important;
    line-break: strict !important;
}

.kj-section-title em {
    font-style: normal !important;
    color: #C4873B !important;
    display: inline-block !important;
}

/* ===== SP-only break (mobile-first helper) ===== */
.kj-sp-br { display: inline !important; }
@media (min-width: 768px) {
    .kj-sp-br { display: none !important; }
}

/* ===== Section Subtitle ===== */
.kj-section-subtitle {
    text-align: center !important;
    color: #888 !important;
    font-size: .85rem !important;
    margin-bottom: 32px !important;
    line-height: 1.7 !important;
    word-break: keep-all !important;
    overflow-wrap: break-word !important;
    line-break: strict !important;
}

/* ===== Utility ===== */
.kj-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ===== Content offset for fixed header ===== */
.kj-breadcrumb:first-child,
.kj-archive,
.kj-single-result,
.kj-blog-article {
    margin-top: 56px !important;
}

.has-campaign ~ main .kj-breadcrumb:first-child,
.has-campaign ~ .kj-archive,
.has-campaign ~ .kj-single-result {
    margin-top: 96px !important;
}

/* ===== Breadcrumb ===== */
.kj-breadcrumb {
    padding: 12px 16px !important;
    font-size: .75rem !important;
    color: #888 !important;
    background: #F5F0E8 !important;
}

.kj-breadcrumb a {
    color: #1B5E7D !important;
    text-decoration: none !important;
}

.kj-breadcrumb span {
    margin: 0 6px !important;
}

/* ===== Pagination ===== */
.kj-pagination {
    display: flex !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 32px 16px !important;
}

.kj-pagination a,
.kj-pagination span {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 8px !important;
    font-size: .85rem !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    transition: all .3s !important;
}

.kj-pagination a {
    background: #fff !important;
    color: #1B5E7D !important;
    border: 1px solid #f0ebe3 !important;
}

.kj-pagination a:hover {
    background: #1B5E7D !important;
    color: #fff !important;
}

.kj-pagination .current {
    background: #1B5E7D !important;
    color: #fff !important;
}

/* ===== PC ===== */
@media (min-width: 769px) {
    body.kj-page {
        padding-bottom: 0 !important;
    }

    .kj-section {
        padding: 100px 40px !important;
    }

    .kj-section-title {
        font-size: 2rem !important;
        margin-bottom: 16px !important;
    }

    .kj-section-subtitle {
        font-size: .9rem !important;
        margin-bottom: 60px !important;
    }

    .kj-breadcrumb:first-child,
    .kj-archive,
    .kj-single-result,
    .kj-blog-article {
        margin-top: 80px !important;
    }

    .has-campaign ~ main .kj-breadcrumb:first-child,
    .has-campaign ~ .kj-archive,
    .has-campaign ~ .kj-single-result {
        margin-top: 124px !important;
    }
}
