@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Noto+Sans+JP:wght@400;500;700&display=swap');

/* ===========================================
   bakuyasu100car事典 WordPress版
   index.html / style.css と全く同じデザイン
   テーマ完全バイパス版 v7.0
   =========================================== */

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

.wp-book-page,
.wp-book-page *,
.wp-book-page *::before,
.wp-book-page *::after {
    box-sizing: border-box;
}

.wp-book-page {
    font-family: 'Noto Sans JP', sans-serif;
    max-width: 100%;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: #4A4A4A;
}

.wp-book-page h2,
.wp-book-page h3,
.wp-book-page h4,
.wp-book-page p,
.wp-book-page ul,
.wp-book-page li,
.wp-book-page div,
.wp-book-page a,
.wp-book-page button,
.wp-book-page img {
    margin: 0;
    padding: 0;
    border: none;
    font-family: inherit;
}

/* ===========================================
   表紙ページ（カバー）
   =========================================== */

.wp-book-page .cover-page {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: #000;
}

.wp-book-page .cover-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.wp-book-page .cover-bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wp-book-page .cover-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.wp-book-page .cover-overlay-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1.0;
}

.wp-book-page .cover-cta {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    text-align: center;
}

.wp-book-page .cover-cta-btn {
    display: inline-block;
    background: linear-gradient(135deg, #2DD4BF, #14B8A6);
    color: white;
    text-decoration: none;
    padding: 16px 40px;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow:
        0 6px 20px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.3);
    transition: all 0.3s ease;
    animation: ctaPulse 2s ease-in-out infinite;
}

.wp-book-page .cover-cta-btn:hover {
    transform: translateY(-3px);
    box-shadow:
        0 10px 30px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.5);
}

@keyframes ctaPulse {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 1; }
}

/* ===========================================
   ページ枠 (羊皮紙背景)
   =========================================== */

.wp-book-page .page {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.1) 0%, transparent 50%),
        linear-gradient(45deg, #F5F5DC 0%, #FFF8DC 30%, #F0E68C 60%, #F5F5DC 100%);
    overflow: hidden;
}

.wp-book-page .page::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(139,69,19,0.1) 2px, rgba(139,69,19,0.1) 4px),
        repeating-linear-gradient(0deg, transparent, transparent 25px, rgba(139,69,19,0.05) 25px, rgba(139,69,19,0.05) 26px);
    pointer-events: none;
    z-index: 0;
}

.wp-book-page .cover-page {
    background: #000;
}

.wp-book-page .cover-page::before {
    display: none;
}

.wp-book-page .page-content {
    position: relative;
    width: 100%;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    z-index: 2;
}

/* ===========================================
   車一覧ページ（目次）
   =========================================== */

.wp-book-page .index-page .page-content {
    padding: 30px 20px 100px 20px;
    min-height: 100vh;
}

.wp-book-page .index-title {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #8B4513;
    margin-bottom: 20px;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.wp-book-page .cars-grid-container {
    width: 100%;
    padding: 20px 10px;
    scrollbar-width: thin;
    scrollbar-color: #B8860B rgba(255,255,255,0.3);
}

.wp-book-page .cars-grid-container::-webkit-scrollbar {
    width: 8px;
}

.wp-book-page .cars-grid-container::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
}

.wp-book-page .cars-grid-container::-webkit-scrollbar-thumb {
    background: #B8860B;
    border-radius: 10px;
}

.wp-book-page .cars-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    max-width: 700px;
    margin: 0 auto;
}

/* --- 車カード --- */

.wp-book-page .car-card {
    aspect-ratio: 0.75;
    background: linear-gradient(135deg, #F5F5DC 0%, #FFF8DC 100%);
    border: 4px solid #8B4513;
    border-radius: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        0 10px 28px rgba(0,0,0,0.35),
        inset 0 0 35px rgba(255,255,255,0.45);
    overflow: hidden;
    padding: 20px 15px 15px;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.wp-book-page .car-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    transition: transform 0.3s ease;
}

.wp-book-page .car-card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow:
        0 10px 25px rgba(0,0,0,0.3),
        inset 0 0 30px rgba(255,255,255,0.4);
    border-color: #DAA520;
}

.wp-book-page .car-card:hover::before {
    transform: scale(1);
}

/* --- カード内フレーム --- */

