/* ═══════════════════════════════════════════════════════════════
   ARTICLES STYLESHEET — "THE JOURNAL"
   Loaded AFTER main.css by articles.php and article.php.
   Implements mockup screen 1g: centred journal masthead, hairline
   card grid, and a narrow centred reading column for the essay.

   The .article-card markup is generated in TWO places — the PHP in
   articles.php and the JS template in assets/js/articles.js. If you
   change the card structure, change both.
   ═══════════════════════════════════════════════════════════════ */

/* ── INDEX: masthead ─────────────────────────────────────── */
.articles-hero {
  padding: calc(var(--nav-h) + 3.25rem) var(--pad-x) 3rem;
  background: var(--paper-warm);
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.articles-hero .section-inner { padding: 0; }
.articles-hero .section-label { margin-bottom: .8rem; }
.articles-hero-title {
  font-family: var(--font-display); font-size: 3rem; font-weight: 400;
  line-height: 1.14; color: var(--ink); margin-bottom: .7rem; text-wrap: pretty;
}
.articles-hero-title em { font-style: normal; color: var(--accent); }
.articles-hero-sub      { color: var(--ink-mid); font-size: 1.2rem;
                          max-width: 56ch; margin: 0 auto; }

/* ── INDEX: tag filter ───────────────────────────────────── */
.articles-section { padding: var(--section-y) 0; }

.articles-filter { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 2.5rem;
                   justify-content: center; }
.tag-btn {
  font-family: var(--font-ui); font-size: .76rem; letter-spacing: .08em;
  cursor: pointer; padding: .6rem 1.2rem; border-radius: var(--radius);
  border: 1px solid var(--line); background: transparent; color: var(--ink-body);
  transition: border-color .2s ease, color .2s ease;
}
.tag-btn:hover { border-color: var(--accent); color: var(--accent); }
/* REQUIRED — articles.js moves .active to the clicked button */
.tag-btn.active { background: var(--accent); border-color: var(--accent); color: var(--paper); }

/* ── INDEX: card grid ────────────────────────────────────── */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--gap);
}
/* Both states span the full grid so they read as one message, not a card */
.articles-empty,
.articles-loading { grid-column: 1 / -1; color: var(--ink-light); padding: 2.5rem 0;
                    font-family: var(--font-ui); font-size: .9rem; text-align: center; }

.article-card {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  background: var(--card); overflow: hidden;
  transition: border-color .25s ease, transform .25s ease;
}
.article-card:hover      { border-color: var(--accent-alt); transform: translateY(-3px); }
.article-card-img        { width: 100%; height: 200px; object-fit: cover; }
.article-card-body       { padding: 1.6rem; }
.article-card-tag        { font-family: var(--font-ui); font-size: .64rem; letter-spacing: .2em;
                           text-transform: uppercase; color: var(--accent-alt); margin-bottom: .6rem; }
.article-card-title      { font-family: var(--font-display); font-size: 1.35rem;
                           font-weight: 400; line-height: 1.3; color: var(--ink); margin-bottom: .5rem; }
.article-card-excerpt    { color: var(--ink-mid); font-size: 1.05rem; line-height: 1.55; margin-bottom: 1rem; }
.article-card-date       { font-family: var(--font-ui); font-size: .68rem; letter-spacing: .12em;
                           text-transform: uppercase; color: var(--ink-light); }

/* ── SINGLE ARTICLE ──────────────────────────────────────── */
.article-page      { padding: calc(var(--nav-h) + 2.5rem) var(--pad-x) var(--section-y);
                     background: var(--card); }
.article-container { max-width: 760px; margin: 0 auto; }

.article-back  { display: inline-block; font-family: var(--font-ui); font-size: .72rem;
                 letter-spacing: .16em; text-transform: uppercase;
                 text-decoration: none; margin-bottom: 2.5rem; color: var(--accent); }

/* Centred masthead, as in the mockup's article screen */
.article-head  { text-align: center; margin-bottom: 2.5rem; }
.article-tag   { font-family: var(--font-ui); font-size: .66rem; letter-spacing: .22em;
                 text-transform: uppercase; color: var(--accent-alt); margin-bottom: .9rem; }
.article-title { font-family: var(--font-display); font-size: 2.75rem; font-weight: 400;
                 line-height: 1.16; color: var(--ink); margin-bottom: .9rem; text-wrap: pretty; }
