/* ==========================================================================
   Project pop-up frame
   ==========================================================================
   Shared photo-and-form layout for qualification and estimate requests.
   Ported from project-popup-frame.tsx.

   .popup-frame--compact drops the photo column for short states such as a
   confirmation, and lets a hosting dialog shrink to fit.
   ========================================================================== */

.popup-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-2xl);
  background-color: var(--color-neutral-900);
  color: #ffffff;
}

@media (min-width: 768px) {
  .popup-frame:not(.popup-frame--compact) {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
  }
}

.popup-frame__photo { position: relative; height: 9rem; }

@media (min-width: 768px) {
  .popup-frame__photo { height: auto; min-height: 100%; }
}

/* Framed off centre vertically so the two faces sit in the upper third rather
   than being cut by the panel edge. */
.popup-frame__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}

@media (min-width: 768px) {
  .popup-frame__photo img { object-position: 50% 40%; }
}

.popup-frame__body { position: relative; padding: 1.5rem; }

@media (min-width: 640px) { .popup-frame__body { padding: 2rem; } }

.popup-frame--compact .popup-frame__body {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: center;
}

.popup-frame__close {
  position: absolute;
  right: 1rem;
  top: 1rem;
  display: flex;
  width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background-color: color-mix(in oklab, var(--color-neutral-800) 90%, transparent);
  color: #ffffff;
  transition: background-color 150ms ease;
}

.popup-frame__close:hover { background-color: var(--color-neutral-700); }
.popup-frame__close svg { width: 1.25rem; height: 1.25rem; }

.popup-frame__close:focus-visible {
  outline: 2px solid var(--color-blue-300);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .popup-frame__close { transition: none; }
}
