/* Royal Velvet for the Flowershow build of VENUS_FILES.
 *
 * Ported from caro401's Royal Velvet (MIT, v0.11.8) in .obsidian/themes/Royal Velvet.
 * Same palette and the same per-level heading gradients, pinned to dark mode.
 *
 * Flowershow sets its own variables with !important, and its stylesheet can load
 * after custom.css, so a tie on importance is not enough. The doubled attribute
 * below exists only to outweigh :root[data-theme] in the theme file.
 */

:root,
html,
html[data-theme="dark"],
html:root[data-theme="dark"][data-theme],
html:root[data-theme="light"][data-theme] {
  /* Light mode, in case the switch is ever turned back on. */
  --color-l-background: hsl(235 15% 96%) !important;
  --color-l-foreground: hsl(235 14% 15%) !important;
  --color-l-accent: hsl(330 90% 45%) !important;

  /* Royal Velvet dark: layer-2 background, near-white text, pink accent. */
  --color-d-background: hsl(235 15% 13%) !important;
  --color-d-foreground: hsl(0 0% 95%) !important;
  --color-d-accent: hsl(330 100% 75%) !important;

  --color-code-bg: hsl(235 15% 91%) !important;
  --color-code-bg-dark: hsl(235 15% 19%) !important;

  /* The theme derives text shades from --color-foreground by lowering lightness,
     which lands body copy at mid grey on dark. Royal Velvet body text is ~95%
     lightness, so the top of the scale is pushed back up. Lower shades stay put
     because they carry borders and dividers. */
  --color-foreground-500: oklch(0.86 0 0) !important;
  --color-foreground-600: oklch(0.93 0 0) !important;
  --color-foreground-700: oklch(0.96 0 0) !important;
  --color-foreground-800: oklch(0.98 0 0) !important;
  --color-foreground-900: oklch(1 0 0) !important;

  --color-danger: hsl(10 100% 75%) !important;
  --color-warning: hsl(35 100% 75%) !important;

  /* Callouts, mapped onto the Royal Velvet hues. */
  --callout-note-color: hsl(250 100% 75%) !important;
  --callout-tip-color: hsl(170 100% 75%) !important;
  --callout-success-color: hsl(115 100% 75%) !important;
  --callout-warning-color: hsl(60 100% 75%) !important;
  --callout-danger-color: hsl(10 100% 75%) !important;
  --callout-example-color: hsl(285 100% 75%) !important;
  --callout-quote-color: hsl(35 100% 75%) !important;

  --font-body: "Fira Sans", "Inter", system-ui, sans-serif;
  --font-heading: "Fira Sans", "Inter", system-ui, sans-serif;
  --radius: 0.4rem;
}

[data-theme="dark"] ::selection {
  background-color: hsl(250 100% 75% / 0.25) !important;
}

/* Navbar, footer and drawers sit one layer below the page, like Obsidian's sidebars. */
[data-theme="dark"] .site-navbar,
[data-theme="dark"] .site-footer,
[data-theme="dark"] .site-subnav,
[data-theme="dark"] .sidebar-drawer-panel {
  background-color: hsl(235 15% 11%) !important;
  border-color: hsl(235 15% 19%) !important;
}

[data-theme="dark"] .site-navbar-link:hover,
[data-theme="dark"] .site-tree-item-self:hover,
[data-theme="dark"] .mobile-nav-link:hover {
  color: hsl(330 100% 75%) !important;
}

[data-theme="dark"] .site-tree-item-self.is-current {
  color: hsl(330 100% 75%) !important;
  background-color: hsl(330 100% 75% / 0.1) !important;
}

/* Gradient headings, one gradient pair per level. */
.rendered-mdx h1,
.page-header-title {
  background-image: linear-gradient(90deg, hsl(330 100% 75%), hsl(35 100% 75%)) !important;
}

.rendered-mdx h2 {
  background-image: linear-gradient(90deg, hsl(35 100% 75%), hsl(60 100% 75%)) !important;
}

.rendered-mdx h3 {
  background-image: linear-gradient(90deg, hsl(60 100% 75%), hsl(115 100% 75%)) !important;
}

.rendered-mdx h4 {
  background-image: linear-gradient(90deg, hsl(115 100% 75%), hsl(170 100% 75%)) !important;
}

.rendered-mdx h5 {
  background-image: linear-gradient(90deg, hsl(170 100% 75%), hsl(250 100% 75%)) !important;
}

.rendered-mdx h6 {
  background-image: linear-gradient(90deg, hsl(250 100% 75%), hsl(330 100% 75%)) !important;
}

.rendered-mdx h1,
.rendered-mdx h2,
.rendered-mdx h3,
.rendered-mdx h4,
.rendered-mdx h5,
.rendered-mdx h6,
.page-header-title {
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
  -webkit-box-decoration-break: clone !important;
  box-decoration-break: clone !important;
  display: inline-block !important;
  width: fit-content !important;
  max-width: 100% !important;
  /* Safety net: an unbreakable note title would otherwise run past the gradient
     box and lose its glyphs to the transparent fill. */
  overflow-wrap: anywhere !important;
}

/* The page title is set at ~3.7rem by default, which is where long
   UPPER_SNAKE names start losing characters. */
.page-header-title {
  font-size: clamp(1.9rem, 4.4vw, 2.8rem) !important;
}

/* Anchor links beside headings must stay clickable inside the clipped box. */
.heading-link {
  -webkit-text-fill-color: hsl(330 100% 75%) !important;
  color: hsl(330 100% 75%) !important;
}

/* Tables: collapsed grid with borders on data cells only, per the old snippet. */
.rendered-mdx table {
  border-collapse: collapse !important;
  width: 100% !important;
}

.rendered-mdx td {
  border: 1px solid hsl(0 0% 59% / 0.5) !important;
  padding: 0.5rem !important;
}

.rendered-mdx th {
  border: none !important;
  padding: 0.5rem !important;
}

.rendered-mdx thead th {
  color: hsl(330 100% 75%) !important;
  text-align: left !important;
}

.rendered-mdx tbody tr:nth-child(even) td {
  background-color: hsl(235 15% 11%) !important;
}

/* Body copy sits on a mid shade of the theme's scale, which reads as grey next
   to the gradients. Royal Velvet body text is near-white, so set it directly on
   the text elements rather than shifting shades that also draw borders. */
.rendered-mdx p,
.rendered-mdx li,
.rendered-mdx dd,
.rendered-mdx dt,
.rendered-mdx td {
  color: hsl(0 0% 95%) !important;
}

/* Blockquotes get the red rail, links get the Royal Velvet ink. */
.rendered-mdx blockquote {
  border-left: 3px solid hsl(10 100% 75%) !important;
}

.rendered-mdx a {
  color: hsl(35 100% 75%) !important;
}

.rendered-mdx a:hover {
  color: hsl(35 100% 85%) !important;
}

.rendered-mdx code {
  color: hsl(285 100% 80%) !important;
  background-color: hsl(235 15% 19%) !important;
}

.rendered-mdx pre {
  background-color: hsl(235 15% 16%) !important;
}

.rendered-mdx pre code {
  color: hsl(0 0% 95%) !important;
}

.rendered-mdx hr {
  border-color: hsl(35 100% 75% / 0.4) !important;
}
