/* css/logging.css — P3-05. Observed-conditions + catch capture forms, and
   the Logbook "Add log entry" affordance.

   Scoped under .logf / .log-capture so nothing leaks. Colours come
   exclusively from the styles.css tokens: --bg --bg-raised --line --text
   --text-dim --accent --accent-2 --warn --bad --radius --pad --font --mono.

   MOBILE-FIRST: this form gets filled in on a beach, wet, one-handed. Every
   tappable control (chips, inputs, buttons) is at least 44px tall. The chips
   reuse the .chip look from css/panel.css (linked globally) but get their own
   .logf-chip sizing so the base .chip stays small elsewhere.

   LOADING: js/logging.js injects a guarded <link> to this file on first use.
   Once index.html carries a permanent
   <link rel="stylesheet" href="css/logging.css"> the injection is a no-op. */

/* --- form shell ----------------------------------------------------------- */

.logf {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin: 0 0 var(--pad);
}

.logf-title {
  margin: 0 0 0.125rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.logf-label {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* --- chips: quick-pick viz + ordinal current/surge ------------------------ */

.logf-chiprow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

/* Rides on .chip (panel.css) for the pill look; resized for wet thumbs. */
.logf-chip {
  min-height: 44px;
  min-width: 44px;
  padding: 0 0.75rem;
  justify-content: center;
  font-size: 0.8125rem;
  font-family: var(--font);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.logf-chip:hover { background: rgba(255, 255, 255, 0.08); }

.logf-chip:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.logf-chip.is-active {
  color: var(--accent-2);
  border-color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 16%, transparent);
  font-weight: 600;
}

/* --- inputs --------------------------------------------------------------- */

.logf-input {
  min-height: 44px;
  padding: 0 0.625rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 1rem;              /* ≥16px so iOS Safari does not zoom the page */
}

.logf-input::placeholder { color: var(--text-dim); opacity: 0.7; }

.logf-input:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 1px;
}

.logf-input--num { max-width: 7.5rem; }

/* --- catch rows ----------------------------------------------------------- */

.logf-rows {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.logf-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 3.5rem 5rem 44px;
  gap: 0.375rem;
  align-items: center;
}

.logf-row .logf-input { width: 100%; min-width: 0; }

.logf-remove {
  min-height: 44px;
  min-width: 44px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 1.125rem;
  cursor: pointer;
}

.logf-remove:hover { color: var(--bad); border-color: var(--bad); }

.logf-add { align-self: flex-start; }

/* --- save / errors / confirm ---------------------------------------------- */

.logf-save {
  align-self: stretch;
  justify-content: center;
  border-color: color-mix(in srgb, var(--accent-2) 45%, transparent);
  color: var(--accent-2);
  font-weight: 600;
}

.logf-save:hover {
  background: color-mix(in srgb, var(--accent-2) 12%, transparent);
}

.logf-errors:empty, .logf-ok:empty { display: none; }

.logf-error {
  margin: 0.125rem 0 0;
  color: var(--bad);
  font-size: 0.75rem;
  line-height: 1.4;
}

.logf-confirm {
  margin: 0.125rem 0 0;
  color: var(--accent);
  font-size: 0.75rem;
  line-height: 1.4;
}

/* --- the Logbook "Add log entry" affordance ------------------------------- */

.log-capture { gap: 0.5rem; }

.log-capture__open {
  align-self: stretch;
  justify-content: center;
}

.log-capture__mount:empty { display: none; }

/* Site picker + date, side by side until it doesn't fit. */
.log-capture__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.5rem;
}

.log-capture__site { flex: 1 1 10rem; font-family: var(--font); }
.log-capture__date { flex: 0 1 auto; font-family: var(--font); }

.log-capture__done {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.75rem;
  line-height: 1.4;
}
.log-capture__done:empty { display: none; }
