/* === CHESS RABBITS — TIGHT HERO BASELINE === */

/* 1) Remove top spacing site-wide; we'll add it back where needed */
.site-content,
.site-main,
.content-area {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* 2) Make first block flush with the top when used as a hero */
.entry-content > .wp-block-cover:first-child,
.entry-content > .wp-block-group.alignfull:first-child,
.entry-content > *:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
  margin-bottom: 0 !important; /* remove gap beneath hero */
  padding-bottom: 0 !important;
}

/* 3) Keep Gutenberg block gaps tight on static pages only (not posts/archives) */
body.page .entry-content {
  --wp--style--block-gap: 0px !important;
  gap: 0 !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* 4) Hide static page titles for SEO/screen readers only; show titles on posts */
body.page .entry-title {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%) !important;
  height: 1px !important;
  width: 1px !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

body.single-post .entry-title {
  position: static !important;
  clip: auto !important;
  clip-path: none !important;
  height: auto !important;
  width: auto !important;
  overflow: visible !important;
  white-space: normal !important;
  margin: 0 0 1rem !important;
  padding: 0 !important;
}

/* 5) Tighten spacing between posts on archives/blog index */
.blog .site-main article,
.archive .site-main article {
  margin-bottom: 1.5rem;
  padding-bottom: 0;
}

/* 6) Admin bar spacing fix when logged in (prevents overlap with top bar for logged-in view) */
@media (min-width: 782px) {
  body.admin-bar .site-content,
  body.admin-bar .site-main,
  body.admin-bar .content-area {
    padding-top: 32px; /* admin bar height */
  }
}

/* 7) Image centering utilities, including captions */
.wp-block-image {
  text-align: center;
  display: block;
}

.wp-block-image figure {
  display: inline-block;
  text-align: center;
}

.wp-block-image img {
  display: block;
  margin: 0 auto;
}

.wp-block-image figcaption {
  text-align: center;
  display: block;
}

/* === NEWS & THINKINGS (blog index) — restore breathing room === */
body.blog .site-content,
body.blog .site-main,
body.blog .content-area {
  margin-top: 32px !important;
  padding-top: 0 !important;
}

body.blog .wp-custom-header,
body.blog .custom-header,
body.blog .header-image,
body.blog .site-header {
  margin-bottom: 24px !important;
}

body.blog .site-main article:first-of-type {
  margin-top: 16px !important;
}

body.blog .wp-block-query {
  margin-top: 24px !important;
}

body.blog .site-main {
  --wp--style--block-gap: 24px !important;
}

/* === SINGLE POST — restore breathing room === */
body.single-post .site-content,
body.single-post .site-main,
body.single-post .content-area {
  margin-top: 32px !important;
  padding-top: 0 !important;
}

body.single-post .wp-custom-header,
body.single-post .custom-header,
body.single-post .header-image,
body.single-post .site-header,
body.single-post .post-thumbnail,
body.single-post .featured-media,
body.single-post .entry-header {
  margin-bottom: 24px !important;
}

body.single-post .entry-content > .wp-block-cover:first-child,
body.single-post .entry-content > .wp-block-group:first-child,
body.single-post .entry-content > .wp-block-image:first-child,
body.single-post .entry-content > *:first-child {
  margin-bottom: 24px !important;
}

