/* ==========================================================================
   ESG page expression.

   Read from ref/ESG.jpeg, not from Home / Careers / Services.
   The reference language is flat and square:
     - no cards, no shadows, no radius
     - full-bleed image fields with type set directly on the image
     - hairline rules between items, short trailing rules on actions
     - one solid brand-colour chapter field with faint technical linework
   Nothing on this page inherits .media-placeholder, .service-item,
   .button-link or the pill actions used elsewhere in the prototype.
   Written mobile-first: base rules are the 360-430px composition.

   Block order follows content v2.1 section 7:
     7.1 hero · 7.2 environment (chapter) · 7.3 energy (ruled columns)
     7.4 social and safety (chapter, right) · 7.5 governance (brand field)
     7.6 compliance (numbered rows) · 7.7 indicators and documents · 7.8 CTA
   ========================================================================== */

.esg-page {
  --esg-gutter: 20px;
  --esg-space: 64px;
  --esg-rule: rgb(23 25 40 / .16);
  --esg-tint: #f2f5f8;
  background: var(--surface);
}

.esg-page .desktop-nav a[aria-current="page"]::after { transform: scaleX(1); }


/* --------------------------------------------------------------------------
   Photo fields. Square corners, no inset ring, no radius.
   -------------------------------------------------------------------------- */

.esg-ph {
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-radius: 0;
  background: #c3d2dd;
}

.esg-ph--fill { position: absolute; inset: 0; }

.esg-ph--field { background-color: #3d5a6d; }
.esg-ph--chapter { background-color: #33526a; }
.esg-ph--community { background-color: #2f4a56; }
.esg-ph--governance-detail { background-color: #4a6c8e; }


/* --------------------------------------------------------------------------
   Shared editorial marks
   -------------------------------------------------------------------------- */

.esg-lede {
  max-width: 60ch;
  margin: 0 0 34px;
  color: var(--muted);
}


/* --------------------------------------------------------------------------
   7.1 Hero: full-bleed environment field
   -------------------------------------------------------------------------- */

.esg-hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100svh;
  padding-block: calc(var(--header-height) + 40px) 96px;
  overflow: hidden;
  color: #fff;
}

.esg-hero__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgb(17 16 74 / .56) 0%, rgb(17 16 74 / .24) 34%, rgb(17 16 74 / .66) 100%),
    linear-gradient(90deg, rgb(17 16 74 / .56) 0%, transparent 78%);
}

.esg-hero__inner { position: relative; z-index: 2; }

.esg-hero__kicker {
  margin: 0 0 20px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: rgb(255 255 255 / .84);
}

.esg-hero h1 {
  max-width: 15ch;
  margin: 0;
  font-family: "Biennale", "Helvetica Neue", sans-serif;
  font-size: clamp(38px, 10.5vw, 96px);
  line-height: 1.02;
  letter-spacing: -.02em;
}

.esg-hero__intro {
  max-width: 62ch;
  margin: 28px 0 0;
  color: rgb(255 255 255 / .92);
  font-size: 15px;
  line-height: 1.68;
}

.esg-scroll {
  position: absolute;
  z-index: 2;
  right: var(--esg-gutter);
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: rgb(255 255 255 / .72);
}

.esg-scroll__word {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .3em;
  writing-mode: vertical-rl;
}

.esg-scroll__rule { width: 1px; height: 52px; background: linear-gradient(180deg, rgb(255 255 255 / .7), transparent); }


/* --------------------------------------------------------------------------
   Chapter band (7.2, 7.4): type set directly onto a full-bleed field
   -------------------------------------------------------------------------- */

.esg-chapter {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 88svh;
  padding-block: 92px;
  overflow: hidden;
  color: #fff;
}

/* Long Thai copy sits on the photo, so the veil is darker than a pure
   decorative wash: every line must stay readable over the brightest sky. */
.esg-chapter__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgb(17 16 74 / .5) 0%, rgb(17 16 74 / .7) 100%),
    linear-gradient(90deg, rgb(17 16 74 / .62) 0%, rgb(17 16 74 / .18) 82%);
}

.esg-chapter--right .esg-chapter__veil {
  background:
    linear-gradient(180deg, rgb(17 16 74 / .5) 0%, rgb(17 16 74 / .7) 100%),
    linear-gradient(270deg, rgb(17 16 74 / .62) 0%, rgb(17 16 74 / .18) 82%);
}

