/* ==========================================================================
   Chemical compositions page (chemical-compositions.html)

   Loads on top of css/pipe-dimensions-page.css, which carries the shared
   technical-reference shell (.pd-* hero, feature strip, section heads, table,
   FAQs, closing strip). Only the chemistry-specific pieces live here.
   ========================================================================== */

/* Nine columns, the last one wide enough for the OTHERS text. */
.pd .cc-table {
  min-width: 1180px;
}

/* ==========================================================================
   Grade column - stays put while the element columns scroll
   ========================================================================== */

.pd .cc-table td.cc-grade {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 96px;
  background: #eef3f9;
  border-right: 2px solid #b9c8da;
  color: var(--pd-navy);
  font-size: 13px;
  font-weight: 900;
  text-align: left;
  padding-left: 14px;
}

.pd .cc-table tbody tr:nth-child(even) td.cc-grade {
  background: #e6edf6;
}

.pd .cc-table tbody tr.is-selected td.cc-grade {
  background: var(--pd-red);
  color: #fff;
}

.pd .cc-table th.cc-grade {
  position: sticky;
  left: 0;
  z-index: 4;
  min-width: 96px;
  background: var(--pd-navy);
  border-right: 2px solid #b9c8da;
  text-align: left;
  padding-left: 14px;
}

/* ==========================================================================
   Element column colours

   The printed reference colour-codes each element heading; carrying that
   through makes a wide scrolling table far easier to read across.
   ========================================================================== */

.pd .cc-table th[data-el="C"] { background: #1273b8; }
.pd .cc-table th[data-el="Mn"] { background: #14919e; }
.pd .cc-table th[data-el="P"] { background: #1b4f8a; }
.pd .cc-table th[data-el="S"] { background: #2c8f55; }
.pd .cc-table th[data-el="Si"] { background: #2f7ec4; }
.pd .cc-table th[data-el="Cr"] { background: #d4790f; }
.pd .cc-table th[data-el="Ni"] { background: #74499c; }
.pd .cc-table th[data-el="OTHERS"] { background: #cc2b3a; }

/* The OTHERS column carries prose, not a number. */
.pd .cc-table td.cc-others {
  min-width: 250px;
  border-left: 2px solid #b9c8da;
  text-align: left;
  padding-left: 14px;
  color: #33495f;
}

.pd .cc-table th[data-el="OTHERS"] {
  border-left: 2px solid #b9c8da;
}

/* Highlighted element column while a grade is open in the finder. */
.pd .cc-table td.cc-lit {
  background: #fff2f4;
  color: var(--pd-navy);
  font-weight: 800;
}

/* ==========================================================================
   Element key strip - the row printed under the sheet header
   ========================================================================== */

.cc-keystrip {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  margin-bottom: 22px;
}

.cc-keystrip span {
  padding: 9px 6px;
  background: #fff;
  border: 1px solid var(--pd-line);
  border-radius: 6px;
  color: #33495f;
  font-size: 11.5px;
  text-align: center;
}

.cc-keystrip b {
  color: var(--pd-navy);
  font-weight: 900;
}

/* ==========================================================================
   Filter box in the finder
   ========================================================================== */

.pd .cc-search {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid #ccd7e4;
  border-radius: 5px;
  color: #193553;
  font-family: inherit;
  font-weight: 700;
}

.pd .cc-search::placeholder {
  color: #9aa7b6;
  font-weight: 400;
}

/* Three controls rather than the five the shared finder expects. */
.pd .cc-finder__grid {
  grid-template-columns: 1fr 1.5fr auto;
}

/* Eight readings per grade rather than six. */
.pd .cc-metrics {
  grid-template-columns: repeat(4, 1fr);
}

/* Element symbols are case-sensitive: Mn, not MN. */
.pd .cc-metrics .pd-metric small {
  text-transform: none;
  font-size: 12px;
}

.pd .cc-metrics .pd-metric:nth-child(4n) {
  border-right: 0;
}

.pd .cc-metrics .pd-metric:nth-child(-n+4) {
  border-bottom: 1px solid var(--pd-line);
}

.pd .cc-metrics .pd-metric strong {
  font-size: 16px;
  line-height: 1.35;
}

/* ==========================================================================
   Notes panels - Reference Notes / Element Key / Important
   ========================================================================== */

.cc-panels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 24px;
}

.cc-panel {
  padding: 20px 22px;
  background: #fff;
  border: 1px solid var(--pd-line);
  border-radius: 10px;
  box-shadow: 0 7px 20px rgba(6, 39, 75, 0.06);
}

.cc-panel--warn {
  background: #fff8e8;
  border-color: #f0dca8;
}

.pd .cc-panel h3 {
  margin: 0 0 14px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--pd-line);
  background: none;
  color: var(--pd-navy);
  font-size: 13px;
  font-weight: normal;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pd .cc-panel--warn h3 {
  border-bottom-color: #f0dca8;
  color: var(--pd-red);
}

.cc-panel p {
  margin: 0 0 8px;
  color: #5c6f85;
  font-size: 12.5px;
  line-height: 1.6;
}

.cc-panel p:last-child {
  margin-bottom: 0;
}

.cc-panel--warn p {
  color: #6d5b2b;
}

.cc-panel--warn p:first-of-type {
  color: var(--pd-red);
  font-weight: 700;
}

.cc-elkey {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.cc-elkey span {
  color: #5c6f85;
  font-size: 12.5px;
}

.cc-elkey b {
  color: var(--pd-navy);
}

/* ==========================================================================
   Related product links - carried over from the previous page's sidebar
   ========================================================================== */

/* Cell rules are drawn as borders rather than as grid gaps, so the last row
   does not leave grey blanks where the grid runs out of links. */
.cc-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--pd-line);
  border-radius: 10px;
  overflow: hidden;
}

.cc-links a {
  display: block;
  height: 100%;
  padding: 13px 16px;
  border-right: 1px solid var(--pd-line);
  border-bottom: 1px solid var(--pd-line);
  color: #33495f;
  font-size: 12.5px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.cc-links a:hover {
  background: #eef4fb;
  color: var(--pd-navy2);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media screen and (max-width: 1100px) {
  .pd .cc-finder__grid {
    grid-template-columns: 1fr 1fr;
  }

  .cc-keystrip {
    grid-template-columns: repeat(4, 1fr);
  }

  .cc-panels {
    grid-template-columns: 1fr;
  }

  .cc-links {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media screen and (max-width: 760px) {
  .pd .cc-finder__grid {
    grid-template-columns: 1fr;
  }

  .pd .cc-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .pd .cc-metrics .pd-metric:nth-child(2n) {
    border-right: 0;
  }

  .pd .cc-metrics .pd-metric:nth-child(-n+6) {
    border-bottom: 1px solid var(--pd-line);
  }

  .cc-links {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 520px) {
  .cc-keystrip {
    grid-template-columns: repeat(2, 1fr);
  }

  .cc-links {
    grid-template-columns: 1fr;
  }

  .pd .cc-table td.cc-grade,
  .pd .cc-table th.cc-grade {
    min-width: 76px;
    padding-left: 9px;
  }
}

@media print {
  .pd .cc-table {
    min-width: 0;
  }

  .pd .cc-table td.cc-grade,
  .pd .cc-table th.cc-grade {
    position: static;
  }
}
