/* giftools — shared styles for the animated-GIF tool pages.
 * Builds on the existing resizer-*/compress-*/gf-* primitives in site.css. */

.gt-meta { font: 12px/1.7 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.gt-meta b { color: var(--ink); font-weight: 600; }

.gt-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.gt-preview > div { min-width: 0; }
.gt-preview img, .gt-preview video { width: 100%; height: auto; max-height: 360px; object-fit: contain;
  background: var(--canvas); border: 1px solid var(--line); border-radius: 6px;
  background-image: repeating-conic-gradient(#e7e3de 0% 25%, #f6f4f1 0% 50%); background-size: 16px 16px; }
.gt-preview figcaption { font-size: 12px; color: var(--muted); margin-top: 6px; }
.gt-preview .gt-size { font-variant-numeric: tabular-nums; }
.gt-preview-single { grid-template-columns: 1fr; }
@media (max-width: 720px) { .gt-preview { grid-template-columns: 1fr; } }

.gt-progress { height: 8px; border-radius: 4px; background: var(--canvas); overflow: hidden; margin: 8px 0; }
.gt-progress > i { display: block; height: 100%; width: 0; background: var(--site-accent); transition: width .2s; }
.gt-progress.is-indeterminate > i { width: 30% !important; animation: gt-slide 1.1s ease-in-out infinite alternate; }
@keyframes gt-slide { from { margin-left: 0 } to { margin-left: 70% } }

.gt-frames { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.gt-frame { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); }
.gt-frame canvas, .gt-frame img { display: block; width: 100%; height: auto;
  background-image: repeating-conic-gradient(#e7e3de 0% 25%, #f6f4f1 0% 50%); background-size: 14px 14px; }
.gt-frame .gt-frame-meta { display: flex; justify-content: space-between; gap: 8px;
  font: 11px/1.5 var(--mono); color: var(--muted); padding: 6px 8px; }
.gt-frame .gt-frame-dl { border: 0; background: none; color: var(--site-accent); font: inherit;
  cursor: pointer; padding: 0; text-decoration: underline; min-height: 0; }

.gt-range { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gt-range label { display: grid; gap: 4px; font-size: 13px; }
.gt-range input { width: 100%; }
@media (max-width: 560px) { .gt-range { grid-template-columns: 1fr; } }

.gt-presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.gt-presets button { border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface);
  color: var(--ink); font-size: 12px; padding: 4px 12px; min-height: 32px; cursor: pointer; }
.gt-presets button.is-on { background: var(--site-accent); border-color: var(--site-accent); color: #fff; }

.gt-crop-stage { position: relative; width: 100%; touch-action: none; }
.gt-crop-stage img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none;
  background-image: repeating-conic-gradient(#e7e3de 0% 25%, #f6f4f1 0% 50%); background-size: 16px 16px; }
.gt-crop-box { position: absolute; border: 2px solid var(--site-accent); background: rgba(157, 53, 87, .12);
  box-shadow: 0 0 0 9999px rgba(0,0,0,.35); cursor: move; min-width: 8px; min-height: 8px; }
.gt-crop-box i { position: absolute; width: 12px; height: 12px; border: 2px solid #fff;
  background: var(--site-accent); border-radius: 2px; }
.gt-crop-box i.br { right: -7px; bottom: -7px; cursor: nwse-resize; }
.gt-crop-box i.tl { left: -7px; top: -7px; cursor: nwse-resize; }

.gt-timeline { position: relative; height: 36px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--canvas); overflow: hidden; }
.gt-timeline .gt-tl-range { position: absolute; top: 0; bottom: 0; background: rgba(157, 53, 87, .25);
  border-left: 2px solid var(--site-accent); border-right: 2px solid var(--site-accent); }
.gt-timeline input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%;
  margin: 0; opacity: 0; cursor: ew-resize; }
.gt-timeline .gt-tl-labels { position: absolute; inset: auto 8px 2px; display: flex;
  justify-content: space-between; font: 10px/1 var(--mono); color: var(--muted); pointer-events: none; }

.gt-compare { display: flex; gap: 12px; align-items: baseline; font-variant-numeric: tabular-nums; }
.gt-compare .gt-delta { font-weight: 700; }
.gt-compare .gt-delta.is-good { color: #1a7f37; }
.gt-compare .gt-delta.is-bad { color: var(--warning, #b45309); }

.gt-warn { color: var(--warning, #b45309); font-size: 13px; }
.gt-engine { font-size: 12px; color: var(--muted); }
