/* page.css — page-specific layout for the "Building in public" (/journey) page.
   Depends on styles.css (the shared design system). */

/* ---- Header ----------------------------------------------------------------
   Mirrors /writing/page.css's .writing-head rhythm exactly, so the two pages
   read as one family. */
.journey-head { padding-block: clamp(2.5rem, 7vw, 5rem) clamp(1.4rem, 3.5vw, 2.5rem); }
.journey-head .display { margin-bottom: 1.4rem; }
.journey-head .lede { max-width: 38ch; }
.journey-head .badge { margin-top: .4rem; }

/* ---- From X — row-major masonry of tweet cards -----------------------------
   No-JS fallback: a single centered column. x-masonry.js deals the cards
   left→right into .x-col flex columns so chronology reads across then down
   (01,02 / 03,04 …) with no row-alignment gaps; reverts to one column below
   the breakpoint or with a lone tweet. */
.x-column {
  display: flex;
  flex-direction: column;
  gap: clamp(1.2rem, 3vw, 1.8rem);
  max-width: 560px;
  margin-inline: auto;
  margin-top: var(--sp-4);
}
.x-column.is-cols {
  flex-direction: row;
  align-items: flex-start;
  max-width: 1120px;
}
.x-column.is-cols .x-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(1.2rem, 3vw, 1.8rem);
}

.x-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.4rem, 3vw, 2rem);
  position: relative;
  overflow: hidden;
  transition: border-color .3s var(--ease), transform .3s var(--ease), box-shadow .3s var(--ease);
}
.x-card::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--accent);
  transform: scaleY(0); transform-origin: top;
  transition: transform .35s var(--ease);
}
.x-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line); }
.x-card:hover::before { transform: scaleY(1); }

.x-meta {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: .9rem;
}
.x-meta .num { color: var(--accent); }

/* Embeds cap themselves around ~550px; let the widget iframe fill the card. */
.x-card .twitter-tweet-rendered { margin: 0 auto !important; max-width: 100%; }

/* ---- Pre-JS fallback — editorial pull-quote --------------------------------
   Only applies before widgets.js swaps the blockquote for a rendered iframe
   (x-embeds.js adds the .twitter-tweet-rendered class at that point), and
   also covers the case where the widget script is blocked entirely. */
.x-card .twitter-tweet:not(.twitter-tweet-rendered) {
  display: block;
  font-family: var(--font-reading);
  font-size: clamp(1rem, 1.6vw, 1.1rem);
  line-height: 1.55;
  color: var(--ink);
  border-left: 3px solid var(--accent);
  padding-left: 1.1em;
  margin: 0;
}
.x-card .twitter-tweet:not(.twitter-tweet-rendered) p {
  margin: 0 0 .8em;
}
.x-card .twitter-tweet:not(.twitter-tweet-rendered) a {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .02em;
  color: var(--accent);
  text-decoration: none;
}
.x-card .twitter-tweet:not(.twitter-tweet-rendered) a:hover { color: var(--ink-2); }

/* ---- Closing CTA ------------------------------------------------------------ */
.journey-cta .wrap { text-align: center; }

@media (max-width: 560px) {
  .x-card { padding: clamp(1.2rem, 5vw, 1.6rem); }
  /* Long CTA label — allow it to wrap instead of forcing horizontal
     overflow via the shared .btn's white-space: nowrap. */
  .journey-cta .btn { white-space: normal; text-align: center; }
}
