/* =========================================================
   KOKO.BLOG — Main Stylesheet
   ソース: preview.html（定義版）+ index.html（一覧固有）
   ========================================================= */

/* =========================================================
   1. Design System Variables
   ========================================================= */
:root {
    --bg-base:          #FDFCFA;
    --text-main:        #434343;
    --text-bold:        #1C1C1C;
    --accent-primary:   #E9546B;
    --accent-secondary: #E6B422;
    --border-subtle:    #D3D3D3;

    --cat-color-default:    var(--accent-primary);
    --cat-color-psychology: #5D9450;
    --cat-color-web:        #4A67AD;
    --cat-color-fortune:    var(--accent-secondary);

    --font-base:         'Noto Sans JP', sans-serif;
    --max-width:         1100px;
    --spacing:           1.5rem;

    --transition-base:     0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-interact: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-base:       #434343;
        --text-main:     #FDFCFA;
        --text-bold:     #FFFFFF;
        --border-subtle: #666666;
    }
}

/* =========================================================
   2. Base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-base);
    font-size: 16px;
    line-height: 1.8;
    letter-spacing: 0.06em;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "palt";
    transition: background-color 0.3s, color 0.3s;
}

@media (min-width: 768px) { body { font-size: 18px; } }

a {
    color: var(--text-main);
    text-decoration: none;
    transition: opacity 0.3s ease;
}
a:hover { opacity: 0.7; }

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

.l-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing);
}

/* =========================================================
   3. Progress Bar
   ========================================================= */
.c-progress-bar {
    position: fixed;
    top: 0; left: 0;
    width: 0%;
    height: 3px;
    background-color: var(--accent-primary);
    z-index: 1000;
    transition: width 0.1s ease-out;
}

/* =========================================================
   4. Global Header
   ========================================================= */
.l-header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 2rem 0;
    z-index: 900;
    transition: var(--transition-base);
}

.l-header.is-scrolled {
    padding: 1rem 0;
    background-color: var(--bg-base);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.l-header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.l-header__logo {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 0.1em;
    color: var(--text-bold);
    text-decoration: none;
}

.l-header__nav-list {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.l-header__nav-link {
    color: var(--text-main);
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    opacity: 0.7;
    transition: 0.3s;
}
.l-header__nav-link:hover { opacity: 1; color: var(--accent-primary); }

/* WP nav_menu が出力する <a> への対応 */
.l-header__nav-list li a {
    color: var(--text-main);
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    opacity: 0.7;
    transition: 0.3s;
}
.l-header__nav-list li a:hover { opacity: 1; color: var(--accent-primary); }

/* ハンバーガーボタン */
.c-nav-toggle {
    display: none;
    position: relative;
    width: 30px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1100;
    padding: 0;
}
.c-nav-toggle span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--text-bold);
    transition: var(--transition-base);
}
.c-nav-toggle span:nth-child(1) { top: 0; }
.c-nav-toggle span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.c-nav-toggle span:nth-child(3) { bottom: 0; }
.c-nav-toggle.is-active span:nth-child(1) { transform: translateY(11px) rotate(45deg); }
.c-nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.c-nav-toggle.is-active span:nth-child(3) { transform: translateY(-11px) rotate(-45deg); }

@media (max-width: 900px) {
    .c-nav-toggle { display: block; }

    .l-header__nav {
        position: fixed;
        top: 0; right: -100%;
        width: 80%;
        height: 100vh;
        background: var(--bg-base);
        padding: 100px 2rem 2rem;
        transition: var(--transition-base);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.05);
        z-index: 1050;
        overflow-y: auto;
    }
    .l-header__nav.is-active { right: 0; }
    .l-header__nav-list { flex-direction: column; gap: 2rem; }
    .l-header__nav-list li a,
    .l-header__nav-link { font-size: 1.2rem; font-weight: 700; opacity: 1; }
}

/* =========================================================
   5. Breadcrumbs（記事詳細ページ）
   ========================================================= */
.c-breadcrumbs {
    padding-top: 130px;
    font-size: 0.75rem;
    opacity: 0.6;
    padding-bottom: 1rem;
}
.c-breadcrumbs__list {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 0.5rem;
    margin: 0;
    flex-wrap: wrap;
}
.c-breadcrumbs__list li:not(:last-child)::after {
    content: "/";
    margin-left: 0.5rem;
}
.c-breadcrumbs__list a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-interact);
}
.c-breadcrumbs__list a:hover { color: var(--accent-primary); }

