/* ホームページのスタイル - 統一デザインルール適用 */

.homepage {
    min-height: 100vh;
    background: linear-gradient(135deg, #E3F2FD 0%, #FFFFFF 50%, #E0F7FA 100%);
}

/* セクション共通スタイル */
.content-section {
    margin-bottom: 80px;
    padding: 40px 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(142, 238, 231, 0.3);
}

.section-title {
    font-size: 2rem;
    font-weight: 300;
    color: #0096C7;
    letter-spacing: 2px;
    margin: 0;
}

.view-more-link {
    color: #48CAE4 !important;  /* 白ではなく、見やすい青色に */
    text-decoration: none;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.95);  /* 白背景で視認性向上 */
    border: 1px solid rgba(72, 202, 228, 0.3);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(72, 202, 228, 0.15);
}

.view-more-link:hover {
    color: white !important;
    background: linear-gradient(135deg, #48CAE4, #8eeee7);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(72, 202, 228, 0.3);
    border-color: transparent;
}

/* Netflix風カルーセル実装 - 完全リセット版 */
.netflix-carousel {
    width: 100%;
    overflow: visible; /* バッジが見切れないように visible に変更 */
    position: relative;
    box-sizing: border-box;
    padding: 0 5px; /* 左右に少しパディングを追加 */
}

.netflix-carousel .carousel-inner {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    gap: 5px;
    padding: 3px;
    width: 100% !important;
    box-sizing: border-box !important;
    position: relative !important;
}

/* スクロールバー */
.carousel-inner::-webkit-scrollbar {
    height: 8px;
}

.carousel-inner::-webkit-scrollbar-track {
    background: rgba(142, 238, 231, 0.1);
    border-radius: 4px;
}

.carousel-inner::-webkit-scrollbar-thumb {
    background: rgba(72, 202, 228, 0.5);
    border-radius: 4px;
}

.carousel-inner::-webkit-scrollbar-thumb:hover {
    background: rgba(72, 202, 228, 0.7);
}

/* カルーセルアイテム - 位置を強制リセット */
.netflix-carousel .carousel-item {
    flex: 0 0 300px !important;
    width: 300px !important;
    min-width: 300px !important;
    max-width: 300px !important;
    scroll-snap-align: start !important;
    display: block !important;
    position: relative !important;
    float: none !important;
    margin: 0 !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
}

/* 日記カードはバッジ用に上部パディングを追加 */
.netflix-carousel .diary-card {
    padding-top: 15px !important; /* バッジが見切れないように */
}

.card-content {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 20px;
    height: 100%;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(72, 202, 228, 0.2);
    box-shadow: 0 4px 15px rgba(0, 150, 199, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.card-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 150, 199, 0.2);
}

.card-image {
    width: 100%;
    height: 180px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #E3F2FD, #E0F7FA);
    flex-shrink: 0;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block !important;
    opacity: 1 !important;
}

.card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0096C7;
    margin-bottom: 8px;
    line-height: 1.3;
}

.card-date {
    font-size: 0.9rem;
    color: #48CAE4;
    margin-bottom: 10px;
}

.card-excerpt {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
    margin-bottom: auto;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-link {
    display: inline-block;
    color: #0096C7;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 10px 16px;
    border: 1px solid rgba(0, 150, 199, 0.3);
    border-radius: 8px;
    margin-top: 15px;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.card-link:hover {
    background: rgba(0, 150, 199, 0.1);
    transform: translateY(-1px);
}

/* 小浜島日記セクション */
.diary-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    margin: 40px 20px;
    overflow: visible; /* バッジが見切れないように */
}

/* プレースホルダー画像のスタイル */
.card-image.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #E3F2FD 0%, #E0F7FA 100%);
}

.placeholder-icon {
    opacity: 0.6;
}

.no-content, .no-posts {
    text-align: center;
    padding: 40px;
    color: #48CAE4;
    opacity: 0.7;
}

.btn-post {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, #8eeee7, #48CAE4);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-post:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(72, 202, 228, 0.3);
}

/* つちだきくおのつぶやきセクション - 他セクションと統一デザイン */
.tsuchida-daily-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    margin: 40px 20px;
}

/* イベントスケジュールセクション */
.events-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    margin: 40px 20px;
}

/* 作品一覧セクション */
.works-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    margin: 40px 20px;
}

.tsuchida-daily-section .section-title {
    font-size: 2rem;
    font-weight: 300;
    color: #0096C7;
    letter-spacing: 2px;
    margin: 0;
}

