/* Lucid journal: standalone article pages and the /journal/ hub.
   Same tokens and print frame as the approved journal cards on the main page. */

:root {
  --paper: #fff;
  --ink: #47220f;
  --soft: #6b6661;
  --line: #cfccc9;
  --signal: #67d196;
  --honey: #ffe256;
  --accent: #ff8212;
  --accent-hover: #ff9d45;
  --coral: #f9443f;
  --sky: #6eb1ff;
  --side: clamp(20px, 6vw, 72px);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 20px; }

body {
  margin: 0;
  font: 400 18px/1.85 "Rubik", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper) url(img/tex-grain.webp) 0 0 / 512px;
  background-blend-mode: multiply;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 4px; }
p { margin: 0 0 1em; }

h1, h2, h3 {
  font-family: "Suez One", serif;
  font-weight: 400;
  letter-spacing: normal;
}

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  top: -60px;
  right: 16px;
  z-index: 9;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
}

.skip:focus { top: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: .7em 1.4em;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink);
  font: 700 1.02rem/1.3 "Rubik", sans-serif;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 10px 18px -10px rgb(255 130 18 / 40%);
  transition: background .2s, transform .2s;
}

.btn:hover { background: var(--accent-hover); transform: translateY(-2px); }

.btn.small {
  min-height: 38px;
  padding: 6px 14px;
  background: var(--ink);
  color: #fff;
  font-size: .86rem;
  box-shadow: none;
  white-space: nowrap;
}

/* header and footer */

.journal-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  width: min(1080px, 100% - 2 * var(--side));
  margin: 18px auto 0;
}

.brand {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-decoration: none;
}

.brand b { font: 400 1.6rem/1 "Suez One", serif; }
.brand small { font-size: .72rem; color: var(--soft); }

.journal-top nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  font-size: .88rem;
  font-weight: 500;
}

.journal-top nav a:not(.btn) { text-decoration: none; border-bottom: 1px solid transparent; }
.journal-top nav a:not(.btn):hover { border-color: var(--accent); }

.journal-main {
  width: min(1080px, 100% - 2 * var(--side));
  margin: 0 auto;
  padding-block: clamp(28px, 5vw, 56px) clamp(56px, 8vw, 96px);
}

.journal-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  width: min(1080px, 100% - 2 * var(--side));
  margin: 0 auto;
  padding-block: 28px 40px;
  border-top: 1px solid var(--line);
  font-size: .9rem;
}

.journal-foot p { margin: 0; }
.journal-foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* breadcrumbs */

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin: 0 0 clamp(24px, 4vw, 40px);
  padding: 0;
  list-style: none;
  font-size: .85rem;
  color: var(--soft);
}

.crumbs li:not(:last-child)::after {
  content: "/";
  margin-inline: 10px;
  color: var(--line);
}

.crumbs [aria-current] { color: var(--ink); }

/* article */

.journal-article,
.article-service,
.article-related > h2 {
  max-inline-size: 760px;
  margin-inline: auto;
}

.article-eyebrow {
  margin-bottom: 10px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--soft);
}

.journal-article h1,
.hub-head h1 {
  margin: 0 0 18px;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.2;
}

.article-lead {
  font-size: clamp(1.1rem, 1.6vw, 1.26rem);
  line-height: 1.75;
}

.article-meta {
  font-size: .88rem;
  color: var(--soft);
}

/* the print: white mat, brown frame, hard edge and soft shadow, as on the main page */
.article-cover {
  margin: clamp(24px, 4vw, 40px) 0;
}

.article-cover img,
.hub-entry > img,
.related-entry > img {
  display: block;
  inline-size: 100%;
  block-size: auto;
  aspect-ratio: 8 / 5;
  padding: clamp(7px, 1vw, 12px);
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: #fff;
  box-shadow:
    3px 5px 0 var(--ink),
    8px 18px 24px -16px rgb(71 34 15 / 32%);
}

