/* ==========================================================================
   投稿記事・ブログ用スタイル
   テーマ: yomyom（よむデザイン事務所）
   ========================================================================== */

/* --------------------------------------------------
   0. 共通変数（既存テーマに合わせて調整してください）
   -------------------------------------------------- */
:root {
    --blog-color-primary: #048AE3;
    --blog-color-primary-light: #e8f4fd;
    --blog-color-primary-dark: #0370b8;
    --blog-color-accent-orange: #F5A623;
    --blog-color-accent-yellow: #FFD764;
    --blog-color-text: #333333;
    --blog-color-text-light: #666666;
    --blog-color-text-muted: #999999;
    --blog-color-bg: #ffffff;
    --blog-color-bg-cream: #FFF9F0;
    --blog-color-bg-gray: #F7F7F7;
    --blog-color-border: #E8E8E8;
    --blog-color-border-light: #F0F0F0;
    --blog-radius-s: 6px;
    --blog-radius-m: 12px;
    --blog-radius-l: 20px;
    --blog-shadow-s: 0 2px 8px rgba(0, 0, 0, 0.06);
    --blog-shadow-m: 0 4px 16px rgba(0, 0, 0, 0.08);
    --blog-content-width: 820px;
    --blog-wide-width: 1080px;
}

/* --------------------------------------------------
   1. 記事一覧ページ（アーカイブ）
   -------------------------------------------------- */

/* ページヘッダー */
.blog-archive-header {
    text-align: center;
    padding: 60px 0 40px;
}

.blog-archive-header .section-label {
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: var(--blog-color-primary);
    font-weight: 700;
}

.blog-archive-header .section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--blog-color-text);
    margin-top: 8px;
}

/* カード一覧 */
.blog-archive-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    padding-bottom: 60px;
}

.blog-card {
    display: block;
    background: var(--blog-color-bg);
    border-radius: var(--blog-radius-m);
    box-shadow: var(--blog-shadow-s);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--blog-shadow-m);
}

.blog-card__img {
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.blog-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.blog-card:hover .blog-card__img img {
    transform: scale(1.05);
}

.blog-card__body {
    padding: 20px;
}

.blog-card__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.blog-card__date {
    font-size: 0.75rem;
    color: var(--blog-color-text-muted);
}

.blog-card__cat {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--blog-color-primary);
    background: var(--blog-color-primary-light);
    padding: 2px 10px;
    border-radius: 50px;
    line-height: 1.6;
}

.blog-card__title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.7;
    color: var(--blog-color-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ページネーション */
.blog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 40px 0 80px;
}

.blog-pagination a,
.blog-pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
}

.blog-pagination a {
    color: var(--blog-color-text-light);
    background: var(--blog-color-bg);
    border: 1px solid var(--blog-color-border);
}

.blog-pagination a:hover {
    color: var(--blog-color-primary);
    border-color: var(--blog-color-primary);
    background: var(--blog-color-primary-light);
}

.blog-pagination .current {
    color: #fff;
    background: var(--blog-color-primary);
    border: 1px solid var(--blog-color-primary);
}

/* --------------------------------------------------
   2. 記事詳細ページ（シングル）
   -------------------------------------------------- */

/* 記事ヘッダー */
.post-header {
    max-width: var(--blog-content-width);
    margin: 0 auto;
    padding: 48px 20px 0;
    text-align: center;
}

.post-header__meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.post-header__date {
    font-size: 0.8rem;
    color: var(--blog-color-text-muted);
}

.post-header__cat {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--blog-color-primary);
    background: var(--blog-color-primary-light);
    padding: 3px 14px;
    border-radius: 50px;
    text-decoration: none;
    transition: background 0.25s ease;
}

.post-header__cat:hover {
    background: #d0e9fa;
}

.post-header__title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.7;
    color: var(--blog-color-text);
    margin-bottom: 28px;
}

/* アイキャッチ画像 */
.post-thumbnail {
    max-width: var(--blog-wide-width);
    margin: 0 auto 48px;
    padding: 0 20px;
}

.post-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: var(--blog-radius-l);
    box-shadow: var(--blog-shadow-m);
}

/* --------------------------------------------------
   3. 記事本文（the_content）
   -------------------------------------------------- */
.post-content {
    max-width: var(--blog-content-width);
    margin: 0 auto;
    padding: 0 20px 80px;
    font-size: 1rem;
    line-height: 2;
    color: var(--blog-color-text);
    word-break: break-word;
    overflow-wrap: break-word;
}

