/* articles.css — 教程: the article page (and, later, the list and the group pages).
 * Author: [ASTRO-S3] helper of the 命理学 iMac window — a17 supervisor (Claude Opus 5.5), 2026-11-15. New file.
 *
 * A reading design in the openings' look: ink ground, the Song face for the title and the text's own bold lines, the
 * system sans for running text. Running text 18px / 1.95 (16px / 1.9 at 600px and below), column 36em = 36 Han at
 * 1440; colour #DDD3BE on #0A0907 (13.9:1), the dimmest text #B3A994 (8.5:1), links #E2A847 (9.6:1).
 *
 * The articles' own inline presentation is removed by the content filter (inc/articles.php); the few rules marked
 * "net" below repeat the essentials so that an inline style the filter did not foresee still cannot make text dark,
 * a box white or a picture wider than the column.
 *
 * Isolation (the technique of home-sections.css): the root starts from initial values; every descendant except SVG,
 * pictures and canvas is rolled back to the browser's defaults at (0,1,1); this file's own rules are at (0,2,0) or
 * more. The difference from the other sections: the markup inside .astro-article__text is not ours, so its rules
 * are written for element names (p, section, span, strong, img, figure, h1–h6, blockquote, ul, ol, table …), not
 * classes. No rem (Bricks sets the root size), no web font, nothing from another host.
 * Co-written: [ASTRO-R6] helper of the 命理学 iMac window — a5 supervisor, session of 2026-11-15 (Claude Opus 5.5), 2026-11-16
 * (owner decision N208): no date of publication on the article page or in the lists; the list's date rule
 * (.aa-item__date) went with the date. */

.astro-article { all: initial; min-width: 0; min-height: 0; }
.astro-article *:not(svg, svg *, img, canvas),
.astro-article :where(*:not(svg, svg *, img, canvas))::before,
.astro-article :where(*:not(svg, svg *, img, canvas))::after,
.astro-article :where(*:not(svg, svg *, img, canvas))::marker { all: revert; box-sizing: border-box; }
.astro-article svg, .astro-article svg * { border-color: revert; min-width: revert; min-height: revert; box-sizing: revert; }
.astro-article img { border-color: revert; box-sizing: revert; vertical-align: revert; max-inline-size: revert; }
.astro-article.astro-article :focus { outline: revert; outline-offset: revert; }

.astro-article {
  --aa-ink: #0A0907;
  --aa-text: #ECE3D0;   /* title, bold lines, 15.6:1 */
  --aa-body: #DDD3BE;   /* running text, 13.9:1 */
  --aa-dim: #B3A994;    /* meta, way labels, 8.5:1 */
  --aa-lamp: #E2A847;   /* links, numerals, 9.6:1 */
  --aa-line: rgba(226, 168, 71, .28);
  --aa-song: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif CJK SC", "Source Han Serif", "Noto Serif SC", serif;
  --aa-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --aa-col: 648px;      /* 36 × 18px */
  --aa-x: clamp(20px, 5vw, 48px);
  display: block;
  box-sizing: border-box;
  width: 100%;
  background: var(--aa-ink);
  color: var(--aa-body);
  font-family: var(--aa-sans);
  font-size: 18px;
  line-height: 1.95;
  -webkit-font-smoothing: antialiased;
  padding: calc(var(--astro-header-h, 0px) + 72px) var(--aa-x) 96px;
  overflow-wrap: anywhere;
}

/* ---------- head ---------- */
.astro-article .astro-article__head { max-width: var(--aa-col); margin: 0 auto 40px; display: block; }
.astro-article .astro-article__meta {
  margin: 0 0 20px; font-size: 14px; line-height: 1.6; letter-spacing: .12em; color: var(--aa-dim);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px;
}
.astro-article .astro-article__group { color: var(--aa-lamp); text-decoration: none; text-transform: none; }
.astro-article .astro-article__group:hover { text-decoration: underline; text-underline-offset: 4px; }
.astro-article .astro-article__title {
  margin: 0; font-family: var(--aa-song); font-weight: 600; font-size: clamp(28px, 3vw, 42px); line-height: 1.4;
  letter-spacing: .04em; color: var(--aa-text); text-wrap: balance;
}
.astro-article .astro-article__cover {
  display: block; max-width: calc(var(--aa-col) + 160px); margin: 0 auto 56px;
}
.astro-article .astro-article__cover img { display: block; width: 100%; height: auto; max-width: 100%; border-radius: 2px; }

