/* 詳細ページ共通の補正 */
@media (min-width: 769px) {
    .detail-gallery {
        display: grid !important;
        grid-template-columns: minmax(0, 1140px) minmax(0, 270px) !important;
        align-items: stretch !important;
        gap: 20px !important;
        width: calc(100% - 40px) !important;
        max-width: 1430px !important;
        margin-right: auto !important;
        margin-left: auto !important;
    }

    .detail-gallery-main,
    .detail-main {
        width: 100% !important;
        max-width: 1140px !important;
        height: auto !important;
        aspect-ratio: 1140 / 765 !important;
        max-height: 765px !important;
        overflow: hidden !important;
        border-radius: 30px !important;
    }

    .detail-gallery-main>img,
    .detail-main>img,
    .detail-gallery-main-image {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    .detail-gallery-thumbs,
    .detail-thumbnails {
        display: flex !important;
        flex-direction: column !important;
        align-self: start !important;
        gap: 15px !important;
        width: 100% !important;
        max-width: 270px !important;
    }

    .detail-gallery-thumb,
    .detail-thumb,
    .detail-gallery-thumbs>button,
    .detail-thumbnails>button {
        display: block !important;
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: 270px !important;
        height: auto !important;
        aspect-ratio: 3 / 2 !important;
        max-height: 180px !important;
        padding: 0 !important;
        overflow: hidden !important;
        border-radius: 18px !important;
    }

    .detail-gallery-thumb>img,
    .detail-thumb>img,
    .detail-gallery-thumbs>button>img,
    .detail-thumbnails>button>img {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    .detail-gallery-thumbs:has(> :nth-child(4):last-child),
    .detail-thumbnails:has(> :nth-child(4):last-child) {
        display: grid !important;
        grid-template-rows: repeat(4, minmax(0, 1fr)) !important;
        align-self: stretch !important;
        height: 100% !important;
        max-height: 765px !important;
    }

    .detail-gallery-thumbs:has(> :nth-child(4):last-child)>*,
    .detail-thumbnails:has(> :nth-child(4):last-child)>* {
        height: 100% !important;
        max-height: none !important;
        aspect-ratio: auto !important;
    }

    .single-news .detail-gallery {
        grid-template-columns: minmax(0, 1fr) 236px !important;
        gap: 16px !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
    }

    .single-news .detail-gallery-main {
        width: 100% !important;
        max-width: none !important;
    }

    .single-news .detail-gallery-thumbs {
        width: 236px !important;
        max-width: none !important;
        gap: 14px !important;
    }

    .single-news .detail-gallery-thumb {
        width: 100% !important;
        max-width: none !important;
    }

    /* ツアー詳細だけ：メイン画像の下にサムネイルを横一列で配置 */
    .single-tour-detail .tour-detail-gallery.detail-gallery {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
    }

    .single-tour-detail .tour-detail-gallery .detail-gallery-main {
        width: 100% !important;
        max-width: none !important;
        height: 240px !important;
        max-height: none !important;
        aspect-ratio: auto !important;
        border-radius: 0 !important;
    }

    .single-tour-detail .tour-detail-gallery .detail-gallery-thumbs {
        display: grid !important;
        grid-template-columns: repeat(var(--tour-gallery-count), minmax(0, 1fr)) !important;
        grid-template-rows: 62px !important;
        grid-auto-rows: 62px !important;
        grid-auto-flow: row !important;
        align-self: auto !important;
        align-content: start !important;
        width: 100% !important;
        max-width: none !important;
        height: auto !important;
        max-height: none !important;
        min-height: 0 !important;
        gap: 4px !important;
        margin-top: 4px !important;
    }

    .single-tour-detail .tour-detail-gallery .detail-gallery-thumb {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        height: 62px !important;
        max-height: none !important;
        aspect-ratio: auto !important;
        padding: 0 !important;
        border-radius: 0 !important;
    }
}

@media (max-width: 768px) {
    .single-news .detail-gallery {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .single-news .detail-gallery-main {
        width: 100% !important;
        max-width: none !important;
        border-radius: 5.3vw !important;
    }

    .single-news .detail-gallery-thumbs {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 1.8vw !important;
        width: 100% !important;
        max-width: none !important;
        margin-top: 2.5vw !important;
    }

    .single-news .detail-gallery-thumb {
        width: 100% !important;
        max-width: none !important;
        height: 13vw !important;
        border-radius: 1.3vw !important;
    }

    .detail-meta,
    .single-detail-meta,
    .single-meta {
        gap: 3vw;
    }

    .detail-meta>span:first-child,
    .single-detail-meta>span:first-child,
    .single-meta>span:first-child,
    .detail-category,
    .single-detail-category {
        min-width: 30vw;
        padding: 1.6vw 4vw;
    }

    .detail-pager,
    .detail-navigation,
    .single-nav,
    .post-navigation {
        margin-top: 12vw !important;
        margin-bottom: 16vw !important;
    }

    .single-tour-detail .tour-detail-gallery.detail-gallery {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .single-tour-detail .tour-detail-gallery .detail-gallery-main {
        width: 100% !important;
        height: 57vw !important;
        border-radius: 0 !important;
    }

    .single-tour-detail .tour-detail-gallery .detail-gallery-thumbs {
        display: grid !important;
        grid-template-columns: repeat(var(--tour-gallery-count), minmax(0, 1fr)) !important;
        grid-template-rows: 15vw !important;
        grid-auto-rows: 15vw !important;
        width: 100% !important;
        height: auto !important;
        gap: 1.5vw !important;
        margin-top: 1.5vw !important;
    }

    .single-tour-detail .tour-detail-gallery .detail-gallery-thumb {
        width: 100% !important;
        height: 15vw !important;
        border-radius: 0 !important;
    }
}

.komono-tour-schedule-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 10px;
}

.komono-tour-schedule-row input[type="date"],
.komono-tour-schedule-row select {
    min-width: 170px;
}

.tour-detail-schedule {
    margin-top: 80px;
    padding-bottom: 30px;
    border-bottom: 1px solid #222;
}

.tour-detail-schedule h2 {
    margin: 0 0 32px;
    font-size: 26px;
}

.tour-detail-schedule-list {
    display: grid;
    gap: 24px;
}

.tour-detail-schedule-row {
    display: grid;
    grid-template-columns: 125px 165px 165px;
    align-items: center;
    gap: 26px;
}

.tour-detail-schedule-row time {
    font-size: 22px;
    font-weight: 700;
}

.tour-detail-schedule-status,
.tour-detail-schedule-confirmed {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border-radius: 999px;
    font-size: 17px;
    font-weight: 700;
}

.tour-detail-schedule-status.is-open {
    background: #e78ab7;
    color: #fff;
}

.tour-detail-schedule-status.is-closed {
    background: #707070;
    color: #fff;
}

.tour-detail-schedule-confirmed {
    background: #dbcf35;
    color: #e03f3f;
}

@media (max-width: 768px) {
    .tour-detail-schedule {
        margin-top: 15vw;
    }

    .tour-detail-schedule h2 {
        margin-bottom: 7vw;
        font-size: 5vw;
    }

    .tour-detail-schedule-row {
        grid-template-columns: 1fr 1fr;
        gap: 3vw;
    }

    .tour-detail-schedule-row time {
        grid-column: 1 / -1;
        font-size: 4.5vw;
    }

    .tour-detail-schedule-status,
    .tour-detail-schedule-confirmed {
        min-height: 9vw;
        font-size: 3.8vw;
    }
}