:root {
    --communi-radius: 12px;
    --communi-radius-sm: 8px;
    --communi-border: rgba(15, 23, 42, .08);
    --communi-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .06);
    --communi-shadow-hover: 0 4px 8px rgba(15, 23, 42, .06), 0 12px 32px rgba(15, 23, 42, .10);
    --communi-muted: #6b7280;
    --communi-strong: #111827;
    --communi-accent: var(
        --e-global-color-primary,
        var(--wp--preset--color--primary,
        var(--wp--preset--color--accent,
        var(--wp--preset--color--accent-1,
        #2563eb)))
    );
}

.communi-events,
.communi-official { list-style: none; padding: 0; margin: 0; }

.communi-events--list .communi-event,
.communi-official--list .communi-official__item {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    padding: 1rem;
    margin-bottom: .75rem;
    background: #fff;
    border: 1px solid var(--communi-border);
    border-radius: var(--communi-radius);
    box-shadow: var(--communi-shadow);
    transition: box-shadow .2s ease, transform .15s ease;
}
.communi-events--list .communi-event:hover,
.communi-official--list .communi-official__item:hover {
    box-shadow: var(--communi-shadow-hover);
    transform: translateY(-1px);
}
.communi-event__thumb,
.communi-official__thumb { flex-shrink: 0; }
.communi-event__thumb img,
.communi-official__thumb img {
    width: 160px;
    height: 110px;
    object-fit: cover;
    border-radius: var(--communi-radius-sm);
    display: block;
}
@media (max-width: 540px) {
    .communi-events--list .communi-event,
    .communi-official--list .communi-official__item { flex-direction: column; }
    .communi-event__thumb img,
    .communi-official__thumb img { width: 100%; height: 180px; }
}

.communi-event__date,
.communi-card__date {
    display: inline-block;
    font-size: .8em;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--communi-accent);
    text-transform: uppercase;
    margin-bottom: .35rem;
}

.communi-event__title,
.communi-card__title {
    margin: 0 0 .4rem;
    font-size: 2rem;
    line-height: 1.25;
    font-weight: 600;
    color: var(--communi-strong);
}
.communi-event__title a,
.communi-card__title a { color: inherit; text-decoration: none; }
.communi-event__title a:hover,
.communi-card__title a:hover { color: var(--communi-accent); }

.communi-event__location { font-size: .9em; color: var(--communi-muted); display: inline-flex; align-items: center; gap: .3rem; }
.communi-event__location::before { content: "📍"; font-size: .9em; }

.communi-events--grid,
.communi-official--grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.communi-card {
    border: 1px solid var(--communi-border);
    border-radius: var(--communi-radius);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--communi-shadow);
    transition: box-shadow .2s ease, transform .15s ease;
    display: flex;
    flex-direction: column;
}
.communi-card:hover { box-shadow: var(--communi-shadow-hover); transform: translateY(-2px); }
.communi-card__thumb { aspect-ratio: 16 / 9; overflow: hidden; background: #f3f4f6; }
.communi-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.communi-card__body { padding: 1rem 1.25rem 1.25rem; flex: 1; display: flex; flex-direction: column; }

.communi-cal__month {
    margin-top: 2rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--communi-border);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--communi-strong);
}
.communi-cal__list { list-style: none; padding: 0; margin: .75rem 0 0; }
.communi-cal__list li {
    padding: .6rem .25rem;
    border-bottom: 1px solid var(--communi-border);
    display: flex;
    align-items: baseline;
    gap: 1rem;
}
.communi-cal__list li:last-child { border-bottom: none; }
.communi-cal__date {
    display: inline-block;
    min-width: 8em;
    color: var(--communi-accent);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: .9em;
}
.communi-cal__list a { color: var(--communi-strong); text-decoration: none; }
.communi-cal__list a:hover { color: var(--communi-accent); }

