/* ============================================================
   RotorLog: content pages (blog, changelog, roadmap)
   Rendered server-side by the Worker (worker/contentTemplates.mjs)
   on top of static.css — this file only adds the content-specific
   layer. Token values mirror src/styles/tokens.css; keep in sync.
   ============================================================ */

:root {
  /* Category accents not present in static.css (mirror tokens.css). */
  --cyan: #30b0c7;
  --amber: #ff9500;
}

/* ---- Nav links (extends the .legal-nav bar) ---- */
.content-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.content-nav::-webkit-scrollbar {
  display: none;
}
.content-nav a {
  flex: none;
  padding: 8px 13px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--t2);
  transition: color 0.3s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.content-nav a:hover {
  color: var(--t1);
  background: var(--glass);
}
.content-nav a.is-active {
  color: var(--t1);
  background: var(--glass);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.content-nav-cta {
  border: 1px solid var(--hairline);
  background: var(--glass);
}
.content-nav a.content-nav-cta {
  color: var(--t1);
}
.content-nav a.content-nav-cta:hover {
  border-color: var(--hairline-2);
  background: var(--glass-2);
}
.content-nav a.content-nav-cta:not(.content-nav-cta--ghost) {
  background: linear-gradient(165deg, rgba(110, 128, 242, 0.95) 0%, var(--blue) 42%, var(--blue-deep) 100%);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
  box-shadow: var(--edge-light), 0 8px 22px -12px rgba(54, 78, 232, 0.75);
}
.content-nav a.content-nav-cta:not(.content-nav-cta--ghost):hover {
  background: linear-gradient(165deg, rgba(110, 128, 242, 1) 0%, var(--blue) 46%, var(--blue-deep) 100%);
}
@media (max-width: 860px) {
  .content-nav .content-nav-cta--ghost {
    display: none;
  }
}
@media (max-width: 620px) {
  .content-nav .content-nav-cta {
    display: none;
  }
  .content-nav a {
    padding: 7px 10px;
    font-size: 12.5px;
  }
}

/* ---- Shared page scaffold ---- */
.content-wrap {
  position: relative;
  z-index: 1;
  max-width: 1140px;
  margin: 0 auto;
  padding: 64px 22px 96px;
}
.content-wrap--narrow {
  max-width: 860px;
}
.content-head {
  margin-bottom: 44px;
  max-width: 720px;
}
.content-title {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: clamp(34px, 6vw, 54px);
  line-height: 1.05;
  margin-bottom: 14px;
}
.content-sub {
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--t2);
  max-width: 560px;
}

/* ---- Empty state ---- */
.content-empty {
  max-width: 560px;
  padding: 44px 34px;
  border-radius: var(--r-lg);
  background: var(--glass);
  border: 1px solid var(--hairline);
  box-shadow: var(--edge-light);
  text-align: left;
}
.content-empty-dot {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--blue-bright);
  box-shadow: 0 0 0 4px rgba(110, 128, 242, 0.18);
  margin-bottom: 18px;
}
.content-empty h2 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  font-size: 24px;
  margin-bottom: 8px;
}
.content-empty p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--t2);
}
.content-empty a {
  color: var(--blue-bright);
}
.content-empty a:hover {
  text-decoration: underline;
}

/* ---- Tag chips + mono meta readouts ---- */
.blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue-bright);
  background: rgba(54, 78, 232, 0.12);
  border: 1px solid rgba(110, 128, 242, 0.3);
}
.blog-meta,
.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  font-family: var(--font-data);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--t3);
}
.blog-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--t4);
  flex: none;
}