.wp-book-page .car-card-frame {
    position: relative;
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.wp-book-page .car-card-icon {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    background: linear-gradient(45deg, #87CEEB, #98FB98);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.wp-book-page .car-card-frame::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 2;
}

.wp-book-page .car-card[data-frame="1"] .car-card-frame::after {
    background-image: url('./img/frame1.png');
}

.wp-book-page .car-card[data-frame="2"] .car-card-frame::after {
    background-image: url('./img/frame2.png');
}

.wp-book-page .car-card[data-frame="3"] .car-card-frame::after {
    background-image: url('./img/frame3.png');
}

.wp-book-page .car-card-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #8B4513;
    text-align: center;
    line-height: 1.2;
    z-index: 1;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
    margin-bottom: 4px;
}

.wp-book-page .car-card-brand {
    font-size: 0.85rem;
    font-weight: 500;
    color: #B8860B;
    text-align: center;
    z-index: 1;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.6);
}

/* --- 車一覧ナビゲーション --- */

.wp-book-page .list-nav {
    margin-top: 30px;
    text-align: center;
}

.wp-book-page .list-nav-btn {
    display: inline-block;
    background: linear-gradient(135deg, #DAA520, #B8860B);
    color: white;
    text-decoration: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow:
        0 6px 20px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.3);
    transition: all 0.3s ease;
    min-width: 120px;
}

.wp-book-page .list-nav-btn:hover {
    transform: translateY(-3px);
    box-shadow:
        0 8px 25px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.5);
    color: white;
}

/* ===========================================
   車ページレイアウト（個別ページ）
   =========================================== */

.wp-book-page .car-story-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 10px;
    width: 100%;
    gap: 15px;
}

.wp-book-page .car-title-section {
    text-align: center;
    margin-bottom: 15px;
}

.wp-book-page .car-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #8B4513;
    margin-bottom: 15px;
    text-align: center;
    font-family: 'Cinzel', serif;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    line-height: 1.3;
}

/* --- ギャラリー --- */