.communi-donation {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    padding: 1.75rem;
    margin: 1.5rem 0;
    background: #fff;
    border: 1px solid var(--communi-border);
    border-radius: var(--communi-radius);
    box-shadow: var(--communi-shadow);
}
@media (max-width: 540px) {
    .communi-donation { flex-direction: column; }
}
.communi-donation__body { flex: 1; min-width: 0; }
.communi-donation__thumb img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: var(--communi-radius-sm);
}
.communi-progress {
    height: 8px;
    background: rgba(0,0,0,.08);
    border-radius: 4px;
    overflow: hidden;
    margin: .5rem 0;
    color: var(
        --wp--preset--color--primary,
        var(
            --wp--preset--color--accent,
            var(
                --wp--preset--color--accent-1,
                var(
                    --wp--preset--color--foreground,
                    currentColor
                )
            )
        )
    );
}
.communi-progress__bar { height: 100%; background: currentColor; }
.communi-donation__amounts { font-size: .9em; opacity: .8; margin-bottom: .75rem; }
.communi-cta-wrap { margin-top: 1rem; }

/* ---- App-Banner ---- */
.communi-app-banner {
    background: #fff;
    border: 1px solid rgba(0,0,0,.09);
    border-radius: 16px;
    padding: 1.25rem 1.5rem 1.5rem;
    max-width: 420px;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    font-family: inherit;
}

.communi-app-banner__header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.communi-app-banner__icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    flex-shrink: 0;
    object-fit: cover;
}

.communi-app-banner__name {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
    color: inherit;
}

.communi-app-banner__sub {
    font-size: .8rem;
    color: #888;
    margin-top: .15rem;
}

.communi-app-banner__badges {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    align-items: start;
}

.communi-store-badge {
    text-decoration: none;
    color: inherit;
    transition: opacity .15s, transform .1s;
}
.communi-store-badge:hover { transform: translateY(-1px); }
.communi-store-badge--img:hover { opacity: .8; }
.communi-store-badge:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 8px; }

.communi-store-badge__inner {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    line-height: 1;
}

.communi-store-badge--img .communi-store-badge__inner {
    border-radius: 8px;
    overflow: hidden;
}
.communi-store-badge--img img {
    display: block;
    height: 44px;
    width: auto;
}

.communi-store-badge--web .communi-store-badge__inner {
    justify-content: center;
    gap: .5rem;
    background: #111;
    color: #fff;
    border-radius: 8px;
    padding: 0 1.1rem;
    height: 44px;
    font-size: .95rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background .15s;
}
.communi-store-badge--web:hover .communi-store-badge__inner { background: #333; }

.communi-empty {
    padding: 2rem 1rem;
    color: var(--communi-muted);
    font-style: italic;
    text-align: center;
    background: rgba(15, 23, 42, .02);
    border-radius: var(--communi-radius);
}

.communi-more {
    display: inline-block;
    margin-top: auto;
    padding-top: .5rem;
    font-weight: 600;
    color: var(--communi-accent);
    text-decoration: none;
    font-size: .9em;
}
.communi-more:hover { text-decoration: underline; }

@supports (color: color-contrast(#fff vs #000)) {
    .communi-more {
        color: color-contrast(#fff vs var(--communi-accent), #2563eb to AA);
    }
}

.communi-cta {
    display: inline-block;
    padding: .65rem 1.35rem;
    background: var(--communi-accent);
    color: #fff;
    border-radius: var(--communi-radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: .95rem;
    transition: opacity .15s ease, transform .1s ease;
}
.communi-cta:hover { opacity: .9; transform: translateY(-1px); color: #fff; }
.communi-cta:active { transform: translateY(0); }

.communi-wp-sr-only {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    -webkit-clip-path: inset(50%);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.communi-events a:focus-visible,
.communi-official a:focus-visible,
.communi-card a:focus-visible,
.communi-cal__list a:focus-visible,
.communi-donation a:focus-visible,
.communi-more:focus-visible,
.communi-cta:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}
