/* ===========================================================================
   SECTION — TRIPS (coverflow)
   ---------------------------------------------------------------------------
   Glass trip cards over a darkened harbour photo. The front card is full
   size and lit; its neighbours sit back either side, smaller and dimmed.
   Positions are written per frame by assets/js/sections/trips-coverflow.js
   (transform, z-index, --cf-dim); this file only styles the states.
   Without JS (.cf without .is-ready) the cards are a plain wrapping row.
   =========================================================================== */

.trips {
    --cf-w: min(380px, 84vw);
    padding-block: 0 clamp(4rem, 8vw, 7rem);
    background: var(--navy-d);
    /* clip, not hidden: hidden would make this a scroll container and stop
       the stage sticking to the viewport */
    overflow-x: clip;
}

/* ---------------------------------------------------------------------------
   Pin + stage
   --------------------------------------------------------------------------- */
.trips__pin { position: relative; }

.trips__stage {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(1.25rem, 2.6vh, 2rem);
    padding-block: clamp(5rem, 10vw, 7.5rem) clamp(2rem, 4vw, 3rem);
    isolation: isolate;
}

.trips.is-pinned .trips__stage {
    position: sticky;
    top: 0;
    height: 100svh;
    min-height: 0;
    padding-block: calc(var(--header-h) + 0.5rem) 1.5rem;
}

/* Harbour photo behind the cards, darkened so the glass reads */
.trips__bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.trips__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 30%;
    transform: scale(1.06);
    filter: blur(3px) saturate(1.1);
}

.trips__bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(120% 70% at 50% 45%, rgba(5, 38, 61, 0.55) 0%, rgba(5, 38, 61, 0.86) 70%),
        linear-gradient(180deg, rgba(5, 38, 61, 0.7) 0%, rgba(5, 38, 61, 0.35) 40%, var(--navy-d) 100%);
}

/* ---------------------------------------------------------------------------
   Head — centred, as in the reference
   --------------------------------------------------------------------------- */
.trips__head {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.trips__head .eyebrow { margin-bottom: 0.875rem; }

.trips__head .h2 { color: var(--white); }

.trips__hand { color: var(--turq); }

.trips__lead {
    max-width: 50ch;
    margin: 0.75rem auto 0;
    font-size: clamp(0.975rem, 0.9rem + 0.35vw, 1.125rem);
    color: rgba(255, 255, 255, 0.78);
}

/* ---------------------------------------------------------------------------
   The row
   --------------------------------------------------------------------------- */
.cf { position: relative; }

.cf__track {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    padding-inline: var(--gutter);
}

.cf__item { width: var(--cf-w); }

/* JS on: stack the cards on one centre line and let the script place them */
.cf.is-ready .cf__track {
    display: block;
    position: relative;
    height: var(--cf-h, 560px);
    padding: 0;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}

.cf.is-ready .cf__item {
    position: absolute;
    left: 50%;
    top: 50%;
    margin-left: calc(var(--cf-w) / -2);
    will-change: transform, opacity;
    /* translate(-50%) on Y comes from the script, so tall and short cards
       share one centre line */
}

.cf.is-dragging .cf__track { cursor: grabbing; }
.cf.is-ready:not(.is-pinned-mode) .cf__track { cursor: grab; }

/* ---------------------------------------------------------------------------
   Card
   --------------------------------------------------------------------------- */
.trip-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: rgba(9, 44, 70, 0.66);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    backdrop-filter: blur(16px) saturate(1.3);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 26px;
    box-shadow: 0 24px 60px rgba(2, 16, 26, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    color: var(--white);
    transition: border-color 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

/* Set-back cards are dimmed by an overlay whose strength the script sets */
.trip-card::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 3;
    border-radius: inherit;
    background: rgba(3, 21, 31, 0.62);
    opacity: var(--cf-dim, 0);
    pointer-events: none;
}

.cf__item.is-active .trip-card {
    border-color: rgba(138, 240, 223, 0.55);
    box-shadow: 0 40px 90px rgba(2, 16, 26, 0.6),
                0 0 0 1px rgba(56, 225, 197, 0.22),
                inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

/* Side cards are a click target that brings them forward */
.cf.is-ready .cf__item:not(.is-active) { cursor: pointer; }

.trip-card__media {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--navy);
}

.trip-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s var(--ease);
    -webkit-user-drag: none;
}

