/* MATEX SEO — phase two. Matches the theme: Montserrat headings, Lora body,
   #fd2f2f accent, #f7f7f7 cards with 25px radius. */

:root {
  --matex-red: #fd2f2f;
  --matex-ink: #000;
  --matex-text: #4f4f4f;
  --matex-card: #f7f7f7;
  --matex-line: #dfdfdf;
  --matex-radius: 25px;
}
body.dark {
  --matex-ink: #fff;
  --matex-text: #d4d4d4;
  --matex-card: #1e1e1e;
  --matex-line: #3a3a3a;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); border: 0; white-space: nowrap;
}

/* Headings promoted for hierarchy keep the look of the h6 they replace. */
.matex-h6,
.single_page .row .prod_content h2.matex-subtitle {
  font-family: "Montserrat", serif;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--matex-ink);
  margin: 0 0 15px;
}
.single_page .row .prod_content h2.matex-subtitle { margin-bottom: 15px; }
@media (max-width: 1440px) { .matex-h6, .single_page .row .prod_content h2.matex-subtitle { font-size: 22px; } }
@media (max-width: 991px)  { .matex-h6, .single_page .row .prod_content h2.matex-subtitle { font-size: 20px; } }
@media (max-width: 767px)  { .matex-h6, .single_page .row .prod_content h2.matex-subtitle { font-size: 18px; } }
.tec_data h2.matex-h6 span { font-weight: inherit; }

.matex-h2 {
  font-family: "Montserrat", serif;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--matex-ink);
  margin: 0 0 24px;
}
@media (max-width: 991px) { .matex-h2 { font-size: 30px; } }
@media (max-width: 767px) { .matex-h2 { font-size: 24px; } }

/* 6.1.5 Technical data table — same card as the old list. */
.single_page .row .prod_content .tec_data .matex-tech-wrap { display: block; width: 100%; padding: 15px 25px; }
.matex-spec-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.matex-spec-table thead th {
  font-family: "Montserrat", serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #8a8a8a;
  text-align: left;
  padding: 6px 12px 10px 0;
  border-bottom: 1px solid var(--matex-line);
}
.matex-spec-table tbody th,
.matex-spec-table tbody td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px 10px 0;
  border-bottom: 1px dashed var(--matex-line);
  line-height: 1.45;
}
.matex-spec-table tbody th { font-weight: 500; color: var(--matex-text); width: 45%; }
.matex-spec-table tbody td { font-weight: 700; color: var(--matex-ink); }
.matex-spec-table tbody tr:last-child th,
.matex-spec-table tbody tr:last-child td { border-bottom: 0; }
.matex-spec-table tr.sub-ttl th {
  font-family: "Montserrat", serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--matex-ink);
  padding-top: 18px;
  width: auto;
}
@media (max-width: 575px) {
  .single_page .row .prod_content .tec_data .matex-tech-wrap { padding: 10px 15px; }
  .matex-spec-table { font-size: 14px; }
}

/* 6.1.10 Document links with type + size. */
.matex-doc-list a { display: inline-flex; align-items: center; gap: 8px; }
.matex-doc-meta { font-size: 12px; font-weight: 400; opacity: .7; }

/* Product content sections (How to apply, Standards, FAQ, Related). */
.matex-section { margin: 40px 0 0; }
.single_page .matex-section h2 { scroll-margin-top: 120px; }
.matex-section p,
.matex-section li { color: var(--matex-text); }
.matex-howto ol {
  counter-reset: matex-step;
  list-style: none;
  margin: 0;
  padding: 0;
}
.matex-howto ol li {
  counter-increment: matex-step;
  position: relative;
  padding: 0 0 18px 48px;
  line-height: 1.6;
}
.matex-howto ol li::before {
  content: counter(matex-step);
  position: absolute;
  left: 0; top: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--matex-red);
  color: #fff;
  font-family: "Montserrat", serif;
  font-weight: 600;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.matex-howto ol li strong { color: var(--matex-ink); font-weight: 600; }

