/* =========================================
   記事ページ・記事一覧（MORI CREATE JOURNEY）
   ========================================= */

.journey-post-page {
    --journey-post-body: 780px;
    padding: clamp(8rem, 13vw, 10rem) var(--journey-gutter) clamp(5rem, 9vw, 8rem);
}

/* 旧テーマの style.css にある section の全体指定（min-height: 80vh など）を打ち消す */
.journey-post-page section { display: block; min-height: 0; padding: 0; border-bottom: 0; }

.admin-bar .journey-toc { top: calc(6rem + 32px); }

/* ---- ヘッダー ---- */
.journey-post-hero,
.journey-archive-hero { max-width: 880px; margin: 0 auto clamp(2.5rem, 5vw, 3.5rem); }
/* 記事のタイトル部分は本文と同じ幅にそろえ、目次がタイトルの列にはみ出さないようにする */
.journey-post-page .journey-post-hero { max-width: var(--journey-post-body); }

/* 記事ページのタイトル部分は、ヘッダー（PC 5.25rem・スマホ 4.5rem）のすぐ下から画面幅いっぱいの黒帯にする。文字は本文と同じ列に置く */
.journey-post > .journey-post-hero {
    max-width: none;
    margin: calc(5.25rem - clamp(8rem, 13vw, 10rem)) calc(50% - 50vw) clamp(2.5rem, 5vw, 3.5rem);
    padding: clamp(2.5rem, 5vw, 4rem) max(var(--journey-pad), calc((100vw - var(--journey-post-body)) / 2)) clamp(2rem, 4vw, 3rem);
    background: var(--journey-ink);
    color: var(--journey-cream);
}
.journey-post > .journey-post-hero .journey-post-breadcrumb a,
.journey-post > .journey-post-hero .journey-post-breadcrumb li + li::before,
.journey-post > .journey-post-hero .journey-post-reading,
.journey-post > .journey-post-hero .journey-post-dates { color: rgba(242, 237, 223, .72); }
.journey-post > .journey-post-hero .journey-post-breadcrumb a:hover { color: var(--journey-yellow); }
.journey-post > .journey-post-hero .journey-post-category { border-color: var(--journey-yellow); }
.journey-post > .journey-post-hero .journey-post-category:hover { box-shadow: 2px 2px 0 var(--journey-cream); }
.journey-post > .journey-post-hero .journey-post-title { color: var(--journey-cream); }
.journey-post > .journey-post-hero .journey-post-lead { color: rgba(242, 237, 223, .85); }
.journey-post > .journey-post-hero .journey-post-byline { border-top: 1px solid rgba(242, 237, 223, .25); }
.journey-post > .journey-post-hero .journey-post-avatar { border-color: var(--journey-cream); }
/* ログイン中は管理バーの分だけ本文が下がるが、ヘッダーは上に残るのでその分だけ帯を上げる */
.admin-bar .journey-post > .journey-post-hero { margin-top: calc(5.25rem - clamp(8rem, 13vw, 10rem) - 46px); }
@media (min-width: 783px) {
    .admin-bar .journey-post > .journey-post-hero { margin-top: calc(5.25rem - clamp(8rem, 13vw, 10rem) - 32px); }
}

