/* ==========================================================================
   TIMBERROOT SHARED CLASS SYSTEM  (css/tr-system.css)
   One stylesheet for every page built on the new system. Today: blog posts.

   1. Tokens        colors, type, spacing as variables
   2. Base          plain elements inside .tr-page
   3. Layout        .tr-container, .tr-section, .tr-layout
   4. Components    .tr-btn, .tr-card, .tr-eyebrow, .tr-tag, .tr-toc ...
   5. Prose         blog content inside .tr-prose, styled through
                    WordPress's own wp-block-* classes
   6. Block styles  .is-style-* (picked from the editor's Styles panel)
   7. Variations    .tr-dark
   8. Astra bridge  fixes for Astra bleed. Delete when the custom theme lands.
   ========================================================================== */

/* 1. TOKENS ---------------------------------------------------------------- */
:root {
  /* Brand palette */
  --tr-cream: #fbf8f1;
  --tr-cream-2: #f3ecdf;
  --tr-cream-3: #e6dccb;
  --tr-green: #69745d;
  --tr-green-dark: #545d4a;
  --tr-brown: #473129;
  --tr-ink: #312824;
  --tr-sage: #8a9a7b;      /* brand sage: fails WCAG with white text (3.0:1), so not used on buttons */
  --tr-sage-cta: #6b7a60;  /* button sage: 4.6:1 with white text, passes WCAG AA */
  --tr-sage-dark: #56634d; /* button hover: 6.4:1 with white text */

  /* Roles: components use these, never the raw palette */
  --tr-bg: var(--tr-cream);
  --tr-surface: #ffffff;
  --tr-surface-2: var(--tr-cream-2);
  --tr-text: var(--tr-ink);
  --tr-text-muted: #6b5e57;
  --tr-heading: var(--tr-brown);
  --tr-accent: var(--tr-green);
  --tr-accent-hover: var(--tr-green-dark);
  --tr-on-accent: #ffffff;
  --tr-link: var(--tr-brown);
  --tr-link-prose: var(--tr-sage-dark); /* links inside post text */
  --tr-border: var(--tr-cream-3);
  --tr-dark-bg: var(--tr-ink);
  --tr-cta: var(--tr-sage-cta);
  --tr-cta-hover: var(--tr-sage-dark);
  --tr-on-cta: #ffffff;

  /* Type */
  --tr-font-heading: "Playfair Display", Georgia, "Times New Roman", serif;
  --tr-font-body: Lato, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --tr-step--1: 0.875rem;
  --tr-step-0: 1.0625rem;
  --tr-step-1: 1.25rem;
  --tr-step-2: 1.375rem;
  --tr-step-3: clamp(1.6rem, 1.35rem + 1vw, 2rem);
  --tr-step-4: clamp(2.1rem, 1.6rem + 2vw, 3rem);

  /* Space and shape */
  --tr-space-1: 0.5rem;
  --tr-space-2: 1rem;
  --tr-space-3: 1.5rem;
  --tr-space-4: 2.5rem;
  --tr-space-5: 4rem;
  --tr-radius-sm: 4px;
  --tr-radius: 10px;
  --tr-radius-btn: 5px;   /* every button and tag */
  --tr-container: 1240px; /* TODO: match the nav bar's content width */
  --tr-measure: 42rem;    /* reading width for prose */
}

