.footer {
    background-color: #002C6C;
    padding: 60px 40px 0 40px;
    font-family: "BIZ UDPGothic", sans-serif;
}

.footer-container {
    margin: 0 auto;
    background-color: #FFFFFF;
    border-top-left-radius: 20px;
    border-top-right-radius: 80px;
    padding: 80px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* ロゴエリア */
.footer-logo-area {
    margin-bottom: 40px;
}

.footer-title {
    font-size: 104px;
    font-weight: 700;
    line-height: 100%;
    letter-spacing: -2px;
    color: #002C6C;
    margin: 0;
    width: 80%;
}

.footer-title span {
    display: inline;
}

/* 区切り線 */
.footer-divider {
    width: 100%;
    height: 1px;
    background-color: rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

/* メニュータイトル */
.menu-title {
    font-size: 48px;
    font-weight: 700;
    color: #000000;
    margin: 0 0 40px 0;
}

/* フッターグリッド - ヘッダーと全く同じスタイル */
.footer-grid {
    width: 100%;
    max-width: 1200px;
    height: auto;
    min-height: 340px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2%;
    position: relative;
}

/* カラム設定 */
.footer-column {
    position: relative;
    height: auto;
    min-height: 340px;
    display: flex;
    flex-direction: column;
}

/* カラム区切り線 - ヘッダーと同じ */
.footer-category::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    height: 80%;
    width: 1px;
    background-color: rgba(0, 0, 0, 0.1);
}

.footer-column:nth-child(4) .footer-category::after {
    display: none;
}

/* カテゴリーセクション */
.footer-category {
    display: flex;
    flex-direction: column;
    position: relative;
}

.footer-category:last-child {
    margin-bottom: 0;
}

/* 同じ列内の第1カテゴリーの高さを揃える */
.footer-column:nth-child(1) .footer-category:nth-child(1),
.footer-column:nth-child(2) .footer-category:nth-child(1),
.footer-column:nth-child(3) .footer-category:nth-child(1),
.footer-column:nth-child(4) .footer-category:nth-child(1) {
    flex: 0.8;
}

/* 同じ列内の第2カテゴリーの高さを揃える */
.footer-column:nth-child(1) .footer-category:nth-child(2),
.footer-column:nth-child(2) .footer-category:nth-child(2),
.footer-column:nth-child(3) .footer-category:nth-child(2) {
    flex: 0.8;
}

/* カテゴリータイトル */
.footer-category-title {
    font-family: "BIZ UDPGothic", sans-serif !important;
    font-size: 24px;
    font-weight: 700;
    line-height: 100%;
    color: #002C6C;
    margin: 0 0 20px 0;
}

/* サブカテゴリー */
.footer-subcategory {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-subcategory li {
    margin-bottom: 0;
}

.footer-subcategory li:last-child {
    margin-bottom: 0;
}

.footer-subcategory a {
    font-family: "Noto Sans JP", sans-serif !important;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.5);
    text-decoration: none;
    align-items: center;
    position: relative;
    padding-right: 16px; /* 矢印用のスペース確保 */
}

/* シェブロン（矢印）のスタイル */
.footer-subcategory a::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    width: 7px;
    height: 7px;
    border-top: 0.8px solid #000000;
    border-right: 0.8px solid #000000;
    transform: translateY(-50%) rotate(45deg);
}

/* フッターボトム - SNSアイコンとコピーライト */
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sns-links {
    display: flex;
    gap: 16px;
}

.sns-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.sns-icon img {
    width: 32px;
    height: 32px;
}

.copyright {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.5);
    font-weight: 400;
}

/* トップに戻るボタン */
.back-to-top {
    position: absolute;
    top: 80px;
    right: 80px;
    width: 48px;
    height: 48px;
    background-color: #002C6C;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: transform 0.2s ease;
}

.back-to-top svg {
    width: 18px;
    height: 18px;
}

.back-to-top:hover {
    transform: scale(1.1);
}

.back-to-top:active {
    transform: scale(0.95);
}

