/* Wagtail article presentation. Block templates, fields and content remain intact.
   Keep every article rule scoped so directory pages and CMS embeds keep their styles. */
.guidebook {
  --gb-heading: #193331;
  --gb-text: #354c43;
  --gb-muted: #61726b;
  --gb-accent: #146b58;
  --gb-accent-hover: #105745;
  --gb-border: #e2e9e4;
  --gb-surface: #fff;
  --gb-soft: #f5f7f3;
  --gb-link: var(--gb-accent);
  --gb-link-hover: var(--gb-accent-hover);
  color: var(--gb-text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.025rem;
  line-height: 1.8;
  overflow-wrap: anywhere;
  padding-inline: clamp(1.25rem, 4vw, 4rem);
  padding-bottom: clamp(2rem, 5vw, 4rem);
}
.guidebook .breadcrumb {
  color: var(--gb-muted);
  line-height: 1.6;
}
.guidebook a {
  color: var(--gb-link);
  text-underline-offset: 3px;
}
.guidebook a:hover { color: var(--gb-link-hover); }
.guidebook :is(a, button, input, select, textarea):focus-visible {
  outline: 3px solid #31b989;
  outline-offset: 3px;
}
.guidebook-body [id] { scroll-margin-top: 1.5rem; }
.guidebook-body :is(h1, h2, h3, h4, .h2) {
  color: var(--gb-heading);
  font-family: inherit;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -.02em;
  margin-bottom: .85rem;
}
.guidebook-body :is(h2, .h2) { font-size: clamp(1.4rem, 2.5vw, 1.8rem); }
.guidebook-body h3 { font-size: 1.3rem; }
.guidebook-body h4 { font-size: 1.12rem; }
.guidebook-body p { margin-bottom: 1.15rem; }
.guidebook-body .rich-text > :first-child { margin-top: 0; }
.guidebook-body .rich-text > :last-child { margin-bottom: 0; }
.guidebook-body :is(.gb-intro__kicker, .gb-section-heading__eyebrow) {
  color: var(--gb-link);
  font-size: .78rem;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: .65rem;
}
.guidebook-body :is(.gb-section__subheading, .gb-section-heading__lede,
  .gb-checklist__intro, .gb-cards__intro) { color: var(--gb-muted); }

/* Preserve the hero's full-width template and CMS background image. */
.guidebook .gb-hero {
  position: relative;
  padding-block: clamp(3rem, 7vw, 5rem);
  overflow: hidden;
}
.guidebook .gb-hero__bg { position: absolute; inset: 0; z-index: 0; }
.guidebook .gb-hero__bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .16;
}
.guidebook .gb-hero__inner { position: relative; z-index: 1; max-width: 760px; }
.guidebook .gb-hero__title {
  margin-bottom: 1rem;
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  line-height: 1.18;
  letter-spacing: -.03em;
}
.guidebook .gb-hero__subtitle {
  max-width: 65ch;
  margin-bottom: 0;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.65;
}

/* Both background class spellings are used by existing block templates.
   Local tokens let nested light cards retain their own readable palette. */
.guidebook :is(.gb-bg-light, .gb-bg--light, .gb-hero--light, .gb-cta--light) {
  background: var(--gb-soft);
}
.guidebook :is(.gb-bg-light, .gb-bg--light, .gb-bg-dark, .gb-bg--dark, .gb-cta) {
  padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: 12px;
}
.guidebook :is(.gb-bg-dark, .gb-bg--dark, .gb-hero--dark, .gb-cta--dark, .gb-cta--gradient) {
  --gb-heading: #f3f7f1;
  --gb-text: #e3ede6;
  --gb-muted: #c0d4c7;
  --gb-border: #456257;
  --gb-surface: #243f36;
  --gb-soft: #243f36;
  --gb-link: #a4e1c4;
  --gb-link-hover: #d5f5e4;
  color: var(--gb-text);
  background: #193331;
}
.guidebook .gb-cta--gradient { background: linear-gradient(120deg, #193331, #245744); }
/* Explicit light backgrounds and cards reset inherited dark-section colors. */
.guidebook :is(.gb-bg-light, .gb-bg--light, .gb-hero--light, .gb-cta--light, .gb-card) {
  --gb-heading: #193331;
  --gb-text: #354c43;
  --gb-muted: #61726b;
  --gb-border: #e2e9e4;
  --gb-surface: #fff;
  --gb-soft: #f5f7f3;
  --gb-link: #146b58;
  --gb-link-hover: #105745;
  color: var(--gb-text);
}

/* Shared column behavior; preserve each editor-selected layout and ordering. */
.guidebook :is(.gb-content-img__grid, .gb-toc-download__grid, .gb-two-col__grid,
  .gb-three-col__grid, .gb-four-col__grid, .gb-cards__grid) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2rem);
  align-items: start;
}
.guidebook :is(.gb-content-img__grid, .gb-toc-download__grid, .gb-two-col__grid,
  .gb-three-col__grid, .gb-four-col__grid, .gb-cards__grid) > * { min-width: 0; }
