/* Manualele didactice din epoca comunistă — stylesheet */

:root {
  --paper: #f5f1e8;
  --paper-2: #ebe5d8;
  --ink: #1b1815;
  --ink-2: #3d3832;
  --muted: #6b635a;
  --rule: #d6cdba;
  --red: #9b1c14;
  --red-dark: #7a150f;
  --max: 46rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
}

/* ---------- header ---------- */

.site-head {
  position: relative;
  padding: 4.5rem 0 3rem;
  border-bottom: 1px solid var(--rule);
  background:
    radial-gradient(ellipse at 15% 0%, rgba(155, 28, 20, 0.07), transparent 60%),
    linear-gradient(180deg, var(--paper-2), var(--paper));
}

.site-head::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--red) 0 33%, var(--rule) 33% 100%);
}

.kicker {
  margin: 0 0 1.25rem;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 600;
}

h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(2.1rem, 6vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 400;
}

.lead {
  margin: 0;
  font-size: clamp(1.05rem, 2.2vw, 1.22rem);
  color: var(--ink-2);
  max-width: 38rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1.5rem 1.75rem;
  margin: 3rem 0 0;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

.stats dt {
  font-size: 2.1rem;
  line-height: 1;
  color: var(--red);
  font-variant-numeric: tabular-nums;
}

.stats dd {
  margin: 0.45rem 0 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}

/* ---------- toc ---------- */

.toc {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(245, 241, 232, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

.toc .wrap {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding: 0.85rem 0;
  scrollbar-width: none;
}

.toc .wrap::-webkit-scrollbar { display: none; }

.toc a {
  flex: 0 0 auto;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}

.toc a:hover { color: var(--red); border-bottom-color: var(--red); }

/* ---------- sections ---------- */

section { padding: 3.5rem 0 1.5rem; }

section + section { border-top: 1px solid var(--rule); }

h2 {
  margin: 0 0 1.25rem;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.01em;
}

h2 em { color: var(--red); font-style: italic; }

h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 600;
}

p { margin: 0 0 1.1rem; }

.intro {
  color: var(--muted);
  font-size: 0.98rem;
  max-width: 40rem;
}

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

strong { font-weight: 600; }

/* ---------- timeline ---------- */

.timeline {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  border-left: 1px solid var(--rule);
}

.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 1.5rem;
  padding: 0 0 2rem 1.75rem;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.55rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
}

.timeline .year {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
  padding-top: 0.35rem;
  font-weight: 600;
}

.timeline p { margin: 0; color: var(--ink-2); font-size: 0.97rem; }

/* ---------- cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.card {
  padding: 1.35rem 1.4rem 1.1rem;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--red);
}

.card .tag {
  margin: 0 0 0.6rem;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.card p:last-child { margin: 0; font-size: 0.95rem; color: var(--ink-2); }

/* ---------- lists ---------- */

.anatomy, .links {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.anatomy li, .links li {
  padding: 0.75rem 0 0.75rem 1.5rem;
  border-bottom: 1px solid var(--rule);
  position: relative;
  font-size: 0.97rem;
  color: var(--ink-2);
}

.anatomy li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--red);
}

.links li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--red);
}

.links li:last-child, .anatomy li:last-child { border-bottom: 0; }

section h3:not(:first-child) { margin-top: 2.5rem; }

/* ---------- table ---------- */

.table-wrap {
  margin-top: 2rem;
  overflow-x: auto;
  border: 1px solid var(--rule);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: #fbf8f1;
}

th, td {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

th {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--paper-2);
  font-weight: 600;
  white-space: nowrap;
}

tbody tr:hover { background: #f7f2e7; }

td:last-child { white-space: nowrap; }

td:nth-child(2), td:nth-child(3) { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- footer ---------- */

.site-foot {
  margin-top: 3rem;
  padding: 2.5rem 0 3rem;
  border-top: 3px double var(--rule);
  background: var(--paper-2);
}

.site-foot p {
  margin: 0 0 0.35rem;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  color: var(--ink-2);
}

.site-foot .fine { color: var(--muted); font-size: 0.78rem; }

/* ---------- responsive ---------- */

@media (max-width: 34rem) {
  .site-head { padding: 3rem 0 2.25rem; }
  .timeline li { grid-template-columns: 1fr; gap: 0.25rem; }
  .timeline .year { padding-top: 0; }
  .stats { gap: 1.25rem; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171512;
    --paper-2: #201d19;
    --ink: #eee8dc;
    --ink-2: #cfc7b8;
    --muted: #9a9184;
    --rule: #332e28;
    --red: #e0655a;
    --red-dark: #f08178;
  }
  .toc { background: rgba(23, 21, 18, 0.94); }
  table { background: var(--paper-2); }
  tbody tr:hover { background: #26221d; }
}

@media print {
  .toc, .site-head::after { display: none; }
  body { background: #fff; color: #000; }
}
