/* Private enquiry dialog. Reuses the page's own tokens only, so it follows
   body.theme-dark automatically. See docs/specs/2026-09-28-enquiry-dialog-design.md. */

html.enquiry-open,
html.enquiry-open body { overflow: hidden; }

dialog.enquiry {
  width: min(92vw, 920px);
  max-width: none;
  max-height: min(90svh, 800px);
  margin: auto;
  padding: 0;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  overflow: hidden; /* so the fixed-height box below actually clips instead of letting content spill past it */
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 220ms ease, transform 220ms ease;
}

/* Scoped to [open]: an unconditional display:flex would override the UA's
   `dialog:not([open]) { display: none }` and leave it visible after close(). */
dialog.enquiry[open] {
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: translateY(0);
}

dialog.enquiry::backdrop { background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(6px); }

.enquiry-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
}

dialog.enquiry.no-image .enquiry-layout { grid-template-columns: minmax(0, 1fr); }

/* contain, never cover: the whole print or painting must stay visible, never cropped.
   The img has to actually fill its box (100%/100%) for object-fit to have a box to
   letterbox within; width/height:auto here would just shrink-wrap and defeat it. */
.enquiry-image { min-height: 0; background: var(--paper); }
.enquiry-image img { width: 100%; height: 100%; object-fit: contain; }

.enquiry-panel {
  position: relative;
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 0; /* grid items default to auto, which would push content past the dialog's box instead of scrolling */
  padding: clamp(24px, 3vw, 40px);
  overflow-y: auto;
}

.enquiry-close {
  position: absolute;
  top: 18px;
  right: 18px;
  min-width: 60px;
  min-height: 34px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.enquiry-close:hover,
.enquiry-close:focus-visible { color: var(--ink); border-color: var(--ink); }

.enquiry-eyebrow {
  margin: 0;
  padding-right: 80px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.enquiry-title {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 400;
  line-height: 1.08;
}

.enquiry-meta { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.enquiry-body { margin-top: clamp(14px, 2vw, 22px); }
.enquiry-intro { margin: 0 0 14px; max-width: 46ch; color: var(--muted); font-size: 15px; line-height: 1.5; }
.enquiry-form:not([hidden]) { display: grid; gap: 14px; }
.enquiry-field { display: grid; gap: 6px; }
.enquiry-field label { color: var(--muted); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; }

.enquiry-field input,
.enquiry-field textarea {
  width: 100%;
  padding: 6px 0 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  resize: vertical;
}

.enquiry-field input:focus-visible,
.enquiry-field textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.enquiry-hp {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.enquiry-checkbox { display: flex; gap: 10px; align-items: start; color: var(--ink); font-size: 13px; line-height: 1.4; }
.enquiry-checkbox input { margin-top: 3px; }
.enquiry-privacy { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.enquiry-actions { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center; margin-top: 4px; }

.enquiry-submit {
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.enquiry-submit:hover,
.enquiry-submit:focus-visible { background: var(--ink); color: var(--paper); }
.enquiry-submit:disabled { cursor: not-allowed; opacity: 0.6; }
.enquiry-footnote { margin: 0; color: var(--muted); font-size: 12px; }
.enquiry-footnote a { border-bottom: 1px solid currentColor; }
.enquiry-result { max-width: 46ch; font-family: var(--serif); font-size: clamp(19px, 2vw, 24px); line-height: 1.4; }
.enquiry-result a { border-bottom: 1px solid currentColor; }

@media (max-width: 680px) {
  dialog.enquiry { width: 100vw; height: 100%; max-height: 100svh; }
  .enquiry-layout { grid-template-columns: 1fr; grid-auto-rows: auto 1fr; max-height: 100svh; overflow-y: auto; }
  .enquiry-image { height: 38vh; max-height: 38vh; }
  .enquiry-panel { overflow-y: visible; }
}

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