[data-theme="bluebear3"] {
  --color-bg: #faf6f0;
  --color-surface: #ffffff;
  --color-text: #2a190d;
  --color-text-muted: #5b4632;
  --color-text-subtle: #634d37;
  --color-border: #e4d9c8;
  --color-border-strong: #7c3410;
  --color-accent: #7c3410;
  --color-accent-muted: rgba(124, 52, 16, 0.12);
  --color-accent-fg: #ffffff;

  --font-body: Georgia, "Times New Roman", serif;
  --font-display: Baskerville, "Libre Baskerville", Georgia, serif;
  --font-mono: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --gutter: clamp(24px, 6vw, 72px);
  --col-read: 720px;
  --nav-h: 0px;
}

[data-theme="bluebear3"] body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.72;
  text-rendering: optimizeLegibility;
}

[data-theme="bluebear3"] a {
  color: var(--color-accent);
  text-decoration: none;
}

[data-theme="bluebear3"] a:hover,
[data-theme="bluebear3"] a:focus-visible {
  color: var(--color-text);
}

/* Simple inline links underline on hover; compound block links
   (post/list items, featured) handle their own hover affordance. */
[data-theme="bluebear3"] a:not(.bb-list-item):not(.post-list-item):not(.bb-featured-home):hover,
[data-theme="bluebear3"] a:not(.bb-list-item):not(.post-list-item):not(.bb-featured-home):focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* On a post/list row, underline only the title, not the date or excerpt. */
[data-theme="bluebear3"] .bb-list-item:hover .bb-item-title,
[data-theme="bluebear3"] .bb-list-item:focus-visible .bb-item-title,
[data-theme="bluebear3"] .post-list-item:hover .bb-item-title,
[data-theme="bluebear3"] .post-list-item:focus-visible .bb-item-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

[data-theme="bluebear3"] a:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 4px;
}

[data-theme="bluebear3"] .post-content a {
  color: var(--color-accent);
  font-weight: 600;
  text-decoration: none;
  transition: color 160ms ease;
}

[data-theme="bluebear3"] .post-content a:hover,
[data-theme="bluebear3"] .post-content a:focus-visible {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

[data-theme="bluebear3"] .bb-action-link,
[data-theme="bluebear3"] .bb-post-nav a,
[data-theme="bluebear3"] .tag-filter-clear {
  color: #7c3410;
  font-weight: 700;
}

[data-theme="bluebear3"] .bb-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(22px, 3.5vw, 46px) var(--gutter) 0;
}

[data-theme="bluebear3"] .bb-masthead {
  margin-bottom: clamp(28px, 4.5vw, 54px);
}

[data-theme="bluebear3"] .bb-wordmark {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--color-text);
}

[data-theme="bluebear3"] .bb-rule,
[data-theme="bluebear3"] .bb-gradient-rule {
  height: 7px;
  margin-top: 16px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--color-accent) 0%, rgba(124, 52, 16, 0.52) 52%, rgba(124, 52, 16, 0) 100%);
}

[data-theme="bluebear3"] .bb-home-intro,
[data-theme="bluebear3"] .bb-page-title,
[data-theme="bluebear3"] .bb-post-title {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.12;
  color: var(--color-text);
  max-width: 760px;
}

[data-theme="bluebear3"] .bb-home-intro {
  font-size: clamp(44px, 6vw, 76px);
  margin-bottom: 30px;
}

[data-theme="bluebear3"] .bb-page-title,
[data-theme="bluebear3"] .bb-post-title {
  font-size: clamp(42px, 5vw, 64px);
  margin-bottom: 22px;
}

[data-theme="bluebear3"] .bb-date,
[data-theme="bluebear3"] .bb-kicker,
[data-theme="bluebear3"] .bb-section-title,
[data-theme="bluebear3"] .bb-footer-heading,
[data-theme="bluebear3"] .bb-post-nav,
[data-theme="bluebear3"] .bb-caption,
[data-theme="bluebear3"] .tag-chip,
[data-theme="bluebear3"] .tag-filter-bar {
  font-family: var(--font-mono);
  font-size: 16px;
}

