/*
 * Pyabunny v10 sakura overrides for hugo-theme-reimu.
 * Loaded via injector.head_end AFTER the theme's main.css, so equal-specificity
 * rules here win. Pairs with the internal_theme palette in
 * config/_default/params.yml; the theme submodule is never edited.
 *
 * Why this exists (per 06-brand-guidelines/BRAND-GUIDELINES.md):
 * 1. Brand surfaces: the theme's neutral greys are re-pointed to the brand
 *    semantic tokens (light bg #faf8fc / fg #23192b / muted #6b5d78; dark bg
 *    #27222e / surface #302939 / fg #eceaf1 / muted #aea2bc).
 * 2. Regular-size text on the sakura primary #d85a9b uses ink #17131b (5.11:1);
 *    the theme hardcodes white there (3.59:1, forbidden by the kit for text).
 * 3. Normal-size link/label text on light surfaces uses deep sakura #b0326f
 *    (>= 5:1); brand pink #d85a9b stays on fills and large accents.
 * 4. Dark mode: the compiled theme shares light --red-1/2/3 in dark (~3.4:1 on
 *    dark surfaces), so they are lightened here to >= 5:1 tints. The theme's
 *    dark block never declares them (it only re-aliases --red-0 := var(--red-1)),
 *    so plain [data-theme="dark"] declarations win.
 */

/* ---- Brand semantic surfaces (tokens.css) ---- */
:root {
  --color-background: #faf8fc;
  --color-default: #23192b;
  --grey-9: #6b5d78;
  --color-archive-year: #643451;
  --color-h2-border: #e7dfee;
  --color-hover-shadow: rgba(100, 52, 81, 0.18);
}

[data-theme="dark"] {
  --red-1: #f2a5ce;
  --red-2: #f6b7da;
  --red-3: #f9c8e3;
}

[data-theme="dark"]:root {
  --color-background: #27222e;
  --color-wrap: #302939;
  --color-header-background: #302939;
  --color-footer-background: #27222e;
  --color-mobile-nav-background: #302939;
  --color-default: #eceaf1;
  --grey-9: #aea2bc;
  --color-archive-year: #b9a6ce;
  --color-h2-border: #423750;
}

/* Normal-size link text on light surfaces: deep sakura #b0326f (5.6:1 on the
   brand background, 5.6:1 on inline-code surfaces); dark keeps --color-link =
   var(--red-1), which resolves to the lightened #f2a5ce above. */
:root:not([data-theme="dark"]) {
  --color-link: #b0326f;
}

/* ---- Ink (not white) on sakura accent fills, both modes ----
   Ink reaches >= 5.1:1 on light fills (#d85a9b family) and >= 9.6:1 on the
   dark lightened tints (#f2a5ce family). */
body ::selection,
#page-nav a:hover,
#page-nav .current,
#reimu-hits mark,
.reimu-pagination a:hover,
.reimu-pagination a:focus,
.reimu-pagination .current .page-number,
.select-items li:hover,
.select-items li.selected,
.comment-selector-wrap .selector-item.active,
.notification-wrapper button,
.friend-badge {
  color: #17131b;
}

/* Press state sits on --red-0 deep plum (#643451) in light mode where ink
   fails (2.3:1) and white passes (9.76:1); dark presses on the lightened tint
   keep the ink from the rule above. */
:root:not([data-theme="dark"]) .notification-wrapper button:active {
  color: #ffffff;
}

/* Sidebar TOC/common buttons sit on the --red-3 tint; the theme compiles these
   at .sidebar-btn-wrapper specificity, so match it. */
.sidebar-btn-wrapper .sidebar-toc-btn,
.sidebar-btn-wrapper .sidebar-common-btn {
  color: #17131b;
}

/* Active sidebar menu entry: in dark its background is the lightened red-0
   tint, so flip the theme's hardcoded white to ink. */
[data-theme="dark"] .link-active .sidebar-menu-link,
[data-theme="dark"] .link-active .sidebar-menu-icon {
  color: #17131b;
}

/* ---- Light mode: accent-tint text becomes deep sakura ----
   The theme paints these labels/links with --red-1/--red-2 tints on light
   surfaces (3.2-3.6:1, below AA for normal text). Dark mode is untouched: the
   lightened tints above already reach >= 5:1 there. Specificity of
   :root:not(...) + class (0,3,0) beats the theme's compiled nesting. */
:root:not([data-theme="dark"]) .article-date-link,
:root:not([data-theme="dark"]) .article-more-link a,
:root:not([data-theme="dark"]) .article-comment-link,
:root:not([data-theme="dark"]) .article-visitor-link,
:root:not([data-theme="dark"]) .article-category-link,
:root:not([data-theme="dark"]) .article-tag-list-link,
:root:not([data-theme="dark"]) .archives-tag-list-link,
:root:not([data-theme="dark"]) .archives-category-list-link,
:root:not([data-theme="dark"]) .sidebar-author-name,
:root:not([data-theme="dark"]) .friend-name,
:root:not([data-theme="dark"]) .reimu-hit-item-link,
:root:not([data-theme="dark"]) .select-selected {
  color: #b0326f;
}
