/* AFH Events Manager Styles */
:root {
    --afh-primary:    #2a7d8c;
    --afh-primary-dk: #1e6070;
    --afh-orange:     #e5a550;
    --afh-blue:       #3a8cc4;
    --afh-purple:     #7b62a3;
    --afh-teal:       #3a9da0;
    --afh-text:       #2d3748;
    --afh-muted:      #718096;
    --afh-border:     #e2e8f0;
    --afh-bg:         #f8fafc;
    --afh-white:      #ffffff;
    --afh-radius:     10px;
    --afh-shadow:     0 2px 12px rgba(0,0,0,.08);
}

.afh-events-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--afh-text);
    max-width: 1100px;
    margin: 0 auto;
    background: var(--afh-white);
}

/* ── Filters Bar ── */
.afh-filters-bar {
    display: flex !important;
    align-items: center !important;
    flex-direction: row !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
    margin-bottom: 20px !important;
}

.afh-search-wrap {
    position: relative !important;
    flex: 1 !important;
    min-width: 200px !important;
}
.afh-search-wrap input {
    width: 100% !important;
    padding: 10px 16px 10px 38px !important;
    border: 1px solid var(--afh-border) !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    color: var(--afh-text) !important;
    background: var(--afh-white) !important;
    box-sizing: border-box !important;
    outline: none !important;
    transition: border-color .2s;
    display: block !important;
    margin: 0 !important;
}
.afh-search-wrap input:focus { border-color: var(--afh-primary) !important; }
.afh-search-icon {
    position: absolute !important;
    left: 11px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 15px !important;
    color: var(--afh-muted) !important;
    pointer-events: none !important;
}

.afh-filters-bar select {
    padding: 10px 32px 10px 12px !important;
    border: 1px solid var(--afh-border) !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    color: var(--afh-text) !important;
    background: var(--afh-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23718096'/%3E%3C/svg%3E") no-repeat right 12px center !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    cursor: pointer !important;
    outline: none !important;
    transition: border-color .2s;
    width: auto !important;
    display: inline-block !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}
.afh-filters-bar select:focus { border-color: var(--afh-primary) !important; }

/* ── Tabs Row ── */
.afh-tabs-row {
    display: flex !important;
    align-items: center !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    margin-bottom: 24px !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
}

.afh-tabs {
    display: flex;
    flex-direction: row;
    gap: 0;
}

.afh-hidden {
    display: none !important;
}


.afh-tab {
    padding: 10px 22px;
    border: 2px solid var(--afh-border);
    background: var(--afh-white);
    color: var(--afh-text);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
    line-height: 1;
}
.afh-tab:first-child { border-radius: 6px 0 0 6px; border-right: none; }
.afh-tab:last-child  { border-radius: 0 6px 6px 0; }
.afh-tab.active {
    background: var(--afh-primary);
    color: var(--afh-white);
    border-color: var(--afh-primary);
}
.afh-tab:hover:not(.active) { background: var(--afh-bg); }

.afh-calendar-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border: 2px solid var(--afh-border);
    border-radius: 6px;
    background: var(--afh-white);
    color: var(--afh-text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background .2s, border-color .2s;
}
.afh-calendar-btn:hover { background: var(--afh-bg); border-color: var(--afh-primary); }

/* ── Events Grid ── */
.afh-events-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}
@media (max-width: 700px) {
    .afh-events-grid { grid-template-columns: 1fr; }
}

/* ── Event Card ── */
.afh-event-card {
    border: 1px solid var(--afh-border);
    border-radius: var(--afh-radius);
    background: var(--afh-white);
    box-shadow: var(--afh-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s, transform .2s;
}
.afh-event-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,.12);
    transform: translateY(-2px);
}

.afh-event-card-inner {
    display: flex;
    gap: 0;
}

.afh-event-image {
    width: 140px;
    min-width: 140px;
    max-height: 160px;
    overflow: hidden;
    flex-shrink: 0;
}
.afh-event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.afh-event-image-placeholder {
    width: 100%;
    height: 100%;
    min-height: 140px;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e0 100%);
}

.afh-event-body {
    padding: 16px 16px 12px;
    flex: 1;
}

