/* =========================================================
   ARP Supporting Posts UI — Astra-friendly (CLEANED)
   - Hero/Inline: title top, image left, bullets + CTA right
   - Comparison hero: 2 columns on desktop
   - Recommended grid: stacked cards (Quick Picks) with aligned CTAs
   ========================================================= */

.arp-sup-disclosure{
  margin: 0 0 14px 0;
  opacity: .92;
}

/* ---------- Base card (Hero + Inline + Mini) ---------- */
.arp-sup-box{
  --arp-accent: var(--ast-global-color-0, var(--wp--preset--color--primary, #ff9900));
  --arp-accent-contrast: var(--ast-global-color-5, #fff);
  --arp-border: rgba(15, 23, 42, .10);
  --arp-soft: rgba(15, 23, 42, .06);
  --arp-media-col: 240px;

  display: grid;
  grid-template-columns: var(--arp-media-col) minmax(0, 1fr);
  gap: 18px 22px;
  align-items: start;

  border: 1px solid var(--arp-border);
  border-radius: 18px;
  padding: 22px;
  background: #fff;
  box-shadow: 0 12px 30px var(--arp-soft);
  margin: 20px 0;

  position: relative;
}

/* Title always spans full width */
.arp-sup-box > .arp-sup-title{
  grid-column: 1 / -1;
  margin: 0 0 6px 0;
  text-align: center;

  font-weight: 700;
  font-size: clamp(20px, 2.0vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.015em;

  /* prevent weird per-letter wrapping if theme uses aggressive wrap rules */
  word-break: normal;
  overflow-wrap: normal;
  hyphens: auto;
}

/* Badge */
.arp-sup-badge{
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;

  background: var(--arp-accent);
  color: var(--arp-accent-contrast);
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 999px;
  box-shadow: 0 10px 20px rgba(0,0,0,.12);
  pointer-events: none;
}

/* IMPORTANT:
   If your markup uses <div class="arp-sup-media"><a class="arp-sup-img">...</a></div>
   this wrapper is the grid item (prevents wpautop from wrapping <a> in <p>)
*/
.arp-sup-media{
  align-self: start;
}

/* Image link */
.arp-sup-img{
  display:flex;
  align-items:center;
  justify-content:center;

  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(15,23,42,.08);
  background: #fff;
  padding: 12px;

  text-decoration: none !important;
}

.arp-sup-img img{
  width: 100%;
  height: auto;
  max-height: 300px;
  display:block;
  object-fit: contain;
}

/* Body */
.arp-sup-body{
  min-width: 0;
  display:flex;
  flex-direction:column;
  gap: 10px;
}

.arp-sup-rating{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-weight: 700;
}
.arp-sup-stars{ letter-spacing: 1px; font-size: 15px; line-height: 1; }
.arp-sup-rating-num{ opacity: .92; }
.arp-sup-rating-count{ font-weight: 700; opacity: .70; }

.arp-sup-bullets{ margin: 0; padding-left: 18px; }
.arp-sup-bullets li{ margin: 6px 0; line-height: 1.55; opacity: .95; }

/* CTA wrapper (optional but helps alignment) */
.arp-sup-cta{}

/* Button */
.arp-sup-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;

  text-decoration:none !important;
  font-weight: 700;

  padding: 14px 18px;
  border-radius: 999px;
  line-height: 1;

  background: var(--arp-accent);
  color: var(--arp-accent-contrast) !important;

  box-shadow: 0 12px 24px rgba(0,0,0,.14);
  transition: transform .08s ease, filter .15s ease, opacity .15s ease;

  width: fit-content;
  max-width: 100%;
	
	gap: 10px;
}

.arp-sup-btn:hover{
  filter: brightness(.96);
  transform: translateY(-1px);
}

/* HARD RESET (kills old absolute/circle CTA rules) */
.arp-sup-btn,
.arp-sup-cta{
  position: static !important;
  inset: auto !important;
  float: none !important;
}
@media (min-width: 640px){
  .arp-sup-body{ height: 100%; }
  .arp-sup-cta{ margin-top: auto; } /* <-- wrapper, not the <a> */
  .arp-sup-btn{ margin-top: 0; }
}


/* Align CTA to bottom on desktop/tablet */
@media (min-width: 640px){
  .arp-sup-body{ height: 100%; }
  .arp-sup-cta{ margin-top: auto; }
}

/* ---------- Variants ---------- */
.arp-sup-box--hero{
  --arp-media-col: clamp(200px, 32%, 320px);
  padding: 24px;
  border-radius: 20px;
}

.arp-sup-box--mini{
  /* Inline mini: bigger image by default */
  --arp-media-col: clamp(220px, 36%, 360px);
  padding: 18px;
  border-radius: 16px;
}

.arp-sup-box--mini .arp-sup-img img{
  max-height: 340px;
}

/* ---------- Comparison hero (TOP of comparison post) ---------- */
.arp-sup-compare-hero{
  display: grid;
  gap: 18px;
  margin: 18px 0;
  grid-template-columns: 1fr;
}

@media (min-width: 860px){
  .arp-sup-compare-hero{ grid-template-columns: 1fr 1fr; }
}

.arp-sup-compare-hero .arp-sup-compare-col{ min-width: 0; }
.arp-sup-compare-hero .arp-sup-box{ margin: 0; }

/* make the mini card image column narrower INSIDE comparison hero */
.arp-sup-compare-hero .arp-sup-box--mini{
  --arp-media-col: clamp(140px, 34%, 200px);
  gap: 16px 18px;
}

.arp-sup-compare-hero .arp-sup-box--mini > .arp-sup-title{
  text-align: left;
  font-size: clamp(18px, 1.8vw, 24px);
}

/* prevent button looking like a circle if the theme tries to wrap */
.arp-sup-compare-hero .arp-sup-btn{ white-space: nowrap; }

/* ---------- Recommended grids (BOTTOM sections) ---------- */
.arp-sup-rec-title{ margin-top: 26px; }

.arp-sup-grid{
  display: grid;
  gap: 18px;
  margin: 12px 0 26px 0;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* stacked cards: keep GRID (don’t switch to flex) => no shrink-to-min-content bug */
.arp-sup-grid .arp-sup-box{
  margin: 0;
  padding: 18px;
  border-radius: 18px;

  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.arp-sup-grid .arp-sup-box > .arp-sup-title{
  text-align: left;
  font-size: 18px;
  line-height: 1.2;
  margin: 0;
}

.arp-sup-grid .arp-sup-img{
  padding: 14px;
  border-radius: 14px;
  background: rgba(15,23,42,.03);
}

.arp-sup-grid .arp-sup-img img{ max-height: 260px; }

.arp-sup-grid .arp-sup-btn{
  width: 100%;
  justify-content: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px){
  .arp-sup-box,
  .arp-sup-box--hero,
  .arp-sup-box--mini{
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .arp-sup-box > .arp-sup-title{ text-align: left; }

  .arp-sup-btn{ width: 100%; }

  .arp-sup-compare-hero .arp-sup-btn{
    white-space: normal;
  }
}


/* ===== Comparison table upgrade ===== */
.arp-sup-compare-table{
  width:100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: 16px;
}

.arp-sup-compare-table th,
.arp-sup-compare-table td{
  padding: 12px 14px;
  vertical-align: top;
}

.arp-sup-compare-th-prod a{
  display:block;
  text-decoration:none !important;
}

.arp-sup-compare-th-img{
  display:flex;
  justify-content:center;
  margin-bottom: 8px;
}

.arp-sup-compare-th-img img{
  max-height: 110px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display:block;
}

.arp-sup-compare-th-title{
  font-weight: 700;
  line-height: 1.2;
}

.arp-sup-compare-table-cta{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.arp-sup-btn--table{
  width: 100%;
  justify-content: center;
}


/* ===== Fix compare hero cards (top) ===== */
.arp-sup-compare-hero--top{
  display:grid;
  gap:18px;
  margin: 14px 0 18px 0;
}

@media (min-width: 860px){
  .arp-sup-compare-hero--top{
    grid-template-columns: 1fr 1fr;
  }
}

.arp-sup-compare-hero--top .arp-sup-box{
  margin: 0;
  grid-template-columns: clamp(140px, 30%, 220px) 1fr;
}

.arp-sup-compare-hero--top .arp-sup-btn{
  width: 100%;
  white-space: normal;
}

/* Make media wrapper behave like the old direct <a> grid item */
.arp-sup-box > .arp-sup-media{ min-width:0; }
.arp-sup-box > .arp-sup-body{ min-width:0; }

/* ===== Comparison table enhancement ===== */
.arp-sup-compare-table{
  width:100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow:hidden;
  border-radius: 18px;
}

.arp-sup-compare-table th,
.arp-sup-compare-table td{
  vertical-align: top;
}

.arp-sup-cth{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  text-align:center;
}

.arp-sup-cth-img{
  max-width: 180px;
  height:auto;
  object-fit:contain;
  display:block;
}

.arp-sup-cth-title{
  font-weight: 700;
  line-height: 1.2;
}

.arp-sup-ctabtm{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:12px;
}

.arp-sup-ctabtm-img{
  max-width: 220px;
  height:auto;
  object-fit:contain;
  display:block;
}

.arp-sup-btn--table{
  width: 100%;
  max-width: 320px;
  justify-content:center;
}


/* =========================================================
   TOP COMPARISON HERO — stacked cards (disable internal grid)
   ========================================================= */

.arp-sup-compare-hero-top{
  display: grid;
  gap: 18px;
  margin: 18px 0;
}

@media (min-width: 860px){
  .arp-sup-compare-hero-top{
    grid-template-columns: 1fr 1fr;
  }
}

/* make columns equal height */
.arp-sup-compare-hero-top .arp-sup-compare-col{
  min-width: 0;
  display: flex;
}
.arp-sup-compare-hero-top .arp-sup-compare-col .arp-sup-box{
  flex: 1;
}

/* key fix: kill internal 2-col grid for TOP hero only */
.arp-sup-compare-hero-top .arp-sup-box{
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* title alignment */
.arp-sup-compare-hero-top .arp-sup-box > .arp-sup-title{
  text-align: left;
  margin: 0 0 6px 0;
}

/* image sizing */
.arp-sup-compare-hero-top .arp-sup-img img{
  max-height: 320px;
}

/* keep CTA stable */
.arp-sup-compare-hero-top .arp-sup-body{
  flex: 1;
  display: flex;
  flex-direction: column;
}
.arp-sup-compare-hero-top .arp-sup-btn{
  width: 100%;
  white-space: normal;
}


/* =========================================================
   COMPARISON TABLE — header images + bottom secondary row + CTAs
   ========================================================= */

.arp-sup-table-wrap{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 18px 0 22px 0;
}

.arp-sup-compare-table{
  width: 100%;
  min-width: 720px; /* allows scroll on mobile instead of squishing */
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid rgba(15, 23, 42, .10);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
}

.arp-sup-compare-table th,
.arp-sup-compare-table td{
  padding: 14px 16px;
  border-bottom: 1px solid rgba(15, 23, 42, .10);
  border-right: 1px solid rgba(15, 23, 42, .10);
  vertical-align: top;
}

.arp-sup-compare-table th:last-child,
.arp-sup-compare-table td:last-child{
  border-right: 0;
}

.arp-sup-compare-table tr:last-child td{
  border-bottom: 0;
}

.arp-sup-compare-table thead th{
  text-align: center;
  font-weight: 900;
  background: rgba(15,23,42,.02);
}

.arp-sup-th-media img{
  display: block;
  margin: 0 auto 10px auto;
  max-width: 220px;
  max-height: 170px;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.arp-sup-th-title{
  margin: 0 auto;
  max-width: 260px;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 900;
}

.arp-sup-compare-cta-row td{
  text-align: center;
  background: rgba(15,23,42,.02);
}

.arp-sup-secondary-img{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
}

.arp-sup-secondary-img img{
  display:block;
  margin: 0 auto;
  max-width: 240px;
  max-height: 180px;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.arp-sup-table-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: 999px;
  margin-top: 10px;

  background: var(--ast-global-color-0, #0b62d6);
  color: #fff !important;
  box-shadow: 0 12px 24px rgba(0,0,0,.12);
}


/* =========================================================
   TOP comparison hero: force stacked card layout
   (matches your DevTools test: disabling display:grid fixes it)
   ========================================================= */
.arp-sup-compare-hero-top .arp-sup-box{
  display: flex !important;
  flex-direction: column;
  gap: 14px;
}

.arp-sup-compare-hero-top .arp-sup-title{
  text-align: left;
  margin-bottom: 6px;
  font-size: 18px;
  line-height: 1.2;
}

.arp-sup-compare-hero-top .arp-sup-btn{
  width: 100%;
  white-space: normal;
}

/* =========================================================
   Comparison table upgrades (header images + secondary row + CTA)
   ========================================================= */
.arp-sup-table-wrap{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 14px 0 20px 0;
}

.arp-sup-compare-table{
  width: 100%;
  border-collapse: collapse;
}

.arp-sup-compare-table th,
.arp-sup-compare-table td{
  vertical-align: top;
}

.arp-sup-th-wrap{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap: 10px;
}

.arp-sup-th-img{
  display:flex;
  justify-content:center;
  text-decoration:none !important;
}

.arp-sup-th-img img{
  width: 100%;
  max-width: 220px;
  height: 220px;
  object-fit: contain;
  display:block;
}

.arp-sup-th-title{
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.arp-sup-tr-secondary .arp-sup-td-label{
  font-weight: 700;
  opacity: .85;
}

.arp-sup-td-media{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap: 10px;
}

.arp-sup-td-img{
  display:flex;
  justify-content:center;
  text-decoration:none !important;
}

.arp-sup-td-img img{
  width: 100%;
  max-width: 240px;
  height: auto;
  object-fit: contain;
  display:block;
  border-radius: 12px;
}

.arp-sup-btn--sm{
  padding: 12px 14px;
  font-size: 14px;
  width: 100%;
  justify-content: center;
}

/* =========================================================
   CTA arrow glitch fix (removes mojibake â / squares)
   ========================================================= */

/* 1) Remove any existing pseudo-content (theme/plugin/minifier may inject arrows) */
.arp-sup-btn::before,
.arp-sup-btn::after{
  content: none !important;
}

/* 2) Add ONE clean arrow using a unicode escape (ASCII-safe, no encoding issues) */
.arp-sup-btn{
  position: relative;
  padding-right: 56px;   /* space for arrow */
  white-space: nowrap;   /* prevents weird wraps */
}

/* Clean arrow pinned to the right */
.arp-sup-btn::after{
  content: "\2192" !important; /* → */
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  line-height: 1;
}



/* ---------- Safety fallback for old content where wpautop wrapped things in <p> ---------- */
.arp-sup-box > p{ margin: 0; }
