/**
 * Blog & archive layout — Impreza Child
 *
 * All rules are namespaced with .bd-* to avoid clashes with Impreza / child style.css.
 * Loaded when bd_should_load_blog_styles() is true (see functions.php), including single posts.
 *
 * @package Impreza_Child
 */

/* -------------------------------------------------------------------------- */
/* Design tokens                                                               */
/* -------------------------------------------------------------------------- */

/* Screen reader only (matches WP core pattern). */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

/* Fallback when markup is not inside .bd-blog / .bd-archive (e.g. single-post breadcrumbs). */
:root {
  --bd-max-width: 1280px;
}

.bd-blog,
.bd-archive,
.bd-single-shell {
  --bd-font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bd-color-text: #1a1a1a;
  --bd-color-muted: #5c5c5c;
  --bd-color-border: #e8e8e8;
  --bd-color-surface: #fafafa;
  --bd-radius: 10px;
  --bd-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --bd-max-width: 1280px;
  --bd-gap: 1.5rem;
  font-family: var(--bd-font-sans);
  color: var(--bd-color-text);
}

/* Child blog layouts: readable link hover (avoid theme .l-main forcing white text). */
.bd-blog__nav a:hover,
.bd-blog__nav a:focus-visible,
.bd-blog__subtitle.entry-content a:hover,
.bd-blog-latest__title a:hover,
.bd-blog-section__link:hover,
.bd-archive__breadcrumbs a:hover,
.bd-sidebar__list a:hover,
.bd-sidebar__recent-title a:hover,
.bd-single-shell a:hover {
  color: var(--bd-color-text) !important;
  text-decoration: none;
}

.bd-blog__footer-cta a:hover {
  color: #fff !important;
  text-decoration: none;
}

/* -------------------------------------------------------------------------- */
/* Landing: outer shell                                                        */
/* -------------------------------------------------------------------------- */

.bd-blog {
  max-width: var(--bd-max-width);
  margin-left: auto;
  margin-right: auto;
  padding: 2rem 1.25rem 4rem;
  position: relative;
  z-index: 1;
  clear: both;
  width: 100%;
  box-sizing: border-box;
}

/*
 * Impreza pads only .l-main > .l-section > .l-section-h under a fixed / transparent header.
 * Our hub and archive shells are direct children of #page-content, so use body flags from
 * {@see bd_blog_landing_body_class()} (bd-hor-header-overlays-main) — sibling selectors alone
 * can miss when markup differs. Keep sibling rules as a fallback.
 */
body.bd-hor-header-overlays-main #page-content.l-main>#bd-blog-landing.bd-blog {
  padding-top: calc(var(--header-height, 0px) + 1.25rem);
}

body.bd-hor-header-overlays-main #page-content.l-main>#bd-blog-all-posts.bd-blog,
body.bd-hor-header-overlays-main #page-content.l-main>#bd-blog-archive.bd-archive {
  padding-top: calc(var(--header-height, 0px) + 2rem);
}

body.bd-hor-header-overlays-main #page-content.l-main>#bd-blog-category.bd-archive {
  padding-top: calc(var(--header-height, 0px) + 1.5625rem);
}

.header_hor .l-header.pos_fixed~.l-main>#bd-blog-landing.bd-blog {
  padding-top: calc(var(--header-height, 0px) + 1.25rem);
}

.header_hor .l-header.pos_fixed~.l-main>#bd-blog-all-posts.bd-blog,
.header_hor .l-header.pos_fixed~.l-main>#bd-blog-archive.bd-archive {
  padding-top: calc(var(--header-height, 0px) + 2rem);
}

.header_hor .l-header.pos_fixed~.l-main>#bd-blog-category.bd-archive {
  padding-top: calc(var(--header-height, 0px) + 1.5625rem);
}

.header_hor .l-header.pos_static.bg_transparent~.l-main>#bd-blog-landing.bd-blog {
  padding-top: calc(var(--header-height, 0px) + 1.25rem);
}

.header_hor .l-header.pos_static.bg_transparent~.l-main>#bd-blog-all-posts.bd-blog,
.header_hor .l-header.pos_static.bg_transparent~.l-main>#bd-blog-archive.bd-archive {
  padding-top: calc(var(--header-height, 0px) + 2rem);
}

