﻿/* =========================================================================
   Discover Lockhart — content + right rail (inside the page container)
   ========================================================================= */
:root {
    --rail-navy: #1F3D58;
    --rail-navy-deep: #152c41;
    --rail-gold: #E5B700;
    --rail-red: #C14D3D;
    --rail-ink: #1d2733;
    --rail-muted: #6b7280;
    --rail-line: #e6e8ec;
    --rail-card: #ffffff;
}

/* ---------- Layout ---------- */
.cwr {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
}

.cwr-main {
    min-width: 0;
}

@media (min-width: 992px) {
    .cwr {
        grid-template-columns: minmax(0, 1fr) 300px;
        gap: 2rem;
    }
}

@media (min-width: 1200px) {
    .cwr {
        grid-template-columns: minmax(0, 1fr) 320px;
        gap: 2.5rem;
    }
}

/* ---------- Rail ---------- */
.ad-rail {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Desktop: the rail runs the full height of the content and the Featured card sticks as you scroll */
@media (min-width: 992px) {
    .ad-rail {
        height: 100%;
    }

    .rail-featured {
        position: sticky;
        top: 24px;
    }
}

.ad-rail a {
    text-decoration: none;
}

/* ---------- Card ---------- */
.rail-card {
    background: var(--rail-card);
    border: 1px solid var(--rail-line);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
}

.rail-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: 12px;
    min-height: 30px;
}

.rail-eyebrow {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--rail-muted);
}

.ad-rail .rail-head-link {
    display: inline-flex;
    align-items: center;
    font-size: .8rem;
    font-weight: 600;
    color: var(--rail-navy);
    transition: color .15s;
}

    .ad-rail .rail-head-link:hover {
        color: var(--rail-red);
    }

.rail-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: .01em;
    color: var(--rail-ink);
    display: flex;
    align-items: center;
    gap: .5rem;
}

    .rail-title::before {
        content: "";
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--rail-red);
    }

.rail-card-foot {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #eef0f3;
}

.ad-rail .rail-card-foot a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .85rem;
    font-weight: 600;
    color: var(--rail-navy);
}

    .ad-rail .rail-card-foot a:hover {
        color: var(--rail-red);
    }

/* ---------- House ads (shown until real ads exist) ---------- */
.ad-rail .rail-house {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: .4rem;
    padding: 22px;
    border-radius: 10px;
    overflow: hidden;
    background: radial-gradient(circle at 88% 12%, rgba(229, 183, 0, .28), transparent 42%), radial-gradient(circle at 0% 100%, rgba(193, 77, 61, .22), transparent 45%), linear-gradient(150deg, var(--rail-navy) 0%, var(--rail-navy-deep) 100%);
    color: #fff;
    transition: transform .2s ease, box-shadow .2s ease;
}

    .ad-rail .rail-house:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 24px rgba(21, 44, 65, .25);
    }

.ad-rail .rail-house-size {
    position: absolute;
    top: 12px;
    right: 14px;
    font: 600 .62rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: .06em;
    color: rgba(255, 255, 255, .45);
}

.ad-rail .rail-house-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(229, 183, 0, .16);
    color: var(--rail-gold);
    font-size: 1.1rem;
}

.ad-rail .rail-house-title {
    margin-top: .5rem;
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.15;
    color: #fff;
}

.ad-rail .rail-house-text {
    font-size: .88rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, .78);
}

.ad-rail .rail-house-cta {
    margin-top: .6rem;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem .95rem;
    border-radius: 999px;
    background: var(--rail-gold);
    color: var(--rail-navy);
    font-size: .85rem;
    font-weight: 700;
    transition: background .15s;
}

.ad-rail .rail-house:hover .rail-house-cta {
    background: #f2c61a;
}

.rail-house-square {
    aspect-ratio: 1 / 1;
}

/* ---------- Featured carousel ---------- */
.rail-nav {
    display: flex;
    gap: 6px;
}

.rail-nav-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--rail-line);
    background: #fff;
    color: var(--rail-navy);
    display: grid;
    place-items: center;
    padding: 0;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}

    .rail-nav-btn:hover {
        background: var(--rail-navy);
        border-color: var(--rail-navy);
        color: #fff;
    }

.rail-carousel {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    background: #0f1f2e;
    touch-action: pan-y;
}

.rail-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity .6s ease;
}

    .rail-slide.active {
        opacity: 1;
        pointer-events: auto;
    }