.afh-event-title {
    font-size: 15px !important;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 10px;
}
.afh-event-title a {
    color: var(--afh-primary);
    text-decoration: none;
    transition: color .2s;
}
.afh-event-title a:hover { color: var(--afh-primary-dk); text-decoration: underline; }

/* Badges */
.afh-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
}
.badge-teal   { background: #e0f5f5; color: var(--afh-teal); }
.badge-orange { background: #fef3e0; color: var(--afh-orange); }
.badge-blue   { background: #e0f0fa; color: var(--afh-blue); }
.badge-purple { background: #f0ecf8; color: var(--afh-purple); }

.afh-event-date {
    font-size: 13px;
    color: var(--afh-text);
    margin-bottom: 6px;
    font-weight: 400;
}

.afh-event-location-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--afh-muted);
}
.afh-location-icon { font-size: 14px; }
.afh-ceu {
    margin-left: auto;
    background: #e0f5f5;
    color: var(--afh-teal);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* Footer */
.afh-event-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px 14px;
    border-top: 1px solid var(--afh-border);
}

.afh-event-excerpt {
    font-size: 13px;
    color: var(--afh-muted);
    margin: 0;
    flex: 1;
    line-height: 1.5;
}

.afh-register-btn {
    display: inline-block;
    padding: 8px 18px;
    border: 2px solid var(--afh-primary);
    border-radius: 6px;
    color: var(--afh-primary);
    background: var(--afh-white);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background .2s, color .2s;
}
.afh-register-btn:hover {
    background: var(--afh-primary);
    color: var(--afh-white);
}

/* ── Pagination ── */
.afh-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
}

.afh-page-btn {
    padding: 8px 14px;
    border: 1px solid var(--afh-border);
    border-radius: 50%;
    background: var(--afh-white);
    color: var(--afh-text);
    font-size: 14px;
    cursor: pointer;
    min-width: 36px;
    min-height: 36px;
    transition: background .2s, border-color .2s, color .2s;
    line-height: 1;
}
.afh-page-btn:hover:not(:disabled):not(.active) { background: var(--afh-bg); border-color: var(--afh-primary); }
.afh-page-btn.active {
    background: var(--afh-primary);
    border-color: var(--afh-primary);
    color: var(--afh-white);
}
.afh-page-btn:disabled { opacity: .4; cursor: not-allowed; }
.afh-prev, .afh-next {
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 13px;
}

/* ── Delivery Checkboxes ── */
.afh-delivery-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 14px;
    border: 1px solid var(--afh-border);
    border-radius: 6px;
    background: var(--afh-white);
}
.afh-delivery-label {
    font-size: 14px;
    color: var(--afh-muted);
    font-weight: 500;
    margin-right: 4px;
}
.afh-delivery-check {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: var(--afh-text);
    cursor: pointer;
    white-space: nowrap;
}
.afh-delivery-check input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--afh-primary);
    cursor: pointer;
}


.afh-loading, .afh-no-events {
    text-align: center;
    padding: 48px 16px;
    color: var(--afh-muted);
    font-size: 15px;
}

/* ── Calendar View ── */
.afh-calendar-view {
    background: var(--afh-white);
    border: 1px solid var(--afh-border);
    border-radius: var(--afh-radius);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--afh-shadow);
}

.afh-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.afh-calendar-header h3 { font-size: 17px; font-weight: 700; color: var(--afh-primary); margin: 0; }
.afh-calendar-header button {
    background: none;
    border: 1px solid var(--afh-border);
    border-radius: 6px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 18px;
    color: var(--afh-primary);
    transition: background .2s;
}
.afh-calendar-header button:hover { background: var(--afh-bg); }

.afh-calendar-days-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--afh-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 8px;
}

