:root {
  --sjep-accent: #e0a84a;
  --sjep-bg: #15110f;
  --sjep-fg: #f5efe6;
  --sjep-muted: rgba(245, 239, 230, 0.68);
  --sjep-line: rgba(245, 239, 230, 0.12);
}

/* Container ----------------------------------------------------------- */
.sjep-overlay {
  position: fixed;
  z-index: 99999;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.sjep-overlay[hidden] { display: none; }
.sjep-overlay.is-visible { opacity: 1; }

.sjep-dialog {
  position: relative;
  width: 100%;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sjep-overlay.is-visible .sjep-dialog { transform: none; }

/* Corner card (default): slides in, page stays usable, no backdrop. */
.sjep-pos-bottom-left,
.sjep-pos-bottom-right {
  bottom: 20px;
  width: min(400px, calc(100vw - 32px));
  /* Never taller than the screen; scroll inside the card instead. */
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.sjep-pos-bottom-left  { left: 20px; }
.sjep-pos-bottom-right { right: 20px; }
.sjep-pos-bottom-left .sjep-dialog  { transform: translateX(-30px) translateY(16px); }
.sjep-pos-bottom-right .sjep-dialog { transform: translateX(30px) translateY(16px); }
.sjep-pos-bottom-left .sjep-card__body,
.sjep-pos-bottom-right .sjep-card__body { padding: 22px 22px 20px; }
.sjep-pos-bottom-left .sjep-card__eyebrow,
.sjep-pos-bottom-right .sjep-card__eyebrow { margin-bottom: 14px; padding-right: 36px; }
.sjep-pos-bottom-left .sjep-card__title,
.sjep-pos-bottom-right .sjep-card__title { font-size: 22px; }
.sjep-pos-bottom-left .sjep-card__brand,
.sjep-pos-bottom-right .sjep-card__brand { margin-bottom: 14px; padding-bottom: 12px; }
.sjep-pos-bottom-left .sjep-card__logo,
.sjep-pos-bottom-right .sjep-card__logo { width: 132px; }
.sjep-pos-bottom-left .sjep-card__image,
.sjep-pos-bottom-right .sjep-card__image { height: 130px; }
.sjep-pos-bottom-left .sjep-card__actions,
.sjep-pos-bottom-right .sjep-card__actions { margin-top: 18px; padding-top: 16px; gap: 10px 16px; }
.sjep-pos-bottom-left .sjep-btn,
.sjep-pos-bottom-right .sjep-btn { padding: 11px 18px; font-size: 14px; }
.sjep-pos-bottom-left .sjep-more,
.sjep-pos-bottom-right .sjep-more { font-size: 13px; }

/* Centered modal with backdrop. */
.sjep-pos-center {
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px;
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  /* The overlay scrolls when the card is taller than the screen; once it hits its end
     (or when the card fits) the wheel/touch scroll chains through to the page, so the
     page behind the backdrop stays scrollable. */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(8, 6, 5, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.sjep-pos-center .sjep-dialog {
  max-width: 520px;
  margin: auto; /* centered when it fits, scrollable from the top when it doesn't */
  flex: 0 0 auto;
  transform: translateY(18px) scale(0.98);
}

.sjep-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 32px;
  height: 32px;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--sjep-fg);
  opacity: 0.7;
  line-height: 0;
  font-size: 0;
  box-shadow: none;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s, border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.sjep-close svg {
  width: 14px;
  height: 14px;
  display: block;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  fill: none;
}
.sjep-close:hover,
.sjep-close:focus-visible {
  opacity: 1;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
  outline: none;
}

/* Card ---------------------------------------------------------------- */
.sjep-card {
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(224, 168, 74, 0.18), transparent 55%),
    var(--sjep-bg);
  color: var(--sjep-fg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--sjep-line);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.sjep-card__image {
  height: 180px;
  background-size: cover;
  background-position: center;
}
.sjep-card__body { padding: 28px 28px 26px; }

/* Brand logo at the top of the card. Cream wordmark, sits on the dark bg.
   Right padding keeps it clear of the close button in the pop-up. */
.sjep-card__brand {
  margin: 0 0 16px;
  padding-right: 44px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--sjep-line);
  line-height: 0;
}
.sjep-card__logo {
  display: block;
  width: 150px;
  max-width: 100%;
  height: auto;
  opacity: 0.92;
}
.sjep-inline .sjep-card__brand { padding-right: 0; }

.sjep-card__eyebrow {
  margin: 0 0 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sjep-accent);
}

.sjep-card__main {
  display: flex;
  gap: 22px;
  align-items: flex-start;
}

.sjep-card__date {
  flex: 0 0 auto;
  min-width: 74px;
  padding: 10px 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--sjep-line);
  text-align: center;
  line-height: 1;
}
.sjep-card__dow,
.sjep-card__month {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sjep-muted);
}
.sjep-card__day {
  display: block;
  margin: 6px 0 5px;
  font-size: 40px;
  font-weight: 700;
  color: var(--sjep-accent);
  font-variant-numeric: tabular-nums;
}

