/* --- Global & Typography --- */
:root {
    --cep-accent: #2563eb;
    --cep-dark: #1e293b;
    --cep-gray: #f8fafc;
    --cep-border: #e2e8f0;
    --cal-bg: #ffffff;
    --cal-border: #eef2f6; /* لون حدود ناعم جداً */
    --cal-text: #1e293b;
    --cal-text-light: #94a3b8;
    --cal-accent: #3b82f6; /* اللون الرئيسي */
    --cal-today-bg: #eff6ff;
    --cal-hover: #f8fafc;
}

.cep-page-wrapper {
    width: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* --- Hero Section (Full Width) --- */
.cep-modern-hero {
    position: relative;
    width: 100%;
    height: 400px; /* طول الهيرو */
    background: #1e1e24;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    margin-bottom: 50px;
}

.cep-hero-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; background-position: center; opacity: 0.6;
}

.cep-hero-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 100%);
}

.cep-hero-container {
    position: relative; z-index: 5; max-width: 900px; padding: 20px;
}

.cep-hero-title {
    font-size: 3.5rem; margin: 15px 0; font-weight: 800; line-height: 1.2; text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.cep-hero-meta { font-size: 1.3rem; opacity: 0.9; margin-top: 10px; }

.cep-badge-lg {
    background: var(--cep-accent); padding: 6px 16px; border-radius: 50px; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; font-size: 0.8rem;
}

/* --- Content Container (Centered) --- */
.cep-content-container {
    max-width: 1000px; /* العرض الأقصى للمحتوى */
    margin: 0 auto; /* توسيط المحتوى */
    padding: 0 20px 60px 20px;
}

.cep-section { margin-bottom: 60px; }
.cep-section-title {
    font-size: 1.8rem; border-left: 5px solid var(--cep-accent); padding-left: 15px; margin-bottom: 25px; color: var(--cep-dark);
}

/* --- Timeline List (Sub Events) --- */
.cep-timeline-item {
    display: flex; gap: 20px; background: #fff; border: 1px solid var(--cep-border);
    padding: 20px; border-radius: 12px; margin-bottom: 15px; transition: transform 0.2s, box-shadow 0.2s;
    align-items: center;
}
.cep-timeline-item:hover { transform: translateY(-3px); box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1); border-color: var(--cep-accent); }