.afh-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.afh-cal-day {
    min-height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 4px 2px;
    border-radius: 6px;
    font-size: 13px;
    cursor: default;
}
.afh-cal-day.empty { background: none; }
.afh-cal-day.today { background: #e0f5f5; font-weight: 700; }
.afh-cal-day.has-event { background: #e8f4fe; cursor: pointer; }
.afh-cal-day.has-event:hover { background: #c8e8fc; }
.afh-cal-day-num { font-weight: 500; }
.afh-cal-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--afh-primary);
    margin-top: 3px;
}

/* ── Single Event Page ── */
.afh-single-wrap {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px 60px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.afh-single-inner {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 48px;
    align-items: start;
}
@media (max-width: 820px) {
    .afh-single-inner { grid-template-columns: 1fr; }
}

/* Left */
.afh-single-title {
    font-size: 26px !important;
    font-weight: 700;
    color: var(--afh-primary);
    margin: 0 0 12px;
    line-height: 1.3;
}

.afh-single-presenter {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--afh-muted);
    margin: 10px 0 14px;
}
.afh-presenter-icon { font-size: 16px; }

.afh-single-excerpt {
    font-size: 15px;
    color: var(--afh-text);
    line-height: 1.6;
    margin-bottom: 20px;
}

.afh-single-image {
    border-radius: var(--afh-radius);
    overflow: hidden;
    margin-bottom: 28px;
}
.afh-single-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Meta items */
.afh-single-meta {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.afh-meta-item {
    display: flex;
    align-items: center;
    gap: 14px;
}

.afh-meta-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--afh-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.afh-meta-label {
    font-size: 12px;
    color: var(--afh-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 2px;
}

.afh-meta-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--afh-text);
}

.afh-single-content {
    margin-top: 32px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--afh-text);
}

/* Right — Registration Box */
.afh-single-right {
    position: sticky;
    top: 24px;
}

.afh-reg-box {
    border: 1px solid var(--afh-border);
    border-radius: var(--afh-radius);
    padding: 28px;
    background: var(--afh-white);
    box-shadow: var(--afh-shadow);
}

.afh-reg-title {
    font-size: 20px !important;
    font-weight: 700;
    color: var(--afh-text);
    margin: 0 0 6px;
}

.afh-reg-subtitle {
    font-size: 13px;
    color: var(--afh-muted);
    margin: 0 0 22px;
}

.afh-reg-field {
    margin-bottom: 16px;
}

.afh-reg-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--afh-text);
    margin-bottom: 5px;
}

.afh-req { color: #e53e3e; }

.afh-reg-field input[type="text"],
.afh-reg-field input[type="email"],
.afh-reg-field input[type="tel"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--afh-border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--afh-text);
    background: var(--afh-white);
    box-sizing: border-box;
    outline: none;
    transition: border-color .2s;
}
.afh-reg-field input:focus {
    border-color: var(--afh-primary);
}
.afh-reg-field input::placeholder { color: #b0bec5; }

/* Checkbox */
.afh-reg-checkbox {
    background: var(--afh-bg);
    border: 1px solid var(--afh-border);
    border-radius: 6px;
    padding: 12px;
}

.afh-check-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-weight: 400 !important;
}

.afh-check-label input[type="checkbox"] {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    accent-color: var(--afh-primary);
    flex-shrink: 0;
    cursor: pointer;
}

.afh-check-label span {
    font-size: 12px;
    color: var(--afh-muted);
    line-height: 1.5;
}

/* Submit button */
.afh-reg-submit {
    width: 100%;
    padding: 14px;
    background: var(--afh-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: background .2s;
    letter-spacing: .01em;
}
.afh-reg-submit:hover { background: var(--afh-primary-dk); }

/* Success message */
.afh-reg-success {
    background: #e0f5f5;
    color: var(--afh-teal);
    border: 1px solid var(--afh-teal);
    border-radius: 6px;
    padding: 16px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

/* ── Registration Confirmation Box ── */
.afh-confirmed-box {
    border: 1px solid var(--afh-border);
    border-radius: var(--afh-radius);
    padding: 24px;
    background: #fafbfc;
}

.afh-confirmed-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.afh-confirmed-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--afh-orange);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.afh-confirmed-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--afh-text);
    margin: 0;
}

.afh-confirmed-cal-label {
    font-size: 14px;
    color: var(--afh-text);
    margin: 0 0 12px;
}

.afh-cal-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.afh-cal-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid var(--afh-border);
    border-radius: 6px;
    background: var(--afh-white);
    color: var(--afh-text);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background .2s, border-color .2s;
}
.afh-cal-btn:hover {
    background: var(--afh-bg);
    border-color: var(--afh-primary);
    color: var(--afh-text);
}
.afh-cal-btn img { border-radius: 3px; }
.afh-apple-icon { font-size: 18px; }

