/* ============================================================
   Event Manager – Frontend Styles
   ============================================================ */

/* ---- List view ------------------------------------------- */
.em-event-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-family: inherit;
}

.em-event-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    border-left: 5px solid #3788d8;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    border-radius: 4px;
    transition: box-shadow .2s;
}
.em-event-item:hover {
    box-shadow: 0 3px 12px rgba(0,0,0,.14);
}

.em-event-date-badge {
    flex: 0 0 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    border-radius: 6px;
    background: #3788d8;
    color: #fff;
    min-width: 52px;
}
.em-event-date-badge .em-day {
    font-size: 1.6em;
    font-weight: 700;
    line-height: 1;
}
.em-event-date-badge .em-month {
    font-size: .72em;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.em-event-content {
    flex: 1;
}
.em-event-title {
    margin: 0 0 4px;
    font-size: 1.15em;
}
.em-event-title a {
    text-decoration: none;
    color: inherit;
}
.em-event-title a:hover {
    text-decoration: underline;
}
.em-event-date,
.em-event-location,
.em-event-organizer,
.em-event-excerpt {
    margin: 2px 0;
    font-size: .9em;
    color: #555;
}
.em-icon {
    margin-right: 4px;
}
.em-event-readmore {
    display: inline-block;
    margin-top: 8px;
    font-size: .85em;
    font-weight: 600;
    text-decoration: none;
    color: #3788d8;
}
.em-event-readmore:hover {
    text-decoration: underline;
}
.em-no-events {
    color: #888;
    font-style: italic;
}

/* ---- Calendar view --------------------------------------- */
.em-calendar {
    font-family: inherit;
    max-width: 100%;
}
.em-calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.em-cal-title {
    font-weight: 700;
    font-size: 1.1em;
}
.em-cal-prev,
.em-cal-next {
    background: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 1.1em;
    line-height: 1;
}
.em-cal-prev:hover,
.em-cal-next:hover {
    background: #f0f0f0;
}
.em-cal-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
.em-cal-table th {
    text-align: center;
    padding: 6px 2px;
    font-size: .8em;
    color: #888;
    border-bottom: 2px solid #eee;
}
.em-cal-table td {
    vertical-align: top;
    min-height: 80px;
    height: 80px;
    padding: 4px;
    border: 1px solid #eee;
    font-size: .85em;
}
.em-cal-empty {
    background: #fafafa;
}
.em-today .em-cal-day-num {
    background: #3788d8;
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
}
.em-cal-day-num {
    display: inline-block;
    font-weight: 600;
    margin-bottom: 2px;
}
.em-cal-events {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.em-cal-events li {
    border-radius: 3px;
    padding: 1px 5px;
    font-size: .78em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: #3788d8;
}
.em-cal-events li a {
    color: #fff;
    text-decoration: none;
}
.em-cal-events li a:hover {
    text-decoration: underline;
}

/* ---- Single event ---------------------------------------- */
.em-single-event {
    max-width: 720px;
    margin: 0 auto;
    font-family: inherit;
}
.em-single-header {
    padding-top: 12px;
    margin-bottom: 20px;
}
.em-single-thumbnail {
    margin-bottom: 16px;
}
.em-single-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: 6px;
}
.em-single-title {
    font-size: 1.8em;
    margin: 0 0 8px;
}
.em-single-meta {
    background: #f7f7f7;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.em-meta-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: .95em;
}
.em-meta-icon {
    width: 20px;
    text-align: center;
}
.em-meta-item strong {
    min-width: 90px;
    color: #444;
}
.em-single-body {
    margin-bottom: 24px;
    line-height: 1.7;
}
.em-single-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
}
.em-tag {
    background: #eee;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: .8em;
    color: #555;
}
.em-single-back a {
    font-size: .9em;
    text-decoration: none;
    color: #3788d8;
}
.em-single-back a:hover {
    text-decoration: underline;
}

/* ---- Enfold theme overrides ------------------------------ */
/*
 * Enfold resets margins/padding and overrides article, h3, a globally.
 * These rules restore the expected look inside .em-* containers.
 */
.em-event-list article.em-event-item {
    /* Enfold sets article { margin: 0 } globally */
    margin: 0 !important;
    padding: 16px !important;
    border: none !important;         /* Enfold adds border to article */
    border-left: 5px solid #3788d8 !important;
    border-radius: 4px !important;
    background: #fff !important;
    box-shadow: 0 1px 4px rgba(0,0,0,.08) !important;
}
.em-event-item .em-event-title {
    /* Enfold h3 often has letter-spacing / text-transform */
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-size: 1.15em !important;
    margin: 0 0 4px !important;
    border: none !important;
    padding: 0 !important;
}
.em-event-item .em-event-title a,
.em-event-readmore,
.em-single-back a,
.em-cal-events li a {
    /* Enfold theme color can override link colors */
    text-decoration: none !important;
    border-bottom: none !important;  /* Enfold adds border-bottom to links */
    box-shadow: none !important;
}
.em-event-item .em-event-date,
.em-event-item .em-event-location,
.em-event-item .em-event-organizer,
.em-event-item .em-event-excerpt {
    margin: 2px 0 !important;
    padding: 0 !important;
    font-size: .9em !important;
    color: #555 !important;
    line-height: 1.5 !important;
}
.em-single-meta strong {
    /* Enfold sometimes bolds too aggressively */
    font-weight: 600 !important;
}
/* Prevent Enfold from stretching the date badge image */
.em-event-date-badge img { display: none; }

/* ---- Responsive ------------------------------------------ */
@media (max-width: 600px) {
    .em-event-item {
        flex-direction: column;
        gap: 8px;
    }
    .em-event-date-badge {
        flex-direction: row;
        gap: 6px;
        padding: 6px 10px;
    }
    .em-cal-table td {
        height: 56px;
        font-size: .75em;
    }
    .em-cal-events li {
        display: none;
    }
    .em-has-events::after {
        content: '•';
        color: #3788d8;
        display: block;
        text-align: center;
    }
}
