/* ============================================================
   Sweebrew Travel Landing Page
   Shared layout for state / region / country landing pages
   ============================================================ */

.travel-landing {
    width: 94%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 12px 0 28px;
}

/* ------------------------------------------------------------
   Navigation banner
   ------------------------------------------------------------ */
.travel-hero-panel {
    background: #fff;
    border: 2px solid #7aa7bd;
    border-radius: 24px;
    box-shadow: 0 3px 9px rgba(0,0,0,0.12);
    padding: 16px 18px;
    margin: 0 0 18px;
}

.travel-hero-inner {
    display: grid;
    grid-template-columns: minmax(300px, 0.9fr) minmax(520px, 1.1fr);
    gap: 28px;
    align-items: center;
}

.travel-intro {
    padding: 6px 0 6px 2px;
}

.travel-intro h1 {
    margin: 0 0 7px;
    font-family: Garamond, Georgia, serif;
    font-size: 40px;
    font-weight: 500;
    letter-spacing: 4px;
    line-height: 1.1;
    color: #444;
}

.travel-intro p {
    margin: 0;
    max-width: 460px;
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    line-height: 1.45;
    color: #666;
}

/* ------------------------------------------------------------
   Destination links

   Desktop behavior:
   - 1 to 4 links stay on one centered row
   - 5 links display as 3 on the first row and 2 centered below
   - 6 links display as 3 + 3
   ------------------------------------------------------------ */
.travel-destination-grid {
    display: grid;
    gap: 8px 10px;
    justify-content: center;
}

/* 1 destination */
.travel-destination-grid:has(.travel-destination-card:first-child:last-child) {
    grid-template-columns: minmax(145px, 1fr);
    width: 25%;
    margin-left: auto;
}

/* 2 destinations */
.travel-destination-grid:has(.travel-destination-card:nth-child(2):last-child) {
    grid-template-columns: repeat(2, minmax(145px, 1fr));
    width: 50%;
    margin-left: auto;
}

/* 3 destinations */
.travel-destination-grid:has(.travel-destination-card:nth-child(3):last-child) {
    grid-template-columns: repeat(3, minmax(145px, 1fr));
    width: 75%;
    margin-left: auto;
}

/* 4 destinations */
.travel-destination-grid:has(.travel-destination-card:nth-child(4):last-child) {
    grid-template-columns: repeat(4, minmax(135px, 1fr));
    width: 100%;
}

/* Exactly 5 destinations.
   Six grid columns let the second row of two cards sit centered
   beneath the first row of three. */
.travel-destination-grid:has(.travel-destination-card:nth-child(5):last-child) {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    width: 100%;
}

.travel-destination-grid:has(.travel-destination-card:nth-child(5):last-child)
.travel-destination-card {
    grid-column: span 2;
}

.travel-destination-grid:has(.travel-destination-card:nth-child(5):last-child)
.travel-destination-card:nth-child(4) {
    grid-column: 2 / span 2;
}

.travel-destination-grid:has(.travel-destination-card:nth-child(5):last-child)
.travel-destination-card:nth-child(5) {
    grid-column: 4 / span 2;
}

/* 6 or more destinations use three columns.
   This currently gives six links a clean 3 + 3 layout. */
.travel-destination-grid:has(.travel-destination-card:nth-child(6)) {
    grid-template-columns: repeat(3, minmax(145px, 1fr));
    width: 100%;
}

.travel-destination-card {
    display: block;
    overflow: hidden;
    background: #fff;
    border: 1px solid #d6d6d6;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.10);
    color: #333;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.travel-destination-card:hover,
.travel-destination-card:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 11px rgba(0,0,0,0.16);
    border-color: #7aa7bd;
    color: #333;
    text-decoration: none;
}

/* Destination images keep their original aspect ratio.
   No fixed height and no cropping. */
.travel-destination-image {
    width: 100%;
    overflow: hidden;
    background: #fff;
}

.travel-destination-image img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
}

/* Retained for compatibility with Europe flag cards. */
.travel-destination-card.is-contain .travel-destination-image img {
    width: 100%;
    height: auto;
}

.travel-destination-caption {
    display: block;
    padding: 6px 5px 7px;
    text-align: center;
    font-family: Garamond, Georgia, serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.15;
    color: #333;
    background: #fff;
}

