@import url('./partials/header.css');
@import url('./partials/footer.css');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 全体スタイル */
body {
    font-family: Montserrat, 'Noto Sans JP', 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #fff;
    color: #222;
    line-height: 1.6;
    position: relative;
    height: 100%;
}

main, header, footer {
    position: relative;
    z-index: 1;
}

html, body {
    height: 100%;
}

.wrapper {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* ヘッダー */
header {
    position: relative;
    z-index: 2;
    height: 80px;
}

/* ブログ詳細ページ専用スタイル */
.blog-detail-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 20px 40px;  /* 上部にヘッダー分のパディングを追加 */
    background: #fff;
    position: relative;
    z-index: 1; /* ヘッダー(z-index: 100)より背面に配置 */
}

.back-to-list {
    display: inline-flex;
    align-items: center;
    color: #c40000;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 30px;
    font-size: 0.95em;
    transition: color 0.3s ease;
}

.back-to-list:hover {
    color: #a00000;
    text-decoration: none;
}

.back-to-list i {
    margin-right: 8px;
}

.blog-detail-main .blog-detail-title {
    border-bottom: 2px solid #f5f5f5;
}

.blog-detail-main .blog-detail-title-text {
    font-size: 2.2rem;
}

.blog-detail-meta {
    display: flex;
    justify-content: flex-end;
    color: #666;
    font-size: 0.95em;
    margin-top: 10px;
}

.blog-detail-date {
    display: flex;
    align-items: center;
    gap: 8px;
}

.blog-detail-author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

/* 画像カルーセル関連のスタイル */
.blog-image-carousel {
    margin: 20px 0 40px;
    position: relative;
    z-index: 1;
}

/* 単一画像の場合 */
.blog-detail-image.single-image {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    background-color: #f8f8f8;
    transition: opacity 0.3s ease;
}

.blog-detail-image.loaded {
    opacity: 1;
}

/* カルーセルコンテナ */
.carousel-container {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
}

.carousel-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    background-color: #f8f8f8;
}

.carousel-track {
    display: flex;
    transition: transform 0.4s ease-in-out;
    will-change: transform;
}

.carousel-slide {
    min-width: 100%;
    position: relative;
}

.carousel-slide .blog-detail-image {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    display: block;
    background-color: #f8f8f8;
    border-radius: 0;
    box-shadow: none;
}

/* カルーセルナビゲーションボタン */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #c40000;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.carousel-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.carousel-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-prev {
    left: 15px;
}

.carousel-next {
    right: 15px;
}

/* カルーセルインジケーター */
.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.carousel-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.carousel-indicator.active {
    background: #c40000;
    transform: scale(1.2);
}

.carousel-indicator:hover {
    background: #999;
    transform: scale(1.1);
}

.carousel-indicator.active:hover {
    background: #a00000;
}

/* ローディング効果 */
.blog-detail-image {
    opacity: 1; /* 初期状態で表示 */
    transition: opacity 0.3s ease;
}

.blog-detail-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    font-family: 'Noto Sans JP', sans-serif;
    white-space: pre-line;
}

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

.blog-detail-content h1,
.blog-detail-content h2,
.blog-detail-content h3 {
    margin: 40px 0 20px;
    color: #c40000;
    font-weight: 700;
}

.blog-detail-content h1 {
    font-size: 1.8rem;
    border-bottom: 3px solid #c40000;
    padding-bottom: 10px;
}

.blog-detail-content h2 {
    font-size: 1.5rem;
    border-left: 4px solid #c40000;
    padding-left: 15px;
}

.blog-detail-content h3 {
    font-size: 1.3rem;
}

/* ブログ一覧へ戻るリンクの下部配置 */
.back-to-list-bottom {
    display: flex;
    justify-content: flex-end;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

.back-to-list-bottom .back-to-list {
    margin-bottom: 0;
    font-size: 1.1em;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.back-to-list-bottom .back-to-list:hover {
    color: #a00000;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transform: translateX(-3px);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    header {
        height: 60px; /* モバイル版ヘッダー高さ */
    }

    .blog-detail-container {
        padding: 20px 15px;
    }
    
    .blog-detail-title-text {
        font-size: 1.5rem; /* SP版ではより小さく */
    }
        
    .blog-detail-content {
        font-size: 1rem;
    }
        
    /* カルーセルボタンのモバイル対応 */
    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .carousel-prev {
        left: 10px;
    }
    
    .carousel-next {
        right: 10px;
    }
    
    .carousel-indicator {
        width: 10px;
        height: 10px;
    }
    
    /* ブログ一覧へ戻るリンクのモバイル対応 */
    .back-to-list-bottom .back-to-list {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .carousel-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .carousel-prev {
        left: 8px;
    }
    
    .carousel-next {
        right: 8px;
    }
    
    .back-to-list-bottom .back-to-list {
        font-size: 0.95rem;
    }
}