.rail-slide-media {
    position: absolute;
    inset: 0;
    display: block;
    overflow: hidden;
}

.rail-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s ease;
}

.rail-slide:hover img {
    transform: scale(1.03);
}

.ad-rail .rail-slide-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    color: var(--rail-navy);
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.rail-slide-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 56px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: linear-gradient(to top, rgba(10, 20, 32, .94) 0%, rgba(10, 20, 32, .6) 55%, rgba(10, 20, 32, 0) 100%);
}

.ad-rail .rail-slide-title {
    color: #fff;
    font-weight: 700;
    font-size: .98rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ad-rail .rail-slide-caption {
    color: rgba(255, 255, 255, .8);
    font-size: .8rem;
}

.rail-dots {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.rail-dot {
    width: 7px;
    height: 7px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #d1d5db;
    cursor: pointer;
    transition: width .25s ease, background .25s ease;
}

    .rail-dot:hover {
        background: #9ca3af;
    }

    .rail-dot.active {
        width: 20px;
        background: var(--rail-navy);
    }

@media (max-width: 991.98px) {
    .rail-dot {
        width: 9px;
        height: 9px;
    }

        .rail-dot.active {
            width: 24px;
        }
}

/* ---------- Event Details: rail inside the "When & where" sidebar ---------- */
/* The info card stops being sticky so it can't slide over the ads; the Featured card follows you instead. */
.dl-site .details-body .right.with-rail .info-card {
    position: static;
}

.details-body .right .rail-host {
    flex: 1 1 auto;
    margin-top: 24px;
}

    .details-body .right .rail-host .ad-rail {
        max-width: none;
        margin: 0;
    }



/* ---------- Ad image layout (Components/Shared/AdImage.razor) ---------- */
/* Fill & crop: covers the slot; inline object-position / scale come from the advertiser's choice */
.ad-rail img.ad-fill {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Show whole image: the full picture centered, a blurred copy filling the space around it */
.ad-rail .ad-fit {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #0f1f2e;
}

.ad-rail img.ad-fit-bg {
    position: absolute;
    inset: -12%;
    width: 124%;
    height: 124%;
    object-fit: cover;
    filter: blur(18px) brightness(.55) saturate(1.1);
    transform: none;
}

.ad-rail img.ad-fit-main {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: none;
}

/* Featured slides that show the whole image: picture on top, a solid caption bar under it.
   The bar grows to fit a two-line headline; the picture takes whatever height is left. */
.ad-rail .rail-slide.is-fit {
    display: flex;
    flex-direction: column;
}

    .ad-rail .rail-slide.is-fit .rail-slide-media {
        position: relative;
        inset: auto;
        flex: 1 1 auto;
        min-height: 0;
    }

    .ad-rail .rail-slide.is-fit .rail-slide-overlay {
        position: relative;
        flex: none;
        padding: 10px 14px 12px;
        background: rgba(10, 20, 32, .96);
    }

    .ad-rail .rail-slide.is-fit .rail-slide-title {
        -webkit-line-clamp: 2;
        font-size: .92rem;
    }

.rail-slide.is-fit:hover img {
    transform: none;
}

/* Admin list thumbnails reuse the same layout */
.dl-portal .adm-ad-thumb {
    position: relative;
}

    .dl-portal .adm-ad-thumb img.ad-fill {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .dl-portal .adm-ad-thumb .ad-fit {
        position: absolute;
        inset: 0;
        overflow: hidden;
        background: #0f1f2e;
    }

    .dl-portal .adm-ad-thumb img.ad-fit-bg {
        position: absolute;
        inset: -12%;
        width: 124%;
        height: 124%;
        object-fit: cover;
        filter: blur(10px) brightness(.55);
    }

    .dl-portal .adm-ad-thumb img.ad-fit-main {
        position: relative;
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

/* AdRailHost's wrapper: layout-neutral, so the rail's height (for the sticky card) is unchanged */
.ad-rail-host {
    display: contents;
}

/* ---------- Pinned bar (phones & tablets only; hidden on desktop) ---------- */
.rail-mini {
    display: none;
}

/* =========================================================================
   Phones & tablets (< 992px)
   The full Featured card (same as desktop) right after the page hero, with
   "Promote your event". Once it scrolls away, a slim bar with the current ad
   slides down and stays pinned to the top (wwwroot/js/ad-rail.js).
   ========================================================================= */
@media (max-width: 991.98px) {
    /* Something on the page is a few pixels wider than the screen, which widens the area the pinned bar
       is measured against (seen in narrow desktop windows and DevTools). Clip sideways overflow so the
       bar and the cards line up with the screen edges. "clip" (not "hidden") keeps sticky positioning working. */
    html,
    body {
        overflow-x: clip;
    }

    /* The card sits right under the hero: drop most of the section's top padding */
    .dl-site .section:has(> .cwr),
    .section:has(> .cwr) {
        padding-top: 16px;
    }

    .cwr {
        gap: 1.5rem;
    }

    .cwr-rail {
        order: -1; /* before the events / listings */
    }

    .ad-rail .rail-featured {
        width: 100%;
        max-width: 520px;
        margin: 0 auto;
        padding: 14px;
        border-radius: 16px;
        box-shadow: 0 2px 4px rgba(16, 24, 40, .04), 0 12px 32px rgba(16, 24, 40, .10);
    }

    .ad-rail .rail-carousel {
        border-radius: 12px;
    }

    .ad-rail .rail-slide-title {
        font-size: 1.05rem;
    }

    .ad-rail .rail-card-foot a {
        font-size: .95rem;
        padding: 4px 0;
    }

    /* Bigger tap targets for the arrows */
    .rail-nav-btn {
        width: 36px;
        height: 36px;
    }

    /* ---------- Pinned bar (about the size of an event card) ---------- */
    .rail-mini {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1050;
        /* Plain values first so the spacing holds even where env() isn't understood */
        padding: 10px 12px 8px;
        padding-top: calc(10px + env(safe-area-inset-top, 0px));
        background: rgba(246, 247, 249, .96);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        box-shadow: 0 6px 16px rgba(16, 24, 40, .12);
        transform: translateY(-110%);
        transition: transform .28s ease;
        pointer-events: none;
    }

        .rail-mini.show {
            transform: none;
            pointer-events: auto;
        }

    .ad-rail .rail-mini-link {
        display: flex;
        align-items: stretch;
        max-width: 520px;
        height: 140px;
        margin: 0 auto;
        border-radius: 14px;
        overflow: hidden;
        background: #0f1f2e;
        color: #fff;
        box-shadow: 0 4px 14px rgba(16, 24, 40, .18);
    }

    .rail-mini-media {
        position: relative;
        flex: 0 0 140px;
        height: 140px;
        overflow: hidden;
    }

    .ad-rail .rail-mini-media img.ad-fill {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .rail-mini-text {
        flex: 1 1 auto;
        min-width: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 3px;
        padding: 10px 12px 10px 14px;
    }

    .rail-mini-badge {
        font-size: .62rem;
        font-weight: 800;
        letter-spacing: .12em;
        text-transform: uppercase;
        color: var(--rail-gold);
    }

    .rail-mini-title {
        font-size: 1.02rem;
        font-weight: 700;
        line-height: 1.22;
        color: #fff;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .rail-mini-caption {
        font-size: .78rem;
        color: rgba(255, 255, 255, .75);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .rail-mini-more {
        display: none; /* shown when there's room (taller phones) */
    }

    .ad-rail .rail-mini-promote {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: .3rem;
        max-width: 520px;
        margin: 6px auto 0;
        padding: 0 2px;
        font-size: .78rem;
        font-weight: 700;
        color: var(--rail-navy);
    }

        .ad-rail .rail-mini-promote:hover {
            color: var(--rail-red);
        }
}

@media (max-width: 991.98px) and (min-height: 700px) {
    .ad-rail .rail-mini-link {
        height: 150px;
    }

    .rail-mini-media {
        flex-basis: 150px;
        height: 150px;
    }

    .rail-mini-more {
        display: inline-flex;
        align-items: center;
        gap: .3rem;
        margin-top: 4px;
        font-size: .78rem;
        font-weight: 700;
        color: var(--rail-gold);
    }
}

/* Event Details: single-column layout (up to 1024px) keeps the ads after the event info;
   on phones & tablets (< 992px) they're hidden so the event itself has the screen. */
@media (max-width: 1024px) {
    .details-body .right .rail-host {
        order: 4;
    }
}

@media (max-width: 991.98px) {
    .section.details .rail-host,
    .section.details .ad-rail,
    .section.details .rail-mini {
        display: none !important;
    }
}
