/* ==========================================================================
   PHOTO PRINTING — page-only sections (see ARCHITECTURE.md "photo-printing/", user 2026-10-21)
   photo-hero · photo-order (+ print-editor dialog) · photo-papers · photo-sizes · photo-how · photo-faq
   Global pieces: .page-hero--cover, .choice-card, .qty, .cart-photos, .step-card / .steps, .accordion.
   ========================================================================== */

/* ---------- Hero (global .page-hero--cover) ---------- */
.photo-hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-2); }
@media (max-width: 639.98px) { .photo-hero__actions .btn { width: 100%; padding-inline: var(--space-4); white-space: normal; } }
@media (min-width: 1024px) { .photo-hero .page-hero__inner > .lead { max-width: var(--measure-sm); } } /* keeps the text off the prints */
.photo-hero__trust { margin-top: var(--space-4); gap: var(--space-4) var(--space-6); }

/* ---------- Order panel: photo tiles | choices + summary ---------- */
.photo-order { scroll-margin-top: var(--header-height); }
.photo-order__head { display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: calc(var(--space-6) * var(--title-gap-scale)); }
.photo-order__panel {
  display: grid; gap: var(--space-8);
  padding: var(--card-padding); background: var(--color-surface); border: var(--card-border); border-radius: var(--card-radius); box-shadow: var(--card-shadow);
}
@media (min-width: 1024px) {
  .photo-order__panel { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--space-10); padding: var(--space-8); }
}
.photo-order__step { margin-bottom: var(--space-3); font-size: var(--text-lg); font-weight: var(--weight-medium); color: var(--color-heading); }
.photo-order__photos { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); min-width: 0; }
.photo-order__photos .photo-order__step { margin-bottom: 0; }
.photo-order__pick { cursor: pointer; }
.photo-order__pick:focus-within { box-shadow: var(--shadow-focus); }
@media (max-width: 639.98px) { .photo-order__pick { width: 100%; } }
.photo-order__count { color: var(--color-text-muted); }
.photo-order__list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--print-tile-width), 1fr)); gap: var(--space-3);
  width: 100%; max-height: var(--photo-list-height); overflow-y: auto; margin: 0; padding: var(--space-1); list-style: none;
}
.photo-order__list:empty { display: none; }
/* Desktop (user, 2026-10-21): the photo list is as tall as the choices column next to it and scrolls inside;
   contain: size keeps the photos out of the row height, so the choices column alone sets it */
@media (min-width: 1024px) {
  .photo-order__photos { contain: size; min-height: var(--photo-list-min-height); }
  .photo-order__list { flex: 1 1 0; min-height: 0; max-height: none; align-content: start; }
}

/* One photo: its thumbnail in the print's shape, size badge, remove ×, copies counter */
.print-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--space-2); min-width: 0; }
.print-tile__open {
  position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1; padding: var(--space-1);
  background: var(--color-bg-alt); border: var(--border-width) solid var(--color-border); border-radius: var(--radius-md); cursor: pointer;
}
.print-tile__open:hover { border-color: var(--color-primary); }
.print-tile__open:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.print-tile__shape { display: block; height: 100%; aspect-ratio: var(--print-ratio-4x6); overflow: hidden; background: var(--print-paper-bg); box-shadow: var(--shadow-sm); }
.print-tile[data-size="5x7"] .print-tile__shape { aspect-ratio: var(--print-ratio-5x7); }
.print-tile[data-orient="landscape"] .print-tile__shape { height: auto; width: 100%; aspect-ratio: var(--print-ratio-6x4); }
.print-tile[data-orient="landscape"][data-size="5x7"] .print-tile__shape { aspect-ratio: var(--print-ratio-7x5); }
.print-tile[data-fit="fit"] .print-tile__img { object-fit: contain; }
.print-tile__img { display: block; width: 100%; height: 100%; object-fit: cover; }
.print-tile__img[hidden] { display: none; }
.print-tile__busy { position: absolute; inset: 0; display: grid; place-items: center; padding: var(--space-1); font-size: var(--text-xs); text-align: center; color: var(--color-text-muted); }
.print-tile__busy[hidden] { display: none; }
.print-tile__size, .print-tile__edited {
  position: absolute; bottom: var(--space-1); padding: 0 var(--space-1); font-size: var(--text-xs); line-height: var(--leading-normal);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
}
.print-tile__size { left: var(--space-1); color: var(--color-heading); background: var(--color-surface); }
.print-tile__edited { right: var(--space-1); color: var(--color-on-primary); background: var(--color-primary); }
.print-tile__edited[hidden] { display: none; }
.print-tile__remove {
  position: absolute; top: calc(var(--space-1) * -1); right: calc(var(--space-1) * -1); display: grid; place-items: center;
  width: var(--space-6); height: var(--space-6); padding: 0; border: 0; border-radius: var(--radius-full);
  color: var(--color-heading); background: var(--color-surface); box-shadow: var(--shadow-md); cursor: pointer;
}
.print-tile__remove:hover { color: var(--color-danger); }
.print-tile__remove:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

