/* ===== ESG Investing Page ===== */
.page-esg {
  background: var(--color-white);
}

/* Hero */
.esg-hero {
  position: relative;
  background: var(--color-dark);
  color: var(--color-white);
  padding: calc(var(--header-height) + 48px) 0 80px;
  overflow: hidden;
}

.esg-hero::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 55%;
  height: 100%;
  background-image: url('https://assets.cmcinvest.com/invest-sg/esg-hero-digital-sapling.png');
  background-repeat: no-repeat;
  background-position: 100px bottom;
  background-size: auto 100%;
  pointer-events: none;
}

.esg-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 58%;
}

.esg-hero__title {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 800;
  line-height: 1.1;
  color: var(--color-accent);
  margin-bottom: 12px;
}

.esg-hero__subtitle {
  font-size: clamp(20px, 2.5vw, 32px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-white);
}

.esg-hero__mobile-image {
  display: none;
  margin-top: -20px;
  background-image: url('https://assets.cmcinvest.com/invest-sg/esg-hero-digital-sapling.png');
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: 500px auto;
  padding-bottom: 86%;
  position: relative;
}

.esg-hero__mobile-image::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: var(--color-accent);
}

/* Section common */
.esg-section {
  padding: 80px 0;
}

.esg-section--cloud {
  background: var(--color-gray-bg);
}

.esg-section--dark {
  background: var(--color-dark);
  color: var(--color-white);
}

.esg-section__title {
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
  margin-bottom: 24px;
}

.esg-section__title--rose {
  color: var(--color-accent);
}

.esg-section__intro {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  font-size: 17px;
  line-height: 1.75;
  color: var(--color-text);
}

.esg-section__intro p + p {
  margin-top: 16px;
}

/* Three Pillars */
.esg-pillars {
  margin-top: 48px;
}

.esg-pillars__title {
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 800;
  text-align: center;
  margin-bottom: 48px;
}

.esg-pillars__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 32px;
}

.esg-pillar {
  text-align: center;
}

.esg-pillar__icon {
  width: 80px;
  height: 68px;
  margin: 0 auto 16px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

.esg-pillar__icon--environment {
  background-image: url('https://assets.cmcinvest.com/invest-sg/icon-globe-leaf-inkp-rose.svg');
}

.esg-pillar__icon--social {
  background-image: url('https://assets.cmcinvest.com/invest-sg/icon-hands-people-inkp-rose.svg');
}

.esg-pillar__icon--governance {
  background-image: url('https://assets.cmcinvest.com/invest-sg/icon-politics-inkp-rose.svg');
}

.esg-pillar h3 {
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 700;
  margin-bottom: 10px;
}

.esg-pillar > p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text-light);
  margin-bottom: 20px;
}

.esg-pillar ul {
  font-size: 14px;
  line-height: 1.5;
}

.esg-pillar ul li {
  padding: 8px 0;
  border-bottom: 2px solid var(--color-accent);
}

.esg-pillar ul li:last-child {
  border-bottom: none;
}

/* Ratings */
.esg-ratings__header {
  max-width: 800px;
  margin: 0 auto 48px;
  text-align: center;
}

.esg-ratings__header p {
  font-size: 17px;
  line-height: 1.75;
  color: var(--color-text-light);
}

.esg-ratings__inner {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 48px;
  align-items: start;
}

.esg-ratings__phone {
  background-image: url('https://assets.cmcinvest.com/invest-sg/iphone-esg-dark.png');
  background-size: contain;
  background-position: center top;
  background-repeat: no-repeat;
  padding-bottom: 172%;
  position: relative;
}

.esg-ratings__phone::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: var(--color-accent);
  display: none;
}

.esg-ratings__content h3 {
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 700;
  margin-bottom: 12px;
}

.esg-ratings__content h3 + h3 {
  margin-top: 28px;
}

.esg-ratings__content p {
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-text-light);
}

.esg-ratings__content ul {
  list-style: disc;
  padding-left: 20px;
  margin: 16px 0;
}

