/* ==========================================================
   Phase 8.0 V1.3.1 additive styles
   Official design tokens + components come from itinerary-style.css
   ========================================================== */

.phase8-v12 {
    background: var(--bg-body);
}

.phase8-eyebrow {
    font-family: 'Outfit', sans-serif;
    font-size: .78rem;
    letter-spacing: .24em;
    margin-bottom: 16px;
    opacity: .92;
}

/* HERO collage */
.phase8-hero-collage {
    height: 80vh;
    min-height: 620px;
    position: relative;
    overflow: hidden;
    background: #24312e;
}

.phase8-hero-grid {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 1.55fr .75fr .75fr;
    grid-template-rows: 1fr 1fr;
    gap: 4px;
    background: #fff;
}

.phase8-hero-tile {
    margin: 0;
    overflow: hidden;
    position: relative;
    background: #dfe7e4;
}

.phase8-hero-tile img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transform: scale(1.01);
}

.phase8-hero-tile.tile-1 {
    grid-row: 1 / 3;
}

.phase8-hero-tile.tile-4,
.phase8-hero-tile.tile-5 {
    grid-column: auto;
}

.hero-count-4 {
    grid-template-columns: 1.5fr .75fr .75fr;
}

.hero-count-4 .tile-4 {
    grid-column: 2 / 4;
}

.hero-count-3 {
    grid-template-columns: 1.45fr 1fr;
}

.hero-count-3 .tile-1 {
    grid-row: 1 / 3;
}

.hero-count-2 {
    grid-template-columns: 1.25fr 1fr;
    grid-template-rows: 1fr;
}

.hero-count-2 .tile-1 {
    grid-row: auto;
}

.hero-count-1 {
    display: block;
}

.phase8-hero-empty {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(
            circle at 30% 20%,
            #799087,
            #32463f 55%,
            #202d29
        );
}

.phase8-hero-shade {
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
        linear-gradient(
            90deg,
            rgba(19,33,29,.72) 0%,
            rgba(19,33,29,.44) 40%,
            rgba(19,33,29,.18) 100%
        );
}

.phase8-hero-copy {
    position: absolute;
    z-index: 3;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(1100px, calc(100% - 48px));
    color: #fff;
    text-align: center;
}

.phase8-hero-copy .hero-title {
    margin-left: auto;
    margin-right: auto;
    max-width: 1050px;
}

.phase8-brand-bridge {
    text-align: center;
    background: #fff;
    padding: 70px 20px 35px;
}

.phase8-bridge-small {
    font-family: 'Noto Serif TC', serif;
    color: var(--theme-accent);
    font-size: 1rem;
    letter-spacing: .18em;
}

.phase8-bridge-title {
    font-family: 'Noto Serif TC', serif;
    color: var(--text-main);
    font-size: 2rem;
    font-weight: 700;
    margin-top: 10px;
}

.phase8-bridge-line {
    width: 1px;
    height: 55px;
    background: var(--theme-accent);
    opacity: .7;
    margin: 22px auto 0;
}

.phase8-layout {
    margin-top: 25px;
}

.phase8-sg {
    font-family: 'Outfit', sans-serif;
    font-size: .75rem;
    color: #94a3b8;
    margin-top: 3px;
}

.phase8-selected {
    background: #f7fbf9 !important;
}

/* Compact passenger price line */
.phase8-price-toggle {
    display: block;
    padding: 3px 0 0;
    background: none;
    border: 0;
    color: var(--theme-primary);
    font-size: .76rem;
    cursor: pointer;
}

.phase8-dep-row {
    flex-wrap: wrap;
}

.phase8-price-detail {
    display: none;
    flex-basis: 100%;
    width: 100%;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 9px 0 1px;
    margin-top: 8px;
    border-top: 1px dashed var(--border-color);
}

.phase8-dep-row.price-open .phase8-price-detail {
    display: flex;
}

.phase8-price-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    background: #fafbfb;
    padding: 5px 9px;
    font-size: .78rem;
}

.phase8-price-chip span {
    color: var(--text-muted);
}

.phase8-price-chip b {
    color: var(--danger-color);
    font-family: 'Outfit', sans-serif;
}

/* Editorial Journey Notes */
.phase8-editorial-stack {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.phase8-editorial-row {
    display: grid;
    grid-template-columns: minmax(0, 44%) minmax(0, 56%);
    min-height: 380px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(30,41,59,.035);
}

.phase8-editorial-row.is-reverse {
    grid-template-columns: minmax(0, 56%) minmax(0, 44%);
}

.phase8-editorial-row.is-reverse .phase8-editorial-media {
    order: 2;
}

.phase8-editorial-row.text-only {
    display: block;
    min-height: 0;
}

.phase8-editorial-media {
    min-height: 380px;
    position: relative;
    overflow: hidden;
    background: #eef2f1;
}

.phase8-editorial-media > img {
    width: 100%;
    height: 100%;
    min-height: 380px;
    object-fit: cover;
    display: block;
    transition: transform .8s ease;
}

.phase8-editorial-row:hover
.phase8-editorial-media > img {
    transform: scale(1.035);
}

.phase8-editorial-mini {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    display: flex;
    gap: 7px;
    justify-content: flex-end;
}

.phase8-editorial-mini img {
    width: 84px;
    height: 58px;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,.88);
    border-radius: 7px;
    box-shadow: 0 4px 12px rgba(0,0,0,.16);
}

