/* =====================================================================
   Picrezo - shared styles for every page
   Colors are defined once at the top; dark mode swaps them automatically.
   ===================================================================== */

/* ---- BLOCK 1: Colors and basic settings (light mode) ---- */
:root {
  --bg: #ffffff;
  --bg-soft: #f4f6fb;
  --text: #1b2130;
  --muted: #5b6475;
  --line: #dde2ee;
  --brand: #3b5bdb;
  --brand-dark: #2f49b0;
  --on-brand: #ffffff;
  --error: #b42318;
  --radius: 14px;
}

/* ---- BLOCK 2: Dark mode colors (used if the visitor's device is in dark mode) ---- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151d;
    --bg-soft: #1b2030;
    --text: #e8ebf3;
    --muted: #a3acc0;
    --line: #2d3550;
    --brand: #7f9bff;
    --brand-dark: #a5b9ff;
    --on-brand: #10131c;
    --error: #ff8a80;
  }
}

/* ---- BLOCK 3: Page basics ---- */
* { box-sizing: border-box; }
/* Anything marked "hidden" must really disappear, even if another style sets its display. */
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--brand); }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
h1 { font-size: 1.9rem; line-height: 1.2; margin: 1.5rem 0 0.5rem; }
h2 { font-size: 1.3rem; margin: 2.2rem 0 0.6rem; }
p { margin: 0.6rem 0; }
.lead { color: var(--muted); font-size: 1.05rem; }

/* ---- BLOCK 4: Top bar and footer ---- */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; }
.logo { font-weight: 700; font-size: 1.2rem; text-decoration: none; color: var(--text); }
.site-footer { border-top: 1px solid var(--line); margin-top: 3rem; padding: 1.5rem 0 2.5rem; color: var(--muted); font-size: 0.9rem; }
.site-footer a { margin-right: 14px; }

/* ---- BLOCK 5: The drop area where photos are added ---- */
.dropzone {
  display: block;
  border: 2px dashed var(--brand);
  border-radius: var(--radius);
  background: var(--bg-soft);
  padding: 2.2rem 1rem;
  text-align: center;
  cursor: pointer;
}
.dropzone.is-over { background: var(--line); }
.dropzone strong { display: block; font-size: 1.15rem; }
.dropzone span { color: var(--muted); font-size: 0.95rem; }
.dropzone:focus-within { outline: 3px solid var(--brand); outline-offset: 2px; }
/* The real file input is hidden but still works with the keyboard. */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- BLOCK 6: Quality slider ---- */
.options { display: flex; align-items: center; gap: 12px; margin: 1rem 0; flex-wrap: wrap; }
.options input[type=range] { flex: 1; min-width: 160px; }

/* ---- BLOCK 7: Buttons ---- */
.button {
  display: inline-block;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: var(--on-brand);
  font: inherit;
  font-weight: 600;
  padding: 0.65rem 1.1rem;
  cursor: pointer;
  text-decoration: none;
}
.button:hover { background: var(--brand-dark); }
.button.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); }
.button.small { padding: 0.3rem 0.8rem; font-size: 0.9rem; }
.button:disabled { opacity: 0.6; cursor: wait; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 1rem 0; }

/* ---- BLOCK 8: The list of files being converted ---- */
.file-list { list-style: none; margin: 1rem 0 0; padding: 0; }
.file-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-status { color: var(--muted); font-size: 0.9rem; }
.file-row.has-error .file-status { color: var(--error); }

/* ---- BLOCK 9: Messages, FAQ and tool cards on the home page ---- */
.notice { border: 1px solid var(--error); color: var(--error); border-radius: 10px; padding: 0.7rem 1rem; margin: 1rem 0; }
details { border-bottom: 1px solid var(--line); padding: 0.7rem 0; }
summary { cursor: pointer; font-weight: 600; }
.cards { display: grid; gap: 12px; margin-top: 1rem; }
.card { display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; text-decoration: none; color: var(--text); background: var(--bg-soft); }
.card strong { display: block; }
.card span { color: var(--muted); font-size: 0.95rem; }

/* ---- BLOCK 9b: Settings box on the compress pages (radio buttons, number boxes, drop-down) ---- */
.options-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.4rem 1rem 0.6rem; margin: 1rem 0; }
.options-box legend { padding: 0 0.4rem; font-weight: 600; }
.options-box .options { margin: 0.6rem 0; }
.options-box label { display: inline-flex; align-items: center; gap: 6px; }
.options-box input[type=number], .options-box select {
  font: inherit;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}
.options-box input[type=number] { width: 7rem; }
.hint { color: var(--muted); font-size: 0.9rem; margin: 0.2rem 0 0.4rem; }

/* ---- BLOCK 10: Small screens (phones) ---- */
@media (max-width: 520px) {
  h1 { font-size: 1.55rem; }
  .file-row { grid-template-columns: 1fr auto; }
  .file-status { grid-column: 1; }
  .file-row .button { grid-row: 1 / span 2; grid-column: 2; }
}