.guidebook :is(.gb-content-img__img, .gb-content__figure img, .gb-card__media img) {
  display: block;
  max-width: 100%;
  width: 100%;
  height: auto;
}
.guidebook :is(.gb-content-img__img, .gb-content__figure img) { border-radius: 9px; }
.guidebook .gb-content__figure { margin: 1.25rem 0; }
.guidebook .gb-content__caption { color: var(--gb-muted); font-size: .85rem; margin-top: .5rem; }
.guidebook .gb-content-header { margin: 1.25rem 0 .75rem; }
.guidebook .gb-content-header--h2 { font-size: 1.6rem; }
.guidebook .gb-content-header--h3 { font-size: 1.3rem; }
.guidebook .gb-content-header--h4 { font-size: 1.12rem; }

@media (min-width: 700px) {
  .guidebook :is(.gb-four-col__grid, .gb-cards__grid--cols-2, .gb-cards__grid--cols-4) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .guidebook .gb-cards__grid--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .guidebook :is(.gb-content-img__grid--text_left_image_right,
    .gb-content-img__grid--image_left_text_right) {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  }
  .guidebook :is(.gb-toc-download__grid, .gb-two-col__grid) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .guidebook :is(.gb-two-col__grid--text_left_image_right, .gb-two-col__grid--callout_left_content_right) {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  }
  .guidebook .gb-two-col__grid--image_left_text_right {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  }
  .guidebook .gb-two-col__grid--image_left_text_right .gb-two-col__col--left { order: 2; }
  .guidebook .gb-two-col__grid--image_left_text_right .gb-two-col__col--right { order: 1; }
  .guidebook .gb-three-col__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .guidebook :is(.gb-four-col__grid, .gb-cards__grid--cols-4) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Lists are limited to article content, leaving embedded forms alone. */
.guidebook :is(.rich-text, .gb-content__bullets, .gb-intro__bullets) :is(ul, ol),
.guidebook .gb-intro__bullets { padding-left: 1.4rem; margin-bottom: 1.25rem; }
.guidebook :is(.rich-text, .gb-content__bullets, .gb-intro__bullets) li { margin-bottom: .45rem; }
.guidebook :is(.rich-text, .gb-content__bullets, .gb-intro__bullets) li::marker { color: var(--gb-link); }
.guidebook .gb-checklist__items { list-style: none; padding: 0; margin: 0; font-weight: 600; }
.guidebook .gb-checklist__item { position: relative; padding-left: 2.25rem; margin: 1rem 0; }
/* CSS checkmarks match the new palette while keeping the optional heading icon. */
.guidebook .gb-checklist__item::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: .2rem;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--gb-soft);
  color: var(--gb-link);
  line-height: 1;
}
.guidebook .gb-section-heading__icon {
  background-image: none !important; /* Override the template's blue icon. */
  background-color: var(--gb-link);
  mask: var(--gb-section-heading-icon-url) center / contain no-repeat;
  -webkit-mask: var(--gb-section-heading-icon-url) center / contain no-repeat;
}