.cf__item.is-active .trip-card__media img { transform: scale(1.04); }

/* Soft fade from photo into the glass body */
.trip-card__media::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 40%;
    background: linear-gradient(to bottom, rgba(9, 44, 70, 0), rgba(9, 44, 70, 0.66));
}

.trip-card__badge {
    position: absolute;
    top: 0.875rem;
    left: 0.875rem;
    z-index: 2;
    padding: 0.375rem 0.8125rem;
    background: var(--yellow);
    color: var(--navy);
    font-family: var(--font-ui);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(5, 38, 61, 0.3);
}

.trip-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.125rem 1.375rem 1.375rem;
    flex: 1;
}

.trip-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.trip-card__tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3125rem 0.6875rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    font-family: var(--font-ui);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
}

.trip-card__tag--time {
    border-color: rgba(56, 225, 197, 0.4);
    background: rgba(56, 225, 197, 0.12);
    color: var(--turq-l);
}

.trip-card__tag svg { width: 13px; height: 13px; }

.trips .trip-card__name {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--white);
}

/* Three lines on the set-back cards; the front card opens to the full copy */
.trip-card__blurb {
    --lh: 1.6;
    margin: 0;
    max-height: calc(3 * var(--lh) * 1em);
    overflow: hidden;
    font-size: 0.875rem;
    line-height: var(--lh);
    color: rgba(255, 255, 255, 0.74);
    -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
    mask-image: linear-gradient(to bottom, #000 55%, transparent);
    transition: max-height 0.7s var(--ease);
}

.trip-card__blurb strong { display: block; color: var(--white); font-weight: 600; }

.cf__item.is-active .trip-card__blurb,
.cf__item.is-measuring .trip-card__blurb,
.cf:not(.is-ready) .trip-card__blurb {
    max-height: calc(12 * var(--lh) * 1em);
    -webkit-mask-image: none;
    mask-image: none;
}

/* Departure times ride on the photo as a glass pill */
.trip-card__depart {
    position: absolute;
    left: 0.875rem;
    bottom: 0.75rem;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.5rem;
    margin: 0;
    padding: 0.375rem 0.8125rem;
    background: rgba(5, 38, 61, 0.68);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    font-family: var(--font-ui);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--white);
    font-variant-numeric: tabular-nums;
}

.trip-card__depart-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--turq);
}

.trip-card__prices {
    display: flex;
    gap: 1.5rem;
    margin-top: auto;
    padding-top: 0.875rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.trip-card__price { display: flex; flex-direction: column; gap: 0.2rem; }

.trip-card__price-label {
    font-family: var(--font-ui);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

.trip-card__price-label em {
    font-style: normal;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--turq-l);
}

.trip-card__price-main {
    font-family: var(--font-display);
    font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem);
    font-weight: 800;
    line-height: 1;
    color: var(--white);
    font-variant-numeric: tabular-nums;
}

.trip-card__price--child .trip-card__price-main { color: var(--turq-l); }

.trip-card__cta { width: 100%; justify-content: center; }

/* ---------------------------------------------------------------------------
   Arrows, dots, hint
   --------------------------------------------------------------------------- */