.wp-book-page .car-gallery-container {
    position: relative;
    margin-bottom: 15px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.wp-book-page .car-main-image {
    width: 400px;
    height: 280px;
    background: linear-gradient(45deg, #87CEEB, #98FB98);
    border-radius: 20px;
    border: 4px solid #8B4513;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.wp-book-page .car-main-image:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(0,0,0,0.4);
}

.wp-book-page .car-main-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 16px;
}

.wp-book-page .gallery-hint {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    pointer-events: none;
}

/* --- TikTok動画 --- */

.wp-book-page .video-section {
    width: 100%;
    max-width: 700px;
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 10px;
}

.wp-book-page .video-container {
    width: 100%;
    max-width: 650px;
    height: auto;
    background: transparent;
    border-radius: 15px;
    border: 3px solid #8B4513;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 15px;
    margin: 0 auto;
}

.wp-book-page .tiktok-placeholder-msg {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
}

.wp-book-page .tiktok-embed {
    max-width: 100% !important;
    margin: 0 auto !important;
}

/* --- 物語セクション --- */

.wp-book-page .story-section {
    width: 100%;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    border: 3px solid rgba(139,69,19,0.3);
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    backdrop-filter: blur(5px);
}

.wp-book-page .story-title {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    color: #8B4513;
    margin-bottom: 20px;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    line-height: 1.3;
}

.wp-book-page .story-content {
    color: #4A4A4A;
    line-height: 1.8;
    font-size: 1.1rem;
    text-align: justify;
}

.wp-book-page .story-content p {
    margin-bottom: 15px;
    color: #4A4A4A;
    font-size: 1.1rem;
    line-height: 1.8;
}

.wp-book-page .story-content::first-letter {
    font-size: 3rem;
    font-weight: bold;
    color: #8B4513;
    float: left;
    line-height: 0.8;
    margin: 8px 8px 0 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

/* ===========================================
   ギャラリーモーダル
   =========================================== */

.gallery-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.gallery-content {
    background: linear-gradient(135deg, #F5F5DC 0%, #FFF8DC 100%);
    border-radius: 20px;
    border: 3px solid #8B4513;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    max-width: 90vw;
    max-height: 90vh;
    width: 800px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.gallery-header {
    background: linear-gradient(135deg, #8B4513, #A0522D);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gallery-header h3 {
    margin: 0;
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    color: white;
}

.gallery-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.gallery-close:hover {
    background: rgba(255,255,255,0.2);
}

.gallery-main-section {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: 300px;
}

#galleryMainImage {
    max-width: 100%;
    max-height: 60vh;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    object-fit: contain;
    display: block;
}

.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(139,69,19,0.8);
    color: white;
    border: none;
    width: 50px; height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    padding: 0;
}

.gallery-nav-btn:hover {
    background: rgba(139,69,19,1);
    transform: translateY(-50%) scale(1.1);
}

.gallery-nav-btn.prev { left: 15px; }
.gallery-nav-btn.next { right: 15px; }

.gallery-thumbnails-section {
    padding: 15px 20px;
    border-top: 2px solid rgba(139,69,19,0.3);
    background: rgba(255,255,255,0.1);
}

.gallery-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 5px 0;
    scrollbar-width: thin;
    scrollbar-color: #B8860B rgba(255,255,255,0.3);
}

.gallery-modal .gallery-thumbnail {
    flex-shrink: 0;
    width: 80px; height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.gallery-modal .gallery-thumbnail:hover {
    transform: scale(1.05);
}

.gallery-modal .gallery-thumbnail.active {
    border-color: #DAA520;
    box-shadow: 0 0 15px rgba(218,165,32,0.5);
}

.gallery-modal .gallery-thumbnail img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}

/* ===========================================
   レスポンシブ（タブレット）
   =========================================== */

@media (max-width: 768px) {
    .wp-book-page .car-title {
        font-size: 2rem;
    }

    .wp-book-page .car-main-image {
        width: 90%;
        max-width: 350px;
        height: 240px;
    }

    .wp-book-page .video-section {
        max-width: 100%;
        padding: 0;
    }

    .wp-book-page .video-container {
        max-width: 100%;
        padding: 8px;
        border-width: 2px;
    }

    .wp-book-page .cars-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .wp-book-page .index-title {
        font-size: 2rem;
        margin-bottom: 15px;
    }

    .wp-book-page .car-card {
        padding: 15px 12px 12px;
    }

    .wp-book-page .car-card-name {
        font-size: 1.2rem;
        font-weight: 700;
    }

    .wp-book-page .car-card-brand {
        font-size: 1rem;
        font-weight: 500;
    }

    .wp-book-page .cover-cta {
        bottom: 80px;
    }

    .wp-book-page .cover-cta-btn {
        padding: 14px 35px;
        font-size: 1.1rem;
    }

    .gallery-content {
        max-width: 95vw;
        max-height: 95vh;
    }

    .gallery-main-section {
        min-height: 250px;
        padding: 10px;
    }

    #galleryMainImage {
        max-height: 50vh;
    }

    .gallery-nav-btn {
        width: 40px; height: 40px;
        font-size: 1.2rem;
    }

    .gallery-nav-btn.prev { left: 8px; }
    .gallery-nav-btn.next { right: 8px; }
}

/* ===========================================
   レスポンシブ（スマートフォン）
   =========================================== */

@media (max-width: 480px) {
    .wp-book-page .page-content {
        padding: 15px 10px;
    }

    .wp-book-page .index-page .page-content {
        padding: 15px 10px 80px 10px;
    }

    .wp-book-page .index-title {
        font-size: 1.8rem;
        margin-bottom: 10px;
    }

    .wp-book-page .car-title {
        font-size: 1.6rem;
    }

    .wp-book-page .car-main-image {
        width: 100%;
        max-width: 300px;
        height: 200px;
    }

    .wp-book-page .story-section {
        padding: 20px;
    }

    .wp-book-page .story-title {
        font-size: 1.5rem;
    }

    .wp-book-page .story-content,
    .wp-book-page .story-content p {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .wp-book-page .story-content::first-letter {
        font-size: 2.5rem;
        margin: 6px 6px 0 0;
    }

    .wp-book-page .cars-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .wp-book-page .car-card {
        padding: 12px 10px 10px;
    }

    .wp-book-page .car-card-name {
        font-size: 1.1rem;
        font-weight: 700;
    }

    .wp-book-page .car-card-brand {
        font-size: 0.95rem;
        font-weight: 500;
    }

    .wp-book-page .cover-cta {
        bottom: 60px;
    }

    .wp-book-page .cover-cta-btn {
        padding: 12px 30px;
        font-size: 1rem;
    }

    .wp-book-page .list-nav-btn {
        padding: 12px 25px;
        font-size: 1rem;
    }

    .gallery-thumbnails-section {
        padding: 10px;
    }

    .gallery-modal .gallery-thumbnail {
        width: 60px; height: 45px;
    }
}

/* ===========================================
   超小画面（iPhone SE等）
   =========================================== */

@media (max-width: 375px) {
    .wp-book-page .index-title {
        font-size: 1.6rem;
    }

    .wp-book-page .cars-grid {
        gap: 8px;
    }

    .wp-book-page .car-card {
        padding: 10px 8px 8px;
        border-radius: 16px;
        border-width: 3px;
    }

    .wp-book-page .car-card-name {
        font-size: 1rem;
    }

    .wp-book-page .car-card-brand {
        font-size: 0.85rem;
    }
}
