/* Shared stylesheet for the GIS & Land Administration workspace.
   Tufte-influenced: generous margins, sidenotes, restrained colour, prints well. */

:root {
  --ink: #1a1a18;
  --ink-soft: #5c5b57;
  --rule: #d8d5cc;
  --paper: #fffef9;
  --accent: #7a2e1d;      /* cadastre / spatial */
  --accent-2: #1f4e5f;    /* registry / legal */
  --wash: #f4f1e8;
  --ok: #2f6b3c;
  --no: #9b2226;
  --measure: 34rem;
}

* { box-sizing: border-box; }

html { font-size: 17px; }

body {
  margin: 0 auto;
  padding: 4rem 2rem 8rem;
  max-width: 58rem;
  background: var(--paper);
  color: var(--ink);
  font-family: et-book, Palatino, "Palatino Linotype", "Iowan Old Style", Georgia, serif;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

/* ---- Structure ---- */

.eyebrow {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 .8rem;
}

h1 {
  font-size: 2.4rem;
  line-height: 1.14;
  font-weight: 400;
  margin: 0 0 .6rem;
  max-width: var(--measure);
}

h2 {
  font-size: 1.35rem;
  font-weight: 400;
  font-style: italic;
  margin: 3rem 0 .8rem;
  max-width: var(--measure);
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.8rem 0 .5rem;
  max-width: var(--measure);
}

p, ul, ol, blockquote { max-width: var(--measure); }
p { margin: 0 0 1.1rem; }
li { margin-bottom: .4rem; }

.subtitle {
  font-size: 1.15rem;
  font-style: italic;
  color: var(--ink-soft);
  max-width: var(--measure);
  margin-bottom: 2.5rem;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 3.5rem 0;
}

a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--rule); }
a:hover { border-bottom-color: var(--accent); }

code, .mono {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: .85em;
  background: var(--wash);
  padding: .1em .35em;
  border-radius: 3px;
}

/* ---- Sidenotes ---- */

.sidenote {
  float: right;
  clear: right;
  width: 15rem;
  margin: .3rem -18rem .8rem 0;
  font-size: .8rem;
  line-height: 1.45;
  color: var(--ink-soft);
}
.sidenote a { border-bottom-color: #c9c5b8; }

/* ---- Callouts ---- */

.callout {
  border-left: 3px solid var(--accent);
  background: var(--wash);
  padding: 1rem 1.2rem;
  margin: 1.8rem 0;
  max-width: var(--measure);
}
.callout.legal { border-left-color: var(--accent-2); }
.callout .label {
  font-family: ui-monospace, Menlo, monospace;
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: block;
  margin-bottom: .4rem;
}
.callout p:last-child { margin-bottom: 0; }

/* ---- Two-column compare ---- */

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--rule);
  margin: 2rem 0;
  max-width: 46rem;
}
.compare > div { padding: 1.1rem 1.3rem; }
.compare > div:first-child { border-right: 1px solid var(--rule); }
.compare h4 {
  margin: 0 0 .6rem;
  font-size: .95rem;
  letter-spacing: .02em;
}
.compare .spatial h4 { color: var(--accent); }
.compare .legal h4 { color: var(--accent-2); }
.compare ul { margin: 0; padding-left: 1.1rem; font-size: .92rem; }

/* ---- Tables ---- */

table {
  border-collapse: collapse;
  width: 100%;
  max-width: 46rem;
  margin: 1.8rem 0;
  font-size: .9rem;
}
th, td {
  text-align: left;
  padding: .55rem .7rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
th {
  font-weight: 600;
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1.5px solid var(--ink-soft);
}

/* ---- Numbered process steps ---- */

ol.steps { counter-reset: step; list-style: none; padding: 0; max-width: 40rem; }
ol.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1rem 2.6rem;
  border-left: 1px solid var(--rule);
  margin-left: .6rem;
}
ol.steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
ol.steps li::before {
  content: counter(step);
  position: absolute;
  left: -.72rem;
  top: 0;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--ink-soft);
  color: var(--ink-soft);
  font-family: ui-monospace, Menlo, monospace;
  font-size: .7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
ol.steps li strong { display: block; margin-bottom: .1rem; }
ol.steps li .note { font-size: .86rem; color: var(--ink-soft); }

/* ---- Decision matrix ---- */

table.matrix td:first-child { font-weight: 600; width: 32%; }
table.matrix .yes { color: var(--ok); }
table.matrix .no { color: var(--no); }

/* ---- Key-value model sketch ---- */

pre.model {
  background: var(--wash);
  border-left: 3px solid var(--accent-2);
  padding: 1rem 1.2rem;
  overflow-x: auto;
  font-family: ui-monospace, Menlo, monospace;
  font-size: .78rem;
  line-height: 1.55;
  max-width: 46rem;
}
pre.model code { background: none; padding: 0; font-size: inherit; }

/* ---- Self-check checklist ---- */

ul.checklist { list-style: none; padding: 0; max-width: 40rem; }
ul.checklist li {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  padding: .5rem .7rem;
  border-bottom: 1px solid var(--rule);
  font-size: .92rem;
}
ul.checklist li:hover { background: var(--wash); }
ul.checklist input { margin-top: .35rem; accent-color: var(--accent-2); }
ul.checklist label { cursor: pointer; }
ul.checklist .hint { display: block; font-size: .82rem; color: var(--ink-soft); margin-top: .15rem; }
ul.checklist input:checked + label { color: var(--ink-soft); text-decoration: line-through; }
ul.checklist input:checked + label .hint { text-decoration: none; }

/* ---- Lesson series nav ---- */

.series {
  font-family: ui-monospace, Menlo, monospace;
  font-size: .7rem;
  letter-spacing: .1em;
  color: var(--ink-soft);
  margin-bottom: 2.5rem;
}
.series a { color: var(--ink-soft); }

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

.footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: .85rem;
  color: var(--ink-soft);
  max-width: var(--measure);
}
.footer a { color: var(--ink); }

.ask {
  background: var(--wash);
  border: 1px dashed var(--rule);
  padding: .9rem 1.1rem;
  font-size: .88rem;
  margin: 2.5rem 0 0;
  max-width: var(--measure);
}

/* ---- Print ---- */

@media print {
  body { padding: 0; font-size: 11pt; max-width: none; }
  .sidenote { float: none; width: auto; margin: .6rem 0; border-left: 2px solid var(--rule); padding-left: .8rem; }
  .quiz button { display: none; }
  a { border-bottom: none; }
}

@media (max-width: 1100px) {
  .sidenote { float: none; width: auto; margin: .8rem 0 1.2rem; border-left: 2px solid var(--rule); padding-left: .9rem; }
}

@media (max-width: 600px) {
  body { padding: 2rem 1.1rem 5rem; }
  h1 { font-size: 1.8rem; }
  .compare { grid-template-columns: 1fr; }
  .compare > div:first-child { border-right: 0; border-bottom: 1px solid var(--rule); }
}
