/*
    [brand-ranking-10.css]

    このファイルは、ブランドランキング iframeの中のソースに対する指定です。
    外側外側（=iframeタグ）への指定は、brand-ranking-wrap.css で行っています。
*/

/* --------------------
  ランキングのコンテンツ（iframe 内側です）

  スマホ719px以下、PC商品ページ720px以上の
  2つのメディアクエリが存在します。

  その際に、iframe内側はcontainerクエリで制御しています。

-------------------- */

/* コンテナクエリを適用する場合 ➝ トータルで考えると @mediaのほうが良いと判断 */ 
/* body {
    container-type: inline-size; 
} */

    .tb-p-brand-ranking {
        margin-left: auto;
        margin-right: auto;
    }

    .tb-p-brand-ranking-title {
        margin-top: var(--sp-3);
        text-align: center;
        font-size: var(--fz-140);
        font-weight: 600;
        font-family: "Hanken Grotesk", sans-serif;
        color: var(--gr-90);
    }

    /* ランキング のサブ見出し */
    .tb-p-brand-ranking-title--sub {
            display: block;
            margin: 0;
            line-height: 1;
            font-size: var(--fz-90);
            font-weight: 600;
            color: var(--gr-50);
            text-align: center;
    }

    .tb-p-brand-ranking-items li:nth-child(1)::before {
        content: "1";
        color: white;
        background-color: var(--gold);
    }
    
    .tb-p-brand-ranking-items li:nth-child(2)::before {
        content: "2";
        color: white;
        background-color: var(--silver);
    }
    
    .tb-p-brand-ranking-items li:nth-child(3)::before {
        content: "3";
        color: white;
        background-color: var(--bronze);
    }
    
    .tb-p-brand-ranking-items li:nth-child(4)::before {
        content: "4";
    }
    
    .tb-p-brand-ranking-items li:nth-child(5)::before {
        content: "5";
    }
    
    .tb-p-brand-ranking-items li:nth-child(6)::before {
        content: "6";
    }
    
    .tb-p-brand-ranking-items li:nth-child(7)::before {
        content: "7";
    }
    
    .tb-p-brand-ranking-items li:nth-child(8)::before {
        content: "8";
    }
    
    .tb-p-brand-ranking-items li:nth-child(9)::before {
        content: "9";
    }
    
    .tb-p-brand-ranking-items li:nth-child(10)::before {
        content: "10";
    }

.tb-p-brand-ranking-items li a {
    display: block;
    font-size: var(--fz-70);
    line-height: 1.3;
    text-align: center;
}

.tb-p-brand-ranking-items li a img {
    display: block;
    margin-bottom: var(--sp-3);
    border-radius: var(--rd-3);
}



/* コンテナクエリを適用したスタイル */
/* @container (max-width: 569px) { */