.afh-confirmed-note {
    font-size: 13px;
    color: var(--afh-muted);
    margin: 0;
}

/* ── Past Event Card ── */
.afh-event-card.afh-is-past {
    background: #f5f5f5;
}
.afh-event-card.afh-is-past .afh-event-image img {
    filter: grayscale(30%);
}
.afh-recording-btn {
    background: var(--afh-white) !important;
    color: var(--afh-primary) !important;
}

/* ── Past Event Single Box ── */
.afh-past-box { text-align: left; }
.afh-past-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.afh-past-icon {
    font-size: 28px;
    line-height: 1;
}

/* ── Full Calendar Grid (append to existing afh-events.css) ── */

/* ── Full Calendar Grid (append to existing afh-events.css) ── */
/* ── Full Calendar Grid (append to existing afh-events.css) ── */
/* ── Full Calendar Grid (append to existing afh-events.css) ── */
/* ── Full Calendar Grid (append to existing afh-events.css) ── */

.afh-events-wrap { position: relative !important; }

.afh-calendar-view {
    background: var(--afh-white) !important;
    border: 1px solid var(--afh-border) !important;
    border-radius: var(--afh-radius) !important;
    overflow: hidden !important;
    margin-bottom: 24px !important;
    padding: 0 !important;
    box-shadow: var(--afh-shadow) !important;
}

.afh-calendar-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 24px !important;
    padding: 16px !important;
    border-bottom: 1px solid var(--afh-border) !important;
    margin-bottom: 0 !important;
}
.afh-calendar-header h3 {
    font-size: 17px !important;
    font-weight: 700 !important;
    color: var(--afh-text) !important;
    margin: 0 !important;
    min-width: 160px !important;
    text-align: center !important;
}
.afh-calendar-header button {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    font-size: 24px !important;
    color: var(--afh-text) !important;
    cursor: pointer !important;
    padding: 0 8px !important;
    line-height: 1 !important;
}

.afh-calendar-days-header {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    border-bottom: 1px solid var(--afh-border) !important;
    margin-bottom: 0 !important;
    text-align: left !important;
}
.afh-calendar-days-header span {
    padding: 10px 0 10px 10px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: var(--afh-muted) !important;
    letter-spacing: .06em !important;
    text-transform: uppercase !important;
}

.afh-calendar-days {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 0 !important;
}