.photo-order__choices { display: flex; flex-direction: column; gap: var(--space-6); zoom: var(--photo-choices-scale); } /* every control 20% smaller (user, 2026-10-21) */
.photo-order__group { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding: 0; border: 0; }
.photo-order__group .choice-card { width: 100%; }
.photo-order__group legend.photo-order__step { padding: 0; }
.photo-order__warn { display: flex; align-items: flex-start; gap: var(--space-2); padding: var(--space-2) var(--space-3); font-size: var(--text-sm); color: var(--color-on-warning); background: var(--color-warning-bg); border-radius: var(--radius-md); }
.photo-order__warn .icon { flex: none; margin-top: var(--space-1); }

.photo-order__summary { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding-top: var(--space-4); border-top: var(--border-width) solid var(--color-border); }
.photo-order__summary > div { display: flex; justify-content: space-between; gap: var(--space-4); }
.photo-order__summary dt { color: var(--color-text-muted); }
.photo-order__summary dd { margin: 0; color: var(--color-heading); }
.photo-order__total dt, .photo-order__total dd { font-size: var(--text-xl); font-weight: var(--weight-medium); color: var(--color-heading); }
.photo-order__ship { font-size: var(--text-sm); color: var(--color-success); }
.photo-order__actions { display: flex; flex-direction: column; gap: var(--space-3); }
.photo-order__status { font-size: var(--text-sm); color: var(--color-text-muted); }
.photo-order__status:empty { display: none; }
.photo-order__status[data-tone="error"] { color: var(--color-danger); }
.photo-order__added { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); background: var(--color-primary-soft); border-radius: var(--card-radius); }
.photo-order__added-title { display: flex; align-items: center; gap: var(--space-2); color: var(--color-heading); }
.photo-order__added-title .icon { color: var(--color-success); }
.photo-order__added-links { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* ---------- Photo editor dialog: dark stage, white print frame, the photo's outline + corner squares ---------- */
.print-editor {
  width: min(calc(100vw - var(--container-gutter) * 2), var(--print-editor-width)); max-height: calc(100dvh - var(--space-8));
  margin: auto; /* the base reset removes the dialog's own centering */
  padding: 0; color: var(--color-text); background: var(--color-surface); border: 0; border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
}
.print-editor[open] { display: flex; flex-direction: column; }
.print-editor::backdrop { background: color-mix(in srgb, var(--color-heading) 60%, transparent); }
.print-editor__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-4) var(--space-6); }
.print-editor__title { font-size: var(--text-2xl); }
.print-editor__body { display: grid; gap: var(--space-4); min-height: 0; padding: 0 var(--space-6); overflow-y: auto; }
@media (min-width: 1024px) { .print-editor__body { grid-template-columns: minmax(0, 1fr) var(--editor-panel-width); overflow: visible; } }
.print-editor__stage {
  position: relative; height: var(--print-stage-height); overflow: hidden; touch-action: none; user-select: none;
  background: var(--editor-stage-bg); border-radius: var(--radius-lg);
}
.print-editor__frame { position: absolute; overflow: hidden; background: var(--print-paper-bg); box-shadow: var(--print-frame-shadow); }
.print-editor__img { position: absolute; max-width: none; filter: url(#print-color); pointer-events: none; }
.print-editor__box { position: absolute; border: var(--border-width-thick) dashed var(--print-outline); cursor: move; }
.print-editor__handle {
  position: absolute; width: var(--editor-handle-size); height: var(--editor-handle-size);
  background: var(--editor-frame-color); border: var(--border-width) solid var(--editor-stage-bg); box-shadow: var(--shadow-sm);
}
.print-editor__handle--nw { top: calc(var(--editor-handle-size) / -2); left: calc(var(--editor-handle-size) / -2); cursor: nwse-resize; }
.print-editor__handle--ne { top: calc(var(--editor-handle-size) / -2); right: calc(var(--editor-handle-size) / -2); cursor: nesw-resize; }
.print-editor__handle--sw { bottom: calc(var(--editor-handle-size) / -2); left: calc(var(--editor-handle-size) / -2); cursor: nesw-resize; }
.print-editor__handle--se { bottom: calc(var(--editor-handle-size) / -2); right: calc(var(--editor-handle-size) / -2); cursor: nwse-resize; }
.print-editor__loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--color-text-inverse); }
.print-editor__loading[hidden] { display: none; }
.print-editor__stage[data-state="loading"] :is(.print-editor__frame, .print-editor__box) { visibility: hidden; }
.print-editor__tools { display: flex; flex-direction: column; gap: var(--space-4); }
.print-editor__group { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding: 0; border: 0; }
.print-editor__group legend { padding: 0; margin-bottom: var(--space-2); }
.print-editor__row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.print-editor__zoom { flex: 1; min-width: 0; }
.print-editor__slider { display: grid; grid-template-columns: var(--editor-range-label) minmax(0, 1fr); align-items: center; gap: var(--space-2); font-size: var(--text-sm); }
.print-editor input[type="range"] { width: 100%; accent-color: var(--color-primary); }
.print-editor__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-6); border-top: var(--border-width) solid var(--color-border); }
.print-editor__note { font-size: var(--text-sm); color: var(--color-text-muted); }
.print-editor__actions { display: flex; gap: var(--space-3); margin-left: auto; }
.print-editor__defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Paper finishes: a CSS swatch under each finish's sheen ---------- */
.photo-papers__head, .photo-sizes__head { display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: calc(var(--space-6) * var(--title-gap-scale)); }
.photo-papers__grid { display: grid; gap: var(--grid-gap); margin: 0; padding: 0; list-style: none; }
@media (min-width: 640px) { .photo-papers__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .photo-papers__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.paper-card {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--card-padding); background: var(--color-surface); border: var(--card-border); border-radius: var(--card-radius); box-shadow: var(--card-shadow);
}
.paper-card h3 { font-size: var(--text-xl); }
.paper-card p { color: var(--color-text-muted); }
.paper-card__swatch {
  position: relative; display: block; height: var(--print-swatch-height); margin-bottom: var(--space-2); overflow: hidden;
  background: var(--print-paper-photo); border: var(--space-2) solid var(--print-paper-bg); border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
}
.paper-card__swatch::after { content: ""; position: absolute; inset: 0; }
.paper-card--glossy .paper-card__swatch::after { background: var(--print-sheen-glossy); }
.paper-card--matte .paper-card__swatch::after { background: var(--print-matte-veil); }
.paper-card--satin .paper-card__swatch::after { background: var(--print-sheen-satin); }
.paper-card--luster .paper-card__swatch::after { background: var(--print-sheen-luster), var(--print-luster-grain); }