/* ---------- the text (markup not ours) ---------- */
.astro-article .astro-article__text { display: block; max-width: var(--aa-col); margin: 0 auto; }
.astro-article .astro-article__text :where(section, div, article, figure, center) {
  display: block; max-width: 100%; margin: 0; padding: 0;
}
.astro-article .astro-article__text p { margin: 0 0 1.15em; }
.astro-article .astro-article__text :where(span, font, em, i, u, small, big, sub, sup, label) { font-size: inherit; }
.astro-article .astro-article__text :where(strong, b) { font-weight: 600; color: var(--aa-text); }
.astro-article .astro-article__text a { color: var(--aa-lamp); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.astro-article .astro-article__text :where(h1, h2, h3, h4, h5, h6) {
  font-family: var(--aa-song); font-weight: 600; color: var(--aa-text); line-height: 1.5; margin: 1.8em 0 .7em; letter-spacing: .04em;
}
.astro-article .astro-article__text h1, .astro-article .astro-article__text h2 { font-size: 28px; }
.astro-article .astro-article__text h3 { font-size: 24px; }
.astro-article .astro-article__text h4 { font-size: 21px; }
.astro-article .astro-article__text h5, .astro-article .astro-article__text h6 { font-size: 19px; }
.astro-article .astro-article__text blockquote {
  margin: 1.6em 0; padding: 0 0 0 1.2em; border-left: 1px solid var(--aa-lamp); color: var(--aa-text);
}
.astro-article .astro-article__text :where(ul, ol) { margin: 0 0 1.15em; padding: 0 0 0 1.6em; }
.astro-article .astro-article__text li { margin: 0 0 .4em; }
.astro-article .astro-article__text li::marker { color: var(--aa-lamp); }
.astro-article .astro-article__text hr { border: 0; border-top: 1px solid var(--aa-line); margin: 2.4em 0; }
.astro-article .astro-article__text img { display: block; max-width: 100%; height: auto; margin: 1.6em auto; border-radius: 2px; }
.astro-article .astro-article__text figcaption { font-size: 14px; line-height: 1.7; color: var(--aa-dim); text-align: center; margin: -.8em 0 1.6em; }
/* tables (none today): scroll inside their own box, never widen the page */
.astro-article .astro-article__text :where(.wp-block-table, figure:has(> table)) { overflow-x: auto; }
.astro-article .astro-article__text table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 16px; line-height: 1.7; }
.astro-article .astro-article__text :where(td, th) { border: 1px solid var(--aa-line); padding: 8px 12px; vertical-align: top; }
.astro-article .astro-article__text :where(pre, code) { white-space: pre-wrap; font-size: 15px; }

/* net: an inline style the filter did not foresee */
.astro-article .astro-article__text :where(*:not(img, svg, svg *, a, strong, b, h1, h2, h3, h4, h5, h6)) { color: inherit !important; background-color: transparent !important; }
.astro-article .astro-article__text :where(*:not(img, svg, svg *)) { max-width: 100% !important; }
.astro-article .astro-article__text :where(strong, b, h1, h2, h3, h4, h5, h6) { color: var(--aa-text) !important; background-color: transparent !important; }
.astro-article .astro-article__text a { color: var(--aa-lamp) !important; }

/* ---------- the way on ---------- */
.astro-article .astro-article__way {
  max-width: var(--aa-col); margin: 80px auto 0; padding: 32px 0 0; border-top: 1px solid var(--aa-line);
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px 32px;
}
.astro-article .astro-article__way a { display: block; color: var(--aa-text); text-decoration: none; }
.astro-article .astro-article__next { grid-column: 2; text-align: right; }
.astro-article .astro-article__waylabel { display: block; font-size: 13px; letter-spacing: .2em; color: var(--aa-dim); margin: 0 0 6px; }
.astro-article .astro-article__waytitle { display: block; font-family: var(--aa-song); font-size: 18px; line-height: 1.6; }
.astro-article .astro-article__way a:hover .astro-article__waytitle { color: var(--aa-lamp); }
.astro-article .astro-article__back {
  grid-column: 1 / -1; justify-self: center; margin-top: 24px; font-size: 15px; letter-spacing: .3em; color: var(--aa-lamp) !important;
  padding: 10px 28px; border: 1px solid var(--aa-line); border-radius: 999px;
}
.astro-article .astro-article__back:hover { border-color: var(--aa-lamp); }

@media (max-width: 600px) {
  .astro-article { font-size: 16px; line-height: 1.9; padding-top: calc(var(--astro-header-h, 0px) + 40px); padding-bottom: 72px; }
  .astro-article .astro-article__head { margin-bottom: 28px; }
  .astro-article .astro-article__cover { margin-bottom: 36px; }
  .astro-article .astro-article__way { grid-template-columns: 1fr; }
  .astro-article .astro-article__next { grid-column: 1; text-align: left; }
}

/* A heading that holds whole paragraphs is not a heading: 524 (science) has its entire text inside one <h5>, pasted
 * from Word. Such a heading reads as running text; a real heading (text only) keeps the scale above. */
.astro-article .astro-article__text :is(h1, h2, h3, h4, h5, h6):has(p, div, section, ul, ol, table, blockquote) {
  font-family: inherit; font-size: inherit; font-weight: 400; line-height: inherit; letter-spacing: normal; margin: 0;
  color: var(--aa-body) !important;
}

/* ===================== 教程: the list (templates/blog.php, category.php, archive.php) — [ASTRO-S3], sitting 2 =====================
 * Not a grid of cards: each group opens with its newest article large (picture beside the text at 1440, above it on a
 * phone), then a measured single column of rows — a small picture in a fixed 16:9 box, date, title, the beginning of
 * the text — divided by hairlines. Pictures sit in aspect boxes, so nothing jumps while the image plugin loads them. */
