/*
 * UNDP Gutenberg Blocks CSS
 * Styles for all custom blocks
 * @package UNDP
 */

/* =============================================
   WP COLOR PALETTE – CSS CUSTOM PROPERTIES
   Mirrors theme.json so that has-*-color and
   has-*-background-color block classes work on
   the front end even without global-styles output.
   ============================================= */
:root {
    --wp--preset--color--undp-blue:          #0468b1;
    --wp--preset--color--undp-blue-dark:     #00559b;
    --wp--preset--color--undp-blue-darker:   #1a2e48;
    --wp--preset--color--undp-blue-light:    #b5d5f5;
    --wp--preset--color--undp-blue-lightest: #e8f3fc;
    --wp--preset--color--undp-yellow:        #ffe539;
    --wp--preset--color--undp-yellow-dark:   #faca20;
    --wp--preset--color--undp-red:           #ee402d;
    --wp--preset--color--undp-green:         #6de354;
    --wp--preset--color--undp-dark:          #232e3d;
    --wp--preset--color--undp-gray-dark:     #55606e;
    --wp--preset--color--undp-gray:          #a9b1b7;
    --wp--preset--color--undp-gray-light:    #d4d6d8;
    --wp--preset--color--undp-gray-lighter:  #f7f7f7;
    --wp--preset--color--undp-white:         #ffffff;
    --wp--preset--color--undp-black:         #000000;
}

/* Text colour utility classes (.has-text-color ensures the class is set by the block) */
.has-undp-blue-color.has-text-color          { color: var(--wp--preset--color--undp-blue)          !important; }
.has-undp-blue-dark-color.has-text-color     { color: var(--wp--preset--color--undp-blue-dark)     !important; }
.has-undp-blue-darker-color.has-text-color   { color: var(--wp--preset--color--undp-blue-darker)   !important; }
.has-undp-blue-light-color.has-text-color    { color: var(--wp--preset--color--undp-blue-light)    !important; }
.has-undp-blue-lightest-color.has-text-color { color: var(--wp--preset--color--undp-blue-lightest) !important; }
.has-undp-yellow-color.has-text-color        { color: var(--wp--preset--color--undp-yellow)        !important; }
.has-undp-yellow-dark-color.has-text-color   { color: var(--wp--preset--color--undp-yellow-dark)   !important; }
.has-undp-red-color.has-text-color           { color: var(--wp--preset--color--undp-red)           !important; }
.has-undp-green-color.has-text-color         { color: var(--wp--preset--color--undp-green)         !important; }
.has-undp-dark-color.has-text-color          { color: var(--wp--preset--color--undp-dark)          !important; }
.has-undp-gray-dark-color.has-text-color     { color: var(--wp--preset--color--undp-gray-dark)     !important; }
.has-undp-gray-color.has-text-color          { color: var(--wp--preset--color--undp-gray)          !important; }
.has-undp-gray-light-color.has-text-color    { color: var(--wp--preset--color--undp-gray-light)    !important; }
.has-undp-gray-lighter-color.has-text-color  { color: var(--wp--preset--color--undp-gray-lighter)  !important; }
.has-undp-white-color.has-text-color         { color: var(--wp--preset--color--undp-white)         !important; }
.has-undp-black-color.has-text-color         { color: var(--wp--preset--color--undp-black)         !important; }

/* Background colour utility classes */
.has-undp-blue-background-color.has-background          { background-color: var(--wp--preset--color--undp-blue)          !important; }
.has-undp-blue-dark-background-color.has-background     { background-color: var(--wp--preset--color--undp-blue-dark)     !important; }
.has-undp-blue-darker-background-color.has-background   { background-color: var(--wp--preset--color--undp-blue-darker)   !important; }
.has-undp-blue-light-background-color.has-background    { background-color: var(--wp--preset--color--undp-blue-light)    !important; }
.has-undp-blue-lightest-background-color.has-background { background-color: var(--wp--preset--color--undp-blue-lightest) !important; }
.has-undp-yellow-background-color.has-background        { background-color: var(--wp--preset--color--undp-yellow)        !important; }
.has-undp-yellow-dark-background-color.has-background   { background-color: var(--wp--preset--color--undp-yellow-dark)   !important; }
.has-undp-red-background-color.has-background           { background-color: var(--wp--preset--color--undp-red)           !important; }
.has-undp-green-background-color.has-background         { background-color: var(--wp--preset--color--undp-green)         !important; }
.has-undp-dark-background-color.has-background          { background-color: var(--wp--preset--color--undp-dark)          !important; }
.has-undp-gray-dark-background-color.has-background     { background-color: var(--wp--preset--color--undp-gray-dark)     !important; }
.has-undp-gray-background-color.has-background          { background-color: var(--wp--preset--color--undp-gray)          !important; }
.has-undp-gray-light-background-color.has-background    { background-color: var(--wp--preset--color--undp-gray-light)    !important; }
.has-undp-gray-lighter-background-color.has-background  { background-color: var(--wp--preset--color--undp-gray-lighter)  !important; }
.has-undp-white-background-color.has-background         { background-color: var(--wp--preset--color--undp-white)         !important; }
.has-undp-black-background-color.has-background         { background-color: var(--wp--preset--color--undp-black)         !important; }

