/*
Theme Name: 集客支援メディア
Theme URI: https://blog.syukyakushien.com/
Description: 集客支援のオウンドメディア用テーマ。白ベース・シンプル・信頼感（note風）。Tailwind CDN + 記事タイポグラフィ。
Author: 集客支援
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: syukyaku-blog
*/

/* =========================================================
   ベース
   ========================================================= */
:root {
    --c-text: #1a1a1a;
    --c-muted: #6b6b6b;
    --c-line: #e5e5e5;
    --c-line-light: #efefef;
    --c-bg-soft: #f6f6f6;
    /* アクセント（リンク・見出しの帯・チップ等）はモノクロ寄りの濃いグレー/黒 */
    --c-accent: #1a1a1a;
    --c-accent-dark: #000000;
    /* ボタン専用カラー */
    --c-btn: #E49A2E;
    --c-btn-dark: #c98a26;
    --c-btn-text: #1a1a1a;
}

*, *::before, *::after { box-sizing: border-box; }

/* ルート: 横はみ出しをクリップ + iOS のテキスト自動拡大を無効化（実機だけ崩れる原因の一つ） */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
html, body {
    max-width: 100%;
    width: 100%;
    overflow-x: hidden;   /* iOS Safari 対策で html/body 両方に指定 */
}

body {
    color: var(--c-text);
    background: #ffffff;
    font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.9;
    letter-spacing: 0.02em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    position: relative;
    /* 固定ヘッダー（h-16 = 64px）の分だけコンテンツを下げる */
    padding-top: 64px;
}

a { color: inherit; text-decoration: none; }

/* アンカーリンク（目次・スキップリンク等）が固定ヘッダーに隠れないように */
:target { scroll-margin-top: 80px; }

img, video, iframe, embed, object { max-width: 100%; }
img, video { height: auto; }

/* Tailwind の任意値クラスの保険（CDN設定が効かない場合でもレイアウト幅を維持） */
.max-w-wrap { max-width: 1080px; }
.max-w-content { max-width: 720px; }
.custom-logo, .custom-logo-link img { max-height: 40px; width: auto; height: auto; max-width: 100%; }

