/*
 * theme.css — Frontline Victoria Group of Creators.
 * Brutalist incident-board / terminal mood: sharp corners, hard offset
 * shadows, condensed display face, mono timestamps. Opens dark (a console
 * a spotter trusts at 2am); a cream/ink light mode sits under
 * html[data-theme="light"].
 *
 * Division signal colours reuse the six categorical chart tokens:
 * chart-1 = media (blue), chart-2 = transport (gold), chart-3 = alerts (red).
 */

:root {
  color-scheme: dark;

  --canvas: #12151a;
  --surface: #2a2c31;
  --surface-2: #1c1f25;
  --border: #383b42;
  --border-strong: #6a6d75;
  --ink: #f2efe9;
  --muted: #989896;

  --accent: #e8590c;
  --accent-hover: #ff6b1f;
  --accent-ink: #12151a;
  --accent-text: #ec7231;
  --accent-soft: #3a2415;
  --accent-strong: #ec7231;
  --accent-border: #6b3a1c;

  --success: #2f9e57;
  --success-ink: #0c1410;
  --success-soft: #163322;
  --success-strong: #5fcf8a;

  --warning: #d69b1f;
  --warning-ink: #171205;
  --warning-soft: #3a2c0c;
  --warning-strong: #eec565;

  --danger: #d1453b;
  --danger-ink: #180706;
  --danger-soft: #3a1414;
  --danger-strong: #f08a82;

  --chart-1: #4d8fe8;
  --chart-2: #d4a017;
  --chart-3: #e2483a;
  --chart-4: #8b6fd9;
  --chart-5: #2fb6c4;
  --chart-6: #d9698f;

  --font-display: "Barlow Condensed", ui-sans-serif, sans-serif;
  --font-body: "Inter", ui-sans-serif, sans-serif;
  --font-sans: "Inter", ui-sans-serif, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --display-weight: 700;
  --display-tracking: -0.01em;
  --eyebrow-tracking: 0.08em;

  --radius-btn: 0px;
  --radius-card: 0px;
  --radius-input: 0px;
  --border-w: 2px;
  --border-strong-w: 2px;
  --shadow-card: 6px 6px 0 0 var(--border-strong);
  --shadow-raised: 8px 8px 0 0 var(--border-strong);
  --shadow-btn: 4px 4px 0 0 var(--border-strong);
  --card-pad: 1.25rem;
  --caps: uppercase;
  --caps-tracking: 0.04em;
  --btn-weight: 700;
  --measure: 68ch;
}

html[data-theme="light"] {
  color-scheme: light;

  --canvas: #f2efe9;
  --surface: #ffffff;
  --surface-2: #e9e4da;
  --border: #d9d3c7;
  --border-strong: #12151a;
  --ink: #12151a;
  --muted: #5b5d61;

  --accent: #c94a0a;
  --accent-hover: #a63e08;
  --accent-ink: #ffffff;
  --accent-text: #b8440a;
  --accent-soft: #f6dfce;
  --accent-strong: #9c3c08;
  --accent-border: #e3b28c;

  --success: #1f7a3c;
  --success-ink: #ffffff;
  --success-soft: #dcefe1;
  --success-strong: #1f7a3c;

  --warning: #a06a00;
  --warning-ink: #ffffff;
  --warning-soft: #f3e6c8;
  --warning-strong: #8a5900;

  --danger: #b3261e;
  --danger-ink: #ffffff;
  --danger-soft: #f6dcda;
  --danger-strong: #9c211a;

  --chart-1: #1d5fc4;
  --chart-2: #a67c00;
  --chart-3: #c0392b;
  --chart-4: #6a4fb5;
  --chart-5: #157c88;
  --chart-6: #b3466a;
}

/*
 * app.css — Frontline Victoria Group of Creators. The one screen this app
 * owns: the incident-board album grid, the hold-to-confirm delete control,
 * the upload dropzone and the always-dark bands. Tokens only.
 */

