/* KB#4071 The blog in the heavy luxury (program KB#4045, item 5; Decision #481). One stylesheet loaded after
   blog.css and blog-foreground.css on every blog page and in both templates of scripts/build-blog.py; the articles,
   their texts, links and markup are untouched.
   - The page wears the base of main.css (body.pn-base-page, KB#4062): the warm paper of the Academy and FAQ in the
     light theme, the deep jade in the dark one; ink, links and focus follow its tokens.
   - Cards, the table of contents, the sidebar and the highlight boxes are plates: paper in a copper hairline in the
     light theme, the jade plate in a copper rim in the dark one. The two calls to action are jade plates in both themes
     with ivory ink, like the sign-in card (KB#4058).
   - Copper replaces the cyan of blog.css: links, tags, the category, the reading progress (it ran cyan into violet),
     table heads and quotes.
   Nothing smaller than 16 px for the 60+ audience (KB#4024). */

body[data-page="blog"] {
  --bl-copper: var(--accent);
  --bl-rim: rgb(133 85 47 / .42);
  --bl-rim-strong: #85552f;
  --bl-plate: linear-gradient(180deg, #fffaf2, #fbf7f0);
  --bl-tint: rgb(133 85 47 / .07);
  --bl-tint-strong: rgb(133 85 47 / .12);
  --bl-jade-plate:
    linear-gradient(180deg, rgb(255 236 210 / .07), transparent 40%),
    radial-gradient(120% 140% at 30% 20%, rgb(60 130 96 / .16), rgb(2 18 13 / .32)),
    url("/landing-assets/toc/jade-plate.webp") 50% 50% / 640px auto,
    #0b2a22;
  --bl-jade-rim: #b67c4e;
}
:root[data-theme="dark"] body[data-page="blog"] {
  --bl-rim: rgb(182 124 78 / .7);
  --bl-rim-strong: #b67c4e;
  --bl-plate: var(--bl-jade-plate);
  --bl-tint: rgb(214 152 101 / .1);
  --bl-tint-strong: rgb(214 152 101 / .16);
}

/* plates */
body[data-page="blog"] #main.pn-foreground :is(.blog-card, .related-card, .sidebar-widget, .toc, .article-body .highlight-box) {
  background: var(--bl-plate);
  border: 1px solid var(--bl-rim);
  border-radius: 6px;
  box-shadow: 0 1px 0 rgb(255 240 220 / .06) inset, 0 14px 30px rgb(0 0 0 / .14);
}
body[data-page="blog"] #main.pn-foreground :is(.blog-card, .related-card):hover {
  border-color: var(--bl-rim-strong);
  box-shadow: 0 1px 0 rgb(255 240 220 / .08) inset, 0 18px 36px rgb(0 0 0 / .2);
}

/* the calls to action: jade plates with ivory ink in both themes */
body[data-page="blog"] #main.pn-foreground :is(.article-cta, .sidebar-cta) {
  --pn-fg-primary: #f5ecdf;
  --pn-fg-secondary: #c9d6d0;
  --pn-fg-on-dark: #f5ecdf;
  --pn-fg-on-dark-muted: #c9d6d0;
  --pn-fg-link: #e9b386;
  --pn-fg-focus: #f5ecdf;
  background: var(--bl-jade-plate);
  border: 1px solid var(--bl-jade-rim);
  border-radius: 6px;
  box-shadow: 0 1px 0 rgb(255 240 220 / .08) inset, 0 16px 34px rgb(0 0 0 / .22);
  color-scheme: dark;
}
body[data-page="blog"] #main.pn-foreground :is(.article-cta h3, .sidebar-cta h4) { color: #f5ecdf; }
body[data-page="blog"] #main.pn-foreground :is(.article-cta p, .sidebar-cta p) { color: #c9d6d0; }