/* Link colour — WordPress uses a dynamic wp-elements-* class with an inline
   --wp--style--color--link variable. This rule makes it work for all palette colours. */
.has-link-color a:where(:not(.wp-element-button)) {
    color: var(--wp--style--color--link, currentColor) !important;
}

/* =============================================
   HERO BLOCK
   ============================================= */
.undp-hero {
  position: relative;
  width: 100%;
  min-height: 640px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background-color: var(--undp-blue-darker);
}
.undp-hero--full { min-height: 100vh; }
.undp-hero--medium { min-height: 480px; }
.undp-hero--small { min-height: 320px; }

.undp-hero__bg {
  position: absolute;
  inset: 0;
  object-fit: cover;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.undp-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(26, 46, 72, 0.90) 0%,
    rgba(26, 46, 72, 0.50) 40%,
    rgba(26, 46, 72, 0.10) 100%
  );
}
.undp-hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: var(--space-2xl) 0 var(--space-3xl);
}
.undp-hero__inner {
  max-width: 760px;
}
.undp-hero__kicker {
  display: inline-block;
  background: var(--undp-yellow);
  color: var(--undp-dark);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  margin-bottom: var(--space-lg);
}
.undp-hero__title {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  color: var(--undp-white);
  line-height: 1.1;
  margin: 0 0 var(--space-lg);
  letter-spacing: -0.02em;
}
.undp-hero__description {
  font-size: 1.125rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: var(--space-xl);
  max-width: 56ch;
  line-height: 1.65;
}
.undp-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
}
.undp-hero__scroll-indicator {
  position: absolute;
  bottom: var(--space-xl);
  right: var(--space-xl);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  color: rgba(255,255,255,0.7);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.undp-hero__scroll-line {
  width: 1px;
  height: 40px;
  background: rgba(255,255,255,0.5);
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { opacity: 0.5; transform: scaleY(1); }
  50%       { opacity: 1;   transform: scaleY(1.3); }
}

/* =============================================
   HOMEPAGE HERO (UNDP Docs Parity)
   ============================================= */
/* .wp-block-undp-hero.homepage-hero-full,
.wp-block-undp-hero.homepage-hero-tall,
.wp-block-undp-hero.homepage-hero-wide {
  width: 100%;
  margin-inline: 0;
}

.wp-block-undp-hero.homepage-hero-full {
  display: block;
  min-height: 0;
}

.wp-block-undp-hero.homepage-hero-full .homepage-hero-content > div {
  padding-top: 10.438rem;
}

.wp-block-undp-hero.homepage-hero-full .homepage-hero-content .button {
  margin-bottom: var(--undpds-spacing-06);
}

@media (max-width: 47.9375em) {
  .wp-block-undp-hero.homepage-hero-full .homepage-hero-content {
    padding: 0 var(--undpds-spacing-06);
  }

  .wp-block-undp-hero.homepage-hero-full .homepage-hero-content .button {
    margin-top: var(--undpds-spacing-10);
  }
}

@media (min-width: 48em) {
  .wp-block-undp-hero.homepage-hero-full .homepage-hero-content > div {
    padding-top: 13.688rem;
  }

  .wp-block-undp-hero.homepage-hero-full .homepage-hero-content .button {
    margin-bottom: 10.188rem;
  }
} */

.wp-block-undp-hero.homepage-hero-tall video,
.wp-block-undp-hero.homepage-hero-wide video {
  min-height: 0;
}

/* =============================================
   STATS CARD SLIDER BLOCK
   ============================================= */
.undp-stats-slider {
  padding: var(--space-3xl) 0;
  background: var(--undp-blue-darker);
  color: var(--undp-white);
  overflow: hidden;
}
.undp-stats-slider__header {
  margin-bottom: var(--space-2xl);
}
.undp-stats-slider__header-title {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  color: var(--undp-white);
}
.undp-stats-slider__track-wrap {
  position: relative;
  overflow: hidden;
}
.undp-stats-slider__track {
  display: flex;
  gap: var(--space-md);
  transition: transform 0.4s ease;
}
.undp-stat-card {
  flex: 0 0 280px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  padding: var(--space-xl);
  position: relative;
  overflow: hidden;
  transition: background-color var(--transition-base), border-color var(--transition-base);
}
.undp-stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--undp-yellow);
}
.undp-stat-card:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.25);
}
.undp-stat-card__number {
  display: block;
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1;
  color: var(--undp-white);
  margin-bottom: var(--space-sm);
}
.undp-stat-card__unit {
  display: block;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--undp-yellow);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-md);
}
.undp-stat-card__description {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.6;
}
.undp-stats-slider__controls {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}
.undp-stats-slider__btn {
  width: 44px; height: 44px;
  background: transparent;
  border: 2px solid rgba(255,255,255,0.4);
  color: var(--undp-white);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition-base);
}
.undp-stats-slider__btn:hover { background: var(--undp-yellow); border-color: var(--undp-yellow); color: var(--undp-dark); }
.undp-stats-slider__btn:disabled { opacity: 0.3; cursor: not-allowed; }
.undp-stats-slider__dots {
  display: flex; gap: var(--space-sm);
}
.undp-stats-slider__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  cursor: pointer;
  border: none;
  padding: 0;
  transition: background-color var(--transition-base), transform var(--transition-base);
}
.undp-stats-slider__dot.is-active { background: var(--undp-yellow); transform: scale(1.3); }