.afh-cal-cell {
    min-height: 110px !important;
    border-right: 1px solid var(--afh-border) !important;
    border-bottom: 1px solid var(--afh-border) !important;
    padding: 8px 6px !important;
    box-sizing: border-box !important;
    vertical-align: top !important;
}
.afh-cal-cell:nth-child(7n) { border-right: none !important; }
.afh-cal-other  { background: #f9fafb !important; }
.afh-cal-today  { background: #f0fafa !important; }

.afh-cal-num {
    display: block !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: var(--afh-text) !important;
    margin-bottom: 5px !important;
}
.afh-cal-other .afh-cal-num { color: #bbb !important; }
.afh-cal-today .afh-cal-num { color: var(--afh-primary) !important; font-weight: 700 !important; }

/* Event pill inside calendar cell */
.afh-cal-event {
    display: block !important;
    border-radius: 6px !important;
    padding: 5px 7px !important;
    margin-bottom: 4px !important;
    cursor: pointer !important;
    text-decoration: none !important;
    transition: opacity .15s !important;
}
.afh-cal-event:hover { opacity: .8 !important; }
.afh-cal-event.badge-teal   { background: #d6f0f0 !important; }
.afh-cal-event.badge-orange { background: #fdefd8 !important; }
.afh-cal-event.badge-blue   { background: #d6ecf8 !important; }
.afh-cal-event.badge-purple { background: #ede8f5 !important; }

.afh-cal-ev-type {
    display: inline-block !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    border-radius: 4px !important;
    padding: 1px 7px !important;
    margin-bottom: 3px !important;
    color: #fff !important;
}
.badge-teal   .afh-cal-ev-type { background: var(--afh-teal) !important; }
.badge-orange .afh-cal-ev-type { background: var(--afh-orange) !important; }
.badge-blue   .afh-cal-ev-type { background: var(--afh-blue) !important; }
.badge-purple .afh-cal-ev-type { background: var(--afh-purple) !important; }

.afh-cal-ev-title {
    display: block !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    color: var(--afh-text) !important;
    line-height: 1.3 !important;
    margin-bottom: 2px !important;
}
.afh-cal-ev-time,
.afh-cal-ev-loc {
    display: block !important;
    font-size: 10px !important;
    color: var(--afh-muted) !important;
    line-height: 1.4 !important;
}

/* ── Calendar Event Popup ── */
.afh-cal-popup {
    position: absolute !important;
    z-index: 9999 !important;
    width: 300px !important;
    background: var(--afh-white) !important;
    border: 1px solid var(--afh-border) !important;
    border-radius: var(--afh-radius) !important;
    box-shadow: 0 8px 30px rgba(0,0,0,.15) !important;
}
.afh-cal-popup-inner {
    padding: 20px !important;
    position: relative !important;
}
.afh-cal-popup-close {
    position: absolute !important;
    top: 10px !important;
    right: 12px !important;
    background: none !important;
    border: none !important;
    font-size: 20px !important;
    color: var(--afh-muted) !important;
    cursor: pointer !important;
    line-height: 1 !important;
    padding: 0 !important;
}
.afh-cal-popup-close:hover { color: var(--afh-text) !important; }
.afh-cal-popup-badge  { margin-bottom: 10px !important; }
.afh-cal-popup-title  { font-size: 16px !important; font-weight: 700 !important; color: var(--afh-primary) !important; margin: 0 0 10px !important; line-height: 1.3 !important; }
.afh-cal-popup-time   { font-size: 13px !important; color: var(--afh-text) !important; margin-bottom: 6px !important; }
.afh-cal-popup-loc    { font-size: 13px !important; color: var(--afh-muted) !important; margin-bottom: 10px !important; }
.afh-cal-popup-excerpt{ font-size: 12px !important; color: var(--afh-muted) !important; line-height: 1.5 !important; margin-bottom: 14px !important; }
.afh-cal-popup-btn    { display: block !important; text-align: center !important; width: 100% !important; box-sizing: border-box !important; }

/* ── Live Stream ── */
.afh-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e53e3e;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
    letter-spacing: .06em;
    animation: afh-pulse 1.5s infinite;
}
.afh-soon-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--afh-orange);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
}
@keyframes afh-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .7; }
}

.afh-stream-wrap {
    margin-bottom: 24px;
}
.afh-stream-label {
    font-size: 13px;
    font-weight: 700;
    color: #e53e3e;
    margin-bottom: 8px;
    letter-spacing: .04em;
}
.afh-stream-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--afh-radius);
    background: #000;
}
.afh-stream-embed iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}
.afh-join-btn {
    display: inline-block;
    padding: 12px 24px;
    background: #e53e3e;
    color: #fff;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: background .2s;
}
.afh-join-btn:hover { background: #c53030; color: #fff; }
.afh-recording-link { background: var(--afh-primary); }
.afh-recording-link:hover { background: var(--afh-primary-dk); }

/* Live panel right box */
.afh-live-panel { text-align: center; }
.afh-live-pulse {
    width: 16px; height: 16px;
    background: #e53e3e;
    border-radius: 50%;
    margin: 0 auto 12px;
    animation: afh-pulse 1s infinite;
}
.afh-soon-panel { text-align: center; }
.afh-countdown {
    font-size: 28px;
    font-weight: 700;
    color: var(--afh-primary);
    margin-top: 16px;
    letter-spacing: .05em;
}

/* Live card overlay */
.afh-event-image { position: relative; }
.afh-card-live-overlay {
    position: absolute;
    top: 8px; left: 8px;
    background: #e53e3e;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: .06em;
    z-index: 2;
}
.afh-is-live { border-color: #e53e3e !important; }
.afh-live-btn {
    background: #e53e3e !important;
    border-color: #e53e3e !important;
    color: #fff !important;
    animation: afh-pulse 1.5s infinite;
}
.afh-join-reminder {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--afh-border);
}

/* ── Live Chat Box ── */
.afh-live-chat-box {
    display: flex;
    flex-direction: column;
    height: 480px;
    border: 1px solid var(--afh-border);
    border-radius: var(--afh-radius);
    overflow: hidden;
    background: var(--afh-white);
    box-shadow: var(--afh-shadow);
}

/* Chat Tabs */
.afh-chat-tabs {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    border-bottom: 1px solid var(--afh-border);
    background: var(--afh-bg);
    flex-shrink: 0;
}
.afh-chat-tab {
    flex: 1;
    padding: 12px 8px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--afh-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color .2s, border-color .2s;
}
.afh-chat-tab.active {
    color: var(--afh-primary);
    border-bottom-color: var(--afh-primary);
    background: var(--afh-white);
}
.afh-chat-tab:hover:not(.active) { color: var(--afh-text); }
.afh-chat-clear {
    padding: 8px 12px;
    border: none;
    background: none;
    font-size: 14px;
    cursor: pointer;
    color: var(--afh-muted);
    flex-shrink: 0;
}
.afh-chat-clear:hover { color: #e53e3e; }

/* Panels */
.afh-chat-panel {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}
.afh-chat-panel.active { display: flex; }

/* Messages */
.afh-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}
.afh-chat-loading {
    text-align: center;
    color: var(--afh-muted);
    font-size: 13px;
    padding: 20px;
}
.afh-chat-msg {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.afh-chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--afh-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.afh-chat-bubble { flex: 1; }
.afh-chat-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}
.afh-chat-meta strong {
    font-size: 12px;
    color: var(--afh-text);
}
.afh-chat-meta span {
    font-size: 11px;
    color: var(--afh-muted);
}
.afh-chat-text {
    font-size: 13px;
    color: var(--afh-text);
    line-height: 1.45;
    background: var(--afh-bg);
    padding: 6px 10px;
    border-radius: 0 8px 8px 8px;
    word-break: break-word;
}

/* Input Row */
.afh-chat-input-row {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    padding: 10px 12px !important;
    border-top: 1px solid var(--afh-border) !important;
    background: var(--afh-white) !important;
    flex-shrink: 0 !important;
}
.afh-chat-input-row input {
    flex: 1 !important;
    padding: 8px 12px !important;
    border: 1px solid var(--afh-border) !important;
    border-radius: 20px !important;
    font-size: 13px !important;
    outline: none !important;
    background: var(--afh-bg) !important;
}
.afh-chat-input-row input:focus {
    border-color: var(--afh-primary) !important;
    background: var(--afh-white) !important;
}
#afh-chat-send {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    background: var(--afh-primary) !important;
    color: #fff !important;
    border: none !important;
    font-size: 14px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    transition: background .2s !important;
}
#afh-chat-send:hover { background: var(--afh-primary-dk) !important; }

