/* PAPIK · Pillar detail modal
   Visually identical to .hp-login (lateral right drawer · sister of header).
   Brand: TT Firs Neue 300/400/500 only, never italic.
   Easing: cubic-bezier(0.23, 1, 0.32, 1) — same as hp-login.
   Respects prefers-reduced-motion. */

:root {
  --rl-pillar-page:   #ffffff;       /* pure white (B/W modal) */
  --rl-pillar-ink:    #000000;       /* pure black (B/W modal) */
  --rl-pillar-tile:   #d9e4e0;
  --rl-pillar-easing: cubic-bezier(0.23, 1, 0.32, 1);
}

.rl-pillar-modal {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: none;
}
.rl-pillar-modal.is-open { display: block; }
.rl-pillar-modal[hidden] { display: none !important; }

/* ─── Backdrop · fade 620ms ─── */
.rl-pillar-modal__backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(0,40,25,0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms var(--rl-pillar-easing);
}
.rl-pillar-modal.is-open .rl-pillar-modal__backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* ─── Dialog · panell flotant germà del header ───
   Mateixos insets, radius, slide i shadow que .hp-login__dialog. */
.rl-pillar-modal__dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  width: calc(100% - 48px);
  max-width: 390px;
  height: auto;
  max-height: 78vh;
  z-index: 65;
  background: var(--rl-pillar-page);
  color: var(--rl-pillar-ink);
  border: 1px solid rgba(0,40,25,0.06);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translate(-50%, -50%) scale(0.96);
  opacity: 0;
  box-shadow:
    0 24px 60px -16px rgba(0, 0, 0, 0),
    0 8px 24px rgba(0, 0, 0, 0);
  transition:
    transform 340ms var(--rl-pillar-easing),
    opacity 240ms var(--rl-pillar-easing),
    box-shadow 340ms var(--rl-pillar-easing);
  font-family: 'TT Firs Neue', sans-serif;
  font-style: normal;
  padding: 0;
}
.rl-pillar-modal.is-open .rl-pillar-modal__dialog {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  box-shadow:
    0 24px 60px -16px rgba(0,40,25,0.22),
    0 8px 24px rgba(0,40,25,0.08);
}

/* Tablet · centered, slightly narrower */
@media (max-width: 1023px) {
  .rl-pillar-modal__dialog {
    max-width: 360px;
    max-height: 76vh;
  }
}

/* Mobile · centered, near full-width, slide-up */
@media (max-width: 767px) {
  .rl-pillar-modal__dialog {
    width: calc(100% - 24px);
    max-width: calc(100% - 24px);
    max-height: 82vh;
    border-radius: 14px;
    transform: translate(-50%, -50%) translateY(16px);
    opacity: 0;
    transition:
      transform 320ms var(--rl-pillar-easing),
      opacity 320ms var(--rl-pillar-easing),
      box-shadow 320ms var(--rl-pillar-easing);
  }
  .rl-pillar-modal.is-open .rl-pillar-modal__dialog {
    transform: translate(-50%, -50%);
    opacity: 1;
  }
}

/* ─── Top bar kicker removed · close button floats top-right ─── */

.rl-pillar-modal__close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #fff;            /* white over the dark visual panel (two-column) */
  opacity: 0.85;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
/* Text-only variant: top-right sits over the white column, so ink X */
.rl-pillar-modal__dialog.is-text-only .rl-pillar-modal__close {
  color: var(--rl-pillar-ink);
}
@media (min-width: 768px) {
  .rl-pillar-modal__close {
    top: 16px;
    right: 24px;
  }
}
.rl-pillar-modal__close:hover,
.rl-pillar-modal__close:focus-visible {
  opacity: 1;
  transform: rotate(90deg);
}
.rl-pillar-modal__close svg { display: block; }
.rl-pillar-modal__close:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* ─── Statement (top dark block · the editorial headline) ─── */
.rl-pillar-modal__statement {
  font-family: 'TT Firs Neue', sans-serif;
  font-style: normal;
  font-size: clamp(20px, 2vw, 24px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.005em;
  color: var(--rl-pillar-ink);
  margin: 0 0 24px;
  padding: 40px 24px 0;
}
@media (min-width: 768px) {
  .rl-pillar-modal__statement {
    padding: 48px 40px 0;
    margin-bottom: 28px;
  }
}

/* ─── Body (middle muted block, same scale, lighter color) ─── */
.rl-pillar-modal__body {
  font-family: 'TT Firs Neue', sans-serif;
  font-style: normal;
  font-size: clamp(17px, 1.5vw, 19px);
  font-weight: 300;
  line-height: 1.55;
  letter-spacing: -0.003em;
  color: #000;
  margin: 0;
  padding: 0 24px;
  overflow-y: auto;
  flex: 1;
}
@media (min-width: 768px) {
  .rl-pillar-modal__body { padding: 0 40px; }
}

/* ─── Signature (bottom small line) ─── */
.rl-pillar-modal__signature {
  /* text + gray rule removed, but its space is kept blank so the card
     keeps its lower breathing room (visibility:hidden reserves the box). */
  visibility: hidden;
  margin: 0;
  padding: 18px 24px 22px;
  flex-shrink: 0;
}
@media (min-width: 768px) {
  .rl-pillar-modal__signature { padding: 22px 40px 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .rl-pillar-modal__backdrop,
  .rl-pillar-modal__dialog,
  .rl-pillar-modal__close { transition: none; }
}

/* ════════════════════════════════════════════════════════════
   Two-panel layout · text column + visual panel (double width).
   The visual shows a realistic render per pillar when data.image
   is provided; otherwise a brand green-mesh panel with a large icon.
   ════════════════════════════════════════════════════════════ */
.rl-pillar-modal__dialog {
  max-width: min(780px, calc(100% - 48px));
  flex-direction: row;
  overflow: hidden;
}
.rl-pillar-modal__text {
  flex: 1 1 54%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.rl-pillar-modal__visual {
  flex: 0 0 46%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Replicate the source pillar card's icon-field gradient exactly
     (rl-system.css .rl-featured__card-visual:has(>svg/>i)): #002819 base
     + mint bloom top-right + soft black vignette bottom-left, white icon. */
  background:
    radial-gradient(125% 120% at 78% 12%, rgba(217,228,224,0.20) 0%, rgba(217,228,224,0) 52%),
    radial-gradient(120% 120% at 12% 100%, rgba(0,0,0,0.22) 0%, rgba(0,0,0,0) 55%),
    #002819;
}
.rl-pillar-modal__visual.has-image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.rl-pillar-modal__visual svg {
  width: clamp(72px, 9vw, 120px);
  height: clamp(72px, 9vw, 120px);
  color: #fff;
  stroke: currentColor;
  opacity: 0.96;
}
.rl-pillar-modal__visual i {
  font-size: clamp(72px, 9vw, 120px);
  line-height: 0;
  color: #fff;
  opacity: 0.96;
}
/* Text-only variant: popups whose trigger has no icon/image (wall layers,
   house hotspots) drop the visual panel and use a single narrower column. */
.rl-pillar-modal__dialog.is-text-only {
  max-width: min(420px, calc(100% - 48px));
}
@media (max-width: 767px) {
  .rl-pillar-modal__dialog { flex-direction: column; }
  .rl-pillar-modal__visual { flex: 0 0 200px; order: -1; }
  .rl-pillar-modal__visual svg { width: 64px; height: 64px; }
  .rl-pillar-modal__text { overflow-y: visible; }
}