/* --- 見出し --- */
.post-content h2 {
    position: relative;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.6;
    color: var(--blog-color-text);
    margin: 72px 0 28px;
    padding: 16px 20px 16px 24px;
    background: var(--blog-color-bg-cream);
    border-left: 5px solid var(--blog-color-primary);
    border-radius: 0 var(--blog-radius-s) var(--blog-radius-s) 0;
}

.post-content h2:first-child {
    margin-top: 0;
}

.post-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.6;
    color: var(--blog-color-text);
    margin: 56px 0 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--blog-color-primary-light);
}

.post-content h4 {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.6;
    color: var(--blog-color-text);
    margin: 44px 0 16px;
    padding-left: 14px;
    border-left: 3px solid var(--blog-color-accent-orange);
}

.post-content h5 {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.6;
    color: var(--blog-color-text-light);
    margin: 36px 0 12px;
}

/* --- 段落 --- */
.post-content p {
    margin: 0 0 24px;
}

.post-content p:last-child {
    margin-bottom: 0;
}

/* --- リンク --- */
.post-content a {
    color: var(--blog-color-primary);
    text-decoration: underline;
    text-decoration-color: rgba(4, 138, 227, 0.3);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.25s ease;
}

.post-content a:hover {
    text-decoration-color: var(--blog-color-primary);
}

/* --- 太字・斜体 --- */
.post-content strong {
    font-weight: 700;
    background: linear-gradient(transparent 60%, var(--blog-color-accent-yellow) 60%);
    padding: 0 2px;
}

.post-content em {
    font-style: italic;
}

/* --- リスト --- */
.post-content ul,
.post-content ol {
    margin: 0 0 28px;
    padding-left: 0;
    list-style: none;
}

.post-content ul li,
.post-content ol li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 10px;
    line-height: 1.9;
}

.post-content ul li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 0.75em;
    width: 8px;
    height: 8px;
    background: var(--blog-color-primary);
    border-radius: 50%;
}

.post-content ol {
    counter-reset: ol-counter;
}

.post-content ol li {
    counter-increment: ol-counter;
}

.post-content ol li::before {
    content: counter(ol-counter);
    position: absolute;
    left: 0;
    top: 0.15em;
    width: 22px;
    height: 22px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    background: var(--blog-color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ネストリスト */
.post-content ul ul,
.post-content ol ol,
.post-content ul ol,
.post-content ol ul {
    margin: 8px 0 0;
}

/* --- 引用 --- */
.post-content blockquote {
    position: relative;
    margin: 36px 0;
    padding: 28px 28px 28px 56px;
    background: var(--blog-color-bg-gray);
    border-radius: var(--blog-radius-m);
    border: none;
    font-size: 0.95rem;
    color: var(--blog-color-text-light);
    line-height: 2;
}

.post-content blockquote::before {
    content: "\201C";
    position: absolute;
    left: 20px;
    top: 16px;
    font-size: 3rem;
    font-family: Georgia, serif;
    color: var(--blog-color-primary);
    opacity: 0.4;
    line-height: 1;
}

.post-content blockquote p {
    margin-bottom: 12px;
}

.post-content blockquote p:last-child {
    margin-bottom: 0;
}

.post-content blockquote cite {
    display: block;
    margin-top: 12px;
    font-size: 0.8rem;
    font-style: normal;
    color: var(--blog-color-text-muted);
    text-align: right;
}

.post-content blockquote cite::before {
    content: "— ";
}

/* --- 画像 --- */
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--blog-radius-m);
}

.post-content .wp-block-image {
    margin: 36px 0;
}

.post-content .wp-block-image img {
    box-shadow: var(--blog-shadow-s);
}

.post-content .wp-block-image figcaption {
    font-size: 0.8rem;
    color: var(--blog-color-text-muted);
    text-align: center;
    margin-top: 10px;
    line-height: 1.6;
}

/* ワイド幅・フル幅 */
.post-content .alignwide {
    max-width: var(--blog-wide-width);
    margin-left: calc(50% - var(--blog-wide-width) / 2);
    margin-right: calc(50% - var(--blog-wide-width) / 2);
}

.post-content .alignfull {
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.post-content .alignfull img {
    border-radius: 0;
}

/* --- テーブル --- */
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 36px 0;
    font-size: 0.92rem;
    line-height: 1.7;
}

.post-content table thead th {
    background: var(--blog-color-primary);
    color: #fff;
    font-weight: 600;
    padding: 12px 16px;
    text-align: left;
}

