/* Site popup renderer (site-popup.js) - replaces the scraped Nuxt layer_pop component.
   Loaded by site-bridge.js on every scraped page and by /site-popup/preview.html (admin preview).
   Position/size are set inline by the layout algorithm; this file only styles the popup box. */

/* Class-only selector on purpose: an id selector here (#skp-root .skp) out-ranks the template and
   image rules below and its `background` shorthand resets background-size/repeat on the public site
   while the admin preview (which has no #skp-root) looks right. */
.skp {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  position: fixed;
  overflow: hidden;
  background: #fff;
  color: #222;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  font-family: 'Roboto', 'NotoSanskr', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.skp-preview .skp { position: relative; }

.skp *, .skp *::before, .skp *::after { box-sizing: border-box; }

/* Background placement: the image fills the whole box (cover, centered) regardless of its own ratio,
   so undersized / very wide / very tall uploads never leave gaps or distort. */
.skp.skp-img-background {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Scrollable region = banner + content. The footer stays pinned. */
.skp-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Banner placement: a strip above the body. Cover-cropped to a fixed band so any ratio fits;
   the band height scales with popup width (16:7) and is clamped so it never dominates a short popup. */
.skp-banner {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 7;
  max-height: 260px;
  min-height: 90px;
  object-fit: cover;
  /* Top-aligned: banner artwork (people, headlines) usually sits at the top, and a centered crop cuts it off. */
  object-position: center top;
}

.skp-content { padding: 24px 28px; }
.skp-heading { font-size: 22px; font-weight: 700; line-height: 1.35; margin: 0 0 14px; word-break: keep-all; }
.skp-body { word-break: keep-all; overflow-wrap: anywhere; }
.skp-body p { margin: 0 0 10px; }
.skp-body img { max-width: 100%; height: auto; }
.skp-body table { max-width: 100%; }

/* CTA button */
.skp-cta { margin-top: 18px; }
.skp-cta-left { text-align: left; }
.skp-cta-center { text-align: center; }
.skp-cta-right { text-align: right; }
.skp-cta-full .skp-btn { display: block; width: 100%; text-align: center; }
.skp-btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  border: 0;
  transition: filter 0.15s;
}
.skp-btn:hover { filter: brightness(0.92); }
.skp-btn-sm { padding: 7px 14px; font-size: 13px; }
.skp-btn-md { padding: 11px 24px; font-size: 15px; }
.skp-btn-lg { padding: 15px 32px; font-size: 17px; }

/* Footer: don't-show-today + close */
.skp-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: #f4f4f4;
  border-top: 1px solid #e3e3e3;
  font-size: 13px;
  color: #444;
}
.skp-foot label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
/* The site's reset.css strips native checkbox rendering (appearance: none) - restore it here. */
.skp-foot input[type="checkbox"] { width: 15px; height: 15px; margin: 0; -webkit-appearance: checkbox; appearance: auto; accent-color: #ea5504; }
.skp-foot .skp-close2 {
  border: 1px solid #bbb;
  background: #fff;
  color: #333;
  border-radius: 4px;
  padding: 5px 14px;
  font-size: 13px;
  cursor: pointer;
}
.skp-foot .skp-close2:hover { background: #eaeaea; }

/* ---- Template: notice (background image + title + body card + button) ---- */
.skp-t-notice { background-color: #36363d; }
.skp-t-notice .skp-content { padding: 32px 28px 28px; }
.skp-t-notice .skp-heading {
  color: #fff;
  text-align: center;
  font-size: 26px;
  margin: 0 0 22px;
  text-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
}
.skp-t-notice .skp-body {
  background: rgba(255, 255, 255, 0.96);
  color: #222;
  padding: 24px;
  border-radius: 4px;
}
.skp-t-notice .skp-cta { margin-top: 0; padding: 18px 24px 0; background: rgba(255, 255, 255, 0.96); border-radius: 0 0 4px 4px; margin-top: -4px; padding-bottom: 20px; }
.skp-t-notice:not(.skp-img-background) { background-color: #f3efe9; }
.skp-t-notice:not(.skp-img-background) .skp-heading { color: #1d3fbf; text-shadow: none; }

/* ---- Template: announcement (banner strip + title band + body card) ---- */
.skp-t-announcement .skp-heading {
  margin: 0 -28px 18px;
  padding: 14px 28px;
  border-left: 6px solid #ea5504;
  background: #fff5ef;
  font-size: 20px;
}
.skp-t-announcement .skp-body { padding: 0 2px; }

/* ---- Template: blank (legacy HTML or free-form) ---- */
.skp-t-blank .skp-content { padding: 0; }
.skp-t-blank .skp-heading { padding: 20px 24px 0; }
.skp-t-blank .skp-cta { padding: 0 24px 20px; }

/* Mobile: tighter paddings, smaller heading */
@media (max-width: 768px) {
  .skp { font-size: 14px; border-radius: 6px; }
  .skp-content { padding: 18px 16px; }
  .skp-t-notice .skp-content { padding: 26px 14px 18px; }
  .skp-t-notice .skp-heading { font-size: 21px; }
  .skp-t-notice .skp-body { padding: 16px; }
  .skp-heading { font-size: 19px; }
  .skp-t-announcement .skp-heading { margin: 0 -16px 14px; padding: 12px 16px; font-size: 18px; }
  .skp-banner { max-height: 180px; }
}