/* ---- Blog index: featured card ---- */
.blog-featured {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  border-radius: var(--r-lg);
  background: var(--glass);
  border: 1px solid var(--hairline);
  box-shadow: var(--edge-light), var(--sh-card);
  overflow: hidden;
  margin-bottom: 40px;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.blog-featured:hover {
  transform: translateY(-3px);
  border-color: var(--hairline-2);
  background: var(--glass-2);
}
.blog-featured-media {
  min-height: 280px;
  overflow: hidden;
}
.blog-featured-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.blog-featured-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 30px 32px;
}
.blog-featured-flag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-family: var(--font-data);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--emerald-br);
  background: rgba(50, 215, 75, 0.1);
  border: 1px solid rgba(50, 215, 75, 0.28);
}
.blog-featured-body h2 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  font-size: clamp(24px, 3.4vw, 34px);
  line-height: 1.12;
}
.blog-featured-body p {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--t2);
}
.blog-featured-body .blog-meta {
  margin-top: auto;
  padding-top: 10px;
}
@media (max-width: 820px) {
  .blog-featured {
    grid-template-columns: 1fr;
  }
  .blog-featured-media {
    min-height: 0;
    max-height: 300px;
  }
}

/* ---- Blog index: card grid ---- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 1000px) {
  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
}
.blog-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  background: var(--glass);
  border: 1px solid var(--hairline);
  box-shadow: var(--edge-light);
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.blog-card:hover {
  transform: translateY(-3px);
  border-color: var(--hairline-2);
  background: var(--glass-2);
}
.blog-card-media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.blog-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.blog-card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  padding: 20px 22px 22px;
  flex: 1;
}
.blog-card-body h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 19px;
  line-height: 1.2;
}
.blog-card-body p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--t2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card-body .blog-meta {
  margin-top: auto;
  padding-top: 8px;
}

/* ---- Post page ---- */
.post-shell .legal-head {
  max-width: none;
}
.post-subtitle {
  font-size: 18px;
  line-height: 1.55;
  color: var(--t2);
  max-width: 680px;
  margin-bottom: 16px;
}
.post-meta {
  margin-bottom: 14px;
}
.post-head .blog-tags {
  margin-bottom: 4px;
}
.post-cover {
  margin-top: 26px;
}
.post-cover img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  display: block;
  border-radius: var(--r-lg);
  border: 1px solid var(--hairline);
  box-shadow: var(--sh-card);
}
.post-cover figcaption {
  margin-top: 10px;
  font-family: var(--font-data);
  font-size: 11.5px;
  color: var(--t3);
}

/* Article typography rhythm. The sanitized html lands here verbatim, so every
   element the sanitizer allows gets a deliberate style. */
.post-body {
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--t2);
  max-width: 70ch;
}
.post-body h2 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  font-size: 26px;
  line-height: 1.15;
  color: var(--t1);
  margin: 40px 0 14px;
  scroll-margin-top: 84px;
}
.post-body h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 20px;
  color: var(--t1);
  margin: 30px 0 10px;
}
.post-body h4 {
  font-weight: 700;
  font-size: 16px;
  color: var(--t1);
  margin: 24px 0 8px;
}
.post-body > :first-child {
  margin-top: 0;
}
.post-body p {
  margin: 0 0 16px;
}
.post-body a {
  color: var(--blue-bright);
}
.post-body a:hover {
  text-decoration: underline;
}
.post-body strong {
  color: var(--t1);
  font-weight: 700;
}
.post-body ul,
.post-body ol {
  margin: 0 0 16px;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.post-body blockquote {
  margin: 22px 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--blue);
  color: var(--t1);
  font-size: 17px;
}
.post-body blockquote p:last-child {
  margin-bottom: 0;
}
.post-body hr {
  border: none;
  height: 1px;
  background: var(--hairline);
  margin: 34px 0;
}
.post-body img {
  max-width: 100%;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  display: block;
  margin: 22px 0;
}
.post-body figure {
  margin: 22px 0;
}
.post-body figure img {
  margin: 0;
}
.post-body figcaption {
  margin-top: 10px;
  font-family: var(--font-data);
  font-size: 11.5px;
  color: var(--t3);
}