[data-theme="bluebear3"] .bb-date,
[data-theme="bluebear3"] .bb-kicker,
[data-theme="bluebear3"] .bb-section-title,
[data-theme="bluebear3"] .bb-footer-heading {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
}

[data-theme="bluebear3"] .bb-main {
  min-height: 52vh;
}

[data-theme="bluebear3"] .bb-index,
[data-theme="bluebear3"] .bb-notes,
[data-theme="bluebear3"] .bb-article {
  padding-top: 0;
}

[data-theme="bluebear3"] .bb-home-grid,
[data-theme="bluebear3"] .bb-list,
[data-theme="bluebear3"] .bb-notes-list {
  display: grid;
  gap: 0;
  max-width: 900px;
}

[data-theme="bluebear3"] .bb-section-title {
  margin-bottom: 24px;
}

[data-theme="bluebear3"] .bb-home-list {
  max-width: 820px;
  margin-top: 38px;
}

[data-theme="bluebear3"] .bb-list-item,
[data-theme="bluebear3"] .post-list-item,
[data-theme="bluebear3"] .bb-note-item {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 180px;
  gap: 24px;
  align-items: start;
  padding: 22px 0;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}

[data-theme="bluebear3"] .bb-home-list .bb-list-item {
  grid-template-columns: 130px minmax(0, 1fr);
}

[data-theme="bluebear3"] .bb-note-item {
  grid-template-columns: 130px minmax(0, 1fr);
}

[data-theme="bluebear3"] .bb-item-date {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--color-text-muted);
}

[data-theme="bluebear3"] .bb-item-copy {
  display: block;
}

[data-theme="bluebear3"] .bb-item-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.3vw, 32px);
  line-height: 1.2;
  color: var(--color-text);
}

[data-theme="bluebear3"] .bb-item-excerpt {
  display: block;
  margin-top: 6px;
  color: var(--color-text);
  font-size: 18px;
  line-height: 1.55;
}

[data-theme="bluebear3"] .bb-thumb-empty {
  display: block;
}

[data-theme="bluebear3"] .bb-thumb {
  width: 180px;
  height: 115px;
  object-fit: cover;
  filter: saturate(0.72) contrast(0.92);
}

[data-theme="bluebear3"] .bb-read-more,
[data-theme="bluebear3"] .bb-archive-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 30px;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
}

[data-theme="bluebear3"] .bb-article {
  max-width: var(--col-read);
}

[data-theme="bluebear3"] .bb-article .bb-date {
  margin-bottom: 16px;
}

[data-theme="bluebear3"] .post-content {
  max-width: var(--col-read);
}

[data-theme="bluebear3"] .post-content p,
[data-theme="bluebear3"] .post-content ul,
[data-theme="bluebear3"] .post-content ol,
[data-theme="bluebear3"] .post-content blockquote,
[data-theme="bluebear3"] .post-content pre,
[data-theme="bluebear3"] .post-content figure,
[data-theme="bluebear3"] .post-content .snippet {
  margin: 0 0 1.5em;
}

[data-theme="bluebear3"] .post-content h2,
[data-theme="bluebear3"] .post-content h3,
[data-theme="bluebear3"] .post-content h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  margin: 2.1em 0 0.8em;
}

[data-theme="bluebear3"] .post-content h2 { font-size: clamp(32px, 4vw, 44px); }
[data-theme="bluebear3"] .post-content h3 { font-size: clamp(26px, 3vw, 34px); }
[data-theme="bluebear3"] .post-content h4 { font-size: 22px; }

[data-theme="bluebear3"] .post-content blockquote {
  border-left: 3px solid var(--color-accent);
  padding-left: 22px;
  color: var(--color-text-muted);
  font-style: italic;
}

[data-theme="bluebear3"] .post-content code {
  font-family: var(--font-mono);
  font-size: 0.95em;
  background: var(--color-accent-muted);
  padding: 0.1em 0.25em;
}

