/*
Theme Name: BookMatome
Theme URI: https://example.com/bookmatome
Author: Genspark
Author URI: https://genspark.ai
Description: 電子書籍・Kindle本・電子コミックのまとめ・レビューサイト向けWordPressテーマ。書籍カバー表示、星評価、価格比較、ジャンル別ナビ、無料本・セール情報セクションを搭載。
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bookmatome
Tags: responsive, two-columns, right-sidebar, custom-colors, custom-logo, featured-images, translation-ready, blog, entertainment, books
*/

/* ===== CSS Variables ===== */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #1e293b;
    --accent-color: #f59e0b;
    --accent-warm: #ef4444;
    --free-color: #10b981;
    --bg-color: #f1f5f9;
    --bg-warm: #fef3c7;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.15);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
    --header-height: 64px;
    --container-max: 1200px;
    --sidebar-width: 320px;
    --kindle-blue: #00a4d3;
    --bookwalker-orange: #ff8c00;
    --rakuten-red: #bf0000;
}

/* ===== Reset ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
    overflow-x: hidden;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

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

ul, ol {
    list-style: none;
}

/* ===== Layout Container ===== */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 16px;
}

/* ===== Header ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    box-shadow: var(--shadow-sm);
    border-bottom: 3px solid var(--primary-color);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    gap: 16px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary-color);
    text-decoration: none;
    white-space: nowrap;
}

.site-logo:hover {
    text-decoration: none;
    color: var(--primary-color);
}

.site-logo .logo-icon {
    font-size: 1.6rem;
}

/* Header Search */
.header-search {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.header-search-form {
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border-radius: 30px;
    padding: 4px 4px 4px 16px;
    border: 2px solid transparent;
    transition: var(--transition);
}

.header-search-form:focus-within {
    border-color: var(--primary-color);
    background: #fff;
}

.header-search-form input[type="search"] {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.9rem;
    padding: 8px 0;
}

.header-search-form button {
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.header-search-form button:hover {
    background: var(--primary-dark);
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    background: none;
    border: none;
}

.hamburger span {
    width: 24px;
    height: 3px;
    background: var(--secondary-color);
    border-radius: 2px;
    transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Header Nav */
.header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-nav a {
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 0;
    position: relative;
}

.header-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.header-nav a:hover::after { width: 100%; }
.header-nav a:hover {
    text-decoration: none;
    color: var(--primary-color);
}

/* ===== Sub Nav (Genre Bar) ===== */
.sub-nav {
    background: var(--secondary-color);
    color: #fff;
    overflow-x: auto;
    scrollbar-width: thin;
}

.sub-nav::-webkit-scrollbar { height: 4px; }
.sub-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 2px; }

.sub-nav-inner {
    display: flex;
    gap: 0;
    white-space: nowrap;
}

.sub-nav a {
    color: rgba(255,255,255,0.85);
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    border-right: 1px solid rgba(255,255,255,0.1);
}

.sub-nav a:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    text-decoration: none;
}

.sub-nav a.active {
    background: var(--primary-color);
    color: #fff;
}

.sub-nav a .badge {
    background: var(--accent-warm);
    color: #fff;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 700;
}

/* ===== Main Layout ===== */
.main-wrapper {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: 24px;
    padding: 24px 0;
    max-width: var(--container-max);
    margin: 0 auto;
    padding-left: 16px;
    padding-right: 16px;
}

.content-area {
    min-width: 0;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
    padding: 12px 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.breadcrumb a { color: var(--text-light); }
.breadcrumb span { margin: 0 6px; color: var(--text-muted); }
.breadcrumb .current { color: var(--primary-color); font-weight: 600; }

/* ===== Section Title ===== */
.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--primary-color);
}

.section-title .icon { color: var(--primary-color); }
.section-title .more-link {
    margin-left: auto;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}
.section-title .more-link:hover { color: var(--primary-color); }

