/* 基本リセット */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ヘッダー */
.header {
    background: #222;
    color: #fff;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo img {
    height: 40px;
    width: auto;
}

.main-nav ul {
    list-style: none;
    display: flex;
}

.main-nav ul li {
    margin-left: 20px;
}

.main-nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.main-nav ul li a:hover {
    color: #007bff;
}

/* 会員登録ボタン */
.btn {
    display: inline-block;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.btn-primary {
    background-color: #007bff;
    color: #fff;
    border: none;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-cta {
    background-color: #28a745;
    color: #fff;
    padding: 12px 25px;
    font-size: 1.1em;
    border: none;
}

.btn-cta:hover {
    background-color: #218838;
}

.btn-secondary {
    background-color: #6c757d;
    color: #fff;
    border: none;
    margin: 5px;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* ヒーローセクション */
.hero {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url(/images/musicfs-lp04-hero.png) no-repeat center center/cover;
    color: #fff;
    text-align: center;
    padding: 80px 20px; /* 左右のパディングを維持 */
    margin-bottom: 30px;
    width: 100%; /* 画面幅いっぱいに広げる */
}

.hero h1 {
    font-size: 2.5em;
    margin-bottom: 15px;
}

.hero p {
    font-size: 1.2em;
    margin-bottom: 30px;
}

/* 各セクション */
.section {
    background: #fff;
    padding: 30px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow: hidden; /* コンテンツがはみ出さないようにする */
}

.section h2 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.8em;
    color: #333;
}

/* Swiper スライダー */
.music-slider {
    width: 100%; /* 親要素の幅いっぱいに設定 */
    margin: 0; /* マージンをリセット */
    height: auto;
    padding: 10px 0 30px;
    position: relative;
    overflow: hidden; /* スライダー自体のコンテンツがはみ出さないように */
}

/* スライドアイテム */
.music-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px; /* アイテム内のパディングを調整 */
}

/* 画像リンク */
.music-item .image-link {
    display: block; /* リンクが画像全体を覆うように */
    width: 100%;
    max-width: 120px;
    margin-bottom: 8px;
}

.music-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    object-fit: cover; /* 画像の比率を保ちつつボックスに収める */
    aspect-ratio: 1 / 1; /* 正方形を維持 */
}

.music-item .item-info {
    text-align: center;
    width: 100%;
    max-width: 120px; /* 画像の幅に合わせて調整 */
}

/* テキストリンクのスタイル */
.music-item .text-link,
.ranking-item .text-link {
    display: block; /* テキスト全体がリンクになるように */
    color: inherit; /* 親要素の色を継承 */
    text-decoration: none; /* 下線を削除 */
}

