/*
 * CTJPN Premium Editorial — Unified Design System
 * Standalone theme stylesheet.
 * No parent theme. No dark-mode class dependency.
 *
 * Design tokens
 * ─────────────────────────────────────────────────────
 *   Background  #F8F4EC  (ivory)
 *   Alternate   #E9DDC8  (warm tan)
 *   Text        #1F1A17  (near-black)
 *   Forest      #24433A  (dark green — hero / dark sections)
 *   Copper      #B46A3C  (warm copper — accent, CTAs)
 *   Stone       #6F6A61  (mid-tone — secondary text, captions)
 *   Border      #D8CBB8  (light tan — borders, dividers)
 *   White       #FFFFFF
 */

/* ── Reset / base ─────────────────────────────────────────────────────────── */
*,
*::before,
*::after { box-sizing: border-box; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background-color: #F8F4EC;
    color: #1F1A17;
    font-family: 'Helvetica Neue', Arial, 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: #24433A;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: color 0.15s ease;
}
a:hover { color: #B46A3C; }
a:focus-visible {
    outline: 2px solid #B46A3C;
    outline-offset: 2px;
}

/* ── Typography ──────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    color: #1F1A17;
    font-weight: 700;
    line-height: 1.3;
    margin-top: 0;
    margin-bottom: 0.6em;
}
/* Global heading scale — overridden per context below */
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.4rem,  3vw, 1.9rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.35rem); }
h4 { font-size: 1.1rem; }
h5, h6 { font-size: 1rem; }

p { margin: 0 0 1.2em; }

ul, ol {
    margin: 0 0 1.2em;
    padding-left: 1.6em;
}
li { margin-bottom: 0.3em; }

blockquote {
    margin: 1.5em 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid #B46A3C;
    background-color: #E9DDC8;
    color: #1F1A17;
    font-style: italic;
}
blockquote cite {
    display: block;
    margin-top: 0.5em;
    font-size: 0.875rem;
    font-style: normal;
    color: #6F6A61;
}

code, kbd, pre, samp {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Courier New', monospace;
    font-size: 0.875em;
}
pre {
    background: #E9DDC8;
    border: 1px solid #D8CBB8;
    border-radius: 4px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1.5em 0;
}
code {
    background: #E9DDC8;
    padding: 0.15em 0.4em;
    border-radius: 3px;
}
pre code {
    background: none;
    padding: 0;
}

hr {
    border: none;
    border-top: 1px solid #D8CBB8;
    margin: 2em 0;
}

/* ── Layout shell ─────────────────────────────────────────────────────────── */
.ctjpn-site-wrap {
    min-height: 70vh;
}

.ctjpn-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

.ctjpn-section-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── Homepage centered container ─────────────────────────────────────────────*/
.ctjpn-container {
    max-width: 1160px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 32px;
    padding-right: 32px;
}

/* ── Homepage section wrappers ───────────────────────────────────────────────*/
.ctjpn-section {
    padding: 4rem 0;
    background-color: #F8F4EC;
}
.ctjpn-section-alt {
    padding: 4rem 0;
    background-color: #E9DDC8;
}
.ctjpn-section-cta {
    text-align: center;
    margin-top: 2.5rem;
    margin-bottom: 0;
}

/* ── Skip link ────────────────────────────────────────────────────────────── */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    background: #24433A;
    color: #F8F4EC;
    padding: 0.5rem 1rem;
    border-radius: 0 0 4px 4px;
    z-index: 9999;
}
.skip-link:focus { top: 0; }

/* ── Header ──────────────────────────────────────────────────────────────── */
.ctjpn-site-header {
    background-color: #FFFFFF;
    border-bottom: 2px solid #24433A;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.ctjpn-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.ctjpn-site-title-link {
    text-decoration: none;
}
.ctjpn-site-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #24433A;
    letter-spacing: -0.01em;
}
.ctjpn-site-tagline {
    margin: 0;
    font-size: 0.75rem;
    color: #6F6A61;
}

