/**
 * ==========================================================================
 * ショートコード設置ガイド ページ専用CSS
 * ファイル名: shortcode-guide.css
 * 配置先: /css/shortcode-guide.css（ページ別CSS自動読み込みで適用）
 * 更新日: 2026/02/23
 * 追記者: 寿ラボ：上長
 * ==========================================================================
 */

/* ガイド全体 */
.sg {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 0 60px;
}

/* テーマ出力のページタイトル（H1）を非表示 */
#page_headline {
    display: none;
}

/* ─── ヘッダー ─── */
.sg-header {
    text-align: center;
    padding: 32px 20px 40px;
    margin-bottom: 36px;
    border-bottom: 1px solid #e0e0e0;
}

/* wpautopで挿入される空pを潰す */
.sg-header p:empty {
    display: none;
    margin: 0;
    padding: 0;
    line-height: 0;
}

.sg-header__label {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: #999 !important;
    margin: 0 0 6px;
    text-transform: uppercase;
}

.post_content .sg-header__title,
.sg-header__title {
    font-size: 1.8rem;
    font-weight: bold;
    color: #222 !important;
    margin: 0 0 16px !important;
    line-height: 1.3;
}

.sg-header__desc {
    font-size: 0.88rem;
    color: #666 !important;
    line-height: 1.8;
    margin: 0;
}

/* ─── 自動採番カウンター ─── */
.sg {
    counter-reset: sg-counter;
}

/* ─── 目次 ─── */
.sg-toc {
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 28px 32px;
    margin-bottom: 48px;
    counter-reset: sg-toc-counter;
}

.sg-toc__title {
    font-size: 0.8rem;
    font-weight: bold;
    color: #999 !important;
    letter-spacing: 0.1em;
    margin: 0 0 16px;
    text-transform: uppercase;
}

.sg-toc__list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.sg-toc__list li {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    list-style: none !important;
    counter-increment: sg-toc-counter;
}

.sg-toc__list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sg-toc__list li::before {
    content: counter(sg-toc-counter, decimal-leading-zero) !important;
    display: inline-block !important;
    font-size: 0.85rem;
    font-weight: bold;
    color: #ccc !important;
    font-family: "Helvetica Neue", Arial, sans-serif;
    min-width: 24px;
    flex-shrink: 0;
    position: static !important;
    padding: 0 !important;
}

.sg-toc__list a {
    font-size: 0.95rem;
    font-weight: bold;
    color: #333 !important;
    text-decoration: none !important;
    white-space: nowrap;
}

.sg-toc__list a:hover {
    color: #cc2929 !important;
}

.sg-toc__list span {
    font-size: 0.78rem;
    color: #999 !important;
}

/* ─── セクション ─── */
.sg-section {
    margin-bottom: 56px;
    padding-bottom: 56px;
    border-bottom: 1px solid #eee;
    counter-increment: sg-counter;
}

.sg-section:last-of-type {
    border-bottom: none;
    margin-bottom: 40px;
}

.sg-section__head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 28px;
}

/* カウンター駆動の番号（::before） */
.sg-section__head::before {
    content: counter(sg-counter, decimal-leading-zero);
    font-size: 2rem;
    font-weight: bold;
    color: #ddd !important;
    line-height: 1;
    flex-shrink: 0;
    min-width: 48px;
    font-family: "Helvetica Neue", Arial, sans-serif;
}

.post_content .sg-section__title,
.sg-section__title {
    font-size: 1.15rem;
    font-weight: bold;
    color: #333 !important;
    margin: 0 0 4px !important;
    line-height: 1.4;
    border: none !important;
    background: none !important;
    padding: 0 !important;
}

.sg-section__meta {
    font-size: 0.78rem;
    color: #999 !important;
    margin: 0;
    line-height: 1.6;
}

.sg-section__meta code {
    background: #f0f0f0;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.78rem;
    color: #cc2929 !important;
    font-family: "Courier New", Courier, monospace;
}

/* ─── フッター ─── */
.sg-footer {
    text-align: center;
    padding-top: 32px;
    border-top: 1px solid #e0e0e0;
}

.sg-footer p {
    font-size: 0.78rem;
    color: #bbb !important;
    margin: 0;
}

/* ─── SP対応 ─── */
@media screen and (max-width: 767px) {
    .sg {
        padding: 10px 0 40px;
    }

    .sg-header {
        padding: 32px 16px 28px;
        margin-bottom: 24px;
    }

    .sg-header__title {
        font-size: 1.35rem;
    }

    .sg-header__desc {
        font-size: 0.82rem;
    }

    .sg-toc {
        padding: 20px;
        margin-bottom: 36px;
    }

    .sg-toc__list li {
        flex-direction: column;
        gap: 2px;
        padding: 8px 0;
    }

    .sg-section {
        margin-bottom: 40px;
        padding-bottom: 40px;
    }

    .sg-section__head {
        gap: 12px;
        margin-bottom: 20px;
    }

    .sg-section__head::before {
        font-size: 1.5rem;
        min-width: 36px;
    }

    .sg-section__title {
        font-size: 1.05rem;
    }
}