.header_hor .l-header.pos_static.bg_transparent~.l-main>#bd-blog-category.bd-archive {
  padding-top: calc(var(--header-height, 0px) + 1.5625rem);
}

.bd-blog__breadcrumbs {
  margin: 0 0 1rem;
}

.bd-blog__intro {
  margin-bottom: 2rem;
}

.bd-blog__title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

.bd-blog__subtitle {
  margin: 0;
  font-size: 1.05rem;
  color: var(--bd-color-muted);
  font-weight: 400;
  max-width: 42rem;
}

/* -------------------------------------------------------------------------- */
/* Category nav (tabs)                                                         */
/* -------------------------------------------------------------------------- */

.bd-blog__nav-wrap {
  position: sticky;
  top: var(--wp-admin--admin-bar--height, 0px);
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--bd-color-border);
  margin: 0 -1.25rem 2rem;
  padding: 0.75rem 1.25rem;
}

.bd-blog__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  max-width: var(--bd-max-width);
  margin: 0 auto;
}

.bd-blog__nav-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bd-color-muted);
  margin-right: 0.25rem;
}

.bd-blog__nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--bd-color-text);
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.bd-blog__nav a:hover,
.bd-blog__nav a:focus-visible {
  background: var(--bd-color-surface);
  outline: none;
}

/* -------------------------------------------------------------------------- */
/* Hero + latest row                                                           */
/* -------------------------------------------------------------------------- */

.bd-blog__hero-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--bd-gap);
  margin-bottom: 3rem;
}

@media (min-width: 900px) {
  .bd-blog__hero-row {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    /* Top-align columns: do not stretch the hero card to the sidebar height. */
    align-items: start;
  }
}

/* Hero: category → title → excerpt → image; entire card is one link (.bd-blog-hero__wrap-link). */
.bd-blog-hero__wrap-link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--bd-radius);
  overflow: hidden;
  border: 1px solid var(--bd-color-border);
  box-shadow: var(--bd-shadow);
  outline-offset: 4px;
}

.bd-blog-hero__wrap-link:focus-visible {
  outline: 3px solid #2563eb;
}

.bd-blog .bd-blog-hero {
  display: flex;
  flex-direction: column;
  border: none;
  border-radius: 0;
  overflow: visible;
  background-color: #fff;
  background-image: none;
  box-shadow: none;
  color: var(--bd-color-text);
}

.bd-blog-hero__content {
  padding: 1.75rem 1.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background-color: #fff;
  background-image: none;
}

.bd-blog-hero__cat {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bd-color-muted);
  margin: 0 0 0.65rem;
}

.bd-blog .bd-blog-hero .bd-blog-hero__title {
  font-size: clamp(1.35rem, 2.8vw, 1.95rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  max-width: 38rem;
  color: var(--bd-color-text);
}

.bd-blog .bd-blog-hero .bd-blog-hero__title-text {
  color: var(--bd-color-text);
}

.bd-blog .bd-blog-hero .bd-blog-hero__excerpt {
  color: var(--bd-color-muted);
  font-size: 1rem;
  line-height: 1.55;
  margin: 0 0 1rem;
  max-width: 40rem;
}

.bd-blog-hero__wrap-link:hover .bd-blog-hero__img {
  opacity: 0.92;
}

.bd-blog-hero__figure {
  display: block;
  margin: 0;
  padding: 0;
  line-height: 0;
  background-color: #fff;
  background-image: none;
  border-top: 1px solid var(--bd-color-border);
}

.bd-blog-hero__figure-inner {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
}

.bd-blog-hero:not(:has(.bd-blog-hero__figure)) .bd-blog-hero__content {
  padding-bottom: 1.75rem;
}

.bd-blog-hero__img {
  width: 100%;
  height: auto;
  max-width: 820px;
  max-height: 400px;
  display: block;
  margin: 0;
  /* Flush to card edges; inner curve matches parent (1px border on .bd-blog-hero). */
  border-radius: 0 0 calc(var(--bd-radius) - 1px) calc(var(--bd-radius) - 1px);
  transition: opacity 0.2s ease;
}

/* Latest posts column */
.bd-blog-latest {
  border: 1px solid var(--bd-color-border);
  border-radius: var(--bd-radius);
  background: #fff;
  box-shadow: var(--bd-shadow);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.bd-blog-latest__heading {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 1rem;
  color: var(--bd-color-muted);
}

.bd-blog-latest__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.bd-blog-latest__item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--bd-color-border);
}

