/**
 * CSS público do plugin Eventos - Catolicos em Ennis.
 * Mantém escopo com prefixo .ebm para evitar conflito com temas modernos.
 */

.ebm-events-wrap,
.ebm-single-wrap {
    --ebm-primary: #1d4ed8;
    --ebm-primary-dark: #123b9a;
    --ebm-text: #1f2937;
    --ebm-muted: #6b7280;
    --ebm-border: #e5e7eb;
    --ebm-surface: #ffffff;
    --ebm-soft: #f8fafc;
    --ebm-shadow: 0 18px 40px rgba(15, 23, 42, 0.10);
    --ebm-radius: 22px;
    color: var(--ebm-text);
}

.ebm-events-wrap {
    width: min(1180px, calc(100% - 32px));
    margin: 32px auto;
}

.ebm-filter-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 14px;
    align-items: end;
    padding: 18px;
    margin-bottom: 28px;
    background: var(--ebm-surface);
    border: 1px solid var(--ebm-border);
    border-radius: var(--ebm-radius);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.ebm-filter-field label {
    display: block;
    font-size: 0.86rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--ebm-muted);
}

.ebm-filter-field select,
.ebm-filter-field input {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--ebm-border);
    border-radius: 12px;
    padding: 10px 12px;
    background: #fff;
}

.ebm-filter-button,
.ebm-card-button,
.ebm-primary-action,
.ebm-secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 11px 18px;
    border-radius: 999px;
    border: 0;
    text-decoration: none !important;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.ebm-filter-button,
.ebm-card-button,
.ebm-primary-action {
    background: var(--ebm-primary);
    color: #fff !important;
    box-shadow: 0 12px 20px rgba(29, 78, 216, 0.18);
}

.ebm-filter-button:hover,
.ebm-card-button:hover,
.ebm-primary-action:hover,
.ebm-secondary-action:hover {
    transform: translateY(-2px);
}

.ebm-filter-button:hover,
.ebm-card-button:hover,
.ebm-primary-action:hover {
    background: var(--ebm-primary-dark);
}

.ebm-secondary-action {
    color: var(--ebm-primary) !important;
    background: #eef4ff;
}

.ebm-honeypot {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.ebm-events-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
}

.ebm-event-card {
    position: relative;
    overflow: hidden;
    background: var(--ebm-surface);
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: var(--ebm-radius);
    box-shadow: var(--ebm-shadow);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.ebm-event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 24px 56px rgba(15, 23, 42, 0.16);
    border-color: rgba(29, 78, 216, 0.25);
}

.ebm-card-image-link {
    display: block;
    text-decoration: none !important;
}

.ebm-card-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
    overflow: hidden;
}

.ebm-card-image img,
.ebm-single-banner img {
    display: block;
    max-width: 100%;
    height: auto;
}

.ebm-card-image.ebm-banner-horizontal {
    aspect-ratio: 16 / 9;
}

.ebm-card-image.ebm-banner-vertical {
    aspect-ratio: 9 / 16;
    max-height: 560px;
}

.ebm-card-image.ebm-banner-square {
    aspect-ratio: 1 / 1;
}

.ebm-card-image.ebm-banner-original {
    min-height: 220px;
    max-height: 520px;
}

.ebm-card-image.ebm-banner-horizontal img,
.ebm-card-image.ebm-banner-vertical img,
.ebm-card-image.ebm-banner-square img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ebm-card-image.ebm-banner-original img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.ebm-no-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    color: var(--ebm-muted);
    font-weight: 700;
}

.ebm-card-body {
    padding: 22px;
}