/* Callouts (emitted by the markdown renderer's > [!NOTE] extension) */
.post-body .callout {
  margin: 22px 0;
  padding: 16px 20px;
  border-radius: var(--r-md);
  background: var(--glass);
  border: 1px solid var(--hairline);
  box-shadow: var(--edge-light);
}
.post-body .callout p:last-child {
  margin-bottom: 0;
}
.post-body .callout-info {
  background: rgba(54, 78, 232, 0.08);
  border-color: rgba(110, 128, 242, 0.28);
}
.post-body .callout-warn {
  background: rgba(255, 149, 0, 0.07);
  border-color: rgba(255, 149, 0, 0.3);
}

/* Code, in the cockpit typeface on a dark inset */
.post-body code {
  font-family: var(--font-data);
  font-size: 0.86em;
  background: var(--bg-1);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 2px 6px;
  color: var(--t1);
}
.post-body pre {
  margin: 22px 0;
  padding: 18px 20px;
  border-radius: var(--r-md);
  background: var(--bg-1);
  border: 1px solid var(--hairline);
  overflow-x: auto;
}
.post-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--t1);
}

/* Tables scroll inside their own box, like .legal-table-wrap */
.post-body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 22px 0;
  font-size: 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
}
.post-body th,
.post-body td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
  line-height: 1.55;
  min-width: 120px;
}
.post-body tr:last-child td {
  border-bottom: none;
}
.post-body th {
  font-weight: 700;
  color: var(--t1);
  background: var(--glass);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---- Prev / next ---- */
.post-pn {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 44px;
}
@media (max-width: 560px) {
  .post-pn {
    grid-template-columns: 1fr;
  }
  .post-pn-spacer {
    display: none;
  }
}
.post-pn-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border-radius: var(--r-md);
  background: var(--glass);
  border: 1px solid var(--hairline);
  box-shadow: var(--edge-light);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.post-pn-card:hover {
  transform: translateY(-2px);
  border-color: var(--hairline-2);
  background: var(--glass-2);
}
.post-pn-card--next {
  text-align: right;
  align-items: flex-end;
}
.post-pn-label {
  font-family: var(--font-data);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t3);
}
.post-pn-title {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.35;
  color: var(--t1);
}

/* ---- Closing CTA ---- */
.post-cta {
  margin-top: 44px;
  padding: 34px 32px;
  border-radius: var(--r-lg);
  background: rgba(54, 78, 232, 0.08);
  border: 1px solid rgba(110, 128, 242, 0.28);
  box-shadow: var(--edge-light);
  text-align: center;
}
.post-cta h2 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  font-size: 26px;
  margin-bottom: 8px;
}
.post-cta p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--t2);
  max-width: 480px;
  margin: 0 auto 22px;
}
.post-cta-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
@media (max-width: 520px) {
  .post-cta-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ---- Changelog timeline ---- */
.cl-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding-left: 26px;
}
.cl-timeline::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 0;
  width: 1px;
  background: var(--hairline);
}
.cl-entry {
  position: relative;
}
.cl-entry::before {
  content: "";
  position: absolute;
  top: 10px;
  left: -30px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--blue-bright);
  box-shadow: 0 0 0 4px rgba(110, 128, 242, 0.16);
}
.cl-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.cl-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 13px;
  border-radius: var(--r-pill);
  font-family: var(--font-data);
  font-size: 12.5px;
  letter-spacing: 0.03em;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: var(--edge-light), 0 8px 20px -10px rgba(54, 78, 232, 0.7);
}
.cl-date {
  font-family: var(--font-data);
  font-size: 11.5px;
  color: var(--t3);
}
.cl-title {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  font-size: 22px;
  margin-bottom: 12px;
}
.cl-items {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cl-items li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--t2);
}
.cl-text {
  min-width: 0;
  overflow-wrap: break-word;
}
.cl-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-family: var(--font-data);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t2);
  background: var(--glass);
  border: 1px solid var(--hairline);
}
.cl-chip--feature {
  color: var(--emerald-br);
  background: rgba(50, 215, 75, 0.1);
  border-color: rgba(50, 215, 75, 0.28);
}
.cl-chip--improvement {
  color: var(--cyan);
  background: rgba(48, 176, 199, 0.1);
  border-color: rgba(48, 176, 199, 0.3);
}
.cl-chip--fix {
  color: var(--amber);
  background: rgba(255, 149, 0, 0.09);
  border-color: rgba(255, 149, 0, 0.3);
}

