/*
* Bearming — a personal Bear theme
* * Version 4.1.1 | 2026-01-16
* Robert Birming | robertbirming.com
*
* Modified by Dan 2026-01-31
*/
@import "https://fonts.googleapis.com/css?family=Raleway";

:root {
  color-scheme: light dark;
  --bg: #fff;
  --header: #0E5693;
  --text: #000;
  --link: #1470bf;
  --visited: #729CC1;
  --muted: color-mix(in srgb, var(--text) 70%, transparent);
  --surface: color-mix(in srgb, var(--text) 3%, var(--bg));
  --border: color-mix(in srgb, var(--text) 12%, transparent);
  --font-small: 0.95rem;
  --radius: 3px;
  --radius-lg: 12px;

  --font-header: Sirba, serif;
  --font-body: Raleway, system-ui, sans-serif;
  --font-code: ui-monospace, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f18;
    --header: #eee;
    --text: #ddd;
    --link: #729CC1;
    --visited: #1470bf;
    --border: color-mix(in srgb, var(--text) 15%, transparent);
  }
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0 auto;
  padding: 2.2rem 1.25rem 1.5rem;
  max-width: 75ch;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  overflow-wrap: break-word;
}

p {
  margin: 1.2em 0;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--header);
  font-family: var(--font-header);
  margin: 2rem 0 0.8rem;
  font-weight: 700;
  line-height: 1.3;
}

h1 { font-size: 1.7rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s ease-out;
}

a:hover,
a:active {
  color: color-mix(in srgb, var(--text) 50%, var(--link));
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.post main a:visited,
.blog-posts a:visited {
  color: var(--visited);
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--link) 60%, transparent);
  outline-offset: 3px;
}

blockquote {
  margin: 1.8rem 0;
  padding: 0.5rem 1.5rem;
  border-left: 4px solid color-mix(in srgb, var(--link) 50%, transparent);
  background: var(--surface);
  color: var(--muted);
}

blockquote p {
  margin: 0.5em 0;
}

hr {
  margin: 1.5rem 0;
  border: none;
  border-top: 1px solid var(--border);
}

img {
  display: block;
  margin: 1.8rem 0;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

pre {
  margin: 1.5rem 0;
  padding: 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--font-code);
  font-size: var(--font-small);
}

code {
  padding: 0.15em 0.35em;
  background: var(--surface);
  border-radius: var(--radius);
  font-family: var(--font-code);
  font-size: var(--font-small);
}

pre code {
  padding: 0;
  background: none;
  border-radius: 0;
  font-size: inherit;
}

table {
  width: 100%;
  margin: 1.8rem 0;
  font-size: var(--font-small);
  border-collapse: collapse;
}

th,
td {
  padding: 0.5em 0.7em;
  text-align: left;
  vertical-align: top;
}

thead th {
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

tbody tr + tr td {
  border-top: 1px solid var(--border);
}

/* Header */
header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem 1.5rem;
  margin: 0 0 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

header h1 {
  margin: 0;
  font-size: 1.1rem;
}

header a.title {
  color: inherit;
  text-decoration: none;
}

header nav p {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0;
  font-size: var(--font-small);
}

main h1 {
  margin: 0;
}

main h1 + p {
  margin: 0 0 1.5rem;
}

.page main > h1:first-of-type {
  margin: 0 0 1.5rem;
}

time {
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-style: normal;
  white-space: nowrap;
}

h4 + p + .embedded.blog-posts {
  margin-top: 0.5rem;
}

/* Blog list: Minimal */
.blog-posts {
  list-style: none;
  margin: 2rem 0;
  padding: 0;
}

.blog-posts li {
  margin: 0.5rem 0;
}

.blog-posts li time {
  margin-right: 1em;
}

/* Upvote button */
#upvote-form > small {
  display: block;
  margin-top: 1.5rem;
}

.upvote-button {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font-size: var(--font-small);
  color: var(--muted) !important;
}

.upvote-button svg {
  display: none;
}

.upvote-count::before {
  content: "⇮";
  display: inline-block;
  margin-right: 0.15em;
  font-size: 1.4rem;
  color: var(--link);
  vertical-align: -0.1em;
  transition: transform 0.15s ease;
}

@media (hover: hover) {
  .upvote-button:not([disabled]):hover .upvote-count::before {
    transform: scale(1.15);
  }
}

.upvote-button[disabled] {
  opacity: 0.7;
  cursor: default;
}

.upvote-button[disabled] .upvote-count::before {
  content: "↟";
}

p.tags {
  margin: 1.5rem 0;
}

p.tags a {
  margin-right: 0.5em;
  font-size: var(--font-small);
  color: var(--muted);
}

footer {
  margin-top: 2rem;
  padding-top: 1rem !important;
  border-top: 1px solid var(--border);
  font-size: var(--font-small);
  color: var(--muted);
  text-align: center;
}

footer p {
  margin: 0;
}

footer > span {
  display: block;
  margin-top: 0.5rem;
}


/* ============================================================
   OPTIONAL EXTRAS
   Use what you like, add more, or delete them.
   Full documentation: robertbirming.com/bearming
   ============================================================ */

/* card class (Dan) */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-sizing: border-box;
    padding: 1rem;
}


/* Footnote reference arrow (Dan) */
.footnote {
    font-family: var(--font-code);
    padding-left: 0.5rem;
}

/* Buttons (Dan) */
button {
    padding: 10px 15px;
    background-color: #ddd;
    border-radius: 5px;
    border: 0;
    font-family: var(--body);
    font-size: 1.0rem;
}


/* Image caption */
span.caption {
  display: block;
  margin-top: -1.2rem;
  margin-bottom: 1.5rem;
  font-size: var(--font-small);
  color: var(--muted);
  text-align: center;
}


/* Photo gallery */
.bearming-gallery {
  margin: 1.6rem 0;
}

.bearming-gallery,
.bearming-gallery * {
  cursor: pointer !important;
}

.bearming-gallery > ul,
.bearming-gallery > ol {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bearming-gallery li {
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  overflow: hidden;
  cursor: pointer;
}

.bearming-gallery img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 0;
  cursor: inherit;
  transform: translateZ(0);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.bearming-gallery li {
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  overflow: hidden;
}

.bearming-gallery img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 0;
  cursor: zoom-in;
  transform: translateZ(0);
  transition: transform 0.18s ease, filter 0.18s ease;
}

@media (hover: hover) {
  .bearming-gallery li:hover img {
    transform: scale(1.02);
    filter: brightness(1.03);
  }
}

@media (max-width: 480px) {
  .bearming-gallery > ul,
  .bearming-gallery > ol {
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
  }
}

/* Copy button */
:where(.highlight, pre) {
  position: relative;
}

:where(pre) {
  padding-top: 2.4rem;
}

:where(.bearming-copy-btn) {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  color: var(--muted);
  font: inherit;
  font-size: var(--font-small);
  line-height: 1.1;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

@media (hover: hover) {
  :where(.bearming-copy-btn:hover) {
    filter: brightness(1.05);
    transform: translateY(-1px);
  }
}

:where(.bearming-copy-btn:focus-visible) {
  outline: 3px solid color-mix(in srgb, var(--link) 60%, transparent);
  outline-offset: 3px;
}

:where(.bearming-copy-btn[data-copied="true"]) {
  color: var(--text);
  border-color: color-mix(in srgb, var(--link) 35%, var(--border));
}

/* Inline menu */
.inline-menu {
  margin: 2rem 0;
  padding: 0.8rem 0;
  font-size: var(--font-small);
  color: var(--muted);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.inline-menu ul {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
