/*
 * GOFINSA_XTB_COMPACT_V1
 * Reduce vertical footprint of XTB promotional cards.
 * Does NOT change brand colors, backgrounds, disclosure text,
 * affiliate URLs, rel attributes, tracking, or popup advertising.
 */

:where(
  .newsXtbAd,
  .gf-xtb-promo,
  .xtbCard,
  .gf-search-xtb-card,
  .gf-xtb-market-card,
  .gg-xtb,
  .gg-xtb-second,
  .uaeAd,
  aside[aria-label="إعلان XTB"],
  [data-gofinsa-b05-xtb-card]
){
  box-sizing:border-box!important;
  min-height:0!important;
  padding:15px 18px!important;
  margin-top:17px!important;
  margin-bottom:17px!important;
  border-radius:14px!important;
}

/* Headings */
:where(
  .newsXtbAd,
  .gf-xtb-promo,
  .xtbCard,
  .gf-search-xtb-card,
  .gf-xtb-market-card,
  .gg-xtb,
  .gg-xtb-second,
  .uaeAd,
  aside[aria-label="إعلان XTB"],
  [data-gofinsa-b05-xtb-card]
) :where(h2,h3,.gf-xtb-title){
  font-size:clamp(18px,2vw,22px)!important;
  line-height:1.35!important;
  margin-top:4px!important;
  margin-bottom:6px!important;
}

/* Main descriptive text */
:where(
  .newsXtbAd,
  .gf-xtb-promo,
  .xtbCard,
  .gf-search-xtb-card,
  .gf-xtb-market-card,
  .gg-xtb,
  .gg-xtb-second,
  .uaeAd,
  aside[aria-label="إعلان XTB"],
  [data-gofinsa-b05-xtb-card]
) > p,
:where(
  .newsXtbAd,
  .gf-xtb-promo,
  .xtbCard,
  .gf-search-xtb-card,
  .gf-xtb-market-card,
  .gg-xtb,
  .gg-xtb-second,
  aside[aria-label="إعلان XTB"],
  [data-gofinsa-b05-xtb-card]
) .gf-xtb-desc{
  font-size:14px!important;
  line-height:1.6!important;
  margin-top:5px!important;
  margin-bottom:9px!important;
}

/* Eyebrow / ad label */
:where(
  .newsXtbAd,
  .gf-xtb-promo,
  .xtbCard,
  .gf-search-xtb-card,
  .gf-xtb-market-card,
  .gg-xtb,
  .gg-xtb-second,
  aside[aria-label="إعلان XTB"],
  [data-gofinsa-b05-xtb-card]
) :where(
  .newsXtbAdLabel,
  .gf-xtb-eyebrow
){
  font-size:10.5px!important;
  line-height:1.35!important;
  margin-bottom:4px!important;
}

/* CTA buttons */
:where(
  .newsXtbAd,
  .gf-xtb-promo,
  .xtbCard,
  .gf-search-xtb-card,
  .gf-xtb-market-card,
  .gg-xtb,
  .gg-xtb-second,
  .uaeAd,
  aside[aria-label="إعلان XTB"],
  [data-gofinsa-b05-xtb-card]
) a[href^="https://s3ode.co"],
.newsXtbAdButton{
  box-sizing:border-box!important;
  min-height:42px!important;
  padding:9px 16px!important;
  border-radius:9px!important;
  font-size:14px!important;
  line-height:1.35!important;
  margin-top:6px!important;
  margin-bottom:6px!important;
}

/* Perks / badges */
.gf-xtb-promo ul.gf-xtb-perks{
  gap:5px 7px!important;
  margin-top:4px!important;
  margin-bottom:10px!important;
}

.gf-xtb-promo ul.gf-xtb-perks li{
  font-size:11.5px!important;
  line-height:1.4!important;
  padding:3px 9px!important;
}

/* Disclosure / risk text */
:where(
  .newsXtbAd,
  .gf-xtb-promo,
  .xtbCard,
  .gf-search-xtb-card,
  .gf-xtb-market-card,
  .gg-xtb,
  .gg-xtb-second,
  aside[aria-label="إعلان XTB"],
  [data-gofinsa-b05-xtb-card]
) :where(
  small,
  .newsXtbAdRisk,
  .gf-xtb-disclaimer
){
  font-size:10.5px!important;
  line-height:1.5!important;
  margin-top:7px!important;
}

/*
 * Existing "approved" cards are already compact.
 * Avoid shrinking their internal structure again.
 */