.esg-chapter__inner { position: relative; z-index: 2; }

.esg-chapter__copy { max-width: min(100%, 700px); }

.esg-chapter h2 {
  margin: 0 0 22px;
  font-family: "Biennale", "Helvetica Neue", sans-serif;
  font-size: clamp(30px, 7.4vw, 58px);
  line-height: 1.08;
  letter-spacing: -.02em;
}

.esg-chapter p {
  margin: 0 0 10px;
  color: rgb(255 255 255 / .92);
  font-size: 15px;
  line-height: 1.68;
}

/* 7.4 community activity: one ruled item under the body copy. */
.esg-community {
  margin: 26px 0 0;
  padding: 18px 0 8px;
  border-top: 1px solid rgb(255 255 255 / .3);
  border-bottom: 1px solid rgb(255 255 255 / .3);
}

.esg-community__title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
}

/* Faint technical linework, read from the reference chapter fields. */
.esg-linework {
  position: absolute;
  z-index: 1;
  right: -14%;
  bottom: -6%;
  width: 92%;
  max-width: 620px;
  fill: none;
  stroke: rgb(255 255 255 / .2);
  stroke-width: 1;
  pointer-events: none;
}

.esg-linework circle { fill: none; }
.esg-linework--light { right: auto; left: -10%; top: -8%; bottom: auto; stroke: rgb(255 255 255 / .18); }


/* --------------------------------------------------------------------------
   Points (7.2, 7.3): title and body separated by hairline rules
   -------------------------------------------------------------------------- */

.esg-points {
  margin: 0;
  padding: 0;
  list-style: none;
}

.esg-point {
  padding: 18px 0;
  border-top: 1px solid var(--esg-rule);
}

.esg-point__num {
  display: block;
  margin-bottom: 12px;
  color: var(--infra-blue);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
}

.esg-point__title {
  margin: 0 0 6px;
  color: var(--tank-blue);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
}

.esg-point__body {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.62;
}

.esg-points--light { margin-top: 8px; }
.esg-points--light .esg-point { padding: 16px 0; border-top-color: rgb(255 255 255 / .28); }
.esg-points--light .esg-point:last-child { border-bottom: 1px solid rgb(255 255 255 / .28); }
.esg-points--light .esg-point__title { color: #fff; }
.esg-chapter .esg-points--light .esg-point__body { margin: 0; color: rgb(255 255 255 / .9); }

.esg-points--cols { margin-top: 34px; }

.esg-closing-note {
  max-width: 64ch;
  margin: 30px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--esg-rule);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.62;
}


/* --------------------------------------------------------------------------
   7.5 Governance: solid brand field, image bleeding past the shell
   -------------------------------------------------------------------------- */

.esg-governance {
  position: relative;
  padding-block: var(--esg-space) 0;
  overflow: hidden;
  background: var(--infra-blue);
  color: #fff;
}

.esg-governance__grid { position: relative; z-index: 2; }

.esg-governance h2 {
  margin: 0 0 20px;
  font-family: "Biennale", "Helvetica Neue", sans-serif;
  font-size: clamp(30px, 7.4vw, 56px);
  line-height: 1.06;
  letter-spacing: -.02em;
}

.esg-governance__copy > p {
  margin: 0;
  max-width: 52ch;
  color: rgb(255 255 255 / .92);
  font-size: 15px;
  line-height: 1.68;
}

.esg-governance__list {
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}

.esg-governance__list li { border-top: 1px solid rgb(255 255 255 / .3); }
.esg-governance__list li:last-child { border-bottom: 1px solid rgb(255 255 255 / .3); }

.esg-policy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
}

.esg-policy__arrow { flex: none; transition: transform .25s var(--ease); }
.esg-policy:hover .esg-policy__arrow { transform: translateX(4px); }

.esg-governance__media {
  position: relative;
  margin: 44px calc(var(--esg-gutter) * -1) 0 24px;
  aspect-ratio: 5 / 4;
  overflow: hidden;
}


/* --------------------------------------------------------------------------
   Row sections (7.3, 7.6, 7.7). Hairline rules only. No containers.
   -------------------------------------------------------------------------- */

.esg-rows-section { padding-block: var(--esg-space); background: var(--surface); }
.esg-rows-section--tint { background: var(--esg-tint); }

