/* The Dehaze and HDR tool (inc/hdr-tool.inc.php): the samples, the look
   tiles and the photo. The layout is pt-ui.css's, the
   phone editor pt-app.css's, the sliders and buttons take pt-theme.css's look. */

/* ── Empty state: the samples ─────────────────────────────────────────── */
.hdr-editor .sample-thumbnails-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  text-align: center;
  /* Without a width it shrinks to half the box (left: 50%). */
  width: 90%;
}
/* By id: in the phone editor the photo box is out of the card. */
#hx-empty.hidden { display: none; }
.hdr-editor .sample-thumbnails { display: flex; justify-content: center; gap: 12px; margin: 10px 0; flex-wrap: wrap; }
.hdr-editor .sample-thumbnail {
  flex-shrink: 0;
  cursor: pointer;
  border: 2px solid #dee2e6;
  border-radius: 10px;
  overflow: hidden;
  width: 110px;
  height: 110px;
  padding: 0;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.hdr-editor .sample-thumbnail:hover,
.hdr-editor .sample-thumbnail:focus-visible { border-color: var(--pt-accent, #0f70e6); box-shadow: 0 4px 12px rgba(15, 112, 230, 0.25); }
.hdr-editor .sample-thumbnail img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 767px) { .hdr-editor .sample-thumbnail { width: 84px; height: 84px; } }

/* ── The photo ────────────────────────────────────────────────────────── */
#hx-viewport { position: relative; display: flex; align-items: center; justify-content: center; padding: 12px; overflow: hidden; }
#hx-canvas { display: block; max-width: 100%; max-height: 100%; border-radius: 6px; background: #fff; }
#hx-canvas[hidden] { display: none; }
#hx-compare.active { color: #fff; background: var(--cb-ink, #16181d); border-color: var(--cb-ink, #16181d); }

/* ── Look tiles: the photo in each look ───────────────────────────────── */
/* Two looks: two tiles of the same size as the other tools' */
.hx-looks { display: grid; grid-template-columns: repeat(2, 96px); gap: 10px 16px; }
.hx-look {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--cb-text, #3d434b);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
}
.hx-thumb {
  position: relative;
  display: block;
  width: 100%;
  max-width: 96px;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, #e9e5df, #f6f4f1);
  box-shadow: inset 0 0 0 1px var(--cb-line, #e4e1dc);
  transition: box-shadow 0.15s;
}
.hx-thumb canvas { display: block; width: 100%; height: 100%; }
.hx-name { max-width: 100%; text-align: center; overflow-wrap: anywhere; hyphens: auto; }
.hx-look:hover .hx-thumb { box-shadow: inset 0 0 0 1px var(--cb-line, #e4e1dc), 0 0 0 2px #cfcac3; }
.hx-look[aria-pressed="true"] { color: var(--cb-ink, #16181d); font-weight: 700; }
/* The chosen one: CB's double ring. */
.hx-look[aria-pressed="true"] .hx-thumb { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--cb-ink, #16181d); }
.hx-look:focus-visible { outline: none; }
.hx-look:focus-visible .hx-thumb { box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(15, 112, 230, 0.6); }
fieldset:disabled .hx-look { cursor: default; opacity: 0.75; }

.hx-link {
  border: 0;
  background: none;
  padding: 2px 4px;
  font-size: 0.8rem;
  color: var(--pt-accent, #0f70e6);
  cursor: pointer;
}
.hx-link:disabled { color: #9aa1aa; cursor: default; }

/* ── Phone editor ─────────────────────────────────────────────────────── */
/* The tiles lifted into the bottom bar: one row that scrolls sideways. */
.pt-app-panels .hx-looks { display: flex; gap: 10px; padding: 6px 4px; }
.pt-app-panels .hx-look { flex: 0 0 auto; width: 68px; color: var(--pt-app-fg); }
.pt-app-panels .hx-look[aria-pressed="true"] { color: var(--pt-app-fg); }
.pt-app-panels .hx-thumb { box-shadow: inset 0 0 0 1px var(--pt-app-line-strong); }
