/* Shared event card. Used on the events list, profile pages, and anywhere
   else event tiles render. Extracted from events.css so non-events pages
   can use the same component. */

.event-card {
    position: relative;
    background: rgba(20, 0, 30, 0.6);
    border: 1px solid rgba(255, 0, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
    transition:
        transform var(--transition-normal),
        box-shadow var(--transition-normal),
        border-color var(--transition-normal);
    height: 100%;
    width: 100%;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
}

/* Bootstrap cols are flex items but not flex containers, so a child with
   height: 100% can't reliably resolve against the row's stretched height.
   Promote any col holding an .event-card to a flex container in column
   direction so the card stretches to match the tallest sibling. */
.row > [class*="col-"]:has(> .event-card) {
    display: flex;
    flex-direction: column;
}

/* Hover and keyboard focus: a small lift, the magenta border glow and a
   gradient accent drawn under the title, which stays white. */
.event-card:hover,
.event-card:focus-within {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-lg);
    border-color: var(--rave-glow-strong);
}

/* The title link is the card's one target, so its keyboard focus ring goes
   round the whole card; the link's own outline is turned off below. */
.event-card:has(.event-title a:focus-visible) {
    outline: 2px solid var(--rave-secondary);
    outline-offset: 2px;
}

/* The image area is square, because event posters are, so nearly every image
   fills it. The whole image always shows (contained, never cropped); any
   other shape (a tall poster, an older 16:9 upload, a Ticketmaster image) sits over a
   blurred copy of itself, which events/_card_media.html renders for those only. The image, the copy and
   the placeholder are all placed absolutely, so the square comes from
   aspect-ratio alone and every card in a row lines up; isolation keeps their
   stacking inside the box, under the title link's whole-card overlay. */
.event-card-media {
    position: relative;
    flex-shrink: 0;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    isolation: isolate;
    background: var(--rave-dark);
}

.event-card-media > .event-thumbnail,
.event-card-media > .event-thumbnail-backdrop,
.event-card-media > .event-thumbnail-placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.event-thumbnail {
    z-index: 1;
    object-fit: contain;
    display: block;
}

.event-thumbnail-backdrop {
    z-index: 0;
    object-fit: cover;
    filter: blur(20px) brightness(0.45);
    transform: scale(1.1);
    pointer-events: none;
}

.event-thumbnail-placeholder {
    background: linear-gradient(135deg, rgba(50, 0, 100, 0.6), rgba(100, 0, 50, 0.6));
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.4);
    font-family: Arial, sans-serif;
    font-size: 0.9rem;
}