@media (max-width: 586px) {
        
    .tb-p-brand-ranking-items-wrap {
        margin-top: var(--sp-5);
        overflow-x: scroll;
    }
    
    .tb-p-brand-ranking-items {
        display: flex;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: flex-start;
        height: auto;
        display: -webkit-box;/* 横スクロールうまく行かないときのおまじない */
        margin-top: 2px;
    }
    
    .tb-p-brand-ranking-items li {
        display: block;
        margin-top: var(--sp-6);
        padding-top: var(--sp-4-5);
        padding-bottom: var(--sp-4);
        position: relative;
        width: 150px;
    }
    
    .tb-p-brand-ranking-items li + li {
        margin-left: var(--sp-4-5);
    }
    
    .tb-p-brand-ranking-items li:nth-child(n+6) {
        /* margin-top: 0; */ /* スマホは0にする */
        margin-top: var(--sp-6);
    }
    
    .tb-p-brand-ranking-items li:nth-child(1) {
        /* margin-left: 0; */
        margin-left: var(--sp-5);
    }

    /*
    .tb-p-brand-ranking-items li:nth-child(10) {
        margin-right: var(--sp-5);
    }
    */


    /* スマホだけ左に余白 */
    .tb-p-brand-ranking-items li:nth-child(1) {
        margin-left: var(--sp-5);
    }

    /* スマホだけ左に余白 */
    .tb-p-brand-ranking-items li:nth-child(11) {
        margin-left: var(--sp-5);
    }
    
    /* =====
        10位までランキングのとき * 横スクロールの先頭と最後尾の余白調整
        ハック的ですが、ある方が横スクロール完了時の右余白の仕上がりが
        （ブラウザを問わず）まだ妥協できるかなという状態になるので、
        nth-child(11)を設置しています。
    ===== */
    .tb-p-brand-ranking-items li:nth-child(11) {
        width: 1px;
    }

    
    .tb-p-brand-ranking-items li a:link,
    .tb-p-brand-ranking-items li a:visited,
    .tb-p-brand-ranking-items li a:hover,
    .tb-p-brand-ranking-items li a:active {
        text-decoration: none;
    }
    
    .tb-p-brand-ranking-items li::before {
        display: flex;
        justify-content: center;
        align-items: center;
        position: absolute;
        /* top: 0;
        left: 6px; */
        top: -25px;
        left: -16px;

        z-index: 10;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        content: "";
        line-height: 1;
        color: var(--gr-90);
        background-color: var(--gr-10);
        text-align: center;
        filter: drop-shadow(0px 2px 0px rgba(0,0,0,0.1));
    }
    
    /* =====
        10位までランキングのとき * 横スクロールの先頭と最後尾の余白調整
        ハック的ですが、ある方が横スクロール完了時の右余白の仕上がりが
        （ブラウザを問わず）まだ妥協できるかなという状態になるので、
        nth-child(11)を設置しています。
    ===== */
    .tb-p-brand-ranking-items li:nth-child(11)::before {
        display: none;
    }
    
  }
  

  /* ==============================

    商品ページ、ブランドページ等 幅720px 以上のとき

  ============================== */
  /* @container (min-width: 688px) { */
  /* @container (min-width: 720px) { */

  @media (min-width: 585px) {
    .tb-p-brand-ranking {
        width: 100%;
    }

    .tb-p-brand-ranking-title--sub {
        margin: var(--sp-1) 0 0;
    }

    .tb-p-brand-ranking-items-wrap {
        margin-top: 0;
        overflow: hidden;
    }

    .tb-p-brand-ranking-title {
        font-size: var(--fz-170);
        font-family: "Hanken Grotesk", serif;
    }

    .tb-p-brand-ranking-items {
        display: grid;
        gap: var(--sp-4) var(--sp-4-5);
        grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
        justify-content: space-between;
        height: auto;
        margin-top: var(--sp-8);
        margin-left: var(--sp-6);
    }

    .tb-p-brand-ranking-items li {
        padding-bottom: 0;
        width: initial;
        position: relative;
    }

    .tb-p-brand-ranking-items li::before {
        /*
        top: 0;
        left: 5px;
        width: 36px;
        height: 36px;
        font-size: var(--fz-90);
 */

        display: flex;
        justify-content: center;
        align-items: center;
        position: absolute;
        /* top: 0;
        left: 6px; */
        top: -35px;
        left: -16px;

        z-index: 10;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        content: "";
        line-height: 1;
        color: var(--gr-90);
        background-color: var(--gr-10);
        text-align: center;
        filter: drop-shadow(0px 2px 0px rgba(0,0,0,0.1));
    }

    .tb-p-brand-ranking-items li:nth-child(1) {
        margin-left: 0!important;
    }

    .tb-p-brand-ranking-items li:nth-child(n+6) {
        /* margin-top: 0; */ /* スマホは0にする */
        margin-top: var(--sp-7-5);
    }

    /* =====
        10位までランキングのとき * 横スクロールの先頭と最後尾の余白調整
        ハック的ですが、ある方が横スクロール完了時の右余白の仕上がりが
        （ブラウザを問わず）まだ妥協できるかなという状態になるので、
        nth-child(11)を設置しています。
    ===== */
    .tb-p-brand-ranking-items li:nth-child(11) {
        display: none;
    }

    .tb-p-brand-ranking-items li + li {
        margin-left: 0;
    }

    .tb-p-brand-ranking-items li a:hover,
    .tb-p-brand-ranking-items li a:active {
        opacity: .8;
    }
}