.post-content table thead th:first-child {
    border-radius: var(--blog-radius-s) 0 0 0;
}

.post-content table thead th:last-child {
    border-radius: 0 var(--blog-radius-s) 0 0;
}

.post-content table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--blog-color-border-light);
    color: var(--blog-color-text);
}

.post-content table tbody tr:nth-child(even) {
    background: var(--blog-color-bg-gray);
}

.post-content table tbody tr:last-child td:first-child {
    border-radius: 0 0 0 var(--blog-radius-s);
}

.post-content table tbody tr:last-child td:last-child {
    border-radius: 0 0 var(--blog-radius-s) 0;
}

/* --- コードブロック --- */
.post-content code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.88em;
    background: var(--blog-color-bg-gray);
    color: #d63384;
    padding: 2px 7px;
    border-radius: 4px;
}

.post-content pre {
    margin: 36px 0;
    padding: 24px;
    background: #1e1e2e;
    color: #cdd6f4;
    border-radius: var(--blog-radius-m);
    overflow-x: auto;
    font-size: 0.88rem;
    line-height: 1.7;
    -webkit-overflow-scrolling: touch;
}

.post-content pre code {
    background: none;
    color: inherit;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
}

/* --- 区切り線 --- */
.post-content hr {
    border: none;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--blog-color-border), transparent);
    margin: 56px 0;
}

/* --- WPブロック: ボタン --- */
.post-content .wp-block-button .wp-block-button__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 36px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    background: var(--blog-color-primary);
    border-radius: 50px;
    text-decoration: none;
    transition: background 0.3s ease, transform 0.2s ease;
    box-shadow: 0 3px 12px rgba(4, 138, 227, 0.25);
}

.post-content .wp-block-button .wp-block-button__link:hover {
    background: var(--blog-color-primary-dark);
    transform: translateY(-1px);
}

/* --- WPブロック: カラム --- */
.post-content .wp-block-columns {
    margin: 36px 0;
    gap: 24px;
}

/* --- WPブロック: ギャラリー --- */
.post-content .wp-block-gallery {
    margin: 36px 0;
}

.post-content .wp-block-gallery .wp-block-image {
    margin: 0;
}

.post-content .wp-block-gallery .wp-block-image img {
    border-radius: var(--blog-radius-s);
}

/* --- WPブロック: カバー --- */
.post-content .wp-block-cover {
    border-radius: var(--blog-radius-l);
    overflow: hidden;
    margin: 36px 0;
}

/* --- WPブロック: 埋め込み（YouTube等） --- */
.post-content .wp-block-embed {
    margin: 36px 0;
}

.post-content .wp-block-embed__wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--blog-radius-m);
    box-shadow: var(--blog-shadow-s);
}

.post-content .wp-block-embed__wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* --- 補足ボックス（カスタム：任意で使用） --- */
.post-content .box-note {
    margin: 32px 0;
    padding: 24px 24px 24px 56px;
    background: var(--blog-color-primary-light);
    border-radius: var(--blog-radius-m);
    position: relative;
    line-height: 1.9;
}

.post-content .box-note::before {
    content: "\1F4A1";
    position: absolute;
    left: 20px;
    top: 22px;
    font-size: 1.2rem;
}

.post-content .box-warning {
    margin: 32px 0;
    padding: 24px 24px 24px 56px;
    background: #FFF5E5;
    border-left: 4px solid var(--blog-color-accent-orange);
    border-radius: 0 var(--blog-radius-m) var(--blog-radius-m) 0;
    position: relative;
    line-height: 1.9;
}

.post-content .box-warning::before {
    content: "\26A0\FE0F";
    position: absolute;
    left: 20px;
    top: 22px;
    font-size: 1.2rem;
}

/* --------------------------------------------------
   4. 記事フッター（タグ・シェア・前後ナビ）
   -------------------------------------------------- */

/* タグ */
.post-tags {
    max-width: var(--blog-content-width);
    margin: 0 auto;
    padding: 0 20px 40px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.post-tags a {
    display: inline-block;
    font-size: 0.78rem;
    color: var(--blog-color-text-light);
    background: var(--blog-color-bg-gray);
    padding: 4px 14px;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.25s ease;
}

.post-tags a::before {
    content: "# ";
}

.post-tags a:hover {
    background: var(--blog-color-primary-light);
    color: var(--blog-color-primary);
}

/* シェアボタン */
.post-share {
    max-width: var(--blog-content-width);
    margin: 0 auto;
    padding: 0 20px 48px;
    text-align: center;
}

.post-share__title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--blog-color-text-muted);
    letter-spacing: 0.08em;
    margin-bottom: 14px;
}