/* ── Primary navigation ───────────────────────────────────────────────────── */
.ctjpn-primary-nav {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.ctjpn-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.ctjpn-nav-list li { position: relative; }

.ctjpn-nav-list a {
    display: block;
    padding: 0.5rem 0.9rem;
    color: #1F1A17;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    border-radius: 3px;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.ctjpn-nav-list a:hover,
.ctjpn-nav-list .current-menu-item > a {
    background-color: #24433A;
    color: #F8F4EC;
}

/* Dropdown menus */
.ctjpn-nav-list ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #FFFFFF;
    border: 1px solid #D8CBB8;
    border-top: 2px solid #24433A;
    min-width: 200px;
    list-style: none;
    margin: 0;
    padding: 0.4rem 0;
    z-index: 200;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.ctjpn-nav-list li:hover > ul,
.ctjpn-nav-list li:focus-within > ul { display: block; }
.ctjpn-nav-list ul a {
    padding: 0.5rem 1rem;
    border-radius: 0;
    font-weight: 500;
}

/* Mobile nav toggle */
.ctjpn-nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    color: #1F1A17;
    font-size: 1.4rem;
}

/* ── Hero / dark sections ─────────────────────────────────────────────────── */
.ctjpn-hero,
.ctjpn-hub-hero,
.ctjpn-final-cta,
.ctjpn-dark {
    background-color: #24433A;
    color: #F8F4EC;
}
/* Homepage hero uses .ctjpn-container for horizontal padding */
.ctjpn-hero { padding: 4.5rem 0; }
/* Hub/page heroes and dark sections have their own horizontal padding */
.ctjpn-hub-hero,
.ctjpn-final-cta,
.ctjpn-dark { padding: 4rem 1.5rem; }

/* Hero eyebrow, description, actions */
.ctjpn-hero-eyebrow {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #B8C8B4;
    margin: 0 0 0.75rem;
}
.ctjpn-hero-desc {
    font-size: 1rem;
    color: #C8D8C4;
    max-width: 560px;
    line-height: 1.75;
    margin: 0.75rem 0 2rem;
}
.ctjpn-hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}
.ctjpn-button-ghost {
    display: inline-block;
    padding: 0.7rem 1.6rem;
    color: #F8F4EC;
    border: 2px solid rgba(248,244,236,0.45);
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}
.ctjpn-button-ghost:hover {
    border-color: #F8F4EC;
    background-color: rgba(248,244,236,0.12);
    color: #FFFFFF;
}

.ctjpn-hero h1,
.ctjpn-hero h2,
.ctjpn-hero h3,
.ctjpn-hero p,
.ctjpn-hub-hero h1,
.ctjpn-hub-hero h2,
.ctjpn-hub-hero h3,
.ctjpn-hub-hero p,
.ctjpn-hub-hero .ctjpn-hero-headline,
.ctjpn-final-cta h1,
.ctjpn-final-cta h2,
.ctjpn-final-cta p,
.ctjpn-dark h1,
.ctjpn-dark h2,
.ctjpn-dark h3,
.ctjpn-dark p {
    color: #F8F4EC;
}
.ctjpn-hero a,
.ctjpn-hub-hero a,
.ctjpn-final-cta a,
.ctjpn-dark a {
    color: #E9DDC8;
}
.ctjpn-hero a:hover,
.ctjpn-hub-hero a:hover,
.ctjpn-final-cta a:hover,
.ctjpn-dark a:hover {
    color: #FFFFFF;
}