/* 2. BASE (scoped to .tr-page until the custom theme owns <body>) --------- */
.tr-page {
  color: var(--tr-text);
  font-family: var(--tr-font-body);
  font-size: var(--tr-step-0);
  line-height: 1.6;
}
.tr-page *, .tr-page *::before, .tr-page *::after { box-sizing: border-box; }
.tr-page :where(h1, h2, h3, h4) {
  font-family: var(--tr-font-heading);
  color: var(--tr-heading);
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  text-wrap: balance;
}
.tr-page :where(img) { max-width: 100%; height: auto; display: block; }
.tr-page :where(a) { color: var(--tr-link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
.tr-page :where(a:hover) { text-decoration-thickness: 2px; }
.tr-page :focus-visible { outline: 3px solid var(--tr-accent); outline-offset: 3px; }

/* 3. LAYOUT ---------------------------------------------------------------- */
.tr-container {
  width: 100%;
  max-width: var(--tr-container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}
.tr-section { padding-block: var(--tr-space-5); }
.tr-section--tight { padding-block: var(--tr-space-4); }
.tr-post-body { padding-block: var(--tr-space-4) var(--tr-space-5); }
@media (max-width: 759px) {
  .tr-section { padding-block: var(--tr-space-4); }
  .tr-post-body { padding-block: var(--tr-space-3) var(--tr-space-4); }
}
.tr-section--alt { background: var(--tr-surface-2); }
.tr-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--tr-space-4); }
@media (min-width: 960px) {
  .tr-layout--with-side { grid-template-columns: minmax(0, 1fr) 17rem; gap: var(--tr-space-5); }
  .tr-layout--with-side .tr-layout__side { order: 2; }
}
.tr-stack > * + * { margin-top: var(--tr-space-3); }

/* 4. COMPONENTS ------------------------------------------------------------ */

/* Eyebrow: small context label, sentence case */
.tr-eyebrow {
  display: block;
  margin: 0;
  font-family: var(--tr-font-body);
  font-size: var(--tr-step--1);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--tr-accent);
}

/* Buttons. Every CTA is sage, with a 5px corner */
.tr-btn {
  --btn-bg: var(--tr-cta);         --btn-fg: var(--tr-on-cta);   --btn-bd: var(--tr-cta);
  --btn-bg-h: var(--tr-cta-hover); --btn-fg-h: var(--tr-on-cta); --btn-bd-h: var(--tr-cta-hover);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 44px; padding: 0.7rem 1.4rem;
  border: 2px solid var(--btn-bd); border-radius: var(--tr-radius-btn);
  background: var(--btn-bg); color: var(--btn-fg);
  font: 700 var(--tr-step--1)/1 var(--tr-font-body); letter-spacing: 0.02em; text-transform: none;
  text-decoration: none; cursor: pointer;
}
.tr-btn:hover, .tr-btn:focus-visible { background: var(--btn-bg-h); color: var(--btn-fg-h); border-color: var(--btn-bd-h); }
/* Outline: darker sage text so it passes WCAG on cream (5.7:1) */
.tr-btn--outline { --btn-bg: transparent; --btn-fg: var(--tr-cta-hover); --btn-bd: var(--tr-cta-hover); --btn-bg-h: var(--tr-cta-hover); --btn-fg-h: var(--tr-on-cta); --btn-bd-h: var(--tr-cta-hover); }
.tr-dark .tr-btn--outline { --btn-fg: #fff; --btn-bd: #fff; --btn-bg-h: #fff; --btn-fg-h: var(--tr-ink); --btn-bd-h: #fff; }
/* .tr-btn--book is kept so templates don't change; it now matches every other CTA */
.tr-btn--book { }
.tr-btn--icon { padding: 0; width: 44px; }
.tr-btn svg { width: 18px; height: 18px; flex: none; }

/* Tags */
.tr-tags { display: flex; flex-wrap: wrap; gap: var(--tr-space-1); padding: 0; margin: 0; list-style: none; }
.tr-tags li { margin: 0; }
.tr-tag {
  display: inline-block; padding: 0.35rem 0.8rem;
  border: 1px solid var(--tr-border); border-radius: var(--tr-radius-btn);
  background: var(--tr-surface); color: var(--tr-text);
  font-size: var(--tr-step--1); text-decoration: none;
}
.tr-tag:hover { border-color: var(--tr-accent); color: var(--tr-accent); }

/* Breadcrumbs */
.tr-breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; margin: 0; font-size: var(--tr-step--1); }
.tr-breadcrumbs li { margin: 0; }
.tr-breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 0.4rem; color: var(--tr-text-muted); }
.tr-breadcrumbs a { color: var(--tr-text-muted); }
.tr-breadcrumbs [aria-current] { color: var(--tr-text); }

