/* Gym tracker CSS. Mobile-first, single column, Solarized.
 *
 * Spec source: spec.md §7. The palette uses literal Solarized colours
 * mapped to semantic role variables that flip between light and dark
 * mode via prefers-color-scheme. Components reference role variables
 * only.
 */

:root {
  /* --- Literal Solarized palette (same in both modes) ---------- */
  --base03: #002b36;
  --base02: #073642;
  --base01: #586e75;
  --base00: #657b83;
  --base0:  #839496;
  --base1:  #93a1a1;
  --base2:  #eee8d5;
  --base3:  #fdf6e3;

  --solar-yellow:  #b58900;
  --solar-orange:  #cb4b16;
  --solar-red:     #dc322f;
  --solar-magenta: #d33682;
  --solar-violet:  #6c71c4;
  --solar-blue:    #268bd2;
  --solar-cyan:    #2aa198;
  --solar-green:   #859900;

  /* --- Light mode role assignments (default) ------------------- */
  --bg:          var(--base3);
  --surface-alt: var(--base2);
  --text-muted:  var(--base1);
  --text:        var(--base00);
  --text-strong: var(--base01);
  --border:      var(--base01);

  --accent:      var(--solar-blue);
  --accent-text: var(--base3);
  --danger:      var(--solar-orange);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          var(--base03);
    --surface-alt: var(--base02);
    --text-muted:  var(--base01);
    --text:        var(--base0);
    --text-strong: var(--base1);
    --border:      var(--base1);

    --accent:      var(--solar-blue);
    --accent-text: var(--base03);
    --danger:      var(--solar-orange);
  }
}

* { box-sizing: border-box; }

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

/* --- Layout ----------------------------------------------------- */

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
}

/* Inline breadcrumb trail at the top of every signed-in page. Last
   segment is rendered as <strong>; earlier segments are links. */
.crumbs {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.crumbs a { text-decoration: none; }
.crumbs strong { color: var(--text-strong); font-weight: 600; }

h1, h2 { color: var(--text-strong); }
h1 { font-size: 28px; line-height: 1.2; font-weight: 700; margin: 0 0 16px; }
h2 { font-size: 22px; line-height: 1.3; font-weight: 700; margin: 24px 0 12px; }

p { margin: 0 0 16px; }
.muted { color: var(--text-muted); font-size: 16px; }

a { color: var(--accent); }
a:visited { color: var(--accent); }

/* --- Forms ------------------------------------------------------- */

label {
  display: block;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 4px;
}

input, textarea, select {
  width: 100%;
  padding: 12px;
  font: inherit;
  font-size: 20px;
  color: var(--text-strong);
  background: var(--surface-alt);
  border: 2px solid var(--border);
  border-radius: 0;
  -webkit-appearance: none;
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 8px;
  margin-bottom: 8px;
}

button, .btn {
  display: block;
  width: 100%;
  padding: 14px;
  font: inherit;
  font-size: 18px;
  font-weight: 600;
  background: var(--accent);
  color: var(--accent-text);
  border: 2px solid var(--border);
  border-radius: 0;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}
.btn-secondary {
  background: transparent;
  color: var(--text-strong);
}
.btn-danger {
  background: var(--danger);
  color: var(--accent-text);
}

/* --- Tables (set rows) ------------------------------------------ */

table { width: 100%; border-collapse: collapse; }
tbody tr:nth-child(even) { background: var(--surface-alt); }
td, th {
  padding: 12px 8px;
  text-align: left;
  vertical-align: top;
}
.set-row .num { font-weight: 700; font-size: 20px; }
.set-row .weight { font-size: 20px; }
.set-row .notes { color: var(--text-muted); font-size: 16px; }
.set-row .delete {
  background: transparent;
  border: 0;
  width: auto;
  padding: 8px;
  cursor: pointer;
  color: var(--text-muted);
}

/* --- Lists ------------------------------------------------------ */

.list { list-style: none; padding: 0; margin: 0; }
.list li {
  border-bottom: 1px solid var(--border);
}
.list li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  text-decoration: none;
  color: var(--text-strong);
}
.list li a .meta {
  color: var(--text-muted);
  font-size: 16px;
}

/* --- Utility ---------------------------------------------------- */

.center { text-align: center; }
.section { margin: 24px 0; }
.banner-error {
  padding: 12px 16px;
  border: 2px solid var(--danger);
  color: var(--danger);
  margin-bottom: 16px;
}