/* つぶやきセクションは標準のcard-*スタイルを使用（CSS削除済み） */

/* アニメーション */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* モバイル対応 - 1件表示 + インジケーター */
@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        margin-bottom: 15px;
        padding-bottom: 8px;
    }

    .section-title {
        font-size: 1.3rem;
        letter-spacing: 1px;
    }

    .view-more-link {
        font-size: 0.8rem;
        padding: 5px 12px;
    }

    /* モバイルでは1件表示のカルーセル */
    .netflix-carousel {
        position: relative;
        overflow: hidden;
        padding: 0 20px; /* 左右にパディング */
    }

    .netflix-carousel .carousel-inner {
        display: flex !important;
        flex-direction: row !important;
        gap: 0 !important;
        transition: transform 0.3s ease;
        width: auto !important;
        overflow: visible !important;
        padding: 0 !important;
    }

    .netflix-carousel .carousel-item {
        flex: 0 0 100% !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }

    .card-content {
        padding: 20px !important;
        min-height: 300px !important;
        margin: 0 10px !important;
        border-radius: 16px !important;
    }

    .card-image {
        height: 150px !important;
        margin-bottom: 15px !important;
        border-radius: 12px !important;
    }

    .card-title {
        font-size: 1.1rem !important;
        margin-bottom: 8px !important;
        line-height: 1.3 !important;
        display: block !important;
        -webkit-line-clamp: unset !important;
        overflow: visible !important;
    }

    .card-date {
        font-size: 0.9rem !important;
        margin-bottom: 10px !important;
    }

    .card-excerpt {
        display: block !important;
        font-size: 0.85rem !important;
        line-height: 1.4 !important;
        margin-bottom: 15px !important;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .card-link {
        font-size: 0.9rem !important;
        padding: 10px 20px !important;
        margin-top: 10px !important;
        border-radius: 8px !important;
    }

    /* モバイル用インジケーター */
    .mobile-carousel-indicators {
        display: flex !important;
        justify-content: center;
        align-items: center;
        gap: 8px;
        margin-top: 20px;
        padding: 10px 0;
    }

    .mobile-carousel-indicators .indicator {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: rgba(142, 238, 231, 0.3);
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .mobile-carousel-indicators .indicator.active {
        background: linear-gradient(135deg, #8eeee7 0%, #5fd4cd 100%);
        transform: scale(1.2);
        box-shadow: 0 2px 8px rgba(142, 238, 231, 0.4);
    }

    .mobile-carousel-indicators .indicator:hover {
        background: rgba(142, 238, 231, 0.6);
        transform: scale(1.1);
    }


    .content-section {
        margin-bottom: 30px;
        padding: 20px 0;
    }

    .diary-section,
    .tsuchida-daily-section,
    .events-section,
    .works-section {
        margin: 20px 10px;
    }
}

/* デスクトップでは通常のカルーセル */
@media (min-width: 769px) {
    .mobile-carousel-indicators {
        display: none !important;
    }

}

@media (max-width: 480px) {
    /* 小さい画面でのカルーセル調整 */
    .card-content {
        padding: 15px !important;
        min-height: 250px !important;
        margin: 0 5px !important;
    }

    .card-image {
        height: 120px !important;
    }

    .card-title {
        font-size: 1rem !important;
    }

    .card-date {
        font-size: 0.8rem !important;
    }

    .card-excerpt {
        font-size: 0.8rem !important;
        -webkit-line-clamp: 2;
    }

    .card-link {
        font-size: 0.8rem !important;
        padding: 8px 16px !important;
    }

    .container {
        padding: 0 5px;
    }

    .section-title {
        font-size: 1.1rem;
    }

    .diary-section,
    .tsuchida-daily-section,
    .events-section,
    .works-section {
        margin: 15px 5px;
        padding: 15px 5px;
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    .homepage {
        background: linear-gradient(135deg, #0a0e27 0%, #151b3d 50%, #0a0e27 100%) !important;
    }

    .diary-section {
        background: rgba(0, 0, 0, 0.2) !important;
    }

    .card-content {
        background: rgba(20, 30, 50, 0.95) !important;
        border-color: rgba(176, 224, 230, 0.2) !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5) !important;
    }

    .diary-entry {
        background: rgba(0, 0, 0, 0.3) !important;
        border-color: rgba(176, 224, 230, 0.2) !important;
    }

    .card-image.no-image {
        background: linear-gradient(135deg, #1a2547, #0f1837) !important;
    }

    .card-link {
        color: #B0E0E6 !important;
        border-color: rgba(176, 224, 230, 0.3) !important;
    }

    .card-link:hover {
        background: rgba(176, 224, 230, 0.1) !important;
        color: #E0FFFF !important;
    }

    .card-excerpt {
        color: #c0c0c0 !important;
    }

    .hero-subtitle,
    .section-title,
    .entry-title,
    .card-title {
        color: #B0E0E6;
    }

    .hero-description,
    .card-date,
    .entry-meta {
        color: #E0FFFF;
    }

    .view-more-link {
        color: #E0FFFF;
        background: rgba(224, 255, 255, 0.1);
    }

    .view-more-link:hover {
        background: rgba(224, 255, 255, 0.2);
    }
}

/* カードクリック可能スタイル */
.carousel-item {
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.carousel-item:hover {
    transform: translateY(-5px);
}

.card-content {
    position: relative;
}

/* クリック可能であることを示すvisual feedback */
.carousel-item:active {
    transform: translateY(-2px);
}

/* 回数バッジ（ホームページ用） */
.diary-number-badge-home {
    position: absolute;
    top: 5px;  /* -12px から 5px に変更してカード内に収める */
    right: 10px;
    z-index: 10;
    background: linear-gradient(135deg, #8eeee7 0%, #5fd4cd 100%);
    padding: 6px 12px;
    border-radius: 20px;
    box-shadow: 0 3px 10px rgba(95, 212, 205, 0.3);
    display: flex;
    align-items: baseline;
    gap: 2px;
    transition: all 0.3s ease;
}

.carousel-item:hover .diary-number-badge-home {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 5px 15px rgba(95, 212, 205, 0.4);
}

.diary-number-badge-home .number-prefix,
.diary-number-badge-home .number-suffix {
    font-size: 0.75rem;
    font-weight: 500;
    color: #fff;
    opacity: 0.9;
}

.diary-number-badge-home .number-value {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin: 0 1px;
}

/* ダークモードでのバッジ */
@media (prefers-color-scheme: dark) {
    .diary-number-badge-home {
        background: linear-gradient(135deg, #2a6b75 0%, #1a4a52 100%);
        box-shadow: 0 3px 10px rgba(72, 202, 228, 0.3);
    }

    .carousel-item:hover .diary-number-badge-home {
        box-shadow: 0 5px 15px rgba(72, 202, 228, 0.4);
    }
}

/* モバイル対応 - より具体的なセレクタで優先度を上げる */
@media (max-width: 768px) {
    .homepage .diary-section .diary-number-badge-home {
        top: 8px !important;
        right: 8px !important;
        padding: 4px 8px !important;
        border-radius: 12px !important;
        transform: scale(1.0) !important; /* サイズを通常に戻す */
        background: linear-gradient(135deg, #48CAE4 0%, #8eeee7 100%) !important; /* 続きを読むボタンと完全一致 */
        box-shadow: 0 2px 8px rgba(72, 202, 228, 0.4) !important;
        border: 1px solid rgba(255, 255, 255, 0.3) !important; /* 白い縁を追加 */
    }

    .homepage .diary-section .diary-number-badge-home .number-prefix,
    .homepage .diary-section .diary-number-badge-home .number-suffix {
        font-size: 0.7rem !important; /* より大きく */
        font-weight: 600 !important;
        color: #fff !important;
        opacity: 1 !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
    }

    .homepage .diary-section .diary-number-badge-home .number-value {
        font-size: 0.9rem !important; /* より大きく */
        font-weight: 800 !important;
        color: #fff !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
    }
}

@media (max-width: 480px) {
    .homepage .diary-section .diary-number-badge-home {
        top: 6px !important;
        right: 6px !important;
        padding: 3px 6px !important;
        border-radius: 10px !important;
        transform: scale(0.9) !important; /* 小さい画面でも十分なサイズ */
        background: linear-gradient(135deg, #48CAE4 0%, #8eeee7 100%) !important;
        box-shadow: 0 2px 6px rgba(72, 202, 228, 0.4) !important;
        border: 1px solid rgba(255, 255, 255, 0.3) !important;
    }

    .homepage .diary-section .diary-number-badge-home .number-prefix,
    .homepage .diary-section .diary-number-badge-home .number-suffix {
        font-size: 0.6rem !important; /* より読みやすいサイズ */
        font-weight: 600 !important;
        color: #fff !important;
        opacity: 1 !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
    }

    .homepage .diary-section .diary-number-badge-home .number-value {
        font-size: 0.75rem !important; /* より読みやすいサイズ */
        font-weight: 800 !important;
        color: #fff !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
    }
}