.journey-post-breadcrumb ol { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1.75rem; padding: 0; list-style: none; font-size: .78rem; font-weight: 700; }
.journey-post-breadcrumb li { display: flex; align-items: center; gap: .4rem; }
.journey-post-breadcrumb li + li::before { content: "/"; color: #8a857a; }
.journey-post-breadcrumb a { color: #5c584f; }
.journey-post-breadcrumb a:hover { color: var(--journey-blue); text-decoration: underline; text-underline-offset: 3px; }

.journey-post-labels { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-bottom: 1.25rem; }
.journey-post-category { padding: .3rem .9rem; border: var(--journey-line); border-radius: 999px; background: var(--journey-yellow); font-size: .78rem; font-weight: 900; transition: transform .2s ease, box-shadow .2s ease; }
.journey-post-category:hover { transform: translate(-2px, -2px); box-shadow: 2px 2px 0 var(--journey-ink); }
.journey-post-reading { color: #5c584f; font-size: .8rem; font-weight: 700; }

.journey-post-title { margin: 0; font-family: "Noto Sans JP", sans-serif !important; font-size: clamp(1.75rem, 3.6vw, 2.75rem); font-weight: 900; line-height: 1.45; letter-spacing: .01em; }
.journey-post-lead { margin: 1.5rem 0 0; color: #45423b; font-size: clamp(1rem, 1.4vw, 1.08rem); line-height: 1.95; }
.journey-post-lead p { margin: 0; }

.journey-post-byline { display: flex; align-items: center; gap: .9rem; margin-top: 2rem; padding-top: 1.5rem; border-top: var(--journey-line); }
.journey-post-avatar { display: grid; flex: none; place-items: center; width: 2.9rem; aspect-ratio: 1; border: var(--journey-line); border-radius: 50%; background: var(--journey-blue); color: var(--journey-cream); font-family: "Archivo Black"; font-size: 1rem; }
.journey-post-avatar.is-large { width: 4.5rem; font-size: 1.5rem; }
.journey-post-avatar img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.journey-post-avatar:has(img) { overflow: hidden; background: var(--journey-cream); }
.journey-post-author { margin: 0; font-size: .92rem; font-weight: 900; line-height: 1.4; }
.journey-post-dates { display: flex; flex-wrap: wrap; gap: 0 1rem; margin: .15rem 0 0; color: #5c584f; font-size: .76rem; line-height: 1.6; }

/* ---- アイキャッチ ---- */
.journey-post-eyecatch { max-width: 1100px; margin: 0 auto clamp(3rem, 6vw, 4.5rem); }
.journey-post-eyecatch img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 12px; }

/* ---- 本文レイアウト（目次 + 本文） ---- */
/* 本文はページの真ん中。目次は左の余白に置く */
/* ページの左右の余白に関係なく、画面幅いっぱいを使って本文を真ん中に置く */
.journey-post-layout { --journey-layout-w: min(calc(100vw - 64px), 1400px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, var(--journey-post-body)) minmax(0, 1fr); gap: 3.5rem; width: var(--journey-layout-w); margin-inline: calc((100% - var(--journey-layout-w)) / 2); }
.journey-post-aside { position: relative; grid-column: 1; grid-row: 1; justify-self: start; width: min(220px, 100%); }
.journey-post-main { grid-column: 2; grid-row: 1; min-width: 0; }

/* 外枠は付けず、黒い帯＋項目だけ（帯と外枠で二重に見えるため） */
/* 固定ヘッダー（4.5rem）の下に止まるようにする */
.journey-toc { position: sticky; top: 6rem; border-bottom: 1px solid rgba(17, 17, 15, .25); }
/* 項目が多くても画面からはみ出さないよう、高さを画面に収めて中だけスクロールさせる */
.journey-toc ol { max-height: calc(100vh - 8rem - 3.2rem); overflow-y: auto; overscroll-behavior: contain; }
.journey-toc summary { display: flex; align-items: center; justify-content: space-between; padding: .85rem 1.1rem; background: var(--journey-ink); color: var(--journey-cream); font-size: .82rem; font-weight: 900; letter-spacing: .1em; list-style: none; cursor: pointer; }
.journey-toc summary::-webkit-details-marker { display: none; }
.journey-toc summary::after { content: "−"; font-family: "Archivo Black"; }
.journey-toc:not([open]) summary { border-bottom: 0; }
.journey-toc:not([open]) summary::after { content: "+"; }
.journey-toc ol { margin: 0; padding: .6rem 0; list-style: none; counter-reset: toc; }
.journey-toc li { counter-increment: toc; }
.journey-toc a { display: grid; grid-template-columns: 1.6rem 1fr; gap: .25rem; padding: .5rem 1.1rem; font-size: .82rem; font-weight: 700; line-height: 1.6; transition: background-color .2s ease, color .2s ease; }
.journey-toc a::before { content: counter(toc, decimal-leading-zero); color: var(--journey-blue); font-family: "Archivo Black"; font-size: .7rem; line-height: 2.1; }
.journey-toc a:hover { background: rgba(244, 196, 48, .35); }
.journey-toc a.is-active { background: var(--journey-yellow); }

/* ---- 本文 ---- */
.journey-post-content { color: #2b2a26; font-size: clamp(1rem, 1.25vw, 1.0625rem); line-height: 1.95; letter-spacing: .03em; }
.journey-post-content > * { margin: 0; }
.journey-post-content > * + * { margin-top: 1.4em; }
.journey-post-content h2,
.journey-post-content h3,
.journey-post-content h4 { color: var(--journey-ink); font-family: "Noto Sans JP", sans-serif !important; font-weight: 900; line-height: 1.5; letter-spacing: .02em; scroll-margin-top: 6.5rem; }
/* 章の区切りは、箱にせず上の太線で見せる */
.journey-post-content h2 { margin-top: 3.4em; padding-top: 1rem; border-top: 3px solid var(--journey-ink); font-size: clamp(1.3rem, 2.3vw, 1.65rem); }
.journey-post-content > h2:first-child { margin-top: 0; }
.journey-post-content h3 { margin-top: 2.4em; padding-left: .8rem; border-left: 4px solid var(--journey-yellow); font-size: clamp(1.08rem, 1.6vw, 1.22rem); }
.journey-post-content h4 { margin-top: 2em; font-size: 1.05rem; }
.journey-post-content h2 + *,
.journey-post-content h3 + * { margin-top: 1.1em; }

.journey-post-content a { color: var(--journey-blue); font-weight: 700; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.journey-post-content a:hover { background: rgba(244, 196, 48, .45); }
.journey-post-content strong { background: linear-gradient(transparent 68%, rgba(244, 196, 48, .45) 68%); color: var(--journey-ink); font-weight: 700; }

.journey-post-content ul,
.journey-post-content ol { padding-left: 1.4em; }
.journey-post-content ul { list-style: none; padding-left: 1.2em; }
.journey-post-content ul > li { position: relative; }
.journey-post-content ul > li::before { content: ""; position: absolute; top: .85em; left: -1.05em; width: .45em; height: .45em; border-radius: 50%; background: var(--journey-ink); }
.journey-post-content ol { list-style: decimal; }
.journey-post-content ol > li::marker { color: var(--journey-blue); font-family: "Archivo Black"; font-size: .85em; }
.journey-post-content li + li { margin-top: .45em; }

.journey-post-content code { padding: .12em .4em; border-radius: 4px; background: rgba(17, 17, 15, .08); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; }
.journey-post-content pre { overflow-x: auto; padding: 1.25rem 1.4rem; border: var(--journey-line); background: var(--journey-ink); color: var(--journey-cream); font-size: .84rem; line-height: 1.8; }
.journey-post-content pre code { padding: 0; background: none; color: inherit; font-size: inherit; }

.journey-post-content .wp-block-table { overflow-x: auto; }
.journey-post-content table { width: 100%; border: var(--journey-line); border-collapse: collapse; background: #fffdf7; font-size: .9rem; line-height: 1.7; }
.journey-post-content th,
.journey-post-content td { padding: .8rem 1rem; border: 1px solid rgba(17, 17, 15, .25); text-align: left; vertical-align: top; }
.journey-post-content thead th { border-bottom: var(--journey-line); background: var(--journey-yellow); font-weight: 900; white-space: nowrap; }
.journey-post-content tbody tr:nth-child(even) { background: rgba(242, 237, 223, .6); }

/* 引用・注記は小見出し（h3 の黄色い線）と見分けがつくよう、線は灰色にして薄い背景の箱で見せる */
.journey-post-content blockquote { position: relative; margin-left: 0; margin-right: 0; padding: .9rem 1.2rem; border-left: 4px solid rgba(17, 17, 15, .25); background: rgba(242, 237, 223, .6); color: #3d3a33; font-size: .92rem; }
.journey-post-content blockquote p { margin: 0; }
.journey-post-content img { height: auto; border-radius: 8px; }
.journey-post-content figcaption { margin-top: .5rem; color: #5c584f; font-size: .8rem; text-align: center; }

/* ---- タグ・著者・CTA ---- */
.journey-post-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 3.5rem; }
.journey-post-tags a { padding: .3rem .85rem; border: 1.5px solid var(--journey-ink); border-radius: 999px; background: #fffdf7; font-size: .78rem; font-weight: 700; }
.journey-post-tags a::before { content: "#"; color: var(--journey-blue); }
.journey-post-tags a:hover { background: var(--journey-yellow); }

.journey-post-page .journey-post-author-box { display: grid; grid-template-columns: auto 1fr; gap: 1.5rem; margin-top: 3.5rem; padding: clamp(1.5rem, 3vw, 2rem); border: var(--journey-line); background: #fffdf7; }
.journey-post-author-box .journey-eyebrow { margin-bottom: .35rem; color: var(--journey-blue); }
.journey-post-author-box h2 { margin: 0 0 .75rem; font-family: "Noto Sans JP", sans-serif !important; font-size: 1.25rem; font-weight: 900; }
.journey-post-author-box p { margin: 0; font-size: .9rem; line-height: 1.9; }
.journey-post-author-box ul { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin: 1rem 0 0; padding: 0; list-style: none; font-size: .84rem; font-weight: 700; }
.journey-post-author-box ul a { border-bottom: 2px solid var(--journey-yellow); }
.journey-post-author-box ul a:hover { color: var(--journey-blue); }

.journey-post-page .journey-post-cta { margin-top: 2rem; padding: clamp(1.75rem, 4vw, 2.5rem); border: var(--journey-line); background: var(--journey-blue); color: var(--journey-cream); box-shadow: 8px 8px 0 var(--journey-ink); }
.journey-post-cta .journey-eyebrow { margin-bottom: .5rem; color: var(--journey-yellow); }
.journey-post-cta h2 { margin: 0 0 .8rem; font-family: "Noto Sans JP", sans-serif !important; font-size: clamp(1.3rem, 2.4vw, 1.6rem); font-weight: 900; line-height: 1.5; }
.journey-post-cta p { margin: 0 0 1.5rem; font-size: .92rem; line-height: 1.9; }
.journey-post-cta-button { display: inline-flex; align-items: center; gap: .6rem; padding: .85rem 1.5rem; border: var(--journey-line); border-radius: 999px; background: var(--journey-yellow); color: var(--journey-ink); font-weight: 900; transition: transform .2s ease, box-shadow .2s ease; }
.journey-post-cta-button:hover { transform: translate(-3px, -3px); box-shadow: 4px 4px 0 var(--journey-ink); }

/* ---- 関連記事・記事カード ---- */
.journey-post-page .journey-post-related { max-width: 1100px; margin: clamp(5rem, 9vw, 7rem) auto 0; padding-top: clamp(3rem, 6vw, 4rem); border-top: var(--journey-line); }
.journey-post-related-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 2rem; }
.journey-post-related-head .journey-eyebrow { margin-bottom: .4rem; }
.journey-post-related-head h2 { margin: 0; font-family: "Noto Sans JP", sans-serif !important; font-size: clamp(1.5rem, 2.8vw, 2rem); font-weight: 900; }
.journey-post-related-head a { font-size: .85rem; font-weight: 900; border-bottom: 2px solid var(--journey-ink); }

.journey-post-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.25rem, 2.5vw, 2rem); max-width: 1100px; margin: 0 auto; }
.journey-post-card a { display: block; height: 100%; }
/* トップページのブログのカードと同じ、枠付きのサムネイル */
.journey-post-card-thumb { display: grid; place-items: center; overflow: hidden; aspect-ratio: 1200 / 630; border: var(--journey-line); border-radius: 12px; background: var(--journey-yellow); transition: transform .25s ease, box-shadow .25s ease; }
.journey-post-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.journey-post-card-thumb span { font-family: "Archivo Black"; font-size: 2rem; transform: rotate(-6deg); }
.journey-post-card a:hover .journey-post-card-thumb { transform: translateY(-4px); }
.journey-post-card a:hover img { transform: scale(1.04); }
.journey-post-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; margin-top: 1rem; font-size: .72rem; font-weight: 700; letter-spacing: .06em; }
.journey-post-card-meta span { padding: .1rem .6rem; border: 1.5px solid var(--journey-ink); border-radius: 999px; background: #fffdf7; }
.journey-post-card-title { display: -webkit-box; margin: .5rem 0 0; overflow: hidden; font-family: "Noto Sans JP", sans-serif !important; font-size: 1rem; font-weight: 900; line-height: 1.65; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.journey-post-card a:hover .journey-post-card-title { color: var(--journey-blue); }

/* ---- 記事一覧 ---- */
.journey-archive-hero { max-width: 1100px; }
.journey-archive-hero .journey-eyebrow { margin-bottom: .5rem; }
.journey-archive-pagination { max-width: 1100px; margin: 3.5rem auto 0; }
.journey-archive-pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.journey-archive-pagination .page-numbers { display: grid; place-items: center; min-width: 2.75rem; height: 2.75rem; padding: 0 .9rem; border: var(--journey-line); background: #fffdf7; font-weight: 900; }
.journey-archive-pagination .current { background: var(--journey-ink); color: var(--journey-cream); }
.journey-archive-pagination a.page-numbers:hover { background: var(--journey-yellow); }

/* ---- レスポンシブ ---- */
/* 左に目次を置く余白がない幅では、目次は本文の上に閉じた状態で置く */
@media (max-width: 1359px) {
    .journey-post-layout { grid-template-columns: minmax(0, var(--journey-post-body)); justify-content: center; width: auto; margin-inline: 0; }
    .journey-post-aside { grid-column: 1; grid-row: 1; justify-self: stretch; width: auto; }
    .journey-post-main { grid-column: 1; grid-row: 2; }
    .journey-toc { position: static; }
    .journey-toc ol { max-height: none; }
}

@media (max-width: 900px) {
    .journey-post-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
    .journey-post-page { padding-top: 7.5rem; }
    .journey-post > .journey-post-hero { margin-top: -3rem; }
    .admin-bar .journey-post > .journey-post-hero { margin-top: calc(-3rem - 46px); }
    .journey-post-cards { grid-template-columns: 1fr; }
    .journey-post-page .journey-post-author-box { grid-template-columns: 1fr; gap: 1rem; }
    .journey-post-related-head { display: block; }
    .journey-post-related-head a { display: inline-block; margin-top: 1rem; }
    .journey-post-content thead th { white-space: normal; }
    /* スマホでは表を1行ずつのカードにして、横スクロールなしで読めるようにする（td に data-label がある表だけ） */
    .journey-post-content table:has(td[data-label]) { border: 0; background: none; }
    .journey-post-content table:has(td[data-label]) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .journey-post-content table:has(td[data-label]) tbody { display: grid; gap: .9rem; }
    .journey-post-content table:has(td[data-label]) tr { display: block; border: var(--journey-line); background: #fffdf7; }
    .journey-post-content table:has(td[data-label]) tbody tr:nth-child(even) { background: #fffdf7; }
    .journey-post-content table:has(td[data-label]) td { display: block; padding: .65rem .9rem; border: 0; border-top: 1px solid rgba(17, 17, 15, .15); }
    .journey-post-content table:has(td[data-label]) td:first-child { border-top: 0; background: var(--journey-yellow); font-weight: 900; }
    .journey-post-content table:has(td[data-label]) td:not(:first-child)::before { content: attr(data-label); display: block; margin-bottom: .2rem; color: #5c584f; font-size: .75rem; font-weight: 700; }
}

/* ---- 本文途中のCTA ---- */
.journey-post-content .journey-inline-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; margin-top: 3rem; padding: 1.25rem 1.5rem; border-radius: 12px; background: var(--journey-yellow); }
.journey-post-content .journey-inline-cta + h2 { margin-top: 3rem; }
.journey-inline-cta-text { flex: 1 1 18rem; margin: 0; font-size: .98rem; line-height: 1.7; }
.journey-post-content .journey-inline-cta-text strong { background: none; font-weight: 900; }
.journey-post-content .journey-inline-cta-button { display: inline-flex; flex: none; align-items: center; gap: .5rem; padding: .7rem 1.25rem; border: var(--journey-line); border-radius: 999px; background: var(--journey-ink); color: var(--journey-cream); font-size: .9rem; font-weight: 900; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease; }
.journey-post-content .journey-inline-cta-button:hover { background: var(--journey-ink); transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--journey-blue); }

/* ---- 固定ページ（プロフィール・プライバシーポリシー） ---- */
.journey-page-body { max-width: var(--journey-post-body); margin: 0 auto; }
.journey-profile-head { display: flex; align-items: center; gap: 1.25rem; }
.journey-profile-head .journey-post-avatar.is-large { width: 5.5rem; }
.journey-profile-role { margin: .5rem 0 0; color: var(--journey-blue); font-size: .9rem; font-weight: 900; letter-spacing: .04em; }
.journey-profile-stat { margin: .35rem 0 0; font-size: .95rem; font-weight: 700; }
.journey-profile-stat strong { font-size: 1.15em; font-weight: 900; background: linear-gradient(transparent 62%, rgba(244, 196, 48, .7) 62%); }
.journey-page-date { margin-top: 3em; color: #5c584f; font-size: .85rem; }

/* 記事ページの背景はスマホ（style.css で白）に合わせて PC も白にする */
html:has(body.single-post), body.single-post { background-color: #fcfcfc; }
/* 背景は白でも、上のヘッダーはほかのページと同じベージュのままにする */
body.single-post .journey-header { background-color: var(--journey-cream); }
body.single-post .journey-header.is-scrolled { background-color: rgba(242, 237, 223, .92); }