/* Login notice */
.afh-chat-login-notice {
    padding: 12px;
    text-align: center;
    font-size: 13px;
    color: var(--afh-muted);
    border-top: 1px solid var(--afh-border);
}
.afh-chat-login-notice a { color: var(--afh-primary); }

/* Participants */
.afh-participants-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.afh-participant-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--afh-text);
}

/* ── Meta Item Icons (distinct per type) ── */
.afh-meta-icon {
    background-image: none;
    font-size: 0 !important; /* hide any leftover emoji */
}
.afh-meta-icon::after {
    font-size: 18px;
    line-height: 1;
}

/* Date — calendar */
.afh-meta-icon.icon-date {
    background: var(--afh-primary);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") center/20px no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") center/20px no-repeat;
}

/* Override with background-color + SVG background approach instead */
.afh-meta-icon.icon-date,
.afh-meta-icon.icon-time,
.afh-meta-icon.icon-duration,
.afh-meta-icon.icon-location,
.afh-meta-icon.icon-delivery,
.afh-meta-icon.icon-ceu {
    background-color: var(--afh-primary) !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 20px 20px !important;
    -webkit-mask: none !important;
    mask: none !important;
}

.afh-meta-icon.icon-date {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") !important;
}
.afh-meta-icon.icon-time {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E") !important;
}
.afh-meta-icon.icon-duration {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3Cpath d='M5 3L2 6'/%3E%3Cpath d='M19 3l3 3'/%3E%3C/svg%3E") !important;
}
.afh-meta-icon.icon-location {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13S3 17 3 10a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E") !important;
}
.afh-meta-icon.icon-delivery {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='2' y1='12' x2='22' y2='12'/%3E%3Cpath d='M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'/%3E%3C/svg%3E") !important;
}
.afh-meta-icon.icon-ceu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 10v6M2 10l10-5 10 5-10 5z'/%3E%3Cpath d='M6 12v5c3 3 9 3 12 0v-5'/%3E%3C/svg%3E") !important;
}

