/* Journal (blog) — public list + article pages.
   Long-read typography per docs/style_guide.md: ~17px body, generous
   line-height, ~70ch measure. Text colour inherits the site navy from
   global.css — nothing here sets near-black. */

/* No top padding: the shared header already leaves a generous band
   under the logo (Dave, 2026-09-22 - the list heading sat too low). */
.th-journal {
  max-width: 46rem;
  padding-block: 0 3rem;
}

.th-journal__heading {
  text-align: center;
  margin-block: 0 2rem;
}

.th-journal__empty {
  text-align: center;
}

/* ---------- List page entry cards ---------- */

.th-journal-card {
  /* position: relative anchors the .stretched-link's cover, making the
     whole entry tappable. */
  position: relative;
  padding-block: 1.5rem;
  border-bottom: 1px solid rgba(0, 83, 125, 0.15);
}

.th-journal-card:first-of-type {
  padding-top: 0.25rem;
}

.th-journal-card:last-of-type {
  padding-bottom: 0.25rem;
  border-bottom: none;
}

/* Desktop-only hover cue for the whole-card link; on touch, iOS keeps
   :hover stuck after a tap. */
@media (hover: hover) {
  .th-journal-card:hover .th-journal-card__title a {
    color: #ef589c;
  }
}

.th-journal-card__hero {
  display: block;
  width: 100%;
  max-height: 170px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.th-journal-card__title {
  font-size: 1.35rem;
  margin-bottom: 0.25rem;
}

.th-journal-card__title a {
  color: inherit;
  text-decoration: none;
}

.th-journal-card__title a:hover {
  color: #ef589c;
}

.th-journal-card__date {
  font-size: 0.9rem;
  color: rgba(0, 83, 125, 0.78);
  margin-bottom: 0.5rem;
}

/* Semibold: Helene reads the standfirst as the entry's second title
   (2026-09-22), and the write screen has no way to bold it by hand. */
.th-journal-card__standfirst {
  font-weight: 600;
  margin-bottom: 0;
}

.th-journal-card__read {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
}

.th-journal-pager {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
}

/* ---------- Article page ---------- */

.th-journal-draftbar {
  background: rgba(239, 88, 156, 0.12);
  color: #e01571;
  border-radius: 10px;
  padding: 0.5rem 1rem;
  text-align: center;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.th-journal-post__title {
  text-align: center;
  margin-bottom: 0.5rem;
}

.th-journal-post__date {
  text-align: center;
  font-size: 0.9rem;
  color: rgba(0, 83, 125, 0.78);
  margin-bottom: 1.5rem;
}

.th-journal-post__hero {
  display: block;
  width: 100%;
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.th-journal-post__standfirst {
  font-size: 1.15rem;
  font-weight: 600;   /* the "second title" - see the list rule above */
  line-height: 1.55;
  margin-bottom: 1.5rem;
}

/* Curator-only "Edit this entry" line above a live article (a draft
   preview carries the same link inside its draft bar). */
.th-journal-curatorline {
  text-align: center;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* The Trix-authored body: sanitized HTML, so element selectors (not
   classes) dress it. */
.th-journal-post__body {
  font-size: 1.0625rem;   /* ~17px */
  line-height: 1.65;
}

.th-journal-post__body h2 {
  font-size: 1.3rem;
  margin: 2rem 0 0.75rem;
}

.th-journal-post__body p,
.th-journal-post__body div {
  margin-bottom: 1rem;
}

/* Body links: the site text-pink, semibold — the weight is the second
   cue alongside colour (no resting underline; one appears on hover).
   #e01571 on the cream card measures ~4.44:1 — a hair under AA's 4.5,
   accepted with the weight compensating (it passes on white). */
.th-journal-post__body a {
  color: #e01571;
  font-weight: 600;
  text-decoration: none;
}

.th-journal-post__body a:hover {
  color: #ef589c;
  text-decoration: underline;
}

.th-journal-post__body blockquote {
  border-left: 3px solid rgba(239, 88, 156, 0.45);
  background: rgba(239, 88, 156, 0.06);
  border-radius: 0 10px 10px 0;
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
  font-style: italic;
}

.th-journal-post__body blockquote > :last-child {
  margin-bottom: 0;
}

.th-journal-post__body ul,
.th-journal-post__body ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.th-journal-post__body img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 1.5rem auto;
}

.th-journal-post__body figure {
  margin: 1.5rem 0;
}

.th-journal-post__body figure img {
  margin: 0 auto 0.5rem;
}

.th-journal-post__body figcaption {
  text-align: center;
  font-size: 0.9rem;
  color: rgba(0, 83, 125, 0.78);
}

/* ---------- Curator: manage list ---------- */

.th-jm-row {
  padding-block: 1rem;
  border-bottom: 1px solid rgba(0, 83, 125, 0.15);
}

.th-jm-row:first-of-type {
  padding-top: 0.25rem;
}

.th-jm-row:last-of-type {
  padding-bottom: 0.25rem;
  border-bottom: none;
}

.th-jm-title {
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}

.th-jm-title:hover {
  color: #ef589c;
}

.th-jm-chip {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: rgba(0, 83, 125, 0.08);
  margin-left: 0.5rem;
  vertical-align: middle;
}

.th-jm-chip--live {
  background: rgba(239, 88, 156, 0.15);
  color: #e01571;
}

.th-jm-chip--scheduled {
  background: rgba(239, 88, 156, 0.08);
  color: #e01571;
}

.th-jm-meta {
  font-size: 0.9rem;
  color: rgba(0, 83, 125, 0.78);
  margin: 0.25rem 0 0;
}

/* ---------- Curator: write screen ---------- */

.th-jw-label {
  display: block;
  font-weight: 600;
  margin: 1.25rem 0 0.35rem;
}

.th-jw-hint {
  font-weight: 400;
  font-size: 0.9rem;
  color: rgba(0, 83, 125, 0.78);
}

.th-jw-title {
  font-size: 1.15rem;
}

/* The Trix writing surface: a calm white page. */
.th-jw-editor {
  background: #fff;
  border: 1px solid rgba(0, 83, 125, 0.25);
  border-radius: 12px;
  min-height: 320px;
  padding: 1rem;
  font-size: 1.0625rem;
  line-height: 1.6;
}

/* Keep the formatting bar reachable while writing a long entry. */
.th-jw trix-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fdf9f4;
  padding: 0.4rem 0.25rem;
  border-radius: 0 0 10px 10px;
}

/* Trix 2.1.19 marks a refused link address with the class `trix-validate`
   but its own stylesheet styles `.validate`, so the refusal was invisible.
   journal_write.js fills in a missing https:// first, so this only shows
   for an address that is unusable even then. */
.th-jw trix-toolbar .trix-input--dialog.trix-validate:invalid {
  box-shadow: 0 0 0 2px #e01571;
}

/* The one-line "how links work" tip under the writing area. */
.th-jw-tip {
  font-size: 0.9rem;
  color: rgba(0, 83, 125, 0.78);
  margin: 0.5rem 0 0;
}

.th-jw-herorow {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.th-jw-heroprev {
  max-height: 90px;
  border-radius: 8px;
}

.th-jw-heroremove {
  font-size: 0.9rem;
}

.th-jw-notice {
  min-height: 1.2rem;
  font-size: 0.9rem;
  color: #e01571;
  margin: 0.35rem 0 0;
}

.th-jw-publishbox .th-jw-when {
  max-width: 280px;
}

.th-jw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 1.75rem;
}

.th-jw-backline {
  text-align: center;
  margin-top: 1.5rem;
  margin-bottom: 0;
}

/* ---------- Foot: the "try it" invitation ---------- */

.th-journal-foot {
  text-align: center;
  border-top: 1px solid rgba(0, 83, 125, 0.15);
  margin-top: 3rem;
  padding-top: 2rem;
}

.th-journal-foot__line {
  margin-bottom: 1rem;
}

.th-journal-foot__back {
  margin-top: 1.5rem;
  margin-bottom: 0;
}