.bd-blog-latest__item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.bd-blog-latest__thumb {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bd-color-surface);
}

.bd-blog-latest__thumb a,
.bd-blog-latest__thumb .bialty-container {
  display: block;
  width: 100%;
  height: 100%;
}

.bd-blog-latest__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bd-blog-latest__title {
  grid-column: 2;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  /* Impreza: h3 { padding-top: 1.5rem } when not :first-child (thumb is first). */
  margin: 0 !important;
  padding-top: 0 !important;
}

.bd-blog .bd-blog-latest__item > h3.bd-blog-latest__title {
  margin: 0 !important;
  padding-top: 0 !important;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
}

.bd-blog-latest__title a {
  color: var(--bd-color-text);
  text-decoration: none;
  display: block;
}

.bd-blog-latest__title a:hover {
  text-decoration: underline;
}

/* -------------------------------------------------------------------------- */
/* Category sections on landing                                                */
/* -------------------------------------------------------------------------- */

.bd-blog-section {
  margin-bottom: 3rem;
}

.bd-blog-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.bd-blog-section__title {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0;
}

.bd-blog-section__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bd-color-text);
  text-decoration: none;
}

.bd-blog-section__link:hover {
  text-decoration: underline;
}

.bd-blog-section__link svg {
  width: 1em;
  height: 1em;
}

.bd-blog-section__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--bd-gap);
}

@media (min-width: 640px) {
  .bd-blog-section__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .bd-blog-section__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.bd-blog__footer-cta {
  text-align: center;
  margin-top: 2rem;
}

.bd-blog__footer-cta a {
  display: inline-flex;
  padding: 0.85rem 1.75rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
  background: #1a1a1a;
  border-radius: 8px;
  text-decoration: none;
}

.bd-blog__footer-cta a:hover {
  opacity: 0.92;
}

/* -------------------------------------------------------------------------- */
/* Post card                                                                   */
/* -------------------------------------------------------------------------- */

.bd-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--bd-color-border);
  border-radius: var(--bd-radius);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--bd-shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  height: 100%;
}

.bd-card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.bd-card__link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.bd-card__thumb {
  aspect-ratio: 16 / 10;
  background: var(--bd-color-surface);
  overflow: hidden;
}

.bd-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.bd-card:hover .bd-card__thumb img {
  transform: scale(1.03);
}

.bd-card__body {
  padding: 1.1rem 1.15rem 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.bd-card__badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  color: #fff;
  background: var(--bd-cat-color, #2563eb);
  margin-bottom: 0.5rem;
}

.bd-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 0.5rem;
  color: var(--bd-color-text);
}

.bd-card__excerpt {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--bd-color-muted);
  margin: 0 0 1rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bd-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--bd-color-border);
}

.bd-card__date {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--bd-color-muted);
  flex-shrink: 0;
}

.bd-card__read {
  font-size: 0.75rem;
  color: var(--bd-color-muted);
  flex-shrink: 0;
}

/* -------------------------------------------------------------------------- */
/* Archive + category: two-column (main + sidebar right)                       */
/* -------------------------------------------------------------------------- */

.bd-archive {
  max-width: var(--bd-max-width);
  margin-left: auto;
  margin-right: auto;
  padding: 2rem 1.25rem 4rem;
  position: relative;
  z-index: 1;
  clear: both;
  width: 100%;
  box-sizing: border-box;
}

.bd-archive__header {
  margin-bottom: 2rem;
}

.bd-archive__breadcrumbs {
  font-size: 0.8rem;
  color: var(--bd-color-muted);
  margin-bottom: 0.75rem;
  margin-top: 20px !important;
}

.bd-archive__breadcrumbs a {
  color: var(--bd-color-muted);
  text-decoration: none;
}

.bd-archive__breadcrumbs a:hover {
  color: var(--bd-color-text);
  text-decoration: none;
}

.bd-archive__title {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.bd-archive__desc {
  margin: 0;
  font-size: 1rem;
  color: var(--bd-color-muted);
  max-width: 40rem;
}

.bd-archive__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 900px) {
  .bd-archive__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 260px);
    gap: 2.5rem;
  }
}

/* -------------------------------------------------------------------------- */
/* Single post: main + sidebar right                                           */
/* -------------------------------------------------------------------------- */

