@charset "utf-8";

/* =========================================================
    温泉・施設（page-onsen-facility.php）
    ・見出し・写真ギャラリー・項目の枠・白背景は style.css の「下層ページ 共通」。ここは温泉・施設だけの部品と間隔
    ・文字は rem（カンプ「標準」= 1rem 16px。コメントにカンプの px を併記）
    ・文字と文字まわりの余白は rem、ボタン・枠の padding は em（その要素の文字の大きさ基準）、画像・写真どうしの間・線・角丸は px（数字の横にカンプの px を併記）
    ・767px 以下が SP
========================================================= */
/* ページの見出しの後ろの和柄はこのページ用の画像（位置・大きさは style.css の .sub-page） */
.onsen.sub-page {
    background-image: url(../img/common/bg-onsen.webp);
}

.onsen-list {
    margin-top: 13.9375rem; /* 223px */
}

/* ---------- 大浴場 ---------- */
.onsen .photo-gallery {
    margin-top: 2.9375rem; /* 47px */
}

/* 大きい写真の左下の札（男湯・女湯）：黒い帯の右端を斜めに切る（上 131px・下 158px、高さ 45px、写真の下から 35px）
    文字が大きくなったら帯が横・縦に伸びる */
.onsen-bath-label {
    position: absolute;
    left: 0;
    bottom: 35px;
    display: flex;
    align-items: center;
    min-height: 2.8125rem; /* 45px */
    padding: 0 2.3077em 0 1.5385em; /* 0 60px 0 40px */
    background: var(--text);
    color: var(--white);
    font-size: 1.625rem; /* 26px */
    line-height: 1.4;
    letter-spacing: 0.1em;
    clip-path: polygon(0 0, calc(100% - 27px) 0, 100% 100%, 0 100%);
}

.onsen-bath .sub-text {
    margin-top: 2.125rem; /* 34px */
}

.onsen .spec-list {
    margin-top: 1.4375rem; /* 23px */
}

/* 脱衣所・洗面台（2 列）：写真（590×390px）の下に名前 */
.onsen-photos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 3.5625rem; /* 57px */
}

.onsen-photos img {
    border-radius: 27.6px;
    background: var(--sub-frame);
    aspect-ratio: 591 / 391;
}

/* 写真の下の名前（脱衣所・洗面台・館内施設 共通） */
.onsen-photo-name {
    margin-top: 0.9375rem; /* 15px */
    font-size: 1.125rem; /* 18px */
    line-height: 1.4;
    text-align: center;
}

/* ---------- 家族湯 ---------- */
.onsen-family {
    margin-top: 7.9375rem; /* 127px */
}

/* 入口の写真（1200×500px） */
.onsen-family-main {
    margin-top: 2.9375rem; /* 47px */
}

.onsen-family-main img {
    border-radius: 27.6px;
    background: var(--sub-frame);
    aspect-ratio: 1200 / 500;
}

.onsen-family .sub-text {
    margin-top: 2.0625rem; /* 33px */
}

.onsen-family-note {
    font-weight: 500;
}

/* 4 つを 2 列に。それぞれ上に名前のタブ、下に写真（590×390px） */
.onsen-family-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 63px 20px;
    margin-top: 3.8125rem; /* 61px */
}

/* 名前のタブ（400×57.3px。写真の幅に対する比率で縮む。名前が入りきらないときは写真の幅まで広げる） */
.onsen-family-name {
    display: flex;
    justify-content: center;
    align-items: center;
    width: fit-content;
    min-width: 67.8%;
    max-width: 100%;
    min-height: 3.5812rem; /* 57.3px */
    margin: 0 auto;
    padding: 0.2em 0.5em;
    border-radius: 20px 20px 0 0;
    background: var(--dark);
    color: var(--white);
    font-family: var(--Mincho);
    font-size: 1.5rem; /* 24px */
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
}

/* 写真 3 枚を重ねて、表示中だけ出す（.photo-gallery-photo：style.css） */
.onsen-family-slider {
    position: relative;
    overflow: hidden;
    border-radius: 27.6px;
    background: var(--sub-frame);
    aspect-ratio: 590 / 390;
}

/* 枠の端の丸め誤差で隙間が出ないよう、画像を中央から少しはみ出させる */
.onsen-family-slider img.photo-gallery-photo {
    inset: -0.5% auto auto -0.5%;
    width: 101%;
    height: 101%;
}

/* 写真の下のバー：表示中のバーが時間とともに左から黄色になる（バー 23.9×2px、間隔 15px、写真の下から 18.9px）
    押しやすいように、ボタン自体は上下に広げている */
