/* SDG goal pages (page-tdd-sdg.php). Brand colours from the logo: --td-blue #153994, --td-gold #fba10a.
   --sdg (official goal colour) is used only for the SDG tile. */
.page-wrapper:has(.tdd-sdg) { padding: 0; }

.tdd-sdg {
  --td-blue: #153994;
  --td-blue-dark: #0e2a75;
  --td-gold: #fba10a;
  --sdg-ink: #1d1d1f;
  --sdg-text: #3b3b3f;
  --sdg-muted: #6b6b72;
  --sdg-line: #e3e3e6;
  --sdg-soft: #f4f4f5;
  color: var(--sdg-text);
  background: #fff;
  font-size: 15px;
  line-height: 1.7;
  overflow: hidden;
}
.tdd-sdg *, .tdd-sdg *::before, .tdd-sdg *::after { box-sizing: border-box; }
.tdd-sdg [hidden] { display: none !important; }
.tdd-sdg img { display: block; max-width: 100%; height: auto; }
.tdd-sdg a { color: inherit; text-decoration: none; }
.tdd-sdg h1, .tdd-sdg h2, .tdd-sdg h3 { font-family: inherit; letter-spacing: 0; color: inherit; margin: 0; }
.tdd-sdg a:focus-visible, .tdd-sdg button:focus-visible, .tdd-sdg select:focus-visible, .tdd-sdg summary:focus-visible {
  outline: 2px solid var(--td-blue);
  outline-offset: 3px;
}
.tdd-sdg__wrap { width: min(100% - 48px, 1200px); margin-inline: auto; position: relative; }
.tdd-sdg__icon { flex: none; }

/* Hero */
.tdd-sdg__hero {
  position: relative;
  min-height: clamp(320px, 38vw, 520px);
  display: flex;
  align-items: center;
  color: #fff;
  background: #1d2433;
  isolation: isolate;
}
.tdd-sdg__hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100% !important;
  object-fit: cover;
  z-index: -2;
}
.tdd-sdg__hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(10, 14, 24, .78) 0%, rgba(10, 14, 24, .45) 45%, rgba(10, 14, 24, .05) 80%);
}
.tdd-sdg__hero-copy { padding-block: 56px; }
.tdd-sdg__crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: rgba(255, 255, 255, .78); margin-bottom: 18px; }
.tdd-sdg__crumbs a:hover { color: #fff; text-decoration: underline; }
.tdd-sdg .tdd-sdg__hero-title { display: flex; flex-direction: column; gap: 4px; font-weight: 800; line-height: 1.08; text-shadow: 0 2px 18px rgba(0, 0, 0, .35); }
.tdd-sdg__hero-num { font-size: clamp(36px, 5vw, 64px); color: #fff; text-transform: uppercase; }
.tdd-sdg__hero-name { font-size: clamp(30px, 4.4vw, 56px); color: var(--td-gold); max-width: 16ch; }
.tdd-sdg__hero-en { margin: 16px 0 0; font-size: 15px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .85); }

/* Section label: coloured box like the goal tile */
.tdd-sdg .tdd-sdg__label {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 28px;
  padding: 8px 26px 8px 22px;
  background: var(--td-blue);
  border-left: 6px solid var(--td-gold);
  color: #fff;
  font-size: clamp(19px, 2vw, 23px);
  font-weight: 500;
  line-height: 1.35;
  text-transform: uppercase;
}

/* Intro: grey band with a white diagonal on the right */
.tdd-sdg__intro { position: relative; padding: 64px 0 72px; background: var(--sdg-soft); }
.tdd-sdg__intro::before {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: 38%;
  background: #fff;
  clip-path: polygon(22% 0, 100% 0, 100% 100%, 0 100%);
}
.tdd-sdg__intro-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(28px, 4vw, 56px); align-items: center; }
.tdd-sdg__slogan { margin: 0 0 18px; font-weight: 700; color: var(--sdg-ink); font-size: 15px; line-height: 1.6; }
.tdd-sdg__prose > :last-child { margin-bottom: 0; }
.tdd-sdg__prose p { margin: 0 0 14px; text-align: justify; }
.tdd-sdg__prose a { color: var(--td-blue); text-decoration: underline; text-underline-offset: 2px; }
.tdd-sdg__prose ul, .tdd-sdg__prose ol { margin: 0 0 14px 1.3em; }
.tdd-sdg__prose table { width: 100%; border-collapse: collapse; margin: 0 0 14px; font-size: 14px; }
.tdd-sdg__prose th, .tdd-sdg__prose td { border: 1px solid var(--sdg-line); padding: 8px 10px; text-align: left; }
.tdd-sdg__prose th { background: var(--sdg-soft); color: var(--sdg-ink); }
.tdd-sdg__prose img { margin-block: 8px; }
/* Trích dẫn/link tham khảo (vd "Xem thêm về SDG5 (UN)") nhỏ hơn đoạn văn chính; Flatsome để blockquote 1.2em. */
.tdd-sdg__prose blockquote { margin: 0 0 14px; padding: 2px 0 2px 14px; font-size: 13px; line-height: 1.6; color: var(--sdg-muted); }
.tdd-sdg__prose blockquote p { margin-bottom: 4px; text-align: left; }
.tdd-sdg__prose blockquote a { overflow-wrap: anywhere; }
.tdd-sdg__tile {
  position: relative;
  margin: 0;
  background: var(--sdg);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, .45);
}
.tdd-sdg__tile img { position: absolute; inset: 0; margin: auto; width: auto; height: 100% !important; max-width: 100%; object-fit: contain; }

