/* ============================================================================
   Destinito Perks — the card and its grid.

   Linked by the surfaces that list Perks (the home hub via _HomeDestinito, and
   /Explore through the same partial). Same shape as /css/events-listing.css:
   one feature stylesheet, linked with ?v=AssetVersioning.Version.

   Only tokens already defined by the site are used — --navy*, --orange*,
   --white, --success, --radius-*, --elev-*, --dur-fast, --ease-out,
   --font-sans. No new design tokens are introduced here; a Perks card is a
   card like any other and should not invent a palette.
   ========================================================================= */

.destinito-perks-grid {
    display: grid;
    /* auto-fill, not auto-fit: with one or two deals the cards keep their width
       instead of stretching to fill the row, which is what makes a single Perk
       look like a card rather than a banner. */
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
    align-items: start;
}

/* The hub shows at most three; the compact variant tightens them for a section
   that sits between two denser ones. */
.destinito-perks-grid--compact {
    gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.destinito-perks-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--navy-200);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: box-shadow var(--dur-fast) var(--ease-out),
                transform var(--dur-fast) var(--ease-out);
}

.destinito-perks-card:hover {
    box-shadow: var(--elev-1);
}

/* ── Media ───────────────────────────────────────────────────────────────── */

.destinito-perks-card-media {
    position: relative;
    /* Reserves the box before the logo arrives, which is why the <img> carries no
       width/height: nothing records a logo's intrinsic size. */
    aspect-ratio: 16 / 10;
    background: var(--navy-050);
}

.destinito-perks-card-media img {
    width: 100%;
    height: 100%;
    /* contain, not cover: these are business LOGOS. Cover crops a wordmark and
       the merchant becomes unreadable, which is the one thing the image is for. */
    object-fit: contain;
    padding: 10px;
    box-sizing: border-box;
}

.destinito-perks-card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border-radius: var(--radius-pill);
    background: var(--navy);
    color: var(--white);
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .2px;
    /* The plane mark is the signal that a boarding pass is involved. Deliberately
       subtle — navy on the image, not a warning colour. */
}

.destinito-perks-card-badge i { font-size: 10px; }

/* The coin mark, for a merchant with no logo. White rather than --navy-050 because the
   source art carries its own near-white ground (#F8F6F8) — a 3/255 difference against white,
   invisible, where the tinted box would frame it as a visible lighter square. */
.destinito-perks-card-media--mark {
    background: var(--white);
}

.destinito-perks-card-media--mark img {
    padding: 16px;
}

/* ── Body ────────────────────────────────────────────────────────────────── */

.destinito-perks-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 13px;
    flex: 1 1 auto;
}

.destinito-perks-card-merchant {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    color: var(--navy-400);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.destinito-perks-card-offer {
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
    color: var(--navy);
}

.destinito-perks-card-offer strong { font-weight: 700; }

.destinito-perks-card-cap {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: var(--navy-400);
}

.destinito-perks-card-desc {
    margin: 2px 0 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--navy-400);
    /* Two lines, then ellipsis. Descriptions are merchant-written and unbounded;
       without this one long one sets the height of every card in the row. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.destinito-perks-card-meta {
    margin: 6px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11px;
    color: var(--navy-400);
}

.destinito-perks-card-meta:empty { display: none; }

.destinito-perks-card-min,
.destinito-perks-card-left {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: var(--navy-050);
}

/* Scarcity, shown only when genuinely scarce. Orange rather than a red: this is
   an incentive, not an error. */
.destinito-perks-card-left {
    background: var(--orange-050);
    color: var(--orange-press);
    font-weight: 700;
}

/* ── Footer / CTA ────────────────────────────────────────────────────────── */

.destinito-perks-card-foot {
    padding: 0 13px 13px;
}

.destinito-perks-card-cta {
    display: block;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    background: var(--navy);
    color: var(--white);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: background var(--dur-fast) var(--ease-out);
}

.destinito-perks-card-cta:hover { background: var(--navy-700); }

/* Already held — the visitor owns this one, so the card points at the wallet. */
.destinito-perks-card-cta--held {
    background: var(--white);
    color: var(--navy);
    border: 1px solid var(--navy-200);
}

/* Explicit zero remaining. A <span>, not an anchor: there is nothing to claim,
   and a disabled-looking link that still navigates is worse than no link. */
.destinito-perks-card-cta--disabled {
    background: var(--navy-050);
    color: var(--navy-400);
    cursor: default;
}

.destinito-perks-card--soldout .destinito-perks-card-media img,
.destinito-perks-card--soldout .destinito-perks-card-offer {
    opacity: .55;
}

/* A Perk from another island, which only happens on the bare tree where the hub
   shows several at once. Named so the visitor is never left thinking a deal two
   islands away is round the corner. */
.destinito-perks-card-where {
    margin: 4px 0 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--orange);
    text-transform: uppercase;
    letter-spacing: .4px;
}

/* ── Banner ──────────────────────────────────────────────────────────────────
   The section's header: a navy panel carrying real text plus the 3-D art. The
   supplied artwork had this copy baked into the pixels; it is HTML here so it
   translates, scales and can be read by clients that never see an image. */

.destinito-perks-banner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    overflow: hidden;
    margin-bottom: 16px;
    padding: 22px 0 22px 24px;
    border-radius: var(--radius-lg);
    /* The art's own background was keyed out against this exact value, so the two meet
       with no seam. */
    background: var(--navy);
}

.destinito-perks-banner-copy {
    flex: 1 1 auto;
    min-width: 0;
    padding: 6px 0;
}

.destinito-perks-wordmark {
    margin: 0;
    font-family: var(--font-sans);
    /* Scales with the panel instead of stepping at a breakpoint — the wordmark is the
       widest thing in the copy column and is what overflows first on a narrow phone. */
    font-size: clamp(26px, 6vw, 46px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.5px;
    color: var(--white);
}

.destinito-perks-wordmark-o { color: var(--orange); }

.destinito-perks-banner-sub {
    margin: 8px 0 0;
    font-size: clamp(13px, 2.2vw, 17px);
    line-height: 1.35;
    color: var(--white);
    opacity: .92;
}

.destinito-perks-banner-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 11px 22px;
    border-radius: var(--radius-pill);
    background: var(--orange);
    color: var(--white);
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: background var(--dur-fast) var(--ease-out);
}

.destinito-perks-banner-cta:hover { background: var(--orange-press); }

.destinito-perks-banner-art {
    flex: 0 0 auto;
    width: clamp(150px, 34%, 330px);
    height: auto;
    /* Bleeds to the panel's edges rather than sitting in a padded box, which is how the
       original artwork is composed. */
    margin: -22px 0;
    align-self: center;
}

@media (max-width: 560px) {
    .destinito-perks-banner {
        /* The art stops being decoration and starts crowding the CTA below ~560px.
           Dropping it keeps the promise and the button, which are the parts that do
           the work. */
        padding: 20px;
    }

    .destinito-perks-banner-art { display: none; }
}

@media (max-width: 480px) {
    .destinito-perks-grid,
    .destinito-perks-grid--compact {
        /* One column on a phone. Two 150px cards side by side truncate the
           merchant name, which is the field a visitor scans for. */
        grid-template-columns: 1fr;
    }
}
