/*
 * styles.css — PhotoZip
 *
 * Mobile-first, no build step, no framework. Written for the actual audience:
 * a phone on a slow connection, one-handed, mid-application-form. So: large
 * tap targets (44px minimum), no hover-only affordances, system fonts so there
 * is no webfont round-trip, and a dark header that keeps the tool card as the
 * clear focal point.
 */

/* ------------------------------------------------------------------ *
 * Tokens
 * ------------------------------------------------------------------ */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #0f172a;
  --ink-soft: #4b5563;
  --ink-faint: #6b7280;
  --line: #e3e6ea;
  --line-strong: #cfd4da;
  --brand: #0f766e;
  --brand-dark: #0b5b55;
  --brand-soft: #e6f4f1;
  --accent: #f59e0b;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, .07), 0 1px 3px rgba(15, 23, 42, .05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: break-word;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.25rem; margin-top: 2em; }
p { margin: 0 0 1em; }
a { color: var(--brand-dark); }

.wrap {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}

.nowrap { white-space: nowrap; }

.small { font-size: .875rem; color: var(--ink-faint); }

.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;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  padding: 12px 16px;
  z-index: 10;
}
.skip-link:focus { left: 8px; top: 8px; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ *
 * Header
 * ------------------------------------------------------------------ */

.site-header {
  background: var(--ink);
  color: #fff;
  padding: 14px 0;
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.125rem;
}

.brand__mark { font-size: 1.25rem; }

.site-header__tagline {
  margin: 0;
  font-size: .8125rem;
  color: #cbd5e1;
}

/* Site navigation. On a phone it wraps onto its own row so the tap targets stay
 * at 44px rather than being squeezed to fit beside the brand. */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: auto;
}

.site-nav a {
  color: #e2e8f0;
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.site-nav a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.site-nav a[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, .16); }

@media (max-width: 560px) {
  .site-nav { margin-left: 0; flex-basis: 100%; }
  .site-nav a { padding: 8px 8px; }
}

/* ------------------------------------------------------------------ *
 * Hero
 * ------------------------------------------------------------------ */

.hero { padding: 28px 16px 8px; }

.hero__lede {
  font-size: 1.0625rem;
  color: var(--ink-soft);
  max-width: 62ch;
}

.hero__points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  font-size: .9375rem;
  color: var(--ink-soft);
}

.hero__points li {
  position: relative;
  padding-left: 26px;
}

.hero__points li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--brand);
  font-weight: 700;
}

/* ------------------------------------------------------------------ *
 * Tool card
 * ------------------------------------------------------------------ */

.tool { padding-top: 20px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 18px;
}

.field__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.field__label {
  font-weight: 700;
  font-size: .9375rem;
}

.field__value {
  font-size: .875rem;
  color: var(--ink-faint);
}

.field__value strong { color: var(--brand-dark); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: .9375rem;
  padding: 10px 16px;
  min-height: 44px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}

.chip:hover { border-color: var(--brand); }

.chip.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.custom-target { margin-top: 14px; }

.custom-target__label {
  display: block;
  font-size: .8125rem;
  color: var(--ink-faint);
  margin-bottom: 6px;
}

.custom-target__controls {
  display: flex;
  gap: 8px;
}

.custom-target__controls input,
.custom-target__controls select {
  font: inherit;
  padding: 10px 12px;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
}

.custom-target__controls input { flex: 1 1 auto; min-width: 0; }
.custom-target__controls input.is-invalid { border-color: var(--danger); background: var(--danger-soft); }
.custom-target__controls select { flex: 0 0 auto; }