.gf-xtb-card.gf-xtb-approved{
  min-height:0!important;
}

/* Mobile */
@media(max-width:650px){
  :where(
    .newsXtbAd,
    .gf-xtb-promo,
    .xtbCard,
    .gf-search-xtb-card,
    .gf-xtb-market-card,
    .gg-xtb,
    .gg-xtb-second,
    .uaeAd,
    aside[aria-label="إعلان XTB"],
    [data-gofinsa-b05-xtb-card]
  ){
    padding:12px 14px!important;
    margin-top:14px!important;
    margin-bottom:14px!important;
    border-radius:12px!important;
  }

  :where(
    .newsXtbAd,
    .gf-xtb-promo,
    .xtbCard,
    .gf-search-xtb-card,
    .gf-xtb-market-card,
    .gg-xtb,
    .gg-xtb-second,
    .uaeAd,
    aside[aria-label="إعلان XTB"],
    [data-gofinsa-b05-xtb-card]
  ) :where(h2,h3,.gf-xtb-title){
    font-size:18px!important;
    line-height:1.32!important;
    margin:3px 0 5px!important;
  }

  :where(
    .newsXtbAd,
    .gf-xtb-promo,
    .xtbCard,
    .gf-search-xtb-card,
    .gf-xtb-market-card,
    .gg-xtb,
    .gg-xtb-second,
    .uaeAd,
    aside[aria-label="إعلان XTB"],
    [data-gofinsa-b05-xtb-card]
  ) a[href^="https://s3ode.co"],
  .newsXtbAdButton{
    min-height:40px!important;
    padding:8px 13px!important;
    font-size:13.5px!important;
    border-radius:8px!important;
  }

  .gf-xtb-promo ul.gf-xtb-perks li{
    font-size:11px!important;
    padding:3px 8px!important;
  }
}

/*
 * GOFINSA_XTB_COMPACT_V2_APPROVED
 * Approved market cards were already compact.
 * Apply a lighter reduction so they stay premium and readable.
 */

.gf-xtb-card.gf-xtb-approved{
  box-sizing:border-box!important;
  min-height:0!important;
  padding:11px 14px!important;
  margin-top:14px!important;
  margin-bottom:14px!important;
  border-radius:13px!important;
  gap:7px!important;
}

.gf-xtb-card.gf-xtb-approved .gf-xtb-copy{
  gap:5px!important;
}

.gf-xtb-card.gf-xtb-approved :where(h2,h3){
  font-size:clamp(17px,1.8vw,20px)!important;
  line-height:1.32!important;
  margin-top:3px!important;
  margin-bottom:5px!important;
}

.gf-xtb-card.gf-xtb-approved .gf-xtb-trust{
  font-size:10.5px!important;
  line-height:1.4!important;
  margin-bottom:4px!important;
}

.gf-xtb-card.gf-xtb-approved .gf-xtb-points{
  gap:4px 6px!important;
  margin-top:5px!important;
  margin-bottom:7px!important;
}

.gf-xtb-card.gf-xtb-approved .gf-xtb-points > *{
  font-size:11.5px!important;
  line-height:1.4!important;
}

.gf-xtb-card.gf-xtb-approved .gf-xtb-offer{
  font-size:12px!important;
  line-height:1.45!important;
  margin-top:5px!important;
  margin-bottom:6px!important;
}

.gf-xtb-card.gf-xtb-approved .gf-xtb-action{
  margin-top:6px!important;
  margin-bottom:5px!important;
}

.gf-xtb-card.gf-xtb-approved .gf-xtb-action a[href^="https://s3ode.co"]{
  box-sizing:border-box!important;
  min-height:40px!important;
  padding:8px 14px!important;
  border-radius:9px!important;
  font-size:13.5px!important;
  line-height:1.35!important;
}

.gf-xtb-card.gf-xtb-approved .gf-xtb-risk{
  font-size:10px!important;
  line-height:1.45!important;
  margin-top:5px!important;
}

@media(max-width:650px){
  .gf-xtb-card.gf-xtb-approved{
    padding:10px 11px!important;
    margin-top:12px!important;
    margin-bottom:12px!important;
    border-radius:11px!important;
    gap:5px!important;
  }

  .gf-xtb-card.gf-xtb-approved :where(h2,h3){
    font-size:17px!important;
  }

  .gf-xtb-card.gf-xtb-approved .gf-xtb-action a[href^="https://s3ode.co"]{
    min-height:38px!important;
    padding:7px 11px!important;
    font-size:13px!important;
  }
}