.bd-single-shell {
  max-width: var(--bd-max-width);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
  padding: 1.5rem 1.25rem 4rem;
  position: relative;
  z-index: 1;
  clear: both;
}

/* Space below breadcrumbs before hero (single post). */
body.bd-single-post-bc #page-content.l-main>.bd-breadcrumbs-wrap+#bd-single-post-shell {
  margin-top: 0px;
}

@media screen and (max-width: 600px) {
  .bd-single-shell {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

.bd-single-shell__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 900px) {
  .bd-single-shell__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 260px);
    gap: 3.5rem;
  }
}

.bd-single-shell__main {
  min-width: 0;
}

/*
 * Impreza .l-section.height_* applies 4rem+ padding on the section itself; that left the hero
 * far below the sidebar “Categories” line. Match the sidebar card’s vertical padding (1.25rem).
 */
body.bd-single-post-bc #page-content.l-main>section.l-section:first-of-type,
body.bd-single-post-bc #page-content.l-main .bd-single-shell__main>section.l-section:first-of-type {
  padding-top: 1.25rem !important;
  padding-left: 16px !important;
  padding-right: 16px !important;
}

/* Sidebar */
.bd-sidebar {
  border: 1px solid var(--bd-color-border);
  border-radius: var(--bd-radius);
  background: #fff;
  box-shadow: var(--bd-shadow);
  padding: 1.25rem;
  margin-top: 0;
  margin-bottom: 0;
}

.bd-sidebar__block+.bd-sidebar__block {
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--bd-color-border);
}

.bd-sidebar__heading {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 1rem;
  color: var(--bd-color-muted);
}

.bd-sidebar__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.bd-sidebar__list li {
  margin-bottom: 0.35rem;
}

.bd-sidebar__list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  margin-left: -0.5rem;
  margin-right: -0.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--bd-color-text);
  text-decoration: none;
}

.bd-sidebar__list a:hover {
  background: var(--bd-color-surface);
}

.bd-sidebar__list a.is-active {
  background: #eff6ff;
  font-weight: 600;
}

.bd-sidebar__count {
  font-size: 0.75rem;
  color: var(--bd-color-muted);
}

.bd-sidebar__recent-item {
  display: flex;
  gap: 0.65rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--bd-color-border);
}

.bd-sidebar__recent-item:last-child {
  border-bottom: none;
}

.bd-sidebar__recent-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bd-color-surface);
}

.bd-sidebar__recent-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bd-sidebar__recent-title {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
  text-align: left;
}

.bd-sidebar__recent-title a {
  color: var(--bd-color-text);
  text-decoration: none;
  text-align: left;
}

.bd-sidebar__recent-title a:hover {
  text-decoration: underline;
}

/* Archive main grid */
.bd-archive__cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--bd-gap);
}

@media (min-width: 640px) {
  .bd-archive__cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .bd-archive__cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Pagination */
.bd-archive__pagination {
  margin-top: 2.5rem;
  display: flex;
  justify-content: center;
}

.bd-archive__pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  justify-content: center;
}

.bd-archive__pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 999px;
  text-decoration: none;
  color: var(--bd-color-text);
  border: 1px solid transparent;
}

