.kv-slider-outer {
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: center;
    /* 中央を基準にする */
    margin-top: 100px; /* ヘッダーから離すため余白を拡充 */
}

.toma-new-kv {
    width: 100%;
    padding: 0 0 10px 0; /* 下部の無駄な空きを大幅に削減 (元: 50px) */
    margin-top: 0 !important;
    background: #fff;
    flex: 3;
    /* ド迫力を復元 */
    min-width: 600px;
    margin-left: -10%;
    /* 左寄せをさらに強調 */
    overflow: visible;
    position: relative;
}

.toma-new-kv .swiper {
    overflow: visible;
    width: 100%;
    padding: 0 0 35px 10%; /* コントロール用の確保スペースを最適化 (元: 60px) */
    /* 左側にチラ見せ分を確保 */
    margin-top: 0 !important;
    transform: none !important;
}

.toma-new-kv .swiper-wrapper {
    align-items: flex-start;
}

.toma-new-kv .swiper-slide {
    width: 75%;
    transform-origin: top;
    opacity: 0;
    /* 基本は消す */
    visibility: hidden;
    transition: all 0.7s cubic-bezier(0.25, 1, 0.5, 1);
}

/* アクティブ、及びその左右の隣接スライドのみ可視化 */
.toma-new-kv .swiper-slide-active,
.toma-new-kv .swiper-slide-next,
.toma-new-kv .swiper-slide-prev {
    opacity: 1;
    visibility: visible;
}

/* アクティブなスライド：スライド完了後に大きくする */
.toma-new-kv .swiper-slide-active {
    opacity: 1;
    transform: scale(1);
    transition-delay: 0.4s;
}

/* 非アクティブなスライドの演出（左右の見切れ） */
.toma-new-kv .swiper-slide:not(.swiper-slide-active) {
    opacity: 1;
    /* 透過をなくして鮮やかに表示 */
    transform: scale(0.8);
    /* 縮小させて重なりを解消 */
    transition-delay: 0s;
}

.toma-new-kv .kv-img-wrap {
    position: relative;
    width: 100%;
    /* 重なり防止のために100%に固定 */
    margin-left: 0;
    aspect-ratio: 3 / 2;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.06);
}

.toma-new-kv .kv-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Navigation & Pagination Cluster (Wrapped Container) */
.kv-controls-wrap {
    position: absolute;
    bottom: 0; /* スライダー枠の底辺にピタッと合わせる */
    left: 0;
    right: 0;
    width: 100%;
    height: 30px;
    z-index: 30;
    pointer-events: none;
    /* 下の要素のクリックを邪魔しない */
}

.kv-controls-wrap .swiper-pagination {
    position: relative;
    top: auto !important;
    bottom: auto !important;
    margin: 0 auto !important;
    width: fit-content !important;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 12px;
    pointer-events: auto;
}

.kv-controls-wrap .swiper-pagination-bullet {
    background: #333;
    opacity: 0.15;
    margin: 0 !important;
    width: 6px;
    height: 6px;
    cursor: pointer;
    border-radius: 6px; /* 真円とカプセル型を綺麗に両立するための固定丸み */
    transition: width 0.3s ease, opacity 0.3s ease, background-color 0.3s ease;
}

.kv-controls-wrap .swiper-pagination-bullet-active {
    opacity: 1;
    width: 24px;
    /* width以外のアニメーションも滑らかに */
}

.kv-controls-wrap .swiper-button-prev,
.kv-controls-wrap .swiper-button-next {
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 30px !important;
    height: 30px !important;
    color: #999 !important;
    margin: auto 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    cursor: pointer;
}

.kv-controls-wrap .swiper-button-prev {
    left: calc(50% - 130px) !important;
}

.kv-controls-wrap .swiper-button-next {
    right: calc(50% - 130px) !important;
    left: auto !important;
}

.kv-controls-wrap .swiper-button-prev::after,
.kv-controls-wrap .swiper-button-next::after {
    font-size: 14px !important;
    line-height: 1 !important;
}