.ebm-featured-badge,
.ebm-status-badge {
    display: inline-flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.ebm-featured-badge {
    color: #92400e;
    background: #fef3c7;
}

.ebm-status-badge.ebm-status-closed {
    color: #374151;
    background: #e5e7eb;
}

.ebm-status-badge.ebm-status-cancelled {
    color: #991b1b;
    background: #fee2e2;
}

.ebm-card-category,
.ebm-single-category {
    color: var(--ebm-primary);
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 7px;
}

.ebm-card-title {
    margin: 0 0 12px;
    font-size: clamp(1.18rem, 2vw, 1.45rem);
    line-height: 1.22;
}

.ebm-card-title a {
    color: var(--ebm-text) !important;
    text-decoration: none !important;
}

.ebm-card-title a:hover {
    color: var(--ebm-primary) !important;
}

.ebm-card-meta {
    display: grid;
    gap: 5px;
    margin-bottom: 14px;
    color: var(--ebm-muted);
    font-size: 0.95rem;
    line-height: 1.35;
}

.ebm-card-description {
    margin: 0 0 18px;
    color: #4b5563;
    line-height: 1.62;
}

.ebm-empty-state {
    padding: 42px 24px;
    border-radius: var(--ebm-radius);
    text-align: center;
    background: var(--ebm-soft);
    border: 1px dashed var(--ebm-border);
}

.ebm-empty-state h3 {
    margin-top: 0;
}

/* Página individual
 * O site usa um cabeçalho/menu flutuante. Por isso adicionamos um
 * espaçamento superior na página individual para que o banner comece
 * abaixo do menu e não fique escondido atrás do cabeçalho do tema.
 */
.ebm-single-wrap {
    --ebm-single-top-offset: clamp(130px, 13vw, 175px);
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto 64px;
    padding-top: var(--ebm-single-top-offset);
    clear: both;
}

.ebm-single-event {
    margin: 0;
}

.ebm-single-hero {
    /*
     * Caixa visual do banner.
     * O padding cria uma borda/área de respiro permanente ao redor da imagem,
     * evitando que o banner fique colado no topo, nas laterais ou embaixo.
     *
     * A largura foi reduzida novamente para aproximadamente 60% do
     * tamanho anterior solicitado, mantendo o banner centralizado na página
     * individual do evento.
     */
    width: min(72%, 760px);
    max-width: 760px;
    min-width: 0;
    margin: 0 auto;
    overflow: visible;
    border-radius: 30px;
    padding: clamp(20px, 3vw, 42px) clamp(16px, 4vw, 52px);
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
    box-shadow: var(--ebm-shadow);
    box-sizing: border-box;
}

.ebm-single-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow: hidden;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.42);
}

.ebm-single-banner.ebm-banner-horizontal {
    aspect-ratio: 16 / 9;
}

.ebm-single-banner.ebm-banner-vertical {
    max-height: none;
}

.ebm-single-banner.ebm-banner-square {
    aspect-ratio: 1 / 1;
    max-height: 760px;
}

.ebm-single-banner.ebm-banner-horizontal img,
.ebm-single-banner.ebm-banner-square img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ebm-single-banner.ebm-banner-vertical img,
.ebm-single-banner.ebm-banner-original img {
    width: auto;
    max-width: 100%;
    max-height: min(74vh, 780px);
    height: auto;
    object-fit: contain;
}

.ebm-single-content-card {
    position: relative;
    z-index: 1;
    margin: clamp(34px, 5vw, 62px) auto 0;
    width: min(960px, calc(100% - 28px));
    padding: clamp(24px, 4vw, 42px);
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: 28px;
    box-shadow: var(--ebm-shadow);
    backdrop-filter: blur(12px);
}

.ebm-single-header {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 26px;
}

.ebm-single-title {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.05;
    color: var(--ebm-text);
}

.ebm-single-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.ebm-single-details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 26px 0;
}

.ebm-detail-row {
    padding: 16px;
    border: 1px solid var(--ebm-border);
    border-radius: 18px;
    background: var(--ebm-soft);
}

.ebm-detail-row strong,
.ebm-detail-row span {
    display: block;
}