.guidebook :is(.gb-callout, .gb-inline-callout, .gb-toc-download__card, .gb-card) {
  border: 1px solid var(--gb-border);
  border-radius: 12px;
  background: var(--gb-surface);
  box-shadow: 0 3px 12px rgba(25, 51, 49, .035);
}
.guidebook :is(.gb-callout, .gb-inline-callout, .gb-toc-download__card) {
  padding: clamp(1.25rem, 3vw, 1.75rem);
}
.guidebook :is(.gb-callout, .gb-inline-callout) { border-left: 4px solid var(--gb-link); }
.guidebook :is(.gb-callout--note, .gb-inline-callout--note) { border-left-color: #7b8b80; }
.guidebook :is(.gb-callout--warning, .gb-inline-callout--warning) { border-left-color: #b77920; }
.guidebook :is(.gb-callout--success, .gb-inline-callout--success) { border-left-color: #37966a; }
.guidebook :is(.gb-callout__heading, .gb-inline-callout__heading, .gb-card__title) {
  color: var(--gb-heading);
  font-size: 1.1rem;
  font-weight: 650;
  line-height: 1.4;
  margin-bottom: .65rem;
}
.guidebook .gb-divider { padding-block: 1.5rem; }
.guidebook .gb-divider__line { margin: 0; border: 0; height: 1px; background: var(--gb-border); opacity: 1; }
.guidebook .gb-cards__grid { align-items: stretch; }
.guidebook .gb-card { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.guidebook .gb-card__body { padding: 1.25rem; }
.guidebook .gb-card__desc { line-height: 1.7; }

/* TOC links keep their complete clickable rows and numbered anchors. */
.guidebook .gb-toc-download__toc-list { list-style: none; counter-reset: toc; margin: 0; padding: 0; }
.guidebook .gb-toc-download__toc-item {
  counter-increment: toc;
  position: relative;
  padding: .9rem 0 .9rem 2.5rem;
  border-bottom: 1px solid var(--gb-border);
  font-size: 1rem;
  line-height: 1.6;
}
.guidebook .gb-toc-download__toc-item:last-child { border-bottom: 0; }
.guidebook .gb-toc-download__toc-item::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute;
  left: 0;
  color: var(--gb-link);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.guidebook .gb-toc-download__toc-link { display: flex; align-items: center; gap: 1rem; text-decoration: none; }
.guidebook .gb-toc-download__toc-link-text { flex: 1; min-width: 0; }
.guidebook .gb-toc-download__toc-link-cta { display: inline-flex; align-items: center; gap: .4rem; flex-shrink: 0; }
.guidebook .gb-toc-download__toc-link-cta-text { font-size: .85rem; font-weight: 600; }
.guidebook .gb-toc-download__toc-link-cta-icon { width: 18px; height: 18px; }
.guidebook .gb-toc-download__toc-link:hover .gb-toc-download__toc-link-text { text-decoration: underline; }
.guidebook .gb-toc-download__form { margin-top: 1rem; }

.guidebook .gb-cta { border: 1px solid var(--gb-border); }
.guidebook .gb-cta__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; }
.guidebook .gb-cta__text { flex: 1 1 30ch; min-width: 0; }
.guidebook .gb-cta__body { margin-bottom: 0; }
.guidebook .gb-cta__action { max-width: 100%; }
.guidebook :is(.gb-btn--primary, .gb-toc-download__download-btn) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  max-width: 100%;
  padding: .7rem 1.2rem;
  border: 1px solid var(--gb-accent);
  border-radius: 7px;
  background: var(--gb-accent);
  color: #fff;
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
}
.guidebook :is(.gb-btn--primary, .gb-toc-download__download-btn):hover {
  background: var(--gb-accent-hover);
  border-color: var(--gb-accent-hover);
  color: #fff;
}
.guidebook .gb-toc-download__download-btn { display: flex; width: fit-content; margin: 1.5rem auto 0; }

@media (max-width: 575.98px) {
  .guidebook { font-size: 1rem; line-height: 1.75; }
  .guidebook .gb-toc-download__toc-link { gap: .5rem; }
}

/* Guidebook Index Cards */
.gb-index-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

@media (min-width: 900px) {
    .gb-index-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.gb-index-card {
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.gb-index-card__media {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #f3f4f6;
    overflow: hidden;
}

.gb-index-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gb-index-card__body {
    padding: 18px 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.gb-index-card__meta {
    font-size: 13px;
    color: rgba(0,0,0,.70);
    display: flex;
    align-items: center;
    gap: 10px;
}

.gb-index-card__meta .gb-index-card__pill {
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: rgba(0,0,0,.78);
}

.gb-index-card__meta .gb-index-card__sep {
    width: 1px;
    height: 14px;
    background: rgba(0,0,0,.25);
    display: inline-block;
}

.gb-index-card__title {
    margin: 0;
    font-size: 20px;
    line-height: 1.25;
    font-weight: 800;
    color: #111;
}

.gb-index-card__title a {
    color: inherit;
    text-decoration: none;
}

.gb-index-card__excerpt {
    margin: 0;
    color: rgba(0,0,0,.78);
    line-height: 1.5;
}

.gb-index-card__footer {
    margin-top: auto;
    padding-top: 6px;
}

.gb-index-card__readmore {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: .02em;
    text-transform: uppercase;
    text-decoration: none;
    color: #355aa5;
}

.gb-index-card__readmore svg {
    width: 18px;
    height: 18px;
}