.phase8-editorial-copy {
    padding: 44px 46px;
    align-self: center;
}

.phase8-editorial-kicker {
    color: var(--theme-accent);
    letter-spacing: .18em;
    font: 600 .72rem 'Outfit', sans-serif;
}

.phase8-editorial-copy h3 {
    margin: 11px 0 17px;
    font-family: 'Noto Serif TC', serif;
    color: var(--text-main);
    font-size: 1.55rem;
    line-height: 1.55;
}

.phase8-editorial-text {
    color: var(--text-muted);
    font-size: .95rem;
    line-height: 1.9;
}

.phase8-clamp:not(.is-expanded) {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    overflow: hidden;
}

.phase8-readmore {
    margin-top: 12px;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--theme-accent);
    padding: 2px 0;
    color: var(--theme-primary);
    cursor: pointer;
    font-size: .84rem;
}

/* Other editorial sections */
.phase8-feature-list {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.phase8-feature-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    background: var(--bg-card);
}

.phase8-feature-card h3 {
    margin: 0 0 16px;
    font: 700 1.3rem 'Noto Serif TC', serif;
    color: var(--text-main);
}

.phase8-feature-images {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.phase8-feature-images.count-1 {
    grid-template-columns: 1fr;
}

.phase8-feature-images img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 9px;
}

.phase8-rich {
    color: var(--text-main);
    line-height: 1.9;
    font-size: .95rem;
}

/* Daily overview */
.phase8-day-overview {
    background: #fbfaf7;
    border-left: 4px solid var(--theme-accent);
    border-radius: 8px;
    padding: 18px 21px;
    margin-bottom: 22px;
    color: #4b5563;
    line-height: 1.85;
}

/* Attraction cards */
.phase8-attraction-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 18px;
}

.phase8-attraction-card {
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,.025);
    transition:
        transform .35s cubic-bezier(.25,1,.5,1),
        box-shadow .35s ease;
}

.phase8-attraction-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,.065);
}

.phase8-attraction-media {
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #edf2f0;
}

.phase8-attraction-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .65s ease;
}

.phase8-attraction-card:hover
.phase8-attraction-media img {
    transform: scale(1.045);
}

.phase8-attraction-body {
    padding: 18px 17px 19px;
}

.phase8-attraction-body h3 {
    margin: 0 0 9px;
    font: 700 1.06rem 'Noto Serif TC', serif;
    color: var(--theme-primary);
    line-height: 1.5;
}

.phase8-attraction-desc {
    color: var(--text-muted);
    font-size: .86rem;
    line-height: 1.75;
}

.phase8-attraction-desc.phase8-clamp:not(.is-expanded) {
    -webkit-line-clamp: 4;
}

.phase8-day-gallery {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 12px;
}

.phase8-day-gallery img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 9px;
}

/* Official-style booking sidebar */
.phase8-booking-sidebar {
    align-self: flex-start;
}

.phase8-sidebar-inquiry {
    font-size: 1.15rem;
    color: var(--theme-accent);
}

.phase8-booking-sidebar .booking-body {
    max-height: 48vh;
    overflow: auto;
}

/* Inquiry / booking panel - does not write old trip_inquiries */
.phase8-booking-overlay {
    position: fixed;
    inset: 0;
    z-index: 10010;
    background: rgba(15,23,42,.56);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: .3s;
}

.phase8-booking-overlay.show {
    opacity: 1;
    visibility: visible;
}

.phase8-booking-panel {
    position: fixed;
    z-index: 10011;
    top: 0;
    right: -520px;
    width: min(500px, 94vw);
    height: 100vh;
    padding: 48px 36px;
    background: #fff;
    box-shadow: -18px 0 45px rgba(15,23,42,.15);
    transition: right .4s cubic-bezier(.25,1,.5,1);
    overflow: auto;
}

.phase8-booking-panel.show {
    right: 0;
}

.phase8-booking-close {
    position: absolute;
    right: 20px;
    top: 16px;
    border: 0;
    background: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
}

.phase8-panel-kicker {
    color: var(--theme-accent);
    letter-spacing: .15em;
    font: 600 .72rem 'Outfit', sans-serif;
}

.phase8-booking-panel h2 {
    font: 700 1.7rem 'Noto Serif TC', serif;
    color: var(--text-main);
    margin: 9px 0 25px;
}

.phase8-panel-trip {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 17px;
    border-radius: 9px;
    background: var(--theme-secondary);
}

.phase8-panel-trip span {
    font-size: .87rem;
    color: var(--text-muted);
}

.phase8-booking-panel > p {
    color: var(--text-muted);
    line-height: 1.7;
    margin: 22px 0 12px;
}

.phase8-booking-panel textarea {
    width: 100%;
    min-height: 150px;
    resize: vertical;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    padding: 13px;
    font: inherit;
    color: var(--text-main);
    background: #fafafa;
}

.phase8-panel-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-top: 14px;
}