.ebm-detail-row strong {
    margin-bottom: 4px;
    color: var(--ebm-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ebm-detail-row span {
    font-weight: 800;
    color: var(--ebm-text);
}

.ebm-single-description {
    margin-top: 24px;
    color: #374151;
    font-size: 1.05rem;
    line-height: 1.75;
}

.ebm-single-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.ebm-back-link {
    margin: 28px 0 0;
}

.ebm-back-link a {
    color: var(--ebm-muted) !important;
    text-decoration: none !important;
    font-weight: 700;
}

.ebm-back-link a:hover {
    color: var(--ebm-primary) !important;
}


/* Página pública central em mosaico
 * Ajuste da versão 1.0.18:
 * no computador os banners ficam lado a lado, mas dentro do limite visual da página.
 * O grid desktop passa a ter 4 colunas estáveis para acomodar melhor:
 * - 2 cards Grandes lado a lado (2x2 + 2x2)
 * - 2 cards Horizontal Duplo lado a lado (2x1 + 2x1)
 * - 4 cards Vertical Duplo lado a lado (1x2 x4)
 * - 4 cards Normais lado a lado (1x1 x4)
 * Em tablet e celular, os cards podem ficar um abaixo do outro.
 */
.ebm-events-wrap-mosaic {
    width: min(1320px, calc(100% - 56px));
    max-width: 1320px;
    margin: clamp(34px, 5vw, 68px) auto;
    overflow: hidden;
    box-sizing: border-box;
}

.ebm-events-mosaic {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-flow: row;
    grid-auto-rows: clamp(247px, 16.9vw, 338px);
    gap: clamp(14px, 1.3vw, 20px);
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.ebm-mosaic-item {
    max-width: 100%;
    position: relative;
    min-height: 0;
    overflow: hidden;
    padding: 0;
    border: 0;
    border-radius: 24px;
    background: #0f172a;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.14);
    box-sizing: border-box;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.ebm-mosaic-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 56px rgba(15, 23, 42, 0.20);
}

.ebm-mosaic-item-layout-normal {
    grid-column: span 1;
    grid-row: span 1;
}

.ebm-mosaic-item-layout-wide {
    grid-column: span 2;
    grid-row: span 1;
}

.ebm-mosaic-item-layout-tall {
    grid-column: span 1;
    grid-row: span 2;
}

.ebm-mosaic-item-layout-large {
    grid-column: span 2;
    grid-row: span 2;
}

.ebm-mosaic-link {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
    border-radius: 24px;
    background: #0f172a;
    color: inherit !important;
    text-decoration: none !important;
}

.ebm-mosaic-image {
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    width: 100%;
    height: 100%;
    min-height: 100%;
    background: #0f172a;
}

.ebm-mosaic-image img,
.ebm-mosaic-image.ebm-banner-original img,
.ebm-mosaic-image.ebm-banner-vertical img,
.ebm-mosaic-image.ebm-banner-horizontal img,
.ebm-mosaic-image.ebm-banner-square img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: center center;
}

.ebm-mosaic-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    width: 100%;
    min-height: 100%;
    padding: clamp(18px, 2vw, 28px);
    color: #ffffff;
    background:
        linear-gradient(to top, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.82) 54%, rgba(15, 23, 42, 0.52));
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.24s ease, transform 0.24s ease, background 0.24s ease;
    pointer-events: none;
    box-sizing: border-box;
    backdrop-filter: blur(2px);
}

.ebm-mosaic-item:hover .ebm-mosaic-overlay,
.ebm-mosaic-link:focus .ebm-mosaic-overlay,
.ebm-mosaic-link:focus-visible .ebm-mosaic-overlay {
    opacity: 1;
    transform: translateY(0);
    background:
        linear-gradient(to top, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.88) 56%, rgba(15, 23, 42, 0.58));
}

.ebm-mosaic-link:active .ebm-mosaic-overlay {
    opacity: 1;
    transform: translateY(0);
}

.ebm-mosaic-overlay .ebm-card-category {
    color: #bfdbfe;
    margin-bottom: 4px;
    font-size: 0.70rem;
}

