/* Site webfonts: Fira Mono (Latin) + LXGW WenKai Mono GB Screen (CJK) */
@font-face {
  font-family: "Fira Mono";
  src: url("/fonts/FiraMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Fira Mono";
  src: url("/fonts/FiraMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "LXGW WenKai Mono GB Screen";
  src: url("/fonts/lxgw-wenkai-mono-gb-screen.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range:
    U+2000-206F, U+3000-303F, U+3040-30FF, U+3400-4DBF, U+4E00-9FFF,
    U+F900-FAFF, U+FF00-FFEF;
}

/* Nerd Font icons in body text */
@font-face {
  font-family: "NerdFontIcons";
  src: url("/fonts/SymbolsNerdFontMono-Regular.woff2") format("woff2");
  font-display: swap;
  unicode-range: U+23FB-23FE, U+276C-2771, U+E000-F8FF, U+F0000-FFFFD;
}

:root {
  --font-monospace:
    "Fira Mono", "LXGW WenKai Mono GB Screen", "NerdFontIcons", monospace;
}
/* Friend link cards */
.friend-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 0 0 1.5rem 0;
}

.friend-card {
  position: relative;
  background-color: var(--bg);
  border: 1px solid var(--inner-bg);
  border-radius: 0.25rem;
  transition: border-color 0.15s ease;
}

.friend-card:hover {
  border-color: var(--link);
}

.friend-card__body {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  text-decoration: none;
  color: var(--fg);
}

/* avatar */
.friend-card__avatar {
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
}

.friend-card__icon--fallback {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--bg);
  background-color: var(--link);
}

/* text */
.friend-card__meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  line-height: 1.4;
}

.friend-card__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-card__author {
  font-weight: 600;
  color: var(--fg);
}

.friend-card__title {
  margin-left: 0.4rem;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--off-fg);
}

.friend-card__desc {
  font-size: 0.85rem;
  color: var(--off-fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* floating panel */
.friend-card__panel {
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 0;
  z-index: 20;
  display: none;
  width: max-content;
  max-width: min(20rem, calc(100vw - 2rem));
  padding: 0.75rem;
  background-color: var(--inner-bg);
  border: 1px solid var(--muted);
  border-radius: 0.25rem;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
}

.friend-card:hover .friend-card__panel {
  display: block;
}

/* invisible bridge over the gap, keeps hover active on the way to the panel */
.friend-card__panel::before {
  content: "";
  position: absolute;
  bottom: -0.5rem;
  left: 0;
  right: 0;
  height: 0.5rem;
}

/* allow text selection, prevent image/link drag */
.friend-card img {
  -webkit-user-drag: none;
  user-drag: none;
}

.friend-card__panel {
  -webkit-user-select: text;
  user-select: text;
}

.friend-card__panel-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.friend-card__panel-icon {
  flex: none;
  width: 1rem;
  height: 1rem;
  border-radius: 0.125rem;
  object-fit: cover;
}

.friend-card__panel-icon--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--bg);
  background-color: var(--link);
}

.friend-card__panel-url {
  font-size: 0.85rem;
  color: var(--link);
  overflow-wrap: anywhere;
}

.friend-card__panel-desc {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--fg);
  overflow-wrap: anywhere;
}

.friend-card__comment {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--off-fg);
  overflow-wrap: anywhere;
}

/* single column on narrow screens */
@media (max-width: 45rem) {
  .friend-links {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* ------------------------------------------------------------------
 * Markdown heading sizes (h1–h5)
 * Patch layer: this file is loaded AFTER css/risotto.css (see
 * layouts/partials/head.html), so these rules override the theme's
 * uniform 1rem heading size without touching themes/risotto.
 * ------------------------------------------------------------------ */
h1 {
  font-size: 1.35rem;
}
h2 {
  font-size: 1.2rem;
}
h3 {
  font-size: 1.1rem;
}
h4 {
  font-size: 1.05rem;
}
h5 {
  font-size: 1rem;
}

/* The theme fixes line-height to 1.5rem on <body>; give headings a
   proportional line-height so the larger sizes don't overlap. */
h1,
h2,
h3,
h4,
h5 {
  line-height: 1.45;
}

/* Keep the header prompt (h1.page__logo in layouts/partials/header.html)
   at the small terminal size — it must not inherit the enlarged h1
   heading size above. */
h1.page__logo {
  font-size: 1rem;
  line-height: 1.5rem;
}

/* Article count next to category/section names */
.term-count {
  color: var(--muted);
  font-size: 0.85em;
  font-weight: 400;
}
/* Image captions (render-image hook wraps markdown images in figure) */
.image-figure {
  margin: 0 0 1.5rem 0;
}

.image-caption {
  margin-top: 0.25rem;
  font-size: 0.9rem;
  color: var(--off-fg);
  text-align: center;
}
/* Code copy button */
.highlight {
  position: relative;
}

.code-copy {
  position: absolute;
  top: 0.3rem;
  right: 0.6rem;
  padding: 0.1rem 0.4rem;
  font-family: var(--font-monospace);
  font-size: 0.95rem;
  line-height: 1.2;
  color: var(--fg);
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: 0.25rem;
  cursor: pointer;
}

.code-copy:hover {
  color: var(--link);
  border-color: var(--inner-bg);
}
/* Admonitions (callouts): [!KEYWORD] blockquotes */
.admonition {
  --admonition-color: var(--fg);
  color: var(--admonition-color);
}

.admonition::before {
  color: var(--admonition-color);
}

.admonition-title {
  display: inline-block;
  padding: 0rem 0.5rem;
  line-height: 1.3;
  margin-right: 0.5rem;
  background-color: var(--admonition-color);
  color: #000;
  font-weight: 700;
}
