/* ================================================================
   Arabic Event Manager — Public Styles (RTL)
   ================================================================ */

:root {
    --aem-primary:     #1a73e8;
    --aem-primary-dk:  #1557b0;
    --aem-green:       #00a32a;
    --aem-red:         #d63638;
    --aem-orange:      #f57c00;
    --aem-gray:        #6c757d;
    --aem-light-bg:    #f8f9fa;
    --aem-border:      #dee2e6;
    --aem-text:        #1d2327;
    --aem-text-light:  #6c757d;
    --aem-radius:      10px;
    --aem-shadow:      0 2px 12px rgba(0,0,0,.08);
    --aem-shadow-hover:0 6px 24px rgba(0,0,0,.14);
    --aem-font:        'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
}

/* ── Wrapper & Grid ─────────────────────────────────────────── */

.aem-events-wrapper {
    direction: rtl;
    font-family: var(--aem-font);
    display: grid;
    gap: 24px;
    margin: 24px 0;
}

.aem-layout-grid.aem-cols-1 { grid-template-columns: 1fr; }
.aem-layout-grid.aem-cols-2 { grid-template-columns: repeat(2, 1fr); }
.aem-layout-grid.aem-cols-3 { grid-template-columns: repeat(3, 1fr); }
.aem-layout-grid.aem-cols-4 { grid-template-columns: repeat(4, 1fr); }

.aem-layout-list { grid-template-columns: 1fr; }
.aem-layout-list .aem-event-card { display: flex; flex-direction: row; }
.aem-layout-list .aem-card-image { width: 260px; flex-shrink: 0; }

/* ── Event Card ─────────────────────────────────────────────── */

.aem-event-card {
    font-family: var(--aem-font);
    background: #fff;
    border-radius: var(--aem-radius);
    box-shadow: var(--aem-shadow);
    overflow: hidden;
    transition: transform .22s ease, box-shadow .22s ease;
    display: flex;
    flex-direction: column;
}

.aem-event-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--aem-shadow-hover);
}

/* Card Image */
.aem-card-image {
    position: relative;
    overflow: hidden;
    height: 200px;
    background: #f0f4f8;
}

.aem-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}

.aem-event-card:hover .aem-card-image img {
    transform: scale(1.04);
}

.aem-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: linear-gradient(135deg, #e8f0fe, #f0f7ff);
}

/* Badges */
.aem-status-badge,
.aem-price-badge {
    position: absolute;
    top: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--aem-font);
    line-height: 1.4;
}

.aem-status-badge {
    right: 12px;
}

.aem-badge-upcoming  { background: rgba(26,115,232,.15); color: var(--aem-primary); border: 1px solid rgba(26,115,232,.3); }
.aem-badge-ongoing   { background: rgba(0,163,42,.15);   color: var(--aem-green);   border: 1px solid rgba(0,163,42,.3); }
.aem-badge-completed { background: rgba(108,117,125,.15);color: var(--aem-gray);    border: 1px solid rgba(108,117,125,.3); }
.aem-badge-cancelled { background: rgba(214,54,56,.15);  color: var(--aem-red);     border: 1px solid rgba(214,54,56,.3); }

.aem-price-badge {
    left: 12px;
    background: rgba(0,0,0,.65);
    color: #fff;
    backdrop-filter: blur(4px);
}

.aem-free-badge {
    background: rgba(0,163,42,.85) !important;
    color: #fff !important;
}

/* Card Body */
.aem-card-body {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    text-align: right;
}

.aem-card-date {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--aem-primary);
    font-weight: 600;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.aem-time-sep { color: var(--aem-border); }

.aem-card-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 10px;
    line-height: 1.45;
    font-family: var(--aem-font);
}

.aem-card-title a {
    color: var(--aem-text);
    text-decoration: none;
    transition: color .18s;
}

.aem-card-title a:hover { color: var(--aem-primary); }

.aem-card-excerpt {
    font-size: 13.5px;
    color: var(--aem-text-light);
    line-height: 1.7;
    margin: 0 0 12px;
    flex: 1;
}

