/* Shared by the shop app and the backoffice (EventCardView.razor). --event-color: the event's colour ("#RRGGBB"), set inline on the card. Same look and sizes as the
   "Os meus espaços" cards (SpaceCard.razor.css): 24px corners, the colour glowing inside the card from the bottom edge
   up (nothing outside the card) and the small frosted button. */

.event-card {
    --event-color: var(--color-primary, #17189B);
    position: relative;
    isolation: isolate;
    border-radius: 24px;
}

.event-card__surface {
    position: relative;
    display: flex;
    overflow: hidden;
    min-height: 260px;
    border-radius: inherit;
    background-color: var(--event-color);
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--event-color) 30%, transparent),
        0 10px 22px -16px rgba(15, 16, 60, 0.45);
    isolation: isolate;
}

.event-card--plain .event-card__surface {
    background-image:
        radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--color-accent, #E8BC33) 30%, transparent), transparent 50%),
        linear-gradient(160deg, color-mix(in srgb, var(--event-color) 82%, white) 0%, var(--event-color) 55%, color-mix(in srgb, var(--event-color) 70%, black) 100%);
}

/* With a banner, a poster layout (like the event artwork "Natal à Porta"): the banner is the background, whole and not
   darkened (its art usually sits at the right); the texts are on the left — the title big, bold, upper case and in the
   ATL yellow, the description in white under it, then the dates and the button. Only the left side gets a soft wash in
   the event's colour, so the texts read over any banner. */
/* Sizes follow the card (container query units), not the screen: on desktop there are two cards side by side. */
.event-card--banner {
    container-type: inline-size;
}

/* At least 3:1 (and 240px), growing when the texts need more: nothing is squeezed. */
.event-card--banner .event-card__surface {
    min-height: max(240px, 33.34cqi);
}

.event-card--banner .event-card__content > * {
    flex-shrink: 0;
}

.event-card__banner {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right center;
}

.event-card--banner .event-card__surface::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--event-color) 70%, transparent) 0%,
        color-mix(in srgb, var(--event-color) 35%, transparent) 45%,
        transparent 70%);
    pointer-events: none;
}

.event-card--banner .event-card__content {
    justify-content: center;
    max-width: 68%;
    padding: clamp(16px, 4%, 32px);
}

.event-card--banner .event-card__title {
    order: 1;
    font-size: clamp(26px, 8.5cqi, 60px);
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    color: var(--event-title-color, var(--color-accent, #E8BC33));
    text-shadow: none;
    overflow-wrap: anywhere;
}

.event-card--banner .event-card__description {
    order: 2;
    margin-top: 10px;
    font-size: clamp(13px, 2.4cqi, 17px);
    font-weight: 700;
    color: var(--event-text-color, var(--color-on-primary, #fff));
    -webkit-line-clamp: 2;
}

.event-card--banner .event-card__dates {
    order: 3;
    margin: 12px 0 0;
    color: var(--event-text-color, var(--color-on-primary, #fff));
    text-shadow: none;
}

/* Solid yellow button with the event's colour, like the title (the frosted one fades into the poster). */
.event-card--banner .event-card__btn {
    order: 4;
    height: 44px;
    margin-top: 16px;
    padding: 0 20px;
    border-color: transparent;
    background: var(--event-button-color, var(--color-accent, #E8BC33));
    color: var(--event-button-text-color, var(--event-color));
    box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.45);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.event-card--banner .event-card__btn:hover {
    background: color-mix(in srgb, var(--event-button-color, var(--color-accent, #E8BC33)) 88%, white);
}

.event-card--banner .event-card__btn:focus-visible {
    outline-color: var(--event-button-color, var(--color-accent, #E8BC33));
}

/* "✓ Inscrito": the state, not a button: stays light, with the yellow tick. */
.event-card--banner .event-card__done {
    background: color-mix(in srgb, var(--color-on-primary, #fff) 18%, transparent);
    color: var(--color-on-primary, #fff);
    box-shadow: none;
}

/* Narrow cards (phones): the texts get more of the width. */
@container (max-width: 480px) {
    .event-card--banner .event-card__content {
        max-width: 78%;
    }
}

.event-card__content {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 20px;
    color: var(--color-on-primary, #fff);
}

.event-card__dates {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px;
    font: 700 13px/1.2 var(--font-sans, "Inter", "Segoe UI", system-ui, sans-serif);
    letter-spacing: 0.02em;
    color: var(--event-text-color, var(--color-accent, #E8BC33));
    text-shadow: 0 1px 10px color-mix(in srgb, var(--event-color) 40%, black);
}

.event-card__dates svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.event-card__title {
    margin: 0;
    font: 800 24px/1.12 var(--font-sans, "Inter", "Segoe UI", system-ui, sans-serif);
    letter-spacing: -0.02em;
    color: var(--event-title-color, var(--color-on-primary, #fff));
    text-shadow: 0 1px 12px color-mix(in srgb, var(--event-color) 40%, black);
}

.event-card__description {
    display: -webkit-box;
    overflow: hidden;
    margin: 8px 0 0;
    font: 500 14px/1.45 var(--font-sans, "Inter", "Segoe UI", system-ui, sans-serif);
    color: var(--event-text-color, color-mix(in srgb, var(--color-on-primary, #fff) 86%, transparent));
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: pre-line;
}

.event-card__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    margin-top: 16px;
    padding: 0 18px;
    border: 1px solid color-mix(in srgb, var(--color-on-primary, #fff) 45%, transparent);
    border-radius: 12px;
    background: var(--event-button-color, color-mix(in srgb, var(--color-on-primary, #fff) 18%, transparent));
    color: var(--event-button-text-color, var(--color-on-primary, #fff));
    font: 800 15px/1 var(--font-sans, "Inter", "Segoe UI", system-ui, sans-serif);
    white-space: nowrap;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background-color 150ms ease, transform 120ms ease;
}

.event-card__btn:hover {
    background: color-mix(in srgb, var(--color-on-primary, #fff) 28%, transparent);
}

.event-card__btn:active {
    transform: translateY(1px);
}

.event-card__btn:focus-visible {
    outline: 2px solid var(--color-on-primary, #fff);
    outline-offset: 3px;
}

.event-card__btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* The yellow tick marks the state. */
.event-card__done {
    cursor: default;
}

.event-card__done svg {
    color: var(--color-accent, #E8BC33);
    stroke-width: 2.4;
}

/* Preview (backoffice): nothing to press. */
.event-card--preview .event-card__btn {
    pointer-events: none;
}
