/* The archive editor: a working screen in the site's own type and colour.
   Quiet 1px lines separate the rows; the one dark button is the main action. */
.admin {
  --line: #e6e6e4;
  --line-strong: #cfcfcc;
  --field: #ffffff;
  --warn: #9a3412;
}

.bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 1.25rem;
  padding: calc(env(safe-area-inset-top, 0px) + 1rem) var(--pad-r) 1rem var(--pad-l);
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.bar .logo { width: 6.5rem; }
.bar__title { font-size: 1.5rem; font-weight: 500; line-height: 1; }
.bar__site { margin-left: auto; font-size: var(--step-small); }

.desk { padding: 1.5rem var(--pad-r) 6rem var(--pad-l); }

.steps { font-size: var(--step-small); color: var(--muted); max-width: 46rem; }
.actions__row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: 0 1.1rem;
  border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink);
  font-size: var(--step-small); cursor: pointer; white-space: nowrap;
  transition: background-color var(--t-hover) ease, border-color var(--t-hover) ease, transform 140ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn--quiet { border-color: transparent; color: var(--muted); }
.btn--small { min-height: 2.25rem; padding: 0 0.7rem; font-size: 0.8125rem; }
.btn--danger { color: var(--warn); }
.btn[disabled] { opacity: 0.4; cursor: default; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { border-color: var(--ink); }
  .btn--primary:hover { background: #2a2a2a; }
  .btn--quiet:hover { border-color: transparent; color: var(--ink); }
}
.sr-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.sr-file:focus-visible + .btn, label.btn:has(+ .sr-file:focus-visible) { outline: 2px solid var(--ink); outline-offset: 3px; }
.status { min-height: 1.5rem; margin-top: 0.75rem; font-size: var(--step-small); }
.status.is-dirty { color: var(--warn); }

.tabs { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin-top: 2rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--line); font-size: var(--step-small); }
.tab { min-height: 2.25rem; color: var(--muted); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.4em; text-decoration-thickness: 1px; }
.tab[aria-pressed="true"] { color: var(--ink); text-decoration-color: currentColor; }
.tab .nums { margin-left: 0.3em; }

.drop {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.94); font-size: 1.25rem; border: 2px dashed var(--line-strong);
}
.drop[hidden] { display: none; }

/* one row per photograph: picture, details, actions */
.item {
  display: grid; grid-template-columns: 9rem minmax(0, 1fr) 9.5rem; gap: 1.25rem; align-items: start;
  padding: 1.25rem 0; border-bottom: 1px solid var(--line);
}
.item__thumb { width: 9rem; height: 9rem; object-fit: cover; background: var(--surface); }
.item__fields { display: grid; gap: 0.85rem; min-width: 0; }
.item__top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; font-size: var(--step-small); }
.item__badge { font-size: 0.75rem; padding: 0.1rem 0.5rem; background: #f3ece4; color: var(--warn); }
.item__meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.6rem 0.75rem; }
.field { display: grid; gap: 0.25rem; font-size: 0.75rem; color: var(--muted); min-width: 0; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 2.35rem; padding: 0.4rem 0.6rem;
  border: 1px solid var(--line); background: var(--field); color: var(--ink);
  font: inherit; font-size: 0.875rem; line-height: 1.4;
}
.field textarea { resize: vertical; min-height: 3.5rem; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); }
.field--wide { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer; }
.check input { width: 1rem; height: 1rem; accent-color: var(--ink); }
.item__hint { font-size: 0.75rem; color: var(--muted); }
.item__actions { display: grid; gap: 0.4rem; justify-items: stretch; }
.item__move { display: flex; gap: 0.4rem; }
.item__move .btn { flex: 1; }

.empty { padding: 3rem 0; color: var(--muted); font-size: var(--step-small); }

@media (max-width: 47.99em) {
  .item { grid-template-columns: 5.5rem minmax(0, 1fr); }
  .item__thumb { width: 5.5rem; height: 5.5rem; }
  .item__actions { grid-column: 1 / -1; grid-auto-flow: column; justify-content: start; }
  .item__meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bar__title { font-size: 1.25rem; }
}
