/* ==========================================================================
   OERL reusable Event Countdown Modal — pairs with oerl-event-popup.js.
   Self-contained; drop this + the script (+ oerl-event-config.js) on any page
   and set window.OERL_EVENT. Centered modal with a dimmed backdrop; shows once.
   ========================================================================== */
/* lock page scroll while the modal is open */
.oerl-epop-lock, .oerl-epop-lock body { overflow: hidden !important; }

.oerl-epop-overlay {
  position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(8, 16, 34, .62); backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s ease;
}
.oerl-epop-overlay.is-open { opacity: 1; visibility: visible; }

.oerl-epop {
  position: relative; width: 420px; max-width: 100%; max-height: calc(100vh - 40px); overflow: auto;
  background: var(--oerl-surface, #fff); color: var(--tg-heading-color, #0a1830);
  border: 1px solid var(--oerl-border-soft, rgba(20,24,60,.1)); border-radius: 20px;
  box-shadow: 0 40px 90px -30px rgba(8, 16, 34, .7);
  transform: translateY(18px) scale(.94); opacity: 0; transition: transform .38s cubic-bezier(.2,.7,.3,1), opacity .38s ease;
}
.oerl-epop-overlay.is-open .oerl-epop { transform: translateY(0) scale(1); opacity: 1; }

.oerl-epop-media { position: relative; height: 168px; overflow: hidden; }
.oerl-epop-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.oerl-epop-media::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,24,48,0) 40%, rgba(10,24,48,.6)); }
.oerl-epop-flag { position: absolute; z-index: 1; left: 16px; bottom: 14px; font-size: 11px; font-weight: 800;
  letter-spacing: .05em; text-transform: uppercase; padding: 5px 12px; border-radius: 30px;
  background: var(--tg-theme-secondary-500, #fa6c20); color: #fff; box-shadow: 0 8px 18px -8px rgba(250,108,32,.7); }

.oerl-epop-close { position: absolute; z-index: 2; top: 14px; right: 14px; width: 34px; height: 34px; border: 0;
  border-radius: 50%; background: rgba(10,24,48,.55); color: #fff; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; backdrop-filter: blur(3px); transition: background .2s ease; }
.oerl-epop-close:hover { background: rgba(10,24,48,.85); }
.oerl-epop-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.oerl-epop-close svg { width: 16px; height: 16px; }

.oerl-epop-body { padding: 24px 26px 26px; text-align: center; }
.oerl-epop-eyebrow { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--tg-theme-primary-500, #3fa3d7); margin-bottom: 8px; }
.oerl-epop-title { font-size: 21px; font-weight: 800; line-height: 1.3; margin: 0 0 8px; color: var(--tg-heading-color, #0a1830); }
.oerl-epop-desc { font-size: 13.5px; line-height: 1.65; margin: 0 0 18px; color: var(--tg-body-color, #4a5568); }

.oerl-epop-cd { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-bottom: 20px; }
.oerl-epop-cd .u { background: var(--oerl-surface-2, #f4f7fb);
  border: 1px solid var(--oerl-border-soft, rgba(20,24,60,.08)); border-radius: 12px; padding: 11px 4px; }
.oerl-epop-cd .n { display: block; font-size: 23px; font-weight: 800; line-height: 1;
  color: var(--tg-theme-primary-500, #3fa3d7); font-variant-numeric: tabular-nums; }
.oerl-epop-cd .l { display: block; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--tg-body-color, #667594); margin-top: 5px; }
.oerl-epop-cd .n.is-tick { animation: oerl-epop-tick .4s ease; }
@keyframes oerl-epop-tick { 0% { transform: translateY(-3px); opacity: .4; } 100% { transform: translateY(0); opacity: 1; } }

.oerl-epop-actions { display: flex; flex-direction: column; gap: 10px; }
.oerl-epop-cta { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  font-size: 14.5px; font-weight: 700; padding: 13px 20px; border-radius: 40px;
  background: var(--tg-theme-primary-500, #3fa3d7); color: #fff; transition: background .2s ease, gap .2s ease; }
.oerl-epop-cta:hover { background: var(--tg-theme-primary-600, #2f8bbd); color: #fff; gap: 12px; }
.oerl-epop-cta svg { width: 17px; height: 17px; flex: 0 0 auto; }
.oerl-epop-dismiss { border: 0; background: transparent; color: var(--tg-body-color, #667594); font-size: 13px; font-weight: 600;
  cursor: pointer; padding: 4px; }
.oerl-epop-dismiss:hover { color: var(--tg-theme-secondary-500, #fa6c20); }

@media (max-width: 575px) { .oerl-epop-media { height: 140px; } .oerl-epop-body { padding: 20px 18px 22px; } }
@media (prefers-reduced-motion: reduce) {
  .oerl-epop { transition: opacity .3s ease; transform: none; }
  .oerl-epop-overlay.is-open .oerl-epop { transform: none; }
  .oerl-epop-cd .n.is-tick { animation: none; }
}
