/* =========================================================
   THEMATIC AREAS (CLEAN)
   - Header matches Partners/News style
   - Scoped styles (no Bootstrap card bleed)
   - Image fits exactly inside media div (no gaps)
   - NEW: “waves surrounding the icon” animation on the pill icon
   - No duplicated rules
========================================================= */

.thematic-areas-section{
  position: relative;
  overflow: hidden;
  padding: 72px 0;
  margin: 0;
  background:
    radial-gradient(circle at 15% 25%, rgba(245, 123, 44, 0.07) 0%, transparent 38%),
    radial-gradient(circle at 80% 35%, rgba(11, 79, 102, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 55% 85%, rgba(20, 119, 109, 0.06) 0%, transparent 45%),
    linear-gradient(135deg,
      rgba(243, 250, 250, 0.96) 0%,
      rgba(255, 255, 255, 0.98) 35%,
      rgba(243, 250, 250, 0.96) 100%);
}

/* dot texture */
.thematic-areas-section::before{
  content:"";
  position:absolute;
  inset:0;
  background-image: radial-gradient(circle, rgba(11, 79, 102, 0.10) 1.2px, transparent 1.3px);
  background-size: 22px 22px;
  opacity: 0.14;
  pointer-events:none;
}

.thematic-areas-section .container{
  position: relative;
  z-index: 1;
}

/* =========================
   HEADER (NEWS/PARTNERS STYLE)
========================= */
.ta-title-wrap{
  text-align: center;
  max-width: 920px;
  margin: 0 auto 34px;
}

.ta-title-wrap h2{
  margin: 0;
  font-weight: 900;
  letter-spacing: 0.2px;
  line-height: 1.1;
  font-size: clamp(1.8rem, 2.8vw, 3rem);
}

.ta-title-wrap .t-primary{ color: var(--ahda-teal); }
.ta-title-wrap .t-accent{ color: var(--ahda-orange); }

.ta-underline{
  display: inline-block;
  width: min(260px, 62%);
  height: 6px;
  margin-top: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg,
    rgba(245, 123, 44, 0.0) 0%,
    rgba(245, 123, 44, 0.9) 30%,
    rgba(245, 123, 44, 0.6) 55%,
    rgba(245, 123, 44, 0.0) 100%);
  position: relative;
}

.ta-underline::after{
  content:"";
  position:absolute;
  left:50%;
  transform: translateX(-50%);
  top:-3px;
  width:52px;
  height:12px;
  border-radius:999px;
  background: rgba(245, 123, 44, 0.18);
}

.ta-subtitle{
  margin: 10px auto 0;
  color: var(--ahda-text-gray);
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.55;
  max-width: 780px;
}

/* =========================
   GRID
========================= */
.ta-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}

/* =========================
   CARD (Scoped, no bootstrap card look)
========================= */
.ta-card{
  position: relative;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(11, 79, 102, 0.12);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  height: 100%;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.ta-card::before{
  content:"";
  position:absolute;
  top:0;
  left:0;
  right:0;
  height:4px;
  background: linear-gradient(90deg, var(--ahda-teal), var(--ahda-green));
  opacity: .95;
  z-index: 2;
}

/* top line per type */
.ta-community::before{ background: linear-gradient(90deg, var(--ahda-maroon), var(--ahda-orange)); }
.ta-healthsys::before{ background: linear-gradient(90deg, var(--ahda-green), var(--ahda-teal)); }

.ta-card:hover{
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(245, 123, 44, 0.25);
}

/* =========================
   MEDIA (Image fits EXACTLY)
   - No gap
   - No stretching distortion
========================= */
.ta-media{
  position: relative;
  height: 210px;
  width: 100%;
  overflow: hidden;
  background: rgba(11, 79, 102, 0.06);
  line-height: 0; /* kills inline-image baseline gap if <img> is not block */
}

.ta-img{
  width: 100%;
  height: 100%;
  display: block;               /* removes bottom gap */
  object-fit: cover;            /* fills div exactly */
  object-position: center;
  transform: scale(1.01);       /* tiny fill safety (prevents hairline edges) */
  transition: transform .45s cubic-bezier(.2,.9,.2,1);
  will-change: transform;
}

.ta-card:hover .ta-img{
  transform: scale(1.08);
}

/* =========================
   BODY
========================= */
.ta-body{
  padding: 20px 20px 24px;
}

.ta-card-title{
  margin: 0 0 10px;
  color: var(--primary-heading);
  font-weight: 900;
  font-size: 1.25rem;
  line-height: 1.35;
}

.ta-card-text{
  margin: 0;
  color: var(--ahda-text-gray);
  line-height: 1.65;
}

/* =========================
   PILL (Top-right) + ICON WAVES
   - Waves surround the ICON (not the whole pill)
   - Keeps your existing pill waves too (clean + subtle)
========================= */
.ta-pill{
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  padding: 9px 14px;
  border-radius: 999px;

  font-weight: 900;
  font-size: 0.85rem;
  color: var(--ahda-white);
  letter-spacing: .2px;

  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255,255,255,0.18);

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  -webkit-tap-highlight-color: transparent;
}

