/* ═══════════════════════════════════════════════════════════════════════════
   E-ink display stylesheet — TRMNL dashboard server
   ═══════════════════════════════════════════════════════════════════════════

   Hard rules for 1-bit e-ink:
   · #000 and #fff ONLY — no grey, no opacity, no rgba()
   · Minimum font size: 14px for anything that must be read
   · Sans-serif for text ≤ 20px (thicker strokes survive thresholding)
   · Serif only for large display numbers (≥ 40px) where strokes are thick
   · No dashed/dotted borders — render as uneven dots on e-ink
   · No box-shadow, text-shadow, or filter
   · No opacity — use solid colors instead
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Reset ────────────────────────────────────────────────────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Base ─────────────────────────────────────────────────────────────────── */

html, body {
  width: 800px;
  height: 480px;
  overflow: hidden;
  background: #fff;
  color: #000;
  /* Sans-serif as default — strokes stay thick at small sizes after thresholding */
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ── Screen wrapper ───────────────────────────────────────────────────────── */

.screen {
  display: flex;
  flex-direction: column;
  width: 800px;
  height: 480px;
  padding: 18px 22px 10px;
  gap: 10px;
}

/* ── Page header ──────────────────────────────────────────────────────────── */

.page-header {
  flex-shrink: 0;
}

.page-header h1 {
  font-size: 2rem;        /* 32px — thick enough for serif */
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.page-header .subtext {
  font-size: 0.95rem;     /* 15px */
  margin-top: 3px;
  font-weight: 500;
}

/* ── Cards ────────────────────────────────────────────────────────────────── */

.card {
  border: 2px solid #000;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.card--wide {
  flex: 1;
}

.card--tall {
  justify-content: center;
}

.card-label {
  font-size: 0.8rem;      /* 12.8px — uppercase+bold makes it readable */
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1.5px solid #000;
  padding-bottom: 5px;
  margin-bottom: 3px;
}

.card-value {
  font-weight: 600;
}

.card-value--md {
  font-size: 1.15rem;     /* 18.4px */
}

.card-value--sm {
  font-size: 0.95rem;     /* 15px */
  line-height: 1.6;
}

.card-subtext {
  font-size: 0.9rem;      /* 14.4px */
  font-weight: 500;
}

/* ── 2-column grid ────────────────────────────────────────────────────────── */

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ── Timestamp footer ─────────────────────────────────────────────────────── */

.timestamp {
  flex-shrink: 0;
  font-size: 0.8rem;      /* 12.8px — uppercase bold to compensate for small size */
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: right;
  border-top: 1.5px solid #000;
  padding-top: 5px;
  color: #000;            /* never grey */
}

/* ── Stat rows (key/value pairs) ──────────────────────────────────────────── */

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 3px 0;
  border-bottom: 1px solid #000;  /* solid, not dashed */
  font-size: 0.9rem;              /* 14.4px */
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-label {
  font-weight: 700;
  min-width: 130px;
}

.stat-value {
  text-align: right;
  font-family: 'Courier New', Courier, monospace;
  font-weight: 600;
}

/* ── Status indicator ─────────────────────────────────────────────────────── */

.status-ok {
  font-weight: 800;
}

/* ── Clock layout ─────────────────────────────────────────────────────────── */

.clock-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 2px solid #000;
}

.clock-time {
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 0;
}

.clock-hhmm {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 15rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -4px;
  color: #000;
}

.clock-date {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #000;
}

.clock-meta {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #000;
}

.clock-meta .divider {
  margin: 0 10px;
  font-weight: 300;
}

/* ── Weather ──────────────────────────────────────────────────────────────── */

.weather-temp {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 4.5rem;      /* 72px */
  font-weight: 900;
  line-height: 1;
  letter-spacing: -2px;
  color: #000;
}

/* ── Calendar ─────────────────────────────────────────────────────────────── */

.cal-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 2px solid #000;
  padding: 12px 16px 8px;
  gap: 8px;
  overflow: hidden;
}

.cal-header {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  flex-shrink: 0;
  border-bottom: 2px solid #000;
  padding-bottom: 8px;
}

.cal-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 1fr;
}

.cal-dow {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1.5px solid #000;
  padding-bottom: 4px;
}

.cal-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.6rem;
  font-weight: 600;
}

.cal-cell--today span {
  background: #000;
  color: #fff;
  border-radius: 50%;
  width: 1.8em;
  height: 1.8em;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Links row (home page) ────────────────────────────────────────────────── */

.links-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.chip {
  border: 2px solid #000;
  padding: 3px 12px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9rem;      /* 14.4px */
  font-weight: 700;
}
