/* ═══════════════════════════════════════════════════════════
   Compress PDF & Image Compressor Online — page styles
   Matches the site's blue theme (top bar #1a237e → #1565c0)
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg:          #eaf2fb;
  --surface:     #ffffff;
  --sunken:      #f2f6fc;
  --ink:         #111827;
  --ink-soft:    #374151;
  --ink-faint:   #6b7280;
  --line:        #dbe4f0;
  --line-strong: #b9c8dd;
  --blue:        #1a73e8;
  --blue-dark:   #1251aa;
  --navy:        #1a237e;
  --green:       #15803d;
  --green-soft:  #e8f6ee;
  --red:         #b91c1c;
  --red-soft:    #fdecea;
  --amber-soft:  #fff7e6;
  --radius:      10px;
  --radius-lg:   14px;
  --shadow:      0 1px 0 rgba(17,24,39,.04), 0 8px 24px rgba(17,24,39,.08);
}

/* ── Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6; font-size: 15px;
}
a { color: #1d4ed8; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2.5px solid var(--blue); outline-offset: 2px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.noscript-banner { background: var(--red); color: #fff; text-align: center; padding: 12px 16px; font-weight: 600; }

/* ── Header / nav — same as homepage (style.css) ──────────── */
.top-domain-bar {
  width: 100%;
  text-align: center;
  padding: 6px 0 8px;
  background: rgba(80, 87, 118, 0.05);
  border-bottom: 1px solid #ddd;
}
.domain-home-link {
  font-size: 24px;
  font-weight: 600;
  color: #1e88e5;
  text-decoration: none;
  transition: color 0.2s ease;
}
.domain-home-link:hover { color: #0d47a1; }
.domain-home-link img { vertical-align: middle; margin-right: 8px; }
.site-nav {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 16px;
  background: linear-gradient(135deg, #1a237e 0%, #1565c0 100%);
  border-bottom: 2px solid #0d47a1;
  box-shadow: 0 2px 6px rgba(21, 101, 192, 0.25);
}
.site-nav a {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  padding: 6px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  white-space: nowrap;
}
.site-nav a:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.7);
  transform: translateY(-1px);
}