.article-meta  { font-family: var(--font-ui); font-size: .72rem; letter-spacing: .12em;
                 text-transform: uppercase; color: var(--ink-light); }

/* The byline row with the small logo */
.article-byline { display: flex; align-items: center; justify-content: center; gap: .8rem;
                  margin-top: 1.2rem; }
.article-byline-logo { width: 34px; height: 34px; object-fit: contain; flex: none; }
.article-byline-name { font-size: 1.1rem; color: var(--ink-mid); }

.article-image { width: 100%; margin-bottom: 2.5rem; border: 1px solid var(--line); }

/* ── ARTICLE BODY ────────────────────────────────────────────
   This is admin-authored HTML from the rich-text editor. Style the
   raw tags — you cannot add classes to what the editor produces. */
.article-body            { font-size: 1.24rem; line-height: 1.75; color: var(--ink-body); }
/* The opening paragraph carries the mockup's larger standfirst size */
.article-body > p:first-child { font-size: 1.42rem; line-height: 1.55; color: var(--ink); }
.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4         { font-family: var(--font-display); font-weight: 400;
                           color: var(--ink); line-height: 1.3; margin: 2.4rem 0 .8rem; }
.article-body h1         { font-size: 2rem; }
.article-body h2         { font-size: 1.65rem; }
.article-body h3         { font-size: 1.35rem; }
.article-body h4         { font-size: 1.15rem; }
.article-body p          { margin-bottom: 1.3rem; text-wrap: pretty; }
.article-body ul,
.article-body ol         { margin: 0 0 1.3rem 1.5rem; }
.article-body li         { margin-bottom: .45rem; }
.article-body a          { color: var(--accent); text-decoration: underline;
                           text-underline-offset: 3px; }
.article-body img        { margin: 1.8rem 0; border: 1px solid var(--line); }
.article-body blockquote { margin: 2rem 0; padding: 1.6rem 1.9rem;
                           background: var(--paper-warm); border-left: 3px solid var(--accent-alt);
                           font-style: italic; font-size: 1.3rem; line-height: 1.5; color: var(--ink); }
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body pre        { background: var(--paper-warm); padding: 1rem; overflow-x: auto;
                           font-size: .92rem; margin-bottom: 1.3rem; white-space: pre-wrap;
                           border: 1px solid var(--line); }
.article-body hr         { border: 0; border-top: 1px solid var(--line); margin: 2.4rem 0; }
.article-body table      { width: 100%; border-collapse: collapse; margin-bottom: 1.3rem; font-size: 1.05rem; }
.article-body th,
.article-body td         { border: 1px solid var(--line); padding: .6rem .8rem; text-align: left; }
.article-body th         { background: var(--paper-warm); font-family: var(--font-ui);
                           font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
                           font-weight: 400; color: var(--ink-light); }

/* ── END-OF-ARTICLE CALL TO ACTION ───────────────────────── */
.article-cta    { margin-top: 3.5rem; padding: 2.5rem; background: var(--dark);
                  color: var(--on-dark); border-radius: var(--radius);
                  display: flex; justify-content: space-between; align-items: center;
                  gap: 1.5rem; flex-wrap: wrap; text-align: left; }
.article-cta h3 { font-family: var(--font-display); font-size: 1.55rem;
                  font-weight: 400; color: var(--cream); margin-bottom: .4rem; }
.article-cta p  { color: var(--on-dark); font-size: 1.1rem; margin: 0; }
.article-cta .btn-primary { background: var(--gold); border-color: var(--gold);
                            color: var(--dark); white-space: nowrap; }
.article-cta .btn-primary:hover { background: var(--gold-soft); border-color: var(--gold-soft);
                                  color: var(--dark); }

/* Tag chips under the essay */
.article-tags { display: flex; gap: .6rem; flex-wrap: wrap;
                margin-top: 2.75rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.article-tags span { padding: .5rem 1rem; border: 1px solid var(--line);
                     font-family: var(--font-ui); font-size: .68rem; letter-spacing: .12em;
                     text-transform: uppercase; color: var(--ink-mid); }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .articles-hero-title { font-size: 2.1rem; }
  .article-title       { font-size: 1.95rem; }
  .article-body        { font-size: 1.15rem; }
  .article-body > p:first-child { font-size: 1.25rem; }
  .article-cta         { padding: 1.75rem; }
}