/* ---- Roadmap board ---- */
.rm-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .rm-board {
    grid-template-columns: 1fr;
  }
}
.rm-col {
  border-radius: var(--r-lg);
  background: var(--glass);
  border: 1px solid var(--hairline);
  box-shadow: var(--edge-light);
  padding: 18px 16px;
}
.rm-col-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 2px 6px 14px;
}
.rm-col-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 17px;
}
.rm-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.rm-col--planned .rm-dot {
  background: var(--blue-bright);
  box-shadow: 0 0 0 3px rgba(110, 128, 242, 0.18);
}
.rm-col--building .rm-dot {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(255, 149, 0, 0.18);
}
.rm-col--shipped .rm-dot {
  background: var(--emerald);
  box-shadow: 0 0 0 3px rgba(50, 215, 75, 0.18);
}
.rm-count {
  margin-left: auto;
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--t3);
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--glass);
  border: 1px solid var(--hairline);
}
.rm-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rm-card {
  padding: 16px 18px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--hairline);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.rm-card:hover {
  transform: translateY(-2px);
  border-color: var(--hairline-2);
  background: var(--glass-2);
}
.rm-card h3 {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.35;
  margin-bottom: 5px;
}
.rm-card p {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--t2);
}
.rm-shipped {
  display: inline-block;
  margin-top: 9px;
  font-family: var(--font-data);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  color: var(--emerald-br);
}
.rm-empty {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--t3);
  padding: 6px 6px 8px;
}

/* ---- Responsive hardening (same contract as the legal pages) ---- */
.content-title,
.blog-featured-body h2,
.blog-card-body h3,
.post-body,
.cl-title,
.rm-card h3 {
  overflow-wrap: break-word;
}
@media (max-width: 480px) {
  .content-wrap {
    padding-left: 18px;
    padding-right: 18px;
  }
  .blog-featured-body,
  .post-cta {
    padding-left: 22px;
    padding-right: 22px;
  }
  .cl-timeline {
    padding-left: 20px;
  }
  .cl-entry::before {
    left: -24px;
  }
}

/* ---- Small-screen hardening ----
   A `1fr` grid track's automatic minimum is the content's min-content size,
   so one unbreakable token (a registration, a pasted URL) or an image's
   intrinsic width can push a collapsed column far past the viewport — where
   the page's overflow clip silently cuts it off instead of scrolling.
   Anywhere-wrapping plus minmax(0, …) tracks keep every layout honest at
   every width. */

.blog-featured-media,
.blog-featured-body,
.blog-card-media,
.blog-card-body,
.rm-col,
.rm-card,
.cl-entry {
  min-width: 0;
}

.blog-featured-body h2,
.blog-featured-body p,
.blog-card-body h3,
.blog-card-body p,
.post-shell .legal-title,
.post-subtitle,
.post-body,
.post-shell .legal-toc a,
.cl-title,
.cl-text,
.rm-card h3,
.rm-card p,
.content-empty p {
  overflow-wrap: anywhere;
}

@media (max-width: 820px) {
  .blog-featured {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .rm-board {
    grid-template-columns: minmax(0, 1fr);
  }

  /* static.css collapses .legal-shell to a bare 1fr at this width; repeat it
     as minmax(0, 1fr) for post pages only (blog.css loads after static.css). */
  .post-shell {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Stored post HTML carries bare <table> markup (no wrapper element), so wide
   tables scroll as blocks instead of pushing the page. */
.post-body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
