/* ============================================================
   Workplace Problems — V1 shared stylesheet
   Mobile-first, text-first, no frameworks, no animations.
   ============================================================ */

:root {
  --bg: #ffffff;
  --text: #1d2733;
  --muted: #5c6673;
  --line: #e4e9ee;
  --soft: #f4f7fa;
  --accent: #0f5aa8;
  --accent-dark: #0b4178;
  --plan: #8a939e;
  --plan-bg: #fafbfc;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  overflow-wrap: break-word;
}

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1.25rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.site-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
}

.site-name:hover { color: var(--accent); }

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.site-nav a:hover { color: var(--accent); }

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--soft);
  color: var(--accent-dark);
  padding: 0.5rem 1rem;
  border-radius: 0 0 6px 0;
}

.skip-link:focus {
  left: 0;
  z-index: 10;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Typography ---------- */

h1 {
  font-size: clamp(1.7rem, 5.5vw, 2.35rem);
  line-height: 1.22;
  margin: 2.2rem 0 1rem;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.38rem;
  line-height: 1.3;
  margin: 2.6rem 0 0.8rem;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.12rem;
  line-height: 1.35;
  margin: 1.9rem 0 0.5rem;
}

p { margin: 0 0 1.05rem; }

ul, ol { margin: 0 0 1.05rem; padding-left: 1.4rem; }

li { margin-bottom: 0.45rem; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover { color: var(--accent-dark); }

.lede {
  font-size: 1.12rem;
  line-height: 1.65;
}

.muted { color: var(--muted); }

.small { font-size: 0.9rem; }

.back-link {
  display: inline-block;
  margin-top: 1.6rem;
  font-size: 0.95rem;
  color: var(--muted);
  text-decoration: none;
}

.back-link:hover { color: var(--accent); }

/* ---------- Sections ---------- */

.hero {
  padding: 3rem 0 1rem;
}

.hero h1 { margin-top: 0; }

.hero p {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 36rem;
}

section { margin-bottom: 0.5rem; }

/* ---------- Callout ---------- */

.callout {
  background: var(--soft);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.15rem;
  margin: 1.5rem 0;
}

.callout p { margin: 0; }

.callout strong { color: var(--text); }

/* ---------- Directory / planned items ---------- */

.problem-list {
  list-style: none;
  padding: 0;
  margin: 0.6rem 0 1.6rem;
}

.problem-list li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  margin: 0;
}

.problem-list a {
  text-decoration: none;
  font-weight: 600;
}

.problem-list a:hover { text-decoration: underline; }

.problem-list .planned {
  color: var(--plan);
  background: var(--plan-bg);
  font-weight: 500;
  cursor: default;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.tag {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--plan);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.05rem 0.6rem;
  white-space: nowrap;
  align-self: center;
}

.count {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 400;
}

/* ---------- "What you'll find" flow ---------- */

.flow {
  list-style: none;
  padding: 0;
  margin: 0 0 1.05rem;
}

.flow li {
  padding: 0.5rem 0;
  margin: 0;
  border-bottom: 1px dashed var(--line);
}

.flow li:last-child { border-bottom: none; }

.flow .step-label {
  font-weight: 700;
  font-size: 0.95rem;
}

/* ---------- Pattern comparison table ---------- */

.table-scroll { margin: 1.3rem 0 1.6rem; }

.pattern-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.97rem;
}

.pattern-table caption {
  caption-side: top;
  text-align: left;
  font-size: 0.9rem;
  color: var(--muted);
  padding-bottom: 0.5rem;
}

.pattern-table th,
.pattern-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--line);
}

.pattern-table thead th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 2px solid var(--line);
  background: var(--soft);
}

.pattern-table tbody th {
  font-weight: 600;
  width: 45%;
}

.pattern-table td { color: var(--muted); }

/* Mobile: stack each row into a card, no horizontal scroll */
@media (max-width: 640px) {
  .pattern-table thead { display: none; }

  .pattern-table, .pattern-table tbody,
  .pattern-table tr, .pattern-table th,
  .pattern-table td {
    display: block;
    width: 100%;
  }

  .pattern-table tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 0.9rem;
    overflow: hidden;
  }

  .pattern-table tbody th,
  .pattern-table td {
    border-bottom: none;
    padding: 0.65rem 0.85rem;
  }

  .pattern-table tbody th {
    background: var(--soft);
    border-bottom: 1px solid var(--line);
  }

  .pattern-table tbody th::before {
    content: "What you're seeing";
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 0.15rem;
  }

  .pattern-table td::before {
    content: "What it may suggest";
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 0.15rem;
  }

  .pattern-table td { color: var(--text); }
}

/* ---------- FAQ ---------- */

.faq-item { margin-bottom: 1.4rem; }

.faq-item h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.faq-item p { margin-bottom: 0; }

/* ---------- Sources ---------- */

.sources { font-size: 0.93rem; }

.sources h3 { margin-bottom: 0.4rem; }

.sources ul { padding-left: 1.3rem; }

.sources li { margin-bottom: 0.55rem; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 3.5rem;
  padding: 1.4rem 0 2.2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p { margin-bottom: 0.5rem; }

/* ---------- Breadcrumbs & active nav ---------- */

.crumbs {
  margin: 1.6rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.crumbs a {
  color: var(--muted);
  text-decoration: none;
}

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

.crumbs + h1 { margin-top: 0.9rem; }

.site-nav a.active {
  color: var(--accent);
  font-weight: 600;
}