/* Generic sections */
.tdd-sdg__section { padding: 72px 0 0; }
.tdd-sdg__content { padding-top: 56px; }

/* Filters */
.tdd-sdg__filter { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; font-size: 14px; color: var(--sdg-muted); }
.tdd-sdg__filter--center, .tdd-sdg__filter--news { justify-content: center; }
.tdd-sdg__filter label { margin: 0; font-weight: 500; color: var(--sdg-muted); font-size: 14px; }
.tdd-sdg__select { position: relative; display: inline-flex; align-items: center; }
.tdd-sdg .tdd-sdg__select select {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  height: 40px;
  min-width: 140px;
  padding: 0 38px 0 14px;
  border: 1px solid #cfcfd4;
  border-radius: 10px;
  transition: border-color .2s, box-shadow .2s;
  background: #fff;
  box-shadow: none;
  font: inherit;
  font-size: 14px;
  color: var(--sdg-ink);
  cursor: pointer;
}
.tdd-sdg .tdd-sdg__filter--news select { min-width: 220px; }
.tdd-sdg .tdd-sdg__select select:hover { border-color: #a9b3c6; }
.tdd-sdg .tdd-sdg__select select:focus { outline: none; border-color: var(--td-blue); box-shadow: 0 0 0 3px rgb(21 57 148 / 15%); }
.tdd-sdg__select .tdd-sdg__icon { position: absolute; right: 12px; pointer-events: none; color: var(--sdg-muted); }

/* Accordion */
.tdd-sdg__accordion { border-top: 1px solid var(--sdg-line); }
.tdd-sdg__item { border-bottom: 1px solid var(--sdg-line); }
.tdd-sdg__item summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 4px;
  cursor: pointer;
  font-size: clamp(16px, 1.6vw, 18px);
  font-weight: 600;
  color: var(--sdg-ink);
  line-height: 1.45;
}
.tdd-sdg__item summary::-webkit-details-marker { display: none; }
.tdd-sdg__item summary:hover { color: var(--td-blue); }
.tdd-sdg__item summary .tdd-sdg__icon { width: 20px; height: 20px; color: var(--td-gold); transition: transform .25s ease; }
.tdd-sdg__item[open] summary .tdd-sdg__icon { transform: rotate(45deg); }
.tdd-sdg__item-body { padding: 0 4px 24px 12px; font-size: 14px; }

/* Programs */
.tdd-sdg__program-list { columns: 2; column-gap: 56px; margin: 0; padding: 0 0 0 1.6em; font-size: 14px; }
.tdd-sdg__program-list li { break-inside: avoid; margin: 0 0 12px; padding-left: 4px; }
.tdd-sdg__program-list li::marker { color: var(--sdg-muted); }
.tdd-sdg__program-list a { display: inline-flex; align-items: center; gap: 8px; }
.tdd-sdg__program-list a:hover { color: var(--td-blue); }
.tdd-sdg__program-list .tdd-sdg__icon { width: 14px; height: 14px; }

