/* PipeMag — erteashat rubber expansion joint (article-scoped via :has)
 * Does NOT alter other PipeMag articles.
 * NOTE: site root font-size is 10px, so prefer px for reading measures.
 */

.mag:has(.mag-erteashat-root) .mag-wrap {
  max-width: min(1180px, 100%);
}

.mag-article:has(.mag-erteashat-root) {
  max-width: min(1180px, 100%);
  width: 100%;
}

.mag-article:has(.mag-erteashat-root) > .mag-article__header,
.mag-article:has(.mag-erteashat-root) > .mag-toc,
.mag-article:has(.mag-erteashat-root) > .mag-prose,
.mag-article:has(.mag-erteashat-root) > .mag-faq {
  max-width: min(1180px, 100%);
  width: 100%;
  margin-inline: auto;
}

/* Title/lede: wider than body prose, still readable */
.mag-article:has(.mag-erteashat-root) > .mag-article__header {
  max-width: min(920px, 100%);
}

/* Comfortable reading measure (~72ch) — NOT rem (10px root) */
.mag-article:has(.mag-erteashat-root) > .mag-prose > p,
.mag-article:has(.mag-erteashat-root) > .mag-prose > ul,
.mag-article:has(.mag-erteashat-root) > .mag-prose > ol,
.mag-article:has(.mag-erteashat-root) > .mag-prose > h2,
.mag-article:has(.mag-erteashat-root) > .mag-prose > h3,
.mag-article:has(.mag-erteashat-root) > .mag-prose > .mag-callout,
.mag-article:has(.mag-erteashat-root) > .mag-prose > .mag-faq,
.mag-article:has(.mag-erteashat-root) > .mag-prose > .mag-install-steps,
.mag-article:has(.mag-erteashat-root) > .mag-prose > .mag-mistake-grid,
.mag-article:has(.mag-erteashat-root) > .mag-prose > .mag-abbr-grid {
  max-width: min(720px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.mag-article:has(.mag-erteashat-root) > .mag-article__cover {
  max-width: min(850px, 100%);
  width: 100%;
  margin: 1.25rem auto 1.75rem;
  border-radius: 14px;
  /* Override base .mag-article__cover aspect-ratio:16/9 + overflow:hidden crop */
  aspect-ratio: auto;
  height: auto;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}

.mag-article:has(.mag-erteashat-root) > .mag-article__cover img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  object-position: center;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.mag-prose .mag-editorial-figure {
  margin: 1.5rem auto 1.85rem;
  max-width: min(700px, 100%);
  text-align: center;
}

.mag-prose .mag-editorial-figure--hero,
.mag-prose .mag-editorial-figure--wide {
  max-width: min(700px, 100%);
}

.mag-prose .mag-editorial-figure img {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  display: block;
  margin-inline: auto;
  object-fit: contain;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
}

.mag-prose .mag-editorial-figure figcaption {
  margin-top: 0.55rem;
  font-size: 1.4rem; /* ~14px at 10px root */
  color: #475569;
  text-align: center;
  max-width: 700px;
  margin-inline: auto;
}

.mag-prose .mag-spec-panel {
  margin: 1.65rem auto 2.1rem;
  max-width: min(1100px, 100%);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.mag-prose .mag-spec-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 1rem;
  padding: 0.95rem 1.15rem;
  background: linear-gradient(95deg, #0b1f3a 0%, #123056 62%, #8b1e2d 160%);
  color: #fff;
}

.mag-prose .mag-spec-panel__head h3 {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 700;
  color: #fff;
}

.mag-prose .mag-spec-panel__note {
  margin: 0;
  font-size: 1.35rem;
  opacity: 0.92;
}

.mag-prose .mag-spec-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  overscroll-behavior-x: contain;
}

.mag-prose .mag-spec-table {
  display: table !important;
  width: 100% !important;
  max-width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 1.5rem; /* ~15px */
  table-layout: fixed;
  margin: 0 !important;
}

.mag-prose .mag-spec-table th,
.mag-prose .mag-spec-table td {
  border: 1px solid rgba(15, 23, 42, 0.1);
  padding: 0.7rem 0.55rem;
  text-align: center;
  white-space: nowrap;
  overflow: visible;
}

.mag-prose .mag-spec-table thead th {
  background: #eef3f9;
  color: #0b1f3a;
  font-weight: 700;
  border-bottom: 2px solid rgba(139, 30, 45, 0.35);
}

.mag-prose .mag-spec-table tbody th {
  background: #f7f9fc;
  color: #0b1f3a;
  font-weight: 700;
  text-align: right;
  padding-inline: 0.75rem;
  position: sticky;
  right: 0;
  z-index: 1;
  box-shadow: -4px 0 8px rgba(15, 23, 42, 0.04);
}

.mag-prose .mag-spec-table tbody tr:nth-child(even) td {
  background: #fbfdff;
}

.mag-prose .mag-spec-table tbody tr:hover td,
.mag-prose .mag-spec-table tbody tr:hover th {
  background: #f3f7fc;
}

@media (min-width: 901px) {
  .mag-prose .mag-spec-table {
    min-width: 0;
  }
}

@media (max-width: 900px) {
  .mag-prose .mag-spec-table {
    min-width: 640px;
    table-layout: auto;
    font-size: 1.35rem;
  }
  .mag-prose .mag-spec-table th,
  .mag-prose .mag-spec-table td {
    padding: 0.5rem 0.45rem;
  }
  .mag-prose .mag-spec-scroll {
    border-top: 1px solid rgba(15, 23, 42, 0.06);
  }
}

.mag-prose .mag-abbr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.65rem 1rem;
  margin: 1rem auto 1.5rem;
  padding: 0;
  list-style: none;
}

.mag-prose .mag-abbr-grid li {
  margin: 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 10px;
  background: #f8fafc;
  font-size: 1.45rem;
}

.mag-prose .mag-abbr-grid strong {
  color: #8b1e2d;
}

.mag-prose .mag-install-steps {
  display: grid;
  gap: 0.75rem;
  margin: 1.25rem auto 1.75rem;
  padding: 0;
  list-style: none;
  counter-reset: mag-step;
}

.mag-prose .mag-install-steps li {
  counter-increment: mag-step;
  margin: 0;
  padding: 0.95rem 1.05rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  background: #fff;
  border-right: 4px solid #0b1f3a;
}

.mag-prose .mag-install-steps li::before {
  content: counter(mag-step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  margin-left: 0.65rem;
  border-radius: 999px;
  background: #0b1f3a;
  color: #fff;
  font-weight: 700;
  font-size: 1.3rem;
  vertical-align: middle;
}

.mag-prose .mag-mistake-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.9rem;
  margin: 1.25rem auto 1.75rem;
}

.mag-prose .mag-mistake-card {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  background: #fff;
}

.mag-prose .mag-mistake-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.6rem;
  color: #8b1e2d;
}

.mag-prose .mag-mistake-card p {
  margin: 0.35rem 0;
}

.mag-prose .mag-callout {
  margin: 1rem auto 1.5rem;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(139, 30, 45, 0.25);
  background: #fff7f8;
  color: #3b1220;
  font-size: 1.5rem;
}

.mag-prose > .mag-faq,
.mag-prose .mag-faq {
  margin: 2rem auto 1rem;
}

.mag-prose .mag-faq__list {
  display: grid;
  gap: 0.55rem;
}

.mag-prose .mag-faq__item {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  background: #fff;
  padding: 0 0.85rem;
}

.mag-prose .mag-faq__summary {
  cursor: pointer;
  list-style: none;
  padding: 0.85rem 0;
  font-weight: 700;
  color: #0b1f3a;
}

.mag-prose .mag-faq__summary::-webkit-details-marker {
  display: none;
}

.mag-prose .mag-faq__answer {
  margin: 0 0 0.9rem;
  color: #334155;
  line-height: 1.75;
}

@media (max-width: 720px) {
  .mag:has(.mag-erteashat-root) .mag-wrap {
    max-width: 100%;
  }
  .mag-prose .mag-mistake-grid {
    grid-template-columns: 1fr;
  }
}
