/* Popup, on the site. The look comes from the variables Renderer sets on each popup. */

.startertk-popup {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  /* The side margins are never given up, whatever the width asked for. */
  padding: 1.5rem var(--np-margin-m, 1.5rem);
  pointer-events: none;
}

@media (min-width: 782px) {
  .startertk-popup {
    padding-inline: var(--np-margin-d, 3rem);
  }
}

.startertk-popup[hidden] {
  display: none;
}

.startertk-popup[data-position="top"] { align-items: flex-start; }
.startertk-popup[data-position="bottom"] { align-items: flex-end; }
.startertk-popup[data-position="left"] { justify-content: flex-start; }
.startertk-popup[data-position="right"] { justify-content: flex-end; }

.startertk-popup-overlay {
  position: absolute;
  inset: 0;
  background: var(--np-overlay, rgba(0, 0, 0, 0.6));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: auto;
}

.startertk-popup[data-overlay="0"] .startertk-popup-overlay {
  display: none;
}

.startertk-popup-box {
  position: relative;
  box-sizing: border-box;
  width: min(var(--np-width, 560px), 100%);
  height: var(--np-height, auto);
  max-height: 100%;
  overflow: auto;
  padding: var(--np-padding, 32px);
  border-radius: var(--np-radius, 12px);
  background: var(--np-bg, #fff) var(--np-bg-image, none) center / cover no-repeat;
  color: var(--np-text, #1d2327);
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
  outline: none;
}

.startertk-popup[data-shadow="1"] .startertk-popup-box {
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.startertk-popup[data-entrance="top"] .startertk-popup-box { transform: translateY(-40px); }
.startertk-popup[data-entrance="bottom"] .startertk-popup-box { transform: translateY(40px); }
.startertk-popup[data-entrance="left"] .startertk-popup-box { transform: translateX(-40px); }
.startertk-popup[data-entrance="right"] .startertk-popup-box { transform: translateX(40px); }

.startertk-popup.is-open .startertk-popup-overlay { opacity: 1; }

.startertk-popup.is-open .startertk-popup-box {
  opacity: 1;
  transform: none;
}

.startertk-popup-locked,
.startertk-popup-locked body {
  overflow: hidden;
}

.startertk-popup-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--np-close, currentColor);
  font: 400 1.6rem/1 system-ui, sans-serif;
  cursor: pointer;
}

.startertk-popup[data-close-side="left"] .startertk-popup-close {
  right: auto;
  left: 0.6rem;
}

.startertk-popup-close:hover,
.startertk-popup-close:focus-visible {
  background: rgba(0, 0, 0, 0.08);
}

.startertk-popup-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.startertk-popup-content:has(> :is(.startertk-popup-video, .startertk-popup-images):first-child) {
  padding-top: 1.75rem;
}

.startertk-popup-content > * {
  margin: 0;
}

.startertk-popup-title {
  color: inherit;
  line-height: 1.2;
}

h2.startertk-popup-title { font-size: var(--np-h2, 28px); }
h3.startertk-popup-title { font-size: var(--np-h3, 22px); }
h4.startertk-popup-title { font-size: var(--np-h4, 19px); }
h5.startertk-popup-title { font-size: var(--np-h5, 17px); }
h6.startertk-popup-title { font-size: var(--np-h6, 15px); }

.startertk-popup-text,
.startertk-popup-post p,
.startertk-popup-button {
  font-size: var(--np-p, 16px);
}

.startertk-popup-text p {
  margin: 0 0 0.6em;
}

.startertk-popup-text p:last-child {
  margin-bottom: 0;
}

.startertk-popup .startertk-popup-text a,
.startertk-popup .startertk-popup-post a {
  color: var(--np-link, inherit);
  transition: color 0.2s ease;
}

.startertk-popup .startertk-popup-text a:hover,
.startertk-popup .startertk-popup-text a:focus-visible,
.startertk-popup .startertk-popup-post a:hover,
.startertk-popup .startertk-popup-post a:focus-visible {
  color: var(--np-link-hover, inherit);
}

.startertk-popup-images {
  display: grid;
  grid-template-columns: repeat(var(--np-images, 1), minmax(0, 1fr));
  gap: 0.5rem;
}

.startertk-popup-images img {
  display: block;
  width: 100%;
  height: auto;
}

.startertk-popup-button {
  display: inline-block;
  padding: 0.7em 1.4em;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.startertk-popup-button.is-fill {
  background: var(--np-btn, #1d2327);
  color: var(--np-btn-text, #fff);
}

.startertk-popup-button.is-outline {
  background: transparent;
  color: var(--np-btn, #1d2327);
}

/* The theme's own link and button rules stop at the popup's edge: every state is stated. A
   border only when the button asks for one; otherwise it is there, transparent, so the button
   keeps its size whatever the theme's :hover says. */
.startertk-popup .startertk-popup-button,
.startertk-popup .startertk-popup-button:visited,
.startertk-popup .startertk-popup-button:hover,
.startertk-popup .startertk-popup-button:focus,
.startertk-popup .startertk-popup-button:active {
  border: 1px solid transparent;
  text-decoration: none;
  box-shadow: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.startertk-popup .startertk-popup-button.has-border,
.startertk-popup .startertk-popup-button.has-border:visited {
  border-color: var(--np-btn-border, #1d2327);
}

.startertk-popup .startertk-popup-button.has-border:hover,
.startertk-popup .startertk-popup-button.has-border:focus-visible {
  border-color: var(--np-btn-border-hover, #000000);
}

.startertk-popup .startertk-popup-button:hover,
.startertk-popup .startertk-popup-button:focus-visible {
  background: var(--np-btn-hover, #000000);
  color: var(--np-btn-text-hover, #fff);
}

.startertk-popup .startertk-popup-button:focus-visible {
  outline: 2px solid var(--np-btn, #1d2327);
  outline-offset: 2px;
}

.startertk-popup-post {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 0.9rem;
  align-items: start;
  padding: 0.75rem;
  /* A small card, with the popup's own corners and a frame whose colour is chosen. */
  border: 1px solid var(--np-card, #e5e7eb);
  border-radius: var(--np-radius, 12px);
}

.startertk-popup-post:not(:has(.startertk-popup-post-image)) {
  grid-template-columns: 1fr;
}

.startertk-popup-post-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: max(0px, calc(var(--np-radius, 12px) - 0.5rem));
}

.startertk-popup-post h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  line-height: 1.3;
}

.startertk-popup-post h3 a {
  color: inherit;
  text-decoration: none;
}

.startertk-popup-post p {
  margin: 0 0 0.4rem;
  font-size: 0.92rem;
}

.startertk-popup-post-more {
  font-weight: 600;
}

@media (max-width: 781px) {
  .startertk-popup-post {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .startertk-popup-box,
  .startertk-popup-overlay {
    transition: none;
  }

  .startertk-popup .startertk-popup-box,
  .startertk-popup[data-entrance] .startertk-popup-box {
    transform: none;
  }
}

.startertk-popup-social {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
}

.startertk-popup-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--np-social-size, 36px);
  height: var(--np-social-size, 36px);
  border-radius: 50%;
  background: var(--np-social, #1d2327);
  color: var(--np-social-glyph, #ffffff);
  text-decoration: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.startertk-popup-social.is-rounded .startertk-popup-social-link {
  border-radius: 22%;
}

.startertk-popup-social.is-square .startertk-popup-social-link {
  border-radius: 0;
}

.startertk-popup-social-link:hover,
.startertk-popup-social-link:focus-visible {
  opacity: 0.88;
  transform: translateY(-1px);
}

.startertk-popup-social-link svg {
  width: 52%;
  height: 52%;
}