/* ---- Fonts on the shell -------------------------------------------------- */
.font-display, h1, h2, h3 { font-family: var(--font-display); }
body { font-family: var(--font-body); }

/* ---- The bottom tab bar keeps content clear on a phone -------------------- */
@media (width < 48rem) {
  body { padding-bottom: 4rem; }
}

/* ---- A band that is always the darkest tone on the page -------------------
   Dark mode: the canvas is already the darkest surface, so the band sits
   flush with the page — the scale of its type is what sets it apart.
   Light mode: it flips to the ink tone, so it reads as a deliberate dark
   statement against an otherwise light page. */
.dark-band { background-color: var(--canvas); color: var(--ink); }
html[data-theme="light"] .dark-band { background-color: var(--ink); color: var(--canvas); }
/* Headings inside a dark band must never pin an explicit ink/canvas colour of
   their own — that fights the band's own flip and can land text and ground
   on the same value. They read currentColor, inherited from .dark-band. */
.dark-band h1, .dark-band h2, .dark-band h3, .dark-band p, .dark-band span { color: inherit; }

/* ---- Breadcrumb ------------------------------------------------------------ */
.crumb { color: var(--muted); padding: 0.25rem 0.125rem; transition: color 150ms; }
.crumb:hover { color: var(--ink); text-decoration: none; }
.crumb-current { color: var(--ink); font-weight: 700; }

/* ---- Album / photo tiles ---------------------------------------------------
   Sharp corners, a thick ink outline, a hard offset shadow — the incident
   board's own unit. */
.album-tile { box-shadow: var(--shadow-card); transition: transform 150ms var(--ease, ease), box-shadow 150ms var(--ease, ease); }
a.album-tile:hover, a.album-tile:focus-visible { transform: translate(-2px, -2px); box-shadow: 9px 9px 0 0 var(--border-strong); }

/* ---- Division panels: sized by real activity, coloured by signal ----------- */
.division-panel[data-division="media"] { --panel-accent: var(--chart-1); }
.division-panel[data-division="transport"] { --panel-accent: var(--chart-2); }
.division-panel[data-division="alerts"] { --panel-accent: var(--chart-3); }
.division-panel { box-shadow: var(--shadow-card); background: var(--surface); transition: transform 150ms, box-shadow 150ms; }
.division-panel:hover, .division-panel:focus-visible { transform: translate(-2px, -2px); box-shadow: 9px 9px 0 0 var(--panel-accent); text-decoration: none; }

/* ---- Motion: the ONE grid that matters staggers its children in the first
   time it enters view; nothing else on the page moves. Rests fully VISIBLE —
   a visitor whose script failed, or a capture taken before app.js runs, sees
   the finished layout, never a blank one. app.js arms `.stagger-grid` just
   before observing it, and removes the arming the moment app:inview fires,
   which is what lets .stagger-armed ever apply at all. */
.stagger-grid > * { transition: opacity 420ms var(--ease-out, ease), transform 420ms var(--ease-out, ease); }
.stagger-grid.stagger-armed > * { opacity: 0; transform: translateY(14px); }
.stagger-grid.stagger-armed.is-inview > * { opacity: 1; transform: translateY(0); }
.stagger-grid.stagger-armed > *:nth-child(1) { transition-delay: 0ms; }
.stagger-grid.stagger-armed > *:nth-child(2) { transition-delay: 55ms; }
.stagger-grid.stagger-armed > *:nth-child(3) { transition-delay: 110ms; }
.stagger-grid.stagger-armed > *:nth-child(4) { transition-delay: 165ms; }
.stagger-grid.stagger-armed > *:nth-child(5) { transition-delay: 220ms; }
.stagger-grid.stagger-armed > *:nth-child(6) { transition-delay: 275ms; }
.stagger-grid.stagger-armed > *:nth-child(7) { transition-delay: 330ms; }
.stagger-grid.stagger-armed > *:nth-child(n+8) { transition-delay: 385ms; }
html.reduced-motion .stagger-grid.stagger-armed > * { opacity: 1; transform: none; transition: none; }

