/* ============================================================
   Sustain – Economic Material Topics
   Widget: sustain-economic-topics
   Section #suec-topics from economic-dimension/index.html:
   soft-blue section → section head → dark navy panel → 3-col photo cards.
   ============================================================ */

.custom-sustain-economic-topics {
  width: 100%;
}

.custom-sustain-economic-topics__inner {
  max-width: 1920px;
  margin-inline: auto;
}

/* ============================================================
   01 · SECTION HEAD
   h2 + lead paragraph above the dark panel.
   ============================================================ */

.custom-sustain-economic-topics__head {
  margin-bottom: clamp(28px, 3vw, 44px);
}

.custom-sustain-economic-topics__title {
  margin: 0 0 clamp(14px, 1.8vw, 22px);
  font-size: min(clamp(28px, 3.9vw, 56px), 6.2svh);
  font-weight: 600;
  line-height: 1.3;
  color: var(--navy, #16418C);
}

/* em inside the section title renders in red (design: em.red). */
.custom-sustain-economic-topics__title em {
  position: relative;
  display: inline-block;
  font-style: italic;
  color: var(--cp-red, #CE2929);
}

/* app.css:250-253 — the same soft bar that .h-sec em uses site-wide. */
.custom-sustain-economic-topics__title em::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.06em;
  height: 0.16em;
  border-radius: 3px;
  background: currentColor;
  opacity: 0.18;
}

.custom-sustain-economic-topics__lead {
  max-width: 870px;
  margin-inline: auto;
  font-size: clamp(16px, 1.25vw, 18px);
  font-weight: 400;
  line-height: 1.7;
  color: var(--g700, #475569);
}

/* ============================================================
   02 · THE PANEL
   Dark navy box with three brand-colour radial lights.
   position/isolation/overflow are load-bearing — the ::before
   light wash is an inset:0 absolute at z-index -1, so the panel
   must be the stacking context that keeps it behind the cards.
   ============================================================ */

.custom-sustain-economic-topics__panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--navy-darker, #0E1E54);
  border-radius: 50px 0 50px 0;
}

/* Three brand-colour lights: blue from the left, green rising
   from the floor, red from the right. Alphas are held low so
   the white type sits cleanly on the dark ground. */
.custom-sustain-economic-topics__panel::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(46% 130% at 2% -14%, rgba(80, 163, 213, .30), transparent 100%),
    radial-gradient(44% 120% at 52% 118%, rgba(92, 161, 63, .20), transparent 100%),
    radial-gradient(44% 130% at 100% -12%, rgba(206, 41, 41, .20), transparent 100%);
  pointer-events: none;
}

/* ============================================================
   03 · PANEL HEADING ROW
   Title text — decorative hairline taking up the remaining slack.
   ============================================================ */

.custom-sustain-economic-topics__panel-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: clamp(18px, 2vw, 28px);
}

.custom-sustain-economic-topics__panel-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  color: #fff;
  white-space: nowrap;
}

.custom-sustain-economic-topics__rule {
  flex: 1 1 auto;
  height: 1px;
  background: rgba(255, 255, 255, .18);
}

/* ============================================================
   04 · CARD GRID
   Three columns, responsive down to two then one.
   ============================================================ */

.custom-sustain-economic-topics__grid {
  list-style: none;
  margin: 0 !important;
  padding: 0 !important;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 1.6vw, 22px);
}

/* ============================================================
   05 · CARD SHELL
   Full-bleed photograph, mirrored curl (0 curl / curl 0),
   white type over a bottom-up scrim, and an accent-green
   overlay that comes up on hover.
   ============================================================ */

.custom-sustain-economic-topics__card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  aspect-ratio: 4 / 3;
  padding: clamp(20px, 2.2vw, 28px);
  border-radius: 0 50px;
  border: 1px solid rgba(255, 255, 255, .18);
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform .4s cubic-bezier(.2,.8,.2,1),
    border-color .4s cubic-bezier(.2,.8,.2,1),
    box-shadow .4s cubic-bezier(.2,.8,.2,1);
}

/* Photo — full-bleed, slight initial zoom so hover can open up.
   border-radius: inherit ensures the image itself is clipped to the card's
   curl corners — needed because transform: scale() bypasses overflow: hidden
   in Safari and some Chrome versions. */