/* copper labels: the category, tags, the reading progress */
body[data-page="blog"] #main.pn-foreground :is(.article-category, .blog-card-tag, .article-tag, .article-tags .tag) {
  color: var(--pn-fg-primary);
  background: var(--bl-tint);
  border: 1px solid var(--bl-rim);
  border-radius: 999px;
}
body[data-page="blog"] #main.pn-foreground .article-tag:hover { border-color: var(--bl-rim-strong); color: var(--pn-fg-primary); }
body[data-page="blog"] .reading-progress { background: linear-gradient(90deg, #85552f, #e9b386); }

/* links in copper with a copper hairline under them (the crumbs keep the link role of the base: dark copper on the
   paper of an article, light copper on the dark crumbs band of the listing) */
body[data-page="blog"] #main.pn-foreground :is(.article-body a, .toc a, .sidebar-link-list a, .blog-card-link, .blog-layout > article > ul a, .related-card a) {
  color: var(--bl-copper);
  text-decoration-color: color-mix(in srgb, var(--bl-copper) 55%, transparent);
}
body[data-page="blog"] #main.pn-foreground :is(.article-body a, .toc a, .sidebar-link-list a, .blog-card-link):hover {
  text-decoration-color: currentColor;
}
body[data-page="blog"] #main.pn-foreground .blog-card-link:hover { color: var(--pn-fg-primary); }
body[data-page="blog"] #main.pn-foreground :is(.toc-title, .sidebar-widget h4) { color: var(--bl-copper); }
body[data-page="blog"] #main.pn-foreground .sidebar-link-list { list-style: none; padding-inline-start: 0; }
body[data-page="blog"] #main.pn-foreground .sidebar-link-list li { list-style: none; }
body[data-page="blog"] #main.pn-foreground .sidebar-link-list a::before { color: var(--bl-copper); }

/* the card head: the category and the date wrap as whole words at 16 px instead of breaking inside a narrow column */
body[data-page="blog"] #main.pn-foreground .blog-card-meta {
  flex-wrap: wrap;
  justify-content: space-between;
  row-gap: 4px;
  opacity: 1;
}
body[data-page="blog"] #main.pn-foreground .blog-card-meta > * { white-space: nowrap; }
body[data-page="blog"] #main.pn-foreground .blog-card-footer { border-top-color: var(--bl-rim); }
body[data-page="blog"] #main.pn-foreground .blog-listing-header { margin-bottom: 2.5rem; }

/* the article body: quotes, tables, code */
body[data-page="blog"] #main.pn-foreground .article-body blockquote {
  background: var(--bl-tint);
  border-left: 3px solid var(--bl-rim-strong);
}
body[data-page="blog"] #main.pn-foreground .article-body th {
  background: var(--bl-tint-strong);
  border-bottom: 1px solid var(--bl-rim);
}
body[data-page="blog"] #main.pn-foreground .article-body td { border-color: var(--bl-rim); }
body[data-page="blog"] #main.pn-foreground .article-body code { background: var(--bl-tint-strong); }
body[data-page="blog"] #main.pn-foreground .article-body pre {
  background: #04130f;
  border: 1px solid var(--bl-jade-rim);
}
body[data-page="blog"] #main.pn-foreground .article-body pre code { background: none; color: #f5ecdf; }

/* a title rule in copper, solid ink (no gradient-clipped text, KB#3895) */
body[data-page="blog"] #main.pn-foreground :is(.article-title, .blog-listing-header h1) {
  color: var(--pn-fg-primary);
  -webkit-text-fill-color: currentColor;
  background: none;
}
body[data-page="blog"] #main.pn-foreground :is(.article-header, .blog-listing-header) {
  border-bottom: 1px solid var(--bl-rim);
  padding-bottom: 1.25rem;
}

/* nothing smaller than 16 px */
body[data-page="blog"] #main.pn-foreground :is(.breadcrumb, .breadcrumb li, .breadcrumb a, .breadcrumb-current, .article-meta, .article-date, .article-read-time, .article-meta-dot, .article-category, .article-tag, .article-tags .tag, .blog-card-date, .blog-card-meta, .blog-card-read-time, .blog-card-tag, .blog-card-category, .blog-card-link, .related-card-date, .related-category, .related-card-title, .toc-title, .toc a, .sidebar-widget h4, .sidebar-link-list a, .sidebar-cta p, .sidebar-cta .btn-sm, .pn-download-version, .article-body th, .article-body td, .article-body code, .article-body table) {
  font-size: 1rem;
}
body[data-page="blog"] #main.pn-foreground .article-body pre code { font-size: 1rem; }