/* =============================================
   CONTENT CARD WITH IMAGE BLOCK
   ============================================= */
.undp-content-card {
  background: var(--undp-white);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.undp-content-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}
.undp-content-card--hover-blue:hover  .undp-content-card__inner::after { background: var(--undp-blue); }
.undp-content-card--hover-yellow:hover .undp-content-card__inner::after { background: var(--undp-yellow); }
.undp-content-card--hover-red:hover   .undp-content-card__inner::after { background: var(--undp-red); }
.undp-content-card--hover-green:hover .undp-content-card__inner::after { background: var(--undp-green); }

.undp-content-card__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}
.undp-content-card__inner::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: var(--undp-blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-base);
}
.undp-content-card:hover .undp-content-card__inner::after { transform: scaleX(1); }

.undp-content-card__image-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 2;
}
.undp-content-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}
.undp-content-card:hover .undp-content-card__image { transform: scale(1.05); }

.undp-content-card__body {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  flex: 1;
}
.undp-content-card__tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--undp-blue);
  border: 1px solid var(--undp-blue);
  padding: 0.2rem 0.5rem;
  margin-bottom: var(--space-md);
  text-decoration: none;
  align-self: flex-start;
}
.undp-content-card__tag:hover { background: var(--undp-blue); color: var(--undp-white); text-decoration: none; }
.undp-content-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 var(--space-md);
}
.undp-content-card__title-link { color: var(--undp-dark); text-decoration: none; }
.undp-content-card__title-link:hover { color: var(--undp-blue); text-decoration: none; }
.undp-content-card__excerpt {
  font-size: 0.9rem;
  color: var(--undp-gray-dark);
  line-height: 1.6;
  margin-bottom: auto;
  padding-bottom: var(--space-md);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.undp-content-card__read-more {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--undp-blue);
  text-decoration: none;
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--undp-gray-light);
}
.undp-content-card__read-more:hover { color: var(--undp-blue-dark); text-decoration: none; }
.undp-content-card__read-more svg { transition: transform var(--transition-base); }
.undp-content-card__read-more:hover svg { transform: translateX(3px); }

/* Cards Grid */
.undp-cards-grid {
  padding: var(--space-3xl) 0;
}
.undp-cards-grid__header {
  margin-bottom: var(--space-2xl);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-lg);
  flex-wrap: wrap;
}
.undp-cards-grid__header-title { margin: 0; }
.undp-cards-grid__items { display: grid; grid-template-columns: repeat(1, 1fr); gap: var(--space-lg); }
@media (min-width: 640px)  { .undp-cards-grid__items { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .undp-cards-grid__items { grid-template-columns: repeat(3, 1fr); } }

/* =============================================
   FEATURED CARD BLOCK
   ============================================= */
.undp-featured-card {
  position: relative;
  overflow: hidden;
  background: var(--undp-blue-darker);
  display: flex;
  align-items: flex-end;
  min-height: 500px;
}
.undp-featured-card--large  { min-height: 640px; }
.undp-featured-card--medium { min-height: 420px; }
.undp-featured-card--small  { min-height: 320px; }

.undp-featured-card__bg {
  position: absolute;
  inset: 0;
  object-fit: cover;
  width: 100%;
  height: 100%;
  z-index: 0;
  transition: transform var(--transition-slow);
}
.undp-featured-card:hover .undp-featured-card__bg { transform: scale(1.04); }
.undp-featured-card__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
  transition: opacity var(--transition-base);
}
.undp-featured-card:hover .undp-featured-card__overlay { opacity: 0.9; }
/* Hover accent color underline */
.undp-featured-card--hover-blue  .undp-featured-card__body::after { background: var(--undp-blue); }
.undp-featured-card--hover-yellow .undp-featured-card__body::after { background: var(--undp-yellow); }
.undp-featured-card--hover-red    .undp-featured-card__body::after { background: var(--undp-red); }
.undp-featured-card--hover-green  .undp-featured-card__body::after { background: var(--undp-green); }

