/* ========================================
   Blog - スタイル (redesign)
   ======================================== */

/* --- Layout --- */
.blog-layout {
    display: flex;
    gap: 36px;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
}

/* --- Sidebar --- */
.blog-sidebar {
    width: 250px;
    flex-shrink: 0;
    background: #fff;
    border-radius: 14px;
    padding: 22px 18px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    position: sticky;
    top: 84px;
}

.blog-sidebar-heading {
    font-size: 0.82rem;
    font-weight: 700;
    color: #6a5d4e;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* --- Search --- */
.blog-search {
    margin-bottom: 18px;
    position: relative;
}
.blog-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f7f3ec;
    border: 1px solid #e8e2d8;
    border-radius: 10px;
    padding: 8px 12px;
    transition: border-color 200ms, box-shadow 200ms;
}
.blog-search-box:focus-within {
    border-color: #d4a73a;
    box-shadow: 0 0 0 3px rgba(212,167,58,0.12);
}
.blog-search-icon { color: #9a8d7e; font-size: 0.8rem; }
.blog-search-box input {
    border: none; background: none; outline: none;
    font-size: 0.84rem; width: 100%; color: #3a332c;
}
.blog-search-box input::placeholder { color: #b0a898; }

.blog-search-results {
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border-radius: 0 0 12px 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    max-height: 320px; overflow-y: auto; z-index: 50;
}
.blog-search-results a {
    display: block; padding: 10px 14px;
    border-bottom: 1px solid #f0ebe4; transition: background-color 150ms;
}
.blog-search-results a:last-child { border-bottom: none; }
.blog-search-results a:hover { background: #faf6ee; }
.blog-search-result-title {
    font-size: 0.85rem; font-weight: 500; color: #3a332c; display: block;
}
.blog-search-result-snippet {
    font-size: 0.75rem; color: #9a8d7e; display: block;
    margin-top: 2px; line-height: 1.4;
}
.blog-search-empty {
    padding: 14px; text-align: center; font-size: 0.8rem; color: #9a8d7e;
}

/* --- Category buttons --- */
.blog-category-list { list-style: none; }
.blog-category { margin-bottom: 4px; }
.blog-category-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    background: none;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.86rem;
    font-weight: 500;
    color: #5a5248;
    transition: all 180ms;
    text-align: left;
}
.blog-category-btn:hover {
    background: rgba(212,167,58,0.08);
    color: #8b6914;
}
.blog-category-btn.is-active {
    background: rgba(212,167,58,0.12);
    border-color: #d4a73a;
    color: #8b6914;
    font-weight: 600;
}
.blog-cat-count {
    margin-left: auto;
    font-size: 0.72rem;
    background: #f0ebe4;
    color: #7a6e5e;
    padding: 1px 7px;
    border-radius: 10px;
    font-weight: 600;
}
.blog-category-btn.is-active .blog-cat-count {
    background: #d4a73a;
    color: #fff;
}
.blog-empty-msg {
    font-size: 0.82rem; color: #9a8d7e; text-align: center; padding: 16px 0;
}

/* --- Main Content --- */
.blog-main { flex: 1; min-width: 0; }

/* --- Breadcrumb --- */
.blog-breadcrumb {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.78rem; color: #9a8d7e; margin-bottom: 16px;
}
.blog-breadcrumb a { color: #7a6e5e; transition: color 150ms; }
.blog-breadcrumb a:hover { color: #b08d3e; }
.blog-breadcrumb i { font-size: 0.55rem; }

/* --- Article card wrapper --- */
.blog-article-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    overflow: hidden;
}

/* --- Article header --- */
.blog-article-header {
    padding: 32px 36px 24px;
    border-bottom: 1px solid #f0ebe4;
}
.blog-article-category {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    color: #8b6914;
    background: rgba(212,167,58,0.14);
    padding: 3px 10px;
    border-radius: 6px;
    margin-bottom: 12px;
}
.blog-article-title {
    font-size: 1.6rem;
    color: #1D1B19;
    margin-bottom: 14px;
    line-height: 1.45;
    font-weight: 700;
}
.blog-article-info {
    display: flex; flex-wrap: wrap; gap: 16px;
}
.blog-info-item {
    font-size: 0.78rem; color: #9a8d7e;
    display: flex; align-items: center; gap: 4px;
}

/* --- TOC --- */
.blog-toc {
    padding: 0 36px;
    border-bottom: 1px solid #f0ebe4;
}
.blog-toc-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.9rem; font-weight: 600; color: #5a5248;
    cursor: pointer; padding: 16px 0; list-style: none;
}
.blog-toc-title::-webkit-details-marker { display: none; }
.blog-toc-title::after {
    content: "\f078"; font-family: "Font Awesome 6 Free";
    font-weight: 900; font-size: 0.6rem; color: #9a8d7e;
    margin-left: auto; transition: transform 200ms;
}
details.blog-toc[open] > .blog-toc-title::after { transform: rotate(180deg); }
.blog-toc-body { padding-bottom: 16px; }
.blog-toc-body ul { list-style: none; padding-left: 0; }
.blog-toc-body ul ul { padding-left: 16px; }
.blog-toc-body li { margin-bottom: 4px; }
.blog-toc-body a {
    font-size: 0.82rem; color: #5a5248;
    display: block; padding: 4px 8px; border-radius: 6px;
    transition: background-color 150ms, color 150ms;
}
.blog-toc-body a:hover { background: rgba(232,201,122,0.12); color: #b08d3e; }

/* --- Article body --- */
.blog-article {
    padding: 28px 36px 40px;
    line-height: 1.9;
    font-size: 0.96rem;
    color: #2c2720;
}
.blog-article h1 {
    font-size: 1.5rem; margin-bottom: 20px; padding-bottom: 12px;
    border-bottom: 2px solid #e8c97a; color: #1D1B19;
}
.blog-article h2 {
    font-size: 1.28rem; margin-top: 36px; margin-bottom: 14px;
    padding-bottom: 8px; border-bottom: 1px solid #e0d8cc; color: #3a332c;
}
.blog-article h3 {
    font-size: 1.1rem; margin-top: 28px; margin-bottom: 10px; color: #4a4238;
}
.blog-article p { margin-bottom: 18px; }
.blog-article ul, .blog-article ol { margin: 12px 0 18px 24px; }
.blog-article li { margin-bottom: 6px; }
.blog-article code {
    background: #f5f0e8; padding: 2px 6px; border-radius: 4px;
    font-size: 0.88em; color: #8b4513;
}
.blog-article pre {
    position: relative; margin: 20px 0; border-radius: 10px; overflow: hidden;
}
.blog-article pre code {
    background: none; padding: 0; color: inherit; font-size: 0.85rem; line-height: 1.5;
}
.blog-article pre code.hljs { padding: 18px 22px; border-radius: 10px; }

/* コピーボタン */
.blog-code-copy {
    position: absolute; top: 8px; right: 8px;
    background: rgba(255,255,255,0.12); color: #ccc;
    border: none; border-radius: 6px; padding: 4px 10px;
    font-size: 0.72rem; cursor: pointer; opacity: 0;
    transition: opacity 150ms, background 150ms;
}
.blog-article pre:hover .blog-code-copy { opacity: 1; }
.blog-code-copy:hover { background: rgba(255,255,255,0.22); color: #fff; }
.blog-code-copy.copied { color: #7ec87e; }

.blog-article blockquote {
    border-left: 4px solid #e8c97a; margin: 18px 0;
    padding: 14px 18px; background: #faf6ee; color: #5a5248;
    border-radius: 0 10px 10px 0;
}
.blog-article table { width: 100%; border-collapse: collapse; margin: 18px 0; }
.blog-article th, .blog-article td {
    border: 1px solid #e0d8cc; padding: 10px 14px;
    text-align: left; font-size: 0.88rem;
}
.blog-article th { background: #f5f0e8; font-weight: 600; }
.blog-article img { max-width: 100%; height: auto; border-radius: 10px; }
.blog-article a { color: #b08d3e; text-decoration: underline; }
.blog-article a:hover { color: #8b6914; }

/* --- SNS share --- */
.blog-share {
    display: flex; align-items: center; gap: 12px;
    margin-top: 20px; padding: 16px 0;
}
.blog-share-label { font-size: 0.82rem; color: #9a8d7e; font-weight: 500; }
.blog-share-btn {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%;
    font-size: 1rem; color: #fff; text-decoration: none;
    transition: transform 150ms, box-shadow 150ms;
}
.blog-share-btn:hover { transform: scale(1.1); box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.blog-share-x { background: #1d1d1d; }
.blog-share-hatena { background: #00A4DE; font-size: 0.85rem; font-weight: 700; }
.blog-share-line { background: #06C755; }

/* --- Prev / Next --- */
.blog-prev-next { display: flex; gap: 16px; margin-top: 16px; }
.blog-pn-link {
    flex: 1; display: flex; flex-direction: column; gap: 4px;
    padding: 18px 22px; background: #fff; border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: background-color 150ms, box-shadow 150ms, transform 150ms;
    text-decoration: none;
}
.blog-pn-link:hover {
    background: #faf6ee; box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}
.blog-pn-label { font-size: 0.72rem; color: #9a8d7e; font-weight: 500; }
.blog-pn-next .blog-pn-label { text-align: right; }
.blog-pn-title { font-size: 0.88rem; color: #3a332c; font-weight: 500; }
.blog-pn-next .blog-pn-title { text-align: right; }

/* ===== Top page ===== */

/* --- Section --- */
.blog-section { margin-bottom: 36px; }
.blog-section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}
.blog-section-title {
    font-size: 1.05rem; font-weight: 700; color: #3a332c;
    display: flex; align-items: center; gap: 8px; margin: 0;
}
.blog-section-title .fa-fire { color: #e87a3e; }
.blog-section-title .fa-newspaper { color: #6a9fd8; }

/* --- Popular cards (top 3 grid) --- */
.blog-popular-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.blog-popular-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    padding: 20px 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-decoration: none;
    transition: transform 180ms, box-shadow 180ms;
    position: relative;
    overflow: hidden;
}
.blog-popular-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #d4a73a, #e8c97a);
}
.blog-popular-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.blog-popular-rank {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 50%;
    font-size: 0.82rem; font-weight: 800; color: #fff;
    background: #d4a73a; margin-bottom: 12px;
}
.blog-popular-card:nth-child(1) .blog-popular-rank { background: #d4a017; }
.blog-popular-card:nth-child(2) .blog-popular-rank { background: #a0a0a0; }
.blog-popular-card:nth-child(3) .blog-popular-rank { background: #cd7f32; }
.blog-popular-body { display: flex; flex-direction: column; gap: 6px; }
.blog-popular-cat {
    font-size: 0.7rem; font-weight: 600; color: #8b6914;
    background: rgba(212,167,58,0.12); padding: 2px 8px;
    border-radius: 5px; align-self: flex-start;
}
.blog-popular-title {
    font-size: 0.92rem; font-weight: 600; color: #2c2720; line-height: 1.45;
}
.blog-popular-meta {
    font-size: 0.72rem; color: #9a8d7e;
    display: flex; align-items: center; gap: 6px; margin-top: 4px;
}

/* --- Article card list --- */
.blog-card-list { display: flex; flex-direction: column; gap: 10px; }
.blog-card {
    display: flex;
    background: #fff;
    border-radius: 14px;
    padding: 20px 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: transform 180ms, box-shadow 180ms;
    text-decoration: none;
    border-left: 4px solid transparent;
}
.blog-card:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    border-left-color: #d4a73a;
}
.blog-card-body { display: flex; flex-direction: column; gap: 6px; }
.blog-card-category {
    font-size: 0.7rem; font-weight: 600; color: #8b6914;
    background: rgba(212,167,58,0.12);
    padding: 2px 8px; border-radius: 5px; align-self: flex-start;
}
.blog-card-title {
    font-size: 1rem; font-weight: 600; color: #2c2720; margin: 0; line-height: 1.4;
}
.blog-card-desc {
    font-size: 0.82rem; color: #7a6e5e; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; margin: 0;
}
.blog-card-date { font-size: 0.72rem; color: #b0a898; margin-top: 2px; }

/* --- Pagination --- */
.blog-pagination {
    display: flex; align-items: center; justify-content: center;
    gap: 16px; margin-top: 24px; padding: 8px 0;
}
.blog-page-btn {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%;
    background: #fff; border: 2px solid #e0d8cc;
    color: #5a5248; cursor: pointer; font-size: 0.85rem;
    transition: all 180ms;
}
.blog-page-btn:hover:not(:disabled) {
    border-color: #d4a73a; color: #8b6914;
    background: rgba(212,167,58,0.06);
}
.blog-page-btn:disabled {
    opacity: 0.35; cursor: not-allowed;
}
.blog-page-info {
    font-size: 0.88rem; font-weight: 600; color: #5a5248;
    min-width: 60px; text-align: center;
}

/* --- Mobile sidebar FAB --- */
.blog-sidebar-fab {
    display: none;
    position: fixed; bottom: 24px; right: 24px;
    width: 54px; height: 54px; border-radius: 50%;
    background: #1a1612; color: #e8c97a; border: none;
    cursor: pointer; font-size: 1.2rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3); z-index: 120;
    transition: background-color 150ms, transform 150ms;
}
.blog-sidebar-fab:hover { background: #2a2420; transform: scale(1.05); }

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 900px) {
    .blog-popular-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .blog-layout { flex-direction: column; }
    .blog-sidebar {
        position: fixed; top: 64px; left: 0;
        width: 280px; height: calc(100vh - 64px);
        border-radius: 0; z-index: 130;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
    }
    .blog-sidebar.is-open { transform: translateX(0); }
    .blog-sidebar-fab {
        display: flex; align-items: center; justify-content: center;
    }
    .blog-article-header { padding: 24px 20px 18px; }
    .blog-article-title { font-size: 1.25rem; }
    .blog-toc { padding: 0 20px; }
    .blog-article { padding: 22px 20px 32px; }
    .blog-prev-next { flex-direction: column; }
    .blog-pn-next .blog-pn-label,
    .blog-pn-next .blog-pn-title { text-align: left; }
    .blog-share { flex-wrap: wrap; }
    .blog-card { padding: 16px 18px; }
}