.article-toc {
  margin: 0 0 36px;
  padding: 18px 22px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.article-toc-title {
  margin: 0 0 6px;
  font: 400 1.15rem/1.5 "Suez One", serif;
}

.article-toc ol { margin: 0; padding-inline-start: 22px; }
.article-toc li { margin-block-end: 6px; }

.article-body h2,
.article-sources h2 {
  margin: 44px 0 14px;
  font-size: clamp(1.5rem, 3vw, 1.95rem);
  line-height: 1.35;
}

.article-body h3 {
  margin: 28px 0 8px;
  font-size: 1.28rem;
  line-height: 1.45;
}

.article-body ul,
.article-body ol { padding-inline-start: 24px; }
.article-body li { margin-block-end: 10px; }

.article-body,
.article-sources { overflow-wrap: anywhere; }

.journal-sketch {
  max-inline-size: 320px;
  margin: 34px auto;
  transform: rotate(-2deg);
}

.journal-sketch svg { display: block; inline-size: 100%; block-size: auto; }

.journal-sketch figcaption {
  font: 400 1.12rem/1.7 "Gveret Levin", cursive;
  text-align: center;
}

.journal-example {
  margin: 28px 0;
  padding: 18px 22px 6px;
  border-inline-start: 4px solid var(--honey);
  background: #fff;
  box-shadow: 0 10px 22px -18px rgb(71 34 15 / 45%);
}

.journal-example-label {
  font-size: .86rem;
  font-weight: 700;
  color: var(--soft);
}

.journal-table {
  max-inline-size: 100%;
  margin: 24px 0;
  overflow-x: auto;
}

.journal-table table {
  inline-size: 100%;
  min-inline-size: 520px;
  border-collapse: collapse;
  font-size: .94rem;
  line-height: 1.6;
}

.journal-table th,
.journal-table td {
  padding: 10px 12px;
  border-block-end: 1px solid var(--line);
  text-align: start;
  vertical-align: top;
}

.journal-table thead th { border-block-end: 2px solid var(--ink); }
.journal-table tbody th { font-weight: 600; }

.decision-chart { margin: 24px 0; }
.decision-chart figcaption { font-weight: 600; margin-block-end: 12px; }

.decision-chart > div {
  display: grid;
  grid-template-columns: 110px minmax(30px, 1fr) 42px;
  align-items: center;
  gap: 8px;
  margin-block: 14px;
  font-size: .9rem;
}

.decision-chart meter { inline-size: 100%; accent-color: var(--signal); }

.funnel-map li::marker,
.landing-map li::marker { font-weight: 700; }

.article-sources {
  margin-block-start: 48px;
  padding-block-start: 8px;
  border-block-start: 1px solid var(--line);
  font-size: .9rem;
}

.article-sources h2 { margin-block-start: 20px; }
.article-sources ul { padding-inline-start: 22px; }
.article-sources li { margin-block-end: 6px; }

.article-note {
  margin-block-start: 18px;
  color: var(--soft);
}

/* service and related */

.article-service {
  margin-block: 48px;
  padding: 26px 28px 30px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: #fff;
  box-shadow: 3px 5px 0 var(--ink);
}

.article-service h2 { margin: 0 0 10px; font-size: 1.5rem; line-height: 1.4; }

.article-related > h2 {
  margin-block: 56px 22px;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}

.related-grid,
.hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 52px 38px; }

.related-entry,
.hub-entry {
  position: relative;
  min-inline-size: 0;
}

.related-entry h3,
.hub-entry h2 {
  margin: 22px 0 8px;
  font-size: 1.2rem;
  line-height: 1.45;
}

.hub-entry h2 { font-size: 1.4rem; }

.related-entry h3 a,
.hub-entry h2 a { text-decoration: none; }

/* the whole card is clickable through the heading link */
.related-entry h3 a::after,
.hub-entry h2 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.related-entry:hover h3 a,
.hub-entry:hover h2 a { text-decoration: underline; }

.related-entry h3 a:focus-visible,
.hub-entry h2 a:focus-visible { outline: none; }

.related-entry:focus-within,
.hub-entry:focus-within {
  outline: 3px solid var(--ink);
  outline-offset: 8px;
}

.related-entry p,
.hub-entry p {
  font-size: .92rem;
  line-height: 1.7;
  color: var(--soft);
}

.related-all { margin-block-start: 28px; text-align: center; font-weight: 600; }

.hub-head {
  max-inline-size: 760px;
  margin-block-end: clamp(32px, 5vw, 56px);
}

@media (max-width: 859px) {
  .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 599px) {
  body { font-size: 17px; }
  .related-grid,
  .hub-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .article-service { padding: 22px 20px 24px; }
  .btn { inline-size: 100%; }
  .btn.small { inline-size: auto; }
  .decision-chart > div { grid-template-columns: 92px minmax(30px, 1fr) 38px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .btn:hover { transform: none; }
}