.range-second {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.range-second label {
  font-size: .8125rem;
  color: var(--ink-faint);
  flex: 1 1 auto;
}

.range-second input {
  font: inherit;
  padding: 10px 12px;
  min-height: 44px;
  width: 96px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
}

.range-second__unit {
  font-size: .8125rem;
  color: var(--ink-faint);
}

.hint {
  margin: 6px 0 0;
  font-size: .8125rem;
  color: var(--ink-faint);
}

.field--sub {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.field--sub .hint { margin-top: 10px; }

.chips--radio .chip {
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: .875rem;
  padding: 8px 14px;
}

/* ------------------------------------------------------------------ *
 * Dropzone
 * ------------------------------------------------------------------ */

.dropzone {
  margin-top: 18px;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  background: #fafbfc;
  padding: 28px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}

.dropzone:hover { border-color: var(--brand); }

.dropzone.is-dragging {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.dropzone__icon {
  font-size: 1.75rem;
  line-height: 1;
  color: var(--brand);
  margin-bottom: 8px;
}

.dropzone__title {
  margin: 0 0 4px;
  font-weight: 600;
}

.dropzone__hint {
  margin: 0;
  font-size: .8125rem;
  color: var(--ink-faint);
}

/* ------------------------------------------------------------------ *
 * Toolbar
 * ------------------------------------------------------------------ */

.notice {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #fff8e6;
  border: 1px solid #f0d9a8;
  font-size: .875rem;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.toolbar__summary {
  margin: 0;
  font-size: .875rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.toolbar__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  appearance: none;
  font: inherit;
  font-weight: 600;
  font-size: .9375rem;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, opacity .12s ease;
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn--primary:hover:not(:disabled) { background: var(--brand-dark); border-color: var(--brand-dark); }

.btn--ghost {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn--ghost:hover:not(:disabled) { border-color: var(--brand); }

.btn.is-busy { opacity: .7; cursor: progress; }

/* ------------------------------------------------------------------ *
 * Results
 * ------------------------------------------------------------------ */

.empty-hint {
  margin: 16px 0 0;
  text-align: center;
  font-size: .875rem;
  color: var(--ink-faint);
}

.results {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.row.is-error { border-color: #f2c9c9; background: var(--danger-soft); }
.row.is-working { border-color: #cfe3df; background: var(--brand-soft); }
/* Amber, not red: the file is valid and correct — it just cannot satisfy a
 * portal minimum because the source lacked the detail. Red would imply the
 * tool failed, and it did not. */
.row.is-warning { border-color: #f0d9a8; background: #fff8e6; }
.row.is-warning .row__meta { color: #7a5a10; }

.row__thumb {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 6px;
  overflow: hidden;
  background: #eef1f4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.row__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.row__body { flex: 1 1 auto; min-width: 0; }

.row__name {
  margin: 0;
  font-size: .875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row__meta {
  margin: 2px 0 0;
  font-size: .8125rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.row.is-error .row__meta { color: var(--danger); }

.row__bar {
  margin-top: 6px;
  height: 3px;
  border-radius: 2px;
  background: #eceff2;
  overflow: hidden;
}

.row__bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--brand);
  transition: width .25s ease;
}

.row__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.row__actions .btn {
  min-height: 40px;
  padding: 8px 14px;
  font-size: .875rem;
}

.row__actions .btn--remove {
  padding: 8px 10px;
  color: var(--ink-faint);
  line-height: 1;
}

.row__actions .btn--remove:hover:not(:disabled) { color: var(--danger); border-color: var(--danger); }

/* ------------------------------------------------------------------ *
 * Options
 * ------------------------------------------------------------------ */

.options {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-size: .875rem;
}

.options summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-soft);
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
  cursor: pointer;
}

.checkbox input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  flex: 0 0 auto;
  accent-color: var(--brand);
}

.privacy-note {
  margin: 14px 0 0;
  padding: 12px 14px;
  font-size: .8125rem;
  color: var(--ink-soft);
  background: var(--brand-soft);
  border-radius: var(--radius-sm);
}

/* ------------------------------------------------------------------ *
 * Ad slots
 *
 * Reserved and labelled from the start: collapsing them in after approval
 * costs a layout shift on the exact pages that are already ranking. Keep the
 * min-height, or set it to the real unit height once ads are live.
 * ------------------------------------------------------------------ */

/*
 * Ad slots.
 *
 * Ezoic's own guidance is explicit that the ad slot element itself must NOT
 * carry reserved spacing: their AI needs freedom to test sizes and pick the
 * highest-paying creative, and a fixed height on the slot works against that.
 * (See "Handling Layout Shifting (CLS)" in their JavaScript integration guide.)
 *
 * So the two concerns are split deliberately:
 *   .ad-slot            the injection target — no sizing, no styling
 *   .ad-slot__reserve   an outer wrapper that holds space for CLS only
 *
 * The slot carries no min-height at all. The wrapper is what stops the page
 * jumping when an ad arrives, and it is safe to keep fixed because it sits
 * outside whatever Ezoic injects.
 */
.ad-slot {
  margin: 0;
  /* No min-height, no display rule: the injected markup owns this element. */
}

.ad-slot__reserve {
  margin: 20px auto;
}

/* Reserved space, opt-in per slot via a modifier.
 *
 * Ezoic does not reserve space itself with placement-ID integration, and an ad
 * arriving into a zero-height box is what produces a layout shift bad enough to
 * hurt Core Web Vitals scores. Pick the height that matches the tallest creative
 * you actually see in the dashboard for this location, not a guess.
 */
.ad-slot__reserve--banner { min-height: 100px; }   /* mobile leaderboard */
.ad-slot__reserve--rect { min-height: 250px; }     /* 300x250 rectangle  */

/* Development-only placeholder. Opt-in rather than :empty-based: an injected ad
 * iframe is also "empty" until it fills, so :empty cannot distinguish "no ad
 * code yet" from "ad code that has not filled yet". Remove this class — and the
 * rule — before going live, or it will render a grey box behind a real ad. */
.ad-slot--reserved::before {
  content: "Ad space";
  display: inline-block;
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #b6bcc4;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
}

.ad-slot--reserved {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
}

/* ------------------------------------------------------------------ *
 * Prose
 * ------------------------------------------------------------------ */

.prose { padding-bottom: 24px; }

.prose h3 { font-size: 1.0625rem; margin-top: 1.6em; }

.lede {
  font-size: 1.0625rem;
  color: var(--ink-soft);
}

.contact-cta { margin: 24px 0; }

/* Byline. Small and quiet, but present and dated: an undated how-to page on a
 * topic where formats change is a liability, and a named author is a stated
 * requirement for the content pages here. */
.byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: -4px 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  font-size: .8125rem;
  color: var(--ink-faint);
}

.byline__sep { color: var(--line-strong); }

/* A callout that must not be skimmed past. Used for the "these numbers change,
 * go and check your own notification" warning, which is the single most
 * important thing on the size guide. */
.callout {
  margin: 20px 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
}

.callout p:last-child { margin-bottom: 0; }

.callout--warn {
  border-color: #f0d9a8;
  background: #fff8e6;
  border-left: 4px solid var(--accent);
}

/* A quoted specification block, standing in for the wording a notification
 * actually uses. Monospace and scrollable so it does not force the page wide
 * on a phone. */
.spec-sample {
  margin: 16px 0;
  padding: 14px 16px;
  background: #eef1f4;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: .8125rem;
  line-height: 1.7;
}

.spec-sample code {
  background: none;
  padding: 0;
  font-size: inherit;
  white-space: pre;
}

.contact-note {
  margin-top: 32px;
  padding: 14px 16px;
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.steps { padding-left: 1.2em; }
.steps li { margin-bottom: .5em; }

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.specs {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  margin: 0 0 1em;
}

.specs th, .specs td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.specs thead th {
  background: #eef1f4;
  font-size: .8125rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-soft);
}

.faq {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
}

.faq p { margin: 10px 0 0; color: var(--ink-soft); }

/* ------------------------------------------------------------------ *
 * Footer
 * ------------------------------------------------------------------ */

.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 20px 0 32px;
  font-size: .875rem;
  color: var(--ink-soft);
}

.site-footer p { margin: 0 0 8px; }

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0 0 12px;
}

.site-footer__nav a { color: var(--brand-dark); }

/* A printable/spec-table helper used by the size guide. */
.specs code {
  font-size: .8125rem;
  background: #eef1f4;
  padding: 1px 5px;
  border-radius: 4px;
}

/* ------------------------------------------------------------------ *
 * Wider screens
 * ------------------------------------------------------------------ */

@media (min-width: 640px) {
  h1 { font-size: 2rem; }
  .card { padding: 24px; }
  .hero { padding-top: 40px; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --surface: #131b2b;
    --ink: #e8edf5;
    --ink-soft: #b3bdcb;
    --ink-faint: #8d99a8;
    --line: #24304a;
    --line-strong: #33415c;
    --brand: #2dd4bf;
    --brand-dark: #5eead4;
    --brand-soft: #122a2c;
    --danger: #fca5a5;
    --danger-soft: #2a1618;
  }

  .site-header { background: #060b14; }
  .chip, .btn--ghost, .custom-target__controls input, .custom-target__controls select,
  .range-second input,
  .row, .faq, .site-footer { background: var(--surface); }
  .dropzone { background: #101827; }
  .chip.is-active { color: #05201d; }
  .btn--primary { color: #05201d; }
  .specs thead th { background: #1a2438; }
  .row__bar { background: #24304a; }
  .row.is-warning { background: #2a2416; border-color: #4d3f1d; }
  .row.is-warning .row__meta { color: #e8c98a; }
  .row__thumb { background: #1a2438; }
  .notice { background: #2a2416; border-color: #4d3f1d; }
  .callout { background: var(--surface); border-color: var(--line); }
  .callout--warn { background: #2a2416; border-color: #4d3f1d; border-left-color: var(--accent); }
  .spec-sample { background: #1a2438; border-color: var(--line); }
}

@media print {
  .ad-slot, .tool, .site-header, .site-footer { display: none; }
}
