/* The HEIC converter (public/convert/*.html, js/convert.js).
   Rides on theme.css + landing.css; only the tool and the table live here.
   No animation runs at rest: the only moving things are the drop box while a
   file hovers it and a row while it converts — both stop on their own. */

.cv-article h1 { margin-bottom: 10px; }

.cv {
  margin: 22px 0 8px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--bg-1);
  border-radius: var(--radius-lg);
}

/* ── The drop box ─────────────────────────────────────────────────────────── */
.cv-drop {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 34px 16px 30px;
  text-align: center;
  cursor: pointer;
  border: 1px dashed color-mix(in oklab, var(--accent) 45%, var(--line));
  background:
    linear-gradient(var(--bg-2), var(--bg-2)) padding-box;
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.cv-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.cv-drop b { font-family: var(--display); font-size: clamp(17px, 2.2vw, 21px); letter-spacing: .01em; }
.cv-drop:hover, .cv-drop:focus-within { border-color: var(--accent); }
.cv-drop:focus-within { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.cv-glyph {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(26px, 5vw, 40px);
  letter-spacing: .04em;
  line-height: 1;
  color: var(--fg-dim);
}
.cv-glyph i { font-style: normal; color: var(--accent); margin: 0 .25em; display: inline-block; transition: transform var(--dur) var(--ease); }
.cv-drop:hover .cv-glyph i { transform: translateX(4px); }

/* A file hovering the box: a single sweep across it, then still. */
.cv-drop.over { border-style: solid; border-color: var(--accent); background-color: color-mix(in oklab, var(--accent) 7%, var(--bg-2)); }
.cv-drop.over::after {
  content: "";
  position: absolute; inset: 0 auto 0 -30%;
  width: 30%;
  background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--accent) 22%, transparent), transparent);
  animation: cv-sweep 700ms var(--ease) 1 forwards;
  pointer-events: none;
}
@keyframes cv-sweep { to { transform: translateX(440%); } }

/* ── Options ──────────────────────────────────────────────────────────────── */
.cv-opts { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: end; margin-top: 12px; }
.cv-seg { display: flex; align-items: center; gap: 0; }
.cv-seg > .tiny { margin-right: 10px; }
.cv-seg label { cursor: pointer; }
.cv-seg input { position: absolute; opacity: 0; pointer-events: none; }
.cv-seg span:not(.tiny) {
  display: inline-block;
  min-width: 58px;
  padding: 9px 14px;
  text-align: center;
  font-family: var(--display);
  font-weight: 600;
  border: 1px solid var(--line);
  color: var(--fg-dim);
  background: var(--bg-2);
}
.cv-seg label + label span { border-left: 0; }
.cv-seg input:checked + span { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.cv-seg input:focus-visible + span { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.cv-sel { display: grid; gap: 4px; }
.cv-sel select {
  min-height: 40px;
  padding: 6px 10px;
  background: var(--field);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  font-size: 14px;
}
.cv[data-fmt="png"] [data-jpg-only] { display: none; }

/* ── The list ─────────────────────────────────────────────────────────────── */
.cv-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; }
.cv-list:empty { display: none; }
.cv-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 7px 8px 7px 7px;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--line);
}
.cv-thumb {
  width: 48px; height: 48px;
  background: var(--bg-3) center / cover no-repeat;
}
.cv-mid { min-width: 0; display: grid; gap: 2px; }
.cv-mid b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-status { color: var(--fg-dim); font-variant-numeric: tabular-nums; }
.cv-item.ok { border-left-color: var(--ok); }
.cv-item.warn { border-left-color: var(--warn); }
.cv-item.warn .cv-status { color: var(--warn); }
.cv-item.bad { border-left-color: var(--bad); }
.cv-item.bad .cv-status { color: var(--bad); }
/* Only the photo being converted RIGHT NOW shimmers — a queue of forty would
   otherwise keep forty layers animating for the whole batch. */
.cv-item.work.now .cv-thumb {
  background-image: linear-gradient(90deg, var(--bg-3), color-mix(in oklab, var(--accent) 16%, var(--bg-3)), var(--bg-3)) !important;
  background-size: 200% 100%;
  animation: cv-work 1.1s linear infinite;
}
@keyframes cv-work { to { background-position: -200% 0; } }
.cv-btns { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.cv-dl { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.cv-btns .cv-send { min-height: 36px; padding: 6px 10px; font-size: 13px; color: var(--accent); border: 1px solid color-mix(in oklab, var(--accent) 40%, var(--line)); }
.cv-send:disabled { opacity: .6; }
.cv-sent { color: var(--ok); text-decoration: none; }
.cv-sent:hover { text-decoration: underline; }

/* ── Actions ──────────────────────────────────────────────────────────────── */
.cv-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.cv-actions[hidden] { display: none; }
.cv-count { color: var(--fg-dim); }
.cv-privacy { margin: 12px 0 0; color: var(--fg-dim); }
.cv-privacy span { color: var(--ok); font-size: 9px; vertical-align: 2px; margin-right: 4px; }

/* ── The comparison table ─────────────────────────────────────────────────── */
.cv-table-wrap { overflow-x: auto; margin: 34px 0 6px; -webkit-overflow-scrolling: touch; }
.cv-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 14px; }
.cv-table caption {
  text-align: left;
  font-family: var(--display);
  font-size: clamp(19px, 2.4vw, 24px);
  font-weight: 600;
  color: var(--fg);
  padding-bottom: 12px;
}
.cv-table th, .cv-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.cv-table thead th { font-family: var(--display); color: var(--accent); font-size: 15px; letter-spacing: .03em; }
.cv-table tbody th { font-weight: 600; color: var(--fg); width: 34%; }
.cv-table td { color: var(--fg-dim); }

.cv-next { margin-top: 46px; padding: 18px 18px 20px; border: 1px solid var(--line); background: var(--bg-1); }
.cv-next h2 { margin-top: 0; }
.cv-updated { margin-top: 26px; }
.seo-page a[target="_blank"] { text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 560px) {
  .cv { padding: 10px; margin-inline: -8px; }
  .cv-drop { padding: 26px 12px 24px; }
  .cv-item { grid-template-columns: 40px 1fr; }
  .cv-thumb { width: 40px; height: 40px; }
  .cv-btns { grid-column: 1 / -1; justify-content: stretch; }
  .cv-btns > * { flex: 1 1 0; text-align: center; }
  .cv-actions .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .cv-drop.over::after, .cv-item.work.now .cv-thumb { animation: none; }
  .cv-glyph i { transition: none; }
}