.undp-featured-card__body {
  position: relative;
  z-index: 2;
  padding: var(--space-2xl);
  color: var(--undp-white);
  width: 100%;
}
.undp-featured-card__body::after {
  content: '';
  position: absolute;
  top: 0; left: var(--space-2xl); right: var(--space-2xl);
  height: 4px;
  background: var(--undp-yellow);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-slow);
}
.undp-featured-card:hover .undp-featured-card__body::after { transform: scaleX(1); }

.undp-featured-card__category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--undp-yellow);
  margin-bottom: var(--space-md);
  text-decoration: none;
}
.undp-featured-card__title {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 700;
  color: var(--undp-white);
  line-height: 1.2;
  margin: 0 0 var(--space-md);
}
.undp-featured-card__title-link { color: var(--undp-white); text-decoration: none; }
.undp-featured-card__title-link:hover { text-decoration: underline; color: var(--undp-white); }
.undp-featured-card__excerpt {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.8);
  line-height: 1.6;
  margin-bottom: var(--space-lg);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.undp-featured-card__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--undp-white);
  text-decoration: none;
  border-bottom: 2px solid var(--undp-yellow);
  padding-bottom: 2px;
  transition: color var(--transition-base);
}
.undp-featured-card__cta:hover { color: var(--undp-yellow); text-decoration: none; }

/* =============================================
   BUTTON BLOCK
   ============================================= */
.wp-block-undp-button { display: inline-flex; }
.undp-button-block-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
}
.undp-button-block-wrap.is-center { justify-content: center; }
.undp-button-block-wrap.is-right  { justify-content: flex-end; }

/* =============================================
   TYPOGRAPHY HEADING BLOCK
   ============================================= */
.undp-block-heading { margin-bottom: var(--space-lg); }
.undp-block-heading--eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--undp-blue);
  display: block;
  margin-bottom: var(--space-sm);
}
.undp-block-heading--underline {
  position: relative;
  padding-bottom: var(--space-lg);
}
.undp-block-heading--underline::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 60px; height: 4px;
  background: var(--undp-yellow);
}
.undp-block-heading--centered::after { left: 50%; transform: translateX(-50%); }
.undp-block-heading--white .undp-heading { color: var(--undp-white); }
.undp-block-heading--white .undp-block-heading--eyebrow { color: var(--undp-yellow); }

/* =============================================
   BREADCRUMBS BLOCK
   ============================================= */
.wp-block-undp-breadcrumbs { margin-bottom: var(--space-lg); }

/* =============================================
   STAT ITEM (standalone) BLOCK
   ============================================= */
.undp-stat-item {
  padding: var(--space-xl);
  border-left: 4px solid var(--undp-yellow);
  background: var(--undp-gray-lighter);
}
.undp-stat-item__number {
  display: block;
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 700;
  color: var(--undp-blue);
  line-height: 1;
  margin-bottom: var(--space-sm);
}
.undp-stat-item__label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--undp-dark);
  margin-bottom: var(--space-sm);
}
.undp-stat-item__description { font-size: 0.875rem; color: var(--undp-gray-dark); line-height: 1.6; }

/* =============================================
   BLOCK EDITOR — shared alignment
   ============================================= */
.is-align-full  { max-width: 100%; }
.is-align-wide  { max-width: 1440px; margin-left: auto; margin-right: auto; }

@media (max-width: 639px) {
  .undp-stats-slider__track { overflow-x: auto; scroll-snap-type: x mandatory; }
  .undp-stat-card { scroll-snap-align: start; flex: 0 0 85vw; }
  .undp-featured-card { min-height: 280px; }
  .undp-hero { min-height: 420px; }
  .undp-footer__newsletter-form { flex-direction: column; }
}

/* =============================================
   AUTHORS BLOCK
   ============================================= */
.undp-authors-block {
  padding-top: 32px;
  border-bottom: 1px solid #d4d6d8;
  margin-bottom: 5.5rem;
}

.undp-authors-heading {
  margin-bottom: 2rem;
  border-bottom: 2px solid #0468B1;
  padding-bottom: 0.5rem;
}

.undp-authors-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #232e3d;
  margin: 0;
}

.undp-authors-list {
  display: grid;
  gap: 2rem;
}

/* Grid Layout */
.undp-authors-block--grid .undp-authors-list {
  grid-template-columns: repeat(var(--author-columns, 3), 1fr);
}

