/*
 * NCBA Novi Homepage Events
 * Presentation deliberately follows the site's existing WordPress styling.
 * The plugin owns data/layout mechanics, not a separate visual design system.
 */

.ncba-events {
    width: 100%;
    max-width: var(--wp--style--global--wide-size, 1440px);
    margin: var(--wp--preset--spacing--50, 40px) auto var(--wp--preset--spacing--60, 56px);
    padding-inline: var(--wp--preset--spacing--30, 24px);
    color: inherit;
    font-family: inherit;
}

.ncba-events *,
.ncba-events *::before,
.ncba-events *::after {
    box-sizing: border-box;
}

.ncba-events__heading-row {
    margin: 0 0 var(--wp--preset--spacing--30, 24px) !important;
    padding: 0 !important;
}

/* Typography belongs to the WordPress theme. We only normalize spacing. */
.ncba-events .ncba-events__heading {
    margin: 0 !important;
    padding: 0 !important;
}

.ncba-events__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--wp--preset--spacing--40, 32px);
    align-items: stretch;
    margin: 0 !important;
    padding: 0 !important;
}

.ncba-events__layout--calendar-only {
    grid-template-columns: 1fr;
}

/* FEATURED ARTWORK --------------------------------------------------------- */

.ncba-featured {
    display: flex;
    flex-direction: column;
    gap: var(--wp--preset--spacing--20, 18px);
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
}

.ncba-featured__row {
    display: flex;
    flex-flow: row nowrap;
    gap: var(--wp--preset--spacing--20, 18px);
    width: 100%;
    min-width: 0;
    margin: 0 !important;
    margin-block-start: 0 !important;
    padding: 0 !important;
}

.ncba-events .ncba-featured__card,
.ncba-events .ncba-featured__card--lead,
.ncba-events .ncba-featured__row .ncba-featured__card {
    position: relative;
    display: block;
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    aspect-ratio: 7 / 3;
    overflow: hidden;
    margin: 0 !important;
    margin-block: 0 !important;
    padding: 0 !important;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    line-height: 0;
    text-decoration: none;
}

.ncba-events .ncba-featured__row .ncba-featured__card {
    flex-basis: calc((100% - var(--wp--preset--spacing--20, 18px)) / 2);
    width: auto;
}

.ncba-events .ncba-featured__image {
    display: block;
    width: 100%;
    max-width: none;
    height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    border: 0;
    object-fit: cover;
    object-position: center;
    transition: opacity 160ms ease;
}

.ncba-featured__card:hover .ncba-featured__image,
.ncba-featured__card:focus-visible .ncba-featured__image {
    opacity: .92;
}

/* Lead gets a quiet label; the secondary art does not need three repeated tags. */
.ncba-featured__eyebrow {
    position: absolute;
    top: 14px;
    left: 16px;
    z-index: 2;
    display: inline-block;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    font-family: inherit;
    font-size: .72rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-shadow: 0 1px 5px rgba(0,0,0,.55);
}

.ncba-featured__row .ncba-featured__eyebrow {
    display: none;
}

.ncba-featured__card:focus-visible,
.ncba-calendar a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

/* CALENDAR ---------------------------------------------------------------- */

/* No floating grey app-card. The schedule should feel like native page content. */
.ncba-calendar {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    border: 0;
    border-top: 1px solid rgba(18, 59, 122, .22);
    border-bottom: 1px solid rgba(18, 59, 122, .22);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.ncba-calendar__events {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin: 0 !important;
    padding: 0 !important;
}

.ncba-calendar__month-group {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    margin: 0 !important;
    padding: var(--wp--preset--spacing--20, 18px) 0 0 !important;
}

.ncba-calendar__month-group + .ncba-calendar__month-group {
    border-top: 1px solid rgba(18, 59, 122, .14);
}

.ncba-events .ncba-calendar__month {
    margin: 0 0 4px !important;
    padding: 0 !important;
}

.ncba-calendar__event {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
    margin: 0 !important;
    padding: 12px 0 !important;
}

.ncba-calendar__event + .ncba-calendar__event {
    border-top: 1px solid rgba(18, 59, 122, .10);
}

.ncba-events .ncba-calendar__title {
    display: inline-block;
    width: fit-content;
    max-width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    font-size: clamp(1rem, 1.15vw, 1.15rem);
    line-height: 1.22;
    font-weight: 500;
    text-decoration: none;
}

.ncba-calendar__title:hover {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: .18em;
}

.ncba-calendar__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 7px 0 0 !important;
    padding: 0 !important;
    color: rgba(31, 49, 80, .72);
    font-family: inherit;
    font-size: .88rem;
    line-height: 1.25;
}

/* Text metadata fits the site's restrained style better than UI icons. */
.ncba-calendar__meta svg {
    display: none;
}

.ncba-calendar__meta-item {
    display: inline;
    margin: 0;
    padding: 0;
}

.ncba-calendar__meta-item + .ncba-calendar__meta-item::before {
    content: "·";
    display: inline;
    width: auto;
    height: auto;
    margin: 0 6px 0 0;
    background: none;
}

.ncba-calendar__cta {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 !important;
    padding: 15px 0 13px !important;
    border: 0;
    border-top: 1px solid rgba(18, 59, 122, .22);
    font-size: .98rem;
    line-height: 1.2;
    font-weight: 500;
    text-decoration: none;
}

.ncba-calendar__cta span:last-child {
    display: inline;
    width: auto;
    height: auto;
    border-radius: 0;
    background: transparent;
    transition: transform 150ms ease;
}

.ncba-calendar__cta:hover span:first-child {
    text-decoration: underline;
    text-underline-offset: .18em;
}

.ncba-calendar__cta:hover span:last-child {
    transform: translateX(3px);
    background: transparent;
}

.ncba-events-admin-error {
    padding: 12px 16px;
    border: 1px solid #d63638;
    background: #fff;
    color: #8a2424;
}

@media (max-width: 900px) {
    .ncba-events {
        padding-inline: var(--wp--preset--spacing--20, 18px);
    }

    .ncba-events__layout {
        grid-template-columns: 1fr;
        gap: var(--wp--preset--spacing--40, 30px);
    }

    .ncba-calendar {
        min-height: 0;
    }

    .ncba-calendar__event {
        flex: none;
        padding: 15px 0 !important;
    }
}

@media (max-width: 560px) {
    .ncba-events {
        margin-block: 28px 42px;
    }

    .ncba-featured__row {
        flex-direction: column;
    }

    .ncba-events .ncba-featured__row .ncba-featured__card {
        flex-basis: auto;
        width: 100%;
    }

    .ncba-featured__eyebrow {
        top: 10px;
        left: 11px;
        font-size: .66rem;
    }
}