.bd-archive__pagination .page-numbers:hover,
.bd-archive__pagination .page-numbers.current {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

.bd-archive__pagination .page-numbers.dots {
  background: transparent;
  color: var(--bd-color-muted);
  border: none;
}

.bd-archive__empty {
  padding: 2rem;
  text-align: center;
  color: var(--bd-color-muted);
  border: 1px dashed var(--bd-color-border);
  border-radius: var(--bd-radius);
}

/* -------------------------------------------------------------------------- */
/* Single post: breadcrumbs (us_before_page) + avoid double header padding     */
/* -------------------------------------------------------------------------- */

.bd-breadcrumbs-wrap {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding-left: 2.5rem;
  padding-right: 2.5rem;
  padding-bottom: 0;
  text-align: left;
}

@media screen and (max-width: 600px) {
  .bd-breadcrumbs-wrap {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/*
 * Match Impreza: .l-section outer padding + .l-section-h max-width so crumbs sit in the
 * same column as the post (not full-bleed under #page-content).
 */
.bd-breadcrumbs-wrap .bd-archive__breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 0.15rem 0.35rem;
  box-sizing: border-box;
  width: 100%;
  max-width: var(--site-content-width, 1200px);
  margin: 0 auto;
  padding-bottom: 0;
  line-height: 1.35;
}

body.bd-hor-header-overlays-main #page-content.l-main>.bd-breadcrumbs-wrap {
  padding-top: calc(var(--header-height, 0px) + 1.25rem + 9px);
}

.header_hor .l-header.pos_fixed~.l-main>.bd-breadcrumbs-wrap {
  padding-top: calc(var(--header-height, 0px) + 1.25rem + 9px);
}

.header_hor .l-header.pos_static.bg_transparent~.l-main>.bd-breadcrumbs-wrap {
  padding-top: calc(var(--header-height, 0px) + 1.25rem + 9px);
}

/*
 * Breadcrumb row clears the fixed header; keep first section flush so the hero sits
 * closer to the trail (Impreza’s default section top padding is trimmed here).
 * Includes .bd-single-shell__main when the blog sidebar wrapper is present (live view),
 * and direct .l-main children for US Builder preview (no wrapper).
 */
body.bd-single-post-bc #page-content.l-main>section.l-section:first-of-type>.l-section-h,
body.bd-single-post-bc #page-content.l-main>form>.l-section:first-of-type>.l-section-h,
body.bd-single-post-bc #page-content.l-main .bd-single-shell__main>section.l-section:first-of-type>.l-section-h,
body.bd-single-post-bc #page-content.l-main .bd-single-shell__main>form>.l-section:first-of-type>.l-section-h {
  padding-top: 0 !important;
  text-align: left;
}

body.bd-single-post-bc #page-content.l-main>section.l-section:first-of-type>.l-section-h>*:first-child,
body.bd-single-post-bc #page-content.l-main>form>.l-section:first-of-type>.l-section-h>*:first-child,
body.bd-single-post-bc #page-content.l-main .bd-single-shell__main>section.l-section:first-of-type>.l-section-h>*:first-child,
body.bd-single-post-bc #page-content.l-main .bd-single-shell__main>form>.l-section:first-of-type>.l-section-h>*:first-child {
  margin-top: 0 !important;
}

body.bd-single-post-bc #page-content.l-main>section.l-section:first-of-type>.l-section-h .aligncenter,
body.bd-single-post-bc #page-content.l-main>section.l-section:first-of-type>.l-section-h figure.aligncenter,
body.bd-single-post-bc #page-content.l-main>section.l-section:first-of-type>.l-section-h .w-post-elm.post_image,
body.bd-single-post-bc #page-content.l-main .bd-single-shell__main>section.l-section:first-of-type>.l-section-h .aligncenter,
body.bd-single-post-bc #page-content.l-main .bd-single-shell__main>section.l-section:first-of-type>.l-section-h figure.aligncenter,
body.bd-single-post-bc #page-content.l-main .bd-single-shell__main>section.l-section:first-of-type>.l-section-h .w-post-elm.post_image {
  margin-left: 0 !important;
  margin-right: auto !important;
}

/* Single post: hide author (Impreza Post Author element) in the hero / meta row. */
body.bd-single-post-bc .w-post-elm.post_author {
  display: none !important;
}

/* Single post: hide Impreza post date unless JS reuses it when no category element exists. */
body.bd-single-post-bc .w-post-elm.post_date:not(.bd-single-reading-time-slot) {
  display: none !important;
}

.bd-single-reading-bar__time {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bd-color-muted);
}

/* Fila meta: tiempo + categoría agrupados a la izquierda, bajo la imagen. */
body.bd-single-post-bc .bd-single-post-meta-inline {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 1.25rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  align-self: stretch;
}

body.bd-single-post-bc .bd-single-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bd-color-muted);
}

body.bd-single-post-bc .bd-single-meta-chip i {
  font-size: 0.95rem;
  opacity: 0.85;
  flex-shrink: 0;
}

body.bd-single-post-bc .bd-single-meta-chip--date {
  gap: 0.4rem;
}

body.bd-single-post-bc .bd-single-meta-chip--category {
  gap: 0.45rem;
}

body.bd-single-post-bc .bd-single-meta-chip--category .w-post-elm.post_taxonomy {
  margin: 0;
}

/*
 * Impreza: .w-vwrapper.align_center y .w-hwrapper.align_* encogen el ancho del hijo y lo
 * centran / alinean a la derecha; la rejilla queda “igual” visualmente. Forzamos ancho de columna.
 */