.custom-sustain-economic-topics__img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100% !important;
  object-fit: cover;
  object-position: center center;
  display: block;
  border-radius: inherit;
  transform: scale(1.02);
  transition: transform .6s cubic-bezier(.2,.8,.2,1), filter .4s cubic-bezier(.2,.8,.2,1);
}

/* Bottom-up scrim — makes white type readable over any photograph. */
.custom-sustain-economic-topics__card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(14, 30, 84, .82) 0%,
    rgba(14, 30, 84, .62) 30%,
    rgba(14, 30, 84, .24) 56%,
    rgba(14, 30, 84, 0)   80%
  );
  transition: opacity .4s cubic-bezier(.2,.8,.2,1);
}

/* Accent-green overlay — rises on hover to tint the whole frame. */
.custom-sustain-economic-topics__card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    to top,
    color-mix(in srgb, var(--cp-green, #5CA13F) 82%, transparent) 0%,
    color-mix(in srgb, var(--cp-green, #5CA13F) 34%, transparent) 62%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity .4s cubic-bezier(.2,.8,.2,1);
}

/* Body — icon + name + "อ่านเพิ่มเติม", sits above both overlays. */
.custom-sustain-economic-topics__body {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Icon image — custom image uploaded per card. */
.custom-sustain-economic-topics__ico {
  display: block;
  width: 52px;
  height: 52px;
  object-fit: contain;
  object-position: center;
}

.custom-sustain-economic-topics__name {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.45;
  color: #fff;
}

.custom-sustain-economic-topics__go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.custom-sustain-economic-topics__go svg {
  width: 16px;
  height: 16px;
  transition: transform .4s cubic-bezier(.2,.8,.2,1);
}

/* ============================================================
   06 · HOVER STATES
   <a> cards: lift + picture opens + green overlay + arrow moves.
   <div> cards: no lift, cursor: default, lighter green tint.
   ============================================================ */

a.custom-sustain-economic-topics__card:hover,
a.custom-sustain-economic-topics__card:focus-visible {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--cp-green, #5CA13F) 62%, transparent);
  box-shadow: 0 20px 60px rgba(14, 30, 84, .35);
}

a.custom-sustain-economic-topics__card:hover .custom-sustain-economic-topics__img,
a.custom-sustain-economic-topics__card:focus-visible .custom-sustain-economic-topics__img {
  transform: scale(1.08);
  filter: saturate(1.05) brightness(1.04);
}

a.custom-sustain-economic-topics__card:hover::after,
a.custom-sustain-economic-topics__card:focus-visible::after {
  opacity: 1;
}

a.custom-sustain-economic-topics__card:hover .custom-sustain-economic-topics__go svg,
a.custom-sustain-economic-topics__card:focus-visible .custom-sustain-economic-topics__go svg {
  transform: translateX(4px);
}

div.custom-sustain-economic-topics__card {
  cursor: default;
}

div.custom-sustain-economic-topics__card:hover::after {
  opacity: .78;
}

div.custom-sustain-economic-topics__card:hover .custom-sustain-economic-topics__img {
  transform: scale(1.06);
  filter: saturate(1.05) brightness(1.04);
}

/* ============================================================
   07 · REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .custom-sustain-economic-topics__card,
  .custom-sustain-economic-topics__img,
  .custom-sustain-economic-topics__card::after,
  .custom-sustain-economic-topics__go svg {
    transition: none;
  }

  a.custom-sustain-economic-topics__card:hover {
    transform: none;
  }

  .custom-sustain-economic-topics__card:hover .custom-sustain-economic-topics__img {
    transform: scale(1.02);
  }
}

/* ============================================================
   09 · RESPONSIVE
   3-col → 2-col at ≤1024 → 1-col at ≤600.
   Single-column cards go shallower (16:10) so one card is not
   a full screen of photograph.
   ============================================================ */

@media (max-width: 1024px) {
  .custom-sustain-economic-topics__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .custom-sustain-economic-topics__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .custom-sustain-economic-topics__card {
    aspect-ratio: 16 / 10;
  }

  .custom-sustain-economic-topics__ico {
    width: 44px;
    height: 44px;
  }

  .custom-sustain-economic-topics__name {
    font-size: 18px;
  }

  .custom-sustain-economic-topics__panel-title {
    white-space: normal;
    font-size: 18px;
  }

  .custom-sustain-economic-topics__rule {
    display: none;
  }
}