.phase8-panel-actions button {
    min-height: 44px;
    border-radius: 7px;
    font-weight: 700;
    cursor: pointer;
}

.phase8-copy-message {
    border: 1px solid var(--border-color);
    background: #f8fafc;
    color: var(--text-main);
}

.phase8-line-action {
    border: 0;
    background: #06c755;
    color: #fff;
}

.phase8-booking-panel small {
    display: block;
    margin-top: 18px;
    color: #94a3b8;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 1200px) {
    .phase8-layout .left-spacer {
        display: none;
    }

    .phase8-layout {
        padding-left: 24px;
        padding-right: 24px;
    }
}

@media (max-width: 1000px) {
    .phase8-attraction-grid {
        grid-template-columns: repeat(2,1fr);
    }

    .phase8-editorial-row,
    .phase8-editorial-row.is-reverse {
        grid-template-columns: 1fr 1fr;
    }

    .phase8-editorial-copy {
        padding: 34px;
    }
}

@media (max-width: 900px) {
    .phase8-layout {
        display: block;
        padding: 0 16px;
    }

    .phase8-booking-sidebar {
        width: 100%;
        max-width: none;
        position: static;
        margin-top: 24px;
    }

    .phase8-booking-sidebar .booking-body {
        max-height: none;
    }
}

@media (max-width: 768px) {
    .phase8-hero-collage {
        height: 68vh;
        min-height: 520px;
    }

    .phase8-hero-grid {
        grid-template-columns: 1.45fr 1fr;
        grid-template-rows: 1.15fr .85fr;
    }

    .phase8-hero-tile.tile-1 {
        grid-row: 1 / 3;
    }

    .phase8-hero-tile:nth-child(n+4) {
        display: none;
    }

    .phase8-hero-shade {
        background: rgba(16,29,25,.48);
    }

    .phase8-hero-copy {
        width: calc(100% - 28px);
    }

    .phase8-hero-copy .hero-title {
        font-size: 2.35rem;
    }

    .phase8-bridge-title {
        font-size: 1.65rem;
    }

    .phase8-editorial-row,
    .phase8-editorial-row.is-reverse {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .phase8-editorial-row.is-reverse
    .phase8-editorial-media {
        order: 0;
    }

    .phase8-editorial-media,
    .phase8-editorial-media > img {
        min-height: 260px;
        height: 260px;
    }

    .phase8-editorial-copy {
        padding: 26px 23px;
    }

    .phase8-attraction-grid {
        grid-template-columns: 1fr;
    }

    .phase8-feature-images,
    .phase8-day-gallery {
        grid-template-columns: 1fr;
    }

    .phase8-feature-images img,
    .phase8-day-gallery img {
        height: auto;
    }

    .phase8-panel-actions {
        grid-template-columns: 1fr;
    }

    .phase8-price-chip {
        white-space: normal;
    }
}


/* ==========================================================
   V1.3 Content hierarchy refinements
   ========================================================== */

/* Special arrangements: editorial feature cards */
.phase8-special-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}
.phase8-special-card {
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 7px 22px rgba(30,41,59,.035);
}
.phase8-special-card.is-single {
    display: grid;
    grid-template-columns: 48% 52%;
}
.phase8-special-media {
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #edf2f0;
}
.phase8-special-card.is-single .phase8-special-media {
    aspect-ratio: auto;
    min-height: 350px;
}
.phase8-special-media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform .7s ease;
}
.phase8-special-card:hover .phase8-special-media img {
    transform: scale(1.035);
}
.phase8-special-copy {
    padding: 25px 27px 29px;
    align-self: center;
}
.phase8-special-kicker,
.phase8-hotel-kicker {
    color: var(--theme-accent);
    letter-spacing: .16em;
    font: 600 .7rem 'Outfit', sans-serif;
}
.phase8-special-copy h3,
.phase8-hotel-copy h3 {
    margin: 9px 0 14px;
    font: 700 1.35rem 'Noto Serif TC', serif;
    line-height: 1.55;
    color: var(--text-main);
}

/* Selected hotel: image-led showcase rather than generic feature card */
.phase8-hotel-stack {
    display: flex;
    flex-direction: column;
    gap: 28px;
}
.phase8-hotel-showcase {
    display: grid;
    grid-template-columns: minmax(0, 58%) minmax(0, 42%);
    overflow: hidden;
    min-height: 400px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: #fff;
}
.phase8-hotel-showcase.is-reverse {
    grid-template-columns: minmax(0, 42%) minmax(0, 58%);
}
.phase8-hotel-showcase.is-reverse .phase8-hotel-gallery {
    order: 2;
}
.phase8-hotel-gallery {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 4px;
    min-height: 400px;
    background: #edf2f0;
}
.phase8-hotel-gallery.count-1 {
    display: block;
}
.phase8-hotel-gallery.count-2 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
}
.phase8-hotel-gallery .hotel-image {
    margin: 0;
    overflow: hidden;
}
.phase8-hotel-gallery.count-3 .hotel-image-1 {
    grid-row: 1 / 3;
}
.phase8-hotel-gallery img {
    width: 100%;
    height: 100%;
    min-height: 195px;
    object-fit: cover;
    display: block;
    transition: transform .7s ease;
}
.phase8-hotel-showcase:hover .phase8-hotel-gallery img {
    transform: scale(1.025);
}
.phase8-hotel-copy {
    padding: 38px 38px;
    align-self: center;
}
.phase8-hotel-copy .phase8-rich,
.phase8-special-copy .phase8-rich {
    color: var(--text-muted);
    line-height: 1.85;
    font-size: .92rem;
}