.cep-tl-date {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: var(--cep-gray); width: 80px; height: 80px; border-radius: 10px; flex-shrink: 0;
}
.cep-tl-date .day { font-size: 1.8rem; font-weight: bold; color: var(--cep-accent); line-height: 1; }
.cep-tl-date .month { font-size: 0.8rem; text-transform: uppercase; font-weight: bold; }
.cep-tl-date .time { font-size: 0.75rem; margin-top: 3px; color: #666; }

.cep-tl-content { flex-grow: 1; }
.cep-tl-content h3 { margin: 0 0 8px 0; font-size: 1.3rem; }
.cep-tl-content h3 a { text-decoration: none; color: var(--cep-dark); }
.cep-tl-excerpt { color: #64748b; font-size: 0.95rem; }

.cep-btn-view {
    padding: 10px 20px; background: #fff; border: 2px solid var(--cep-border); border-radius: 8px;
    text-decoration: none; color: var(--cep-dark); font-weight: 600; transition: 0.2s; white-space: nowrap;
}
.cep-btn-view:hover { background: var(--cep-dark); color: #fff; border-color: var(--cep-dark); }

/* --- Video --- */
.cep-video-responsive { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 12px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.cep-video-responsive iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* --- Gallery Masonry --- */
.cep-gallery-masonry { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px; }
.cep-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; transition: transform 0.3s; }
.cep-gallery-thumb:hover img { transform: scale(1.03); }

/* --- Shortcodes Styles --- */

/* Next Event Card */
.cep-next-event-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #fff; padding: 40px; border-radius: 16px; text-align: center; margin: 30px 0;
}
.cep-ne-label { color: #38bdf8; font-weight: bold; text-transform: uppercase; margin-bottom: 10px; letter-spacing: 1px; }
.cep-ne-content h2 a { color: #fff; text-decoration: none; font-size: 2.2rem; }
.cep-ne-date { font-size: 1.2rem; margin: 15px 0 25px 0; opacity: 0.8; }
.cep-btn-glow {
    display: inline-block; padding: 12px 30px; background: #2563eb; color: #fff; border-radius: 50px;
    text-decoration: none; font-weight: bold; box-shadow: 0 0 20px rgba(37, 99, 235, 0.5); transition: 0.3s;
}
.cep-btn-glow:hover { transform: scale(1.05); box-shadow: 0 0 30px rgba(37, 99, 235, 0.7); }

/* Grouped List */
.cep-grouped-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 30px; }
@media (max-width: 768px) { .cep-grouped-wrapper { grid-template-columns: 1fr; } }

.cep-group-title { font-size: 1.4rem; border-bottom: 2px solid #eee; padding-bottom: 10px; margin-bottom: 20px; }
.cep-group-title.upcoming { color: var(--cep-accent); border-color: var(--cep-accent); }
.cep-group-title.past { color: #64748b; }

.cep-list-styled .cep-list-item {
    display: flex; align-items: center; padding: 12px 0; border-bottom: 1px solid #f1f5f9;
}
.cep-list-styled .cep-list-item .date {
    font-weight: bold; color: var(--cep-dark); width: 60px; flex-shrink: 0;
}
.cep-list-styled .cep-list-item a { text-decoration: none; color: #475569; transition: 0.2s; }
.cep-list-styled .cep-list-item a:hover { color: var(--cep-accent); padding-left: 5px; }
/* --- Sub Event Page Styling (New) --- */
.cep-sub-header { background: #f8fafc; border-bottom: 1px solid #e2e8f0; padding: 15px 0; }
.cep-back-link { text-decoration: none; color: #64748b; font-weight: 600; display: flex; align-items: center; gap: 5px; font-size: 0.9rem; }
.cep-back-link:hover { color: var(--cep-accent); }

.cep-sub-hero { padding: 40px 0; background: #fff; border-bottom: 1px solid #f1f5f9; }
.cep-label-session { background: #e0f2fe; color: #0284c7; padding: 4px 10px; border-radius: 4px; font-size: 0.75rem; font-weight: bold; text-transform: uppercase; letter-spacing: 0.5px; }
.cep-sub-title { font-size: 2.5rem; margin: 15px 0; color: #1e293b; line-height: 1.2; }
.cep-sub-meta { display: flex; gap: 20px; color: #64748b; font-size: 1.1rem; }

/* Grid Layout for Sub Page */
.cep-grid-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; margin-top: 40px; }
@media(max-width: 768px) { .cep-grid-layout { grid-template-columns: 1fr; } }

.cep-section-box { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 25px; margin-bottom: 30px; }
.cep-section-box.no-pad { padding: 0; overflow: hidden; border: none; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.cep-box-title { margin-top: 0; border-bottom: 2px solid #f1f5f9; padding-bottom: 15px; margin-bottom: 20px; font-size: 1.2rem; }
.cep-text-content { line-height: 1.7; color: #334155; }

/* Sidebar Card */
.cep-info-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; position: sticky; top: 20px; }
.cep-session-thumb img { width: 100%; height: auto; display: block; }
.cep-info-body { padding: 20px; }
.cep-info-body h4 { margin-top: 0; }
.cep-info-body ul { list-style: none; padding: 0; margin: 0 0 20px 0; }
.cep-info-body li { padding: 10px 0; border-bottom: 1px solid #f1f5f9; font-size: 0.95rem; color: #475569; }
.cep-info-body li strong { color: #1e293b; width: 100px; display: inline-block; }
.cep-btn-block { display: block; text-align: center; background: var(--cep-dark); color: #fff; padding: 12px; border-radius: 6px; text-decoration: none; font-weight: bold; }
.cep-btn-block:hover { background: #334155; }

/* --- Sub Event List inside Main Event (The new Cards) --- */
.cep-timeline-wrapper { display: flex; flex-direction: column; gap: 15px; }

.cep-sub-card {
    display: flex; align-items: center; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
    padding: 15px 20px; transition: transform 0.2s, border-color 0.2s;
}
.cep-sub-card:hover { transform: translateY(-3px); border-color: var(--cep-accent); box-shadow: 0 5px 15px rgba(0,0,0,0.05); }

.cep-sc-date {
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; width: 60px; height: 60px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; margin-right: 20px; flex-shrink: 0;
}
.cep-sc-date .d { font-size: 1.4rem; font-weight: bold; color: var(--cep-accent); line-height: 1; }
.cep-sc-date .m { font-size: 0.7rem; text-transform: uppercase; font-weight: 700; color: #64748b; margin-top: 2px; }

.cep-sc-details { flex-grow: 1; }
.cep-sc-meta { font-size: 0.8rem; color: #94a3b8; font-weight: 600; margin-bottom: 4px; text-transform: uppercase; }
.cep-sc-title { margin: 0 0 5px 0; font-size: 1.15rem; }
.cep-sc-title a { text-decoration: none; color: #1e293b; transition: color 0.2s; }
.cep-sc-title a:hover { color: var(--cep-accent); }
.cep-sc-excerpt { font-size: 0.9rem; color: #64748b; }

.cep-sc-action { margin-left: 15px; }
.cep-btn-arrow {
    width: 40px; height: 40px; border-radius: 50%; background: #f1f5f9; color: #1e293b;
    display: flex; align-items: center; justify-content: center; text-decoration: none; transition: 0.2s;
}
/* --- New Calendar Design --- */
/* 1. الحاوية الرئيسية */
.cep-calendar-wrapper {
    background: var(--cal-bg);
    border: 1px solid var(--cal-border);
    border-radius: 16px; /* زوايا أكثر استدارة */
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05); /* ظل ناعم جداً */
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 30px 0;
}

/* 2. الهيدر (أزرار التحكم) */
.cep-cal-controls {
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--cal-border);
    background: #fff;
}

.cep-cal-controls h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--cal-text);
    letter-spacing: -0.5px;
}

/* أزرار التنقل */
.cep-nav-group { display: flex; gap: 8px; }
.cep-nav-btn {
    background: var(--cal-accent);
    border: 1px solid var(--cal-border);
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    color: white;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.cep-nav-btn:hover {
    background: var(--cal-hover);
    border-color: black;
    transform: translateY(-1px);
    color: #000;
}

/* 3. أيام الأسبوع (Header) */
.cep-cal-days-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #fcfcfc;
    border-bottom: 1px solid var(--cal-border);
}
.cep-cal-days-header div {
    padding: 15px 0;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--cal-text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 4. الشبكة (The Grid) */
.cep-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--cal-border); /* لون الفراغات */
    gap: 1px; /* سماكة الحدود */
}

/* 5. الخلية (اليوم) */
.cep-day {
    background: #fff;
    min-height: 140px; /* زيادة الطول قليلاً */
    padding: 10px;
    position: relative;
    transition: background 0.2s;
}
.cep-day:hover {
    background: #fafafa;
}

/* الأيام من الشهر الآخر */
.cep-day.empty {
    background: #fdfdfd;
}
.cep-day.empty .cep-day-num { opacity: 0; } /* إخفاء الرقم للأيام الفارغة */

/* رقم اليوم */
.cep-day-num {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cal-text-light);
    margin-bottom: 8px;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    border-radius: 50%;
}

/* تمييز اليوم الحالي */
.cep-day.today {
    background: #fff; /* يمكن تغييره لتمييز الخلية كاملة */
}
.cep-day.today .cep-day-num {
    background: var(--cep-accent); /* نستخدم المتغير المعرف سابقاً */
    color: #fff;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.4);
}

/* 6. الحدث (The Event Card) */
.cep-event-link {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    /* الـ border-left يأتي من الـ JS (اللون المخصص) */
    /* هنا نضبط باقي التنسيق */
    border-left-width: 4px !important; 
    padding: 6px 10px;
    margin-bottom: 5px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--cal-text);
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cep-event-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: #cbd5e1;
    z-index: 10;
    position: relative;
}

/* Responsive - للموبايل */
@media (max-width: 768px) {
    .cep-cal-days-header div { font-size: 0.6rem; letter-spacing: 0; }
    .cep-day { min-height: 80px; padding: 5px; }
    .cep-event-link { font-size: 0.65rem; padding: 3px 5px; }
    .cep-day-num { width: 20px; height: 20px; line-height: 20px; font-size: 0.75rem; }
    .cep-cal-controls { padding: 15px; }
    .cep-cal-controls h3 { font-size: 1.1rem; }
}

.cep-cal-header{
    margin: 20px auto;
    padding: 0 20px ;
    display: flex;
    justify-content: center;
}

.cep-cal-header button{
    margin: 0 20px;
}