/* ===== Free Books Banner ===== */
.free-banner {
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: var(--radius-md);
    padding: 16px 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: #fff;
    box-shadow: var(--shadow-md);
}

.free-banner .free-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.free-banner .free-text {
    flex: 1;
}

.free-banner .free-text h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.free-banner .free-text p {
    font-size: 0.82rem;
    opacity: 0.9;
}

.free-banner .free-btn {
    background: #fff;
    color: #059669;
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: var(--transition);
}

.free-banner .free-btn:hover {
    transform: scale(1.05);
    text-decoration: none;
}

/* ===== Hero / Featured Section ===== */
.hero-section { margin-bottom: 32px; }

.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 12px;
    height: 420px;
}

.hero-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.hero-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.hero-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.hero-card:hover img { transform: scale(1.08); }

.hero-card-1 { grid-row: 1 / 3; }

.hero-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    padding: 20px 16px 14px;
}

.hero-card-badge {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
}

.hero-card-badge.free { background: var(--free-color); }
.hero-card-badge.sale { background: var(--accent-warm); }
.hero-card-badge.new { background: var(--accent-color); }

.hero-card-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-card-1 .hero-card-title {
    font-size: 1.4rem;
    -webkit-line-clamp: 3;
}

.hero-card-meta {
    color: rgba(255,255,255,0.7);
    font-size: 0.75rem;
    margin-top: 6px;
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ===== Book Cards Grid ===== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.post-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

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

.post-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.post-card-link:hover { text-decoration: none; color: inherit; }

/* Book Cover */
.post-card-thumbnail {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
}

.post-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-card:hover .post-card-thumbnail img { transform: scale(1.08); }

/* Book cover shadow effect */
.post-card-thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 15%;
    height: 100%;
    background: linear-gradient(to left, rgba(0,0,0,0.15), transparent);
    pointer-events: none;
}

/* Badges on cover */
.cover-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cover-badge .badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.badge-free { background: var(--free-color); }
.badge-sale { background: var(--accent-warm); }
.badge-new { background: var(--accent-color); }
.badge-rank { background: var(--secondary-color); }

/* Discount badge */
.cover-badge .badge-discount {
    background: var(--accent-warm);
    font-size: 0.7rem;
    padding: 4px 8px;
}