[data-theme="bluebear3"] .post-content pre {
  overflow-x: auto;
  padding: 20px;
  background: #f4ece0;
}

[data-theme="bluebear3"] .post-content pre code {
  background: transparent;
  padding: 0;
  font-size: 16px;
}

[data-theme="bluebear3"] .post-content figure img {
  display: block;
  width: 100%;
  height: auto;
}

[data-theme="bluebear3"] .post-content figcaption,
[data-theme="bluebear3"] .bb-caption {
  margin-top: 10px;
  color: var(--color-text-muted);
  font-style: italic;
}

[data-theme="bluebear3"] .post-content .img-wide {
  width: min(920px, calc(100vw - var(--gutter) * 2));
}

/* Break: full content width, anchored to the column's left edge (the reading
   column is left-aligned in the shell, so no negative-margin centring). */
[data-theme="bluebear3"] .post-content .img-break {
  width: calc(min(1180px, 100vw) - var(--gutter) * 2);
  max-width: none;
  margin-left: 0;
}

[data-theme="bluebear3"] .post-content .img-small {
  max-width: 520px;
}

[data-theme="bluebear3"] .post-content .img-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

[data-theme="bluebear3"] .post-content .photo-muted img { filter: saturate(0.72) contrast(0.92); }
[data-theme="bluebear3"] .post-content .photo-mono img { filter: grayscale(1) contrast(1.04); }
[data-theme="bluebear3"] .post-content .photo-colour img { filter: none; }
[data-theme="bluebear3"] .post-content .photo-soft img { filter: saturate(0.82) contrast(0.88) brightness(1.04); }

[data-theme="bluebear3"] .post-content .pull-quote blockquote,
[data-theme="bluebear3"] .post-content .quote-interlude blockquote {
  border: 0;
  padding: 0;
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.16;
}

[data-theme="bluebear3"] .post-content .quote-interlude {
  margin: 3em 0;
  padding: 2em 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

[data-theme="bluebear3"] .post-content .snippet {
  padding: 18px 22px;
  background: #f4ece0;
  border-left: 3px solid var(--color-accent);
}

[data-theme="bluebear3"] .bb-post-nav {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 54px;
  padding-top: 28px;
  border-top: 1px solid var(--color-border);
  font-weight: 700;
}

[data-theme="bluebear3"] .tag-filter-bar {
  margin-bottom: 28px;
  padding: 16px 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

[data-theme="bluebear3"] .tags-section {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 36px;
}

[data-theme="bluebear3"] .tag-chip {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  color: var(--color-accent);
}

/* Footnav — copper palette. Footer-only colour tokens kept local so the rest of
   the theme is untouched; the footer renders identically on every page. */
[data-theme="bluebear3"] .bb-footer {
  --fbg: #2b1b12;
  --faccent: #cf8a4e;
  --fhead: #e0a36e;
  --flink: #f6ede4;
  margin-top: clamp(54px, 8vw, 96px);
  background: var(--fbg);
  color: var(--flink);
  font-family: var(--font-mono);
}

[data-theme="bluebear3"] .bb-footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(40px, 6vw, 72px) var(--gutter) 34px;
}

[data-theme="bluebear3"] .bb-footer-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(36px, 7vw, 96px);
  align-items: center;
}

[data-theme="bluebear3"] .bb-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(26px, 4vw, 56px);
}

[data-theme="bluebear3"] .bb-footer-heading {
  color: var(--fhead);
  font-size: 16px;
  letter-spacing: 0.14em;
  margin-bottom: 14px;
}

/* Links are plain at rest; a copper underline appears on hover/focus. */
[data-theme="bluebear3"] .bb-footer a {
  color: var(--flink);
  text-decoration: none;
}

[data-theme="bluebear3"] .bb-footer a:hover,
[data-theme="bluebear3"] .bb-footer a:focus-visible {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
  text-decoration-color: var(--faccent);
}

[data-theme="bluebear3"] .bb-footer .bb-ext::after {
  content: " \2197";
  color: var(--faccent);
  font-size: 0.85em;
  text-decoration: none;
}