/* ---------- Sizes: each print drawn as an outline at one scale ---------- */
.photo-sizes__grid { display: grid; gap: var(--grid-gap); margin: 0; padding: 0; list-style: none; }
@media (min-width: 768px) { .photo-sizes__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.size-card {
  display: flex; align-items: flex-end; gap: var(--space-6);
  padding: var(--card-padding); background: var(--color-surface-tint); border-radius: var(--card-radius);
}
.size-card__print { flex: none; display: block; background: var(--print-paper-photo); border: var(--space-1) solid var(--print-paper-bg); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); }
.size-card--4x6 .size-card__print { width: var(--print-outline-4x6); aspect-ratio: var(--print-ratio-4x6); }
.size-card--5x7 .size-card__print { width: var(--print-outline-5x7); aspect-ratio: var(--print-ratio-5x7); }
.size-card__body { display: flex; flex-direction: column; gap: var(--space-2); }
.size-card__body h3 { font-size: var(--text-2xl); }
.size-card__price { font-size: var(--text-3xl); font-weight: var(--weight-medium); color: var(--color-primary); }
.size-card__price span { font-size: var(--text-base); font-weight: var(--weight-regular); color: var(--color-text-muted); }
.size-card__body p:last-child { color: var(--color-text-muted); }
.photo-sizes__note { display: flex; align-items: center; justify-content: center; gap: var(--space-2); margin-top: var(--space-6); color: var(--color-heading); }

/* ---------- How to order ---------- */
.photo-how__title { margin-bottom: calc(var(--space-6) * var(--title-gap-scale)); }
.photo-how__cta { display: flex; justify-content: center; margin-top: var(--space-8); }

/* ---------- FAQ ---------- */
.photo-faq__title { margin-bottom: calc(var(--space-6) * var(--title-gap-scale)); }
.photo-faq__more { margin-top: var(--space-6); color: var(--color-text-muted); }