.astro-articles { all: initial; min-width: 0; min-height: 0; }
.astro-articles *:not(svg, svg *, img, canvas),
.astro-articles :where(*:not(svg, svg *, img, canvas))::before,
.astro-articles :where(*:not(svg, svg *, img, canvas))::after,
.astro-articles :where(*:not(svg, svg *, img, canvas))::marker { all: revert; box-sizing: border-box; }
.astro-articles img { border-color: revert; box-sizing: revert; vertical-align: revert; max-inline-size: revert; }
.astro-articles.astro-articles :focus { outline: revert; outline-offset: revert; }
.astro-articles {
  --aa-ink: #0A0907; --aa-text: #ECE3D0; --aa-body: #DDD3BE; --aa-dim: #B3A994; --aa-lamp: #E2A847;
  --aa-line: rgba(226, 168, 71, .22);
  --aa-song: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif CJK SC", "Source Han Serif", "Noto Serif SC", serif;
  --aa-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  display: block; box-sizing: border-box; width: 100%; background: var(--aa-ink); color: var(--aa-body);
  font-family: var(--aa-sans); font-size: 17px; line-height: 1.9; -webkit-font-smoothing: antialiased;
  padding: calc(var(--astro-header-h, 0px) + 72px) clamp(20px, 5vw, 48px) 112px; overflow-wrap: anywhere;
}
.astro-articles .aa-wrap { display: block; max-width: 1040px; margin: 0 auto; }
.astro-articles .aa-head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; margin: 0 0 56px; }
.astro-articles .aa-title { margin: 0; font-family: var(--aa-song); font-weight: 600; font-size: clamp(32px, 3.4vw, 48px); line-height: 1.3; letter-spacing: .14em; color: var(--aa-text); }
.astro-articles .aa-back { color: var(--aa-lamp); text-decoration: none; font-size: 15px; letter-spacing: .3em; padding: 8px 24px; border: 1px solid var(--aa-line); border-radius: 999px; }
.astro-articles .aa-back:hover { border-color: var(--aa-lamp); }
.astro-articles .aa-group { display: block; margin: 0 0 96px; }
.astro-articles .aa-group__name { display: flex; align-items: baseline; gap: 16px; margin: 0 0 28px; padding: 0 0 14px; border-bottom: 1px solid var(--aa-line); font-family: var(--aa-song); font-weight: 600; font-size: 24px; line-height: 1.4; letter-spacing: .16em; }
.astro-articles .aa-group__name a { color: var(--aa-lamp); text-decoration: none; }
.astro-articles .aa-group__name a:hover { text-decoration: underline; text-underline-offset: 6px; }
.astro-articles .aa-group__count { font-family: var(--aa-sans); font-size: 14px; font-weight: 400; letter-spacing: .1em; color: var(--aa-dim); }
.astro-articles .aa-list { list-style: none; margin: 0; padding: 0; display: block; }
.astro-articles .aa-item { display: block; margin: 0; border-bottom: 1px solid var(--aa-line); }
.astro-articles .aa-item__link { display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: start; padding: 28px 0; color: inherit; text-decoration: none; }
.astro-articles .aa-item--nopic .aa-item__link { grid-template-columns: 1fr; }
.astro-articles .aa-item__pic { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #15130F; border-radius: 2px; }
.astro-articles .aa-item__img { display: block; width: 100%; height: 100%; max-width: 100%; object-fit: cover; }
.astro-articles .aa-item__body { display: block; min-width: 0; }
.astro-articles .aa-item__title { display: block; font-family: var(--aa-song); font-weight: 600; font-size: 21px; line-height: 1.5; letter-spacing: .04em; color: var(--aa-text); margin: 0 0 8px; }
.astro-articles .aa-item__teaser { display: block; font-size: 16px; line-height: 1.85; color: var(--aa-dim); max-width: 38em; }
.astro-articles .aa-item__link:hover .aa-item__title { color: var(--aa-lamp); }
/* the lead */
.astro-articles .aa-item--lead .aa-item__link { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 48px; padding: 8px 0 44px; align-items: center; }
.astro-articles .aa-item--lead .aa-item__title { font-size: clamp(26px, 2.4vw, 34px); line-height: 1.4; margin-bottom: 16px; }
.astro-articles .aa-item--lead .aa-item__teaser { font-size: 17px; line-height: 1.9; color: var(--aa-body); }
@media (max-width: 820px) {
  .astro-articles .aa-item--lead .aa-item__link { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 600px) {
  .astro-articles { padding-top: calc(var(--astro-header-h, 0px) + 40px); font-size: 16px; }
  .astro-articles .aa-head { margin-bottom: 36px; }
  .astro-articles .aa-item__link { grid-template-columns: 112px 1fr; gap: 16px; padding: 22px 0; }
  .astro-articles .aa-item__title { font-size: 18px; }
  .astro-articles .aa-item__teaser { font-size: 15px; line-height: 1.8; }
  .astro-articles .aa-group { margin-bottom: 64px; }
}