/* ── Layout ───────────────────────────────────────────────── */
.page-wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px 40px; }
h1 { font-size: 1.55rem; line-height: 1.25; margin: 22px 0 10px; }
.para { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 22px 24px; margin: 22px 0; }
/* ── Quick answer box ─────────────────────────────────────── */
.quick-answer { background: var(--surface); border: 1px solid #1a73e8; border-left-width: 5px; border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 18px 22px; margin: 22px 0; }
.qa-title { margin: 0 0 4px; font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #1a73e8; }
.qa-lead { margin: 0 0 10px; font-size: 15px; font-weight: 600; color: var(--ink); }
.qa-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.qa-checks li { font-size: 14px; color: var(--ink-soft); padding-left: 22px; position: relative; }
.qa-checks li::before { content: "✔"; position: absolute; left: 0; color: #1e8e3e; font-weight: 700; }
@media (min-width: 640px) { .qa-checks { grid-template-columns: 1fr 1fr; } }
.para h2, .questions h2 { font-size: 18px; font-weight: 700; margin: 0 0 10px; line-height: 1.3; }
.para h3 { font-size: 15px; font-weight: 700; margin: 0 0 6px; }
.para p, .how-to-list li, .content-list li { font-size: 14.5px; color: var(--ink-soft); }
.para p strong, .how-to-list strong, .content-list strong { color: var(--ink); }
.intro-wrap { padding: 18px 22px; }
.intro-lead { margin: 0; font-size: 15.5px; }
.how-to-list { margin: 10px 0 0; padding-left: 22px; display: grid; gap: 10px; }
.content-list { margin: 10px 0 0; padding-left: 22px; display: grid; gap: 8px; }
.inline-link { color: #1d4ed8; text-decoration: none; font-weight: 600; }
.inline-link:hover { text-decoration: underline; }

/* ── Tool shell ───────────────────────────────────────────── */
.tool-shell {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 20px; margin: 18px 0;
}

.drop-zone {
  border: 2px dashed var(--line-strong); border-radius: var(--radius-lg);
  background: var(--sunken); padding: 30px 20px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.drop-zone-inner { max-width: 640px; margin: 0 auto; }
.drop-zone:hover, .drop-zone.is-dragover { border-color: var(--blue); background: #e8f0fe; }
.drop-icon { font-size: 1.9rem; color: var(--blue); display: block; }
.drop-title { font-weight: 700; font-size: 1.06rem; margin: 8px 0 4px; }
.drop-sub { color: var(--ink-faint); font-size: .88rem; margin: 0 0 14px; }
.btn-choose {
  display: inline-block; background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #fff; font-weight: 700; padding: 10px 22px; border-radius: 24px; font-size: .92rem;
}
.load-error { background: var(--red-soft); color: var(--red); border-radius: var(--radius); padding: 10px 14px; font-weight: 600; margin: 12px 0 0; }

/* ── Global controls ──────────────────────────────────────── */
.workbench { margin-top: 18px; }
.global-controls { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; background: var(--sunken); }
.control-block { margin-bottom: 16px; }
.control-label {
  display: block; font-size: .78rem; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 8px;
}
.control-hint { font-size: .82rem; color: var(--ink-faint); margin: 8px 0 0; }

.level-buttons { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.level-btn {
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--radius);
  padding: 10px 12px; cursor: pointer; text-align: left; font-family: inherit;
  display: grid; gap: 2px; transition: border-color .12s, box-shadow .12s;
}
.level-btn strong { font-size: .95rem; }
.level-btn small { color: var(--ink-faint); font-size: .76rem; }
.level-btn:hover { border-color: var(--blue); }
.level-btn.is-active {
  border-color: var(--blue-dark);
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  box-shadow: 0 4px 12px rgba(26,115,232,.35);
}
.level-btn.is-active strong { color: #fff; }
.level-btn.is-active small { color: #dbeafe; }

.manual-row { margin-top: 12px; }
.target-size-group {
  display: inline-flex; align-items: center; gap: 0;
  border: 1.5px solid var(--blue); border-radius: 10px; overflow: hidden; background: var(--surface);
}
.target-size-group label {
  font-weight: 700; font-size: .9rem; padding: 9px 14px;
  background: #eef4fe; color: var(--blue-dark); border-right: 1.5px solid var(--blue);
}
.target-size-group input {
  width: 90px; padding: 9px 10px; border: none; font-size: 1.05rem; font-weight: 700;
  font-family: inherit; text-align: center; outline-offset: -2px;
}
.target-size-group .target-unit {
  font-size: .85rem; font-weight: 700; color: var(--ink-faint);
  padding: 9px 14px; background: var(--sunken); border-left: 1px solid var(--line);
}
.manual-row .control-hint { margin-top: 8px; }

.format-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.format-btn {
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 20px;
  padding: 8px 16px; cursor: pointer; font-weight: 700; font-size: .88rem; font-family: inherit;
  transition: border-color .12s, background .12s;
}
.format-btn:hover { border-color: var(--blue); }
.format-btn.is-active {
  border-color: var(--blue-dark);
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #fff;
  box-shadow: 0 3px 10px rgba(26,115,232,.35);
}

.global-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-primary {
  font-family: inherit; font-weight: 700; font-size: .95rem; border-radius: 24px;
  padding: 11px 24px; cursor: pointer; border: none;
}
.btn-primary { background: linear-gradient(135deg, var(--blue), var(--blue-dark)); color: #fff; box-shadow: 0 4px 14px rgba(26,115,232,.35); }
.btn-primary:hover { background: linear-gradient(135deg, #1557b0, #0d3f8a); }
.btn-primary:disabled { opacity: .55; cursor: default; }
#compress-all-btn { background: linear-gradient(135deg, #f5576c, #ff8a00); box-shadow: 0 4px 14px rgba(245,87,108,.4); }
#compress-all-btn:hover { background: linear-gradient(135deg, #e0455a, #f07c00); box-shadow: 0 6px 18px rgba(245,87,108,.5); }
.busy-note { margin: 10px 0 0; font-size: .88rem; color: var(--blue-dark); font-weight: 600; }

/* ── File list ────────────────────────────────────────────── */
.file-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; }
.file-row {
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface);
  padding: 12px 14px; display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center;
}
.file-thumb {
  width: 56px; height: 56px; border-radius: 8px; object-fit: cover;
  border: 1px solid var(--line); background: var(--sunken);
}
.file-thumb--pdf {
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--red); font-size: .8rem; letter-spacing: .04em;
}
.file-meta { min-width: 0; }
.file-name { font-weight: 700; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-orig { color: var(--ink-faint); font-size: .8rem; }
.size-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.size-chip {
  font-size: .74rem; font-weight: 700; border-radius: 12px; padding: 3px 10px;
  background: var(--sunken); border: 1px solid var(--line); color: var(--ink-soft);
}
.size-chip.is-active { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.size-chip--pending { color: var(--ink-faint); font-style: italic; }
.file-result { margin-top: 6px; font-size: .84rem; font-weight: 700; }
.file-result .saved { color: var(--green); }
.file-result .grew { color: var(--red); }
.file-note { font-size: .76rem; color: var(--ink-faint); margin-top: 2px; }
.out-format { display: inline-block; background: #1a73e8; color: #fff; font-size: .68rem; font-weight: 700; padding: 1px 7px; border-radius: 10px; vertical-align: 1px; }
.file-actions { display: grid; gap: 6px; justify-items: stretch; }
.btn-download {
  background: linear-gradient(135deg, #22c55e, #15803d); color: #fff; border: none;
  border-radius: 22px; font-family: inherit; font-weight: 800; font-size: .9rem;
  padding: 10px 20px; cursor: pointer; letter-spacing: .01em;
  box-shadow: 0 3px 12px rgba(21,128,61,.35);
  transition: box-shadow .12s, transform .12s;
}
.btn-download:hover:not(:disabled) { box-shadow: 0 5px 16px rgba(21,128,61,.5); transform: translateY(-1px); }
.btn-download:disabled { background: var(--line-strong); box-shadow: none; cursor: default; }
.btn-remove {
  background: linear-gradient(135deg, #ef4444, #b91c1c); color: #fff; border: none;
  border-radius: 18px; font-family: inherit; font-weight: 700; font-size: .8rem;
  padding: 7px 14px; cursor: pointer; box-shadow: 0 2px 8px rgba(185,28,28,.3);
  transition: box-shadow .12s, transform .12s;
}
.btn-remove:hover { box-shadow: 0 4px 12px rgba(185,28,28,.45); transform: translateY(-1px); }

/* ── Level explainer grid ─────────────────────────────────── */
.level-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; margin-top: 8px; }
.level-cell { background: var(--sunken); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.level-cell h3 { color: var(--blue-dark); }
.level-cell p { font-size: .88rem; margin: 0; }

/* ── Size table ───────────────────────────────────────────── */
.size-table-wrap { margin-top: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); }
.size-table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 320px; }
.size-table th, .size-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.size-table thead th { background: var(--navy); color: #fff; font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; }
.size-table tbody tr:nth-child(even) { background: var(--sunken); }
.size-table tbody tr:last-child th, .size-table tbody tr:last-child td { border-bottom: none; }
.size-table tbody th { font-weight: 600; color: var(--ink-soft); }
.size-table td { white-space: nowrap; font-weight: 700; }
.table-note { font-size: .8rem; color: var(--ink-faint); margin: 10px 0 0; }

/* ── Hero image ───────────────────────────────────────────── */
.hero-image-wrap { margin: 22px 0; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.hero-image { display: block; width: 100%; height: auto; aspect-ratio: 1200/630; object-fit: cover; background: var(--sunken); }

/* ── FAQ ──────────────────────────────────────────────────── */
.questions { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 22px 24px; margin: 22px 0; }
.questions dl { margin: 0; }
.questions dt { font-size: 14px; font-weight: 700; margin-top: 14px; }
.questions dt:first-of-type { margin-top: 0; }
.questions dd { font-size: 13.5px; color: var(--ink-soft); line-height: 1.7; margin: 4px 0 0; }

/* ── Author / footer ──────────────────────────────────────── */
.author-line { font-size: .85rem; color: var(--ink-faint); margin: 18px 0 8px; }
.author-link { color: var(--blue); text-decoration: none; }
.author-link:hover { text-decoration: underline; }
.author-label { text-transform: uppercase; letter-spacing: .05em; font-size: .72rem; font-weight: 800; }
.site-footer { background: #10193f; color: #cdd6ea; margin-top: 30px; }
.footer-inner { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 12px; }
.footer-links a { color: #9db4e0; text-decoration: none; font-weight: 600; font-size: .88rem; }
.footer-links a:hover { text-decoration: underline; color: #fff; }
.footer-inner p { font-size: .84rem; margin: 0; }
.footer-inner .inline-link { color: #9db4e0; }

/* ── Motion preference ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ── Breakpoints ──────────────────────────────────────────── */
@media (max-width: 375px) {
  .domain-home-link { font-size: 16px; }
  .site-nav { gap: 5px; padding: 6px 8px; }
  .site-nav a { font-size: 11px; padding: 5px 10px; }
}
@media (min-width: 376px) and (max-width: 413px) {
  .domain-home-link { font-size: 18px; }
  .site-nav { gap: 6px; padding: 6px 10px; }
  .site-nav a { font-size: 12px; padding: 5px 12px; }
}
@media (min-width: 414px) and (max-width: 599px) {
  .domain-home-link { font-size: 20px; }
  .site-nav { gap: 6px; padding: 7px 10px; }
  .site-nav a { font-size: 12px; padding: 5px 13px; }
}
@media (min-width: 600px) and (max-width: 899px) {
  .site-nav a { font-size: 13px; padding: 6px 16px; }
}
@media (min-width: 900px) {
  .site-nav a { font-size: 14px; padding: 7px 22px; }
}
@media (max-width: 820px) {
  .level-buttons { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 640px) {
  h1 { font-size: 1.3rem; }
  .para, .questions { padding: 18px 16px; }
  .tool-shell { padding: 12px; }
  .drop-zone { padding: 24px 14px; }
  .global-controls { padding: 12px; }
  .level-btn { padding: 12px; min-height: 44px; }
  .format-btn { min-height: 42px; }
  .target-size-group { display: flex; width: 100%; }
  .target-size-group input { flex: 1 1 auto; min-width: 0; }
  .level-grid { grid-template-columns: 1fr; }
  .file-row { grid-template-columns: 44px 1fr; }
  .file-thumb { width: 44px; height: 44px; }
  .file-actions { grid-column: 1 / -1; grid-template-columns: 1fr auto; }
  .btn-download { padding: 12px 20px; }
  .size-chips { gap: 5px; }
  .size-chip { font-size: .72rem; padding: 4px 9px; }
  .global-actions .btn-primary { width: 100%; padding: 14px 24px; font-size: 1.02rem; }
}
@media (max-width: 420px) {
  .level-buttons { grid-template-columns: 1fr; }
  .level-btn { display: flex; align-items: baseline; gap: 8px; }
  .format-buttons { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .format-btn { padding: 10px 8px; font-size: .82rem; text-align: center; }
  .file-actions { grid-template-columns: 1fr 1fr; }
  .btn-remove { padding: 12px 14px; }
}