/* Homepage hero — largest headline on the site */
.ctjpn-hero-headline {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 0.75rem;
}
/* Hub / page hero — slightly restrained */
.ctjpn-hub-hero h1 {
    font-size: clamp(1.9rem, 4vw, 3.0rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
}

/* ── Light content sections ───────────────────────────────────────────────── */
.ctjpn-content-section,
.ctjpn-topic-section {
    background-color: #F8F4EC;
    padding: 3.5rem 1.5rem;
    color: #1F1A17;
}

.ctjpn-content-section h2,
.ctjpn-content-section h3,
.ctjpn-topic-section h2,
.ctjpn-topic-section h3 {
    color: #1F1A17;
}

/* Alternate band */
.ctjpn-content-section:nth-child(even),
.ctjpn-alternate {
    background-color: #E9DDC8;
}

/* ── Section titles ───────────────────────────────────────────────────────── */
.ctjpn-section-title {
    color: #1F1A17;
    font-size: clamp(1.45rem, 2.5vw, 2rem);
    font-weight: 700;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #B46A3C;
    display: inline-block;
}

/* ── Statement sections ───────────────────────────────────────────────────── */
.ctjpn-statement {
    background-color: #F8F4EC;
    color: #1F1A17;
    padding: 3rem 1.5rem;
    border-left: 5px solid #B46A3C;
}

.ctjpn-statement-title,
.ctjpn-statement-title h2,
.ctjpn-statement-title h3 {
    color: #1F1A17;
}

.ctjpn-statement p,
.ctjpn-statement li {
    color: #1F1A17;
}

/* ── Homepage front-page sections ────────────────────────────────────────── */
.ctjpn-front-page section {
    position: relative;
}

.ctjpn-latest-posts {
    background-color: #F8F4EC;
    padding: 4rem 0;
}

/* ── Post grid (cards) ────────────────────────────────────────────────────── */
.ctjpn-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.ctjpn-post-card,
.ctjpn-archive-card {
    background-color: #FFFFFF;
    border: 1px solid #D8CBB8;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}
.ctjpn-post-card:hover,
.ctjpn-archive-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.ctjpn-card-thumb {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #E9DDC8;
    border-bottom: 1px solid #D8CBB8;
    line-height: 0;
}
.ctjpn-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.ctjpn-post-card:hover .ctjpn-card-thumb img,
.ctjpn-archive-card:hover .ctjpn-card-thumb img { transform: scale(1.02); }

/* No-image placeholder — subtle, text-only cards remain balanced */
.ctjpn-card-thumb-placeholder {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #EDE6D6 0%, #D8CBB8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #D8CBB8;
}
.ctjpn-card-thumb-placeholder span {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #6F6A61;
}

/* State helpers — applied to the card element */
.ctjpn-no-thumb .ctjpn-card-body { padding-top: 1.3rem; }

.ctjpn-card-body {
    padding: 1rem 1.2rem 1.4rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ctjpn-card-meta {
    font-size: 0.78rem;
    color: #6F6A61;
    margin-bottom: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}
.ctjpn-card-meta a {
    color: #6F6A61;
    text-decoration: none;
}
.ctjpn-card-meta a:hover { color: #24433A; }

.ctjpn-card-title {
    font-size: clamp(1rem, 1.4vw, 1.1rem);
    font-weight: 700;
    margin: 0 0 0.6em;
    color: #1F1A17;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ctjpn-card-title a {
    color: #1F1A17;
    text-decoration: none;
}
.ctjpn-card-title a:hover { color: #24433A; }

.ctjpn-card-excerpt {
    font-size: 0.875rem;
    color: #6F6A61;
    flex: 1;
    margin-bottom: 0.75rem;
    /* Clamp excerpt height — applies to block-level excerpts */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ctjpn-card-excerpt p { margin-bottom: 0; }

.ctjpn-read-more {
    font-size: 0.85rem;
    font-weight: 600;
    color: #24433A;
    text-decoration: none;
    margin-top: auto;
}
.ctjpn-read-more:hover { color: #B46A3C; }

/* ── Content type label ───────────────────────────────────────────────────────*/
.ctjpn-type-label {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #B46A3C;
    margin-bottom: 0.3em;
}

/* ── Reading time ─────────────────────────────────────────────────────────────*/
.ctjpn-reading-time {
    font-size: 0.78rem;
    color: #6F6A61;
}

/* ── Article header labels (type · category above H1) ────────────────────────*/
.ctjpn-article-header-labels {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}
.ctjpn-article-header-labels .ctjpn-type-label {
    margin-bottom: 0;
}
.ctjpn-article-cats {
    font-size: 0.78rem;
    color: #6F6A61;
}
.ctjpn-article-cats a {
    color: #6F6A61;
    text-decoration: none;
}
.ctjpn-article-cats a:hover { color: #24433A; }

/* ── Article author ───────────────────────────────────────────────────────────*/
.ctjpn-article-author {
    font-size: 0.85rem;
    color: #6F6A61;
}

/* ── Compact article rows (Type 2 — related articles) ────────────────────────*/
.ctjpn-article-rows {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 1.5rem;
}
.ctjpn-article-row {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid #D8CBB8;
    text-decoration: none;
    color: inherit;
    transition: padding-left 0.15s ease;
}
.ctjpn-article-row:last-child { border-bottom: none; }
.ctjpn-article-row:hover { padding-left: 4px; border-left: 3px solid #B46A3C; }
.ctjpn-article-row-thumb {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    overflow: hidden;
    background: #E9DDC8;
    border-radius: 4px;
}
.ctjpn-article-row-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ctjpn-article-row-body {
    flex: 1;
    min-width: 0;
}
.ctjpn-article-row-type {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #B46A3C;
    margin-bottom: 0.25em;
}
.ctjpn-article-row-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1F1A17;
    line-height: 1.4;
    margin: 0 0 0.3em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ctjpn-article-row:hover .ctjpn-article-row-title { color: #24433A; }
.ctjpn-article-row-meta {
    font-size: 0.78rem;
    color: #6F6A61;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.ctjpn-button,
.ctjpn-cta-button,
.wp-block-button__link {
    display: inline-block;
    padding: 0.7rem 1.6rem;
    background-color: #B46A3C;
    color: #FFFFFF;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}
.ctjpn-button:hover,
.ctjpn-cta-button:hover,
.wp-block-button__link:hover {
    background-color: #955836;
    color: #FFFFFF;
    transform: translateY(-1px);
}

.ctjpn-button-outline {
    background-color: transparent;
    color: #24433A;
    border: 2px solid #24433A;
}
.ctjpn-button-outline:hover {
    background-color: #24433A;
    color: #F8F4EC;
}

.ctjpn-all-posts-link {
    text-align: center;
    margin-top: 2rem;
}

/* ── Entry header (page.php — shown for non-hub pages) ───────────────────── */
.ctjpn-entry-header {
    padding: 2rem 0 1rem;
    border-bottom: 1px solid #D8CBB8;
    margin-bottom: 2rem;
}
.ctjpn-entry-header .entry-title {
    color: #1F1A17;
    margin-bottom: 0;
}

/* ── Page content ─────────────────────────────────────────────────────────── */
.ctjpn-page-content {
    color: #1F1A17;
}
.ctjpn-page-content h2,
.ctjpn-page-content h3,
.ctjpn-page-content h4 {
    color: #1F1A17;
}

/* ── Single article ───────────────────────────────────────────────────────── */
.ctjpn-article {
    max-width: 780px;
    margin: 0 auto;
}

.ctjpn-article-header {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #D8CBB8;
    margin-bottom: 1.5rem;
}
.ctjpn-article-header .entry-title {
    font-size: clamp(1.8rem, 4vw, 3.0rem);
    font-weight: 800;
    line-height: 1.25;
    color: #1F1A17;
    margin-bottom: 0.5rem;
}

.ctjpn-article-meta {
    font-size: 0.85rem;
    color: #6F6A61;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}
.ctjpn-article-meta a { color: #6F6A61; }
.ctjpn-article-meta a:hover { color: #24433A; }

.ctjpn-article-thumbnail {
    margin-bottom: 1.5rem;
    border-radius: 6px;
    overflow: hidden;
}
.ctjpn-featured-image { width: 100%; }

/* Single article featured image (figure element with optional caption) */
.ctjpn-single-featured-image {
    margin: 0 0 2rem;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #D8CBB8;
    line-height: 0;
}
.ctjpn-single-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}
.ctjpn-single-featured-image figcaption {
    font-size: 0.8rem;
    color: #6F6A61;
    padding: 0.5rem 0.85rem;
    background: #F0EBE1;
    line-height: 1.5;
    border-top: 1px solid #D8CBB8;
}

.ctjpn-article-body {
    color: #1F1A17;
    font-size: 1.05rem;
    line-height: 1.85;
}
.ctjpn-article-body p { margin-bottom: 1.4em; }
.ctjpn-article-body h2 {
    font-size: clamp(1.45rem, 2vw, 1.7rem);
    color: #1F1A17;
    border-bottom: 3px solid #B46A3C;
    padding-bottom: 0.3em;
    margin-top: 2em;
    margin-bottom: 0.8em;
}
.ctjpn-article-body h3 {
    font-size: clamp(1.15rem, 1.8vw, 1.3rem);
    color: #1F1A17;
}
.ctjpn-article-body h4 {
    font-size: 1.05rem;
    color: #1F1A17;
}
.ctjpn-article-body a {
    color: #24433A;
    text-decoration-thickness: 1px;
}
.ctjpn-article-body a:hover { color: #B46A3C; }

.ctjpn-article-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #D8CBB8;
    font-size: 0.875rem;
    color: #6F6A61;
}

/* ── Post navigation (prev/next) ─────────────────────────────────────────── */
.ctjpn-post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #D8CBB8;
    font-size: 0.9rem;
}
.ctjpn-post-navigation a {
    color: #24433A;
    font-weight: 600;
    text-decoration: none;
    max-width: 45%;
}
.ctjpn-post-navigation a:hover { color: #B46A3C; }
.ctjpn-nav-prev { text-align: left; }
.ctjpn-nav-next { text-align: right; }

/* ── Related articles ─────────────────────────────────────────────────────── */
.ctjpn-related-articles {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #D8CBB8;
}

/* ── Archive / search hero (full-bleed dark header) ──────────────────────── */
.ctjpn-archive-hero {
    background-color: #24433A;
    color: #F8F4EC;
    padding: 3rem 0 2.5rem;
}
.ctjpn-archive-hero .ctjpn-archive-title,
.ctjpn-archive-hero .ctjpn-search-title {
    color: #F8F4EC;
    margin-bottom: 0.5rem;
}
.ctjpn-archive-description {
    color: #E9DDC8;
    font-size: 1rem;
    max-width: 600px;
}
.ctjpn-archive-description p { margin-bottom: 0; }
.ctjpn-archive-hero .search-form { margin-top: 1rem; }
.ctjpn-archive-hero .search-field {
    background: rgba(255,255,255,0.12);
    color: #F8F4EC;
    border-color: rgba(255,255,255,0.3);
}
.ctjpn-archive-hero .search-field::placeholder { color: rgba(248,244,236,0.6); }
.ctjpn-archive-hero .search-submit { background: #B46A3C; }
.ctjpn-archive-hero .ctjpn-search-term { color: #E9DDC8; }

/* Archive / search body (content below hero) */
.ctjpn-archive-body {
    padding-top: 2.5rem;
    padding-bottom: 3rem;
}

/* ── Pagination ──────────────────────────────────────────────────────────── */
.ctjpn-pagination {
    margin-top: 3rem;
    text-align: center;
}
.ctjpn-pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
}
.ctjpn-pagination .page-numbers {
    display: inline-block;
    padding: 0.45rem 0.85rem;
    border: 1px solid #D8CBB8;
    border-radius: 4px;
    color: #24433A;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.15s ease;
}
.ctjpn-pagination .page-numbers:hover,
.ctjpn-pagination .page-numbers.current {
    background-color: #24433A;
    border-color: #24433A;
    color: #F8F4EC;
}
.ctjpn-pagination .page-numbers.dots {
    border-color: transparent;
    background: none;
    color: #6F6A61;
}

/* ── No results ───────────────────────────────────────────────────────────── */
.ctjpn-no-results {
    padding: 3rem 0;
    color: #1F1A17;
}
.ctjpn-no-results-links ul {
    columns: 2;
    column-gap: 2rem;
}

/* ── Search ───────────────────────────────────────────────────────────────── */
.ctjpn-search-title {
    color: #1F1A17;
    margin-bottom: 0.5rem;
}
.ctjpn-search-term { color: #B46A3C; }

.search-form {
    display: flex;
    gap: 0.5rem;
    max-width: 520px;
}
.search-field {
    flex: 1;
    padding: 0.6rem 0.9rem;
    border: 1px solid #D8CBB8;
    border-radius: 4px;
    background: #FFFFFF;
    color: #1F1A17;
    font-size: 1rem;
}
.search-field:focus {
    outline: 2px solid #24433A;
    outline-offset: 1px;
    border-color: #24433A;
}
.search-submit {
    padding: 0.6rem 1.2rem;
    background: #24433A;
    color: #F8F4EC;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
}
.search-submit:hover { background: #1a302a; }

/* ── 404 ──────────────────────────────────────────────────────────────────── */
.ctjpn-404-inner {
    max-width: 640px;
    margin: 0 auto;
    padding: 4rem 0;
}
.ctjpn-404-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #D8CBB8;
}
.ctjpn-404-title {
    font-size: clamp(2rem, 5vw, 3rem);
    color: #1F1A17;
}
.ctjpn-404-subtitle { color: #6F6A61; }
.ctjpn-404-search { margin-bottom: 2.5rem; }
.ctjpn-404-links h2 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #1F1A17;
}
.ctjpn-404-links ul { list-style: none; padding: 0; }
.ctjpn-404-links li { margin-bottom: 0.4rem; }

/* ── Tables ───────────────────────────────────────────────────────────────── */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 0.95rem;
    color: #1F1A17;
    background: #FFFFFF;
}
thead th {
    background-color: #24433A;
    color: #F8F4EC;
    font-weight: 600;
    padding: 0.7rem 1rem;
    text-align: left;
    border: 1px solid rgba(255,255,255,0.1);
}
tbody td {
    padding: 0.6rem 1rem;
    border: 1px solid #D8CBB8;
    color: #1F1A17;
    background-color: #FFFFFF;
    vertical-align: top;
}
tbody tr:nth-child(even) td { background-color: #F0EBE1; }
tfoot td {
    padding: 0.6rem 1rem;
    border: 1px solid #D8CBB8;
    font-weight: 600;
    background: #E9DDC8;
    color: #1F1A17;
}

/* ── Sidebar / widgets ────────────────────────────────────────────────────── */
.widget {
    margin-bottom: 2rem;
}
.widget-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1F1A17;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid #B46A3C;
    margin-bottom: 0.8rem;
}
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget ul li { padding: 0.3rem 0; border-bottom: 1px solid #D8CBB8; }
.widget ul li:last-child { border-bottom: none; }
.widget ul a { color: #1F1A17; text-decoration: none; }
.widget ul a:hover { color: #24433A; }

/* ── Comments ─────────────────────────────────────────────────────────────── */
.comments-area {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #D8CBB8;
    color: #1F1A17;
}
.comments-title { color: #1F1A17; }
.comment-list { list-style: none; padding: 0; }
.comment-body {
    padding: 1rem 0;
    border-bottom: 1px solid #D8CBB8;
    color: #1F1A17;
}

/* ── WP Alignments ────────────────────────────────────────────────────────── */
.alignleft  { float: left;  margin-right: 1.5rem; margin-bottom: 1rem; }
.alignright { float: right; margin-left: 1.5rem;  margin-bottom: 1rem; }
.aligncenter { display: block; margin: 0 auto 1rem; text-align: center; }
.alignwide  { margin-left: -2rem; margin-right: -2rem; }
.alignfull  { margin-left: calc(-50vw + 50%); margin-right: calc(-50vw + 50%); }

/* ── WP Blocks ────────────────────────────────────────────────────────────── */
.wp-block-image { margin: 1.5em 0; }
.wp-block-quote {
    border-left: 4px solid #B46A3C;
    background: #E9DDC8;
    padding: 1rem 1.5rem;
    margin: 1.5em 0;
    font-style: italic;
    color: #1F1A17;
}
.wp-block-pullquote {
    border-top: 4px solid #B46A3C;
    border-bottom: 4px solid #B46A3C;
    padding: 1.5rem 2rem;
    text-align: center;
    color: #1F1A17;
}
.wp-block-pullquote blockquote { border: none; background: none; }
.wp-block-separator { border-color: #D8CBB8; }
.wp-block-cover { background-color: #24433A; }
.has-background.has-white-background-color { background-color: #FFFFFF !important; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.ctjpn-site-footer {
    background-color: #24433A;
    color: #F8F4EC;
    padding: 3rem 1.5rem 2rem;
    margin-top: 4rem;
}

.ctjpn-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 2rem;
    align-items: start;
}

.ctjpn-footer-logo {
    font-size: 1.3rem;
    font-weight: 800;
    color: #F8F4EC;
    text-decoration: none;
}
.ctjpn-footer-tagline {
    font-size: 0.8rem;
    color: #B8C8B4;
    margin-top: 0.3rem;
}

.ctjpn-footer-nav-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #B8C8B4;
    margin-bottom: 0.8rem;
}

.ctjpn-footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.ctjpn-footer-links a {
    color: #E9DDC8;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.15s ease;
}
.ctjpn-footer-links a:hover { color: #FFFFFF; }

.ctjpn-copyright {
    font-size: 0.8rem;
    color: #B8C8B4;
    margin-bottom: 0;
}
.ctjpn-copyright a { color: #E9DDC8; text-decoration: none; }
.ctjpn-copyright a:hover { color: #FFFFFF; }

/* ── Accessibility ────────────────────────────────────────────────────────── */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ── Mobile ───────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .ctjpn-header-inner {
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
    }

    .ctjpn-nav-toggle {
        display: block;
        order: 3;
    }

    .ctjpn-primary-nav {
        order: 4;
        width: 100%;
        display: none;
        justify-content: flex-start;
    }
    .ctjpn-primary-nav.is-open { display: flex; }

    .ctjpn-nav-list {
        flex-direction: column;
        width: 100%;
        gap: 0;
        border-top: 1px solid #D8CBB8;
        padding-top: 0.5rem;
    }
    .ctjpn-nav-list a {
        padding: 0.65rem 0.5rem;
        border-radius: 0;
    }
    .ctjpn-nav-list ul {
        position: static;
        border: none;
        box-shadow: none;
        padding-left: 1rem;
        display: block;
    }

    .ctjpn-main { padding: 1.5rem 1rem 2.5rem; }

    .ctjpn-container {
        padding-left: 20px;
        padding-right: 20px;
    }

    .ctjpn-section,
    .ctjpn-section-alt { padding: 2.5rem 0; }

    .ctjpn-posts-grid {
        grid-template-columns: 1fr;
    }

    .ctjpn-start-grid,
    .ctjpn-hub-grid,
    .ctjpn-steps-grid,
    .ctjpn-series-grid { grid-template-columns: 1fr; gap: 1rem; }

    .ctjpn-hero-actions { flex-direction: column; align-items: flex-start; }
    .ctjpn-button-ghost { text-align: center; }

    .ctjpn-footer-inner {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .ctjpn-hero,
    .ctjpn-hub-hero,
    .ctjpn-final-cta,
    .ctjpn-dark,
    .ctjpn-content-section,
    .ctjpn-topic-section,
    .ctjpn-latest-posts {
        padding: 2.5rem 1rem;
    }

    .ctjpn-archive-hero { padding: 2rem 0 1.75rem; }
    .ctjpn-archive-body { padding-top: 1.5rem; padding-bottom: 2rem; }

    .ctjpn-article { max-width: 100%; }

    .ctjpn-post-navigation {
        flex-direction: column;
        gap: 0.75rem;
    }
    .ctjpn-nav-prev, .ctjpn-nav-next { max-width: 100%; }

    .alignwide, .alignfull {
        margin-left: -1rem;
        margin-right: -1rem;
    }

    .search-form { flex-direction: column; }
    .search-submit { width: 100%; }
}

@media (max-width: 480px) {
    .ctjpn-footer-links {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    /* Hide compact row thumbnails on very small screens to preserve text space */
    .ctjpn-article-row-thumb { display: none; }

    .ctjpn-site-title { font-size: 1.2rem; }
}

/* ── Start Here grid ─────────────────────────────────────────────────────────*/
.ctjpn-start-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}
.ctjpn-start-card {
    background-color: #FFFFFF;
    border: 1px solid #D8CBB8;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}
.ctjpn-start-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.ctjpn-start-card .ctjpn-card-body { flex: 1; display: flex; flex-direction: column; }

/* ── Topic Hubs grid ─────────────────────────────────────────────────────────*/
.ctjpn-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}
.ctjpn-hub-card {
    background: #FFFFFF;
    border: 1px solid #D8CBB8;
    border-left: 4px solid #24433A;
    border-radius: 6px;
    padding: 1.25rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    text-decoration: none;
    transition: background-color 0.2s ease, border-left-color 0.2s ease, box-shadow 0.2s ease;
}
.ctjpn-hub-card:hover {
    background: #F0EBE1;
    border-left-color: #B46A3C;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}
.ctjpn-hub-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1F1A17;
    line-height: 1.3;
}
.ctjpn-hub-card:hover .ctjpn-hub-card-title { color: #24433A; }
.ctjpn-hub-card-desc {
    font-size: 0.85rem;
    color: #6F6A61;
    line-height: 1.55;
    flex: 1;
}
.ctjpn-hub-card-cta {
    font-size: 0.82rem;
    font-weight: 600;
    color: #B46A3C;
    margin-top: 0.2rem;
}

/* ── Core Framework steps grid ───────────────────────────────────────────────*/
.ctjpn-steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.ctjpn-step-card {
    background: #FFFFFF;
    border: 1px solid #D8CBB8;
    border-top: 3px solid #24433A;
    border-radius: 6px;
    padding: 1.1rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.ctjpn-step-num {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #B46A3C;
}
.ctjpn-step-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1F1A17;
    line-height: 1.35;
}
.ctjpn-step-desc {
    font-size: 0.82rem;
    color: #6F6A61;
    line-height: 1.55;
    margin-top: 0.15rem;
}

/* ── Series grid ─────────────────────────────────────────────────────────────*/
.ctjpn-series-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}
.ctjpn-series-card {
    background: #FFFFFF;
    border: 1px solid #D8CBB8;
    border-top: 4px solid #24433A;
    border-radius: 6px;
    padding: 1.2rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    transition: box-shadow 0.2s ease, border-top-color 0.2s ease;
}
.ctjpn-series-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    border-top-color: #B46A3C;
}
.ctjpn-series-count {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6F6A61;
}
.ctjpn-series-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1F1A17;
    line-height: 1.35;
    margin: 0;
}
.ctjpn-series-desc {
    font-size: 0.875rem;
    color: #6F6A61;
    line-height: 1.6;
    flex: 1;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Nav toggle (handled via wp_footer inline script in footer.php) ──────── */