/* Meta line */
.tr-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0; color: var(--tr-text-muted); font-size: var(--tr-step--1); }
.tr-meta a { color: inherit; }

/* Card: ONE card for listings, posts and anything with a photo */
.tr-card-grid { display: grid; gap: var(--tr-space-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.tr-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--tr-surface); border: 1px solid var(--tr-border);
  border-radius: var(--tr-radius); overflow: hidden;
}
.tr-card__media { aspect-ratio: 4 / 3; background: var(--tr-surface-2); }
.tr-card__media img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.tr-card__body { display: flex; flex-direction: column; gap: 0.4rem; padding: var(--tr-space-2) var(--tr-space-2) var(--tr-space-3); flex: 1; }
.tr-card .tr-card__title { margin: 0; font-size: var(--tr-step-1); }
.tr-card .tr-card__title a { color: inherit; text-decoration: none; }
.tr-card .tr-card__title a::after { content: ""; position: absolute; inset: 0; } /* whole card clickable */
.tr-card .tr-card__title a:hover { text-decoration: underline; }
.tr-card .tr-card__text { margin: 0; color: var(--tr-text-muted); font-size: var(--tr-step--1); line-height: 1.5; }

/* Table of contents */
.tr-toc { border: 1px solid var(--tr-border); border-radius: var(--tr-radius); background: var(--tr-surface); }
.tr-toc summary { padding: var(--tr-space-2); font-weight: 700; cursor: pointer; }
.tr-toc ol { margin: 0; padding: 0 var(--tr-space-2) var(--tr-space-2) 2.4rem; font-size: var(--tr-step--1); }
.tr-toc li { margin: 0; }
.tr-toc li + li { margin-top: 0.45rem; }
.tr-toc a { color: var(--tr-text); text-decoration: none; }
.tr-toc a:hover, .tr-toc a.is-active { color: var(--tr-accent); text-decoration: underline; }
@media (min-width: 960px) {
  .tr-toc { position: sticky; top: 1.5rem; }
  .tr-toc summary { pointer-events: none; list-style: none; }
  .tr-toc summary::-webkit-details-marker { display: none; }
}

/* Share row */
.tr-share { display: flex; flex-wrap: wrap; align-items: center; gap: var(--tr-space-1); }
.tr-share__label { font-size: var(--tr-step--1); color: var(--tr-text-muted); }