.aem-card-location {
    font-size: 13px;
    color: var(--aem-text-light);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.aem-card-location a { color: var(--aem-text-light); text-decoration: none; }
.aem-card-location a:hover { color: var(--aem-primary); }

/* ── Buttons ─────────────────────────────────────────────────── */

.aem-card-footer {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.aem-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all .2s ease;
    font-family: var(--aem-font);
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.aem-btn-details {
    background: var(--aem-light-bg);
    color: var(--aem-text);
    border: 1px solid var(--aem-border);
    flex: 1;
}

.aem-btn-details:hover {
    background: var(--aem-border);
    color: var(--aem-text);
    text-decoration: none;
}

.aem-btn-register {
    background: var(--aem-primary);
    color: #fff !important;
    flex: 1;
}

.aem-btn-register:hover {
    background: var(--aem-primary-dk);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26,115,232,.35);
}

.aem-btn-large {
    padding: 14px 32px;
    font-size: 16px;
    border-radius: 10px;
}

/* ── No Events ───────────────────────────────────────────────── */

.aem-no-events {
    text-align: center;
    padding: 48px 24px;
    font-family: var(--aem-font);
    color: var(--aem-text-light);
    font-size: 16px;
    background: var(--aem-light-bg);
    border-radius: var(--aem-radius);
    border: 2px dashed var(--aem-border);
}

/* ── Single Event Details (appended below content) ──────────── */

.aem-single-event-details {
    font-family: var(--aem-font);
    direction: rtl;
    margin: 40px 0 24px;
    background: #fff;
    border-radius: 14px;
    border: 1px solid var(--aem-border);
    box-shadow: var(--aem-shadow);
    overflow: hidden;
}

.aem-section-title {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    margin: 0;
    padding: 18px 24px;
    background: linear-gradient(135deg, var(--aem-primary), #0d47a1);
    font-family: var(--aem-font);
}

.aem-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0;
    padding: 8px 0;
}

.aem-detail-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--aem-border);
    transition: background .15s;
}

.aem-detail-item:hover { background: var(--aem-light-bg); }
.aem-detail-item:last-child { border-bottom: none; }

.aem-detail-icon {
    font-size: 22px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--aem-light-bg);
    border-radius: 8px;
    flex-shrink: 0;
}

.aem-detail-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.aem-detail-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--aem-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.aem-detail-value {
    font-size: 14px;
    color: var(--aem-text);
    font-weight: 500;
    line-height: 1.5;
}

.aem-detail-value a {
    color: var(--aem-primary);
    text-decoration: none;
}

.aem-detail-value a:hover { text-decoration: underline; }

/* Badges */
.aem-badge-green {
    display: inline-block;
    background: rgba(0,163,42,.1);
    color: var(--aem-green);
    border: 1px solid rgba(0,163,42,.25);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.aem-status-pill {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.aem-tag-free {
    display: inline-block;
    background: var(--aem-green);
    color: #fff;
    padding: 1px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
}

/* Register CTA */
.aem-register-cta {
    padding: 24px;
    text-align: center;
    background: linear-gradient(135deg, #f8fbff, #eef4ff);
    border-top: 1px solid var(--aem-border);
}

/* ── Full Event Layout (shortcode layout="full") ─────────────── */

.aem-event-full {
    font-family: var(--aem-font);
    direction: rtl;
    max-width: 800px;
    margin: 0 auto;
}

.aem-full-hero {
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 28px;
    box-shadow: var(--aem-shadow);
}

.aem-full-hero img {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    display: block;
}

.aem-full-title {
    font-size: 28px;
    font-weight: 900;
    color: var(--aem-text);
    margin: 0 0 20px;
    line-height: 1.35;
    font-family: var(--aem-font);
}

.aem-full-meta {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--aem-light-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 28px;
    border: 1px solid var(--aem-border);
}

.aem-meta-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.aem-meta-icon { font-size: 20px; width: 28px; text-align: center; }

.aem-meta-label {
    font-weight: 700;
    color: var(--aem-text-light);
    min-width: 80px;
}

.aem-meta-value a { color: var(--aem-primary); text-decoration: none; }

.aem-full-content {
    font-size: 15px;
    line-height: 1.85;
    color: var(--aem-text);
    margin-bottom: 28px;
}

.aem-full-cta { text-align: center; padding: 12px 0; }

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 900px) {
    .aem-layout-grid.aem-cols-3,
    .aem-layout-grid.aem-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .aem-layout-grid.aem-cols-2,
    .aem-layout-grid.aem-cols-3,
    .aem-layout-grid.aem-cols-4 { grid-template-columns: 1fr; }

    .aem-layout-list .aem-event-card { flex-direction: column; }
    .aem-layout-list .aem-card-image { width: 100%; }

    .aem-detail-grid { grid-template-columns: 1fr; }

    .aem-full-title { font-size: 22px; }

    .aem-btn-large { padding: 12px 20px; font-size: 14px; }
}

/* ── Status card borders ─────────────────────────────────────── */
.aem-status-upcoming  { border-top: 3px solid var(--aem-primary); }
.aem-status-ongoing   { border-top: 3px solid var(--aem-green); }
.aem-status-completed { border-top: 3px solid var(--aem-gray); opacity: .85; }
.aem-status-cancelled { border-top: 3px solid var(--aem-red); opacity: .75; }
