/* Ecclesia Events v0.2.0
 * Front-end compatibility layer: intentionally uses WP Event Manager-style class names
 * while remaining self-contained when WP Event Manager itself is inactive.
 */
.ecclesia-events-instance,.ecclesia-single-event{--ee-accent:#b51e4b;--ee-dark:#171717;--ee-muted:#666;--ee-border:#e4e4e4;--ee-bg:#fff;--ee-soft:#f5f5f5;--ee-radius:4px;box-sizing:border-box}
.ecclesia-events-instance{container-type:inline-size;display:block;width:100%;max-width:100%;margin-left:auto;margin-right:auto}
.ecclesia-events-instance *,.ecclesia-single-event *{box-sizing:border-box}
.ecclesia-events-heading{margin:0 0 20px}

/* Optional filters */
.ecclesia-event-filters{background:#f6f6f6;border:1px solid var(--ee-border);padding:16px;margin:0 0 22px}
.ecclesia-filter-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px}
.ecclesia-filter-grid label>span{display:block;font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.03em;margin-bottom:5px}
.ecclesia-filter-grid input,.ecclesia-filter-grid select{width:100%;min-height:40px;background:#fff;border:1px solid #ccc;padding:7px 9px}
.ecclesia-filter-actions{display:flex;gap:14px;align-items:center;margin-top:12px}
.ecclesia-filter-actions .button,.ecclesia-load-more,.ecclesia-book-button{display:inline-flex;align-items:center;justify-content:center;border:0;background:var(--ee-accent);color:#fff!important;text-decoration:none!important;padding:10px 18px;line-height:1.2;cursor:pointer;border-radius:2px;font-weight:700}
.ecclesia-filter-reset{cursor:pointer}

/* Event cards: closely follows WP Event Manager 3.4.1 box-view proportions,
 * but uses container queries so the SAME shortcode can be 3-col full width,
 * 2-col in the homepage Visual Composer column, and 1-col on phones.
 */
.ecclesia-events-list-wrap{width:100%;min-width:0;margin-left:auto;margin-right:auto}
.ecclesia-events-list{width:100%;min-width:0;margin:0 0 30px;padding:0;overflow:visible}
.ecclesia-events-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:30px}
.ecclesia-event-card{display:block;min-width:0;margin:0;padding:0;height:100%}
.ecclesia-event-card[hidden],.ecclesia-event-card.ecclesia-page-hidden{display:none!important}
.ecclesia-event-card .wpem-event-layout-wrapper{height:100%;width:100%;border:1px solid var(--ee-border);border-radius:4px;overflow:hidden;background:var(--ee-bg);transition:box-shadow .2s ease,transform .2s ease}
.ecclesia-event-card .wpem-event-layout-wrapper:hover,.ecclesia-event-card .wpem-event-layout-wrapper:focus-within{box-shadow:0 0 10px rgba(0,0,0,.10);transform:translateY(-1px)}
.ecclesia-event-card .event_listing{height:100%;width:100%;margin:0;background:var(--ee-bg)}
.ecclesia-event-card-link{display:flex;flex-direction:column;height:100%;width:100%;min-width:0;color:inherit!important;text-decoration:none!important;outline:0}

/* Large image-first box, matching the WP Event Manager box-view visual hierarchy. */
.ecclesia-event-card .wpem-event-banner{display:block;position:relative;width:100%;height:230px;padding:0;margin:0;background:var(--ee-border);overflow:hidden}
.ecclesia-event-card .wpem-event-banner-img{display:block;width:100%;height:100%;background-size:cover!important;background-position:center!important;background-repeat:no-repeat;background-color:var(--ee-border);transition:transform .25s ease}
.ecclesia-event-card .wpem-event-layout-wrapper:hover .wpem-event-banner-img{transform:scale(1.012)}
.ecclesia-event-banner-placeholder{background:linear-gradient(135deg,#ececec,#d9d9d9)}

/* White date tile over image: WP Event Manager 3.4.1 box-view pattern. */
.ecclesia-event-card .ecclesia-event-date-badge{display:block;position:absolute;top:15px;left:15px;width:auto!important;margin:0!important;padding:0!important;text-align:center;z-index:2}
.ecclesia-event-card .ecclesia-event-date-badge .wpem-from-date{display:block;background:#fff;padding:10px 15px;min-width:66px;border-radius:4px;box-shadow:5px 3px 15px rgba(0,0,0,.20)}
.ecclesia-event-card .ecclesia-event-date-badge .wpem-date{font-size:23px;line-height:23px;font-weight:600;color:var(--ee-dark)}
.ecclesia-event-card .ecclesia-event-date-badge .wpem-month{font-size:13px;line-height:15px;font-weight:600;text-transform:uppercase;color:var(--ee-muted)}

.ecclesia-event-card .wpem-event-infomation{display:block;flex:1 1 auto;min-width:0;width:100%;font-size:15px;line-height:1.42}
.ecclesia-event-card .wpem-event-details{padding:16px 17px 17px;min-width:0;color:var(--ee-muted)}
.ecclesia-event-card .wpem-event-title{margin:0 0 10px}
.ecclesia-event-card .wpem-event-title .wpem-heading-text{margin:0;color:var(--ee-dark);font-size:22px;line-height:1.32;font-weight:700;letter-spacing:.075em;text-transform:uppercase;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.ecclesia-event-meta-row{display:flex;align-items:flex-start;gap:7px;min-width:0;margin:6px 0;color:var(--ee-muted);font-size:15px;line-height:1.42}
.ecclesia-event-meta-row>span:last-child{min-width:0;overflow-wrap:anywhere}
.ecclesia-meta-icon{flex:0 0 17px;width:17px;height:20px;display:inline-flex;align-items:center;justify-content:center;color:#777;margin-top:1px}
.ecclesia-meta-icon svg{width:16px;height:16px;display:block;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

/* WP Event Manager box view visually shows event type badges; categories stay in data for filters/chatbot. */
.ecclesia-event-tags{display:flex;flex-wrap:wrap;gap:6px;margin:9px 0 0}
.ecclesia-event-tags .wpem-event-type,.ecclesia-event-tags .wpem-event-ticket-type{display:inline-block;margin:0;min-height:0}
.ecclesia-event-tags .wpem-event-type-text,.ecclesia-event-tags .wpem-event-ticket-type-text{display:inline-block;max-width:100%;padding:5px 7px;border-radius:4px;background:var(--ee-soft);color:var(--ee-dark);font-size:14px;font-weight:400;line-height:15px;overflow-wrap:anywhere}
.ecclesia-event-tags .wpem-event-ticket-type-text{background:#f8e8ed;color:#7d1735}

.ecclesia-load-more-wrap{text-align:center;padding:0 0 20px}
.ecclesia-load-more{margin:0 auto;background:var(--ee-soft);color:var(--ee-muted)!important;text-transform:uppercase;font-size:15px;letter-spacing:.5px;font-weight:500;border-radius:4px}
.ecclesia-load-more:hover,.ecclesia-load-more:focus{background:var(--ee-muted);color:#fff!important}
.ecclesia-events-empty,.ecclesia-events-filter-empty{grid-column:1/-1;padding:24px;text-align:center;background:#f7f7f7;color:#555}
.ecclesia-events-filter-empty[hidden]{display:none!important}

/* Same shortcode, different container: full Upcoming Events = 3 cols; homepage column = 2 cols. */
@container (max-width:820px){
  .ecclesia-events-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;justify-content:center}
  .ecclesia-event-card .wpem-event-banner{height:165px}
  .ecclesia-event-card .wpem-event-details{padding:14px 13px 15px}
  .ecclesia-event-card .wpem-event-title .wpem-heading-text{font-size:19px;line-height:1.3;letter-spacing:.065em}
  .ecclesia-event-meta-row{font-size:13px;line-height:1.38;gap:6px;margin:5px 0}
  .ecclesia-meta-icon{flex-basis:15px;width:15px;height:18px}
  .ecclesia-meta-icon svg{width:14px;height:14px}
  .ecclesia-event-tags{gap:5px;margin-top:7px}
  .ecclesia-event-tags .wpem-event-type-text,.ecclesia-event-tags .wpem-event-ticket-type-text{font-size:12px;padding:4px 6px}
  .ecclesia-event-card .ecclesia-event-date-badge{top:11px;left:11px}
  .ecclesia-event-card .ecclesia-event-date-badge .wpem-from-date{padding:8px 11px;min-width:56px}
  .ecclesia-event-card .ecclesia-event-date-badge .wpem-date{font-size:20px;line-height:20px}
  .ecclesia-event-card .ecclesia-event-date-badge .wpem-month{font-size:11px;line-height:13px}
}
@container (max-width:430px){
  /* Phone layout: one centred card. The max-width prevents Visual Composer's
   * stacked homepage column from pinning the card to the left edge. */
  .ecclesia-events-grid{grid-template-columns:minmax(0,420px);justify-content:center;gap:16px}
  .ecclesia-event-card{width:100%;max-width:420px;margin-left:auto;margin-right:auto}
  .ecclesia-event-card .wpem-event-banner{height:220px}
  .ecclesia-event-card .wpem-event-details{padding:16px 17px 18px}
  .ecclesia-event-card .wpem-event-title .wpem-heading-text{font-size:22px;line-height:1.3;letter-spacing:.07em}
  .ecclesia-event-meta-row{font-size:15px;line-height:1.42;gap:7px;margin:6px 0}
  .ecclesia-meta-icon{flex-basis:17px;width:17px;height:20px}
  .ecclesia-meta-icon svg{width:16px;height:16px}
  .ecclesia-event-tags .wpem-event-type-text,.ecclesia-event-tags .wpem-event-ticket-type-text{font-size:14px;padding:5px 7px}
}
@container (max-width:360px){
  .ecclesia-event-card .wpem-event-banner{height:195px}
  .ecclesia-event-card .wpem-event-title .wpem-heading-text{font-size:20px}
  .ecclesia-event-meta-row{font-size:14px}
}

/* Hero carousel */
.ecclesia-hero-carousel{position:relative;margin:0 0 24px;background:#101010;color:#fff;overflow:hidden;border-radius:var(--ee-radius);min-height:330px}
.ecclesia-hero-slides,.ecclesia-hero-slide{min-height:330px}
.ecclesia-hero-slide{position:relative;display:flex;align-items:flex-end;isolation:isolate}
.ecclesia-hero-slide[hidden]{display:none!important}
.ecclesia-hero-image{position:absolute;z-index:-2;inset:0;width:100%;height:100%;object-fit:cover}
.ecclesia-hero-overlay{position:absolute;z-index:-1;inset:0;background:linear-gradient(90deg,rgba(0,0,0,.86) 0%,rgba(0,0,0,.62) 48%,rgba(0,0,0,.2) 100%)}
.ecclesia-hero-content{width:min(760px,86%);padding:42px 58px 46px}
.ecclesia-hero-kicker{display:inline-block;font-size:12px;text-transform:uppercase;letter-spacing:.12em;font-weight:800;color:#fff;background:var(--ee-accent);padding:6px 9px;margin-bottom:10px}
.ecclesia-hero-content h2{color:#fff;font-size:clamp(30px,5vw,52px);line-height:1.03;margin:0 0 10px;text-shadow:0 2px 9px rgba(0,0,0,.55);overflow-wrap:anywhere}
.ecclesia-hero-date,.ecclesia-hero-location{font-size:16px;margin:4px 0;color:#fff}
.ecclesia-hero-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:18px}
.ecclesia-hero-button{display:inline-block;background:#fff;color:#111!important;text-decoration:none!important;padding:11px 17px;font-weight:800}
.ecclesia-hero-button-secondary{background:var(--ee-accent);color:#fff!important}
.ecclesia-hero-nav{position:absolute;top:50%;transform:translateY(-50%);z-index:4;width:42px;height:52px;border:0;background:rgba(0,0,0,.55);color:#fff;font-size:34px;line-height:1;cursor:pointer}
.ecclesia-hero-prev{left:0}.ecclesia-hero-next{right:0}
.ecclesia-hero-dots{position:absolute;left:50%;bottom:13px;transform:translateX(-50%);z-index:5;display:flex;gap:7px}
.ecclesia-hero-dot{width:10px;height:10px;border-radius:50%;border:1px solid #fff;background:transparent;padding:0;cursor:pointer}
.ecclesia-hero-dot.is-active{background:#fff}
.ecclesia-hero-nav:focus-visible,.ecclesia-hero-dot:focus-visible,.ecclesia-hero-button:focus-visible{outline:3px solid #fff;outline-offset:2px}

/* Single event */
.ecclesia-single-event{margin:0 0 30px}
.ecclesia-single-banner{margin:0 0 18px;max-height:none!important;overflow:visible!important;background:transparent}
.ecclesia-single-banner img{display:block;width:100%!important;height:auto!important;max-height:none!important;object-fit:contain!important;object-position:center center!important}
.ecclesia-single-status-row{display:flex;gap:7px;flex-wrap:wrap;margin:0 0 14px}
.ecclesia-event-status{display:inline-block;padding:5px 9px;border-radius:999px;background:#eee;color:#333;font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.04em}
.ecclesia-event-status.is-cancelled{background:#b32d2e;color:#fff}.ecclesia-event-status.is-past{background:#555;color:#fff}.ecclesia-event-status.is-hero{background:var(--ee-accent);color:#fff}
.ecclesia-single-grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(250px,1fr);gap:28px;align-items:start}
.ecclesia-single-description>*:first-child{margin-top:0}
.ecclesia-single-sidebar{background:#f7f7f7;border:1px solid var(--ee-border);padding:19px}
.ecclesia-detail-block{padding:0 0 13px;margin:0 0 13px;border-bottom:1px solid var(--ee-border)}
.ecclesia-detail-block strong,.ecclesia-detail-block span{display:block}.ecclesia-detail-block strong{font-size:12px;text-transform:uppercase;letter-spacing:.04em;margin-bottom:3px}
.ecclesia-book-button{width:100%;text-align:center;margin-top:4px}

/* Viewport fallbacks for filters, single event and Hero. Event cards themselves use container queries above. */
@media(max-width:1000px){.ecclesia-filter-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:720px){.ecclesia-filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.ecclesia-single-grid{grid-template-columns:1fr}.ecclesia-hero-content{padding:34px 44px 45px;width:94%}}
@media(max-width:520px){.ecclesia-filter-grid{grid-template-columns:1fr}.ecclesia-hero-carousel,.ecclesia-hero-slides,.ecclesia-hero-slide{min-height:285px}.ecclesia-hero-content{padding:32px 34px 43px}.ecclesia-hero-nav{width:32px;height:46px;font-size:28px}.ecclesia-hero-actions{gap:7px}.ecclesia-hero-button{padding:9px 12px;font-size:14px}}
@container (max-width:520px){
  .ecclesia-hero-carousel,.ecclesia-hero-slides,.ecclesia-hero-slide{min-height:270px}
  .ecclesia-hero-content{width:100%;padding:28px 38px 42px}
  .ecclesia-hero-content h2{font-size:28px}
  .ecclesia-hero-date,.ecclesia-hero-location{font-size:14px}
}

@media(prefers-reduced-motion:reduce){.ecclesia-event-card .wpem-event-layout-wrapper,.ecclesia-event-card .wpem-event-banner-img{transition:none!important}.ecclesia-hero-slide{scroll-behavior:auto!important}}

/* v0.1.5: explicit Hero start/end lines reduce date ambiguity. */
.ecclesia-hero-date{display:flex;flex-direction:column;gap:3px}
.ecclesia-hero-date .ecclesia-hero-start,.ecclesia-hero-date .ecclesia-hero-end{display:block}

/* v0.1.7 lifecycle and availability states. */
.ecclesia-card-status{position:absolute;right:12px;top:12px;z-index:3;display:inline-block;padding:7px 10px;border-radius:3px;color:#fff;background:#555;font-size:11px;line-height:1;font-weight:800;letter-spacing:.06em;text-transform:uppercase;box-shadow:0 2px 8px rgba(0,0,0,.22)}
.ecclesia-card-status.is-nearly_sold_out{background:#d97706}.ecclesia-card-status.is-sold_out{background:#b32d2e}.ecclesia-card-status.is-ended{background:#555}
.ecclesia-ended-notice{margin:12px 0 2px;padding:10px 11px;border-left:4px solid #555;background:#f3f3f3;color:#333;font-size:13px;line-height:1.35}
.ecclesia-ended-notice strong{display:block;margin-bottom:2px}.ecclesia-ended-notice a{font-weight:700;text-decoration:underline}
.ecclesia-hero-availability{display:inline-block;margin-left:7px;padding:6px 9px;background:#d97706;color:#fff;font-size:12px;line-height:1;text-transform:uppercase;letter-spacing:.06em;font-weight:800;vertical-align:top}
.ecclesia-event-status.is-nearly_sold_out{background:#d97706;color:#fff}.ecclesia-event-status.is-sold_out{background:#b32d2e;color:#fff}
.ecclesia-single-ended-notice{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;margin:0 0 18px;padding:14px 16px;background:#f3f3f3;border-left:5px solid #555;color:#222}
.ecclesia-next-event-button{display:inline-block;padding:8px 12px;background:var(--ee-dark);color:#fff!important;text-decoration:none!important;font-weight:700}
@container (max-width:430px){.ecclesia-card-status{right:10px;top:10px;font-size:10px;padding:6px 8px}.ecclesia-hero-availability{display:block;width:max-content;margin:7px 0 0}}

/* v0.1.9: cap single-event artwork without cropping. Click/tap opens the full image. */
.ecclesia-single-banner{display:flex!important;align-items:center;justify-content:center;margin:0 0 18px!important;max-height:none!important;overflow:visible!important;background:#111!important}
.ecclesia-single-image-button{position:relative;display:flex;align-items:center;justify-content:center;width:100%;height:min(620px,72vh);min-height:220px;margin:0;padding:0;border:0;background:#111;cursor:zoom-in;overflow:hidden}
.ecclesia-single-image-button img{display:block!important;width:auto!important;height:auto!important;max-width:100%!important;max-height:100%!important;object-fit:contain!important;object-position:center center!important}
.ecclesia-image-expand-hint{position:absolute;right:14px;bottom:14px;padding:7px 10px;border-radius:3px;background:rgba(0,0,0,.72);color:#fff;font-size:12px;font-weight:700;letter-spacing:.02em;opacity:0;transform:translateY(4px);transition:opacity .18s ease,transform .18s ease;pointer-events:none}
.ecclesia-single-image-button:hover .ecclesia-image-expand-hint,.ecclesia-single-image-button:focus-visible .ecclesia-image-expand-hint{opacity:1;transform:translateY(0)}
.ecclesia-single-image-button:focus-visible{outline:3px solid var(--ee-accent);outline-offset:3px}
.ecclesia-image-lightbox[hidden]{display:none!important}
.ecclesia-image-lightbox{position:fixed;z-index:1000002;inset:0;display:flex;align-items:center;justify-content:center;padding:24px;background:rgba(0,0,0,.92)}
.ecclesia-image-lightbox img{display:block;max-width:96vw;max-height:92vh;width:auto;height:auto;object-fit:contain}
.ecclesia-image-lightbox-close{position:fixed;z-index:2;top:18px;right:22px;width:46px;height:46px;border:1px solid rgba(255,255,255,.5);border-radius:50%;background:rgba(0,0,0,.6);color:#fff;font-size:32px;line-height:1;cursor:pointer}
.ecclesia-image-lightbox-close:focus-visible{outline:3px solid #fff;outline-offset:3px}
body.ecclesia-image-lightbox-open{overflow:hidden!important}
@media(max-width:720px){.ecclesia-single-image-button{height:min(500px,62vh);min-height:180px}.ecclesia-image-expand-hint{opacity:.85;right:10px;bottom:10px}}

/* v0.2.0: WP Event Manager-style search bar on the dedicated Upcoming Events page. */
.ecclesia-event-filters{padding:0;margin:0 0 26px;background:#fff;border:1px solid var(--ee-border);border-radius:5px;overflow:hidden;box-shadow:0 1px 2px rgba(0,0,0,.02)}
.ecclesia-filter-primary{display:grid;grid-template-columns:minmax(210px,1.35fr) minmax(170px,.9fr) auto auto;align-items:stretch;min-height:68px}
.ecclesia-filter-control{display:flex;align-items:center;min-width:0;margin:0;border-right:1px solid var(--ee-border);background:#fff}
.ecclesia-filter-control input{width:100%;min-width:0;height:100%;min-height:66px;margin:0;padding:0 16px 0 4px;border:0!important;background:transparent!important;box-shadow:none!important;font-size:16px;color:#222}
.ecclesia-filter-control input:focus{outline:0;box-shadow:none!important}
.ecclesia-filter-icon{display:flex;align-items:center;justify-content:center;flex:0 0 44px;color:#111}
.ecclesia-filter-icon svg{display:block;width:22px;height:22px;fill:currentColor}
.ecclesia-filter-more{display:flex;align-items:center;justify-content:center;gap:2px;min-width:104px;padding:0 12px;border:0;border-right:1px solid var(--ee-border);background:#fff;color:#222;font:inherit;font-weight:700;cursor:pointer}
.ecclesia-filter-more:hover,.ecclesia-filter-more:focus-visible{background:#f6f6f6}
.ecclesia-filter-more[aria-expanded="true"]{background:#f3f3f3}
.ecclesia-filter-submit{min-width:146px!important;margin:14px!important;padding:0 18px!important;border-radius:4px!important;white-space:nowrap}
.ecclesia-filter-advanced{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;padding:16px;border-top:1px solid var(--ee-border);background:#fafafa}
.ecclesia-filter-advanced[hidden]{display:none!important}
.ecclesia-filter-advanced label{display:flex;flex-direction:column;gap:5px;min-width:0}
.ecclesia-filter-advanced label>span{font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.04em}
.ecclesia-filter-advanced input,.ecclesia-filter-advanced select{width:100%;min-width:0;min-height:40px;margin:0;padding:7px 9px;background:#fff;border:1px solid #c8c8c8}
.ecclesia-filter-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 14px;border-top:1px solid var(--ee-border);background:#fff;color:#666;font-size:13px}
.ecclesia-filter-result-count{font-weight:600}
.ecclesia-filter-reset{border:0;background:transparent;color:var(--ee-accent);font:inherit;font-weight:700;text-decoration:underline;cursor:pointer}
.ecclesia-event-filters .screen-reader-text{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}

@media(max-width:900px){
  .ecclesia-filter-primary{grid-template-columns:1fr 1fr auto}
  .ecclesia-filter-submit{grid-column:1/-1;min-height:44px!important;margin:0!important;border-radius:0!important}
  .ecclesia-filter-location{border-right:1px solid var(--ee-border)}
  .ecclesia-filter-advanced{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:620px){
  .ecclesia-filter-primary{display:flex;flex-direction:column;min-height:0}
  .ecclesia-filter-control,.ecclesia-filter-more{width:100%;min-height:52px;border-right:0;border-bottom:1px solid var(--ee-border)}
  .ecclesia-filter-control input{min-height:52px}
  .ecclesia-filter-more{justify-content:flex-start;padding-left:0}
  .ecclesia-filter-submit{width:100%;min-width:0!important;min-height:48px!important}
  .ecclesia-filter-advanced{grid-template-columns:1fr}
  .ecclesia-filter-footer{align-items:flex-start;flex-direction:column}
}
