/* Extracted from ui/templates/components/events/_event_card.html. Linked via sekizai so a page loads it once,
   however many instances it renders. */

.event-card-component,
.event-card-component *,
.fe-featured,
.fe-featured * {
    box-sizing: border-box;
    font-family: "NYU Perstare", system-ui, sans-serif;
}

.event-card-title-clamp {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

.event-card-meta-clamp {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.event-card-badge-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.event-card-format {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--event-card-format-color, #9100E4);
    font-size: 11px;
    font-weight: 800;
    line-height: 14px;
    letter-spacing: -0.04em;
    text-transform: uppercase;
}

.event-card-format::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: currentColor;
}

.event-card-nyu-lockup {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #57068C;
}

.event-card-nyu-emblem {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
}

.event-card-nyu-word {
    color: #57068C;
    font-size: 48px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.event-card-title-clamp-featured {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

.fe-featured {
    --fe-img-h: 360px;
}

.fe-featured__mobile-date {
    display: none;
}

.event-card-mobile-date {
    display: none;
}

@media (min-width: 1024px) {
    .fe-featured {
        min-height: var(--fe-img-h);
    }

    /* The image fills the row: --fe-img-h is a floor, and when the
       text column runs taller the image stretches to match it. */
    .fe-featured .fe-featured__media-link {
        display: flex;
        align-items: stretch;
    }

    .fe-featured .fe-featured__media {
        height: auto;
        min-height: var(--fe-img-h);
        align-self: stretch;
    }

    .fe-featured .fe-featured__badge {
        margin-bottom: clamp(12px, calc(var(--fe-img-h) * 0.045), 26px);
    }

    .fe-featured .fe-featured__title {
        margin-bottom: clamp(12px, calc(var(--fe-img-h) * 0.05), 28px);
    }

    .fe-featured .fe-featured__meta {
        margin-bottom: clamp(16px, calc(var(--fe-img-h) * 0.07), 40px);
    }

    .fe-featured .fe-featured__btn {
        padding-top: clamp(10px, calc(var(--fe-img-h) * 0.028), 18px);
        padding-bottom: clamp(10px, calc(var(--fe-img-h) * 0.028), 18px);
    }
}

@media (max-width: 767px) {
    .fe-featured {
        margin-bottom: 24px !important;
        gap: 0 !important;
    }

    /* Date sits as a vertical strip to the left of the image. */
    .fe-featured__media-link {
        position: relative !important;
        display: flex !important;
        align-items: stretch;
        width: 100% !important;
        margin-bottom: 0 !important;
        overflow: hidden !important;
    }

    .fe-featured__media {
        flex: 1 1 0;
        min-width: 0;
        width: auto !important;
        height: 178px !important;
        min-height: 178px !important;
        max-height: 178px !important;
        border-radius: 0 !important;
    }

    .fe-featured__mobile-date {
        order: -1;
        flex: 0 0 25%;
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        background: #4B0082;
        color: #ffffff;
        text-align: center;
        text-transform: uppercase;
    }

    .fe-featured__mobile-date-main {
        font-size: 12px;
        line-height: 15px;
        font-weight: 800;
        letter-spacing: -0.03em;
    }

    .fe-featured__mobile-date-year {
        font-size: 8px;
        line-height: 11px;
        font-weight: 800;
        letter-spacing: -0.03em;
    }

    .fe-featured__desktop-date {
        display: none !important;
    }

    .fe-featured__content {
        padding: 15px 0 26px !important;
        border-bottom: 1px solid #E5E7EB !important;
    }

    .fe-featured__badge {
        margin: 0 0 14px !important;
    }

    .fe-featured__badge span {
        height: 22px !important;
        padding-left: 9px !important;
        padding-right: 9px !important;
        border-radius: 3px !important;
        font-size: 11px !important;
        line-height: 14px !important;
    }

    .fe-featured__title {
        margin-bottom: 15px !important;
        max-width: none !important;
        font-size: 24px !important;
        line-height: 30px !important;
        letter-spacing: -0.035em !important;
    }

    .fe-featured__meta {
        margin-bottom: 22px !important;
        font-size: 12px !important;
        line-height: 16px !important;
    }

    .fe-featured__btn {
        width: 100%;
        min-height: 40px;
        padding: 11px 20px !important;
        font-size: 12px !important;
        line-height: 15px !important;
    }

    .event-card-component:not(.fe-featured) {
        display: block !important;
        min-height: 0 !important;
        height: auto !important;
        background: #ffffff;
    }

    .event-card-component:not(.fe-featured):not(.event-card--hide-mobile-media) .event-card-desktop-media {
        display: block !important;
        min-height: 176px !important;
        height: 176px !important;
        width: 100% !important;
        margin-bottom: 14px !important;
    }

    .event-card-component:not(.fe-featured):not(.event-card--hide-mobile-media) .event-card-desktop-date {
        position: absolute !important;
        inset: auto 0 0 0 !important;
        z-index: 20 !important;
        display: flex !important;
        width: 100% !important;
        height: 34px !important;
        min-height: 34px !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        border-radius: 0 0 3px 3px !important;
        background: #4B0082 !important;
        color: #ffffff !important;
        text-align: center !important;
    }

    .event-card-component:not(.fe-featured):not(.event-card--hide-mobile-media) .event-card-desktop-date-main {
        padding: 0 !important;
        font-size: 12px !important;
        line-height: 15px !important;
        font-weight: 800 !important;
        letter-spacing: -0.03em !important;
    }

    .event-card-component:not(.fe-featured):not(.event-card--hide-mobile-media) .event-card-desktop-date-year {
        margin-top: 0 !important;
        font-size: 8px !important;
        line-height: 11px !important;
        font-weight: 800 !important;
        letter-spacing: -0.03em !important;
    }

    .event-card-component:not(.fe-featured):not(.event-card--hide-mobile-media) .event-card-fallback {
        padding-left: 0 !important;
    }

    .event-card-component:not(.fe-featured):not(.event-card--hide-mobile-media) .event-card-mobile-date {
        display: none !important;
    }

    .event-card--hide-mobile-media .event-card-desktop-media {
        display: none !important;
    }

    /* No image on mobile: the date becomes a vertical strip to the
       left of the text instead. */
    .event-card-component.event-card--hide-mobile-media {
        display: flex !important;
        align-items: stretch;
        gap: 14px;
    }

    .event-card--hide-mobile-media .event-card-mobile-date {
        display: flex !important;
        flex: 0 0 25%;
        width: 25%;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        border-radius: 3px;
        background: #4B0082;
        color: #ffffff;
        text-align: center;
        text-decoration: none;
        text-transform: uppercase;
    }

    .event-card--hide-mobile-media .event-card-compact-content {
        flex: 1 1 auto;
        min-width: 0;
    }

    .event-card-mobile-date-main {
        font-size: 12px;
        line-height: 15px;
        font-weight: 800;
        letter-spacing: -0.03em;
    }

    .event-card-mobile-date-year {
        font-size: 8px;
        line-height: 11px;
        font-weight: 800;
        letter-spacing: -0.03em;
    }

    .event-card-compact-content {
        min-height: 0 !important;
        padding: 10px 0 14px !important;
        border-bottom: 1px solid #D7D7D7;
        background: #ffffff !important;
    }

    .event-card-compact-border {
        display: none !important;
    }

    .event-card-compact-title {
        min-height: 0 !important;
        max-height: none !important;
        margin-top: 10px !important;
        font-size: 15px !important;
        line-height: 20px !important;
        letter-spacing: -0.035em !important;
    }

    .event-card-compact-lower {
        min-height: 0 !important;
        margin-top: 10px !important;
        padding: 0 !important;
        gap: 8px !important;
    }

    .event-card-compact-meta {
        font-size: 10px !important;
        line-height: 14px !important;
    }

    .event-card-compact-link {
        font-size: 10px !important;
        line-height: 14px !important;
    }
}

/* Compact card image: the date panel is an 88px block pinned over the left
   of the media link, so an inset-0 image lost its left 88px under it. Start
   the image at the panel's edge so the whole picture shows beside the date. */
.event-card-desktop-media .event-card-desktop-img {
    left: 88px;
    width: calc(100% - 88px);
    border-radius: 0 3px 3px 0;
}

@media (max-width: 767px) {
    /* Below md the date is a 34px bar along the bottom of the media instead
       of a left panel: the image spans the full width and stops above it. */
    .event-card-component:not(.fe-featured):not(.event-card--hide-mobile-media) .event-card-desktop-media .event-card-desktop-img {
        left: 0 !important;
        width: 100% !important;
        height: calc(100% - 34px) !important;
        border-radius: 3px 3px 0 0 !important;
    }
}