/* 音符スタイル */
.footer-notes {
    top: 0;
    left: 0;
    width: 50%;
    height: 50%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.note {
    position: absolute;
}

.note1 {
    top: 7%;
    right: 30%;
    width: 7%;
}

.note2 {
    top: 12%;
    right: 15%;
    width: 7%;
}

.note3 {
    top: 30%;
    right: 3%;
    width: 11%;
}

/* トップに戻るボタンのz-indexを調整 */
.back-to-top {
    z-index: 110; /* 音符より前面に表示 */
}



@media (max-width: 1100px) {

    .footer-subcategory a {
        font-size: 8px;
    }

    .footer-title {
        font-size: 80px;
    }
}

/* フッターのレスポンシブ対応（768px以下） */
@media (max-width: 768px) {
    .footer {
        padding: 0 10px 0;
    }

    .footer-title {
        font-size: 48px;
        line-height: 1.2;
    }
    
    .footer-column:nth-child(1) .footer-category:nth-child(1),
    .footer-column:nth-child(2) .footer-category:nth-child(1),
    .footer-column:nth-child(3) .footer-category:nth-child(1),
    .footer-column:nth-child(4) .footer-category:nth-child(1) {
        flex: 0;
    }

    .footer-column:nth-child(1) .footer-category:nth-child(2),
    .footer-column:nth-child(2) .footer-category:nth-child(2),
    .footer-column:nth-child(3) .footer-category:nth-child(2) {
        flex: 0;
    }

    .footer-column {
        min-height: 0;
    }

    .footer-title span {
        display: block; /* 各要素を改行させる */
    }
    
    .footer-title .sony {
        margin-bottom: 5px;
    }
    
    .footer-title .music {
        margin-bottom: 5px;
    }

    .footer-container {
        margin: 0;
        padding: 40px 20px;
        border-top-right-radius: 40px;
    }

    .footer-logo-area {
        margin-bottom: 20px;
    }

    /* ロゴエリア */
    .footer-title {
        font-size: 48px;
        line-height: 1.2;
    }

    /* 区切り線 */
    .footer-divider {
        margin-bottom: 0;
    }

    .footer-column:last-child .footer-category:last-child {
        border-bottom: none;
    }

    /* メニュータイトル */
    .menu-title {
        font-size: 32px;
        margin: 0;
        text-align: center;
    }

    /* グリッドレイアウトを1カラムに変更 */
    .footer-grid {
        display: block;
    }

     /* 区切り線を非表示 */
     .footer-grid::before,
     .footer-grid::after,
     .footer-column:nth-child(3)::after {
         display: none;
     }

    /* カラム設定 */
    .footer-column {
        margin-bottom: 0;
    }

    /* カテゴリーセクション */
    .footer-category {
        padding: 15px 0;
        border-bottom: 1px solid #e5e5e5;
    }

    /* カテゴリータイトル */
    .footer-category-title {
        font-size: 20px;
        margin: 0 0 10px 0;
    }

    /* サブカテゴリー */
    .footer-subcategory li {
        margin-bottom: 5px;
        padding-bottom: 5px;
        position: relative;
    }

    .footer-subcategory li:not(:last-child):after {
        display: none;
    }

    .footer-category::after {
        display: none;
    }

    .footer-subcategory li:last-child {
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .footer-subcategory a {
        font-size: 14px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    /* フッターボトム - SNSアイコンとコピーライト */
    .footer-bottom {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
        padding-top: 20px;
    }

    /* 音符スタイル - 巨大化させて右側に隠れるように */
    .footer-notes {
        top: 0;
        right: -10%;
        width: 80%;
        height: 40%;
        pointer-events: none;
    }

    .note1 {
        display: none;
        overflow: none;
    }

    .note2 {
        top: -5%;
        right: 25%;
        width: 20%;
        overflow: none;
    }

    .note3 {
        top: 20%;
        right: 5%;
        width: 28%;
    }

    /* トップに戻るボタン位置調整 */
    .back-to-top {
        top: 40px;
        right: 40px;
        width: 40px;
        height: 40px;
    }

    .back-to-top svg {
        width: 16px;
        height: 16px;
    }

    /* SNSリンク更新 */
    .sns-links {
        display: flex;
        gap: 16px;
    }

    .sns-icon {
        width: 32px;
        height: 32px;
    }
}


/* 音符スタイルの基本設定 - 修正版 */
.footer-notes {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.note {
    position: absolute;
    transition: all 0.3s ease; /* 画面サイズ変更時のスムーズな移動のため */
}

@media (min-width: 768px) {
    .footer-title .sony,
    .footer-title .music {
      display: inline;
    }
    .footer-title .foundation {
      display: block;
    }
  }
  

/* デスクトップサイズ (1200px以上) */
@media (min-width: 1200px) {
    .note1 {
        top: 7%;
        right: 30%;
        width: 7%;
    }
    
    .note2 {
        top: 12%;
        right: 15%;
        width: 7%;
    }
    
    .note3 {
        top: 30%;
        right: 3%;
        width: 11%;
    }
}

/* 中間サイズ (768px〜1199px) */
@media (min-width: 768px) and (max-width: 1199px) {
    .note1 {
        top: -10%;
        right: 25%;
        width: 15%;
    }
    
    .note2 {
        top: 10%;
        right: 10%;
        width: 15%;
    }
    
    .note3 {
        top: 25%;
        right: -10%;
        width: 25%;
    }
    
    /* Sony Musicロゴを音符との重なりから保護 */
    .footer-title {
        position: relative;
        z-index: 2; /* 音符よりも前面に表示 */
    }
}

/* モバイルサイズ (767px以下) - スマホ対応 */
@media (max-width: 767px) {
    .footer-notes {
        top: 0;
        right: -10%;
        width: 100%;
        height: 50%;
    }
    
    .note1 {
        display: none;
    }
    
    .note2 {
        top: 0;
        right: 20%;
        width: 30%;
    }
    
    .note3 {
        top: 35%;
        right: -10%;
        width: 40%;
    }
    
    /* 白背景からはみ出た部分を隠す */
    .footer-container {
        overflow: hidden;
        position: relative;
    }

    .footer-grid {
        display: flex !important;
        flex-direction: column;
      }
    
      /* .footer-column の箱を消して、子要素(.footer-category)を親(.footer-grid)直下に見せる */
      .footer-column {
        display: contents; /* これにより .footer-category がフレックスアイテム化する */
      }
    

    /* ここでカテゴリーごとに順序を指定する */
  .category-aboutus {
    order: 1;
  }
  .category-forkids {
    order: 2;
  }
  .category-news {
    order: 3;
  }
  .category-competition {
    order: 4;
  }
  .category-concert {
    order: 5;
  }
  .category-fund {
    order: 6;
  }
  .category-others {
    order: 7;
  }

  .category-competition {
    border-bottom: 1px solid #e5e5e5 !important; 
  }

  .category-others {
    border-bottom: none !important;
  }
}