/* The web UI's whole stylesheet.

   One file, no build step, no framework. This is a tool for looking at assets on an
   internal service, and the cost of a JavaScript toolchain here would be paid on every
   deploy forever in exchange for nothing the page needs. */

:root {
  --bg: #fbfbfa;
  --panel: #ffffff;
  --ink: #1b1b1a;
  --muted: #6c6a66;
  --line: #e3e1dd;
  --accent: #2f5d8a;
  --warn: #8a5a12;
  --alert: #9b3025;
  --shadow: 0 1px 2px rgb(0 0 0 / 6%);
  --radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16171a;
    --panel: #1d1f23;
    --ink: #e8e6e3;
    --muted: #9a9791;
    --line: #2e3138;
    --accent: #7fb0d9;
    --warn: #d9a441;
    --alert: #e0796c;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, .path, .mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 0.92em;
}

header.top {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  flex-wrap: wrap;
}

header.top .brand { font-weight: 650; letter-spacing: 0.02em; }
header.top nav { display: flex; gap: 1rem; flex-wrap: wrap; }
header.top .spacer { flex: 1; }
header.top .who { color: var(--muted); font-size: 0.9em; }

main { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }

h1 { font-size: 1.35rem; margin: 0 0 0.25rem; }
h2 { font-size: 1.05rem; margin: 2rem 0 0.75rem; }
h3 { font-size: 0.95rem; margin: 1.25rem 0 0.5rem; }
.lede { color: var(--muted); margin: 0 0 1.5rem; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}

/* -- filters -------------------------------------------------------------- */

form.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
input[type="text"], input[type="search"], input[type="password"], select, textarea {
  font: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
}
textarea { width: 100%; resize: vertical; }
button, .button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  padding: 0.35rem 0.75rem;
}
button.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
button:hover { border-color: var(--accent); }

/* -- the asset grid ------------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.card .frame {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  background: repeating-conic-gradient(var(--line) 0% 25%, transparent 0% 50%) 50% / 16px 16px;
  overflow: hidden;
}
.card .frame img { width: 100%; height: 100%; object-fit: contain; }
.card .frame .none { color: var(--muted); font-size: 0.8rem; letter-spacing: 0.08em; }
.card .body { padding: 0.6rem 0.7rem; display: flex; flex-direction: column; gap: 0.3rem; }
.card .name { word-break: break-all; font-size: 0.85rem; }
.card .meta { color: var(--muted); font-size: 0.78rem; display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* -- tags ----------------------------------------------------------------- */

.tag {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}
.tag.source { border-color: var(--accent); color: var(--accent); }
.tag.authoring { border-color: var(--warn); color: var(--warn); }
.tag.reference { border-color: var(--muted); }
.tag.alert { border-color: var(--alert); color: var(--alert); }
/* Maturity: the ship-blocker shouts, the sign-off is quiet and solid, and the state
   nobody has judged yet looks like every other tag. */
.tag.placeholder { border-color: var(--alert); color: var(--alert); border-style: dashed; }
.tag.review { border-color: var(--warn); color: var(--warn); }
.tag.final { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.tag.deprecated { text-decoration: line-through; }

/* -- tables --------------------------------------------------------------- */

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 550; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
tr:last-child td { border-bottom: none; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* -- asset detail --------------------------------------------------------- */

.detail { display: grid; grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr); gap: 1.25rem; align-items: start; }
@media (max-width: 860px) { .detail { grid-template-columns: 1fr; } }

.hero { background: repeating-conic-gradient(var(--line) 0% 25%, transparent 0% 50%) 50% / 20px 20px; border-radius: var(--radius); overflow: hidden; }
.hero img { display: block; width: 100%; height: auto; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { border-left: 2px solid var(--line); padding: 0 0 1rem 0.9rem; margin-left: 0.3rem; }
.timeline .when { color: var(--muted); font-size: 0.8rem; }

.comment { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.7rem 0.8rem; margin-bottom: 0.6rem; background: var(--panel); }
.comment.resolved { opacity: 0.6; }
.comment .head { display: flex; gap: 0.5rem; align-items: baseline; flex-wrap: wrap; margin-bottom: 0.3rem; }
.comment .who { font-weight: 600; }
.comment .when { color: var(--muted); font-size: 0.8rem; }
.comment .body { white-space: pre-wrap; }
.comment .replies { margin: 0.6rem 0 0 1rem; border-left: 2px solid var(--line); padding-left: 0.8rem; }
.comment form { display: inline; }

/* -- translation view ----------------------------------------------------- */

.pairs td.source { color: var(--muted); width: 34%; }
.pairs td.key { width: 18%; }
.pairs textarea { min-height: 2.4rem; }
.pairs tr.stale { background: color-mix(in srgb, var(--warn) 8%, transparent); }
.pairs tr.missing td.key { border-left: 3px solid var(--alert); }

.sticky-save { position: sticky; bottom: 0; background: var(--panel); border-top: 1px solid var(--line); padding: 0.75rem 0; display: flex; gap: 0.6rem; align-items: center; }

.meter { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; min-width: 90px; }
.meter > span { display: block; height: 100%; background: var(--accent); }

.notice { border-left: 3px solid var(--accent); }
.notice.error { border-left-color: var(--alert); }

.empty { color: var(--muted); padding: 2rem 0; text-align: center; }
.pager { display: flex; gap: 1rem; justify-content: center; margin-top: 1.5rem; color: var(--muted); }