.cf__arrow {
    position: absolute;
    top: 50%;
    z-index: 200;
    display: none;
    place-items: center;
    width: 52px;
    height: 52px;
    padding: 0;
    color: var(--white);
    background: rgba(9, 62, 98, 0.45);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    transform: translateY(-50%);
    transition: background 0.3s var(--ease), color 0.3s var(--ease), opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.cf__arrow svg { width: 20px; height: 20px; }
.cf__arrow:hover { background: var(--turq); color: var(--navy); }
.cf__arrow:active { transform: translateY(-50%) scale(0.94); }
.cf__arrow:disabled { opacity: 0.3; pointer-events: none; }

.cf__arrow--prev { left: max(var(--gutter), calc(50% - var(--cf-w) * 1.45)); }
.cf__arrow--next { right: max(var(--gutter), calc(50% - var(--cf-w) * 1.45)); }

.cf.is-ready .cf__arrow { display: grid; }

.cf__nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.625rem;
}

.cf__hint {
    font-family: var(--font-ui);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    padding-left: 0.3em;
}

.cf:not(.is-ready) ~ .cf__nav { display: none; }

.cf__dots { display: flex; gap: 0.375rem; }

.cf__dot {
    position: relative;
    width: 34px;
    height: 18px;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
}

/* The visible bar is thin; the button itself is a comfortable tap target */
.cf__dot::before,
.cf__dot-fill {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 3px;
    margin-top: -1.5px;
    border-radius: 3px;
}

.cf__dot::before { background: rgba(255, 255, 255, 0.22); }

.cf__dot-fill {
    background: var(--turq);
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 0.45s var(--ease);
}

.cf__dot.is-active .cf__dot-fill { transform: scaleX(1); }

/* ---------------------------------------------------------------------------
   Fact strip
   --------------------------------------------------------------------------- */
.cf__facts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.75rem;
    width: fit-content;
    max-width: 100%;
    margin: clamp(1rem, 2vw, 1.5rem) auto 0;
    padding: 0.75rem 1.75rem;
    background: rgba(255, 255, 255, 0.06);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
}

.cf__facts li {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-ui);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.82);
}

.cf__facts li::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--turq);
}

/* ---------------------------------------------------------------------------
   Under the row: times + weather
   --------------------------------------------------------------------------- */
.trips__slots {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    max-width: 760px;
    margin: clamp(2.5rem, 5vw, 3.5rem) auto 0;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.78);
}

.trips__slots strong { color: var(--white); font-weight: 600; }

.trips__slots svg { width: 22px; height: 22px; flex-shrink: 0; margin-top: 0.1rem; color: var(--turq); }

/* Weather / safety note — a glass strip under the cards */
.trips__weather {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    max-width: 760px;
    margin: 1.5rem auto 0;
    padding: clamp(1.125rem, 2.5vw, 1.5rem) clamp(1.25rem, 3vw, 1.75rem);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--r-lg);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.trips__weather-icon { width: 30px; height: 30px; flex-shrink: 0; color: var(--turq); }

.trips__weather-title {
    margin: 0 0 0.375rem;
    font-family: var(--font-display);
    font-size: clamp(1.0625rem, 1rem + 0.5vw, 1.3125rem);
    font-weight: 600;
    line-height: 1.3;
    color: var(--white);
}

.trips__weather-text {
    margin: 0;
    font-size: 0.975rem;
    color: rgba(255, 255, 255, 0.75);
}

/* ---------------------------------------------------------------------------
   Sizes
   --------------------------------------------------------------------------- */
@media (min-width: 760px) {
    .trips { --cf-w: min(360px, 40vw); }
}

@media (min-width: 1000px) {
    .trips { --cf-w: min(400px, 29vw); }
}

/* Pinned on a shorter desktop: trim the head so the row keeps its room */
@media (max-height: 980px) {
    .trips.is-pinned .trips__lead { display: none; }
    .trips.is-pinned .trips__stage { gap: 1rem; }
}

@media (max-width: 759px) {
    /* Swipe and the dots carry it on phones; arrows would sit on the copy */
    .cf.is-ready .cf__arrow { display: none; }
    .cf__facts { border-radius: var(--r-lg); padding: 0.875rem 1.25rem; gap: 0.5rem 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
    .trip-card__blurb, .trip-card__media img { transition: none; }
}