.esg-rows-section h2 {
  margin: 0 0 18px;
  color: var(--tank-blue);
  font-family: "Biennale", "Helvetica Neue", sans-serif;
  font-size: clamp(28px, 6.8vw, 48px);
  line-height: 1.06;
  letter-spacing: -.02em;
}

/* 7.6 licence list */
.esg-licences { margin: 0; padding: 0; list-style: none; }

.esg-licence {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: baseline;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--esg-rule);
}

.esg-licences .esg-licence:last-child { border-bottom: 1px solid var(--esg-rule); }

.esg-licence__num {
  color: var(--infra-blue);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
}

.esg-licence__text {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
}

/* 7.7 indicators: three cells, value above its label */
.esg-kpis {
  display: grid;
  margin: 30px 0 0;
}

.esg-kpi {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 0;
  border-top: 1px solid var(--esg-rule);
}

.esg-kpi__value {
  order: -1;
  margin: 0;
  color: var(--tank-blue);
  font-family: "Biennale", "Helvetica Neue", sans-serif;
  font-size: clamp(30px, 7vw, 44px);
  line-height: 1.08;
  letter-spacing: -.02em;
}

.esg-kpi__unit {
  font-size: 18px;
  letter-spacing: 0;
  white-space: nowrap;
}

.esg-kpi__label {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

/* 7.7 documents */
.esg-docs { margin: 34px 0 0; padding: 0; list-style: none; }
.esg-docs li { border-top: 1px solid var(--esg-rule); }
.esg-docs li:last-child { border-bottom: 1px solid var(--esg-rule); }

.esg-doc {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 0;
}

.esg-doc__name {
  color: var(--tank-blue);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

.esg-doc__arrow { flex: none; color: var(--infra-blue); transition: transform .25s var(--ease); }
.esg-doc:hover .esg-doc__arrow { transform: translateX(4px); }


/* --------------------------------------------------------------------------
   7.8 Closing action: a ruled text action, not a pill
   -------------------------------------------------------------------------- */

.esg-closing {
  padding-block: var(--esg-space);
  border-top: 1px solid var(--esg-rule);
  background: var(--surface);
}

.esg-closing h2 {
  margin: 0 0 14px;
  color: var(--tank-blue);
  font-family: "Biennale", "Helvetica Neue", sans-serif;
  font-size: clamp(28px, 7vw, 50px);
  line-height: 1.06;
  letter-spacing: -.02em;
}

.esg-closing p { margin: 0; max-width: 48ch; color: var(--muted); }

.esg-action {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
  padding: 14px 0;
  color: var(--infra-blue);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.esg-action--light { margin-top: 22px; color: #fff; }

.esg-action__rule {
  width: 52px;
  height: 1px;
  background: currentColor;
  transition: width .3s var(--ease);
}

.esg-action:hover .esg-action__rule { width: 78px; }


/* --------------------------------------------------------------------------
   Thai optical tuning
   -------------------------------------------------------------------------- */

html[data-language="th"] .esg-hero h1,
html[data-language="th"] .esg-chapter h2,
html[data-language="th"] .esg-governance h2,
html[data-language="th"] .esg-rows-section h2,
html[data-language="th"] .esg-closing h2,
html[data-language="th"] .esg-kpi__value {
  font-family: "DB Helvethaica X", "Noto Sans Thai", Tahoma, sans-serif;
  letter-spacing: 0;
}

/* The Thai H1 is one phrase with no spaces, so the measure is opened up and
   the size kept to what fits the shell at each width. */
html[data-language="th"] .esg-hero h1 { max-width: none; font-size: clamp(34px, 6.2vw, 84px); line-height: 1.08; }
html[data-language="th"] .esg-chapter h2 { font-size: clamp(34px, 8.2vw, 64px); line-height: 1.12; }
html[data-language="th"] .esg-governance h2 { font-size: clamp(34px, 8.2vw, 62px); line-height: 1.12; }
html[data-language="th"] .esg-rows-section h2 { font-size: clamp(32px, 7.6vw, 54px); line-height: 1.12; }
html[data-language="th"] .esg-closing h2 { font-size: clamp(32px, 7.8vw, 56px); line-height: 1.12; }
html[data-language="th"] .esg-kpi__value { font-size: clamp(34px, 7.6vw, 48px); line-height: 1.1; }
html[data-language="th"] .esg-kpi__unit { font-size: var(--th-lead); }

html[data-language="th"] .esg-hero__intro,
html[data-language="th"] .esg-chapter p,
html[data-language="th"] .esg-governance__copy > p,
html[data-language="th"] .esg-lede,
html[data-language="th"] .esg-closing p,
html[data-language="th"] .esg-closing-note {
  font-family: "TH Sarabun New", "Noto Sans Thai", Tahoma, sans-serif;
  font-size: var(--th-body);
  line-height: 1.5;
}

html[data-language="th"] .esg-point__body,
html[data-language="th"] .esg-chapter .esg-points--light .esg-point__body,
html[data-language="th"] .esg-kpi__label {
  font-family: "TH Sarabun New", "Noto Sans Thai", Tahoma, sans-serif;
  font-size: var(--th-body-sm);
  line-height: 1.45;
}

html[data-language="th"] .esg-point__title,
html[data-language="th"] .esg-community__title,
html[data-language="th"] .esg-doc__name,
html[data-language="th"] .esg-policy {
  font-family: "DB Helvethaica X", "Noto Sans Thai", Tahoma, sans-serif;
  font-size: var(--th-lead);
  line-height: 1.2;
}

html[data-language="th"] .esg-licence__text {
  font-family: "TH Sarabun New", "Noto Sans Thai", Tahoma, sans-serif;
  font-size: var(--th-body-sm);
  line-height: 1.4;
}

/* Thai does not take Latin tracking. Small labels drop back to normal spacing. */
html[data-language="th"] .esg-hero__kicker {
  font-family: "TH Sarabun New", "Noto Sans Thai", Tahoma, sans-serif;
  font-size: var(--eyebrow-size-th);
  letter-spacing: .02em;
  text-transform: none;
}

html[data-language="th"] .esg-action { font-family: "TH Sarabun New", sans-serif; font-size: var(--th-action); letter-spacing: 0; text-transform: none; }


/* --------------------------------------------------------------------------
   Tablet
   -------------------------------------------------------------------------- */

@media (min-width: 720px) {
  .esg-page { --esg-space: 92px; }

  .esg-hero h1 { font-size: clamp(64px, 9vw, 96px); }
  .esg-hero__kicker { font-size: 12px; }

  .esg-hero__intro,
  .esg-chapter p,
  .esg-governance__copy > p,
  .esg-point__body { font-size: 16px; }

  .esg-governance__media { margin: 56px calc((100vw - var(--shell)) / -2) 0 60px; aspect-ratio: 16 / 9; }

}


/* --------------------------------------------------------------------------
   Desktop
   -------------------------------------------------------------------------- */

@media (min-width: 1024px) {
  .esg-page { --esg-gutter: 0px; --esg-space: 128px; }

  .esg-hero { padding-block: calc(var(--header-height) + 60px) 120px; }
  .esg-hero__kicker { margin-bottom: 26px; }
  .esg-hero h1 { max-width: 16ch; }
  .esg-scroll { right: max(28px, calc((100vw - var(--shell)) / 2 - 44px)); }

  .esg-chapter--right .esg-chapter__inner { display: flex; justify-content: flex-end; }

  .esg-points--cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 40px;
  }
  .esg-points--cols .esg-point { padding-top: 24px; }

  .esg-governance { padding-bottom: 0; }
  .esg-governance__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
    gap: 72px;
  }
  .esg-governance__copy { padding-bottom: var(--esg-space); }
  .esg-governance__media {
    margin: 0 calc((100vw - var(--shell)) / -2) 0 0;
    aspect-ratio: auto;
    min-height: 460px;
  }

  .esg-rows-section h2 { max-width: 22ch; }
  html[data-language="th"] .esg-rows-section h2 { max-width: none; }

  .esg-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 32px; }
  .esg-kpi { padding: 24px 0 4px; }
  .esg-lede { font-size: 17px; }

  .esg-licences {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 48px;
  }
  .esg-licences .esg-licence:nth-last-child(2) { border-bottom: 1px solid var(--esg-rule); }

  .esg-closing__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 56px;
  }
  .esg-closing .esg-action { margin-top: 0; }
}


/* --------------------------------------------------------------------------
   Motion preference
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .esg-policy__arrow,
  .esg-doc__arrow,
  .esg-action__rule { transition: none; }
}
