/* Field notes — article cards on the landing page, and the article reader.
   Uses the brand tokens already defined by shop.css / the landing page head. */

/* [hidden] only sets display:none at UA specificity; a later display rule on
   .section would silently beat it, so state it explicitly. */
.journal[hidden], #articleRoot[hidden], .article-state[hidden] { display: none !important; }

.journal { background: var(--cream-deep); }

.journal-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}
.journal-head h2 { margin: 8px 0 0; max-width: 18ch; }
.journal-head p { margin: 0; color: var(--muted); max-width: 46ch; }

.journal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}

.journal-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.journal-card:hover,
.journal-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(21, 18, 33, .10);
}
.journal-card:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; }

.journal-cover {
  aspect-ratio: 16 / 10;
  width: 100%;
  object-fit: cover;
  background: var(--cream-deep);
  display: block;
}
.journal-body { padding: 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.journal-body h3 { margin: 0; font-size: clamp(19px, 2vw, 22px); line-height: 1.3; }
.journal-body p { margin: 0; color: var(--ink-soft); font-size: 15px; }
.journal-meta {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: .02em;
}
.journal-meta span::after { content: " ·"; }
.journal-meta span:last-child::after { content: ""; }

/* ---- the reader ---- */

.article-page { padding: clamp(56px, 8vw, 110px) 0 clamp(72px, 9vw, 130px); }
.article-wrap { width: min(calc(100% - 40px), 720px); margin-inline: auto; }

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 28px;
}
.article-back:hover { color: var(--ink); }

.article-head h1 {
  margin: 10px 0 14px;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.15;
  letter-spacing: -.02em;
}
.article-head .journal-meta { margin: 0 0 8px; padding: 0; }
.article-lead { color: var(--ink-soft); font-size: 18px; margin: 0 0 32px; }
.article-hero {
  width: 100%;
  border-radius: 18px;
  margin-bottom: 40px;
  display: block;
}

/* Article bodies are author-written HTML, so every element they can produce
   needs a sensible default here -- there is no class to hook onto. */
.article-body { font-size: 17px; line-height: 1.75; color: var(--ink); }
.article-body > * { margin: 0 0 20px; }
.article-body h2 { font-size: clamp(23px, 3vw, 30px); line-height: 1.25; margin: 44px 0 14px; letter-spacing: -.01em; }
.article-body h3 { font-size: clamp(19px, 2.4vw, 23px); line-height: 1.3; margin: 34px 0 12px; }
.article-body h2:first-child, .article-body h3:first-child { margin-top: 0; }
.article-body a { color: var(--violet-dark); text-underline-offset: 3px; }
.article-body ul, .article-body ol { padding-left: 22px; }
.article-body li { margin-bottom: 8px; }
.article-body img { max-width: 100%; height: auto; border-radius: 14px; }
.article-body figure { margin: 32px 0; }
.article-body figcaption { font-size: 14px; color: var(--muted); margin-top: 10px; text-align: center; }
.article-body blockquote {
  margin: 32px 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--violet);
  color: var(--ink-soft);
  font-size: 19px;
}
.article-body pre {
  background: var(--ink);
  color: var(--cream);
  padding: 18px;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 14px;
}
.article-body code { font-size: .92em; }
.article-body :not(pre) > code {
  background: var(--cream-deep);
  padding: 2px 6px;
  border-radius: 5px;
}
.article-body hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.article-body iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 14px; }
.article-body table { width: 100%; border-collapse: collapse; font-size: 15px; }
.article-body th, .article-body td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.article-body th { background: var(--cream-deep); font-weight: 600; }

/* a wide table or code block scrolls inside itself, never the page */
.article-body > table { display: block; overflow-x: auto; }

.article-foot {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.article-state { text-align: center; color: var(--muted); padding: 60px 0; }

@media (max-width: 640px) {
  .journal-grid { grid-template-columns: 1fr; gap: 20px; }
  .journal-head { margin-bottom: 32px; }
  .article-wrap { width: calc(100% - 32px); }
  .article-body { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .journal-card { transition: none; }
  .journal-card:hover, .journal-card:focus-visible { transform: none; }
}

.journal-all { margin: 32px 0 0; text-align: center; }
.journal-all a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  padding: 0 4px; color: var(--ink); font-weight: 600; text-underline-offset: 4px;
}

/* The "what is" answer block — quotable on its own, and a genuine summary
   for a reader who landed here cold. */
.brief { padding: clamp(56px, 7vw, 96px) 0; background: var(--white); }
.brief-inner { display: grid; grid-template-columns: .55fr 1.45fr; gap: clamp(24px, 5vw, 64px); align-items: start; }
.brief h2 { margin: 0; font-size: clamp(26px, 3.4vw, 38px); line-height: 1.15; letter-spacing: -.02em; }
.brief-body p { margin: 0 0 16px; font-size: clamp(16px, 1.35vw, 18px); line-height: 1.7; color: var(--ink-soft); max-width: 62ch; }
.brief-body p:last-child { margin-bottom: 0; }
.brief-body strong { color: var(--ink); font-weight: 600; }
@media (max-width: 860px) { .brief-inner { grid-template-columns: 1fr; gap: 18px; } }

.confidence-detail { margin: 16px 0 0; color: #CFC4FF; font-size: 15.5px; line-height: 1.7; max-width: 60ch; }

/* Byline — an article with a named, linked author is the difference between
   citable and anonymous. */
.article-byline {
  display: flex; flex-direction: column; gap: 3px;
  margin: 14px 0 0; font-size: 14.5px; color: var(--muted);
}
.article-byline a { color: var(--ink); text-underline-offset: 3px; }
.article-byline b { font-weight: 600; }
