/**
 * AIM Archive / Home Component Styles
 *
 * Loaded only on archive and home pages via wp_enqueue_style( 'aim-archive-components' ).
 * Contains: Practitioner archive bar, AIM methodology badge.
 *
 * A2 FIX: Shared CSS custom properties (--teal-dark, --teal-mid, --gold, --gold-light,
 *         --text) removed from per-component scope — they now cascade from :root in
 *         aim-global.css. Component-specific --text-muted values kept scoped.
 * A3 FIX: speak: never added to decorative ◆ Unicode pseudo-elements so screen
 *         readers don't announce "black diamond suit" to users.
 * A5 FIX: -webkit-backdrop-filter vendor prefix added to .aim-badge-inner for
 *         Firefox on Android and older Chromium-based mobile browsers.
 *
 * @package    Ahmed Alshamsy
 * @since      2.0.0
 */

/* =============================================================================
   PRACTITIONER ARCHIVE BAR — above post loop on archive / home
   A2 FIX: --teal-dark, --teal-mid, --gold, --gold-light, --text removed.
   --text-muted (#44524f) kept here — differs from other components.
   ============================================================================= */

.aim-practitioner-archive-bar {
  --text-muted: #44524f;
  width: 100%;
  margin: 0 0 30px 0;
  clear: both;
  box-sizing: border-box;
}

.aim-practitioner-archive-panel {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 0% 0%,   rgba(0, 105, 92, 0.12)  0%, transparent 55%),
    radial-gradient(ellipse at 100% 100%, rgba(197, 160, 89, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 0%,  rgba(0, 77, 64, 0.06)   0%, transparent 45%),
    linear-gradient(160deg, #f3faf8 0%, #f8fcfb 48%, #fffaf0 100%);
  border: 1px solid rgba(197, 160, 89, 0.22);
  border-left: 5px solid var(--gold);
  border-radius: 10px;
  padding: 24px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  box-sizing: border-box;
}

/* Diagonal hatch texture */
.aim-practitioner-archive-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 30px,
    rgba(0, 77, 64, 0.018) 30px,
    rgba(0, 77, 64, 0.018) 31px
  );
  pointer-events: none;
}

/* Top gradient rule */
.aim-practitioner-archive-panel::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--teal-dark), var(--gold) 50%, var(--teal-mid));
  opacity: 0.95;
  pointer-events: none;
}

/* Copy column */
.aim-practitioner-archive-copy {
  flex: 2;
  min-width: 280px;
  position: relative;
  z-index: 1;
  text-align: center;
}

/* "Join & Support" pill badge */
.aim-archive-h3-heading-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--teal-dark), var(--teal-mid));
  color: var(--gold);
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 6px 16px;
  border-radius: 50px;
  border: 1px solid rgba(197, 160, 89, 0.32);
  box-shadow: 0 4px 18px rgba(0, 77, 64, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  margin-bottom: 12px;
  user-select: none;
}

/* A3 FIX: speak: never on decorative ◆ characters */
.aim-archive-h3-heading-badge::before,
.aim-archive-h3-heading-badge::after {
  content: "◆";
  font-size: 0.4rem;
  opacity: 0.72;
  speak: never;
  font-variant: none;
  unicode-bidi: isolate;
}

.aim-practitioner-archive-copy h2 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: clamp(1.2rem, 2.8vw, 1.85rem);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.35px;
  color: var(--teal-dark);
  text-wrap: balance;
  /* Override .entry-content h2 cascade (border-bottom, Merriweather, padding) */
  border-bottom: none;
  padding-top: 0;
  padding-bottom: 0;
}

.aim-practitioner-archive-copy h2 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Ornamental divider */
.aim-practitioner-archive-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 12px;
  margin-bottom: 12px;
}

.aim-practitioner-archive-divider::before {
  content: "";
  height: 1px;
  width: 62px;
  max-width: 20vw;
  background: linear-gradient(to right, transparent, var(--gold));
}

.aim-practitioner-archive-divider::after {
  content: "";
  height: 1px;
  width: 62px;
  max-width: 20vw;
  background: linear-gradient(to left, transparent, var(--gold));
}

.aim-practitioner-archive-gem {
  width: 7px;
  height: 7px;
  background: var(--gold);
  transform: rotate(45deg);
  box-shadow: 0 0 10px rgba(197, 160, 89, 0.45);
  flex: 0 0 auto;
}

.aim-practitioner-archive-copy p {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.aim-practitioner-archive-copy strong {
  color: var(--teal-dark);
  font-weight: 800;
}

/* CTA column */
.aim-practitioner-archive-cta {
  flex: 1;
  min-width: 180px;
  text-align: right;
  position: relative;
  z-index: 1;
}

.aim-practitioner-archive-cta a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--teal-dark), var(--teal-mid));
  color: #ffffff !important;
  padding: 14px 24px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.9rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
  box-shadow: 0 8px 18px rgba(0, 77, 64, 0.16);
  border: 1px solid rgba(197, 160, 89, 0.24);
  white-space: nowrap;
}