.matex-standards table {
  width: 100%;
  border-collapse: collapse;
  background: var(--matex-card);
  border-radius: var(--matex-radius);
  overflow: hidden;
  font-size: 15px;
}
.matex-standards th,
.matex-standards td { text-align: left; vertical-align: top; padding: 12px 16px; border-bottom: 1px dashed var(--matex-line); line-height: 1.45; }
.matex-standards thead th {
  font-family: "Montserrat", serif;
  font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #8a8a8a;
  border-bottom: 1px solid var(--matex-line);
}
.matex-standards td:first-child { font-weight: 700; color: var(--matex-ink); white-space: nowrap; }
.matex-standards tbody tr:last-child td { border-bottom: 0; }
.matex-standards .matex-note { font-size: 13px; margin-top: 10px; opacity: .8; }
@media (max-width: 575px) {
  .matex-standards table, .matex-standards thead, .matex-standards tbody, .matex-standards tr, .matex-standards td { display: block; width: 100%; }
  .matex-standards thead { display: none; }
  .matex-standards tr { padding: 10px 0; border-bottom: 1px dashed var(--matex-line); }
  .matex-standards td { border: 0; padding: 2px 16px; }
}

/* FAQ — native <details>, keyboard accessible without JS. */
.matex-faq details {
  background: var(--matex-card);
  border-radius: 18px;
  margin-bottom: 10px;
  padding: 0;
}
.matex-faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 52px 16px 20px;
  position: relative;
  font-family: "Montserrat", serif;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.4;
  color: var(--matex-ink);
}
.matex-faq summary::-webkit-details-marker { display: none; }
.matex-faq summary::after {
  content: "+";
  position: absolute; right: 20px; top: 50%;
  transform: translateY(-50%);
  font-size: 22px; font-weight: 400; color: var(--matex-red);
}
.matex-faq details[open] summary::after { content: "\2212"; }
.matex-faq summary:focus-visible { outline: 2px solid var(--matex-red); outline-offset: 2px; border-radius: 18px; }
.matex-faq details > :not(summary) { padding: 0 20px 16px; margin: 0; }
.matex-faq .matex-faq-a p:last-child { margin-bottom: 0; }

/* Cards: related products, featured products, related categories. */
.matex-card-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.matex-card-grid a {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--matex-card);
  border-radius: 18px;
  padding: 16px;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}
