/**
 * EC Events – Public CSS
 * EC Digital https://www.ec-digital.com
 */

/* ── Reset & base ────────────────────────────────────────────────────────── */
.ec-wrap { font-family: inherit; line-height: 1.6; color: inherit; }
.ec-container { max-width: 1100px; margin: 0 auto; padding: 1.5em 1.25em; }

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.ec-breadcrumb { font-size: .83rem; color: #888; margin-bottom: 1.25em; display: flex; flex-wrap: wrap; gap: .35em; align-items: center; }
.ec-breadcrumb a { color: #555; text-decoration: none; }
.ec-breadcrumb a:hover { color: #333; text-decoration: underline; }
.ec-breadcrumb span { color: #bbb; }

/* ── Archive header ──────────────────────────────────────────────────────── */
.ec-archive-header { margin-bottom: 1.75em; }
.ec-archive-title { font-size: 2rem; font-weight: 700; margin: 0 0 .3em; }
.ec-archive-desc  { color: #666; margin: 0; }
.ec-list-heading  { font-size: 1.7rem; font-weight: 700; margin: 0 0 1.25em; }

/* ── Month group ─────────────────────────────────────────────────────────── */
.ec-events-month { margin-bottom: 2.5em; }
.ec-month-label  { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #888; margin: 0 0 .85em; padding-bottom: .4em; border-bottom: 1px solid #e5e5e5; }

/* ── Event card (archive row) ────────────────────────────────────────────── */
.ec-event-card { display: flex; align-items: flex-start; gap: 1.1em; padding: 1.1em 0; border-bottom: 1px solid #f0f0f0; }
.ec-event-card:last-child { border-bottom: none; }

.ec-event-card-date { flex: 0 0 48px; text-align: center; }
.ec-date-dow { display: block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #999; line-height: 1; margin-bottom: .1em; }
.ec-date-num { display: block; font-size: 1.9rem; font-weight: 700; color: #222; line-height: 1; }

.ec-event-card-body { flex: 1; min-width: 0; }
.ec-event-card-meta { font-size: .8rem; color: #666; font-weight: 500; margin-bottom: .2em; }
.ec-event-card-title { font-size: 1.08rem; font-weight: 700; margin: 0 0 .25em; line-height: 1.35; }
.ec-event-card-title a { color: #1a1a1a; text-decoration: none; }
.ec-event-card-title a:hover { color: #e05020; }
.ec-event-card-venue { font-size: .82rem; font-weight: 600; color: #444; margin-bottom: .2em; }
.ec-event-card-excerpt { font-size: .85rem; color: #666; margin: .2em 0 .35em; line-height: 1.5; }
.ec-event-card-cost { display: inline-block; font-size: .82rem; font-weight: 700; color: #1a1a1a; background: #f5f5f5; padding: .15em .6em; border-radius: 3px; }

.ec-event-card-thumb-link { flex: 0 0 200px; display: block; border-radius: 6px; background: #f5f5f5; line-height: 0; }
.ec-event-card-thumb { width: 200px; height: auto !important; max-height: none !important; object-fit: unset !important; display: block; transition: transform .25s; }
.ec-event-card-thumb-link:hover .ec-event-card-thumb { transform: scale( 1.04 ); }

/* ── Single event ────────────────────────────────────────────────────────── */

/* Hero image inside left column — 2:1 ratio, full image visible, no crop */
.ec-event-hero-img-wrap {
    margin-bottom: 1.25em;
    border-radius: 8px;
    background: #f5f5f5;
    line-height: 0; /* remove phantom bottom gap */
}
.ec-event-hero-img {
    width: 100%;
    height: auto !important;  /* natural height — never crop */
    max-height: none !important;
    object-fit: unset !important; /* override any theme CSS */
    display: block;
    border-radius: 8px;
}

/* Two-column grid — both columns strictly inside .ec-container */
.ec-event-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2.5em;
    align-items: start;
    width: 100%;
    box-sizing: border-box;
}

.ec-event-title  { font-size: 1.75rem; font-weight: 700; margin: 0 0 .6em; line-height: 1.25; }
.ec-event-datetime { font-size: .92rem; font-weight: 600; color: #555; margin-bottom: 1.25em; display: flex; align-items: center; gap: .4em; }
.ec-event-description { line-height: 1.75; }
.ec-event-description p { margin-top: 0; }

.ec-event-status { display: inline-block; padding: .25em .9em; border-radius: 3px; font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .75em; }
.ec-status--cancelled { background: #ffebee; color: #b71c1c; }
.ec-status--postponed { background: #fff8e1; color: #e65100; }
.ec-status--sold_out  { background: #f3e5f5; color: #4a148c; }

.ec-event-cats { margin-top: 1.5em; display: flex; flex-wrap: wrap; gap: .5em; }
.ec-cat-badge { background: #f0f0f0; color: #444; font-size: .8rem; font-weight: 600; padding: .25em .75em; border-radius: 99px; text-decoration: none; }
.ec-cat-badge:hover { background: #e0e0e0; color: #222; text-decoration: none; }

/* Venue + Organizer row below the ticket widget */
.ec-event-meta-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5em; margin-top: 2em; padding-top: 1.5em; border-top: 1px solid #ebebeb; }
.ec-meta-block h3 { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: #888; margin: 0 0 .5em; }
.ec-meta-block p  { font-size: .88rem; margin: 0 0 .35em; line-height: 1.5; }
.ec-meta-block a  { color: #333; text-decoration: none; }
.ec-meta-block a:hover { color: #e05020; text-decoration: underline; }
.ec-meta-block .ec-venue-addr { color: #666; }
.ec-meta-block .ec-map-link   { font-size: .82rem; color: #e05020; display: inline-block; margin-top: .3em; }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.ec-event-sidebar { position: sticky; top: 2em; }
.ec-sidebar-card { background: #fafafa; border: 1px solid #ebebeb; border-radius: 8px; padding: 1.1em 1.25em; margin-bottom: 1em; }
.ec-sidebar-card h3 { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: #888; margin: 0 0 .6em; }
.ec-sidebar-card p { margin: 0 0 .4em; font-size: .9rem; line-height: 1.5; }
.ec-sidebar-card p:last-child { margin-bottom: 0; }
.ec-sidebar-card a { color: #333; text-decoration: none; }
.ec-sidebar-card a:hover { color: #e05020; text-decoration: underline; }
.ec-venue-addr { color: #666 !important; }
.ec-map-link { font-size: .82rem !important; color: #e05020 !important; display: inline-block; margin-top: .4em; }
.ec-cost { font-size: 1.3rem !important; font-weight: 700 !important; color: #1a1a1a !important; }
.ec-all-day { font-size: .82rem !important; color: #888 !important; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.ec-btn { display: inline-block; padding: .65em 1.4em; border-radius: 4px; font-size: .9rem; font-weight: 600; text-decoration: none !important; text-align: center; transition: background .2s; cursor: pointer; border: none; }
.ec-btn-primary { background: #e05020; color: #fff !important; }
.ec-btn-primary:hover { background: #c04010; color: #fff !important; }
.ec-btn-full { display: block; width: 100%; box-sizing: border-box; }

/* ── Venue / organizer single ────────────────────────────────────────────── */
.ec-venue-hero-img, .ec-organizer-logo { width: 100%; max-height: 280px; object-fit: cover; border-radius: 8px; margin-bottom: 1.25em; }
.ec-organizer-logo { max-width: 200px; max-height: 200px; object-fit: contain; background: #f5f5f5; padding: 1em; }

.ec-venue-events h2, .ec-organizer-events h2 { font-size: 1.2rem; font-weight: 700; margin: 2em 0 .75em; padding-top: 1.5em; border-top: 1px solid #eee; }
.ec-mini-event-row { display: flex; gap: 1em; padding: .55em 0; border-bottom: 1px solid #f5f5f5; font-size: .88rem; }
.ec-mini-date { color: #777; flex: 0 0 220px; white-space: nowrap; }
.ec-mini-event-row a { color: #1a1a1a; font-weight: 600; text-decoration: none; }
.ec-mini-event-row a:hover { color: #e05020; text-decoration: underline; }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.ec-pagination { margin: 2em 0; text-align: center; }
.ec-pagination .page-numbers { display: inline-block; padding: .4em .8em; margin: 0 .15em; border: 1px solid #ddd; border-radius: 4px; color: #444; text-decoration: none; font-size: .88rem; }
.ec-pagination .page-numbers.current { background: #e05020; color: #fff; border-color: #e05020; }
.ec-pagination .page-numbers:hover { background: #f5f5f5; text-decoration: none; }

/* ── Empty states ────────────────────────────────────────────────────────── */
.ec-no-events, .ec-events-empty { padding: 1.5em; background: #f9f9f9; border-left: 3px solid #ddd; color: #777; border-radius: 2px; font-size: .95rem; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media ( max-width: 780px ) {
    .ec-event-layout { grid-template-columns: 1fr; }
    .ec-event-sidebar { position: static; }
    .ec-event-meta-row { grid-template-columns: 1fr; }
    .ec-event-card-thumb-link { flex: 0 0 140px; }
    .ec-event-card-thumb { width: 140px; height: auto !important; }
    .ec-archive-title, .ec-event-title { font-size: 1.5rem; }
}

@media ( max-width: 500px ) {
    .ec-event-card { flex-wrap: wrap; }
    .ec-event-card-thumb-link { flex: 0 0 100%; order: -1; }
    .ec-event-card-thumb { width: 100%; height: auto !important; }
    .ec-mini-date { flex: 0 0 100%; }
    .ec-mini-event-row { flex-wrap: wrap; gap: .2em; }
}

/* ── View switcher ───────────────────────────────────────────────────────── */
.ec-archive-header-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1em; margin-bottom: 1.5em; }
.ec-view-switcher { display: flex; gap: .35em; }
.ec-view-btn { display: inline-flex; align-items: center; gap: .35em; padding: .4em .9em; border: 1px solid #ddd; border-radius: 4px; font-size: .82rem; font-weight: 600; color: #555; text-decoration: none; transition: background .15s, border-color .15s; }
.ec-view-btn:hover { background: #f5f5f5; border-color: #bbb; text-decoration: none; color: #333; }
.ec-view-btn--active { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }
.ec-view-btn--active:hover { background: #333; color: #fff; border-color: #333; }

/* ── Month calendar grid ─────────────────────────────────────────────────── */
.ec-calendar { margin: 0 0 2em; }
.ec-cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1em; }
.ec-cal-title { font-size: 1.25rem; font-weight: 700; margin: 0; }
.ec-cal-nav { display: inline-block; width: 32px; height: 32px; line-height: 32px; text-align: center; border: 1px solid #ddd; border-radius: 4px; color: #444; text-decoration: none; font-size: 1.1rem; transition: background .15s; }
.ec-cal-nav:hover { background: #f5f5f5; text-decoration: none; }

.ec-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: #e5e5e5; border: 1px solid #e5e5e5; border-radius: 8px; overflow: hidden; }
.ec-cal-dow { background: #f8f8f8; text-align: center; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #888; padding: .5em 0; }
.ec-cal-cell { background: #fff; min-height: 90px; padding: .4em .5em; position: relative; vertical-align: top; }
.ec-cal-cell.ec-cal-empty { background: #fafafa; }
.ec-cal-cell.ec-cal-today .ec-cal-day-num { background: #e05020; color: #fff; border-radius: 50%; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; }
.ec-cal-cell.ec-cal-has-events { background: #fffef8; }
.ec-cal-day-num { font-size: .8rem; font-weight: 600; color: #555; line-height: 1; }
.ec-cal-events { list-style: none; margin: .35em 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ec-cal-events li { line-height: 1.2; }
.ec-cal-events a { display: block; font-size: .72rem; background: #e05020; color: #fff; padding: 2px 5px; border-radius: 3px; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ec-cal-events a:hover { background: #c04010; }

@media ( max-width: 600px ) {
    .ec-cal-cell { min-height: 60px; padding: .25em; }
    .ec-cal-events a { font-size: 0; width: 8px; height: 8px; border-radius: 50%; padding: 0; }
}

/* ── Add to Calendar buttons ─────────────────────────────────────────────── */
.ec-add-to-calendar { display: flex; align-items: center; flex-wrap: wrap; gap: .75em; margin: 1.25em 0; padding: 1em 1.25em; background: #f9f9f9; border: 1px solid #ebebeb; border-radius: 8px; }
.ec-atc-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #888; white-space: nowrap; }
.ec-atc-buttons { display: flex; flex-wrap: wrap; gap: .5em; }
.ec-atc-btn { display: inline-flex; align-items: center; gap: .35em; padding: .4em 1em; border: 1px solid #ddd; border-radius: 4px; font-size: .82rem; font-weight: 600; color: #333; text-decoration: none !important; transition: background .15s, border-color .15s; white-space: nowrap; }
.ec-atc-btn:hover { background: #f0f0f0; border-color: #bbb; color: #111 !important; text-decoration: none !important; }
.ec-atc-google  { border-color: #dde; }
.ec-atc-outlook { border-color: #dde; }
.ec-atc-ics     { border-color: #dde; }