/* Adaptive daily attraction composition */
.phase8-attraction-grid.count-1 {
    grid-template-columns: 1fr;
}
.phase8-attraction-grid.count-1 .phase8-attraction-card {
    display: grid;
    grid-template-columns: 46% 54%;
}
.phase8-attraction-grid.count-1 .phase8-attraction-media {
    aspect-ratio: auto;
    min-height: 310px;
}
.phase8-attraction-grid.count-1 .phase8-attraction-body {
    align-self: center;
    padding: 30px 32px;
}
.phase8-attraction-grid.count-2 {
    grid-template-columns: repeat(2, minmax(0,1fr));
}
.phase8-attraction-grid.count-3,
.phase8-attraction-grid.count-4 {
    grid-template-columns: repeat(3, minmax(0,1fr));
}

/* Make the information hierarchy explicit in vertical rhythm */
#flights {
    margin-bottom: 28px;
}
.phase8-brand-bridge + .phase8-layout {
    margin-top: 25px;
}
#section-description,
#section-special,
#section-hotel,
#itinerary {
    scroll-margin-top: 90px;
}

@media (max-width: 900px) {
    .phase8-special-grid {
        grid-template-columns: 1fr;
    }
    .phase8-special-card.is-single,
    .phase8-hotel-showcase,
    .phase8-hotel-showcase.is-reverse {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }
    .phase8-hotel-showcase.is-reverse .phase8-hotel-gallery {
        order: 0;
    }
    .phase8-hotel-gallery {
        width: 100%;
        min-height: 320px;
    }
}

@media (max-width: 768px) {
    .phase8-special-card.is-single .phase8-special-media {
        min-height: 260px;
    }
    .phase8-hotel-gallery {
        min-height: 270px;
    }
    .phase8-hotel-copy {
        padding: 27px 24px;
    }
    .phase8-attraction-grid.count-1 .phase8-attraction-card {
        display: block;
    }
    .phase8-attraction-grid.count-1 .phase8-attraction-media {
        min-height: 0;
        aspect-ratio: 16/10;
    }
    .phase8-attraction-grid.count-2,
    .phase8-attraction-grid.count-3,
    .phase8-attraction-grid.count-4 {
        grid-template-columns: 1fr;
    }
}


/* ==========================================================
   V1.3.1 Responsive Editorial Gallery + Full-Width Media
   ========================================================== */

/* Journey description: image gallery is part of the editorial composition,
   not a floating thumbnail attachment. */
.phase8-editorial-media {
    min-height: 0;
    display: flex;
    background: #eef2f1;
}
.phase8-editorial-gallery {
    width: 100%;
    min-height: 380px;
    display: grid;
    gap: 4px;
    background: #eef2f1;
}
.phase8-editorial-gallery-item {
    position: relative;
    margin: 0;
    min-width: 0;
    overflow: hidden;
    background: #e8eeec;
}
.phase8-editorial-gallery-item img {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
    display: block;
    transition: transform .7s ease;
}
.phase8-editorial-gallery:hover img {
    transform: scale(1.025);
}
.phase8-editorial-gallery.count-1 {
    display: block;
}
.phase8-editorial-gallery.count-1 .phase8-editorial-gallery-item,
.phase8-editorial-gallery.count-1 img {
    width: 100%;
    height: 100%;
    min-height: 380px;
}
.phase8-editorial-gallery.count-2 {
    grid-template-columns: repeat(2, minmax(0,1fr));
    grid-template-rows: 1fr;
}
.phase8-editorial-gallery.count-3 {
    grid-template-columns: minmax(0, 1.55fr) minmax(0, .85fr);
    grid-template-rows: repeat(2, minmax(0,1fr));
}
.phase8-editorial-gallery.count-3 .item-1 {
    grid-row: 1 / 3;
}
.phase8-gallery-more {
    position: absolute;
    right: 12px;
    bottom: 12px;
    min-width: 46px;
    height: 34px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.72);
    border-radius: 999px;
    background: rgba(18,31,27,.72);
    color: #fff;
    font: 600 .84rem 'Outfit', sans-serif;
    backdrop-filter: blur(4px);
}
.phase8-editorial-mini {
    display: none !important;
}

/* Special arrangement / travel gift:
   preserve full image content. No forced crop and no original-pixel overflow. */
.phase8-feature-media-stack {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 28px;
}
.phase8-full-feature-card {
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 7px 22px rgba(30,41,59,.035);
}
.phase8-full-feature-media {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: #f7f8f7;
}
.phase8-full-feature-media img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center;
}
.phase8-full-feature-copy {
    padding: 27px 30px 30px;
}
.phase8-full-feature-copy h3 {
    margin: 9px 0 14px;
    font: 700 1.35rem 'Noto Serif TC', serif;
    line-height: 1.55;
    color: var(--text-main);
}
.phase8-gift-kicker {
    color: var(--theme-accent);
    letter-spacing: .16em;
    font: 600 .7rem 'Outfit', sans-serif;
}