.sjep-card__text { flex: 1 1 auto; min-width: 0; }
.sjep-card__title {
  margin: 0 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(22px, 4.6vw, 28px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--sjep-fg);
}
.sjep-card__subtitle {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--sjep-muted);
}
.sjep-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
  margin: 0;
  font-size: 14px;
  color: var(--sjep-fg);
}
.sjep-card__meta > span:not(.screen-reader-text) + span:not(.screen-reader-text)::before {
  content: "·";
  margin: 0 8px;
  color: var(--sjep-muted);
}
.sjep-card__genre {
  color: var(--sjep-accent);
  font-weight: 600;
}

.sjep-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--sjep-line);
}
.sjep-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  background: var(--sjep-accent);
  color: #1a1410 !important;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none !important;
  transition: transform 0.15s, filter 0.15s;
}
.sjep-btn:hover,
.sjep-btn:focus-visible { transform: translateY(-1px); filter: brightness(1.08); }
.sjep-more {
  font-size: 14px;
  color: var(--sjep-muted) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.sjep-more:hover { color: var(--sjep-fg) !important; }

/* Inline shortcode variant */
.sjep-inline { max-width: 560px; margin: 1.5em 0; }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
}

@media (max-width: 480px) {
  .sjep-pos-bottom-left,
  .sjep-pos-bottom-right {
    left: 12px; right: 12px; width: auto;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
  }
  .sjep-pos-bottom-left .sjep-card__image,
  .sjep-pos-bottom-right .sjep-card__image { height: 110px; }
  .sjep-card__body { padding: 22px 20px 20px; }
  .sjep-card__main { gap: 16px; }
  .sjep-card__date { min-width: 62px; }
  .sjep-card__day { font-size: 32px; }
  .sjep-btn { width: 100%; justify-content: center; }
}

/* Mobile: the pop-up never blocks the page. The centered modal becomes a
   bottom card without backdrop, and the card is kept compact so the page
   stays visible and scrollable around it. */
@media (max-width: 768px) {
  .sjep-pos-center {
    inset: auto 12px calc(12px + env(safe-area-inset-bottom, 0px)) 12px;
    display: block;
    padding: 0;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sjep-pos-center .sjep-dialog {
    max-width: none;
    margin: 0;
    transform: translateY(16px);
  }
  .sjep-overlay.is-visible .sjep-dialog { transform: none; }
}

@media (max-width: 480px) {
  .sjep-card__image { display: none; }
  .sjep-card__brand { margin-bottom: 12px; padding-bottom: 10px; }
  .sjep-card__logo { width: 120px; }
  .sjep-card__eyebrow { margin-bottom: 12px; }
  .sjep-card__actions { margin-top: 16px; padding-top: 14px; gap: 10px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .sjep-overlay, .sjep-dialog, .sjep-btn { transition: none; }
}
