/* =========================================================================
   articles.css — public article pages (articles.html / article.html)

   Only those two pages link this file; everything else keeps style.css.
   Colours come from the :root tokens in style.css so the article pages stay
   inside the same palette. The design system is square-cornered
   (--radius: 0px) — do not introduce rounded corners here.
   ========================================================================= */

/* ----------------------------------------------------------- list page */

/* No 1px-gap + coloured-background seam here. That technique paints the grid's
   background across EVERY cell of the declared columns, so with a single
   article the two empty cells showed up as a 789x505 slab of --paper-line
   sitting on the page. Each card carries its own hairline border instead, so
   unused cells simply render as page background at any article count. */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  background: transparent;
  border: 0;
}
@media (max-width: 1000px) { .posts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 660px)  { .posts-grid { grid-template-columns: 1fr; } }

.post-card {
  background: var(--paper);
  border: 1px solid var(--paper-line);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: background .25s var(--ease);
}
.post-card:hover { background: var(--paper-soft); }

.pc-cover {
  aspect-ratio: 16 / 9;
  background: var(--ink-950);
  overflow: hidden;
  border-bottom: 1px solid var(--paper-line);
  position: relative;
}
.pc-cover img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  opacity: 0;
  transition: opacity .4s var(--ease), transform .6s var(--ease);
}
.pc-cover img.on { opacity: 1; }
.post-card:hover .pc-cover img.on { transform: scale(1.03); }
.pc-cover.is-empty {
  background:
    linear-gradient(135deg, var(--ink-950) 0%, var(--ink-800) 55%, var(--ink-700) 100%);
}

.pc-body {
  padding: 26px 26px 28px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.pc-date {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 12px;
}
.pc-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.34;
  margin: 0 0 12px;
  color: var(--text);
  letter-spacing: -.01em;
}
.pc-title a { color: inherit; text-decoration: none; }
.pc-title a:hover { color: var(--steel); }
.pc-excerpt {
  margin: 0 0 20px;
  color: var(--text-soft);
  font-size: 14.5px;
  line-height: 1.68;
}
.pc-more {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--steel);
  text-decoration: none;
}
.pc-more:hover { color: var(--accent-deep); }
.pc-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 16px;
}

/* --------------------------------------------------------- detail page */

.article-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.article-cover {
  margin: 0 0 34px;
  border: 1px solid var(--paper-line);
  background: var(--ink-950);
}
.article-cover img { width: 100%; height: auto; display: block; }

.article-body {
  font-size: 16.5px;
  line-height: 1.78;
  color: var(--text);
}
.article-body > *:first-child { margin-top: 0; }
/* Heading sizes follow the article outline produced by mdToHtml(): the page
   title is the <h1>, a "##" body section is an <h2>, and "###"/"####" fold
   into <h3>. Mirrored from articles.js — change both together. */
.article-body h2 {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -.01em;
  margin: 42px 0 13px;
  color: var(--text);
}
.article-body h3 {
  font-family: var(--font-display);
  font-size: 17.5px;
  line-height: 1.35;
  margin: 32px 0 10px;
  color: var(--text);
}
.article-body p { margin: 0 0 20px; }
.article-body ul,
.article-body ol { margin: 0 0 20px; padding-left: 24px; }
.article-body li { margin: 8px 0; }
.article-body a {
  color: var(--steel);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.article-body a:hover { color: var(--accent-deep); }
.article-body strong { font-weight: 600; }
.article-body code {
  font-family: var(--font-mono);
  font-size: .88em;
  background: var(--paper-soft);
  border: 1px solid var(--paper-line-2);
  padding: 1px 5px;
}

/* Owner-only preview notice: a draft is readable by the signed-in owner
   through the same SELECT policy, so the page can show it with this banner. */
.draft-banner {
  background: var(--amber-soft);
  border: 1px solid #F0D6A6;
  border-left: 4px solid var(--amber);
  padding: 13px 17px;
  margin-bottom: 28px;
  font-size: 14px;
  line-height: 1.62;
  color: var(--text);
}
.draft-banner b { color: var(--accent-deep); }

.article-empty {
  text-align: center;
  padding: 78px 24px;
  border: 1px solid var(--paper-line);
  background: var(--paper-soft);
}
.article-empty h3 {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 0 0 10px;
}
.article-empty p {
  color: var(--text-soft);
  margin: 0 auto;
  max-width: 460px;
  line-height: 1.7;
}

.article-back {
  margin-top: 52px;
  padding-top: 26px;
  border-top: 1px solid var(--paper-line);
}

@media (max-width: 660px) {
  .article-body { font-size: 16px; }
  .article-body h2 { font-size: 19.5px; margin-top: 34px; }
  .pc-body { padding: 22px 20px 24px; }
}

/* Loading / status line shared by both article pages */
.posts-note {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin: 0 0 22px;
}
.posts-note:empty { display: none; }
