/*
* Bearming — a personal Bear theme
* Version 4.1.3 | 2026-01-28
* Robert Birming | robertbirming.com
*/


:root {
  color-scheme: light;
  --bg: #FFFFFF;
  --text: #2f3234;
  --link: #3a6fc2;
  --visited: #8b5a9f;
  --muted: color-mix(in srgb, var(--text) 70%, var(--bg));
  --surface: color-mix(in srgb, var(--text) 5%, var(--bg));
  --border: color-mix(in srgb, var(--text) 12%, var(--bg));
  --font-small: 0.9rem;
  --radius: 3px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #1b1f24;
    --text: #e1e2e3;
    --link: #7ca8df;
    --visited: #b88fca;
    --muted: color-mix(in srgb, var(--text) 70%, var(--bg));
    --surface: color-mix(in srgb, var(--text) 5%, var(--bg));
    --border: color-mix(in srgb, var(--text) 12%, var(--bg));
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  /* Overstaying its welcome since 2015 */
  -webkit-font-smoothing: antialiased;
}

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

p {
  margin-block: 1.2em;
}

h1,
h2,
h3,
h4 {
  margin-block: 2rem 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; }

main > h1 {
  margin-block: 0;
}

.post main > h1 + p {
  margin-block: 0 1.5rem;
}


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;
}

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

.post main a:visited:hover,
.blog-posts a:visited:hover {
  color: color-mix(in srgb, var(--text) 50%, 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.7rem;
  color: var(--muted);
  font-style: italic;
  background: var(--surface);
  border-left: 2px solid color-mix(in srgb, var(--link) 45%, transparent);
  border-radius: var(--radius);
}

blockquote p {
  margin: 0.5em 0;
}

blockquote cite {
  display: block;
  margin-top: 0.6rem;
  font-style: normal;
}

blockquote cite::before {
  content: "– ";
}

hr {
  margin: 1.8rem 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);
}

figure {
  margin: 1.4rem 0 1.8rem;
}

figure img {
  margin: 0;
}

figure p {
  margin: 0;
}

figcaption {
  margin-top: 0.7rem;
  font-family: ui-monospace, monospace;
  font-size: var(--font-small);
  color: var(--muted);
  text-align: center;
}

time {
  font-family: ui-monospace, monospace;
  font-size: var(--font-small);
  color: var(--muted);
  font-style: normal;
  white-space: nowrap;
}

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

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

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

table {
  width: 100%;
  margin: 1.8rem 0;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 1rem;
  line-height: inherit;
}

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 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-around;
  gap: 0.6rem 1rem;
  margin: 0 0 2rem;
}

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

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

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

.blog-posts {
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
}

.blog-posts li {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.2rem 0;
}

.blog-posts li > span {
  flex: 0 0 100px;
}

.blog-posts li a {
  overflow: visible;
  white-space: normal;
}

p.tags {
  margin: 1.5rem 0;
}

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

footer {
  margin: 2rem 0;
  padding: 0 !important;
  font-size: var(--font-small);
  color: var(--muted);
  text-align: center;
}

footer p {
  margin: 0.5rem 0;
}

/* Upvote button */
#upvote-form > small {
  display: none;
  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: "♥";
}

/* Previous / Next post */
.post-nav {
  display: block;
  margin-bottom: 1.8rem;
}

.post-nav a {
  font-weight: 600;
  margin-right: 0.8em;
}

a.previous-post::before { content: "← "; }
a.next-post::after { content: " →"; }

body.home .post-nav,
body.page .post-nav {
  display: none;
}

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

.bearming-gallery img {
  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;
}

.bearming-gallery img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 0;
  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;
  }
}

/* Curve divider */
span.curve {
  display: block;
  width: 8rem;
  height: 8px;
  margin: 1.2rem auto 0;
  background-color: var(--link);
  -webkit-mask:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='8' viewBox='0 0 120 8'><path d='M0 4 Q30 0 60 4 T120 4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/></svg>")
    no-repeat center / contain;
  mask:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='8' viewBox='0 0 120 8'><path d='M0 4 Q30 0 60 4 T120 4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/></svg>")
    no-repeat center / contain;
  opacity: 0.9;
}

/* 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;
  transform: translateZ(0);
  transition:
    transform 0.15s ease,
    filter 0.15s ease,
    color 0.15s ease,
    border-color 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));
}

/* Lightbox photo gallery | robertbirming.com */
.bear-gallery {
  margin-block: var(--space-block);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem;
}

.bear-gallery > p {
  margin: 0;
  display: contents;
}

.bear-gallery a {
  display: block;
}

/* Thumbnails */
.bear-gallery img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
  -webkit-user-drag: none;
  transition: transform 0.15s ease;
}

@media (hover: hover) {
  .bear-gallery img:hover {
    transform: scale(1.03);
  }
}

.bear-gallery img:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

@media (min-width: 900px) {
  .bear-gallery {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

/* Lightbox overlay */
.bear-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.86);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.bear-gallery-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* The large image */
.bear-gallery-lightbox img {
  display: block;
  max-width: min(100%, 1100px);
  max-height: 88vh;
  width: auto;
  height: auto;
  border-radius: calc(var(--radius) * 2);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  cursor: zoom-out;
  image-rendering: auto;
}

/* Close button */
.bear-gallery-close {
  position: absolute;
  inset-block-start: 0.9rem;
  inset-inline-end: 0.9rem;
  padding: 0.35em 0.75em;
  border-radius: 999px;
  font: inherit;
  font-size: var(--font-small);
  line-height: 1.2;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
}

@media (hover: hover) {
  .bear-gallery-close:hover {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(0, 0, 0, 0.7);
  }
}

.bear-gallery-close:focus {
  outline: none;
}

.bear-gallery-close:focus-visible {
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .bear-gallery-lightbox,
  .bear-gallery img {
    transition: none;
  }
}

footer {
    display: none !important;
}