/* =========================================================
   6. Layout（一覧・詳細 共通グリッド）
   ========================================================= */
.l-main-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 4rem;
    padding-bottom: 60px;
}
@media (max-width: 900px) { .l-main-layout { grid-template-columns: 1fr; } }

/* 記事一覧：ヘッダー分の余白が必要（パンくずなし）*/
.home .l-main-layout,
.blog .l-main-layout,
.archive .l-main-layout,
.search .l-main-layout { padding-top: 150px; }

/* 記事詳細：パンくずが余白を担う */
.single .l-main-layout,
.page .l-main-layout { padding-top: 10px; }

/* =========================================================
   7. Sidebar
   ========================================================= */
.l-sidebar {
    position: sticky;
    top: 120px;
    height: fit-content;
}
@media (max-width: 900px) { .l-sidebar { display: none; } }

.c-sidebar-widget { margin-bottom: 3.5rem; }

.c-sidebar-widget__title {
    font-size: 0.95rem;
    border-bottom: 2px solid var(--accent-secondary);
    padding-bottom: 0.5rem;
    margin: 0 0 1.2rem;
    font-weight: 700;
    color: var(--text-bold);
    letter-spacing: 0.05em;
}

/* TOC（目次）*/
.c-toc-list { list-style: none; padding: 0; margin: 0; }
.c-toc-item { margin-bottom: 0.8rem; line-height: 1.4; }
.c-toc-item a {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    opacity: 0.8;
    transition: var(--transition-interact);
}
.c-toc-item a:hover { opacity: 1; color: var(--accent-primary); transform: translateX(3px); }
.c-toc-item.--h3 { padding-left: 1rem; }
.c-toc-item.--h3 a { font-size: 0.85rem; font-weight: 400; }

/* Widget List */
.c-widget-list { list-style: none; padding: 0; margin: 0; font-size: 0.85rem; }
.c-widget-list li {
    margin-bottom: 0.8rem;
    border-bottom: 1px dotted var(--border-subtle);
    padding-bottom: 0.4rem;
    transition: var(--transition-interact);
}
.c-widget-list a {
    font-weight: 700;
    text-decoration: none;
    opacity: 0.8;
    display: block;
    transition: var(--transition-interact);
}
.c-widget-list a:hover { opacity: 1; color: var(--accent-primary); transform: translateX(3px); }

/* =========================================================
   8. Category Label & Tags
   ========================================================= */
.c-category-label {
    color: var(--cat-color, var(--cat-color-default));
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 0.5rem;
    transition: var(--transition-interact);
}
.c-category-label:hover { opacity: 0.8; }

.c-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0.8rem 0;
}
.c-tag-item a {
    font-size: 0.7rem;
    color: var(--text-main);
    text-decoration: none;
    padding: 2px 10px;
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    background: rgba(211, 211, 211, 0.1);
    transition: 0.3s;
    display: inline-block;
}
.c-tag-item a:hover { border-color: var(--accent-primary); color: var(--accent-primary); opacity: 1; }

/* =========================================================
   9. Post Grid（記事一覧カード）
   ========================================================= */
.c-post-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
}
@media (max-width: 600px) { .c-post-grid { grid-template-columns: 1fr; } }

.c-post-card {
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
    backface-visibility: hidden;
}
.c-post-card > a {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-decoration: none;
    color: inherit;
}
.c-post-card:hover {
    transform: translateY(-8px) scale(1.01);
    border-color: rgba(67, 67, 67, 0.1);
    box-shadow:
        0 20px 40px rgba(67, 67, 67, 0.05),
        0 10px 20px rgba(var(--cat-color-rgb, 233, 84, 107), 0.1);
}

.c-post-card__img-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--border-subtle);
    overflow: hidden;
    position: relative;
}
.c-post-card__img-wrap::after {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(253, 252, 250, 0.1);
}
.c-post-card__img-wrap img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.c-post-card:hover .c-post-card__img-wrap img { transform: scale(1.06); }
.c-post-card__img-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--border-subtle), var(--bg-base));
}

.c-post-card__body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.c-post-card__title {
    font-size: 1.15rem;
    margin: 0.5rem 0;
    line-height: 1.5;
    color: var(--text-bold);
    font-weight: 700;
    transition: var(--transition-interact);
}
.c-post-card:hover .c-post-card__title { color: var(--cat-color, var(--cat-color-default)); }
.c-post-card__excerpt { font-size: 0.85rem; opacity: 0.8; height: 3.2em; overflow: hidden; margin-bottom: 1rem; }