/* Info Box Styling (Right Side) */
.kv-info-box {
    position: relative;
    z-index: 10;
    background: #fff;
    /* 背後のスライダーの隙間を埋めるため左と上に寄せる */
    margin-left: -80px;
    margin-bottom: 0px; /* スライダー枠が縮んだ分、ウィジェットを下に下げて被りを解消 (元: 50px) */
    padding: 0 0px 0px 0px;
    color: #333;
    flex: none;
    /* 勝手に広がらないように固定 */
}

.info-date-row {
    display: flex;
    align-items: center;
    /* center to match image */
    gap: 15px;
    margin-bottom: 14px;
}

.date-main {
    font-family: 'Inter', sans-serif;
    font-size: 56px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    white-space: nowrap;
    /* 改行禁止 */
}

.date-sub {
    display: flex;
    flex-direction: column;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.05em;
    white-space: nowrap;
    /* 改行禁止 */
}

.time-main {
    font-family: 'Inter', sans-serif;
    font-size: 24px;
    font-weight: 600;
    margin-left: 10px;
    white-space: nowrap;
    /* 改行禁止 */
}

.info-actions-row {
    display: flex;
    align-items: center !important;
    /* 絶対に中央揃え */
    gap: 20px;
}

.status-badge {
    background: #222;
    color: #fff;
    padding: 16px 36px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: bold;
    min-width: 130px;
    text-align: center;
    display: inline-flex;
    /* 中の文字も中央に */
    align-items: center;
    justify-content: center;
    line-height: 1;
    /* 行高による浮きを防止 */
}

.status-badge.is-closed {
    background: #888;
}

.action-list {
    display: flex;
    align-items: center;
}

a.action-item {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s ease;
}

a.action-item:hover {
    opacity: 0.7;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 0 25px;
}

.action-item:not(:first-child) {
    border-left: 1px solid #ddd;
}