body.bd-single-post-bc .bd-single-shell__main .bd-has-single-meta-row>.bd-single-post-meta-inline {
  align-self: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

body.bd-single-post-bc .bd-single-shell__main .bd-has-single-meta-row.w-hwrapper {
  justify-content: flex-start !important;
  width: 100% !important;
  max-width: 100% !important;
}

body.bd-single-post-bc .bd-single-shell__main .bd-has-single-meta-row.w-hwrapper>.bd-single-post-meta-inline {
  flex: 1 1 auto !important;
}

body.bd-single-post-bc .bd-single-shell__main .wpb_wrapper.bd-has-single-meta-row {
  display: block !important;
  box-sizing: border-box;
}

/* Fallback si el script no pudo marcar el padre (p. ej. otro contenedor). */
body.bd-single-post-bc .bd-single-shell__main .w-vwrapper>.bd-single-post-meta-inline,
body.bd-single-post-bc .bd-single-shell__main .w-hwrapper>.bd-single-post-meta-inline {
  align-self: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

body.bd-single-post-bc .bd-single-shell__main .w-hwrapper>.bd-single-post-meta-inline {
  flex: 1 1 auto !important;
}

body.bd-single-post-bc .bd-single-shell__main .w-hwrapper:has(> .bd-single-post-meta-inline) {
  justify-content: flex-start !important;
  width: 100% !important;
  max-width: 100% !important;
}

body.bd-single-post-bc .bd-single-post-meta-inline .w-post-elm.post_taxonomy {
  width: fit-content;
  max-width: 100%;
  min-width: 0;
}

/* Espacio bajo la imagen antes de la fila meta; título va encima de la imagen (script). */
body.bd-single-post-bc .bd-single-shell__main > section.l-section:first-of-type .bd-single-post-meta-inline--php,
body.bd-single-post-bc .bd-single-shell__main > section.l-section:first-of-type .bd-single-post-meta-inline {
  margin-top: 1rem;
  margin-bottom: 20px;
}

body.bd-single-post-bc .bd-single-shell__main > section.l-section:first-of-type > .l-section-h > .w-post-elm.post_title:first-of-type {
  margin-top: 0 !important;
  margin-bottom: 1rem !important;
}

/* Hero title (reordered before featured image in .bd-has-single-meta-row). */
body.bd-single-post-bc .bd-single-shell__main > section.l-section:first-of-type .wpb_wrapper.bd-has-single-meta-row > h2.w-post-elm.post_title {
  margin-top: -25px !important;
}

body.bd-single-post-bc .bd-single-shell__main > section.l-section:first-of-type > .l-section-h > .w-post-elm.post_image {
  margin-top: 0 !important;
}

/* Hero column: fixed content width (browser preview). */
body.bd-single-post-bc .bd-single-shell__main > section.l-section:first-of-type .vc_col-sm-8 .vc_column-inner.bd-has-single-meta-row {
  width: 800px;
  max-width: 100%;
  box-sizing: border-box;
}

/* Columna estrecha vacía tras mover la categoría (WPBakery). */
body.bd-single-post-bc .bd-single-shell__main>section.l-section:first-of-type .vc_col-sm-4 .vc_column-inner:not(:has(.w-post-elm)) {
  display: none !important;
}

/* Separadores Impreza vacíos en la columna del hero (quedan huérfanos tras reordenar DOM). */
body.bd-single-post-bc .bd-single-shell__main > section.l-section:first-of-type .vc_col-sm-8 .wpb_wrapper.bd-has-single-meta-row > .w-separator:empty {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
}

body.bd-single-post-bc time.w-post-elm.post_date.bd-single-reading-time-slot {
  display: inline-block !important;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bd-color-muted);
  margin-right: auto;
}

/*
 * Single post: featured image as full-width banner in the first content section.
 * (Overrides legacy child style.css rules and Impreza width/ratio helpers where needed.)
 */
body.bd-single-post-bc #page-content.l-main>section.l-section:first-of-type>.l-section-h .w-post-elm.post_image,
body.bd-single-post-bc #page-content.l-main>form>.l-section:first-of-type>.l-section-h .w-post-elm.post_image,
body.bd-single-post-bc #page-content.l-main .bd-single-shell__main>section.l-section:first-of-type>.l-section-h .w-post-elm.post_image,
body.bd-single-post-bc #page-content.l-main .bd-single-shell__main>form>.l-section:first-of-type>.l-section-h .w-post-elm.post_image {
  width: 100% !important;
  max-width: 100% !important;
  flex-shrink: 0;
  float: none !important;
}