/* List Layout */
.undp-authors-block--list .undp-authors-list {
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

/* Inline Layout */
.undp-authors-block--inline .undp-authors-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.undp-authors-block--inline .undp-author-item {
  flex: 0 0 auto;
}

/* Author Item */
.undp-author-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
}

.undp-authors-block--list .undp-author-item {
  flex-direction: row;
  text-align: left;
  align-items: flex-start;
}

/* Avatar */
.undp-author-avatar img {
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #f0f0f0;
  transition: border-color 0.3s ease;
}
/* Details */
.undp-author-details {
  flex: 1;
}

.undp-author-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: #232e3d;
  margin: 0 0 0.25rem;
}

.undp-author-title {
  font-size: 0.875rem;
  color: #666;
  margin: 0 0 0.5rem;
  line-height: 1.4;
}

.undp-author-bio {
  font-size: 0.875rem;
  color: #888;
  line-height: 1.6;
  margin: 0.5rem 0 0;
}

/* Alignment */
.undp-authors-align--center .undp-author-item {
  align-items: center;
  text-align: center;
}

.undp-authors-align--right .undp-author-item {
  align-items: flex-end;
  text-align: right;
}

.undp-authors-align--left .undp-author-item {
  align-items: flex-start;
  text-align: left;
}

/* Responsive */
@media (max-width: 1024px) {
  .undp-authors-block--grid .undp-authors-list {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 768px) {
  .undp-authors-block--grid .undp-authors-list,
  .undp-authors-block--inline .undp-authors-list {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .undp-authors-block--list .undp-author-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .undp-authors-block--grid .undp-authors-list,
  .undp-authors-block--inline .undp-authors-list {
    grid-template-columns: 1fr;
  }
}

/* =============================================
   BLOCKQUOTE BLOCK
   ============================================= */
.undp-blockquote-block {
  margin: 2rem 0 2rem -28.6666666667%;
}
.undp-blockquote-block.grid-x>.medium-9{
  width: calc(75% + 26%);
}

.undp-blockquote-block.has-position-left {
  margin: 2rem 0 2rem -28.6666666667%;
}

.undp-blockquote-block.has-position-center {
  margin: 2rem auto;
  justify-content: center;
}

.undp-blockquote-block.has-position-right {
  margin: 2rem -28.6666666667% 2rem 0;
  justify-content: flex-end;
}

.undp-blockquote-block.has-position-match-container {
  margin: 2rem 0;
}

.undp-blockquote-block.has-position-center.grid-x>.medium-9,
.undp-blockquote-block.has-position-match-container.grid-x>.medium-9 {
  width: 75%;
}

.undp-blockquote-block .blockquote {
  padding: 5.313rem 96px;
  background-color: #f9f9f9;
  border-left: 4px solid;
  margin-bottom: 0;
}

.undp-blockquote-block .blockquote.accent-yellow {
  border-color: #FFE539;
}

.undp-blockquote-block .blockquote.accent-blue {
  border-color: #0468B1;
}

.undp-blockquote-block .blockquote.accent-red {
  border-color: #EE402D;
}

.undp-blockquote-block .blockquote.accent-green {
  border-color: #56C02B;
}

.undp-blockquote-block blockquote {
  margin: 0;
  padding: 0;
  font-size: 2.25rem;
  line-height: 1.15;
  color: #232e3d;
  font-weight: 600;
}

.undp-blockquote-block cite {
  display: block;
  margin-top: 1rem;
  font-size: 1rem;
  font-style: italic;
  color: #666;
}

@media (max-width: 768px) {
  .undp-blockquote-block .cell {
    width: 100% !important;
  }
  
  .undp-blockquote-block blockquote {
    font-size: 1.1rem;
  }
  
  .undp-blockquote-block .blockquote {
    padding: 1.5rem;
  }
}

/* =============================================
   PUBLICATION PDF DOWNLOAD BUTTON
   ============================================= */
.undp-pdf-download-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 600;
  font-size: 1rem;
  transition: background-color 0.3s ease, transform 0.2s ease;
  border: none;
  cursor: pointer;
  background: none;
}

.undp-pdf-download-button:hover {
  color: #55606f;
  text-decoration: none;
}
.undp-pdf-download-button:hover .download-animated:before {
    transform: translateY(-10px);
}
.undp-pdf-download-button:hover .download-animated:after {
    transform: rotate(-45deg) translate(7px, -7px);
}
.undp-pdf-download-button:active {
  transform: translateY(0);
}

.undp-pdf-download-button svg {
  flex-shrink: 0;
}

.undp-pdf-download-button span {
  line-height: 1;
}

/* Publication meta info */
.publication-meta {
  margin: 1.5rem 0;
  padding: 1rem;
  background: #f5f5f5;
  border-left: 4px solid #0468B1;
  border-radius: 4px;
}

.publication-meta .pdf-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.publication-meta .pdf-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #d63638;
  color: #fff;
  border-radius: 4px;
  font-size: 24px;
}