.ebm-mosaic-overlay .ebm-featured-badge {
    margin-bottom: 7px;
    padding: 5px 8px;
    font-size: 0.68rem;
}

.ebm-mosaic-title {
    margin: 0 0 7px;
    color: #ffffff;
    font-size: clamp(1rem, 1.15vw, 1.4rem);
    line-height: 1.12;
}

.ebm-mosaic-meta {
    display: grid;
    gap: 2px;
    color: rgba(255, 255, 255, 0.90);
    font-size: clamp(0.74rem, 0.88vw, 0.88rem);
    line-height: 1.24;
}

.ebm-mosaic-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ebm-mosaic-summary {
    display: -webkit-box;
    margin: 7px 0 0;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.86);
    font-size: clamp(0.74rem, 0.92vw, 0.86rem);
    line-height: 1.28;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ebm-mosaic-item-layout-normal .ebm-mosaic-summary,
.ebm-mosaic-item-layout-tall .ebm-mosaic-summary {
    display: none;
}

.ebm-mosaic-action {
    display: inline-flex;
    margin-top: 9px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 0.74rem;
    font-weight: 800;
    line-height: 1;
}

@media (max-width: 900px) {
    .ebm-events-mosaic {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    .ebm-mosaic-item,
    .ebm-mosaic-item-layout-normal,
    .ebm-mosaic-item-layout-wide,
    .ebm-mosaic-item-layout-tall,
    .ebm-mosaic-item-layout-large {
        grid-column: span 1;
        grid-row: auto;
        min-height: 320px;
    }

    .ebm-mosaic-item-layout-tall,
    .ebm-mosaic-item-layout-large {
        min-height: 520px;
    }

    .ebm-mosaic-item-layout-wide {
        min-height: 280px;
    }

    .ebm-events-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ebm-filter-form {
        grid-template-columns: 1fr 1fr;
    }

    .ebm-filter-button {
        grid-column: 1 / -1;
    }

    .ebm-single-details {
        grid-template-columns: 1fr;
    }

    .ebm-single-hero {
        width: 82%;
        max-width: 770px;
    }
}

@media (max-width: 640px) {
    .ebm-events-mosaic {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    .ebm-mosaic-item,
    .ebm-mosaic-item-layout-normal,
    .ebm-mosaic-item-layout-wide,
    .ebm-mosaic-item-layout-tall,
    .ebm-mosaic-item-layout-large {
        grid-column: span 1;
        grid-row: auto;
        min-height: 384px;
    }

    .ebm-mosaic-item-layout-tall,
    .ebm-mosaic-item-layout-large {
        min-height: 624px;
    }

    .ebm-mosaic-item-layout-wide {
        min-height: 336px;
    }

    .ebm-mosaic-item-layout-normal .ebm-mosaic-summary,
    .ebm-mosaic-item-layout-normal .ebm-mosaic-action {
        display: inline-flex;
    }

    .ebm-mosaic-item-layout-normal .ebm-mosaic-summary {
        display: -webkit-box;
    }

    .ebm-events-wrap {
        width: min(100% - 20px, 1180px);
        margin-top: 20px;
    }

    .ebm-single-wrap {
        --ebm-single-top-offset: clamp(105px, 22vw, 140px);
        width: min(100% - 20px, 1180px);
    }

    .ebm-events-grid,
    .ebm-filter-form {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .ebm-card-body {
        padding: 18px;
    }

    .ebm-single-hero {
        width: 100%;
        max-width: none;
        padding: 18px 14px;
        border-radius: 22px;
    }

    .ebm-single-banner {
        border-radius: 16px;
    }

    .ebm-single-content-card {
        margin-top: 28px;
        width: calc(100% - 12px);
        border-radius: 22px;
    }

    .ebm-single-header {
        flex-direction: column;
    }

    .ebm-single-badges {
        justify-content: flex-start;
    }
}