/* =========================================================
   10. Pagination
   ========================================================= */
.c-pagination {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 4rem;
    flex-wrap: wrap;
}
/* WP が出力する .page-numbers に対応 */
.c-pagination .page-numbers,
.c-pagination a,
.c-pagination span {
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem;
    border: 1px solid var(--border-subtle);
    text-decoration: none;
    color: inherit;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: 0.3s;
}
.c-pagination .page-numbers:hover,
.c-pagination a:hover { border-color: var(--accent-primary); color: var(--accent-primary); opacity: 1; }
.c-pagination .current,
.c-pagination .is-current {
    background: var(--accent-secondary);
    color: #fff;
    border-color: var(--accent-secondary);
    pointer-events: none;
}

/* =========================================================
   11. Animation
   ========================================================= */
.js-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s var(--transition-base), transform 0.8s var(--transition-base);
}
.js-reveal.is-active {
    opacity: 1;
    transform: translateY(0);
}
/* JS 無効・prefers-reduced-motion 対応 */
@media (prefers-reduced-motion: reduce) {
    .js-reveal { opacity: 1; transform: none; transition: none; }
}

/* =========================================================
   12. Entry Header（記事詳細）
   ========================================================= */
.c-entry { margin-bottom: 40px; }

.c-entry-header__meta {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.c-entry-header__title {
    font-size: clamp(1.8rem, 5vw, 2.4rem);
    font-weight: 700;
    color: var(--text-bold);
    line-height: 1.4;
    margin-bottom: 2rem;
}

/* =========================================================
   13. TL;DR Box
   ========================================================= */
.c-tldr {
    background-color: rgba(230, 180, 34, 0.03);
    border: 1px solid rgba(230, 180, 34, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 3rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
}
.c-tldr__title {
    color: var(--accent-secondary);
    font-weight: 700;
    margin-top: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.c-tldr__list {
    margin: 0;
    padding-left: 1.2rem;
    font-weight: 700;
    font-size: 0.95rem;
}
.c-tldr__item { margin-bottom: 0.5rem; }

/* =========================================================
   14. Entry Content（本文スタイル）
   ========================================================= */
.c-entry-content h2 {
    font-size: 1.6rem;
    border-left: 3px solid var(--accent-primary);
    padding: 0.2em 0 0.2em 1em;
    margin: 3rem 0 1.5rem;
    background: linear-gradient(to right, rgba(233, 84, 107, 0.03), transparent);
}
.c-entry-content h3 {
    font-size: 1.25rem;
    border-bottom: 1px dotted var(--border-subtle);
    padding-bottom: 0.5rem;
    margin: 2.5rem 0 1rem;
}
.c-entry-content p { margin-bottom: 1.5rem; }
.c-entry-content strong { color: var(--text-bold); }
.c-entry-content a { color: var(--accent-primary); text-decoration: underline; }
.c-entry-content ul,
.c-entry-content ol { padding-left: 1.5rem; margin-bottom: 1.5rem; }
.c-entry-content li { margin-bottom: 0.5rem; }

/* =========================================================
   15. Author Card
   ========================================================= */
.c-author-card {
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 2rem;
    margin: 4rem 0;
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    background-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px);
}
@media (max-width: 600px) {
    .c-author-card { flex-direction: column; gap: 1.5rem; }
}
.c-author-card__avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 2rem;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}
.c-author-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
/* preview.html: c-author-card__content / single.html: c-author-card__info 両対応 */
.c-author-card__content,
.c-author-card__info { flex: 1; min-width: 0; }
.c-author-card__name { margin: 0 0 0.5rem; font-size: 1.2rem; color: var(--text-bold); }
.c-author-card__badge {
    background: rgba(230, 180, 34, 0.08);
    color: var(--accent-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 4px;
    margin-right: 0.5rem;
    display: inline-block;
}
.c-author-card__desc { font-size: 0.9rem; margin: 1rem 0 0; }

/* =========================================================
   16. Share Area
   ========================================================= */
.c-share-area {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 3rem 0;
}
.c-share-button {
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    font-size: 0.8rem;
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
    font-weight: 700;
}
.c-share-button:hover { background: var(--text-main); color: var(--bg-base); opacity: 1; }

/* =========================================================
   16b. Entry Thumbnail（記事詳細アイキャッチ）
   ========================================================= */
.c-entry-header__thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 2.5rem;
}
.c-entry-header__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =========================================================
   17. FAQ Section
   ========================================================= */
.c-faq-section {
    border-top: 1px solid var(--border-subtle);
    padding-top: 3rem;
    margin-top: 3rem;
}
.c-faq-section__title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-bold);
    margin: 0 0 2rem;
}
.c-faq-section__list { margin: 0; }
.c-faq { border-bottom: 1px solid var(--border-subtle); }

