/* PDF tools (/tools/merge-pdf/, split-pdf, jpg-to-pdf and their /ko/ pages).
   Loaded after /tools/shared/audio-task.css, which supplies the page shell, tool card,
   buttons, lists, messages and article styles; this file only adds what those don't cover. */

/* Korean pages: Hangul falls through Plus Jakarta Sans to Noto Sans KR; keep words whole. */
html[lang="ko"] body.home-clean {
  font-family: 'Plus Jakarta Sans', 'Noto Sans KR', system-ui, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  word-break: keep-all;
  overflow-wrap: break-word;
}
html[lang="ko"] .at-hero h1 { letter-spacing: -0.02em; }

/* Text inputs (range field) */
.pdf-task .at-tool input[type="text"] {
  font: inherit; font-size: 16px; font-weight: 600; color: var(--et-ink); background: #fff;
  border: 1.5px solid #E2D9F5; border-radius: 10px; padding: 9px 12px; min-height: 44px;
  width: 100%; min-width: 0;
}
.pdf-task .at-tool input[aria-invalid="true"] { border-color: #C2352B; }
.pdf-task .at-tool input:focus-visible { outline: 3px solid rgba(130, 87, 230, .45); outline-offset: 2px; }
.pdf-task .at-tool fieldset + fieldset, .pdf-task .pt-box + fieldset, .pdf-task fieldset + .pt-box { margin-top: 16px; }
.pdf-task .at-field small { line-height: 1.5; }

/* Thumbnail in a file/image list row */
.at-item-thumb {
  width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: #fff;
  border: 1px solid #EEE7FA; display: block;
}
.at-item-lead { display: flex; align-items: center; gap: 10px; }
.at-item-lead > div { min-width: 0; }

/* Merge: page grid ------------------------------------------------------------------ */
.pt-pages {
  list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  gap: 10px; margin: 14px 0 0; padding: 0;
}
.pt-page {
  --file-color: var(--et-purple);
  position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0;
  background: #FBF9FF; border: 1px solid #EEE7FA; border-top: 4px solid var(--file-color);
  border-radius: 14px; padding: 8px;
}
.pt-page.is-dragging { opacity: .55; border-style: dashed; }
.pt-page.is-drop-target { box-shadow: 0 0 0 3px rgba(130, 87, 230, .4); }
.pt-thumb {
  position: relative; aspect-ratio: 1 / 1; display: grid; place-items: center; border-radius: 10px;
  background: #F4F0FB; overflow: hidden; min-width: 0;
}
/* Absolutely centred so max-height resolves against the square box (and a 90° turn still fits). */
.pt-thumb img {
  position: absolute; inset: 0; margin: auto; max-width: 92%; max-height: 92%; width: auto; height: auto;
  display: block; background: #fff; box-shadow: 0 2px 8px rgba(31, 23, 51, .14); transition: transform .18s ease;
}
.pt-thumb-ph {
  width: 64%; aspect-ratio: 1 / 1.414; background: #fff; border-radius: 4px; display: grid; place-items: center;
  color: #B3A6D6; font-weight: 800; font-size: 1.4rem; box-shadow: 0 2px 8px rgba(31, 23, 51, .1);
  transition: transform .18s ease;
}
.pt-page-info { display: flex; align-items: baseline; gap: 6px; min-width: 0; font-size: 12.5px; color: var(--et-mute); }
.pt-page-info strong { color: var(--et-ink); font-size: 14px; font-variant-numeric: tabular-nums; }
.pt-page-info span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pt-page-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.pt-page-actions .at-icon-btn { width: 34px; height: 34px; border-radius: 10px; font-size: .95rem; }
.pt-page-actions .at-grip { cursor: grab; touch-action: none; }

/* File colour key (merge) */
.at-item[data-color] { border-left: 5px solid var(--file-color, var(--et-purple)); }
.pt-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--file-color); margin-right: 6px; vertical-align: 0; }

/* Split: plan summary --------------------------------------------------------------- */
.pt-box { margin-top: 14px; }
.pdf-task .pt-box fieldset { margin-top: 16px; }
.pt-plan {
  margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: #FBF9FF; border: 1px solid #EEE7FA;
  font-size: 14.5px; line-height: 1.55;
}
.pt-plan ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; padding: 0; }
.pt-plan li {
  font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; padding: 3px 9px; border-radius: 999px;
  background: #fff; border: 1px solid #E7E1F4; color: var(--et-purple-dark); overflow-wrap: anywhere;
}

/* JPG to PDF: settings + preview ---------------------------------------------------- */
.pt-setup { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 18px 24px; align-items: start; }
@media (max-width: 620px) { .pt-setup { grid-template-columns: minmax(0, 1fr); } }
.pt-preview { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pt-preview-stage { width: 180px; height: 180px; display: grid; place-items: center; background: #F4F0FB; border-radius: 14px; }
.pt-sheet { position: relative; background: #fff; box-shadow: 0 4px 14px rgba(31, 23, 51, .16); border-radius: 2px; }
.pt-sheet img { position: absolute; display: block; object-fit: fill; }
.pt-preview figcaption { font-size: 12.5px; color: var(--et-mute); text-align: center; font-variant-numeric: tabular-nums; }
.pdf-task .at-seg + .at-unit { display: block; margin-top: 6px; }
.pdf-task fieldset[disabled] { opacity: .5; }

/* License line under the article */
.pt-credits { font-size: 13px; color: var(--et-mute); margin-top: 14px; }

@media (prefers-reduced-motion: reduce) {
  .pt-thumb img, .pt-thumb-ph { transition: none !important; }
}