/* Book body */
.post-card-body {
    padding: 12px 14px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card-title {
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.5;
    color: var(--text-color);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-author {
    font-size: 0.76rem;
    color: var(--text-light);
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Star Rating */
.star-rating {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 8px;
}

.star-rating .stars {
    color: var(--accent-color);
    font-size: 0.82rem;
    letter-spacing: 1px;
}

.star-rating .rating-num {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-left: 4px;
    font-weight: 600;
}

/* Price display */
.book-price {
    margin-top: auto;
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.book-price .price-current {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--accent-warm);
}

.book-price .price-original {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.book-price .price-free {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--free-color);
}

.book-price .price-point {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Ranking badge */
.ranking-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    z-index: 2;
    box-shadow: var(--shadow-md);
}

.ranking-badge.rank-1 { background: linear-gradient(135deg, #ffd700, #ffaa00); }
.ranking-badge.rank-2 { background: linear-gradient(135deg, #c0c0c0, #999999); }
.ranking-badge.rank-3 { background: linear-gradient(135deg, #cd7f32, #b87333); }
.ranking-badge.rank-4, .ranking-badge.rank-5 { background: var(--secondary-color); }

/* ===== Sidebar ===== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.widget {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.widget-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--primary-color);
}

.widget-title .icon { color: var(--primary-color); }

/* Ranking Widget - Book style */
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ranking-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--border-color);
}

.ranking-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.ranking-item a {
    display: flex;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    width: 100%;
}

.ranking-item a:hover { text-decoration: none; }

.ranking-number {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    background: var(--secondary-color);
}

.ranking-item:nth-child(1) .ranking-number { background: linear-gradient(135deg, #ffd700, #ffaa00); }
.ranking-item:nth-child(2) .ranking-number { background: linear-gradient(135deg, #c0c0c0, #999999); }
.ranking-item:nth-child(3) .ranking-number { background: linear-gradient(135deg, #cd7f32, #b87333); }

.ranking-thumb {
    flex-shrink: 0;
    width: 60px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
    box-shadow: 2px 2px 6px rgba(0,0,0,0.15);
}

.ranking-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ranking-content {
    flex: 1;
    min-width: 0;
}

.ranking-title {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.ranking-author {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.ranking-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    gap: 8px;
    align-items: center;
}

.ranking-meta .price-tag {
    color: var(--accent-warm);
    font-weight: 700;
}

.ranking-meta .price-tag.free {
    color: var(--free-color);
}

/* Category Widget */
.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-list a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-color);
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-color);
    transition: var(--transition);
}

.category-list a:hover {
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
}

.category-list .count {
    font-size: 0.7rem;
    opacity: 0.7;
}

/* Tag Cloud */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-cloud a {
    padding: 5px 12px;
    background: var(--bg-color);
    border-radius: 6px;
    font-size: 0.8rem !important;
    color: var(--text-light);
    transition: var(--transition);
}

.tag-cloud a:hover {
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
}

/* Search Widget */
.widget-search-form {
    display: flex;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.widget-search-form input {
    flex: 1;
    border: none;
    padding: 10px 14px;
    font-size: 0.9rem;
    outline: none;
}

.widget-search-form button {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.widget-search-form button:hover { background: var(--primary-dark); }

/* Sale Countdown Widget */
.sale-widget {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 2px solid #f59e0b;
}

.sale-widget .widget-title {
    color: #92400e;
    border-bottom-color: #f59e0b;
}

.sale-widget .widget-title::after { background: #f59e0b; }

.sale-countdown {
    text-align: center;
    padding: 16px 0;
}

.sale-countdown .countdown-label {
    font-size: 0.8rem;
    color: #92400e;
    margin-bottom: 8px;
}

.sale-countdown .countdown-timer {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.sale-countdown .time-block {
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    text-align: center;
    min-width: 56px;
}

.sale-countdown .time-num {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent-warm);
    line-height: 1;
}

.sale-countdown .time-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Platform Links Widget */
.platform-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.platform-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.88rem;
    transition: var(--transition);
    border: 2px solid var(--border-color);
}

.platform-link:hover {
    transform: translateX(4px);
    text-decoration: none;
}

.platform-link .platform-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    flex-shrink: 0;
}

.platform-link.kindle { color: var(--kindle-blue); }
.platform-link.kindle .platform-icon { background: var(--kindle-blue); }
.platform-link.kindle:hover { border-color: var(--kindle-blue); background: #f0f9ff; }

.platform-link.bookwalker { color: var(--bookwalker-orange); }
.platform-link.bookwalker .platform-icon { background: var(--bookwalker-orange); }
.platform-link.bookwalker:hover { border-color: var(--bookwalker-orange); background: #fff7ed; }

.platform-link.rakuten { color: var(--rakuten-red); }
.platform-link.rakuten .platform-icon { background: var(--rakuten-red); }
.platform-link.rakuten:hover { border-color: var(--rakuten-red); background: #fef2f2; }

/* ===== Single Post (Book Review) ===== */
.single-post-wrapper {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.post-header { margin-bottom: 24px; }

.post-header .post-categories {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.post-header .post-categories a {
    background: var(--primary-color);
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.post-header .post-categories a:hover {
    background: var(--primary-dark);
    text-decoration: none;
}

.post-title {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.4;
    color: var(--secondary-color);
    margin-bottom: 16px;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.post-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-meta .author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.post-meta .author img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* ===== Book Info Box ===== */
.book-info-box {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 24px;
    background: var(--bg-color);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 28px;
}

.book-info-cover {
    position: relative;
}

.book-info-cover img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}

.book-info-cover::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 12%;
    height: 100%;
    background: linear-gradient(to left, rgba(0,0,0,0.2), transparent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    pointer-events: none;
}

.book-info-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.book-info-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--secondary-color);
    line-height: 1.4;
}

.book-info-author {
    font-size: 0.9rem;
    color: var(--text-light);
}

.book-info-author a {
    font-weight: 600;
}

/* Review Stars in info box */
.book-info-rating {
    display: flex;
    align-items: center;
    gap: 8px;
}

.book-info-rating .stars {
    color: var(--accent-color);
    font-size: 1.1rem;
    letter-spacing: 2px;
}

.book-info-rating .rating-text {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 600;
}

/* Book metadata table */
.book-info-table {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 16px;
    font-size: 0.85rem;
    padding: 12px 0;
    border-top: 1px solid var(--border-color);
}

.book-info-table dt {
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

.book-info-table dd {
    color: var(--text-color);
}

/* Price comparison in info box */
.book-price-comparison {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.price-store {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #fff;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.price-store:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.price-store .store-name {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
}

.price-store .store-price {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--accent-warm);
}

.price-store .store-price.free { color: var(--free-color); }

.price-store .store-btn {
    background: var(--primary-color);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    transition: var(--transition);
}

.price-store .store-btn:hover {
    background: var(--primary-dark);
    text-decoration: none;
    color: #fff;
}

/* ===== Post Content ===== */
.post-content {
    font-size: 1rem;
    line-height: 1.9;
    color: var(--text-color);
}

.post-content h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin: 32px 0 16px;
    padding: 10px 0 10px 16px;
    border-left: 5px solid var(--primary-color);
    border-bottom: 1px solid var(--border-color);
}

.post-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin: 28px 0 12px;
}

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

.post-content ul, .post-content ol {
    margin: 16px 0 20px 20px;
    padding-left: 10px;
}

.post-content ul li { list-style: disc; margin-bottom: 8px; }
.post-content ol li { list-style: decimal; margin-bottom: 8px; }

.post-content blockquote {
    background: #f8fafc;
    border-left: 4px solid var(--primary-color);
    padding: 16px 20px;
    margin: 20px 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-light);
    font-style: italic;
}

.post-content pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 20px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 20px 0;
    font-size: 0.9rem;
}

.post-content code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.post-content pre code { background: none; padding: 0; }
.post-content img { border-radius: var(--radius-sm); margin: 16px 0; }

.post-content a {
    color: var(--primary-color);
    text-decoration: underline;
    text-decoration-color: rgba(37, 99, 235, 0.3);
    text-underline-offset: 2px;
}

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

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.post-content table th,
.post-content table td {
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    text-align: left;
}

.post-content table th {
    background: var(--bg-color);
    font-weight: 700;
}

/* Matome style list */
.matome-list {
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0;
    margin: 24px 0;
    overflow: hidden;
}

.matome-list-title {
    background: var(--secondary-color);
    color: #fff;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.matome-list ol {
    counter-reset: matome-counter;
    list-style: none;
    padding: 0;
    margin: 0;
}

.matome-list ol > li {
    counter-increment: matome-counter;
    padding: 16px 20px 16px 56px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    font-size: 0.95rem;
    line-height: 1.7;
}

.matome-list ol > li:last-child { border-bottom: none; }

.matome-list ol > li::before {
    content: counter(matome-counter);
    position: absolute;
    left: 16px;
    top: 16px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
}

.matome-list ol > li:nth-child(1)::before {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
}

/* Review Box */
.review-box {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 2px solid var(--primary-light);
    border-radius: var(--radius-md);
    padding: 24px;
    margin: 28px 0;
}

.review-box-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.review-box-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.review-box-rating .stars {
    color: var(--accent-color);
    font-size: 1.3rem;
    letter-spacing: 2px;
}

.review-box-rating .score {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--secondary-color);
}

.review-box-rating .out-of {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.review-box-comment {
    font-size: 0.92rem;
    line-height: 1.8;
    color: var(--text-color);
}

/* Pros / Cons */
.pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 20px 0;
}

.pros-box, .cons-box {
    border-radius: var(--radius-md);
    padding: 20px;
}

.pros-box {
    background: #ecfdf5;
    border: 2px solid #10b981;
}

.cons-box {
    background: #fef2f2;
    border: 2px solid #ef4444;
}

.pros-box h4, .cons-box h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pros-box h4 { color: #059669; }
.cons-box h4 { color: #dc2626; }

.pros-box ul, .cons-box ul {
    margin: 0;
    padding-left: 8px;
}

.pros-box ul li {
    list-style: none;
    padding: 4px 0 4px 24px;
    position: relative;
    font-size: 0.88rem;
}

.pros-box ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: 700;
}

.cons-box ul li {
    list-style: none;
    padding: 4px 0 4px 24px;
    position: relative;
    font-size: 0.88rem;
}

.cons-box ul li::before {
    content: '✗';
    position: absolute;
    left: 0;
    color: #ef4444;
    font-weight: 700;
}

/* Share Buttons */
.share-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 32px 0;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.share-buttons .share-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
    margin-right: 8px;
    display: flex;
    align-items: center;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.share-btn:hover { opacity: 0.85; transform: translateY(-2px); }

.share-btn.twitter { background: #1DA1F2; }
.share-btn.facebook { background: #1877F2; }
.share-btn.line { background: #00B900; }
.share-btn.hatena { background: #008fde; }
.share-btn.copy { background: var(--secondary-color); }

/* Author Box */
.author-box {
    display: flex;
    gap: 16px;
    background: var(--bg-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin: 24px 0;
}

.author-box .author-avatar img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
}

.author-box .author-info .author-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 6px;
}

.author-box .author-info .author-desc {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.6;
}

/* Related Posts */
.related-posts { margin-top: 32px; }

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 32px 0;
}

.pagination a, .pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.pagination a:hover {
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
}

.pagination .current {
    background: var(--primary-color);
    color: #fff;
}

.pagination .dots { background: transparent; box-shadow: none; }

/* ===== Archive Page ===== */
.archive-header {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.archive-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary-color);
    margin-bottom: 8px;
}

.archive-header .archive-description {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ===== 404 Page ===== */
.error404-content {
    text-align: center;
    padding: 60px 20px;
}

.error404-content .error-code {
    font-size: 6rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
}

.error404-content .error-message {
    font-size: 1.2rem;
    color: var(--text-light);
    margin: 16px 0 32px;
}

.error404-content .error-search {
    max-width: 400px;
    margin: 0 auto 32px;
}

.error404-content .back-home {
    display: inline-block;
    padding: 12px 32px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 30px;
    font-weight: 600;
    transition: var(--transition);
}

.error404-content .back-home:hover {
    background: var(--primary-dark);
    text-decoration: none;
    color: #fff;
}

/* ===== Footer ===== */
.site-footer {
    background: var(--secondary-color);
    color: rgba(255,255,255,0.8);
    margin-top: 40px;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 40px 16px;
}

.footer-widget h3 {
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

.footer-widget ul {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-widget ul a {
    color: rgba(255,255,255,0.7);
    font-size: 0.88rem;
    transition: var(--transition);
}

.footer-widget ul a:hover {
    color: var(--accent-color);
    text-decoration: none;
    padding-left: 4px;
}

.footer-widget p {
    font-size: 0.88rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.7);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 16px;
    text-align: center;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.5);
}

.footer-bottom a { color: var(--accent-color); }

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    font-size: 1.2rem;
}

.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--primary-dark); transform: translateY(-4px); }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .main-wrapper { grid-template-columns: 1fr; }
    .sidebar { order: 2; }
    .posts-grid { grid-template-columns: repeat(3, 1fr); }
    .related-posts-grid { grid-template-columns: repeat(3, 1fr); }
    .hero-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
        height: auto;
    }
    .hero-card-1 {
        grid-row: auto;
        grid-column: 1 / 3;
        height: 280px;
    }
    .hero-card-2, .hero-card-3, .hero-card-4, .hero-card-5 { height: 160px; }
    .footer-widgets { grid-template-columns: repeat(2, 1fr); }
    .book-info-box { grid-template-columns: 160px 1fr; }
}

@media (max-width: 768px) {
    .header-search { display: none; }
    .header-nav { display: none; }
    .hamburger { display: flex; }

    .header-nav.mobile-open {
        display: flex;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 16px;
        box-shadow: var(--shadow-md);
        gap: 0;
        z-index: 100;
    }

    .header-nav.mobile-open a {
        padding: 12px 0;
        border-bottom: 1px solid var(--border-color);
        width: 100%;
    }

    .posts-grid { grid-template-columns: repeat(2, 1fr); }
    .related-posts-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-grid { grid-template-columns: 1fr; }
    .hero-card-1 { grid-column: auto; height: 220px; }
    .hero-card { height: 160px; }
    .hero-card-1 .hero-card-title { font-size: 1.1rem; }
    .single-post-wrapper { padding: 20px 16px; border-radius: var(--radius-md); }
    .post-title { font-size: 1.4rem; }
    .post-content h2 { font-size: 1.2rem; }

    .book-info-box {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .book-info-cover {
        max-width: 180px;
        margin: 0 auto;
    }
    .book-info-table {
        text-align: left;
    }
    .pros-cons { grid-template-columns: 1fr; }

    .footer-widgets { grid-template-columns: 1fr; gap: 24px; }
    .ranking-thumb { width: 50px; height: 66px; }
    .ranking-title { font-size: 0.78rem; -webkit-line-clamp: 2; }
    .share-btn span { display: none; }
    .share-btn { padding: 10px 14px; }
    .free-banner { flex-wrap: wrap; }
}

@media (max-width: 480px) {
    .site-logo { font-size: 1.2rem; }
    .section-title { font-size: 1.1rem; }
    .post-card-title { font-size: 0.82rem; }
    .post-card-body { padding: 10px; }
    .posts-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .back-to-top {
        width: 40px; height: 40px;
        bottom: 16px; right: 16px;
    }
    .book-info-box { padding: 16px; }
}

/* ===== WordPress Core Classes ===== */
.alignleft { float: left; margin-right: 16px; }
.alignright { float: right; margin-left: 16px; }
.aligncenter { display: block; margin: 0 auto; }
.alignnone { margin: 16px 0; }
.wp-caption { max-width: 100%; }
.wp-caption-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 8px;
}
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}
.sticky { border-color: var(--accent-color); }

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.gallery img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

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

.alignwide {
    margin-left: calc(25% - 25vw);
    margin-right: calc(25% - 25vw);
    width: auto; max-width: 1000px;
}

/* Search No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.no-results h2 {
    font-size: 1.3rem;
    color: var(--secondary-color);
    margin-bottom: 12px;
}

.no-results p { color: var(--text-light); margin-bottom: 24px; }

/* Comments */
.comments-area {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-top: 24px;
    box-shadow: var(--shadow-sm);
}

.comments-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.comment-list { list-style: none; }
.comment {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}
.comment:last-child { border-bottom: none; }
.comment-body { display: flex; gap: 12px; }
.comment-avatar img {
    width: 40px; height: 40px; border-radius: 50%;
}
.comment-meta { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 6px; }
.comment-meta .comment-author { font-weight: 700; color: var(--text-color); }
.comment-content { font-size: 0.9rem; line-height: 1.7; }
.comment-reply-link { font-size: 0.8rem; color: var(--primary-color); }
.children { list-style: none; padding-left: 24px; }
.comment-respond { margin-top: 24px; }

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 12px;
    font-family: inherit;
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

.comment-form .submit {
    width: auto;
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 10px 28px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.comment-form .submit:hover { background: var(--primary-dark); }