[data-theme="bluebear3"] .bb-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

[data-theme="bluebear3"] .bb-footer li {
  margin: 0 0 10px;
  font-size: 16px;
}

/* Right-side location word mark (caps block) */
[data-theme="bluebear3"] .bb-footer-brand {
  text-align: right;
}

[data-theme="bluebear3"] .bb-place {
  margin: 0;
  text-transform: uppercase;
}

[data-theme="bluebear3"] .bb-place-name {
  display: block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(22px, 2.6vw, 30px);
  letter-spacing: 0.12em;
  line-height: 1.12;
  color: var(--flink);
}

[data-theme="bluebear3"] .bb-place-region {
  display: block;
  margin-top: 12px;
  font-size: 16px;
  letter-spacing: 0.42em;
  color: var(--fhead);
}

[data-theme="bluebear3"] .bb-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 42px;
  padding-top: 28px;
  border-top: 1px solid color-mix(in srgb, var(--flink) 45%, transparent);
  font-size: 16px;
}

[data-theme="bluebear3"] .bb-footer-end {
  display: flex;
  align-items: center;
  gap: 20px;
}

[data-theme="bluebear3"] .bb-footer img {
  display: block;
}

[data-theme="bluebear3"] .bb-signal-link {
  display: inline-flex;
  align-items: center;
}

@media (max-width: 760px) {
  [data-theme="bluebear3"] body {
    font-size: 18px;
  }

  [data-theme="bluebear3"] .bb-list-item,
  [data-theme="bluebear3"] .post-list-item,
  [data-theme="bluebear3"] .bb-note-item,
  [data-theme="bluebear3"] .bb-home-list .bb-list-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  [data-theme="bluebear3"] .bb-thumb {
    width: 100%;
    height: auto;
    margin-top: 10px;
  }

  [data-theme="bluebear3"] .post-content .img-wide,
  [data-theme="bluebear3"] .post-content .img-break {
    width: 100%;
    margin-left: 0;
  }

  [data-theme="bluebear3"] .post-content .img-pair {
    grid-template-columns: 1fr;
  }

  [data-theme="bluebear3"] .bb-post-nav,
  [data-theme="bluebear3"] .bb-footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  [data-theme="bluebear3"] .bb-footer-grid {
    grid-template-columns: 1fr;
  }

  [data-theme="bluebear3"] .bb-footer-brand {
    text-align: left;
  }
}

/* Blue Bear repairs */
[data-theme="bluebear3"] .bb-home-list .bb-list-item,
[data-theme="bluebear3"] .bb-home-list .post-list-item {
  border-bottom: 0;
}

/* Follow links use the same persistent copper underline as the rest of the footer. */
[data-theme="bluebear3"] .bb-footer .social-link {
  font-size: 16px;
}

/* Featured homepage item */
[data-theme="bluebear3"] .bb-featured-home {
  display: block;
  max-width: 760px;
  margin: 0 0 34px;
  padding: 26px 0 30px;
  color: var(--color-text);
  text-decoration: none;
}

[data-theme="bluebear3"] .bb-featured-label,
[data-theme="bluebear3"] .bb-featured-date {
  display: block;
  font-family: var(--font-mono);
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

[data-theme="bluebear3"] .bb-featured-label {
  color: var(--color-accent);
  font-weight: 700;
  margin-bottom: 12px;
}

[data-theme="bluebear3"] .bb-featured-title {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(34px, 4.2vw, 54px);
  line-height: 1.08;
  color: var(--color-text);
}

[data-theme="bluebear3"] .bb-featured-excerpt {
  display: block;
  max-width: 640px;
  margin-top: 12px;
  font-size: 20px;
  line-height: 1.55;
  color: var(--color-text);
}

[data-theme="bluebear3"] .bb-featured-date {
  margin-top: 18px;
  color: var(--color-text-muted);
}

[data-theme="bluebear3"] .bb-featured-home:hover .bb-featured-title,
[data-theme="bluebear3"] .bb-featured-home:focus-visible .bb-featured-title {
  color: var(--color-accent);
}