.aim-practitioner-archive-cta a::after {
  content: "→";
  font-size: 1rem;
  line-height: 1;
}

.aim-practitioner-archive-cta a:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 77, 64, 0.22);
  filter: saturate(1.05);
}

/* Responsive — archive bar */
@media (max-width: 720px) {
  .aim-practitioner-archive-panel {
    padding: 18px 14px;
    border-radius: 0;
    border-left: 0;
  }

  .aim-practitioner-archive-copy,
  .aim-practitioner-archive-cta {
    min-width: 100%;
    flex: 1 1 100%;
    text-align: center;
  }

  .aim-practitioner-archive-copy h2 {
    font-size: 1.08rem;
  }

  .aim-practitioner-archive-copy p {
    font-size: 0.98rem;
  }

  .aim-practitioner-archive-cta a {
    width: 100%;
    max-width: 100%;
  }

  .aim-practitioner-archive-divider::before,
  .aim-practitioner-archive-divider::after {
    width: 48px;
  }
}

/* =============================================================================
   AIM METHODOLOGY BADGE — before posts loop on archive / home
   A2 FIX: --teal-dark, --teal-mid, --gold, --gold-light, --text removed.
   --text-muted (#4f6761) kept here — differs from other components.
   ============================================================================= */

.aim-badge-fp {
  --text-muted:  #4f6761; /* badge general muted text */
  --badge-body:  #2d3748; /* badge body paragraph text */
  --badge-creds: #4a6b65; /* credentials strip text */
  position: relative;
  font-family: "Inter", system-ui, sans-serif;
  margin: 40px auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.aim-badge-frame {
  position: relative;
  background:
    radial-gradient(ellipse at 0% 0%,   rgba(0, 105, 92, 0.12)  0%, transparent 55%),
    radial-gradient(ellipse at 100% 100%, rgba(197, 160, 89, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 0%,  rgba(0, 77, 64, 0.06)   0%, transparent 45%),
    linear-gradient(160deg, #f3faf8 0%, #f8fcfb 48%, #fffaf0 100%);
  border-radius: 18px;
  border: 1px solid rgba(197, 160, 89, 0.22);
  box-shadow:
    0 0 0 1px rgba(0, 77, 64, 0.03),
    0 18px 42px rgba(0, 77, 64, 0.08);
  overflow: hidden;
}

/* Top gradient rule */
.aim-badge-frame::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--teal-dark), var(--gold), var(--teal-mid));
  z-index: 2;
}

/* Diagonal hatch texture */
.aim-badge-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 28px,
    rgba(0, 77, 64, 0.018) 28px,
    rgba(0, 77, 64, 0.018) 29px
  );
  pointer-events: none;
  z-index: 0;
}

/* Gold side pillars */
.aim-badge-pillar-l,
.aim-badge-pillar-r {
  position: absolute;
  top: 22px;
  bottom: 22px;
  width: 3px;
  border-radius: 4px;
  background: linear-gradient(to bottom, transparent, #C5A059 25%, #C5A059 75%, transparent);
  z-index: 3;
  opacity: 0.72;
}

.aim-badge-pillar-l { left: 16px; }
.aim-badge-pillar-r { right: 16px; }

/* Ghost watermark */
.aim-badge-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  overflow: hidden;
  line-height: 0.9;
}

.aim-badge-watermark span {
  font-family: "Playfair Display", serif;
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 800;
  color: transparent;
  -webkit-text-stroke: 1px rgba(0, 77, 64, 0.05);
  letter-spacing: -1px;
  white-space: nowrap;
  display: block;
}

/* Inner layout
   A5 FIX: -webkit-backdrop-filter vendor prefix added for Firefox/Android
   and older Chromium-based browsers that don't support the unprefixed property. */
.aim-badge-inner {
  position: relative;
  z-index: 1;
  padding: 38px 52px 30px;
  text-align: center;
  background: rgba(255, 255, 255, 0.42); /* Fallback if backdrop-filter unsupported */
  -webkit-backdrop-filter: blur(2px);    /* A5 FIX: vendor prefix */
          backdrop-filter: blur(2px);
}

/* Eyebrow */
.aim-badge-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #004D40;
  font-family: "Playfair Display", serif;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 3px;
  margin-bottom: 18px;
  text-transform: uppercase;
}