::selection { background: #e3e3e3; }

/* =========================================================
   記事本文タイポグラフィ（Tailwind CDN に typography が無いため自前）
   .article-body 配下に WordPress 出力の HTML が入る
   ========================================================= */
.article-body {
    font-size: 17px;
    line-height: 2.0;
    color: #2b2b2b;
    word-wrap: break-word;
}
.article-body > * + * { margin-top: 1.6em; }

/* h2: 帯（左に太いアクセントバー＋薄い背景） */
.article-body h2 {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.5;
    margin-top: 2.6em;
    margin-bottom: 1em;
    padding: 0.55em 0.9em;
    background: var(--c-bg-soft);
    border-left: 4px solid var(--c-accent);
    border-radius: 0 4px 4px 0;
    letter-spacing: 0.01em;
    scroll-margin-top: 84px;
}
/* h3: 下線（左端だけアクセント色） */
.article-body h3 {
    position: relative;
    font-size: 1.22rem;
    font-weight: 700;
    line-height: 1.6;
    margin-top: 2.2em;
    margin-bottom: 0.7em;
    padding-bottom: 0.35em;
    border-bottom: 1px solid var(--c-line);
    scroll-margin-top: 84px;
}
.article-body h3::after {
    content: "";
    position: absolute;
    left: 0; bottom: -1px;
    width: 2.2em; height: 2px;
    background: var(--c-accent);
}
.article-body h2 + p,
.article-body h3 + p { margin-top: 0.9em; }
.article-body h4 {
    font-size: 1.06rem;
    font-weight: 700;
    margin-top: 1.8em;
    margin-bottom: 0.6em;
}
.article-body p { margin: 0; }
.article-body a {
    color: var(--c-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}
.article-body a:hover { color: var(--c-accent-dark); }

.article-body ul,
.article-body ol { padding-left: 1.5em; }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin-top: 0.4em; }
.article-body li > ul,
.article-body li > ol { margin-top: 0.4em; }

.article-body blockquote {
    margin-left: 0;
    margin-right: 0;
    padding: 0.2em 0 0.2em 1.2em;
    border-left: 3px solid var(--c-line);
    color: var(--c-muted);
}

.article-body img,
.article-body figure { border-radius: 6px; }
.article-body figure { margin-left: 0; margin-right: 0; }
.article-body figcaption {
    margin-top: 0.6em;
    font-size: 0.85em;
    color: var(--c-muted);
    text-align: center;
}

.article-body hr {
    border: 0;
    border-top: 1px solid var(--c-line);
    margin: 2.6em 0;
}

.article-body code {
    background: var(--c-bg-soft);
    border: 1px solid var(--c-line);
    border-radius: 4px;
    padding: 0.1em 0.4em;
    font-size: 0.9em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.article-body pre {
    background: #1f2530;
    color: #e6e9ef;
    border-radius: 8px;
    padding: 1.2em 1.4em;
    overflow-x: auto;
    font-size: 0.9em;
    line-height: 1.7;
}
.article-body pre code { background: transparent; border: 0; padding: 0; color: inherit; }

/* テーブルは横スクロールでラップして崩れを防ぐ */
.article-body .table-scroll,
.article-body figure.wp-block-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.article-body table {
    border-collapse: collapse;
    font-size: 0.95em;
    max-width: 100%;
}
.article-body th,
.article-body td {
    border: 1px solid var(--c-line);
    padding: 0.6em 0.9em;
    text-align: left;
}
.article-body th { background: var(--c-bg-soft); font-weight: 700; }

.article-body .wp-block-image { margin: 2em 0; }
.article-body .wp-block-image img { display: block; }
.article-body .wp-block-embed,
.article-body .wp-block-embed__wrapper { max-width: 100%; }
.article-body .wp-block-embed iframe { width: 100%; }
.article-body iframe { display: block; }
.article-body strong, .article-body b { font-weight: 700; }
.article-body p, .article-body li, .article-body a { overflow-wrap: break-word; word-break: break-word; }

/* キャプション付き画像（クラシック） */
.article-body .wp-caption { max-width: 100% !important; height: auto; }
.article-body .wp-caption-text { font-size: 0.85em; color: var(--c-muted); text-align: center; }

/* =========================================================
   目次（自動生成）
   ========================================================= */
.toc-box {
    background: var(--c-bg-soft);
    border: 1px solid var(--c-line);
    border-radius: 8px;
    padding: 1.1rem 1.3rem;
}
.toc-box .toc-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.6rem;
}
.toc-box ol { list-style: none; padding-left: 0; counter-reset: toc; }
.toc-box ol li { counter-increment: toc; margin-top: 0.35rem; line-height: 1.6; }
.toc-box ol li::before {
    content: counter(toc) ". ";
    color: var(--c-muted);
    font-size: 0.9em;
}
.toc-box ol li.toc-h3 { padding-left: 1.4rem; }
.toc-box ol li.toc-h3::before { content: ""; }
.toc-box a { color: #333; text-decoration: none; }
.toc-box a:hover { color: var(--c-accent); text-decoration: underline; }

/* =========================================================
   チップ（カテゴリ / タグ / 業種ラベルの共通デザイン）
   ========================================================= */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.2em;
    font-size: 11.5px;
    line-height: 1;
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    white-space: nowrap;
    transition: background-color .15s, color .15s, border-color .15s;
}
.chip-sm { font-size: 11px; padding: 4px 8px; }

/* カテゴリ: 黒塗り（記事ヘッダーなど目立たせたい場所） */
.chip-cat {
    background: #1a1a1a;
    color: #fff;
    font-weight: 700;
}
.chip-cat:hover { background: #000; }

/* カテゴリ: 薄グレー地（カード一覧など落ち着かせたい場所） */
.chip-cat-soft {
    background: #efefef;
    color: #1a1a1a;
    font-weight: 700;
}
.chip-cat-soft:hover { background: #e3e3e3; }

/* タグ / 業種: ニュートラルなアウトライン（# 付き） */
.chip-tag {
    background: #fff;
    color: #555;
    border-color: var(--c-line);
    font-weight: 500;
}
.chip-tag:hover { border-color: var(--c-accent); color: var(--c-accent); }
.chip-tag::before { content: "#"; color: #9aa3ad; }
.chip-tag:hover::before { color: var(--c-accent); }

/* 業種は薄グレー地で少し差をつける */
.chip-industry { background: var(--c-bg-soft); }

/* =========================================================
   ユーティリティ
   ========================================================= */
.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* =========================================================
   サイドバー — WP標準ウィジェット/ブロックを他セクションと同じ見た目に正規化
   （「最新の投稿」ブロック・検索・アーカイブ等を入れても揃う）
   テーマ独自セクション（Tailwindでマークアップ済み）は対象外にしたいので
   ウィジェット領域配下（.widget_block / .widget）にスコープする
   ========================================================= */
.sidebar .widget_block,
.sidebar .widget { margin-bottom: 2.5rem; }

/* 見出し（h2/h3 ブロック・classic widget title） */
.sidebar .widget_block h2,
.sidebar .widget_block h3,
.sidebar .widget_block .wp-block-heading,
.sidebar .widget .widget-title,
.sidebar .widget .widgettitle {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--c-line);
}

/* リスト系（最新の投稿 / アーカイブ / カテゴリ / ページリスト・テーマ独自の .side-list も含む） */
.sidebar .widget_block ul,
.sidebar .widget ul,
.sidebar ul.side-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 14px;
}
.sidebar .widget_block ul li,
.sidebar .widget ul li,
.sidebar ul.side-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--c-line-light);
    line-height: 1.55;
}
.sidebar .widget_block ul li:last-child,
.sidebar .widget ul li:last-child,
.sidebar ul.side-list li:last-child { border-bottom: 0; }
.sidebar .widget_block ul li a,
.sidebar .widget ul li a,
.sidebar ul.side-list li a { color: #333; }
.sidebar .widget_block ul li a:hover,
.sidebar .widget ul li a:hover,
.sidebar ul.side-list li a:hover { color: var(--c-accent); }
.sidebar .widget_block ul ul,
.sidebar .widget ul ul,
.sidebar ul.side-list ul { margin-top: 0.4rem; padding-left: 1rem; }
.sidebar .widget_block ul ul li,
.sidebar .widget ul ul li,
.sidebar ul.side-list ul li { border-bottom: 0; padding: 0.25rem 0; }
/* カテゴリ件数 "(5)" を少し控えめに */
.sidebar ul.side-list li a + .count,
.sidebar ul.side-list li .post-count { color: var(--c-muted); font-size: 11px; }

/* 最新の投稿（コアブロック）の日付 */
.sidebar .wp-block-latest-posts__post-date,
.sidebar .wp-block-latest-comments__comment-date {
    display: block;
    font-size: 11px;
    color: var(--c-muted);
    margin-top: 0.2rem;
}

/* 検索ブロック */
.sidebar .wp-block-search__inside-wrapper {
    border: 1px solid var(--c-line);
    border-radius: 6px;
    overflow: hidden;
}
.sidebar .wp-block-search__input { border: 0; padding: 0.5rem 0.75rem; font-size: 14px; }
.sidebar .wp-block-search__button { border: 0; background: var(--c-text); color: #fff; font-size: 13px; padding: 0 0.9rem; cursor: pointer; }

/* タグクラウド */
.sidebar .wp-block-tag-cloud a, .sidebar .tagcloud a {
    display: inline-block;
    font-size: 12px !important;
    background: var(--c-bg-soft);
    border: 1px solid var(--c-line);
    border-radius: 999px;
    padding: 3px 9px;
    margin: 0 4px 6px 0;
    color: #555;
}
.sidebar .wp-block-tag-cloud a:hover, .sidebar .tagcloud a:hover { border-color: var(--c-accent); color: var(--c-accent); }

/* WordPress 必須クラス */
.screen-reader-text {
    border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
    height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute;
}
.alignleft { float: left; margin-right: 1.5em; }
.alignright { float: right; margin-left: 1.5em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.sticky, .gallery-caption, .bypostauthor { }

/* ページネーション */
.pagination .page-numbers {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px; padding: 0 10px;
    border: 1px solid var(--c-line); border-radius: 6px;
    font-size: 14px; color: #333; transition: all .15s;
}
.pagination .page-numbers:hover { border-color: var(--c-accent); color: var(--c-accent); }
.pagination .page-numbers.current { background: var(--c-text); color: #fff; border-color: var(--c-text); }
.pagination .page-numbers.dots { border: 0; }

@media (max-width: 640px) {
    body { font-size: 15px; line-height: 1.85; }

    .article-body { font-size: 16px; line-height: 1.9; }
    .article-body > * + * { margin-top: 1.4em; }
    .article-body h2 { font-size: 1.28rem; margin-top: 2em; line-height: 1.45; }
    .article-body h3 { font-size: 1.1rem; margin-top: 1.7em; }
    .article-body h4 { font-size: 1.02rem; }
    .article-body ul, .article-body ol { padding-left: 1.25em; }
    .article-body blockquote { padding-left: 1em; }
    .article-body pre { padding: 1em; font-size: 0.82em; }
    .article-body table { font-size: 0.88em; }
    .article-body th, .article-body td { padding: 0.45em 0.6em; }

    .toc-box { padding: 0.9rem 1rem; }
    .toc-box ol li.toc-h3 { padding-left: 1.1rem; }
}