/* ── Card image padding (not edge to edge) ── */
.afh-event-image {
    padding: 10px 0 10px 10px !important;
    width: 150px !important;
    min-width: 150px !important;
}
.afh-event-image img,
.afh-event-image-placeholder {
    border-radius: 8px !important;
    height: 130px !important;
    object-fit: cover !important;
}

/* ── Tabs & Calendar Button — match Figma ── */

/* Tab buttons */
.afh-tab {
    padding: 10px 24px !important;
    border: 1.5px solid var(--afh-border) !important;
    background: var(--afh-white) !important;
    color: var(--afh-text) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    line-height: 1 !important;
    transition: background .2s, color .2s, border-color .2s !important;
}
.afh-tab:first-child {
    border-radius: 6px 0 0 6px !important;
    border-right: none !important;
}
.afh-tab:last-child {
    border-radius: 0 6px 6px 0 !important;
}
.afh-tab.active {
    background: var(--afh-primary) !important;
    color: var(--afh-white) !important;
    border-color: var(--afh-primary) !important;
}
.afh-tab:hover:not(.active) {
    background: var(--afh-bg) !important;
}

/* Calendar View button */
.afh-calendar-btn {
    display: flex !important;
    align-items: center !important;
    flex-direction: row !important;
    gap: 8px !important;
    padding: 10px 20px !important;
    border: 1.5px solid var(--afh-border) !important;
    border-radius: 6px !important;
    background: var(--afh-white) !important;
    color: var(--afh-text) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: background .2s, border-color .2s !important;
    white-space: nowrap !important;
}
.afh-calendar-btn:hover {
    background: var(--afh-bg) !important;
    border-color: var(--afh-primary) !important;
}
.afh-cal-btn-icon {
    flex-shrink: 0 !important;
    display: block !important;
}

/* ── Remove dotted focus border on buttons ── */
.afh-tab:focus,
.afh-tab:active,
.afh-calendar-btn:focus,
.afh-calendar-btn:active,
.afh-page-btn:focus,
.afh-page-btn:active {
    outline: none !important;
    box-shadow: none !important;
}

/* ── Mobile Responsive ── */
@media (max-width: 768px) {

    /* Hide Calendar View button on mobile */
    #afh-calendar-toggle {
        display: none !important;
    }

    /* Tabs row — just tabs, no space-between needed */
    .afh-tabs-row {
        justify-content: flex-start !important;
    }

    /* Filters — each on its own line */
    .afh-filters-bar {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .afh-search-wrap {
        width: 100% !important;
        min-width: unset !important;
    }

    .afh-filters-bar select {
        width: 100% !important;
        display: block !important;
    }

    /* Events grid — single column */
    .afh-events-grid {
        grid-template-columns: 1fr !important;
    }

    /* Single event page — stack layout */
    .afh-single-inner {
        grid-template-columns: 1fr !important;
    }
    .afh-single-right {
        position: static !important;
    }
}

/* ── Single Event Page — constrain featured image ── */
.afh-single-image {
    max-width: 100% !important;
    width: 100% !important;
}
.afh-single-image img {
    width: 100% !important;
    max-height: 275px !important;
    height: auto !important;
    object-fit: cover !important;
    border-radius: var(--afh-radius) !important;
    display: block !important;
    object-position: center top !important; /* focuses on top of image */
    object-position: center center !important; /* default, focuses on middle */
}

/* ── Fix red border on submit button ── */
.afh-reg-submit,
.afh-reg-submit:focus,
.afh-reg-submit:active,
.afh-reg-submit:hover,
.afh-reg-submit:visited {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.afh-hidden {
    display: none !important;
}