/* DJAEV Homepage Manager 10.7 – balanced image event cards (upcoming + past) and header/hero gap fix. */

/* 1) Header/hero gap for logged-in users.
   WordPress core pushes <html> down by the admin bar height (html{margin-top:32px!important}),
   and djaev-managed-header/header.js ALSO adds the admin bar height to body padding-top.
   The admin bar was counted twice → 32px (46px on mobile) empty strip under the fixed header. */
html:has(> body.admin-bar){margin-top:0!important}

/* Hide the theme page title strip on the homepage (it is already display:none, keep it out of flow) */
body.home .hero-section,body.home .entry-header{display:none!important;margin:0!important;padding:0!important}
body.home #main-container,body.home .site-main,body.home .ct-container-full{margin-top:0!important;padding-top:0!important}

/* 2) Event grid: equal cards, centred when there are fewer than 3. */
:is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .djaev-section-events .events-grid,
:is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .djaev-section-past-events .events-grid{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),360px))!important;
  justify-content:center!important;
  align-items:stretch!important;
  gap:24px!important;
}
:is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .events-grid > article.ev-card{
  grid-column:auto!important;
  display:flex!important;flex-direction:column!important;
  min-height:0!important;height:100%!important;
  padding:0!important;gap:0!important;
  border-radius:24px!important;
  border:1px solid rgba(20,120,156,.16)!important;
  background:linear-gradient(160deg,rgba(255,255,255,.82),rgba(240,250,252,.58))!important;
  backdrop-filter:blur(20px) saturate(1.4)!important;-webkit-backdrop-filter:blur(20px) saturate(1.4)!important;
  box-shadow:0 18px 50px rgba(14,90,117,.10),inset 0 1px 0 rgba(255,255,255,.8)!important;
  overflow:hidden!important;
}
/* no coloured top accent line on any card */
:is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .events-grid > article.ev-card:before,
:is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .events-grid > article.ev-card:after{content:none!important;display:none!important}
:is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .events-grid > article.ev-card:hover{transform:translateY(-6px)!important;box-shadow:0 26px 64px rgba(14,90,117,.16)!important}

:is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .ev-card *{font-family:'Almarai',system-ui,sans-serif!important}
:is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .ev-media-link{display:block!important}
:is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .ev-card .ev-media{
  position:relative!important;aspect-ratio:1/1!important;width:100%!important;overflow:hidden!important;
  background:#e7f3f6!important;border-bottom:1px solid rgba(20,120,156,.12)!important;
}
/* blurred copy fills the box; the full flyer sits on top (contain), so portrait and landscape flyers both look right */
:is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .ev-card .ev-media-bg{position:absolute!important;inset:-24px!important;background-size:cover!important;background-position:center!important;filter:blur(22px) saturate(1.1)!important;opacity:.55!important;transform:scale(1.08)!important}
:is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .ev-card .ev-img{position:relative!important;display:block!important;width:100%!important;height:100%!important;max-width:none!important;object-fit:contain!important;object-position:center!important;transition:transform .5s cubic-bezier(.2,.8,.2,1)!important}
:is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .ev-card:hover .ev-img{transform:scale(1.025)!important}
:is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .ev-card .ev-media-empty{display:grid!important;place-items:center!important;background:radial-gradient(120% 90% at 30% 20%,rgba(91,176,185,.28),transparent 60%),linear-gradient(160deg,#f4fbfc,#e3f1f4)!important}
:is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .ev-card .ev-media-empty img{width:42%!important;height:auto!important;opacity:.9!important;filter:drop-shadow(0 14px 24px rgba(20,120,156,.16))!important}

:is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .ev-card .ev-body{flex:1 1 auto!important;display:flex!important;flex-direction:column!important;padding:20px 22px 0!important;gap:10px!important}
:is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .ev-card .ev-status{color:#0e5a75!important;font-size:12.5px!important;font-weight:800!important;line-height:1.6!important;margin:0!important;background:none!important;padding:0!important;border:0!important}
:is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .ev-card.ev-past .ev-status{color:#5b7380!important}
:is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .ev-card .ev-title{margin:0!important;padding:0!important;font-size:17px!important;line-height:1.65!important;font-weight:800!important;color:#0f2733!important;
  display:-webkit-box!important;-webkit-line-clamp:3!important;-webkit-box-orient:vertical!important;overflow:hidden!important}
:is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .ev-card .ev-title a{color:inherit!important}
:is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .ev-card .ev-desc{margin:0!important;color:#5f6f7a!important;font-size:13.4px!important;line-height:1.85!important;font-weight:400!important;
  display:-webkit-box!important;-webkit-line-clamp:3!important;-webkit-box-orient:vertical!important;overflow:hidden!important;}
:is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .ev-card .ev-meta{display:grid!important;gap:4px!important;margin-top:auto!important;padding-top:6px!important}
:is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .ev-card .ev-row{display:block!important;color:#4c5f6b!important;font-size:13.4px!important;line-height:1.8!important}
:is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .ev-card .ev-date{color:#14789c!important;font-weight:800!important;font-size:15px!important}
:is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .ev-card .ev-doctors{font-size:12.5px!important;line-height:1.8!important;color:#4c5f6b!important}
:is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .ev-card .ev-doctors-title{font-weight:800!important;color:#0e5a75!important}
:is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .ev-card .ev-footer{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;margin:16px 22px 0!important;padding:14px 0 18px!important;border-top:1px solid rgba(20,120,156,.13)!important}
:is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .ev-card .ev-org{color:#5f6f7a!important;font-size:12px!important;font-weight:700!important;line-height:1.6!important;background:none!important;padding:0!important;border:0!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;max-width:none!important;flex:1 1 auto!important;min-width:0!important}
:is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .ev-card .ev-org:before{content:none!important}
:is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .ev-card .ev-btn{flex:0 0 auto!important;padding:8px 16px!important;border-radius:12px!important;font-size:12.5px!important;font-weight:800!important;background:linear-gradient(135deg,#14789c,#0e5a75)!important;color:#fff!important;border:0!important;box-shadow:0 10px 24px rgba(20,120,156,.22)!important}
:is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .ev-card .djaev-sponsors{margin:0 22px 18px!important;width:auto!important}

@media(max-width:640px){
  :is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .djaev-section-events .events-grid,
  :is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .djaev-section-past-events .events-grid{grid-template-columns:minmax(0,1fr)!important;gap:18px!important}
  :is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .ev-card .ev-media{aspect-ratio:4/4.2!important}
  :is(#djaev-home-de,#djaev-home-ar,#djaev-home-en).djaev-home.djaev-home .events-grid > article.ev-card:hover{transform:none!important}
}