.onsen-family-bars {
    position: absolute;
    left: 50%;
    bottom: 10px;
    z-index: 1;
    display: flex;
    gap: 15px;
    transform: translateX(-50%);
}

.onsen-family-bar {
    position: relative;
    width: 23.9px;
    height: 20px;
}

.onsen-family-bar::before,
.onsen-family-bar::after {
    content: "";
    position: absolute;
    top: 9px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--white);
}

.onsen-family-bar::after {
    background: var(--yellow);
    transform: scaleX(0);
    transform-origin: left;
}

.onsen-family-bar.is-active::after {
    animation: onsen-bar-progress var(--gallery-interval, 5s) linear forwards;
}

@keyframes onsen-bar-progress {
    to {
        transform: scaleX(1);
    }
}

/* ---------- 館内施設（白背景） ---------- */
.onsen .sub-white {
    margin-top: 9.0625rem; /* 145px */
    padding-bottom: 6.625rem; /* 106px */
}

/* 6 つを 3 列に：写真（390×260px）の下に名前 */
.onsen-facility-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px 15px;
    margin-top: 2.4375rem; /* 39px */
}

.onsen-facility-list img {
    border-radius: 27.6px;
    background: var(--sub-frame);
    aspect-ratio: 391 / 261;
}

.onsen-facility-list .onsen-photo-name {
    margin-top: 0.5625rem; /* 9px */
}

/* ---------- SP ---------- */
@media (max-width: 767px) {
    .onsen.sub-page {
        background-image: url(../img/common/bg-onsen-sp.webp);
    }

    .onsen-list {
        margin-top: 11.5rem; /* 184px */
    }

    .onsen .photo-gallery {
        margin-top: 1.875rem; /* 30px */
    }

    /* 札：カンプ（写真を縮めたもの）だと文字が約 10px なので、サイトの最小の 12px にして帯も合わせて広げる */
    .onsen-bath-label {
        bottom: 12px;
        min-height: 1.25rem; /* 20px */
        padding: 0 2em 0 1.3333em; /* 0 24px 0 16px */
        font-size: 0.75rem; /* 12px */
        clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 100%, 0 100%);
    }

    .onsen .spec-list {
        margin-top: 2.1875rem; /* 35px */
    }

    /* 泉質・効能：区切り線は枠の左から 75px */
    .onsen .spec-item dt {
        width: calc(18px + 3.5rem); /* 74px */
    }

    /* 脱衣所・洗面台（写真 351×232px）：縦に並べる。角丸 10px */
    .onsen-photos {
        grid-template-columns: minmax(0, 1fr);
        gap: 40px;
        margin-top: 2.5rem; /* 40px */
    }

    .onsen-photos img {
        border-radius: 10px;
    }

    .onsen-photo-name {
        margin-top: 0.5rem; /* 8px */
        font-size: 1rem; /* 16px */
    }

    .onsen-family {
        margin-top: 3.8125rem; /* 61px */
    }

    /* 入口の写真（351×146.3px） */
    .onsen-family-main {
        margin-top: 1.75rem; /* 28px */
    }

    .onsen-family-main img {
        border-radius: 8px;
    }

    .onsen-family .sub-text {
        margin-top: 1.875rem; /* 30px */
    }

    /* 4 つを縦に並べる。タブは 312×40px */
    .onsen-family-list {
        grid-template-columns: minmax(0, 1fr);
        gap: 45px;
        margin-top: 2.0625rem; /* 33px */
    }

    .onsen-family-name {
        min-width: calc(100% - 39px);
        min-height: 2.5rem; /* 40px */
        border-radius: 14.75px 14.75px 0 0;
        font-size: 1.25rem; /* 20px */
    }

    .onsen-family-slider {
        border-radius: 10px;
    }

    /* バーは写真の下から 16.6px */
    .onsen-family-bars {
        bottom: 7.6px;
    }

    .onsen .sub-white {
        margin-top: 4.4375rem; /* 71px */
        padding-bottom: 4.1875rem; /* 67px */
        border-radius: 17.5px 17.5px 0 0;
    }

    /* 6 つ（写真 172.2×114.8px）を 2 列に。2 段目はカンプどおり「日本酒バー｜お食事処」の順。角丸 10px */
    .onsen-facility-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px 7px;
        margin-top: 2.6875rem; /* 43px */
    }

    .onsen-facility-list img {
        border-radius: 10px;
    }

    .onsen-facility-list .onsen-photo-name {
        margin-top: 0.375rem; /* 6px */
    }

    .onsen-facility-list li:nth-child(3) {
        order: 4;
    }

    .onsen-facility-list li:nth-child(4) {
        order: 3;
    }

    .onsen-facility-list li:nth-child(n + 5) {
        order: 5;
    }
}
