/* =============================================
   YCCI Sitemap Generator - HTML サイトマップ
   ============================================= */

/* CSS変数（main-style.css と同じ値を参照） */
:root {
    --sm-green-primary: #097040;
    --sm-green-pale:    #eaf4ee;
    --sm-green-border:  #c5e0cc;
    --sm-green-hover:   #e8f5e9;
    --sm-text-dark:     #1b3a28;
    --sm-text-date:     #666;
    --sm-arrow-color:   #097040;
}

/* ラッパー：横幅を広く */
.ycci-sitemap {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 1rem 0 2rem;
    font-family: inherit;
}

/* サイトマップページのコンテンツエリアを横幅まで伸ばす */
.page-id-68 .page-article__content {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}
.page-id-68 .page-article {
    max-width: none;
}

/* =========================================
   セクション見出し
   .text-box-point と同じスタイル
   ========================================= */
.ycci-sitemap__heading {
    position: relative;
    border: 2px solid var(--sm-green-primary);
    border-radius: 10px;
    padding: 0.75rem 1.25rem 0.75rem 3.5rem;
    background: var(--sm-green-pale);
    margin: 2rem 0 0.75rem;
    line-height: 1.6;
    /* テーマのh3スタイルを上書き */
    font-size: 1.05rem !important;
    font-weight: 700;
    color: var(--sm-text-dark);
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--sm-green-primary); /* テーマのborder-bottomを上書き */
}

/* アイコン（.text-box-point::before 相当） */
.ycci-sitemap__heading::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.6rem;
    height: 1.6rem;
    background: var(--sm-green-primary);
    border-radius: 15%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
   ページ一覧リスト
   ========================================= */
.ycci-sitemap__list {
    list-style: none;
    margin: 0 0 0.5rem;
    padding: 0;
    border: 1px solid var(--sm-green-border);
    border-radius: 6px;
    overflow: hidden;
}

.ycci-sitemap__item {
    border-bottom: 1px solid var(--sm-green-hover);
}
.ycci-sitemap__item:last-child {
    border-bottom: none;
}

.ycci-sitemap__item a {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 0.65rem 1.2rem 0.65rem 2.4rem;
    color: var(--sm-green-primary);
    text-decoration: none;
    position: relative;
    transition: background 0.18s ease, color 0.18s ease;
    flex-wrap: nowrap;
}
.ycci-sitemap__item a::before {
    content: '›';
    position: absolute;
    left: 1rem;
    color: var(--sm-green-primary);
    font-size: 1.2rem;
    line-height: 1;
    top: 50%;
    transform: translateY(-50%);
}
.ycci-sitemap__item a:hover {
    background: var(--sm-green-hover);
    color: var(--sm-text-dark);
}

.ycci-sitemap__date {
    flex-shrink: 0;
    font-size: 0.82rem;
    color: var(--sm-text-date);
    min-width: 9em;
}

/* =========================================
   カテゴリー別 <details> プルダウン
   ========================================= */
.ycci-sitemap__cat-details {
    margin-bottom: 0.6rem;
    border: 1px solid var(--sm-green-border);
    border-radius: 6px;
    overflow: hidden;
}

/* summary（クリッカブルヘッダー） */
.ycci-sitemap__cat-summary {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1.2rem;
    background: var(--sm-green-pale);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--sm-text-dark);
    cursor: pointer;
    list-style: none;
    user-select: none;
    border-bottom: 1px solid transparent;
    transition: background 0.18s ease;
}
.ycci-sitemap__cat-summary::-webkit-details-marker { display: none; }

.ycci-sitemap__cat-details[open] > .ycci-sitemap__cat-summary {
    border-bottom-color: var(--sm-green-border);
    background: #d6eddb;
}

.ycci-sitemap__cat-summary:hover {
    background: #d6eddb;
}

/* 件数バッジ */
.ycci-sitemap__cat-count {
    font-size: 0.78rem;
    font-weight: 400;
    color: #555;
    background: #fff;
    border: 1px solid var(--sm-green-border);
    border-radius: 20px;
    padding: 0 0.55em;
    line-height: 1.6;
}

/* 矢印アイコン */
.ycci-sitemap__cat-arrow {
    margin-left: auto;
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    border-right: 2px solid var(--sm-arrow-color);
    border-bottom: 2px solid var(--sm-arrow-color);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s ease;
}
.ycci-sitemap__cat-details[open] > .ycci-sitemap__cat-summary .ycci-sitemap__cat-arrow {
    transform: rotate(-135deg) translateY(-2px);
}

/* details 内のリストはボーダーなし（details が担う） */
.ycci-sitemap__cat-details > .ycci-sitemap__list {
    margin: 0;
    border: none;
    border-radius: 0;
}

/* =========================================
   Rainbow リンクなし項目
   ========================================= */
.ycci-sitemap__item--rainbow {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    padding: 1rem 1.2rem 1rem 2.4rem;
    position: relative;
    color: var(--sm-text-dark);
    cursor: default;
}
.ycci-sitemap__item--rainbow::before {
    content: '–';
    position: absolute;
    left: 1rem;
    color: #aaa;
    font-size: 1.1rem;
    line-height: 1;
    top: 50%;
    transform: translateY(-50%);
}
.ycci-sitemap__nolink {
    color: #777;
    font-size: 0.95rem;
}

/* 準備中メッセージ */
.ycci-sitemap__empty {
    padding: 0.8rem 1.2rem;
    color: #888;
    font-size: 0.9rem;
    margin: 0;
    border: 1px solid var(--sm-green-border);
    border-radius: 6px;
    background: #fafafa;
}

/* =========================================
   レスポンシブ
   ========================================= */
@media (max-width: 600px) {
    .ycci-sitemap__item a {
        flex-direction: column;
        gap: 0.15rem;
    }
    .ycci-sitemap__date {
        font-size: 0.78rem;
    }
    .ycci-sitemap__heading {
        font-size: 0.95rem;
        padding-left: 3rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ycci-sitemap__item a,
    .ycci-sitemap__cat-summary,
    .ycci-sitemap__cat-arrow {
        transition: none;
    }
}