/* Tablet */
@media (max-width: 1024px) {
    .phase8-editorial-gallery {
        min-height: 340px;
    }
    .phase8-editorial-gallery.count-1 .phase8-editorial-gallery-item,
    .phase8-editorial-gallery.count-1 img {
        min-height: 340px;
    }
    .phase8-full-feature-copy {
        padding: 24px 25px 27px;
    }
}

/* Mobile: readability first. Main image + two meaningful lower images. */
@media (max-width: 768px) {
    .phase8-editorial-gallery {
        min-height: 0;
    }
    .phase8-editorial-gallery.count-1 {
        display: block;
    }
    .phase8-editorial-gallery.count-1 .phase8-editorial-gallery-item,
    .phase8-editorial-gallery.count-1 img {
        min-height: 0;
        height: auto;
        aspect-ratio: auto;
    }
    .phase8-editorial-gallery.count-2 {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 210px;
    }
    .phase8-editorial-gallery.count-3 {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: minmax(220px, auto) 145px;
    }
    .phase8-editorial-gallery.count-3 .item-1 {
        grid-column: 1 / 3;
        grid-row: 1;
    }
    .phase8-editorial-gallery.count-3 .item-2 {
        grid-column: 1;
        grid-row: 2;
    }
    .phase8-editorial-gallery.count-3 .item-3 {
        grid-column: 2;
        grid-row: 2;
    }
    .phase8-editorial-gallery.count-3 .item-1 img {
        min-height: 220px;
    }
    .phase8-editorial-gallery.count-3 .item-2 img,
    .phase8-editorial-gallery.count-3 .item-3 img {
        min-height: 145px;
    }
    .phase8-gallery-more {
        right: 8px;
        bottom: 8px;
        min-width: 42px;
        height: 31px;
        font-size: .78rem;
    }
    .phase8-full-feature-card {
        border-radius: 11px;
    }
    .phase8-full-feature-copy {
        padding: 22px 20px 24px;
    }
    .phase8-full-feature-copy h3 {
        font-size: 1.18rem;
        line-height: 1.55;
    }
    .phase8-full-feature-copy .phase8-rich {
        font-size: .92rem;
        line-height: 1.85;
        overflow-wrap: anywhere;
    }
}

/* Narrow phones */
@media (max-width: 480px) {
    .phase8-editorial-gallery.count-2 {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(2, 205px);
    }
    .phase8-editorial-gallery.count-3 {
        grid-template-rows: 210px 125px;
    }
    .phase8-editorial-gallery.count-3 .item-1 img {
        min-height: 210px;
    }
    .phase8-editorial-gallery.count-3 .item-2 img,
    .phase8-editorial-gallery.count-3 .item-3 img {
        min-height: 125px;
    }
    .phase8-full-feature-copy {
        padding-left: 18px;
        padding-right: 18px;
    }
}



/* ==========================================================
   Phase 8.2 V1.0｜Mobile Booking + Itinerary Readability
   ========================================================== */

/* Departure list: <= 3 rows must never clip expanded price details. */
.dep-container.is-short-list {
    max-height: none !important;
    overflow: visible !important;
}

.dep-container.is-short-list .dep-fade-overlay {
    display: none !important;
}

/* Expanded long lists stay bounded; inner scrolling prevents page runaway. */
.dep-container.is-expanded:not(.is-short-list) {
    max-height: min(620px, 68vh) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

/* Give price more room and separate the price-detail action. */
.col-price {
    flex: 1.25 !important;
    min-width: 118px;
}
.col-detail {
    flex: .85;
    justify-content: center;
    min-width: 92px;
}
.col-action {
    flex: .95 !important;
}
.phase8-detail-empty {
    color: #cbd5e1;
}
.phase8-price-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: #fff;
    color: var(--theme-primary);
    font-weight: 700;
    font-size: .75rem;
}
.phase8-price-toggle:hover {
    border-color: var(--theme-primary);
    background: var(--theme-secondary);
}

/* Attraction images: multi-image swipe carousel. */
.phase8-attraction-media {
    position: relative;
}
.phase8-attraction-track {
    display: flex;
    width: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.phase8-attraction-track::-webkit-scrollbar {
    display: none;
}
.phase8-attraction-slide {
    flex: 0 0 100%;
    width: 100%;
    scroll-snap-align: start;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}
.phase8-attraction-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.phase8-gallery-dots {
    position: absolute;
    left: 50%;
    bottom: 9px;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(15,23,42,.28);
    backdrop-filter: blur(5px);
    pointer-events: none;
}
.phase8-gallery-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,.55);
    transition: transform .2s ease, background .2s ease;
}
.phase8-gallery-dot.active {
    background: #fff;
    transform: scale(1.35);
}

