/* NESI Single Post: featured image + content separation (clean overrides) */

body.single-post .entry-header {
  display: block;
  overflow: visible !important;
  position: static !important;
}

body.single-post .entry-header__single__image-container {
  position: static !important;
  display: block;
  width: 100% !important; 
  max-width: 100% !important; 
  height: auto !important;
  margin: 4px auto 18px !important; 
  padding: 0 !important;
  clear: both;
}

body.single-post .entry-header__single__image-container.animation-item {
  visibility: visible !important;
}
body.single-post .entry-header__single__text {
  margin-bottom: 8px;
}

body.single-post .entry-header__single__image-container img {
  display: block;
  width: 100% !important;
  height: auto !important;
}

body.single-post .single-post__entry-content {
  position: static;
  clear: both !important;
  margin-top: 0 !important;
}
body.single-post .single-post__entry-content img,
body.single-post .wp-block-image img {
  max-width: 100% !important;
  height: auto !important;
  display: block;
}

@media (min-width: 992px) { /* lg and up */
  body.single-post .entry-header__single__image-container { max-width: 100% !important; width: 100% !important; }
}

/* Fine‑tune vertical rhythm by viewport */
@media (max-width: 575.98px) {
  /* xs */
  body.single-post .entry-header__single .header { margin-bottom: 6px !important; }
  body.single-post .entry-header__single__image-container { margin: 4px auto 16px !important; }
}
@media (min-width: 576px) and (max-width: 767.98px) {
  /* sm */
  body.single-post .entry-header__single .header { margin-bottom: 8px !important; }
  body.single-post .entry-header__single__image-container { margin: 6px auto 18px !important; }
}
@media (min-width: 768px) and (max-width: 991.98px) {
  /* md */
  body.single-post .entry-header__single .header { margin-bottom: 8px !important; }
  body.single-post .entry-header__single__image-container { margin: 6px auto 22px !important; }
}
@media (min-width: 992px) {
  /* lg and up */
  body.single-post .entry-header__single .header { margin-bottom: 8px !important; }
  body.single-post .entry-header__single__image-container { margin: 6px auto 24px !important; }
}

body.single-post .single-post__entry-content p:first-child,
body.single-post .single-post__entry-content > *:first-child { margin-top: 0 !important; }
@media (min-width: 768px) and (max-width: 991.98px) { /* md */
  body.single-post .entry-header__single__image-container { width: 100% !important; }
}
@media (max-width: 767.98px) { /* sm and down */
  body.single-post .entry-header__single__image-container { width: 100% !important; }
}
body.single-post .single-post__entry-content .wp-block-image,
body.single-post .single-post__entry-content figure {
  width: 100% !important;
  max-width: 100% !important;
  margin: 32px auto !important;
}
body.single-post .single-post__entry-content .wp-block-image.alignfull,
body.single-post .single-post__entry-content .wp-block-image.alignwide,
body.single-post .single-post__entry-content figure.alignfull,
body.single-post .single-post__entry-content figure.alignwide {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
/* Defensive reset for blocks that try to use viewport-width tricks */
body.single-post .single-post__entry-content .wp-block-image.alignfull img,
body.single-post .single-post__entry-content .wp-block-image.alignwide img,
body.single-post .single-post__entry-content figure.alignfull img,
body.single-post .single-post__entry-content figure.alignwide img {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
}

body.single-post .entry-header__single__image-container {
  height: clamp(340px, 60vh, 720px) !important;
  max-height: 720px !important;
  overflow: hidden !important;
}
@media (max-width: 767.98px) {
  body.single-post .entry-header__single__image-container {
    height: clamp(260px, 50vh, 520px) !important;
  }
}
body.single-post .entry-header__single__image-container img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  background: transparent; 
}

body.single-post .entry-header__single__image-container {
  position: relative !important;
  z-index: 0 !important;
}
body.single-post .single-post__entry-content {
  position: relative !important;
  z-index: 5 !important;
}

/* Tame large inline images on wide screens */
@media (min-width: 992px) {
  body.single-post .single-post__entry-content img:not(.emoji):not(.wp-smiley),
  body.single-post .single-post__entry-content figure img {
    max-width: 900px !important;
    width: 100% !important;
    height: auto !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box;
  }
}

/* News archive: center and style the Load More button */
#news-load-more-wrapper {
  text-align: center;
}
#news-load-more.btn--primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 16px 32px 15px 32px;
  border-radius: 26px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
}
#news-load-more {
  margin: 24px auto 0 auto;
}

.home .news-card-grid {
  display: flex;
  flex-wrap: wrap;
}

.home .recent-news-section .section-title {
  margin: 0;
}
.home .recent-news-section .blog__heading {
  margin-bottom: 24px;
}
.home .recent-news-section .btn.btn--primary {
  text-transform: uppercase;
  letter-spacing: 0.13em;
  border-radius: 26px;
  white-space: nowrap;
}

/* View All button sizing and alignment */
.home .recent-news-section .view-all-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto !important;
  -ms-flex: 0 0 auto !important;
  flex-grow: 0 !important;
  height: clamp(32px, 1.875vw, 36px);
  width: clamp(128px, 8.8vw, 168px) !important;
  padding: 0 14px;
  font-size: clamp(11px, 0.75vw, 12px);
  color: #ffffff !important;
  transition: color 150ms ease-out;
}
.home .recent-news-section .view-all-btn span {
  color: #ffffff !important;
}
.home .recent-news-section .view-all-btn .icon-arrow-up-right {
  width: 12px;
  height: 12px;
  display: inline-block;
  pointer-events: none;
}

.home .recent-news-section .view-all-btn:hover,
.home .recent-news-section .view-all-btn:hover span,
.home .recent-news-section .view-all-btn:hover .icon-arrow-up-right {
  color: #000000 !important;
}

.home .recent-news-section .blog__heading {
  margin-bottom: 24px;
}

.news-card__button svg,
.home .news-card .news-card__button.btn.btn--primary svg {
  margin-left: 8px;
  display: inline-block;
  position: relative;
  left: 0;
  transition: left 160ms ease-out, transform 160ms ease-out;
  will-change: left, transform;
}
.news-card__button:hover svg,
.news-card__button:focus svg,
.news-card__button:active svg,
.home .news-card .news-card__button.btn.btn--primary:hover svg {
  left: 4px;
  transform: translateX(4px);
}
