/*
 * "Local Inspiration" card - the picture and the words no longer share the same pixels.
 *
 * Before: the photo filled the whole card under a dark veil (65-95% opaque) and every line of text sat on top of it, so a good photo was
 * dim and a small logo was stretched to fill the card (a 500 px logo blown up almost four times).
 * Now: the picture has its own frame with nothing laid over it, and the words sit on their own solid panel.
 *   - phones and the split layout: the picture on top (16:10), the words below;
 *   - the wide layout (full-width card): the words on the left, the picture on the right, fading into the panel.
 * A picture that filling the frame would damage (a logo, a wide banner, a very small image) is shown whole at its own size
 * over a blurred copy of itself (.is-fit-contain, set by spotlights.js) - never stretched.
 *
 * TO GO BACK: delete the <link> to this file in resources/views/layouts/main.php. (The wrapper div in views/home/premium-spotlight.php is
 * harmless without it: the photo is absolutely positioned inside it and the old stylesheets then paint the card as before.)
 * Loaded after compact.css so it wins on equal specificity.
 */

/* ---- the card: a column - picture first, words below ------------------------------------------------------------------------------------ */
.premium-spotlight .premium-spotlight-card.premium-has-media { justify-content: flex-start; background: linear-gradient(180deg, #1b443f 0%, #153631 100%); }
.premium-spotlight-media { position: relative; z-index: 0; flex: 0 0 auto; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #0f2a28; }
@media (min-width: 576px) { .premium-spotlight-media { aspect-ratio: 2 / 1; } } /* a little shorter once the card is wide enough to stay clear at 2:1 */
.premium-spotlight-media .premium-spotlight-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* no veil over the picture (a card with no picture keeps its own gradient) */
:root .premium-spotlight .premium-spotlight-card.premium-has-media:not(.premium-no-photo)::after { content: none; }
.premium-spotlight-card.premium-no-photo .premium-spotlight-media { display: none; }

/* every slide gets the same height (the tallest one's); the picture takes up any slack, so the words and the controls never float apart */
.premium-spotlight-media { flex: 1 0 auto; }

/* a picture shown whole: its own size (never enlarged past the frame, never cropped) over a soft blurred copy of itself */
.premium-spotlight-media.is-fit-contain::before { content: ''; position: absolute; inset: -30px; background: var(--fit-bg) center / cover no-repeat; filter: blur(26px) saturate(1.15) brightness(.82); }
.premium-spotlight-media.is-fit-contain .premium-spotlight-photo { inset: 0; margin: auto; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
/* a see-through logo: a plain plate chosen from its artwork (spotlights.js) instead of a blurred copy */
.premium-spotlight-media.is-fit-contain[data-plate="light"] { background: #f6f3ec; }
.premium-spotlight-media.is-fit-contain[data-plate="dark"] { background: #10302d; }
.premium-spotlight-media.is-fit-contain[data-plate="light"]::before, .premium-spotlight-media.is-fit-contain[data-plate="dark"]::before { content: none; }

/* the words: their own panel, so the padding at the top no longer has to clear the header (the header sits on the picture).
   The button and the business name share one row (a grid) so the panel stays about as tall as the old card. */
.premium-spotlight-content { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 18px; align-items: center; align-content: start; padding: 18px 28px 74px; }
.premium-spotlight-content > * { grid-column: 1 / -1; }
.premium-spotlight-content > .premium-spotlight-cta { grid-column: 1; justify-self: start; }
.premium-spotlight-content > .premium-spotlight-attribution { grid-column: 2; }
.premium-spotlight-card.premium-no-photo .premium-spotlight-content { padding-top: 76px; }
.premium-spotlight-category { margin: 0 0 6px; }
.premium-spotlight-content h3 { max-width: 22ch; font-size: clamp(1.55rem, 1rem + 1.4vw, 2.1rem); line-height: 1.1; }
.premium-spotlight-description { margin-top: 6px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; line-clamp: 1; overflow: hidden; }
.premium-spotlight-cta { margin-top: 14px; }
.premium-spotlight-attribution { margin-top: 14px; }

/* "Local Inspiration" and "Discover something local" sit on the picture: a small dark pill each, so the photo itself stays clear */
.premium-spotlight-heading h2, .premium-spotlight-heading > span { padding: 6px 12px; border-radius: 999px; background: rgba(9, 28, 27, .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); text-shadow: none; }

@media (max-width: 575.98px) {
    /* too narrow for the button and the name side by side: one under the other */
    .premium-spotlight-content { display: block; padding: 18px 20px 76px; }
    .premium-spotlight-card.premium-no-photo .premium-spotlight-content { padding-top: 70px; }
    .premium-spotlight-content h3 { font-size: 1.6rem; }
}

/* ---- cards 480-991 px wide (the split layout, tablets): the button and the controls share ONE row -------------------------------------------
   The business logo / name / town moves up beside the category label, and the arrows, dots and pause button sit on the button's row.
   Needs container queries; a browser without them keeps the stacked arrangement above (same content, one row taller). */
.premium-spotlight { container: spotlight / inline-size; }
@container spotlight (min-width: 480px) and (max-width: 991.98px) {
    .premium-spotlight-content { padding: 16px 28px 22px; }
    .premium-spotlight-content > .premium-spotlight-category { grid-row: 1; grid-column: 1; align-self: center; margin: 0; white-space: nowrap; }
    .premium-spotlight-content > .premium-spotlight-attribution { grid-row: 1; grid-column: 2; justify-self: end; min-width: 0; max-width: 100%; margin: 0; gap: 9px; }
    .premium-spotlight-attribution > img, .premium-spotlight-avatar { width: 30px; height: 30px; border-radius: 8px; }
    .premium-spotlight-attribution strong { font-size: .8rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .premium-spotlight-attribution > div > span { margin-top: 1px; font-size: .68rem; }
    .premium-spotlight-content > h3 { grid-row: 2; margin-top: 10px; }
    .premium-spotlight-content > .premium-spotlight-description { grid-row: 3; }
    .premium-spotlight-content > .premium-spotlight-cta { grid-row: 4; grid-column: 1; }
    /* the controls: left edge just past the button (the longest label, "Meet this business", is about 205 px wide), right edge = the card's padding */
    .premium-spotlight .premium-spotlight-controls { inset: auto 28px 22px 248px; height: 48px; gap: 2px; }
    .premium-spotlight-controls .local-discovery-counter { display: none; }
    .premium-spotlight-controls .local-discovery-control { flex-basis: 40px; width: 40px; height: 40px; }
    .premium-spotlight-controls .local-discovery-dot { flex: 0 1 24px; width: 24px; height: 40px; }
    .premium-spotlight .premium-spotlight-progress { inset: auto 28px 9px; }
}
@container spotlight (min-width: 480px) and (max-width: 519.98px) {
    .premium-spotlight-controls .local-discovery-dots { display: none; } /* no room for the dots beside the button: arrows and pause stay */
}

/* ---- the wide layout: words left, picture right ----------------------------------------------------------------------------------------- */
@media (min-width: 992px) {
    .hero-spotlight-full .premium-spotlight-card.premium-has-media { justify-content: center; }
    .hero-spotlight-full .premium-spotlight-media { position: absolute; z-index: 0; inset: 0 0 0 auto; width: 56%; aspect-ratio: auto; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16%); mask-image: linear-gradient(90deg, transparent 0, #000 16%); }
    /* the words stay in the left column (the picture owns the right 56%), one block under another */
    .hero-spotlight-full .premium-spotlight-content { display: block; padding: 84px 32px 96px; }
    .hero-spotlight-full .premium-spotlight-card.premium-no-photo .premium-spotlight-content { padding-top: 96px; }
    .hero-spotlight-full .premium-spotlight-content > * { max-width: min(44vw, 560px); }
    .hero-spotlight-full .premium-spotlight-content h3 { max-width: min(44vw, 560px); font-size: clamp(2.2rem, 1.2rem + 2.4vw, 3.4rem); }
    .hero-spotlight-full .premium-spotlight-description { margin-top: 10px; }
    .hero-spotlight-full .premium-spotlight-cta { margin-top: 20px; }
    .hero-spotlight-full .premium-spotlight-attribution { margin-top: 22px; }
    /* the slide controls move off the picture onto the text panel, lined up under the words (they were over the photo's bottom corner) */
    .hero-spotlight-full .premium-spotlight-controls { left: calc((100% - min(100%, 1320px)) / 2 + 32px); right: auto; width: min(44vw, 420px); max-width: none; }
    .hero-spotlight-full .premium-spotlight-progress { left: calc((100% - min(100%, 1320px)) / 2 + 32px); right: auto; width: min(44vw, 420px); }
}
