/* Editorial · Magazine Overview — styles (2026-06-19, remodel).
 * Class prefix: .mag-ov-*. Tabs across the top are now PUBLICATION groups
 * (SA Digital #2563eb, Africa Print #d97706, Africa Digital #7c3aed, Print Ad /
 * Print Article #f59e0b [UNDECIDED tag], Coffee Table #0d9488, Unassigned
 * #6b7280) — the per-tab accent color is applied via the inline `--accent`
 * custom property the JS sets from GROUP_META, so the tab colors live in the JS
 * contract and these rules just consume `--accent`.
 * Then month bands, article rows with a colored status chip (complete = green).
 * Responsive (collapses on mobile).
 */

.mag-ov-page {
  padding: 20px 24px 40px;
  box-sizing: border-box;
  color: var(--text-primary, #0f172a);
  font-family: inherit;
  /* Fill the host and let the body scroll vertically (header + tabs stay put),
     mirroring the production sheet's .prod-sheet-wrap / .prod-sheet-scroll
     split so content is never cut off. */
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

/* ── header ───────────────────────────────────────────────────────────── */
.mag-ov-head { margin-bottom: 14px; }
.mag-ov-title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.mag-ov-sub {
  font-size: 13px;
  color: var(--text-secondary, #64748b);
  line-height: 1.4;
}

/* ── tabs ─────────────────────────────────────────────────────────────── */
.mag-ov-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  padding-bottom: 12px;
}
.mag-ov-tab {
  --accent: #6b7280;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 999px;
  background: #fff;
  color: var(--text-secondary, #475569);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.mag-ov-tab:hover {
  border-color: var(--accent);
  color: var(--text-primary, #0f172a);
}
.mag-ov-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
}
.mag-ov-tab-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.mag-ov-tab.is-active .mag-ov-tab-dot {
  background: rgba(255, 255, 255, 0.9) !important;
}
.mag-ov-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.mag-ov-tab.is-active .mag-ov-tab-count {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

/* ── body / month bands ───────────────────────────────────────────────── */
/* The scroll region: takes the remaining height under the header/tabs and
   scrolls vertically so the full article list is always reachable. */
.mag-ov-body {
  display: flex;
  flex-direction: column;
  gap: 22px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.mag-ov-month { display: flex; flex-direction: column; }
.mag-ov-month-band {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.05), rgba(15, 23, 42, 0));
  border-left: 3px solid rgba(15, 23, 42, 0.35);
  border-radius: 4px;
}
.mag-ov-month-label {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.mag-ov-month-count {
  font-size: 12px;
  color: var(--text-secondary, #64748b);
  font-weight: 500;
}

/* ── article rows ─────────────────────────────────────────────────────── */
.mag-ov-rows { display: flex; flex-direction: column; gap: 6px; }
.mag-ov-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}
.mag-ov-row:hover {
  border-color: rgba(15, 23, 42, 0.22);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}
.mag-ov-row:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}
.mag-ov-row-info { min-width: 0; flex: 1 1 auto; }
/* Client-rating badge above-and-left of the client name. */
.mag-ov-row-rating { display: inline-flex; margin: 2px 0 1px; }
.mag-ov-row-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mag-ov-row-meta {
  font-size: 12px;
  color: var(--text-secondary, #64748b);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── status chip ──────────────────────────────────────────────────────── */
.mag-ov-chip {
  --chip: #9ca3af;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--chip) 14%, #fff);
  border: 1px solid color-mix(in srgb, var(--chip) 40%, #fff);
  color: var(--chip);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.mag-ov-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.mag-ov-chip-label { line-height: 1; }
/* complete = green */
.mag-ov-chip--complete {
  --chip: #16a34a;
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(22, 163, 74, 0.4);
  color: #16a34a;
}

/* ── states ───────────────────────────────────────────────────────────── */
.mag-ov-loading,
.mag-ov-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-secondary, #64748b);
  font-size: 14px;
}
.mag-ov-error {
  padding: 24px 20px;
  text-align: center;
  color: #b91c1c;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.mag-ov-btn {
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
}
.mag-ov-btn--ghost {
  background: #fff;
  border-color: rgba(15, 23, 42, 0.18);
  color: var(--text-primary, #0f172a);
}
.mag-ov-btn--ghost:hover { background: rgba(15, 23, 42, 0.04); }

/* ── fallback for browsers without color-mix ──────────────────────────── */
@supports not (background: color-mix(in srgb, red 50%, white)) {
  .mag-ov-chip {
    background: rgba(148, 163, 184, 0.14);
    border-color: rgba(148, 163, 184, 0.4);
  }
}

/* ── responsive ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .mag-ov-page { padding: 16px 14px 32px; }
  .mag-ov-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .mag-ov-chip { align-self: flex-start; }
  .mag-ov-tab { padding: 7px 12px; font-size: 12px; }
}
