/* PPGL Chemical Sourcing Directory */
.chem-page {
  font-family: Inter, sans-serif;
}
.ch-hero {
  background: linear-gradient(120deg, #081523, #102e46);
  color: #fff;
  padding: 90px 0 88px;
  overflow: hidden;
}
.ch-hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 55px;
}
.ch-kicker {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
  color: #dba900;
}
.ch-hero h1 {
  font-size: clamp(40px, 4.7vw, 70px);
  line-height: 1.09;
  letter-spacing: -0.055em;
  margin: 20px 0;
}
.ch-hero h1 em {
  font-style: normal;
  color: #ffcd1a;
}
.ch-hero p {
  max-width: 600px;
  color: #d0dce7;
  line-height: 1.85;
  font-size: 16px;
}
.ch-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}
.ch-btn {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  padding: 15px 22px;
  border-radius: 100px;
  font-weight: 800;
  font-size: 13px;
  text-decoration: none;
  transition: transform 0.2s;
}
.ch-btn:hover {
  transform: translateY(-2px);
}
.ch-primary {
  background: #ffce17;
  color: #091521;
}
.ch-outline {
  border: 1px solid #7890a2;
  color: #fff;
}
.ch-hero-art {
  height: 365px;
  position: relative;
  isolation: isolate;
}
.ch-orbit {
  position: absolute;
  inset: 24px 14%;
  border: 1px solid #52718b;
  border-radius: 50%;
  transform: rotate(-28deg);
}
.ch-orbit-b {
  inset: 62px 23%;
  border-style: dashed;
  transform: rotate(28deg);
}
.ch-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 20%, #255777, #0b253a);
  border: 1px solid #7390a6;
  box-shadow: 0 0 0 18px #ffffff08;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}
