/* The Journal: articles for grown-ups.
   Loaded after /styles.css, so it shares the homepage's fonts, colours, desk,
   buttons, closing envelope and footer. Everything here is just for the Journal. */

/* The menu bar at the top is the same as the homepage's ("Menu bar" in /styles.css). */

.journal {
  max-width: 1480px; margin: 0 auto; padding-block: 2.5rem 3.5rem;
  display: flex; flex-direction: column; gap: 3.5rem;
}
.journal-foot { padding-bottom: 3rem; }

/* ---------- Journal index ---------- */
.journal-head { max-width: 46rem; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: .7rem; }
.journal-head h1 { font-size: clamp(2.4rem, 6vw, 3.4rem); font-weight: 800; }
.post-list {
  list-style: none; margin: 0 auto; padding: .4rem 2.4rem; width: 100%; max-width: 46rem;
  background: var(--sheet); box-shadow: var(--shadow-paper);
}
.post-list:empty { display: none; }
.post-item { padding: 1.6rem 0; border-bottom: 1.5px dashed rgba(30, 42, 58, .35); display: flex; flex-direction: column; gap: .4rem; }
.post-item:last-child { border-bottom: 0; }
.post-item h2 { font-size: clamp(1.4rem, 3.6vw, 1.75rem); font-weight: 700; }
.post-item h2 a { text-decoration: none; }
.post-item h2 a:hover { text-decoration: underline; text-decoration-color: var(--air-red); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.post-item p { color: var(--ink-soft); max-width: 38em; }
.post-item .post-meta { color: var(--ink-soft); }
.journal-empty { max-width: 46rem; margin: 0 auto; width: 100%; font-family: var(--f-hand); font-weight: 700; font-size: 1.6rem; }

/* ---------- A post ---------- */
.post {
  width: 100%; max-width: 48rem; margin: 0 auto; background: var(--sheet); box-shadow: var(--shadow-paper);
  padding: clamp(2rem, 5vw, 3.6rem) clamp(1.2rem, 5vw, 4rem) clamp(2.2rem, 5vw, 3.4rem);
  display: flex; flex-direction: column; gap: 2.4rem;
}
.post-head { display: flex; flex-direction: column; gap: .9rem; padding-bottom: 1.6rem; border-bottom: 3px double var(--ink); }
.post-head .eyebrow a { color: var(--red-ink); text-decoration: none; } /* a link, so it stays red */
.post-head h1 { font-size: clamp(2rem, 5.4vw, 3rem); font-weight: 800; line-height: 1.1; }
.post-meta { font-family: var(--f-type); font-size: 1.08rem; letter-spacing: .02em; color: var(--ink-soft); }
.post-meta a { color: var(--ink); text-underline-offset: 3px; }

.post-figure { margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.post-figure img { width: 100%; height: auto; }
.post-figure figcaption { font-family: var(--f-hand); font-weight: 700; font-size: 1.3rem; color: var(--ink-soft); }

/* the article text: a comfortable line length and roomy lines, on phones too */
.post-body, .post-faq { max-width: 38rem; width: 100%; }
.post-body { font-size: 1.125rem; line-height: 1.75; display: flex; flex-direction: column; gap: 1.15rem; }
.post-body h2 { font-size: clamp(1.55rem, 4vw, 1.9rem); font-weight: 800; margin-top: 1.4rem; }
.post-body h3 { font-size: 1.3rem; margin-top: .6rem; }
.post-body ul, .post-body ol { margin: 0; padding-left: 1.4rem; display: flex; flex-direction: column; gap: .45rem; }
.post-body li::marker { color: var(--label-ink); }
.post-body a { text-decoration-color: var(--air-red); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.post-body blockquote {
  margin: .4rem 0; padding: .2rem 0 .2rem 1.2rem; border-left: 3px solid var(--air-red);
  font-family: var(--f-hand); font-weight: 700; font-size: 1.55rem; line-height: 1.3;
}
.post-body strong { color: var(--ink); }

/* questions at the end of a post: always open, so every answer is on the page */
.post-faq { display: flex; flex-direction: column; gap: .4rem; padding-top: 1.8rem; border-top: 2px solid var(--ink); }
.post-faq h2 { font-size: clamp(1.55rem, 4vw, 1.9rem); font-weight: 800; margin-bottom: .9rem; }
.post-faq h3 { font-size: 1.2rem; padding-top: 1rem; border-top: 1.5px dashed rgba(30, 42, 58, .35); }
.post-faq h3:first-of-type { border-top: 0; padding-top: 0; }
.post-faq p { color: var(--ink-soft); font-size: 1.06rem; line-height: 1.7; margin-bottom: .6rem; }

/* about the author */
.author-box {
  display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 1.1rem; align-items: start;
  max-width: 38rem; padding: 1.3rem 1.4rem; background: var(--envelope);
  outline: 1.5px solid var(--air-blue); outline-offset: -7px;
}
.author-box img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; object-position: 51% 30%; }
.author-box p { color: var(--ink-soft); font-size: 1rem; line-height: 1.6; }
.author-box a { color: var(--ink); font-weight: 700; text-decoration-color: var(--air-red); text-decoration-thickness: 2px; text-underline-offset: 3px; }

.post-join { max-width: 48rem; width: 100%; margin: 0 auto; }

/* ---------- Phones ---------- */
@media (max-width: 680px) {
  .journal.gutter { padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
  .journal { padding-block: 1.6rem 2.5rem; gap: 2.5rem; }
  .post { gap: 2rem; }
  .post-body { font-size: 1.0625rem; line-height: 1.75; }
  .post-list { padding: .2rem 1.3rem; }
  .author-box { grid-template-columns: 64px minmax(0, 1fr); padding: 1.2rem 1.1rem; }
  .author-box img { width: 64px; height: 64px; }
}