/* OPTIONAL: pill ring waves (subtle) */
.ta-pill::before,
.ta-pill::after{
  content:"";
  position:absolute;
  inset:-8px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.22);
  opacity: 0;
  animation: taPillWave 2.6s ease-out infinite;
  pointer-events:none;
}

.ta-pill::after{
  inset:-16px;
  animation-delay: .45s;
}

@keyframes taPillWave{
  0%   { transform: scale(0.92); opacity: .40; }
  65%  { opacity: .14; }
  100% { transform: scale(1.18); opacity: 0; }
}

/* Color variants */
.ta-pill-teal{   background: linear-gradient(135deg, var(--ahda-teal), var(--ahda-green)); }
.ta-pill-maroon{ background: linear-gradient(135deg, var(--ahda-maroon), var(--ahda-orange)); }
.ta-pill-green{  background: linear-gradient(135deg, var(--ahda-green), var(--ahda-teal)); }

/* ICON wrapper: place waves around the icon */
.ta-pill .ta-icon{
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow: 0 10px 20px rgba(0,0,0,0.18);
  flex: 0 0 auto;
  isolation: isolate; /* keeps pseudo layers clean */
}

/* If you use Bootstrap Icons: <i class="bi ..."> inside .ta-icon */
.ta-pill .ta-icon i{
  font-size: 1rem;
  line-height: 1;
  color: var(--ahda-white);
  transform: translateZ(0);
}
/* =========================
   TA PILL ICON + WAVES (MISSION STYLE)
   Strong AHDA ORANGE waves (always on)
========================= */

.ta-pill{ overflow: visible; } /* ensure rings are not clipped by the pill itself */

.ta-pill .ta-icon{
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  margin-right: 8px; /* if you show label text in pill */
  isolation: isolate;
}

/* optional: give the icon a subtle glow */
.ta-pill .ta-icon i{
  position: relative;
  z-index: 3;
  transform: translateZ(0);
}

/* waves (3 rings) */
.ta-pill .ta-icon .wave{
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  border: 3px solid rgba(245,123,44,0.42);
  z-index: 1;
  pointer-events: none;
  animation: taWavePulse 1.9s ease-out infinite;
  box-shadow:
    0 0 18px rgba(245,123,44,0.30),
    0 0 44px rgba(245,123,44,0.18);
}

/* 2nd ring */
.ta-pill .ta-icon .wave-2{
  inset: -14px;
  opacity: .75;
  border-width: 3px;
  animation-delay: .28s;
}

/* 3rd ring */
.ta-pill .ta-icon .wave-3{
  inset: -22px;
  opacity: .55;
  border-width: 3px;
  animation-delay: .56s;
}

@keyframes taWavePulse{
  0%   { transform: scale(0.82); opacity: .95; }
  60%  { opacity: .28; }
  100% { transform: scale(1.45); opacity: 0; }
}

/* stronger on hover (optional) */
.ta-card:hover .ta-pill .ta-icon .wave{
  border-color: rgba(245,123,44,0.60);
  box-shadow:
    0 0 22px rgba(245,123,44,0.45),
    0 0 60px rgba(245,123,44,0.25);
}

/* reduced motion */
@media (prefers-reduced-motion: reduce){
  .ta-pill .ta-icon .wave{
    animation: none !important;
    opacity: .25 !important;
    transform: none !important;
  }
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 992px){
  .thematic-areas-section{ padding: 60px 0; }
  .ta-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px){
  .thematic-areas-section{ padding: 52px 0; }
  .ta-grid{ grid-template-columns: 1fr; }
  .ta-media{ height: 200px; }
  .ta-body{ padding: 18px 18px 22px; }
  .ta-card-title{ font-size: 1.18rem; }
  .ta-subtitle{ font-size: .95rem; }
}

@media (max-width: 575.98px){
  .ta-title-wrap{ margin-bottom: 26px; }
  .ta-underline{ margin-top: 8px; }
}

/* =========================
   REDUCED MOTION
========================= */
@media (prefers-reduced-motion: reduce){
  .ta-card,
  .ta-img{
    transition: none !important;
  }
  .ta-pill::before,
  .ta-pill::after,
  .ta-pill .ta-icon::before,
  .ta-pill .ta-icon::after{
    animation: none !important;
    opacity: .18 !important;
  }
}