/* Daily summary keeps DAY label independent from the title width. */
.day-header {
    align-items: flex-start !important;
    gap: 12px;
}
.day-title-line {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.day-title-line .day-title {
    min-width: 0;
}

/* Long supplementary notes: 5-line preview, then bounded scroll. */
.phase8-note-clamp {
    position: relative;
    line-height: 1.9;
}
.phase8-note-clamp:not(.is-expanded) {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: calc(1.9em * 5);
    -webkit-mask-image: linear-gradient(to bottom, #000 65%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 65%, transparent 100%);
}
.phase8-note-clamp.is-expanded {
    display: block;
    max-height: min(430px, 55vh);
    overflow-y: auto;
    padding-right: 8px;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    -webkit-mask-image: none;
    mask-image: none;
}
.phase8-note-expand {
    display: block;
    margin: 12px auto 0;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: #fff;
    color: var(--theme-primary);
    padding: 7px 18px;
    font-weight: 700;
    cursor: pointer;
}

/* Mobile persistent booking bar. Desktop keeps the normal sidebar. */
.phase8-mobile-booking-bar {
    display: none;
}

@media (max-width: 768px) {
    body.phase8-v12 {
        padding-bottom: 76px;
    }

    /* Two persistent bars must not overlap. */
    .fixed-left-nav {
        bottom: 64px !important;
    }

    .phase8-mobile-booking-bar {
        position: fixed;
        z-index: 10020;
        left: 0;
        right: 0;
        bottom: 0;
        min-height: 64px;
        display: grid;
        grid-template-columns: 50px minmax(0,1fr) auto;
        align-items: center;
        gap: 10px;
        padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
        background: rgba(255,255,255,.96);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -8px 28px rgba(15,23,42,.10);
        backdrop-filter: blur(14px);
    }
    .phase8-mobile-top {
        width: 42px;
        height: 42px;
        border: 0;
        border-radius: 11px;
        background: #f1f5f3;
        color: var(--theme-primary);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        line-height: 1;
        cursor: pointer;
    }
    .phase8-mobile-top span {
        font-size: .57rem;
        letter-spacing: .08em;
    }
    .phase8-mobile-top b {
        font-size: 1rem;
        margin-top: 2px;
    }
    .phase8-mobile-booking-summary {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    .phase8-mobile-booking-summary span {
        font-size: .73rem;
        color: #64748b;
    }
    .phase8-mobile-booking-summary strong {
        color: var(--danger-color);
        font-family: 'Outfit', sans-serif;
        font-size: 1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .phase8-mobile-booking-action {
        min-height: 42px;
        padding: 0 15px;
        border: 0;
        border-radius: 10px;
        background: #06c755;
        color: #fff;
        font-weight: 800;
        cursor: pointer;
        white-space: nowrap;
    }

    /* Mobile booking becomes a bottom sheet, ~80% viewport, never full screen. */
    .phase8-booking-panel {
        top: auto !important;
        right: 0 !important;
        bottom: -82dvh;
        left: 0;
        width: 100%;
        max-width: none;
        height: min(80dvh, 720px);
        padding: 42px 20px calc(24px + env(safe-area-inset-bottom));
        border-radius: 22px 22px 0 0;
        box-shadow: 0 -18px 50px rgba(15,23,42,.18);
        transition: bottom .35s cubic-bezier(.25,1,.5,1);
        overflow-y: auto;
    }
    .phase8-booking-panel.show {
        right: 0 !important;
        bottom: 0;
    }
    .phase8-booking-close {
        position: sticky;
        float: right;
        top: 0;
        z-index: 2;
        width: 38px;
        height: 38px;
        border-radius: 50%;
        background: #f1f5f3;
        line-height: 1;
    }
    .phase8-booking-panel textarea {
        min-height: 120px;
        resize: none;
    }

    /* Departure rows: price remains readable and actions get their own line. */
    .dep-container.is-expanded:not(.is-short-list) {
        max-height: min(520px, 58vh) !important;
    }
    .phase8-dep-row {
        padding: 14px !important;
    }
    .col-title {
        padding-right: 0 !important;
    }
    .col-flight,
    .col-price,
    .col-detail,
    .col-status {
        flex: 0 0 auto !important;
        margin-right: 10px;
        margin-bottom: 7px;
    }
    .col-price {
        min-width: 132px;
        font-size: 1rem !important;
    }
    .col-detail {
        min-width: 0;
    }
    .col-action {
        position: static !important;
        flex: 0 0 100% !important;
        margin-top: 5px;
        justify-content: flex-start !important;
    }
    .btn-dep-book {
        width: 100%;
        min-height: 40px;
        border-radius: 10px;
    }

    /* DAY label gets its own line above the summary title. */
    .day-summary {
        padding: 18px 16px !important;
    }
    .day-header {
        display: flex !important;
        flex-direction: column;
        gap: 8px;
    }
    .day-tag {
        align-self: flex-start;
    }
    .day-title-line {
        width: 100%;
        align-items: flex-start;
    }
    .day-title {
        font-size: .98rem !important;
        line-height: 1.65;
    }

    /* Mobile media never leaves a blank lower background area. */
    .phase8-attraction-media {
        aspect-ratio: auto !important;
        min-height: 0 !important;
        height: auto !important;
        background: transparent !important;
    }
    .phase8-attraction-track,
    .phase8-attraction-slide {
        min-height: 0 !important;
        height: auto !important;
    }
    .phase8-attraction-slide {
        aspect-ratio: 16 / 10;
    }
    .phase8-attraction-slide img {
        min-height: 0 !important;
        height: 100% !important;
    }

    .phase8-day-gallery {
        display: flex !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 10px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .phase8-day-gallery::-webkit-scrollbar {
        display: none;
    }
    .phase8-day-gallery img {
        flex: 0 0 88%;
        width: 88% !important;
        aspect-ratio: 16 / 10;
        height: auto !important;
        object-fit: cover;
        scroll-snap-align: center;
    }

    .phase8-note-clamp.is-expanded {
        max-height: min(360px, 48vh);
    }
}


/* ==========================================================
   Phase 8.2 V1.0.2｜Compact mobile booking bar + sold-out state
   ========================================================== */

.phase8-booking-soldout,
.phase8-booking-soldout:hover {
    background:#e2e8f0 !important;
    border-color:#e2e8f0 !important;
    color:#64748b !important;
    cursor:not-allowed !important;
    transform:none !important;
}

@media (max-width: 768px) {
    body.phase8-v12 {
        padding-bottom:58px;
    }

    .fixed-left-nav {
        bottom:52px !important;
    }

    .phase8-mobile-booking-bar {
        min-height:52px;
        grid-template-columns:auto minmax(0,1fr) auto;
        gap:8px;
        padding:6px 10px calc(6px + env(safe-area-inset-bottom));
    }

    .phase8-mobile-top {
        width:auto;
        height:36px;
        padding:0 9px;
        border-radius:9px;
        display:inline-flex;
        flex-direction:row;
        font-size:.68rem;
        font-weight:800;
        letter-spacing:.02em;
        white-space:nowrap;
    }

    .phase8-mobile-booking-summary {
        display:flex;
        flex-direction:row;
        align-items:baseline;
        gap:8px;
        overflow:hidden;
        white-space:nowrap;
    }

    .phase8-mobile-booking-summary span {
        flex:0 0 auto;
        font-size:.72rem;
        color:#64748b;
    }

    .phase8-mobile-booking-summary strong {
        min-width:0;
        font-size:.92rem;
        overflow:hidden;
        text-overflow:ellipsis;
        white-space:nowrap;
    }

    .phase8-mobile-booking-action {
        min-height:36px;
        padding:0 12px;
        border-radius:9px;
        font-size:.78rem;
    }

    .phase8-mobile-booking-action.is-soldout,
    .phase8-mobile-booking-action.is-soldout:hover {
        background:#e2e8f0;
        color:#64748b;
        cursor:not-allowed;
    }
}


/* ==========================================================
   Phase 8.2 V1.0.3｜Two booking actions + fallback notice
   ========================================================== */
.phase8-booking-actions {
    display:grid;
    grid-template-columns:1fr;
    gap:10px;
    margin-top:15px;
}
.phase8-other-departures-btn {
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:42px;
    padding:0 14px;
    border:1px solid var(--theme-primary);
    border-radius:8px;
    color:var(--theme-primary);
    background:#fff;
    font-weight:800;
    font-size:.88rem;
    transition:.2s ease;
}
.phase8-other-departures-btn:hover {
    background:var(--theme-secondary);
}
.phase8-booking-fallback-note {
    margin:8px 0 0;
    padding:8px 10px;
    border-radius:8px;
    background:#fff7ed;
    color:#9a6115;
    font-size:.76rem;
    line-height:1.5;
}

.phase8-mobile-booking-actions {
    display:flex;
    align-items:center;
    gap:6px;
}
.phase8-mobile-other-departures {
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:36px;
    padding:0 10px;
    border:1px solid var(--theme-primary);
    border-radius:9px;
    color:var(--theme-primary);
    background:#fff;
    font-size:.72rem;
    font-weight:800;
    white-space:nowrap;
}

@media (max-width:768px) {
    .phase8-mobile-booking-bar {
        grid-template-columns:auto minmax(0,1fr) auto;
    }
    .phase8-mobile-booking-actions {
        flex:0 0 auto;
    }
    .phase8-mobile-booking-action,
    .phase8-mobile-other-departures {
        min-height:34px;
        padding:0 9px;
        font-size:.7rem;
    }
}

/* ==========================================================
   Phase 8.2 V1.2｜Itinerary Content Integrity
   - Daily attraction: 主標題｜副標題 / main intro / full description
   - Journey description mobile galleries preserve every image
   - Mobile text must never be hidden by desktop clamp rules
   ========================================================== */

.phase8-attraction-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0;
}
.phase8-attraction-name {
    color: var(--theme-primary);
}
.phase8-attraction-title-separator {
    padding: 0 .18em;
    color: var(--theme-accent);
    font-weight: 400;
}
.phase8-attraction-subtitle {
    color: var(--text-muted);
    font-weight: 500;
}
.phase8-attraction-intro {
    margin: 0 0 10px;
    color: var(--text-main);
    font-size: .9rem;
    line-height: 1.8;
}
.phase8-attraction-desc {
    margin-top: 0;
}

/* Explicit expanded state must fully release all clamp constraints. */
.phase8-clamp.is-expanded {
    display: block !important;
    max-height: none !important;
    overflow: visible !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: initial !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
}

/*
 * "行程說明" mobile behavior.
 *
 * Previous CSS forced .phase8-editorial-media to 260px while count-1
 * images used natural height. This produced empty vertical space.
 * Count-2/count-3 also used fixed grid row heights + object-fit:cover,
 * which cropped images and made 2-3 image groups incomplete.
 *
 * On mobile every source image is rendered at its natural aspect ratio,
 * stacked vertically, so 1 / 2 / 3 images are all complete.
 */
@media (max-width: 768px) {
    .phase8-editorial-row,
    .phase8-editorial-row.is-reverse {
        min-height: 0 !important;
        overflow: visible;
    }

    .phase8-editorial-media {
        display: block !important;
        width: 100%;
        min-height: 0 !important;
        height: auto !important;
        overflow: visible !important;
        background: transparent;
    }

    .phase8-editorial-gallery,
    .phase8-editorial-gallery.count-1,
    .phase8-editorial-gallery.count-2,
    .phase8-editorial-gallery.count-3 {
        display: flex !important;
        flex-direction: column;
        width: 100%;
        min-height: 0 !important;
        height: auto !important;
        gap: 6px;
        background: transparent;
    }

    .phase8-editorial-gallery.count-3 .item-1,
    .phase8-editorial-gallery.count-3 .item-2,
    .phase8-editorial-gallery.count-3 .item-3 {
        grid-column: auto !important;
        grid-row: auto !important;
    }

    .phase8-editorial-gallery-item {
        width: 100%;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible;
        background: transparent;
    }

    .phase8-editorial-gallery-item img,
    .phase8-editorial-gallery.count-1 img,
    .phase8-editorial-gallery.count-2 img,
    .phase8-editorial-gallery.count-3 img,
    .phase8-editorial-gallery.count-3 .item-1 img,
    .phase8-editorial-gallery.count-3 .item-2 img,
    .phase8-editorial-gallery.count-3 .item-3 img {
        display: block;
        width: 100%;
        max-width: 100%;
        height: auto !important;
        min-height: 0 !important;
        aspect-ratio: auto !important;
        object-fit: contain !important;
        object-position: center;
    }

    /*
     * 行程說明 editorial text stays fully visible on mobile so it cannot
     * be clipped by responsive layout changes.
     *
     * IMPORTANT: daily attraction descriptions are intentionally excluded
     * here. They must retain the 4-line clamp + 更多介紹 / 收起內容 UX.
     */
    .phase8-editorial-text.phase8-clamp {
        display: block !important;
        max-height: none !important;
        overflow: visible !important;
        -webkit-line-clamp: unset !important;
        -webkit-box-orient: initial !important;
        -webkit-mask-image: none !important;
        mask-image: none !important;
    }

    .phase8-editorial-copy > .phase8-readmore {
        display: none;
    }

    /* Daily itinerary attraction detail: compact by default on mobile. */
    .phase8-attraction-desc.phase8-clamp:not(.is-expanded) {
        display: -webkit-box !important;
        overflow: hidden !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 4 !important;
        max-height: none !important;
    }

    .phase8-attraction-desc.phase8-clamp.is-expanded {
        display: block !important;
        overflow: visible !important;
        -webkit-line-clamp: unset !important;
        -webkit-box-orient: initial !important;
    }

    .phase8-attraction-body > .phase8-readmore {
        display: inline-block;
    }
}


/* ==========================================================
   Phase 8.3 V1.0.2｜Departure live seat columns
   已報名 / 可售 are first-class columns instead of status subtext.
   ========================================================== */

.col-confirmed,
.col-allotment {
    flex: .72 0 76px;
    min-width: 72px;
    justify-content: center;
    text-align: center;
}

.phase8-seat-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 30px;
    padding: 4px 8px;
    border-radius: 8px;
    background: #f4f7f5;
    color: var(--theme-primary);
    font-weight: 700;
    font-size: .86rem;
    line-height: 1.2;
    white-space: nowrap;
}

.col-allotment .phase8-seat-number {
    background: #faf7f1;
    color: var(--theme-accent);
}

@media (max-width: 1100px) {
    .col-confirmed,
    .col-allotment {
        flex-basis: 70px;
        min-width: 66px;
    }
}

@media (max-width: 768px) {
    /*
     * Mobile departure rows already wrap into multiple lines.
     * Keep the two live metrics next to each other and visibly labeled,
     * rather than folding them back into the status badge.
     */
    .col-confirmed,
    .col-allotment {
        flex: 0 0 auto !important;
        min-width: 92px;
        margin-right: 8px;
        margin-bottom: 7px;
        justify-content: flex-start;
        text-align: left;
    }

    .col-confirmed::before,
    .col-allotment::before {
        display: inline-block;
        margin-right: 6px;
        color: var(--text-muted);
        font-size: .72rem;
        font-weight: 600;
    }

    .col-confirmed::before {
        content: '已報名';
    }

    .col-allotment::before {
        content: '可售';
    }

    .phase8-seat-number {
        min-width: 0;
        min-height: 28px;
        padding: 3px 7px;
        font-size: .82rem;
    }
}