/* ---- Field log tag, coloured by division ----------------------------------- */
/* The division tag reads in the page's own high-contrast ink — colour is
   carried by a small dot, never by the tag's own text, so this stays
   legible in both modes without a second contrast pair to track. */
.log-tag {
  display: inline-flex; align-items: center; gap: 0.35rem; justify-content: flex-start;
  min-width: 4.75rem; padding: 0.05rem 0.4rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; font-size: 10px;
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
}
.log-tag-dot { width: 0.5rem; height: 0.5rem; flex-shrink: 0; }
.log-tag[data-division="media"] .log-tag-dot { background: var(--chart-1); }
.log-tag[data-division="transport"] .log-tag-dot { background: var(--chart-2); }
.log-tag[data-division="alerts"] .log-tag-dot { background: var(--chart-3); }

.field-log-scroll { background: color-mix(in srgb, currentColor 6%, transparent); border: 2px solid color-mix(in srgb, currentColor 22%, transparent); }
.field-log-row { border-bottom: 1px solid color-mix(in srgb, currentColor 14%, transparent); }
.field-log-row:last-child { border-bottom: 0; }

/* ---- Upload device ---------------------------------------------------------- */
.upload-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.5rem; text-align: center; cursor: pointer;
  padding: 2.5rem 1.5rem;
  border: 2px dashed var(--border-strong);
  color: var(--muted);
  transition: border-color 150ms, background-color 150ms, color 150ms;
}
.upload-drop:hover, .upload-drop.is-dragover { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }

.upload-preview-item {
  position: relative; aspect-ratio: 1; overflow: hidden; border: 2px solid var(--border-strong); background: var(--surface-2);
}
.upload-preview-item img { display: block; width: 100%; height: 100%; object-fit: cover; }
.upload-preview-item .upload-preview-name {
  position: absolute; inset-inline: 0; bottom: 0; padding: 0.2rem 0.35rem;
  background: color-mix(in srgb, var(--canvas) 75%, transparent);
  color: var(--ink); font-family: var(--font-mono); font-size: 9px; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---- Hold-to-confirm delete --------------------------------------------------
   A press-and-hold, never a single click. The fill sweeps left-to-right over
   the hold duration (900ms, matched in app.js); releasing early resets it. */
.hold-btn {
  position: relative; overflow: hidden; cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--border-strong);
  background: var(--surface);
  color: var(--danger-strong);
  touch-action: none;
}
.hold-btn-icon { width: 2.25rem; height: 2.25rem; }
.hold-btn-icon-sm { width: 2.25rem; height: 2.25rem; }
/* Placed on a tile as an overlay. A plain `absolute` utility loses this fight
   — app.css loads after the generated utilities, so .hold-btn's own
   `position: relative` would otherwise win at equal specificity and the
   button would sit in normal flow instead of over the tile's corner. This
   modifier, declared after, is what actually wins. */
.hold-btn-overlay { position: absolute; top: 0.5rem; right: 0.5rem; }
.hold-btn-fill {
  position: absolute; inset: 0; width: 0%;
  background: var(--danger);
  transition: width 60ms linear;
  z-index: 0;
}
.hold-btn.is-holding .hold-btn-fill { width: 100%; transition-duration: 900ms; }
.hold-btn .icon { position: relative; z-index: 1; }
.hold-btn.is-holding { color: var(--danger-ink); border-color: var(--danger); }

/* ---- Album tree manager ------------------------------------------------------ */
.tree-node { border-bottom: 1px solid var(--border); }
.tree-node:last-child { border-bottom: 0; }
.tree-add-form input.input:focus { position: relative; z-index: 1; }

/* A file input that triggers a large styled dropzone stays fully invisible
   but covers the WHOLE dropzone, so its own tappable box is never smaller
   than the control a visitor actually sees and presses. */
.upload-drop { position: relative; }
.upload-drop-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