/* News: grey diagonal background */
.tdd-sdg__news { position: relative; margin-top: 80px; padding: 72px 0 80px; }
.tdd-sdg__news::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--sdg-soft);
  clip-path: polygon(50% 0, 100% 0, 100% 100%, 0 100%, 0 32%);
}
.tdd-sdg .tdd-sdg__news-title {
  width: max-content;
  margin: 0 auto 28px;
  padding-bottom: 6px;
  border-bottom: 3px solid var(--td-gold);
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 500;
  text-transform: uppercase;
  color: var(--sdg-ink);
}
.tdd-sdg__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 28px; margin-top: 12px; }
.tdd-sdg__grid.is-loading { opacity: .45; pointer-events: none; transition: opacity .2s; }
.tdd-sdg__card a { display: flex; flex-direction: column; height: 100%; }
.tdd-sdg__card-media { aspect-ratio: 16 / 10; overflow: hidden; background: #e7e7ea; }
.tdd-sdg__card-img { width: 100%; height: 100% !important; object-fit: cover; transition: transform .45s ease; }
.tdd-sdg__card a:hover .tdd-sdg__card-img { transform: scale(1.05); }
.tdd-sdg__card-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 13px; font-weight: 600; color: var(--td-blue); }
.tdd-sdg__card-meta .tdd-sdg__icon { color: var(--sdg-ink); transition: transform .2s; }
.tdd-sdg__card a:hover .tdd-sdg__card-meta .tdd-sdg__icon { transform: translate(2px, -2px); }
.tdd-sdg .tdd-sdg__card-title {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--sdg-ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tdd-sdg__card a:hover .tdd-sdg__card-title { color: var(--td-blue); }
.tdd-sdg__card-bar { display: block; width: 52px; height: 3px; margin-top: auto; padding-top: 0; background: var(--td-gold); position: relative; top: 16px; transition: width .3s ease; }
.tdd-sdg__card a:hover .tdd-sdg__card-bar { width: 96px; }
.tdd-sdg__empty { text-align: center; color: var(--sdg-muted); margin: 24px 0 0; }
.tdd-sdg__more-wrap { display: flex; justify-content: center; margin-top: 56px; }
.tdd-sdg .tdd-sdg__more {
  display: inline-flex;
  align-items: stretch;
  margin: 0;
  padding: 0;
  min-height: 0;
  border: 1px solid var(--td-blue);
  border-radius: 0;
  background: var(--td-blue);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1;
  box-shadow: none;
  cursor: pointer;
}
.tdd-sdg__more > span:first-child { padding: 14px 26px; }
.tdd-sdg__more-icon { display: grid; place-items: center; width: 44px; background: #fff; color: var(--sdg-ink); transition: background .2s, color .2s; }
.tdd-sdg .tdd-sdg__more:hover .tdd-sdg__more-icon { background: var(--td-gold); color: #fff; }
.tdd-sdg .tdd-sdg__more:hover { background: var(--td-blue-dark); border-color: var(--td-blue-dark); }
.tdd-sdg .tdd-sdg__more[aria-busy="true"] { opacity: .6; cursor: progress; }
.tdd-sdg__news > .tdd-sdg__wrap { z-index: 1; }

/* Hint only editors see */
.tdd-sdg__hint { margin: 0; padding: 14px 16px; border: 1px dashed #b9b9c0; background: #fff; color: var(--sdg-muted); font-size: 13px; }
.tdd-sdg__hint a { color: var(--td-blue); text-decoration: underline; }

/* Reveal on scroll */
.tdd-sdg.is-animated [data-sdg-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.tdd-sdg.is-animated [data-sdg-reveal].is-in { opacity: 1; transform: none; }

@media (max-width: 1023px) {
  .tdd-sdg__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 849px) {
  .tdd-sdg__intro-grid { grid-template-columns: 1fr; }
  .tdd-sdg__intro::before { display: none; }
  .tdd-sdg__program-list { columns: 1; }
  .tdd-sdg__section { padding-top: 56px; }
  .tdd-sdg__news { margin-top: 56px; padding: 56px 0 64px; }
}
@media (max-width: 549px) {
  .tdd-sdg__wrap { width: calc(100% - 32px); }
  .tdd-sdg__hero-copy { padding-block: 40px; }
  .tdd-sdg__intro { padding: 44px 0 52px; }
  .tdd-sdg__grid { grid-template-columns: 1fr; gap: 36px; }
  .tdd-sdg .tdd-sdg__filter--news select { min-width: 0; width: 100%; }
  .tdd-sdg__filter--news .tdd-sdg__select { flex: 1 1 100%; }
  .tdd-sdg .tdd-sdg__label { padding: 7px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .tdd-sdg *, .tdd-sdg *::before, .tdd-sdg *::after { transition: none !important; }
  .tdd-sdg.is-animated [data-sdg-reveal] { opacity: 1; transform: none; }
}