.event-card-body {
    padding: 1.25rem;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.badge-genre {
    background: linear-gradient(45deg, #ff00ff, #9900ff);
    color: #fff;
    font-size: 0.7rem;
    padding: 0.3rem 0.7rem;
    border-radius: 15px;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 0.75rem;
    align-self: flex-start;
}

/* The event page header's "Under 18s" note beside its genre pill: an amber
   outline pill. The padding gives back the 1px border so it matches the genre
   pill's height. */
.badge-under-18s {
    background: transparent;
    border: 1px solid var(--rave-warning);
    color: var(--rave-warning);
    padding: calc(0.3rem - 1px) calc(0.7rem - 1px);
    /* "UNDER 18S" reads as "18S"; keep the words as written. */
    text-transform: none;
    flex-shrink: 0;
}

/* A featured event: a cyan outline and glow round the whole card, kept on
   hover and focus, with its "Featured" label at the card's foot
   (events/_card_end.html). Nothing is drawn over the poster. */
.event-card--featured {
    border-color: var(--rave-secondary);
    box-shadow: 0 0 0 1px var(--rave-secondary), 0 0 22px var(--rave-cyan-glow-soft);
}

.event-card--featured:hover,
.event-card--featured:focus-within {
    border-color: var(--rave-secondary);
    box-shadow: 0 0 0 1px var(--rave-secondary), var(--shadow-cyan-glow-md);
}

/* The event name: real Orbitron bold ('Orbitron Card', a card-only family
   in vendor/orbitron/orbitron.css, so nothing else on the site changes), and
   a short gradient bar under it that runs the full width on hover and focus.
   The title always shows in full, wrapping onto as many lines as it needs;
   the heading reserves at least two lines plus the bar, so short titles and
   the rows below them still line up across a grid row. */
.event-title {
    font-family: 'Orbitron Card', 'Orbitron', sans-serif;
    font-size: calc(1.2rem + 2px);
    font-weight: 700;
    line-height: 1.2;
    color: var(--rave-text-primary);
    text-shadow: 0 0 5px var(--rave-glow-medium);
    margin-bottom: 0.6rem;
    overflow-wrap: anywhere;
    min-height: calc((1.2rem + 2px) * 1.2 * 2 + 8px);
}

.event-title > a,
.event-title > span {
    display: block;
}

.event-title a {
    color: inherit;
    text-decoration: none;
}

.event-title a:hover,
.event-title a:focus-visible {
    color: inherit;
    outline: none;
}

.event-title::after {
    content: '';
    display: block;
    width: 32px;
    height: 2px;
    margin-top: 6px;
    border-radius: 1px;
    background: var(--gradient-horizontal);
    transition: width var(--transition-normal);
}

.event-card:hover .event-title::after,
.event-card:focus-within .event-title::after {
    width: 100%;
}

/* The details under the name (events/_card_details.html): when, in cyan
   capitals; where, in muted Arial; then the genre and the "Under 18s" note
   as small coloured words, so the name is the first thing on the card. */
.event-when {
    margin: 0 0 0.3rem;
    color: var(--rave-secondary);
    font-family: var(--font-primary);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.event-venue {
    margin: 0 0 0.35rem;
    color: rgba(255, 255, 255, 0.75);
    font-family: var(--font-body);
    font-size: 0.9rem;
}

.event-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 0.9rem;
    margin: 0;
}

/* The genre and the labels in the card's real bold cut ('Orbitron Card',
   as the title), so they read at a glance without a pill. */
.event-card-genre,
.event-card-under-18s,
.event-card-flag {
    font-family: 'Orbitron Card', 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.event-card-genre { color: var(--rave-primary); }

.event-card-under-18s {
    color: var(--rave-warning);
    /* "UNDER 18S" reads as "18S"; keep the words as written. */
    text-transform: none;
}

/* The card's end (events/_card_end.html), pushed to the bottom so a row of
   cards lines up: the price and "Featured", then the button at the card's
   full width. */
.event-card-end {
    margin-top: auto;
    padding-top: 0.75rem;
}

/* The price is the foot's last line, so prices sit level across a row; on a
   card too narrow for both, "Featured" moves above it, still on the right. */
.event-card-foot {
    display: flex;
    flex-wrap: wrap-reverse;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.4rem 0.75rem;
}

.event-card-flags {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.3rem 0.75rem;
    margin-left: auto;
}

.event-card-flag--featured { color: var(--rave-secondary); }

.event-card-end .btn-tickets {
    display: flex;
    width: 100%;
    min-height: 44px;
    margin-top: 0.75rem;
}

/* "From £X incl. fees" on our own events: small muted labels either side of the
   amount in the card's body white, on one baseline. No glow: the price is
   information, not a call to action. On a card too narrow for the line it
   wraps between its words, never inside the amount. */
.event-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 0.35rem;
    font-family: var(--font-body);
    margin: 0;
}

.event-price-label {
    color: var(--rave-text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
}

.event-price-amount {
    color: var(--rave-text-primary);
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
}

/* Reduced motion: no lift and no growing title bar. After the base rules it
   overrides, like every media block in this file. */
@media (prefers-reduced-motion: reduce) {
    .event-card,
    .event-title::after {
        transition: none;
    }

    .event-card:hover,
    .event-card:focus-within {
        transform: none;
    }
}

/* Phones: a smaller placeholder label, tighter padding and smaller titles.
   Last in the file on purpose: a media block only overrides the base rules it
   follows (store/tests/test_css_media_order.py). */
@media (max-width: 768px) {
    .event-thumbnail-placeholder { font-size: 0.8rem; }
    .event-card-body { padding: 0.9rem; }
    .event-title {
        font-size: calc(1rem + 2px);
        min-height: calc((1rem + 2px) * 1.2 * 2 + 8px);
    }
}
