.pfo-popup {
  position: fixed;
  inset: 0;
  width: min(820px, calc(100% - 40px));
  max-width: none;
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 0;
  border: 0;
  background: #f7f3ec;
  color: #171512;
  box-shadow: 0 16px 75px rgb(14 12 9 / 26%);
  font: 400 16px/1.6 "DM Sans", sans-serif;
  overscroll-behavior: contain;
}

.pfo-popup[open] { animation: pfo-appear 180ms ease-out; }
.pfo-popup::backdrop { background: rgb(22 19 15 / 60%); }
.pfo-popup [hidden] { display: none !important; }
html:has(.pfo-popup[open]) { overflow: hidden; scrollbar-gutter: stable; }

.pfo-popup__panel { display: grid; }
.pfo-popup__panel--photo { grid-template-columns: minmax(0, 41fr) minmax(0, 59fr); }
.pfo-popup__photo { position: relative; background: #34271d; }
.pfo-popup__photo img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pfo-popup__copy {
  align-self: center;
  min-width: 0;
  padding: clamp(32px, 5vw, 62px);
  overflow-wrap: anywhere;
}

.pfo-popup__close {
  position: absolute;
  z-index: 1;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #171512;
  cursor: pointer;
}
.pfo-popup__close:hover { background: rgb(23 21 18 / 8%); }
.pfo-popup__close:focus-visible, .pfo-popup__cta:focus-visible { outline: 2px solid #664733; outline-offset: 3px; }

.pfo-popup__heading { display: flex; align-items: center; gap: 14px; }
.pfo-popup__heading h2 {
  margin: 0;
  color: inherit;
  font: 400 clamp(30px, 4vw, 44px)/1.04 "DM Serif Display", Georgia, serif;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.pfo-popup__fairy {
  width: 32px;
  height: 52px;
  flex: 0 0 32px;
  object-fit: contain;
  animation: pfo-float 3.6s ease-in-out infinite alternate;
}
.pfo-popup__body { margin: 22px 0 0; color: #3d372f; font: inherit; white-space: pre-line; }
.pfo-popup__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  box-sizing: border-box;
  margin-top: 24px;
  padding: 9px 22px;
  border: 1px solid #171512;
  background: #171512;
  color: #fff;
  text-align: center;
  text-decoration: none;
}
.pfo-popup__cta:hover { background: transparent; color: #171512; }

@keyframes pfo-appear { from { opacity: 0; } to { opacity: 1; } }
@keyframes pfo-float { from { transform: translateY(2px) rotate(-4deg); } to { transform: translateY(-3px) rotate(3deg); } }
@media (prefers-reduced-motion: reduce) {
  .pfo-popup[open], .pfo-popup__fairy { animation: none; }
}

@media (max-width: 600px) {
  .pfo-popup { width: calc(100% - 28px); max-height: calc(100dvh - 28px); }
  .pfo-popup__panel--photo { grid-template-columns: minmax(0, 1fr); }
  .pfo-popup__photo { height: clamp(116px, 26dvh, 205px); }
  .pfo-popup__photo img { object-position: center 44%; }
  .pfo-popup__copy { padding: 24px; }
  .pfo-popup__panel:not(.pfo-popup__panel--photo) .pfo-popup__copy { padding-top: 50px; }
  .pfo-popup__panel--photo .pfo-popup__close { background: #f7f3ec; }
  .pfo-popup__body { margin-top: 14px; }
  .pfo-popup__cta { margin-top: 18px; }
}

.pfo-settings {
  margin: 20px 0 4px;
  padding-top: 12px;
  border-top: 1px solid #dcdcde;
}
.pfo-settings summary { font-weight: 600; cursor: pointer; }
.pfo-settings summary span { margin-left: 8px; color: #50575e; font-weight: 400; }
.pfo-settings__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 30px;
  max-width: 1000px;
  margin-top: 16px;
}
.pfo-settings__field { display: grid; gap: 5px; margin-top: 12px; font-weight: 600; }
.pfo-settings__field input[type=number] { width: 100px; }
.pfo-settings__field select { max-width: 100%; }
.pfo-settings__image { width: 132px; height: 90px; object-fit: cover; }
.pfo-settings__actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
@media (max-width: 782px) {
  .pfo-settings__grid { grid-template-columns: minmax(0, 1fr); }
}