.publication-meta .pdf-details h4 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  color: #232e3d;
}

.publication-meta .pdf-details p {
  margin: 0;
  font-size: 0.875rem;
  color: #666;
}

@media (max-width: 768px) {
  .undp-pdf-download-button {
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================================================
   KNOWLEDGE BASE PAGE TEMPLATE
   ========================================================================== */

.kb-page {
  padding-top: 1.5rem;
}

.kb-page__title {
  font-size: 2rem;
  font-weight: 700;
  color: #232e3d;
  margin-bottom: 0.5rem;
}

.kb-page__subtitle {
  font-size: 1rem;
  color: #4a4a4a;
  margin-bottom: 0;
  max-width: 680px;
}

/* Tabs */
.kb-tabs-row {
  margin-top: 2rem;
  margin-bottom: 0;
}

.kb-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.kb-tab {
  padding: 0.6rem 1.25rem;
  border: 1px solid #d0d0d0;
  background: #fff;
  color: #232e3d;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.kb-tab:hover {
  border-color: #0468b1;
  color: #0468b1;
}

.kb-tab.is-active {
  background: #1a3c5e;
  color: #fff;
  border-color: #1a3c5e;
}

/* Filters */
.kb-filters-row {
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.kb-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  align-items: center;
}

.kb-filter-wrap {
  position: relative;
}

.kb-select {
  -webkit-appearance: none;
  appearance: none;
  background-color: #fff;
  border: 1px solid #d0d0d0;
  border-radius: 2px;
  padding: 0.45rem 2rem 0.45rem 0.75rem;
  font-size: 0.875rem;
  color: #232e3d;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%23555' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 10px;
  min-width: 130px;
}

.kb-select:focus {
  outline: 2px solid #0468b1;
  outline-offset: 1px;
  border-color: #0468b1;
}

/* Cards grid */
.kb-cards-grid {
  margin-top: 1.25rem;
  transition: opacity 0.2s;
}

.kb-cards-grid.kb--loading {
  opacity: 0.4;
  pointer-events: none;
}

/* KB Card */
.kb-card {
  border: 1px solid #e2e2e2;
  background: #fff;
  height: 100%;
  transition: box-shadow 0.2s;
}

.kb-card:hover {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.09);
}

.kb-card__inner {
  display: flex;
  flex-direction: row;
  gap: 0.875rem;
  align-items: flex-start;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.kb-card__image {
  flex: 0 0 90px;
  width: 90px;
  height: 90px;
  overflow: hidden;
  flex-shrink: 0;
}

.kb-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.kb-card__content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.kb-card__type {
  font-size: 0.75rem;
  font-weight: 700;
  color: #0468b1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 0.3rem;
  line-height: 1.2;
}

.kb-card__title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #232e3d;
  margin: 0 0 0.35rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kb-card:hover .kb-card__title {
  color: #0468b1;
}

.kb-card__meta {
  font-size: 0.8125rem;
  color: #767676;
  margin: 0 0 0.5rem;
  line-height: 1.4;
}

.kb-card__download {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: auto;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0468b1;
  text-decoration: none;
}

.kb-card__download:hover {
  text-decoration: underline;
}

.kb-card__download svg {
  flex-shrink: 0;
}

/* Pagination */
.kb-pagination {
  margin-top: 2.5rem;
  margin-bottom: 2rem;
}

.kb-pagination__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.kb-page-btn {
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border: 1px solid #d0d0d0;
  background: #fff;
  color: #232e3d;
  font-size: 0.9375rem;
  cursor: pointer;
  border-radius: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.kb-page-btn:hover:not(.is-disabled):not([disabled]) {
  background: #f0f4f8;
  border-color: #0468b1;
  color: #0468b1;
}

.kb-page-btn.is-active {
  background: #1a3c5e;
  color: #fff;
  border-color: #1a3c5e;
}

.kb-page-btn.is-disabled,
.kb-page-btn[disabled] {
  opacity: 0.38;
  cursor: default;
}

.kb-page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  color: #767676;
  font-size: 0.9375rem;
  user-select: none;
}

/* Responsive */
@media (max-width: 640px) {
  .kb-tabs { flex-direction: column; }
  .kb-tab  { width: 100%; text-align: center; }
  .kb-filters { flex-direction: column; }
  .kb-filter-wrap { width: 100%; }
  .kb-select { width: 100%; }
  .kb-card__image {
    flex: 0 0 70px;
    width: 70px;
    height: 70px;
  }
}

/* Countries Map Block */
.wp-block-undp-countries-map {
  width: 100%;
  margin: 0 0 2rem;
  position: relative;
}

.undp-countries-map {
  width: 100%;
  min-height: 560px;
}
.undp-map-legend {
    position: absolute;
    left: 0;
    bottom: 0;
}

.highcharts-button {
    display: none;
}
.undp-countries-map-error {
  margin: 0;
  padding: 1rem;
  color: #9f1d20;
  background: #fdeaea;
}

/* Tooltip shown for countries whose page is not available yet */
.undp-map-panel .undp-map-tooltip {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  margin-top: 4px;
  padding: 10px 12px;
  background: #3D3D3D;
  color: #fff;
  font-size: 14px;
  font-style: italic;
  line-height: 1.5;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

@media (max-width: 767px) {
  .undp-countries-map {
    min-height: 420px;
  }
}

/* =============================================
   RESPONSIVE EMBEDS (core/embed blocks, e.g. YouTube)
   Replicates WordPress core embed styles so videos
   preserve their aspect ratio when the browser is
   resized, even when the core block-library
   stylesheet is not loaded on the front end.
   ============================================= */
.wp-block-embed {
    overflow-wrap: break-word;
}

.wp-block-embed iframe {
    max-width: 100%;
}

.wp-block-embed__wrapper {
    position: relative;
}

.wp-embed-responsive .wp-has-aspect-ratio .wp-block-embed__wrapper::before {
    content: "";
    display: block;
    padding-top: 50%;
}

.wp-embed-responsive .wp-has-aspect-ratio iframe {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    height: 100%;
    width: 100%;
}

.wp-embed-responsive .wp-embed-aspect-21-9 .wp-block-embed__wrapper::before {
    padding-top: 42.85%;
}

.wp-embed-responsive .wp-embed-aspect-18-9 .wp-block-embed__wrapper::before {
    padding-top: 50%;
}

.wp-embed-responsive .wp-embed-aspect-16-9 .wp-block-embed__wrapper::before {
    padding-top: 56.25%;
}

.wp-embed-responsive .wp-embed-aspect-4-3 .wp-block-embed__wrapper::before {
    padding-top: 75%;
}

.wp-embed-responsive .wp-embed-aspect-1-1 .wp-block-embed__wrapper::before {
    padding-top: 100%;
}

.wp-embed-responsive .wp-embed-aspect-9-16 .wp-block-embed__wrapper::before {
    padding-top: 177.77%;
}

.wp-embed-responsive .wp-embed-aspect-1-2 .wp-block-embed__wrapper::before {
    padding-top: 200%;
}

/* =============================================
   CAROUSEL BLOCK – GRID LAYOUT (Image Reveal Cards)
   Uses the UNDP design system `.image-reveal-card`
   pattern (components.min.css). The theme adds a
   fallback so the grid looks correct even when the
   design-system components stylesheet is not loaded.
   ============================================= */
.image-reveal-card-grid .grid-x {
    align-items: stretch;
}

.image-reveal-card-grid .cell {
    display: flex;
    margin-bottom: 1.5rem;
}

/*
 * Responsive column fallbacks.
 *
 * The UNDP base-minimal stylesheet only applies
 * `.grid-margin-x.small-up-1` / `medium-up-2` / `large-up-3`
 * inside `@media (min-width:30em)` and `@media (min-width:64em)`.
 * Because those rules share the same specificity, whichever
 * appears last in the file wins, so `large-up-3` never overrides
 * `medium-up-2` and the grid never reaches 3 columns.
 *
 * These higher-specificity overrides (scoped to the block,
 * `.image-reveal-card-grid`) guarantee a correct, responsive
 * column layout at every breakpoint and are loaded after the
 * design-system CSS.
 */
.image-reveal-card-grid .image-reveal-card-grid__row {
    display: flex;
    flex-wrap: wrap;
}

/* Base: 1 column (default, applies below 30em as well). */
.image-reveal-card-grid .image-reveal-card-grid__row > .cell {
    width: 100%;
    flex: 0 0 auto;
    box-sizing: border-box;
}

@media (min-width: 30em) {
    .image-reveal-card-grid .image-reveal-card-grid__row > .cell {
        width: calc(50% - 1.5rem);
    }
}

@media (min-width: 64em) {
    .image-reveal-card-grid .image-reveal-card-grid__row > .cell {
        width: calc(33.33333% - 1.5rem);
    }
}

.image-reveal-card-grid .image-reveal-card {
    display: block;
    width: 100%;
    background: var(--undpds-color-white, #ffffff);
    border: 0;
    height: 100%;
    overflow: hidden;
    position: relative;
    text-decoration: none;
    color: inherit;
}

.image-reveal-card-grid .image-reveal-card__content {
    overflow: hidden;
    position: relative;
}

.image-reveal-card-grid .image-reveal-card__content img {
    display: block;
    width: 100%;
}

.image-reveal-card-grid .image-reveal-card__content .image {
    position: relative;
    width: 100%;
}

.image-reveal-card-grid .image-reveal-card__content .image img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.image-reveal-card-grid .image-reveal-card__content .image:before {
    content: "";
    height: 100%;
    left: 0;
    position: absolute;
    top: 0;
    width: 100%;
    opacity: 0;
    transition: all .9s;
    background: linear-gradient(67.76deg, var(--undpds-color-yellow, #ffe539), transparent 61.11%);
}

.image-reveal-card-grid .image-reveal-card__content h5 {
    margin-bottom: 0;
    padding: var(--undpds-spacing-06, 1.25rem) var(--undpds-spacing-06, 1.25rem) 0;
}

.image-reveal-card-grid .image-reveal-card__content h5 {
    background: var(--undpds-color-white, #ffffff);
    bottom: -1px;
    box-sizing: border-box;
    left: 0;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    transform: translateY(100%);
    transition: all .4s cubic-bezier(.64, .05, .35, 1.05);
    transition-delay: .2s;
    width: 100%;
}

.image-reveal-card-grid .image-reveal-card .cta__link {
    margin: var(--undpds-spacing-07, 1.75rem) 0 0 var(--undpds-spacing-06, 1.25rem);
    width: 100%;
    box-sizing: border-box;
    padding-left: var(--undpds-spacing-06, 1.25rem);
}

.image-reveal-card-grid .image-reveal-card:hover .image-reveal-card__content h5 {
    height: auto;
    opacity: 1;
    transform: translateY(0);
}

.image-reveal-card-grid .image-reveal-card:hover .image-reveal-card__content .image:before {
    opacity: .75;
}

.image-reveal-card-grid .image-reveal-card:hover .cta__link i {
    width: 5rem;
}

.image-reveal-card-grid .image-reveal-card:hover .cta__link i:before {
    display: unset;
}

@media (min-width: 48em) {
    .image-reveal-card-grid .image-reveal-card__content h5 {
        padding: var(--undpds-spacing-07, 1.75rem) var(--undpds-spacing-06, 1.25rem) 0;
    }

    .image-reveal-card-grid .image-reveal-card .cta__link {
        box-sizing: border-box;
        margin-left: 0;
        padding-left: var(--undpds-spacing-06, 1.25rem);
    }
}

@media (min-width: 64em) {
    .image-reveal-card-grid .image-reveal-card {
        max-width: 100%;
    }
}

@media (max-width: 47.9375em) {
    .image-reveal-card-grid .image-reveal-card {
        margin-top: 0;
    }
}

/* =============================================
   LATEST POST BLOCK – FEATURED CARD + IMAGE TEMPLATE
   "Featured Card + Image": the featured image is
   shown directly above the title (portrait card),
   with no hover background-slide effect.
   ============================================= */
.featured-card-container .feature__card--portrait.feature__card-image-top {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-bottom: 0;
}

.featured-card-container .feature__card--portrait.feature__card-image-top > a {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
    background: var(--undpds-color-gray-200, #f7f7f7);
    overflow: hidden;
    position: relative;
}

.featured-card-container .feature__card--portrait.feature__card-image-top .feature__card-image {
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    margin-bottom: 20px;
}

.featured-card-container .feature__card--portrait.feature__card-image-top .feature__card-image img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.featured-card-container .feature__card--portrait.feature__card-image-top .feature__card-content {
    padding: var(--undpds-spacing-07, 1.75rem) 0;
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
    z-index: 1;
    padding-bottom: 0;
    width: 100%;
}

.featured-card-container .feature__card--portrait.feature__card-image-top .feature__card-content h6 {
    margin-bottom: var(--undpds-spacing-06, 1.25rem);
    font-size: var(--undpds-font-size-12, 0.75rem);
    font-weight: 700;
    line-height: 1.17;
    text-transform: uppercase;
}

.featured-card-container .feature__card--portrait.feature__card-image-top .feature__card-content h4,
.featured-card-container .feature__card--portrait.feature__card-image-top .feature__card-content h5 {
    margin-bottom: var(--undpds-spacing-06, 1.25rem);
}

.featured-card-container .feature__card--portrait.feature__card-image-top .feature__card-description {
    flex: 1;
}

.featured-card-container .feature__card--portrait.feature__card-image-top .feature__card-description p {
    margin-bottom: var(--undpds-spacing-07, 1.75rem);
}

.featured-card-container .feature__card--portrait.feature__card-image-top .cta__link {
    margin-top: auto;
}

/* Ensure no hover background-slide is applied in this variant */
.featured-card-container .feature__card--portrait.feature__card-image-top .feature__card-slide {
    display: none !important;
}
.feature__card-content .feature__card-description{
	margin-bottom: 0;
}
.feature__card-content span.cta__link.cta--arrow {
    margin-top: 10px;
}