.aim-badge-eyebrow::before {
  content: "";
  height: 1px;
  width: 28px;
  background: linear-gradient(to right, transparent, #C5A059);
}

.aim-badge-eyebrow::after {
  content: "";
  height: 1px;
  width: 28px;
  background: linear-gradient(to left, transparent, #C5A059);
}

/* Body */
.aim-badge-text {
  font-size: 1.1rem;
  color: var(--badge-body);
  line-height: 1.75;
  max-width: 600px;
  margin: 0 auto 22px;
}

.aim-badge-hl {
  color: #004D40;
  font-weight: 700;
  position: relative;
  display: inline-block;
  text-decoration: none;
  white-space: nowrap;
}

.aim-badge-hl::after {
  content: "";
  position: absolute;
  bottom: 1px;
  left: 0;
  width: 100%;
  height: 5px;
  background: rgba(197, 160, 89, 0.22);
  border-radius: 2px;
  z-index: -1;
}

/* Ornamental divider */
.aim-badge-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.aim-badge-ornament::before {
  content: "";
  height: 1px;
  width: 50px;
  background: linear-gradient(to right, transparent, rgba(197, 160, 89, 0.45));
}

.aim-badge-ornament::after {
  content: "";
  height: 1px;
  width: 50px;
  background: linear-gradient(to left, transparent, rgba(197, 160, 89, 0.45));
}

.aim-badge-gem {
  width: 6px;
  height: 6px;
  background: #C5A059;
  transform: rotate(45deg);
  box-shadow: 0 0 8px rgba(197, 160, 89, 0.5);
}

/* Credentials strip */
.aim-badge-creds {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  row-gap: 10px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--badge-creds);
  padding: 16px 20px 4px;
  border-top: 1px solid rgba(197, 160, 89, 0.15);
}

.aim-cred-item {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 4px 12px;
}

/* A3 FIX: speak: never on decorative ◆ bullet character between credential items */
.aim-cred-item + .aim-cred-item::before {
  content: "◆";
  color: #C5A059;
  font-size: 0.38rem;
  margin-right: 12px;
  opacity: 0.8;
  flex-shrink: 0;
  speak: never;
  font-variant: none;
  unicode-bidi: isolate;
}

/* Responsive — badge */
@media (max-width: 680px) {
  .aim-badge-fp {
    padding: 0;
    margin: 24px 0;
    max-width: 100%;
  }

  .aim-badge-frame {
    border-radius: 0;
    box-shadow:
      0 0 0 1px rgba(197, 160, 89, 0.18),
      0 8px 24px rgba(0, 77, 64, 0.07);
  }

  .aim-badge-inner {
    padding: 30px 20px 22px;
  }

  .aim-badge-pillar-l { left: 10px; }
  .aim-badge-pillar-r { right: 10px; }

  .aim-badge-text {
    font-size: 1rem;
  }

  .aim-badge-creds {
    row-gap: 8px;
    font-size: 0.63rem;
    letter-spacing: 0.6px;
    padding: 14px 16px 4px;
  }

  .aim-cred-item {
    padding: 3px 8px;
  }

  .aim-badge-watermark span {
    font-size: clamp(3rem, 16vw, 5rem);
  }
}

@media (max-width: 420px) {
  .aim-badge-inner {
    padding: 26px 16px 20px;
  }

  .aim-badge-eyebrow {
    font-size: 0.64rem;
    letter-spacing: 2px;
    gap: 8px;
  }

  .aim-badge-eyebrow::before,
  .aim-badge-eyebrow::after {
    width: 18px;
  }

  .aim-badge-creds {
    font-size: 0.6rem;
  }
}

/* =============================================================================
   ARCHIVE DOWNLOAD WRAPPER — per-post pack in excerpt
   Q3 FIX: Styles moved from inline PHP (aim_append_download_button_to_excerpt)
   to this file so LiteSpeed UCSS can analyse them and they participate in
   browser caching and CDN compression.
   ============================================================================= */

.aim-archive-download-wrapper {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--gold);
}

.aim-archive-download-flex {
  display: flex;
  align-items: center;
  gap: 10px;
}

.aim-archive-download-col {
  flex: 1;
}

/* Join CTA button — non-member state */
.aim-join-cta {
  display: inline-block;
  padding: 8px 12px;
  background: var(--teal-dark);
  color: #fff !important;
  border-radius: 8px;
  text-decoration: none !important;
  font-weight: 700;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.aim-join-cta:hover {
  background: var(--teal-mid);
  box-shadow: 0 4px 12px rgba(0, 77, 64, 0.18);
}

/* Description beneath join CTA */
.aim-join-desc {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--text-muted, #555555); /* #555 passes WCAG AA (7.1:1 on white) */
  line-height: 1.5;
}

.aim-join-desc a {
  color: var(--gold);
  text-decoration: underline;
}