/**
 * Afriborder — modern layer (variables, motion, reports UI, insights loading)
 */
:root {
  --ab-accent: #3b83bd;
  --ab-accent-soft: rgba(59, 131, 189, 0.12);
  --ab-warm: #ffdb58;
  --ab-radius: 12px;
  --ab-radius-sm: 8px;
  --ab-shadow: 0 8px 32px rgba(21, 21, 21, 0.08);
  --ab-shadow-hover: 0 14px 40px rgba(21, 21, 21, 0.12);
  --ab-transition: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Sitewide typography & surfaces */
a:not(.button):not(.brand):not(.rd-nav-link) {
  transition: color 0.2s ease, opacity 0.2s ease;
}

.bg-default {
  background-color: #fafbfc !important;
}

.section.section-sm.bg-default {
  background-image: linear-gradient(
    180deg,
    rgba(250, 251, 252, 0.65) 0%,
    rgba(255, 255, 255, 0) 100%
  );
}

h2,
h3,
.saka {
  letter-spacing: -0.02em;
}

.saka,
.section h2.heading-2,
.section h3 {
  color: #141820;
}

.post-modern {
  background: #fff;
  border: 1px solid rgba(21, 21, 21, 0.06);
  border-radius: var(--ab-radius-sm);
  padding: 1.15rem 1.25rem 1.35rem;
  height: 100%;
  box-shadow: 0 1px 0 rgba(21, 21, 21, 0.04);
}

.post-modern-title {
  margin-bottom: 0.65rem !important;
}

.post-modern-title a {
  color: #141820;
}

.post-modern-title a:hover {
  color: var(--ab-accent);
}

/* Insights list — extra rhythm on small screens (title / image / excerpt) */
@media (max-width: 767.98px) {
  .post-modern .post-modern-title {
    margin-bottom: 1rem !important;
    padding-bottom: 0.15rem;
  }

  .post-modern .post-image {
    margin-top: 0.35rem;
    margin-bottom: 1rem;
  }

  .post-modern .post-modern-text {
    margin-top: 0.85rem !important;
  }

  .post-modern .post-modern-title + .post-modern-text {
    margin-top: 1rem !important;
  }
}

.footer-corporate .list-marked a,
.footer-corporate .post-minimal-2-title a {
  transition: color 0.2s ease, opacity 0.2s ease;
}

.footer-corporate .list-marked a:hover,
.footer-corporate .post-minimal-2-title a:hover {
  color: #fff;
  opacity: 0.95;
}

/* Hero / slider readability */
.swiper-slide-caption h2,
.swiper-slide-caption h6 {
  text-shadow: 0 1px 24px rgba(0, 0, 0, 0.35);
}

/* Top bar: align compact reports with email row */
.rd-navbar-aside-right.rd-navbar-collapse {
  align-items: center;
  gap: 10px 14px;
}

.rd-navbar-corporate-contacts {
  margin-bottom: 0;
}

.page {
  animation: ab-page-in 0.55s var(--ab-transition) both;
}

@keyframes ab-page-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Global preloader — calmer backdrop */
.preloader {
  background: linear-gradient(145deg, #f8fafc 0%, #eef2f7 45%, #ffffff 100%) !important;
}

.preloader-body p {
  color: #4a5568;
  letter-spacing: 0.04em;
  font-size: 12px;
  text-transform: uppercase;
}

/* Cards & service tiles */
.post-modern,
.box-icon-classic,
.post-minimal-2 {
  transition: transform var(--ab-transition), box-shadow var(--ab-transition);
  border-radius: var(--ab-radius-sm);
}

.post-modern:hover,
.box-icon-classic:hover {
  transform: translateY(-3px);
  box-shadow: var(--ab-shadow-hover);
}

.section .button,
.button {
  border-radius: var(--ab-radius-sm);
  transition: transform var(--ab-transition), box-shadow var(--ab-transition),
    background-color var(--ab-transition), color var(--ab-transition);
}

.section .button:hover,
.button:hover {
  transform: translateY(-1px);
}

/* Index service strip */
.cardx {
  transition: transform var(--ab-transition), box-shadow var(--ab-transition),
    filter var(--ab-transition);
}

.cardx:hover {
  transform: scale(1.02);
  filter: brightness(1.03);
}

/* Reports — compact capsule (label + select) */
.reports-nav-group {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 4px;
}

.reports-nav-inner {
  display: inline-flex;
  align-items: stretch;
  max-width: min(17.5rem, calc(100vw - 2rem));
  border-radius: 6px;
  border: 1px solid rgba(21, 21, 21, 0.11);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 1px 2px rgba(21, 21, 21, 0.05);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.reports-nav-inner:hover {
  border-color: rgba(59, 131, 189, 0.35);
  box-shadow: 0 2px 8px rgba(59, 131, 189, 0.08);
}

.reports-nav-inner:focus-within {
  border-color: var(--ab-accent);
  box-shadow: 0 0 0 2px var(--ab-accent-soft);
}

.reports-nav-label {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0 0.5rem 0 0.65rem;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  line-height: 1;
  border-right: 1px solid rgba(21, 21, 21, 0.08);
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  user-select: none;
}

.reports-nav-select {
  flex: 1 1 auto;
  min-width: 6.5rem;
  max-width: 11rem;
  margin: 0;
  padding: 0.35rem 1.35rem 0.35rem 0.5rem;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  font-family: Montserrat, sans-serif;
  color: #1e293b;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath fill='%2364748b' d='M0 0h8L4 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.45rem center;
  background-size: 8px 5px;
  border: none;
  border-radius: 0;
  cursor: pointer;
  appearance: none;
  transition: color 0.15s ease;
}

.reports-nav-select:hover {
  color: var(--ab-accent);
}

.reports-nav-select:focus {
  outline: none;
}

@media (max-width: 991px) {
  .reports-nav-group {
    margin-left: 0;
    margin-top: 8px;
    width: 100%;
    max-width: 100%;
  }

  .reports-nav-inner {
    max-width: none;
    width: 100%;
  }

  .reports-nav-select {
    max-width: none;
    min-width: 0;
  }
}

/* Insights list loading (below .preloader z-index 10000 until it fades) */
.insights-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  /* Short fade-out only; show is mostly instant to avoid a blank gap after the theme preloader */
  transition: opacity 0.2s ease, visibility 0s linear 0.2s;
  background: linear-gradient(
    135deg,
    rgba(248, 250, 252, 0.94) 0%,
    rgba(238, 242, 247, 0.97) 50%,
    rgba(255, 255, 255, 0.95) 100%
  );
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.insights-loading-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.15s ease, visibility 0s linear 0s;
}

.insights-loading-panel {
  text-align: center;
  padding: 32px 40px;
  border-radius: var(--ab-radius);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: var(--ab-shadow);
  border: 1px solid rgba(21, 21, 21, 0.06);
  max-width: 320px;
}

.insights-loading-panel p {
  margin-top: 16px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.insights-loading-spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border: 3px solid var(--ab-warm);
  border-radius: 50%;
  border-left-color: transparent;
  border-bottom-color: transparent;
  animation: ab-spin 0.85s linear infinite;
}

@keyframes ab-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Inline article loading (insight-single) */
.insight-article-wrap {
  position: relative;
  min-height: 200px;
}

/* Insight single — left-aligned reading column (overrides WP/Gutenberg inline center) */
.insight-article-wrap .post-title {
  text-align: left !important;
}

@media (max-width: 767.98px) {
  .insight-article-wrap .post-title {
    margin-bottom: 1.15rem !important;
    padding-bottom: 0.35rem;
  }

  .insight-article-wrap .post-image:not([hidden]) {
    margin-bottom: 1.1rem;
  }

  .insight-article-wrap .post-content {
    margin-top: 0.5rem;
  }

  .insight-article-wrap .post-content > *:first-child {
    margin-top: 0;
  }
}

.insight-article-wrap .post-content,
.insight-article-wrap .post-content * {
  text-align: left !important;
}

.insight-article-wrap .post-content .wp-block-buttons,
.insight-article-wrap .post-content .wp-block-button {
  justify-content: flex-start !important;
}

.insight-article-wrap .post-content .wp-block-buttons.is-layout-flex {
  justify-content: flex-start !important;
}

.insight-article-wrap .insights-loading-overlay {
  position: absolute;
  border-radius: var(--ab-radius-sm);
}

.insights-card-col {
  animation: ab-fade-up 0.5s ease both;
}

@keyframes ab-fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* RD Navbar subtle polish */
.rd-navbar-corporate.rd-navbar-static .rd-navbar-aside,
.rd-navbar-fixed .rd-navbar-aside {
  box-shadow: 0 1px 0 rgba(21, 21, 21, 0.06);
}

.footer-corporate {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Homepage — About tabs + photo */
.home-about-section .home-about-image-col {
  align-self: stretch;
}

.home-about-section .home-about-photo {
  width: 100%;
  max-width: 640px;
  height: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
  border-radius: var(--ab-radius-sm);
  box-shadow: var(--ab-shadow);
}

@media (min-width: 992px) {
  .home-about-section .home-about-photo {
    max-width: 100%;
    width: 100%;
  }

  .home-about-section .home-about-image-col {
    padding-right: 1.25rem;
  }
}

.home-about-tabs {
  margin-bottom: 0;
}

.home-about-tab-panes {
  margin-top: 0.85rem;
}

.home-about-tab-panes .tab-pane > p:first-of-type {
  margin-top: 0;
}

/* Homepage — Our reports block */
.home-our-reports {
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
}

.home-our-reports-title {
  margin-bottom: 1rem;
  color: #141820;
}

.home-our-reports-lead {
  font-size: 1.05rem;
  line-height: 1.65;
  color: #4a5568;
  max-width: 36rem;
  margin: 0;
}

.home-reports-links {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
}

.home-reports-links li {
  border-bottom: 1px solid rgba(21, 21, 21, 0.08);
}

.home-reports-links li:last-child {
  border-bottom: none;
}

.home-reports-links a {
  display: block;
  padding: 0.85rem 0;
  font-weight: 500;
  font-size: 14px;
  color: #1e293b;
  text-decoration: none;
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.home-reports-links a:hover {
  color: var(--ab-accent);
  padding-left: 4px;
}

.home-reports-more {
  margin: 0;
}
