/* ═══════════════════════════════════════════════════════════
   POP-UPS — admin-configured, one per page.
   ═══════════════════════════════════════════════════════════ */
.popup {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease);
}
.popup.is-open { opacity: 1; pointer-events: auto; }

.popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 15, .72);
  backdrop-filter: blur(6px);
}

.popup__box {
  position: relative;
  z-index: 1;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius);
  background: var(--bg-2, #0e1424);
  border: 1px solid var(--border-gold);
  box-shadow: var(--shadow-xl);
  transform: translateY(16px) scale(.97);
  transition: transform .35s var(--ease);
}
.popup.is-open .popup__box { transform: none; }
/* An image pop-up is the image — no chrome competing with it. */
.popup__box--image { max-width: 560px; background: transparent; border: none; overflow: visible; }
/* A form with a picture beside it needs the room for two columns. */
.popup__box--split { max-width: 800px; }

.popup__close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(6, 8, 15, .6);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.popup__close:hover { background: rgba(6, 8, 15, .9); transform: rotate(90deg); }

.popup__img { display: block; border-radius: var(--radius); overflow: hidden; }
.popup__img img { display: block; width: 100%; height: auto; }

.popup__form { padding: 34px 30px 30px; }

/* Image left, fields right. The padding moves onto the text column so the
   picture runs edge to edge. */
.popup__form--split {
  display: grid;
  grid-template-columns: 42% 1fr;
  padding: 0;
  align-items: stretch;
}
.popup__form--split .popup__form-body { padding: 34px 30px 30px; }
.popup__form-media {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, .04);
}
/* Absolute so the picture fills whatever height the fields end up needing,
   instead of the image's own aspect ratio setting the row height. */
.popup__form-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* In Arabic the whole box is RTL, so the picture lands on the right — which is
   the same "image first" reading order. */

.popup__form h3 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--white, #fff);
  margin-bottom: 8px;
  line-height: 1.2;
}
.popup__form > p {
  color: var(--text-2);
  font-size: .9rem;
  margin-bottom: 20px;
  line-height: 1.55;
}
.popup__form input,
.popup__form textarea {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  font-family: inherit;
  font-size: .92rem;
  resize: vertical;
}
.popup__form input::placeholder,
.popup__form textarea::placeholder { color: rgba(255, 255, 255, .3); }
.popup__form input:focus,
.popup__form textarea:focus { outline: none; border-color: var(--gold); }
.popup__form .btn { width: 100%; justify-content: center; margin-top: 6px; }

/* Bait for bots; a real visitor never sees or tabs into it. */
.popup__hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.popup__status { font-size: .85rem; margin-top: 12px; text-align: center; }
.popup__status--err { color: #ff8f8f; }
.popup__status--ok  { color: #6ee7a8; padding: 20px 0; font-size: .95rem; }

/* Two columns stop being readable well before the phone breakpoint — the
   fields get too narrow long before the box does. */
@media (max-width: 720px) {
  .popup__form--split { grid-template-columns: 1fr; }
  .popup__form-media { height: 150px; }
}
@media (max-width: 520px) {
  .popup__form { padding: 30px 20px 24px; }
  .popup__form--split { padding: 0; }
  .popup__form--split .popup__form-body { padding: 26px 20px 24px; }
  .popup__form h3 { font-size: 1.35rem; }
}
@media (prefers-reduced-motion: reduce) {
  .popup, .popup__box { transition: none; }
  .popup__close:hover { transform: none; }
}

/* Light theme: the box is a dark card on a dark page; keep it dark so the
   gold and white type stay legible rather than inverting the whole thing. */
html.theme-light .popup__box { background: #0e1424; }