.esg-ratings__content li {
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text-light);
  margin-bottom: 8px;
}

.esg-ratings__content .esg-ratings__closing {
  margin-top: 16px;
  color: var(--color-text);
}

/* Why invest cards */
.esg-why__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
}

.esg-why__card {
  background: var(--color-white);
  color: var(--color-text);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  text-align: center;
}

.esg-why__card img {
  height: 70px;
  width: auto;
  margin: 0 auto 16px;
}

.esg-why__card h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.esg-why__card p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--color-text-light);
}

/* Top-rated stocks */
.esg-stocks__intro {
  max-width: 800px;
  margin: 0 auto 40px;
  text-align: center;
  font-size: 17px;
  line-height: 1.75;
  color: var(--color-text-light);
}

.esg-stocks-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

.esg-stock-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #e8ebf2;
  background: var(--color-white);
}

.esg-stock-card__logo {
  width: 80px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
}

.esg-stock-card__info {
  flex: 1;
  min-width: 0;
}

.esg-stock-card__code {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
}

.esg-stock-card__name {
  font-size: 13px;
  color: var(--color-text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.esg-stock-card__chart {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.esg-stock-card__sparkline {
  width: 48px;
  height: 20px;
}

.esg-stock-card__change {
  font-size: 15px;
  font-weight: 700;
  font-family: ui-monospace, monospace;
  color: var(--color-text);
}

/* Learn cards */
.esg-learn__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.esg-learn__card {
  position: relative;
  display: block;
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: var(--color-white);
  min-height: 360px;
}

.esg-learn__card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.esg-learn__card-title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 24px 24px 32px;
  font-size: clamp(22px, 2.5vw, 28px);
  font-weight: 800;
  line-height: 1.15;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent);
}

.esg-learn__card:hover {
  color: var(--color-white);
}

/* FAQ */
.esg-faq__subtitle {
  text-align: center;
  font-size: 16px;
  color: var(--color-text-light);
  margin-top: -12px;
  margin-bottom: 40px;
}

.esg-faq__list {
  max-width: 900px;
  margin: 0 auto;
}

.esg-faq__item {
  border-bottom: 1px solid #e0e4ed;
}

.esg-faq__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 20px 40px 20px 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  text-align: left;
  position: relative;
  cursor: pointer;
}

.esg-faq__question img {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  transition: transform var(--transition);
}

.esg-faq__item.is-open .esg-faq__question img {
  transform: translateY(-50%) rotate(180deg);
}

.esg-faq__answer {
  display: none;
  padding: 0 0 20px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--color-text-light);
}

.esg-faq__item.is-open .esg-faq__answer {
  display: block;
}

/* Pre-footer CTA */
.esg-prefooter {
  background: var(--color-primary);
  color: var(--color-white);
  padding: 24px 0;
}

.esg-prefooter__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.esg-prefooter__icon {
  width: 70px;
  flex-shrink: 0;
}

.esg-prefooter__text {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  line-height: 1.2;
}

.esg-prefooter__badges {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.esg-prefooter__badges img {
  width: 135px;
}

/* Responsive */
@media (max-width: 1024px) {
  .esg-pillars__grid,
  .esg-why__grid,
  .esg-learn__grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }

  .esg-stocks-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .esg-ratings__inner {
    grid-template-columns: 1fr;
  }

  .esg-ratings__phone {
    max-width: 300px;
    margin: 0 auto;
    padding-bottom: 125%;
  }

  .esg-ratings__phone::after {
    display: block;
  }
}

@media (max-width: 768px) {
  .esg-hero::after {
    display: none;
  }

  .esg-hero__inner {
    max-width: 100%;
    text-align: center;
  }

  .esg-hero__mobile-image {
    display: block;
  }

  .esg-section {
    padding: 60px 0;
  }

  .esg-stocks-grid {
    grid-template-columns: 1fr;
  }

  .esg-prefooter__inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .esg-stock-card__logo {
    width: 60px;
    height: 44px;
  }
}