.c-faq__summary {
    list-style: none;
    padding: 1.5rem 0;
    cursor: pointer;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.c-faq__summary::-webkit-details-marker { display: none; }

/* preview.html 版（c-faq__q） */
.c-faq__q::before { content: "Q."; color: var(--accent-primary); margin-right: 0.5rem; }

/* single.html 版（c-faq__q-text）との互換性 */
.c-faq__q-text { display: flex; gap: 0.8rem; align-items: flex-start; }
.c-faq__q-text::before {
    content: "Q.";
    color: var(--accent-primary);
    font-size: 1.2rem;
    line-height: 1;
    flex-shrink: 0;
}

/* FAQ アイコン（＋マーク・SVG共通） */
.c-faq__icon {
    color: var(--border-subtle);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}
details[open] .c-faq__icon { transform: rotate(45deg); color: var(--accent-primary); }

.c-faq__answer {
    padding-bottom: 1.5rem;
    font-size: 0.95rem;
    display: flex;
    gap: 0.5rem;
    animation: slideDown 0.4s ease;
}
.c-faq__a-icon { color: var(--accent-secondary); font-weight: 700; flex-shrink: 0; }
.c-faq__answer-text { margin: 0; opacity: 0.9; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   18. Related Posts
   ========================================================= */
.c-related-posts {
    margin-top: 4rem;
    border-top: 1px solid var(--border-subtle);
    padding-top: 4rem;
    padding-bottom: 4rem;
}
.c-related-posts__title {
    font-size: 1.25rem;
    text-align: center;
    margin-bottom: 2.5rem;
    font-weight: 700;
    color: var(--text-bold);
}
.c-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
@media (max-width: 768px) { .c-related-grid { grid-template-columns: 1fr; } }

.c-related-card { text-decoration: none; color: inherit; display: block; }
.c-related-card__img {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--border-subtle);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
    position: relative;
}
.c-related-card__img::after {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(253, 252, 250, 0.1);
}
.c-related-card img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.c-related-card:hover img { transform: scale(1.06); }
.c-related-card__title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.5;
    transition: var(--transition-interact);
    margin: 0;
    color: var(--text-bold);
}
.c-related-card:hover .c-related-card__title { color: var(--accent-primary); }

/* =========================================================
   19. Footer
   ========================================================= */
.l-footer {
    background-color: var(--text-bold);
    color: var(--bg-base);
    padding: 5rem 0 2rem;
    margin-top: 5rem;
}
.l-footer__inner {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
}
@media (max-width: 768px) { .l-footer__inner { grid-template-columns: 1fr; gap: 3rem; } }

.l-footer__logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: 0.1em;
}
.l-footer__logo a { color: inherit; text-decoration: none; }

.l-footer__description {
    font-size: 0.9rem;
    opacity: 0.8;
    line-height: 1.8;
    max-width: 400px;
    margin: 0;
}
.l-footer__nav { display: flex; gap: 3rem; }
@media (max-width: 480px) { .l-footer__nav { flex-direction: column; gap: 2rem; } }

.l-footer__nav-title {
    font-size: 0.85rem;
    color: var(--accent-secondary);
    margin: 0 0 1.5rem;
    letter-spacing: 0.1em;
}
.l-footer__nav-group ul { list-style: none; padding: 0; margin: 0; }
.l-footer__nav-group li { margin-bottom: 0.8rem; }
.l-footer__nav-group a {
    color: inherit;
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.7;
    transition: var(--transition-interact);
}
.l-footer__nav-group a:hover { opacity: 1; color: var(--accent-secondary); }

.c-footer-sns {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}
.c-footer-sns a {
    color: inherit;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    opacity: 0.8;
    transition: var(--transition-interact);
}
.c-footer-sns a:hover { opacity: 1; color: var(--accent-secondary); }

.l-footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
    font-size: 0.75rem;
    opacity: 0.5;
}
.l-footer__bottom p { margin: 0; }