/* ------------------------------------------------------------
   Europe overview
   Europe flags intentionally use a narrower overall grid.
   Adjust this percentage independently of the state pages.
   ------------------------------------------------------------ */
.europe-flag-grid {
    width: 75% !important;
    margin-left: auto;
}

/* ------------------------------------------------------------
   Photography showcase
   The image intentionally fills the frame; modest cropping is okay.
   ------------------------------------------------------------ */
.travel-showcase {
    position: relative;
    width: 100%;
    height: 800px;
    overflow: hidden;
    background: #111;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.20);
}

.travel-showcase .europe-fade-banner {
    position: relative;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    max-width: none;
    margin: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: none;
}

.travel-showcase .fade-image {
    width: 100%;
    height: 100%;
}

.travel-showcase .fade-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Optional per-image crop control examples:
   style="object-position:center 35%;"
   style="object-position:35% center;"
*/

.travel-showcase .country-caption {
    font-size: 17px;
}

/* ------------------------------------------------------------
   Responsive layout
   ------------------------------------------------------------ */
@media screen and (max-width: 1050px) {
    .travel-hero-inner {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .travel-intro {
        text-align: center;
    }

    .travel-intro p {
        margin: 0 auto;
    }

    .travel-destination-grid {
        max-width: 760px;
        margin: 0 auto;
    }

    .travel-showcase {
        height: 460px;
    }
}

@media screen and (max-width: 767px) {
    .travel-landing {
        width: 100%;
        padding: 10px 10px 24px;
    }

    .travel-hero-panel {
        padding: 14px 12px;
        border-radius: 18px;
        margin-bottom: 14px;
    }

    .travel-intro h1 {
        font-size: 30px;
        letter-spacing: 3px;
    }

    .travel-intro p {
        font-size: 15px;
    }

    .travel-destination-grid {
        grid-template-columns: repeat(2, minmax(130px, 1fr));
        gap: 8px;
    }

    .travel-destination-caption {
        font-size: 15px;
    }

    .travel-showcase {
        height: 52vh;
        min-height: 320px;
        max-height: 460px;
        border-radius: 8px;
    }

    .travel-showcase .europe-fade-banner {
        border-radius: 8px;
    }

    .travel-showcase .country-caption {
        font-size: 14px;
        padding: 20px 24px;
    }
}

@media screen and (max-width: 480px) {
    .travel-destination-grid {
        grid-template-columns: 1fr;
    }

    .travel-destination-card {
        display: grid;
        grid-template-columns: 120px 1fr;
        align-items: stretch;
    }

    .travel-destination-caption {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 8px;
    }

    .travel-showcase {
        height: 50vh;
        min-height: 300px;
    }
}

/* ============================================================
   HORIZONTAL DESTINATION STRIP
   Pilot layout for landing pages with more destination links.
   Existing .travel-destination-grid pages are unaffected.
   ============================================================ */

.travel-destination-strip {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    gap: 8px;
    align-items: center;
    width: calc(100% + 100px);
    margin-left: -100px;
}

.travel-strip-viewport {
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.travel-strip-viewport::-webkit-scrollbar {
    display: none;
}

.travel-strip-track {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    width: 100%;
    min-width: 100%;
    scroll-snap-type: x proximity;
}

/* Show roughly 4.25 cards on desktop so the next destination
   deliberately peeks into view as a cue that more links exist. */
.travel-strip-track .travel-destination-card {
    flex: 0 0 23%;
    min-width: 0;
    scroll-snap-align: start;
}

/* Arrow buttons */
.travel-strip-arrow {
    width: 34px;
    height: 58px;
    padding: 0;
    border: 1px solid #b7c7d0;
    border-radius: 8px;
    background: rgba(255,255,255,0.96);
    color: #607d8b;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.10);
    transition: background 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.travel-strip-arrow:hover,
.travel-strip-arrow:focus {
    background: #f3f7f9;
    color: #335d72;
    outline: none;
}

.travel-strip-arrow.is-hidden {
    visibility: hidden;
    pointer-events: none;
}

.travel-strip-arrow:disabled {
    opacity: 0.30;
    cursor: default;
}

/* Tablet: show about three cards at a time. */
@media screen and (max-width: 1050px) {
    .travel-strip-track .travel-destination-card {
        flex-basis: calc((100% - 20px) / 3);
    }
}

/* Mobile: swipeable strip with two cards visible. */
@media screen and (max-width: 767px) {
    .travel-destination-strip {
        grid-template-columns: 30px minmax(0, 1fr) 30px;
        gap: 5px;
    }

    .travel-strip-arrow {
        width: 30px;
        height: 52px;
        font-size: 20px;
    }

    .travel-strip-track {
        gap: 8px;
    }

    .travel-strip-track .travel-destination-card {
        flex: 0 0 calc((100% - 8px) / 2);
        display: block;
    }
}

/* Very small phones: one large card at a time. */
@media screen and (max-width: 480px) {
    .travel-strip-track .travel-destination-card {
        flex-basis: 100%;
        display: block;
    }
}

/* ============================================================
   SHARED HORIZONTAL DESTINATION NAVIGATION
   JavaScript upgrades ordinary .travel-destination-grid sections
   into a one-row strip. The original grid rules above remain as
   a no-JavaScript fallback. Europe flag grids are not upgraded.
   ============================================================ */

.travel-destination-grid.is-horizontal-strip {
    position: relative;
    display: grid;
    /*
       !important is intentional here. The legacy count-based
       .travel-destination-grid:has(...) rules have higher specificity.
       Once JS upgrades the grid to a horizontal strip, this layout
       must override those old 1-6 destination grid definitions.
    */
    grid-template-columns: 34px minmax(0, 1fr) 34px !important;
    gap: 8px;
    align-items: center;
    width: calc(100% + 100px) !important;
    max-width: none !important;
    margin-left: -100px !important;
    margin-right: 0 !important;
}

.travel-destination-grid.is-horizontal-strip .travel-strip-viewport {
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.travel-destination-grid.is-horizontal-strip .travel-strip-viewport::-webkit-scrollbar {
    display: none;
}

.travel-destination-grid.is-horizontal-strip .travel-strip-track {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    width: 100%;
    min-width: 100%;
    scroll-snap-type: x proximity;
}

.travel-destination-grid.is-horizontal-strip .travel-destination-card {
    flex: 0 0 23%;
    min-width: 0;
    grid-column: auto !important;
    scroll-snap-align: start;
}

.travel-destination-grid.is-horizontal-strip .travel-strip-arrow {
    width: 34px;
    height: 58px;
    padding: 0;
    border: 1px solid #b7c7d0;
    border-radius: 8px;
    background: rgba(255,255,255,0.96);
    color: #607d8b;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.10);
    transition: background 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.travel-destination-grid.is-horizontal-strip .travel-strip-arrow:hover,
.travel-destination-grid.is-horizontal-strip .travel-strip-arrow:focus {
    background: #f3f7f9;
    color: #335d72;
    outline: none;
}

.travel-destination-grid.is-horizontal-strip .travel-strip-arrow.is-hidden {
    visibility: hidden;
    pointer-events: none;
}

.travel-destination-grid.is-horizontal-strip .travel-strip-arrow:disabled {
    opacity: 0.30;
    cursor: default;
}

@media screen and (max-width: 1050px) {
    .travel-destination-grid.is-horizontal-strip {
        width: 100% !important;
        max-width: 760px !important;
        margin: 0 auto !important;
    }

    .travel-destination-grid.is-horizontal-strip .travel-strip-track .travel-destination-card {
        flex-basis: calc((100% - 20px) / 3);
    }
}

@media screen and (max-width: 767px) {
    .travel-destination-grid.is-horizontal-strip {
        grid-template-columns: 30px minmax(0, 1fr) 30px;
        gap: 5px;
    }

    .travel-destination-grid.is-horizontal-strip .travel-strip-arrow {
        width: 30px;
        height: 52px;
        font-size: 20px;
    }

    .travel-destination-grid.is-horizontal-strip .travel-strip-track {
        gap: 8px;
    }

    .travel-destination-grid.is-horizontal-strip .travel-strip-track .travel-destination-card {
        flex: 0 0 calc((100% - 8px) / 2);
        display: block;
    }
}

@media screen and (max-width: 480px) {
    .travel-destination-grid.is-horizontal-strip .travel-strip-track .travel-destination-card {
        flex-basis: 100%;
        display: block;
    }
}

/* ============================================================
   MOBILE / TOUCH RESPONSIVE HARDENING
   Prevent landing-page hero content from creating horizontal
   overflow on phones whose browsers report a wider CSS viewport.
   ============================================================ */

.travel-hero-panel,
.travel-hero-inner,
.travel-intro,
.travel-destination-grid,
.travel-destination-strip,
.travel-strip-viewport,
.travel-strip-track {
    box-sizing: border-box;
}

.travel-hero-inner,
.travel-intro {
    min-width: 0;
    max-width: 100%;
}

.travel-intro h1,
.travel-intro p {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
}

/*
   Some mobile browsers/devices can behave more like the tablet
   breakpoint even in portrait. Treat coarse-pointer portrait
   devices up to 1050px as mobile navigation layouts as well.
*/
@media screen and (max-width: 900px),
       screen and (hover: none) and (pointer: coarse) and (orientation: portrait) and (max-width: 1050px) {

    .travel-landing {
        width: 100%;
        max-width: 100%;
        padding: 10px 10px 24px;
        overflow-x: hidden;
    }

    .travel-hero-panel {
        width: 100%;
        max-width: 100%;
        padding: 14px 12px;
        border-radius: 18px;
        margin-bottom: 14px;
        overflow: hidden;
    }

    .travel-hero-inner {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
        width: 100%;
        max-width: 100%;
    }

    .travel-intro {
        width: 100%;
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
        text-align: center;
    }

    .travel-intro h1 {
        margin-left: auto;
        margin-right: auto;
        font-size: clamp(27px, 7vw, 34px);
        letter-spacing: clamp(1px, 0.7vw, 3px);
        line-height: 1.08;
    }

    .travel-intro p {
        width: 100%;
        max-width: 520px;
        margin-left: auto;
        margin-right: auto;
        padding: 0 4px;
        font-size: 15px;
        line-height: 1.4;
    }

    /* Authored strip pages such as Italy: remove desktop left shift. */
    .travel-destination-strip {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        grid-template-columns: 30px minmax(0, 1fr) 30px;
        gap: 5px;
    }

    /* Runtime-enhanced state/country grids: keep completely inside panel. */
    .travel-destination-grid.is-horizontal-strip {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        grid-template-columns: 30px minmax(0, 1fr) 30px !important;
        gap: 5px;
    }

    .travel-destination-grid.is-horizontal-strip .travel-strip-viewport,
    .travel-destination-strip .travel-strip-viewport {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .travel-destination-grid.is-horizontal-strip .travel-strip-track,
    .travel-destination-strip .travel-strip-track {
        width: 100%;
        min-width: 100%;
        gap: 8px;
    }

    /* Two destinations visible at once on portrait phones/touch devices. */
    .travel-destination-grid.is-horizontal-strip .travel-strip-track .travel-destination-card,
    .travel-destination-strip .travel-strip-track .travel-destination-card {
        flex: 0 0 calc((100% - 8px) / 2);
        min-width: 0;
        display: block;
    }

    .travel-destination-grid.is-horizontal-strip .travel-strip-arrow,
    .travel-destination-strip .travel-strip-arrow {
        width: 30px;
        height: 52px;
        font-size: 20px;
    }
}

/* Very narrow phones: one destination card at a time. */
@media screen and (max-width: 430px) {
    .travel-destination-grid.is-horizontal-strip .travel-strip-track .travel-destination-card,
    .travel-destination-strip .travel-strip-track .travel-destination-card {
        flex-basis: 100%;
    }

    .travel-intro h1 {
        font-size: 28px;
        letter-spacing: 1.5px;
    }
}

/* ============================================================
   MOBILE SHOWCASE ASPECT RATIO
   Preserve the desktop showcase proportions on phones instead
   of forcing the slideshow into a tall viewport-height frame.
   Desktop remains unchanged.
   ============================================================ */

@media screen and (max-width: 900px),
       screen and (hover: none) and (pointer: coarse) and (orientation: portrait) and (max-width: 1050px) {

    .travel-showcase {
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;
        aspect-ratio: 15 / 8;
        border-radius: 8px;
    }

    .travel-showcase .europe-fade-banner {
        width: 100%;
        height: 100%;
        aspect-ratio: auto;
        border-radius: 8px;
    }

    .travel-showcase .fade-image,
    .travel-showcase .fade-image img {
        width: 100%;
        height: 100%;
    }
}