.icon-wrap {
    font-size: 26px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-wrap img {
    width: 1em;
    height: 1em;
    object-fit: contain;
}

.action-item span {
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
    /* 改行禁止 */
}

/* Laptop & Middle Screen Optimization (includes MacBook Air) */
@media screen and (max-width: 1600px) {
    .kv-slider-outer {
        max-width: 100%;
        margin: 0 auto;
        padding: 0 40px;
        /* 適切な左右の余白 */
        justify-content: center;
        gap: 30px;
    }

    .toma-new-kv {
        flex: 1;
        /* 伸びる */
        width: 60%;
        margin-left: 0 !important;
        overflow: visible;
    }

    .toma-new-kv .swiper-slide {
        width: 85%;
    }

    .kv-info-box {
        margin-left: 0;
        margin-right: 0 !important;
        margin-bottom: -35px; /* スライダー枠の縮小分、さらに下へ押し下げて被りを防ぐ (元: 15px) */
        padding-bottom: 60px;
        z-index: 20;
        background: #fff;
        flex: none;
        width: 340px;
        /* パディングを削ったので340pxに再挑戦 */
    }

    .date-main {
        font-size: 40px !important;
        /* 一段小さく */
    }

    .date-sub {
        font-size: 14px !important;
    }

    .time-main {
        font-size: 18px !important;
    }

    .status-badge {
        padding: 10px 16px !important;
        /* 横パディングをさらにスリムに */
        font-size: 13px !important;
        min-width: 80px !important;
    }

    .info-actions-row {
        gap: 15px !important;
    }

    .action-item {
        padding: 0 15px !important;
    }

    .icon-wrap {
        font-size: 20px !important;
    }

    .action-item span {
        font-size: 10px !important;
    }
}

/* Wide Banner Style (Tablet to Large Mobile) */
@media screen and (max-width: 1100px) and (min-width: 601px) {
    .kv-slider-outer {
        max-width: 1200px;
        /* 少し余裕を持たせた上限 */
        margin: 0 auto;
        padding: 0 40px;
        /* 画面端との距離をしっかり確保 */
        display: flex;
        flex-direction: column;
        margin-top: 60px; /* タブレットは少し狭める */
    }

    .toma-new-kv {
        width: 100%;
        margin-left: 0 !important;
        flex: none;
        order: 1 !important;
    }

    .kv-controls-wrap {
        position: relative !important;
        bottom: auto !important;
        order: 2 !important;
        margin: 15px auto !important;
        height: 40px;
    }

    .kv-info-box {
        width: 100%;
        min-width: 100%;
        display: flex;
        flex-direction: row;
        /* 横一列を死守 */
        justify-content: space-between;
        align-items: center;
        padding: 15px 0 30px;
        order: 3 !important;
        border-top: 1px solid #eee;
        margin-left: 0;
        margin-bottom: 0;
    }

    .info-date-row {
        flex: none;
        margin-right: 15px;
    }

    .info-actions-row {
        flex: 1;
        justify-content: flex-end;
        gap: 10px !important;
    }

    .date-main {
        font-size: 26px !important;
    }

    .time-main {
        font-size: 12px !important;
    }

    .action-item span {
        font-size: 8px !important;
    }
}

/* Smartphone Vertical Stack (Only for very small screens) */
@media screen and (max-width: 600px) {
    .kv-slider-outer {
        transform: none;
        justify-content: center;
        flex-direction: column;
        display: flex;
        padding: 0 10px;
        margin-top: 40px; /* スマホはさらに狭める */
    }

    .toma-new-kv {
        min-width: 100%;
        flex: none;
        order: 1 !important;
        margin-left: 0 !important;
        /* 確実にセンター */
        padding-bottom: 0;
    }

    .toma-new-kv .swiper {
        padding: 0 0 20px 0 !important;
        /* 空きを詰める */
    }

    .toma-new-kv .swiper-slide {
        width: 85%;
    }

    .kv-controls-wrap {
        position: relative !important;
        bottom: auto !important;
        order: 2 !important;
        margin: 0 auto 5px !important;
        /* 空きを極限まで詰める */
        width: 100% !important;
        display: flex;
        justify-content: center;
        height: 30px;
        /* ページャー自体も少し詰め */
    }

    .kv-info-box {
        order: 3 !important;
        margin-left: 0;
        align-self: center;
        padding: 0 10px 40px;
        width: 100%;
        text-align: center;
    }

    .info-date-row {
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 10px;
        /* こっちの空きも詰める */
    }

    .date-main {
        font-size: 32px !important;
        /* ナオ指定のサイズ */
    }

    .time-main {
        font-size: 18px !important;
        /* 日付に合わせて調整 */
    }

    .status-badge {
        margin: 0 auto 0;
        padding: 10px 12px !important;
        /* さらに絞って改行を阻止 */
        min-height: 54px;
        /* 右隣のアイコンユニットに合わせる */
        font-size: 13px !important;
        min-width: 80px !important;
    }

    .info-actions-row {
        justify-content: center;
        width: 100%;
        align-items: stretch !important;
    }

    .action-list {
        width: 100%;
        justify-content: center;
    }

    .action-item {
        padding: 0 8px !important;
        /* 隙間を詰める */
        flex: 1;
        min-width: 70px;
    }

    .action-item:not(:first-child) {
        border-left: 1px solid #eee;
    }
}

@media screen and (max-width: 767px) {
    .toma-new-kv .swiper-slide {
        width: 85%;
    }

    .kv-info-box {
        padding-left: 20px;
    }

    .date-main {
        font-size: 36px;
    }

    .status-badge {
        padding: 10px 15px;
    }
}

/* Editor Specific Styling to keep it compact while editing */
body.wp-admin .toma-new-kv {
    min-width: auto;
    padding-bottom: 20px;
}

body.wp-admin .kv-slider-outer {
    transform: none;
    max-width: 100%;
}

body.wp-admin .kv-img-wrap {
    max-height: 200px;
    /* エディター上では高さを抑制 */
    margin-left: 0;
    width: 100%;
}

body.wp-admin .kv-info-box {
    padding-bottom: 20px;
    margin-left: 10px;
    transform: scale(0.8);
    /* 情報ボックスも少し小さくして視認性UP */
    transform-origin: left bottom;
}

body.wp-admin .swiper-slide {
    opacity: 1 !important;
    visibility: visible !important;
    width: 33.33% !important;
    transform: none !important;
    /* エディター上では並べて見やすく */
}
body.wp-admin .toma-new-kv .swiper-wrapper {
    display: flex;
    gap: 10px;
}