.matex-card-grid a:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.matex-card-grid a:focus-visible { outline: 2px solid var(--matex-red); outline-offset: 2px; }
.matex-card-img { display: block; aspect-ratio: 1 / 1; margin-bottom: 12px; background: #fff; border-radius: 12px; overflow: hidden; }
.matex-card-img img { width: 100%; height: 100%; object-fit: contain; }
.matex-card-title { font-family: "Montserrat", serif; font-weight: 600; font-size: 16px; color: var(--matex-ink); line-height: 1.3; }
.matex-card-sub { font-size: 14px; line-height: 1.45; color: var(--matex-text); margin-top: 6px; }
.matex-card-grid--text { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.matex-card-grid a:hover .matex-card-title { color: var(--matex-red); }

/* Category / sub-category pages. */
.matex-term-intro { margin: 10px 0 0; }
.matex-term-extra { padding: 20px 0 80px; }
.matex-term-extra .matex-section { margin-top: 60px; }
.matex-prose { max-width: 860px; }
.matex-term-intro .matex-prose,
.matex-guide .matex-prose { margin: 0 auto; }
.matex-prose h2 { font-family: "Montserrat", serif; font-size: 30px; font-weight: 700; line-height: 1.25; margin: 40px 0 16px; color: var(--matex-ink); }
.matex-prose h3 { font-family: "Montserrat", serif; font-size: 21px; font-weight: 600; line-height: 1.3; margin: 28px 0 10px; color: var(--matex-ink); }
.matex-prose h2:first-child { margin-top: 0; }
.matex-prose p, .matex-prose li { font-size: 17px; line-height: 1.75; color: var(--matex-text); }
.matex-prose ul, .matex-prose ol { padding-left: 1.2em; margin-bottom: 1em; }
.matex-prose li { margin-bottom: 6px; }
.matex-prose a { color: var(--matex-red); text-decoration: underline; text-underline-offset: 3px; }
.matex-prose strong { color: var(--matex-ink); font-weight: 600; }
.matex-prose table { width: 100%; border-collapse: collapse; margin: 16px 0 24px; font-size: 15px; background: var(--matex-card); border-radius: 18px; overflow: hidden; }
.matex-prose th, .matex-prose td { text-align: left; vertical-align: top; padding: 12px 16px; border-bottom: 1px dashed var(--matex-line); line-height: 1.5; }
.matex-prose thead th { font-family: "Montserrat", serif; font-weight: 600; color: var(--matex-ink); border-bottom: 1px solid var(--matex-line); }
.matex-prose tbody tr:last-child td, .matex-prose tbody tr:last-child th { border-bottom: 0; }
@media (max-width: 767px) {
  .matex-prose h2 { font-size: 24px; }
  .matex-prose h3 { font-size: 19px; }
  .matex-prose p, .matex-prose li { font-size: 16px; }
  .matex-prose table { display: block; overflow-x: auto; }
}
.matex-term-extra .matex-faq,
.matex-term-extra .matex-featured,
.matex-term-extra .matex-related-cats { max-width: 1100px; margin-left: auto; margin-right: auto; }
.matex-term-extra .matex-faq { max-width: 860px; }

/* Home: intro, category blurbs, project tags, trust. */
.matex-home-intro { max-width: 900px; margin: 24px auto 0; text-align: center; }
.matex-home-intro p { font-size: 18px; line-height: 1.75; }
.matex-cat-blurb { font-size: 14px; line-height: 1.5; color: var(--matex-text); margin: 10px 4px 0; }
.matex-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 8px; }
.matex-tags a { display: inline-block; font-size: 12px; font-family: "Montserrat", serif; font-weight: 500; padding: 4px 10px; border-radius: 20px; background: rgba(253,47,47,.1); color: var(--matex-red); text-decoration: none; }
.matex-trust { padding: 80px 0; }
.matex-stats { list-style: none; padding: 0; margin: 30px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.matex-stats li { background: var(--matex-card); border-radius: var(--matex-radius); padding: 28px 16px; text-align: center; }
.matex-stat-value { display: block; font-family: "Montserrat", serif; font-weight: 800; font-size: 44px; line-height: 1; color: var(--matex-red); }
.matex-stat-label { display: block; margin-top: 10px; font-size: 15px; color: var(--matex-text); }
.matex-standards-badges { list-style: none; padding: 0; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.matex-standards-badges li { display: flex; align-items: center; gap: 10px; border: 1px solid var(--matex-line); border-radius: 40px; padding: 8px 16px 8px 8px; }
.matex-badge { font-family: "Montserrat", serif; font-weight: 700; font-size: 13px; background: var(--matex-ink); color: var(--matex-card); border-radius: 30px; padding: 6px 10px; }
body.dark .matex-badge { background: #fff; color: #111; }
.matex-badge-label { font-size: 14px; color: var(--matex-text); }
.matex-trust-note { max-width: 760px; margin: 20px auto 0; font-size: 14px; color: var(--matex-text); }
@media (max-width: 991px) { .matex-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575px) {
  .matex-trust { padding: 50px 0; }
  .matex-stat-value { font-size: 34px; }
  .matex-home-intro p { font-size: 16px; }
}

/* 2.1.4 Hero poster sits under the video until it plays. */
.hero-banner .ban_video { position: relative; }
.hero-banner .ban_video .ban_poster {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
  transition: opacity .6s ease;
}
.hero-banner .ban_video video { position: relative; z-index: 1; opacity: 0; transition: opacity .6s ease; }
.hero-banner .ban_video.is-playing video { opacity: 1; }
.hero-banner .ban_video.is-playing .ban_poster { opacity: 0; }

/* 1.7.5 Reserve the WhatsApp button's box so it never shifts layout. */
.float-social ul li a img { width: 24px; height: 24px; }

@media (prefers-reduced-motion: reduce) {
  .matex-card-grid a, .hero-banner .ban_video video, .hero-banner .ban_video .ban_poster { transition: none; }
}

/* Phones: two compact cards per row. */
@media (max-width: 575px) {
  .matex-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .matex-card-grid--text { grid-template-columns: 1fr; }
  .matex-card-grid a { padding: 10px; border-radius: 14px; }
  .matex-card-img { aspect-ratio: 4 / 5; margin-bottom: 8px; }
  .matex-card-title { font-size: 14px; }
  .matex-card-sub { font-size: 12px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
}

/* Dimensions added for layout stability must not distort: keep the ratio
   unless the theme sets an explicit height (attribute selector = low specificity). */
[data-matex-dims] { height: auto; }

/* Body-copy links: darker red for WCAG AA contrast on white (4.5:1+). */
.matex-prose a, .matex-section .matex-note a { color: #c41a1a; }
body.dark .matex-prose a, body.dark .matex-section .matex-note a { color: #ff6b6b; }