/* Previous / next post */
.tr-post-nav { display: grid; gap: var(--tr-space-2); grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.tr-post-nav a { display: block; padding: var(--tr-space-2); border: 1px solid var(--tr-border); border-radius: var(--tr-radius); text-decoration: none; color: var(--tr-text); background: var(--tr-surface); }
.tr-post-nav a:hover { border-color: var(--tr-accent); }
.tr-post-nav span { display: block; font-size: var(--tr-step--1); color: var(--tr-text-muted); }
.tr-post-nav strong { font-family: var(--tr-font-heading); font-weight: 600; color: var(--tr-heading); }
.tr-post-nav .is-next { text-align: right; grid-column: -2; }

/* Section heading above grids */
.tr-section-title { font-size: var(--tr-step-3); margin-bottom: var(--tr-space-3); }

/* Post hero: breadcrumbs, title, meta, photo, with even steps between them */
.tr-post-hero { padding-block: var(--tr-space-4) 0; }
.tr-post-hero__title { font-size: var(--tr-step-4); line-height: 1.1; max-width: 22ch; margin: var(--tr-space-3) 0 var(--tr-space-2); }
.tr-post-hero__media { margin-top: var(--tr-space-4); border-radius: var(--tr-radius); overflow: hidden; aspect-ratio: 21 / 9; background: var(--tr-surface-2); }
.tr-post-hero__media img { width: 100%; height: 100%; object-fit: cover; }
.tr-post-footer { max-width: var(--tr-measure); margin-top: var(--tr-space-4); }

/* Call to action band: heading, line of text, then the button right under it */
.tr-cta { display: flex; flex-direction: column; align-items: flex-start; }
.tr-cta > * { max-width: 40rem; }
.tr-cta__title { font-size: var(--tr-step-3); line-height: 1.15; margin: 0 0 var(--tr-space-2); }
.tr-cta p { margin: 0; font-size: var(--tr-step-0); line-height: 1.6; }
.tr-cta__actions { display: flex; flex-wrap: wrap; gap: var(--tr-space-1); margin-top: var(--tr-space-3); }
@media (max-width: 759px) {
  .tr-cta__actions { width: 100%; }
  .tr-cta__actions .tr-btn { width: 100%; }
}

/* 5. PROSE: blog content. WordPress core blocks keep their own classes ----- */
.tr-prose { max-width: var(--tr-measure); font-size: 1.125rem; line-height: 1.75; }
.tr-prose > * { margin-block: 0; }
.tr-prose > * + * { margin-top: 1.25em; }
.tr-prose :where(h2) { font-size: var(--tr-step-3); }
.tr-prose :where(h3) { font-size: var(--tr-step-2); }
.tr-prose :where(h4) { font-family: var(--tr-font-body); font-size: var(--tr-step-0); font-weight: 700; color: var(--tr-text); }
.tr-prose > h2 { margin-top: 2em; }
.tr-prose > h3 { margin-top: 1.6em; }
.tr-prose > h4 { margin-top: 1.4em; }
.tr-prose > :is(h2, h3, h4) + * { margin-top: 0.5em; }
.tr-prose > h2 + h3 { margin-top: 0.8em; }
.tr-prose > :first-child { margin-top: 0; }
/* Links in post text: sage and underlined, so they never look like plain text.
   #56634d is 6:1 on cream. Buttons are excluded. */
.tr-prose a:not(.wp-block-button__link):not(.wp-element-button):not(.tr-btn) {
  color: var(--tr-link-prose);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
.tr-prose a:not(.wp-block-button__link):not(.wp-element-button):not(.tr-btn):hover {
  color: var(--tr-ink);
  text-decoration-thickness: 2px;
}
.tr-prose mark { background: color-mix(in srgb, var(--tr-sage) 30%, transparent); color: inherit; padding: 0 0.15em; }
.tr-prose abbr[title] { text-decoration: underline dotted; cursor: help; }

/* Lists */
.tr-prose :is(ul, ol):not([class*="tr-"]) { padding-left: 1.4em; margin-left: 0; }
.tr-prose li + li { margin-top: 0.4em; }
.tr-prose li::marker { color: var(--tr-accent); font-weight: 700; }

/* Quotes (Astra styles <blockquote> too, so every property is set here) */
.tr-prose .wp-block-quote {
  margin-inline: 0; padding: 0 0 0 1.5em; background: none;
  border: 0; border-left: 3px solid var(--tr-accent);
  font-size: inherit; font-style: italic;
}
.tr-prose .wp-block-quote cite { display: block; margin-top: 0.6em; font-style: normal; font-size: var(--tr-step--1); color: var(--tr-text-muted); }
.tr-prose .wp-block-pullquote { margin-inline: 0; padding: var(--tr-space-3) 0; border: 0; border-block: 1px solid var(--tr-border); text-align: center; }
.tr-prose .wp-block-pullquote blockquote { margin: 0; padding: 0; border: 0; background: none; }
.tr-prose .wp-block-pullquote p { font-family: var(--tr-font-heading); font-size: var(--tr-step-2); line-height: 1.35; color: var(--tr-heading); margin: 0; }
.tr-prose .wp-block-pullquote cite { display: block; margin-top: 0.8em; font-style: normal; font-size: var(--tr-step--1); color: var(--tr-text-muted); }

/* Images and captions (galleries keep WordPress's own grid) */
.tr-prose .wp-block-image img { border-radius: var(--tr-radius); }
.tr-prose :is(figcaption, .wp-element-caption) { margin-top: 0.6em; font-size: var(--tr-step--1); color: var(--tr-text-muted); text-align: left; }
.tr-prose .wp-block-gallery .wp-block-image .wp-element-caption { color: #fff; } /* captions sit on the photo */
.tr-prose .alignwide { max-width: none; width: min(100%, calc(var(--tr-measure) + 12rem)); }

/* Tables */
.tr-prose .wp-block-table { margin-inline: 0; overflow-x: auto; border: 0; }
.tr-prose .wp-block-table table { width: 100%; min-width: 34rem; border: 0; border-collapse: collapse; font-size: var(--tr-step--1); line-height: 1.5; }
.tr-prose .wp-block-table :is(th, td) { padding: 0.75em 1em; text-align: left; vertical-align: top; border: 0; border-bottom: 1px solid var(--tr-border); }
.tr-prose .wp-block-table thead { border: 0; }
.tr-prose .wp-block-table thead th { font-weight: 700; color: var(--tr-heading); border-bottom: 2px solid var(--tr-accent); }
.tr-prose .wp-block-table.is-style-stripes tbody tr:nth-child(odd) { background: var(--tr-surface-2); }

/* Media and text */
.tr-prose .wp-block-media-text { gap: var(--tr-space-3); }
.tr-prose .wp-block-media-text__content { padding: 0; }
.tr-prose .wp-block-media-text__content > * + * { margin-top: 0.8em; }
.tr-prose .wp-block-media-text img { border-radius: var(--tr-radius); }

/* Embeds */
.tr-prose .wp-block-embed__wrapper { border-radius: var(--tr-radius); overflow: hidden; }

/* FAQ: core Details block */
.tr-prose .wp-block-details { border-bottom: 1px solid var(--tr-border); padding-block: 0.9em; }
.tr-prose .wp-block-details + .wp-block-details { margin-top: 0; }
.tr-prose .wp-block-details summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 44px; font-weight: 700; cursor: pointer; list-style: none; }
.tr-prose .wp-block-details summary::-webkit-details-marker { display: none; }
.tr-prose .wp-block-details summary::after { content: "+"; font-size: 1.4em; line-height: 1; color: var(--tr-accent); }
.tr-prose .wp-block-details[open] summary::after { content: "\2212"; }
.tr-prose .wp-block-details > :not(summary) { margin: 0.5em 0 0; }

/* Separator */
.tr-prose .wp-block-separator { border: 0; height: 1px; background: var(--tr-border); opacity: 1; }

/* Buttons inside posts: locked to the .tr-btn look, whatever color or
   shape was picked in the editor (that's what the !important is for) */
.tr-prose .wp-block-buttons { display: flex; flex-wrap: wrap; gap: var(--tr-space-1); }
.tr-prose :is(.wp-block-button__link, .wp-element-button) {
  display: inline-flex !important; align-items: center; justify-content: center; min-height: 44px;
  padding: 0.7rem 1.4rem !important;
  border: 2px solid var(--tr-cta) !important; border-radius: var(--tr-radius-btn) !important;
  background: var(--tr-cta) !important; color: var(--tr-on-cta) !important;
  font: 700 var(--tr-step--1)/1.2 var(--tr-font-body) !important; letter-spacing: 0.02em !important; text-transform: none !important;
  text-decoration: none !important; box-shadow: none !important;
}
.tr-prose :is(.wp-block-button__link, .wp-element-button):is(:hover, :focus-visible) {
  background: var(--tr-cta-hover) !important; border-color: var(--tr-cta-hover) !important; color: var(--tr-on-cta) !important;
}
.tr-prose .is-style-outline :is(.wp-block-button__link, .wp-element-button) { background: transparent !important; color: var(--tr-cta-hover) !important; border-color: var(--tr-cta-hover) !important; }
.tr-prose .is-style-outline :is(.wp-block-button__link, .wp-element-button):is(:hover, :focus-visible) { background: var(--tr-cta-hover) !important; color: var(--tr-on-cta) !important; }

/* 6. BLOCK STYLES (registered in inc/tr-system.php; also shown in the editor) */
:is(.tr-prose, .editor-styles-wrapper) .is-style-lead { font-size: var(--tr-step-1); line-height: 1.6; color: var(--tr-heading); }

/* Checklist: List block > Styles > Checklist */
:is(.tr-prose, .editor-styles-wrapper) ul.is-style-checklist { list-style: none; padding-left: 0; }
:is(.tr-prose, .editor-styles-wrapper) ul.is-style-checklist li { position: relative; padding-left: 2em; }
:is(.tr-prose, .editor-styles-wrapper) ul.is-style-checklist li::before {
  content: ""; position: absolute; left: 0; top: 0.3em; width: 1.2em; height: 1.2em; border-radius: 50%; background: var(--tr-accent);
}
:is(.tr-prose, .editor-styles-wrapper) ul.is-style-checklist li::after {
  content: ""; position: absolute; left: 0.38em; top: 0.58em; width: 0.45em; height: 0.25em;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg);
}

/* Callouts: Group block > Styles > Tip, Good to know, At a glance.
   The first heading inside becomes the callout title automatically. */
:is(.tr-prose, .editor-styles-wrapper) :is(.is-style-tip, .is-style-note, .is-style-key-facts) {
  padding: var(--tr-space-3); border-radius: var(--tr-radius); background: var(--tr-surface-2);
}
:is(.tr-prose, .editor-styles-wrapper) .is-style-tip { background: color-mix(in srgb, var(--tr-accent) 14%, var(--tr-bg)); }
:is(.tr-prose, .editor-styles-wrapper) .is-style-note { background: var(--tr-surface); border: 1px solid var(--tr-border); }
:is(.tr-prose, .editor-styles-wrapper) :is(.is-style-tip, .is-style-note, .is-style-key-facts) > * { margin-block: 0; }
:is(.tr-prose, .editor-styles-wrapper) :is(.is-style-tip, .is-style-note, .is-style-key-facts) > * + * { margin-top: 0.6em; }
:is(.tr-prose, .editor-styles-wrapper) :is(.is-style-tip, .is-style-note, .is-style-key-facts) > .wp-block-heading:first-child {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--tr-font-body); font-size: var(--tr-step-0); font-weight: 700; color: var(--tr-heading);
}
:is(.tr-prose, .editor-styles-wrapper) :is(.is-style-tip, .is-style-note) > .wp-block-heading:first-child::before {
  content: ""; flex: none; width: 20px; height: 20px; background: var(--tr-accent);
  -webkit-mask: var(--tr-callout-icon) center / contain no-repeat; mask: var(--tr-callout-icon) center / contain no-repeat;
}
.is-style-tip { --tr-callout-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 22h4M12 2a7 7 0 0 0-4 12.7V17h8v-2.3A7 7 0 0 0 12 2z'/%3E%3C/svg%3E"); }
.is-style-note { --tr-callout-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E"); }

/* Branch divider: Separator block > Styles > Branch */
:is(.tr-prose, .editor-styles-wrapper) .wp-block-separator.is-style-branch {
  width: 220px; max-width: 100%; height: 28px; margin-inline: auto; border: 0; opacity: 1; background: var(--tr-brown);
  --tr-branch: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 28' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 16 C50 13 110 19 196 14'/%3E%3Cpath d='M150 15 C156 8 164 6 170 5'/%3E%3Cpath d='M170 5 C165 10 158 13 150 15Z' fill='black'/%3E%3Cpath d='M178 14 C186 20 194 22 200 22'/%3E%3Cpath d='M200 22 C192 16 186 14 178 14Z' fill='black'/%3E%3C/svg%3E");
  -webkit-mask: var(--tr-branch) center / contain no-repeat; mask: var(--tr-branch) center / contain no-repeat;
}

/* 7. VARIATIONS ------------------------------------------------------------ */
/* Dark section: the same components, flipped by one class.
   Named .tr-dark (not .is-dark) so it can't clash with other .is-dark styles on the site. */
.tr-dark {
  --tr-heading: #f6efe3; --tr-text: #f1eadf; --tr-text-muted: #c9bcae;
  --tr-link: #f1e2c2; --tr-surface: #3c322d; --tr-border: #5a4c44;
  --tr-accent: #a9b598; --tr-accent-hover: #bcc6ad; --tr-on-accent: var(--tr-ink);
  background: var(--tr-dark-bg); color: var(--tr-text);
}

/* 8. ASTRA BRIDGE: delete this section when the custom theme replaces Astra */
body.tr-page-body,
body.tr-page-body .site-content { background: var(--tr-bg); }
body.tr-page-body #content > .ast-container { display: block; max-width: none; padding: 0; margin: 0; }
body.tr-page-body .tr-btn { font-family: var(--tr-font-body); line-height: 1; }
body.tr-page-body .tr-btn:hover,
body.tr-page-body .tr-btn:focus { background: var(--btn-bg-h); color: var(--btn-fg-h); border-color: var(--btn-bd-h); }

/* index.css / Astra heading decoration: no highlight bars, no all caps */
body.tr-page-body .tr-page :is(h1, h2, h3, h4) {
  background: none; background-image: none; box-shadow: none;
  text-transform: none; letter-spacing: normal; padding: 0; border: 0; display: block;
}
body.tr-page-body .tr-page :is(h1, h2, h3, h4)::after { content: none; display: none; }
body.tr-page-body .tr-page :is(.tr-post-hero__title, .tr-section-title, .tr-cta__title, .tr-card__title)::before { content: none; display: none; }
body.tr-page-body .tr-page :is(.tr-post-hero__title, .tr-section-title, .tr-cta__title) span { background: none; box-shadow: none; }

/* Keep heading spacing even when Astra adds its own margins */
body.tr-page-body .tr-prose > :is(h2, h3, h4) { margin-bottom: 0; }
body.tr-page-body .tr-prose > h2 { margin-top: 2em; }
body.tr-page-body .tr-prose > h3 { margin-top: 1.6em; }
body.tr-page-body .tr-prose > h4 { margin-top: 1.4em; }
body.tr-page-body .tr-prose > :is(h2, h3, h4) + * { margin-top: 0.5em; }
body.tr-page-body .tr-prose > h2 + h3 { margin-top: 0.8em; }
body.tr-page-body .tr-prose > :first-child { margin-top: 0; }

/* Astra article padding was pushing the post text out of line with the title */
body.tr-page-body .tr-layout__main { margin: 0; padding: 0; background: none; border: 0; box-shadow: none; }
body.tr-page-body .tr-btn { text-transform: none; letter-spacing: 0.02em; border-radius: var(--tr-radius-btn); }

/* Astra and index.css strip link color and underline; put them back in post text */
body.tr-page-body .tr-prose a:not(.wp-block-button__link):not(.wp-element-button):not(.tr-btn) {
  color: var(--tr-link-prose); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em;
}
body.tr-page-body .tr-prose a:not(.wp-block-button__link):not(.wp-element-button):not(.tr-btn):hover {
  color: var(--tr-ink); text-decoration-thickness: 2px;
}

/* Stay banner: undo any leftover decoration from index.css */
body.tr-page-body .tr-dark :is(.tr-container, .tr-cta, .tr-cta > div)::before,
body.tr-page-body .tr-dark :is(.tr-container, .tr-cta, .tr-cta > div)::after { content: none; display: none; }
body.tr-page-body .tr-dark :is(.tr-container, .tr-cta, .tr-cta > div) { background: none; }
body.tr-page-body .tr-cta .tr-cta__title { white-space: normal; overflow-wrap: break-word; }
body.tr-page-body .tr-cta p {
  color: var(--tr-text); font-family: var(--tr-font-body); font-weight: 400;
  text-transform: none; letter-spacing: normal; white-space: normal;
}

/* Even padding above and below the stay banner (something was removing the bottom padding) */
body.tr-page-body section.tr-section.tr-dark { padding-top: var(--tr-space-5); padding-bottom: var(--tr-space-5); margin: 0; }
@media (max-width: 759px) {
  body.tr-page-body section.tr-section.tr-dark { padding-top: var(--tr-space-4); padding-bottom: var(--tr-space-4); }
}
body.tr-page-body .tr-cta > div, body.tr-page-body .tr-cta p { margin-bottom: 0; padding-bottom: 0; }