body.bd-single-post-bc #page-content.l-main>section.l-section:first-of-type>.l-section-h .w-post-elm.post_image.has_width,
body.bd-single-post-bc #page-content.l-main>form>.l-section:first-of-type>.l-section-h .w-post-elm.post_image.has_width,
body.bd-single-post-bc #page-content.l-main .bd-single-shell__main>section.l-section:first-of-type>.l-section-h .w-post-elm.post_image.has_width,
body.bd-single-post-bc #page-content.l-main .bd-single-shell__main>form>.l-section:first-of-type>.l-section-h .w-post-elm.post_image.has_width {
  max-width: 100% !important;
}

body.bd-single-post-bc #page-content.l-main>section.l-section:first-of-type>.l-section-h .w-post-elm.post_image.has_ratio,
body.bd-single-post-bc #page-content.l-main>form>.l-section:first-of-type>.l-section-h .w-post-elm.post_image.has_ratio,
body.bd-single-post-bc #page-content.l-main .bd-single-shell__main>section.l-section:first-of-type>.l-section-h .w-post-elm.post_image.has_ratio,
body.bd-single-post-bc #page-content.l-main .bd-single-shell__main>form>.l-section:first-of-type>.l-section-h .w-post-elm.post_image.has_ratio {
  max-width: 100% !important;
}

body.bd-single-post-bc #page-content.l-main>section.l-section:first-of-type>.l-section-h .w-post-elm.post_image.has_ratio>div:last-of-type,
body.bd-single-post-bc #page-content.l-main>form>.l-section:first-of-type>.l-section-h .w-post-elm.post_image.has_ratio>div:last-of-type,
body.bd-single-post-bc #page-content.l-main .bd-single-shell__main>section.l-section:first-of-type>.l-section-h .w-post-elm.post_image.has_ratio>div:last-of-type,
body.bd-single-post-bc #page-content.l-main .bd-single-shell__main>form>.l-section:first-of-type>.l-section-h .w-post-elm.post_image.has_ratio>div:last-of-type {
  /* Drop Impreza’s padding-bottom spacer so the image can use natural height at width:100%. */
  display: none !important;
}

body.bd-single-post-bc #page-content.l-main>section.l-section:first-of-type>.l-section-h .w-post-elm.post_image.has_ratio img,
body.bd-single-post-bc #page-content.l-main>form>.l-section:first-of-type>.l-section-h .w-post-elm.post_image.has_ratio img,
body.bd-single-post-bc #page-content.l-main .bd-single-shell__main>section.l-section:first-of-type>.l-section-h .w-post-elm.post_image.has_ratio img,
body.bd-single-post-bc #page-content.l-main .bd-single-shell__main>form>.l-section:first-of-type>.l-section-h .w-post-elm.post_image.has_ratio img {
  position: static !important;
  width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
}

body.bd-single-post-bc #page-content.l-main>section.l-section:first-of-type>.l-section-h .w-post-elm.post_image img,
body.bd-single-post-bc #page-content.l-main>form>.l-section:first-of-type>.l-section-h .w-post-elm.post_image img,
body.bd-single-post-bc #page-content.l-main .bd-single-shell__main>section.l-section:first-of-type>.l-section-h .w-post-elm.post_image img,
body.bd-single-post-bc #page-content.l-main .bd-single-shell__main>form>.l-section:first-of-type>.l-section-h .w-post-elm.post_image img {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: none !important;
}

/* Single post: vertical spacing around prev/next navigation */
body.bd-single-post-bc .w-post-elm.post_navigation {
  margin-top: 100px;
  margin-bottom: 10px;
}

/* Single post: prev/next title hover matches sidebar recent posts */
body.bd-single-post-bc .post_navigation.layout_simple a:hover .post_navigation-item-title,
body.bd-single-post-bc.no-touch .post_navigation.layout_simple a:hover .post_navigation-item-title {
  color: var(--bd-color-text) !important;
}

body.bd-single-post-bc .post_navigation.layout_simple a:hover .post_navigation-item-title span {
  text-decoration: underline;
}