.post-share__buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.post-share__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    text-decoration: none;
    color: #fff;
    font-size: 1rem;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.post-share__btn:hover {
    transform: scale(1.1);
    opacity: 0.85;
}

.post-share__btn--x {
    background: #000;
}

.post-share__btn--facebook {
    background: #1877F2;
}

.post-share__btn--line {
    background: #06C755;
}

.post-share__btn--copy {
    background: var(--blog-color-text-muted);
}

/* 前後の記事ナビ */
.post-nav {
    max-width: var(--blog-content-width);
    margin: 0 auto 60px;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.post-nav__item {
    display: flex;
    flex-direction: column;
    padding: 20px 24px;
    background: var(--blog-color-bg-gray);
    border-radius: var(--blog-radius-m);
    text-decoration: none;
    color: inherit;
    transition: background 0.25s ease, transform 0.2s ease;
}

.post-nav__item:hover {
    background: var(--blog-color-primary-light);
    transform: translateY(-2px);
}

.post-nav__item--prev {
    text-align: left;
}

.post-nav__item--next {
    text-align: right;
}

.post-nav__label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--blog-color-primary);
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.post-nav__title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--blog-color-text);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --------------------------------------------------
   5. 関連記事
   -------------------------------------------------- */
.related-posts {
    max-width: var(--blog-wide-width);
    margin: 0 auto;
    padding: 60px 20px 80px;
    border-top: 1px solid var(--blog-color-border-light);
}

.related-posts__heading {
    text-align: center;
    margin-bottom: 32px;
}

.related-posts__label {
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: var(--blog-color-primary);
    font-weight: 700;
}

.related-posts__title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--blog-color-text);
    margin-top: 6px;
}

.related-posts__list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* --------------------------------------------------
   6. レスポンシブ
   -------------------------------------------------- */

/* タブレット */
@media screen and (max-width: 1024px) {
    .blog-archive-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .related-posts__list {
        grid-template-columns: repeat(2, 1fr);
    }

    .post-content .alignwide {
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
}

/* スマートフォン */
@media screen and (max-width: 767px) {

    /* 一覧 */
    .blog-archive-header {
        padding: 40px 0 28px;
    }

    .blog-archive-header .section-title {
        font-size: 1.375rem;
    }

    .blog-archive-list {
        grid-template-columns: 1fr;
        gap: 20px;
        padding-bottom: 40px;
    }

    .blog-card__body {
        padding: 16px;
    }

    .blog-pagination {
        padding: 28px 0 60px;
    }

    /* 記事詳細 */
    .post-header {
        padding: 32px 16px 0;
    }

    .post-header__title {
        font-size: 1.375rem;
        text-align: left;
    }

    .post-header__meta {
        justify-content: flex-start;
    }

    .post-thumbnail {
        padding: 0 16px;
        margin-bottom: 32px;
    }

    .post-thumbnail img {
        border-radius: var(--blog-radius-m);
    }

    /* 本文 */
    .post-content {
        padding: 0 16px 60px;
        font-size: 0.95rem;
    }

    .post-content h2 {
        font-size: 1.25rem;
        margin: 52px 0 20px;
        padding: 14px 16px 14px 20px;
    }

    .post-content h3 {
        font-size: 1.1rem;
        margin: 40px 0 16px;
    }

    .post-content h4 {
        font-size: 1rem;
        margin: 32px 0 12px;
    }

    .post-content blockquote {
        padding: 24px 20px 24px 44px;
    }

    .post-content blockquote::before {
        left: 14px;
        font-size: 2.4rem;
    }

    .post-content pre {
        padding: 20px 16px;
        font-size: 0.82rem;
        border-radius: var(--blog-radius-s);
    }

    .post-content table {
        font-size: 0.82rem;
    }

    .post-content table thead th,
    .post-content table tbody td {
        padding: 10px 12px;
    }

    .post-content .box-note,
    .post-content .box-warning {
        padding: 20px 16px 20px 48px;
    }

    /* フッター */
    .post-tags {
        padding: 0 16px 28px;
    }

    .post-share {
        padding: 0 16px 36px;
    }

    .post-nav {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 0 16px;
        margin-bottom: 40px;
    }

    .post-nav__item--next {
        text-align: left;
    }

    /* 関連記事 */
    .related-posts {
        padding: 40px 16px 60px;
    }

    .related-posts__title {
        font-size: 1.25rem;
    }

    .related-posts__list {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}