.ch-center i {
  font-size: 32px;
  color: #ffce17;
}
.ch-center strong {
  font-size: 26px;
  letter-spacing: 0.07em;
}
.ch-center small {
  font-size: 9px;
  letter-spacing: 0.12em;
  color: #b7d0e2;
}
.ch-node {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: #f8fbfd;
  color: #0d2437;
  border: 1px solid #dde4ea;
  box-shadow: 0 14px 30px #0003;
  border-radius: 18px;
  width: 104px;
  height: 95px;
  font-size: 12px;
  font-weight: 800;
}
.ch-node i {
  font-size: 24px;
  color: #c99a00;
}
.ch-n1 {
  top: 6px;
  left: 12%;
}
.ch-n2 {
  right: 3%;
  top: 110px;
}
.ch-n3 {
  left: 17%;
  bottom: 0;
}
.ch-directory {
  padding: 80px 0 95px;
  background: var(--bg, #f8fafc);
  color: var(--text, #0a1521);
}
.ch-section-head {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  align-items: end;
  margin-bottom: 28px;
}
.ch-section-head h2,
.ch-rfq h2 {
  font-size: clamp(30px, 3vw, 46px);
  letter-spacing: -0.045em;
  margin: 12px 0;
}
.ch-section-head p {
  max-width: 670px;
  color: var(--muted, #64748b);
  line-height: 1.7;
}
.ch-count {
  display: flex;
  align-items: center;
  flex-direction: column;
  min-width: 115px;
}
.ch-count strong {
  font-size: 40px;
  color: #d2a100;
}
.ch-count span {
  font-size: 12px;
  color: var(--muted, #64748b);
}
.ch-toolbar {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.ch-search,
.ch-filter {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border, #d9dfe5);
  border-radius: 13px;
  background: var(--panel, #fff);
  padding: 12px 16px;
  color: var(--text, #0a1521);
}
.ch-search input,
.ch-filter select {
  width: 100%;
  background: transparent;
  border: 0;
  outline: 0;
  color: inherit;
  font: inherit;
  min-height: 28px;
}
.ch-filter span {
  white-space: nowrap;
  font-size: 12px;
  color: var(--muted, #64748b);
}
.ch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.ch-card {
  display: flex;
  flex-direction: column;
  min-height: 180px;
  padding: 24px;
  border: 1px solid var(--border, #d9dfe5);
  border-radius: 18px;
  background: var(--panel, #fff);
  box-shadow: 0 10px 26px #00000008;
  transition:
    transform 0.2s,
    border-color 0.2s;
}
.ch-card:hover {
  transform: translateY(-3px);
  border-color: #d9ad17;
}
.ch-card-tag {
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 800;
  color: #b88b00;
}
.ch-card h3 {
  font-size: 17px;
  line-height: 1.45;
  margin: 17px 0;
  overflow-wrap: anywhere;
}
.ch-card a {
  margin-top: auto;
  font-size: 12px;
  font-weight: 800;
  color: #bd8f00;
  text-decoration: none;
}
.ch-card a i {
  margin-left: 7px;
}
.ch-disclaimer {
  margin-top: 28px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted, #64748b);
}
.ch-disclaimer i {
  color: #d3a400;
  margin-right: 7px;
}
.ch-empty {
  padding: 40px;
  text-align: center;
}
.ch-rfq {
  background: #10283d;
  color: #fff;
  padding: 70px 0;
}
.ch-rfq-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 35px;
}
.ch-rfq p {
  max-width: 700px;
  line-height: 1.8;
  color: #c8d6e0;
}
.ch-rfq .ch-btn {
  white-space: nowrap;
}
@media (max-width: 850px) {
  .ch-hero-inner {
    grid-template-columns: 1fr;
  }
  .ch-hero-art {
    max-width: 460px;
    width: 100%;
    margin: auto;
  }
  .ch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ch-rfq-inner {
    align-items: start;
    flex-direction: column;
  }
}
@media (max-width: 600px) {
  .ch-hero {
    padding: 55px 0;
  }
  .ch-hero-art {
    height: 280px;
  }
  .ch-node {
    width: 83px;
    height: 76px;
    font-size: 10px;
  }
  .ch-center {
    width: 140px;
    height: 140px;
  }
  .ch-grid,
  .ch-toolbar {
    grid-template-columns: 1fr;
  }
  .ch-section-head {
    align-items: start;
  }
  .ch-directory {
    padding: 55px 0;
  }
  .ch-card {
    min-height: 150px;
  }
}
/* =========================================================
   THEME CONTRAST FIX — Chemical Directory
   Explicit section colors prevent global --text / --bg values
   from producing light-on-light or dark-on-dark combinations.
========================================================= */
.chem-page .ch-directory {
  --ch-surface: #f6f8fb;
  --ch-card: #ffffff;
  --ch-ink: #101c2c;
  --ch-secondary: #42536a;
  --ch-line: #d6dfe8;
  --ch-accent: #946b00;
  background: var(--ch-surface);
  color: var(--ch-ink);
}
.chem-page .ch-directory .ch-section-head h2,
.chem-page .ch-directory .ch-card h3,
.chem-page .ch-directory .ch-search input,
.chem-page .ch-directory .ch-filter select,
.chem-page .ch-directory .ch-empty {
  color: var(--ch-ink);
}
.chem-page .ch-directory .ch-section-head p,
.chem-page .ch-directory .ch-count span,
.chem-page .ch-directory .ch-filter span,
.chem-page .ch-directory .ch-disclaimer {
  color: var(--ch-secondary);
}
.chem-page .ch-directory .ch-card,
.chem-page .ch-directory .ch-search,
.chem-page .ch-directory .ch-filter {
  background: var(--ch-card);
  border-color: var(--ch-line);
  color: var(--ch-ink);
}
.chem-page .ch-directory .ch-card-tag,
.chem-page .ch-directory .ch-card a,
.chem-page .ch-directory .ch-kicker,
.chem-page .ch-directory .ch-count strong {
  color: var(--ch-accent);
}
.chem-page .ch-directory .ch-search input::placeholder {
  color: var(--ch-secondary);
  opacity: 1;
}
.chem-page .ch-directory .ch-filter select option {
  background: var(--ch-card);
  color: var(--ch-ink);
}
.chem-page .ch-directory .ch-search:focus-within,
.chem-page .ch-directory .ch-filter:focus-within {
  outline: 2px solid #c99a00;
  outline-offset: 2px;
}

html[data-theme="dark"] .chem-page .ch-directory,
body[data-theme="dark"].chem-page .ch-directory,
html.dark .chem-page .ch-directory {
  --ch-surface: #0b1725;
  --ch-card: #142538;
  --ch-ink: #f3f7fc;
  --ch-secondary: #bdcddd;
  --ch-line: #30465e;
  --ch-accent: #ffd447;
}