.music-item .item-info h3 { /* 曲のタイトル */
    font-size: 0.9em; /* タイトルのフォントサイズを調整 */
    font-weight: bold;
    margin-bottom: 3px;
    color: #333; /* リンクの色ではなく、通常のテキスト色 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-item .item-info .artist-name { /* アーティスト名 */
    font-size: 0.8em; /* アーティスト名のフォントサイズを調整 */
    color: #555; /* リンクの色ではなく、通常のテキスト色 */
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-item .item-info .song-description { /* 楽曲説明 */
    font-size: 0.7em; /* 説明文のフォントサイズを調整 */
    color: #777; /* リンクの色ではなく、通常のテキスト色 */
    line-height: 1.3; /* 行間を調整 */
    height: 3.9em; /* 3行分の高さ (1.3 * 3 = 3.9em) */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

/* Swiper ページネーション */
.swiper-pagination {
    position: absolute;
    bottom: 5px !important;
    left: 0;
    width: 100%;
    text-align: center;
}

.swiper-pagination-bullet-active {
    background: #007bff !important;
}

/* Swiper ナビゲーションボタン */
.swiper-button-next,
.swiper-button-prev {
    color: #007bff !important;
    transform: scale(0.7);
    top: calc(50% - 30px) !important; /* 画像と情報ブロックの間に配置するため、少し上に調整 */
    margin-top: 0 !important;
    z-index: 10;
    width: 30px !important;
    height: 30px !important;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.swiper-button-prev {
    left: 5px !important; /* 左端から少し内側に */
}

.swiper-button-next {
    right: 5px !important; /* 右端から少し内側に */
}


/* ランキングバナー */
.ranking-banner {
    text-align: center;
    margin-bottom: 20px;
}

.ranking-banner img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* ランキンググリッド */
.ranking-grid {
    display: grid;
    gap: 15px;
}

.ranking-item {
    display: flex;
    align-items: center;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: transform 0.2s ease;
}

.ranking-item:hover {
    transform: translateY(-3px);
}

.ranking-item .rank-number {
    font-size: 2em;
    font-weight: bold;
    color: #333;
    margin-right: 15px;
    width: 40px;
    text-align: center;
}

/* トップ3のランキング番号のスタイル */
.ranking-item:nth-child(1) .rank-number {
    color: #FFD700; /* ゴールド */
}
.ranking-item:nth-child(2) .rank-number {
    color: #C0C0C0; /* シルバー */
}
.ranking-item:nth-child(3) .rank-number {
    color: #CD7F32; /* ブロンズ */
}


.ranking-item .image-link { /* ランキング内の画像リンク */
    display: block;
    width: 60px;
    height: 60px;
    border-radius: 5px;
    margin-right: 15px;
    overflow: hidden; /* 画像がはみ出さないように */
}

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

.ranking-item .item-details {
    flex-grow: 1; /* 残りのスペースを埋める */
}

.ranking-item .item-details h3 {
    font-size: 1.1em;
    margin-bottom: 5px;
    color: #333;
}

.ranking-item .item-details p {
    font-size: 0.9em;
    color: #666;
}


/* ユーザーオプション (以前のコードは削除またはコメントアウト) */
/* 新しいユーザーメニューナビゲーション */
.user-menu-nav ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    padding: 0;
    margin: 0;
}

.user-menu-nav ul li {
    text-align: center;
}

.btn-menu {
    display: block;
    background-color: #f0f0f0;
    color: #333;
    padding: 12px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease;
    border: 1px solid #ddd;
}

.btn-menu:hover {
    background-color: #e0e0e0;
    color: #007bff;
    border-color: #007bff;
}

/* フッター */
.footer {
    background: #222;
    color: #fff;
    text-align: center;
    padding: 20px 0;
    margin-top: 30px;
}

/* ハンバーガーメニュー */
.menu-toggle {
    display: none; /* デスクトップでは非表示 */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    position: relative;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #fff;
    margin: 5px 0;
    transition: all 0.3s ease;
}

/* スマートフォンでのレスポンシブデザイン */
@media (max-width: 768px) {
    .header .container {
        flex-wrap: nowrap;
    }

    .main-nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 70%;
        height: 100%;
        background-color: #333;
        padding-top: 60px;
        transition: left 0.3s ease;
        z-index: 999;
    }

    .main-nav.active {
        left: 0;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-nav ul li {
        margin: 15px 0;
        width: 100%;
        text-align: left;
    }

    .main-nav ul li a {
        display: block;
        padding: 10px 20px;
    }

    .menu-toggle {
        display: block;
    }

    /* ハンバーガーメニューのアニメーション */
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.active span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    .hero {
        padding: 60px 15px;
    }

    .hero h1 {
        font-size: 2em;
    }

    .hero p {
        font-size: 1em;
    }

    .section {
        padding: 20px 15px;
    }

    .section h2 {
        font-size: 1.5em;
        margin-bottom: 20px;
    }

    /* Swiper ナビゲーションボタンの位置調整 */
    .swiper-button-next,
    .swiper-button-prev {
        top: calc(50% - 30px) !important; /* スマートフォンでも同じロジックで調整 */
        transform: scale(0.5); /* さらに小さく */
    }
    .swiper-button-prev {
        left: 0 !important;
    }
    .swiper-button-next {
        right: 0 !important;
    }

    .music-item img {
        max-width: 100px; /* スマートフォンで画像をさらに小さく */
    }

    .music-item .item-info {
        max-width: 100px; /* スマートフォンで情報の幅も調整 */
    }

    .music-item .item-info h3 {
        font-size: 0.85em;
    }

    .music-item .item-info .artist-name {
        font-size: 0.75em;
    }

    .music-item .item-info .song-description {
        font-size: 0.65em;
        line-height: 1.2;
        height: 3.6em; /* 3行分の高さ (1.2 * 3 = 3.6em) */
    }

    .ranking-grid {
        grid-template-columns: 1fr; /* スマートフォンでは1列表示 */
    }

    .user-menu-nav ul {
        grid-template-columns: 1fr; /* スマートフォンでは1列表示 */
    }
}

/* 楽曲検索セクション */
#song-search .search-form {
    display: flex;
    max-width: 500px;
    margin: 0 auto 20px;
}

#song-search input[type="text"] {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px 0 0 5px;
    font-size: 1em;
}

#song-search button {
    padding: 10px 15px;
    border: 1px solid #007bff;
    background-color: #007bff;
    color: #fff;
    cursor: pointer;
    border-radius: 0 5px 5px 0;
    transition: background-color 0.3s ease;
    font-size: 1em;
}

#song-search button:hover {
    background-color: #0056b3;
}

.cont-search-jenre {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    padding: 0;
    margin: 0;
}

.cont-search-jenre li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f0f0f0;
    color: #333;
    padding: 12px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease;
    border: 1px solid #ddd;
}

.cont-search-jenre li a:hover {
    background-color: #e0e0e0;
    color: #007bff;
    border-color: #007bff;
}

.cont-search-jenre li a i {
    font-size: 0.8em;
    opacity: 0.7;
}

.hero-info-link {
    display: block; /* Make it a block element to take up its own line */
    margin-top: 15px; /* Add some space above it */
    color: #cccccc; /* Muted white/light gray color */
    font-size: 0.9em; /* Slightly smaller font size */
    text-decoration: underline; /* Keep it as a link */
    transition: color 0.3s ease;
}

.hero-info-link:hover {
    color: #ffffff; /* Lighter color on hover */
}