/* keyboard focus: a copper ring outside the plate */
body[data-page="blog"] #main.pn-foreground :focus-visible {
  outline: 2px solid var(--pn-fg-focus);
  outline-offset: 3px;
}

/* ===================== REAL METAL · KB#4083 S4 =====================
 * Decision #502 (Commander, 12.10.2026): metal is real copper poured into the jade, never drawn. The copper hairline of the paper plates, the copper rim of the
 * jade plates and of the two calls to action, the copper reading progress, the copper stripes of the quotes and of the lead,
 * the flat copper button of the sidebar and the copper pills of the tags were colours. On the paper of the light theme
 * hairlines are soft grooves; in the jade the plates and the calls to action wear the photographed rim of the element
 * base (an overlay, nothing moves); the reading progress and the stripes are the cast copper bars, the buttons of
 * the calls to action the cast copper button; tags are grooved pills. Links keep their copper ink. */
body[data-page="blog"] {
  --bl-rim: rgb(20 40 30 / .2);
  --bl-rim-strong: rgb(20 40 30 / .34);
  --bl-tint: rgb(20 40 30 / .045);
  --bl-tint-strong: rgb(20 40 30 / .08);
  --bl-jade-rim: rgb(0 0 0 / .5);
}
:root[data-theme="dark"] body[data-page="blog"] {
  --bl-rim: rgb(0 0 0 / .5);
  --bl-rim-strong: rgb(0 0 0 / .62);
  --bl-tint: rgb(255 255 255 / .04);
  --bl-tint-strong: rgb(255 255 255 / .07);
}
:root[data-theme="dark"] body[data-page="blog"] #main.pn-foreground :is(.blog-card, .related-card, .sidebar-widget, .toc, .article-body .highlight-box),
body[data-page="blog"] #main.pn-foreground :is(.article-cta, .sidebar-cta) {
  position: relative;
  border-radius: 0;
}
:root[data-theme="dark"] body[data-page="blog"] #main.pn-foreground :is(.blog-card, .related-card, .sidebar-widget, .toc, .article-body .highlight-box)::after,
body[data-page="blog"] #main.pn-foreground :is(.article-cta, .sidebar-cta)::after {
  content: "";
  position: absolute;
  inset: -1.5px;
  z-index: 1;
  border: 12px solid transparent;
  border-image: url(/shared/luxury-elements/plate-rim.webp) 130 / 12px stretch;
  pointer-events: none;
}
body[data-page="blog"] .reading-progress {
  background: url(/shared/luxury-elements/bar-copper-h.webp) left center / 100% 100% no-repeat;
}
body[data-page="blog"] #main.pn-foreground .article-body blockquote {
  border-left-color: transparent;
  background: url(/shared/luxury-elements/bar-copper-v.webp) left top / 4px 100% no-repeat border-box, var(--bl-tint);
}
body[data-page="blog"] #main.pn-foreground .article-lead {
  border-left-color: transparent;
  background: url(/shared/luxury-elements/bar-copper-v.webp) left top / 4px 100% no-repeat border-box;
}
body[data-page="blog"] #main.pn-foreground :is(.article-cta, .sidebar-cta) :is(.btn, .btn-sm) {
  border: 1px solid transparent !important;
  border-radius: 0 !important;
  border-image: url(/shared/luxury-elements/button-copper.webp) 45 65 fill / 10px 14px stretch !important;
  background: #09311f padding-box !important;
  box-shadow: none !important;
  color: #f3d2ad !important;
  text-shadow: 0 1px 1px rgb(0 0 0 / .55);
}
body[data-page="blog"] #main.pn-foreground :is(.article-cta, .sidebar-cta) :is(.btn, .btn-sm):hover { filter: brightness(1.1); }
