/*
  Style sheet for the CLS CastLab Supply website.

  The design palette and layout are inspired by the official
  Ransom & Randolph website, using a vibrant orange as the
  primary accent color alongside deep charcoal backgrounds and
  clean white surfaces. The font family Montserrat provides a
  modern, industrial feel while remaining highly readable.

  Author: CLS (CastLab Supply)
*/

/*
  Theme tokens

  IMPORTANT: The light theme is the styling reference. Dark mode should keep the
  same layout, typography, spacing and component styling — only colors change.
  To achieve that, most colors below are expressed as tokens and the dark theme
  overrides only those tokens.
*/
:root {
  /* Brand accent (R&R-inspired warm orange/red) */
  --primary-color: #b93828;

  /* Core surfaces */
  --bg: #ffffff;
  --bg-muted: #f9f9f9; /* section backgrounds */
  --surface: #ffffff; /* cards/forms */
  --input-bg: #ffffff;

  /* Text */
  --text-color: #333333; /* body text */
  --text-muted: #5b616a;
  --heading-color: #1a1a1a;

  /* Borders & shadows */
  --border-color: #dddddd;
  --card-shadow: rgba(0, 0, 0, 0.1);
  --header-shadow: rgba(0, 0, 0, 0.1);

  /* Header / footer */
  --header-bg: #ffffff;
  --header-text: #1a1a1a;
  --footer-bg: #1a1a1a;

  /* Hero overlay */
  --hero-overlay: rgba(0, 0, 0, 0.5);
}

/* Global reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* Respect reduced motion preferences without changing the visual design */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  font-family: 'Montserrat', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-color);
  line-height: 1.6;
  background-color: var(--bg);
}

/* Improve keyboard accessibility without affecting layout */
:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 3px;
}

a {
  color: var(--primary-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(100% - clamp(24px, 4vw, 48px), var(--container-max, 1200px));
  max-width: var(--container-max, 1200px);
  margin: 0 auto;
}

.panel-shell {
  --container-max: min(1680px, calc(100vw - clamp(24px, 4vw, 48px)));
}

.panel-page {
  padding: clamp(20px, 3vw, 32px) 0 clamp(32px, 4vw, 48px);
  min-height: calc(100svh - 120px);
}

.panel-stack {
  display: grid;
  gap: clamp(14px, 2vw, 22px);
}

.panel-title h1,
.panel-title p,
.panel-card > * {
  min-width: 0;
}

.panel-grid,
.panel-grid-two {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(14px, 2vw, 18px);
}

@media (min-width: 1080px) {
  .panel-grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.panel-card {
  width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

.panel-card-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable both-edges;
}

.panel-side-action {
  max-width: min(220px, 100%);
}

.panel-card-scroll > table {
  min-width: 680px;
}

/* Header styles */
/*
  Header styling
  The default header uses a light background with a thin orange border underneath,
  reminiscent of the official Ransom & Randolph website. In dark mode the header
  reverts to the dark background used elsewhere on the site. 
*/
.site-header {
  /* Light header with white background and orange bottom border */
  background-color: var(--header-bg);
  border-bottom: 4px solid var(--primary-color);
  padding: 10px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px var(--header-shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo img {
  /* Increase logo height for better readability and provide a drop shadow to improve contrast on dark backgrounds */
  /* Increase the logo height further to improve clarity and fill available space */
  height: 80px;
  width: auto;
  /* Apply a light drop‑shadow so the tagline remains visible on dark headers */
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.8));
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
}

.main-nav a {
  /* Dark text for light header */
  color: var(--header-text);
  font-weight: 500;
  padding: 6px 0;
  transition: color 0.3s ease;
}

.main-nav a:hover {
  color: var(--primary-color);
}

/* Header controls for language switch and dark mode */
.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-controls .lang-link,
.header-controls .dark-toggle {
  font-size: 0.9rem;
  /* Match text colour with dark text on the light header */
  color: var(--header-text);
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 4px 8px;
  transition: color 0.3s ease;
}

.header-controls .lang-link {
  min-width: 2.6rem;
}

.header-controls .dark-toggle {
  min-width: 32px;
}

.header-controls .lang-link:hover,
.header-controls .dark-toggle:hover {
  color: var(--primary-color);
}

.header-controls .dark-toggle i {
  font-size: 1rem;
}

.header-controls .lang-link[aria-current='page'] {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Dark mode: keep the same component styling as light mode; only tokens change */
.dark-mode {
  --bg: #0b0f14;
  --bg-muted: #0f141b;
  --surface: #121a23;
  --input-bg: #0f1620;

  --text-color: #e9eef6;
  --text-muted: #b6c0cc;
  --heading-color: #ffffff;

  --border-color: rgba(255, 255, 255, 0.14);
  --card-shadow: rgba(0, 0, 0, 0.35);
  --header-shadow: rgba(0, 0, 0, 0.35);

  --header-bg: #0b0f14;
  --header-text: #ffffff;
  --footer-bg: #0b0f14;

  /* Slightly lighter overlay in dark mode so hero images remain detailed */
  --hero-overlay: rgba(0, 0, 0, 0.28);
}



/* Skip off-screen rendering for below-the-fold homepage sections */
@supports (content-visibility: auto) {
  .products-section,
  .about-section,
  .contact-section,
  .site-footer {
    content-visibility: auto;
    contain-intrinsic-size: 1px 900px;
  }
}
/* Hero section */
.hero {
  position: relative;
  background-image: url('hero.jpg');
  background-size: cover;
  background-position: center;
  height: clamp(400px, 60svh, 680px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  text-align: center;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--hero-overlay);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  font-weight: 300;
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 4px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: #a52f21;
}

/* Section titles */
.section-title {
  font-size: 2rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 2rem;
  color: var(--heading-color);
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background-color: var(--primary-color);
  margin: 8px auto 0;
  border-radius: 2px;
}

/* Products section */
.products-section {
  padding: 4rem 0;
  background-color: var(--bg-muted);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.product-card {
  background-color: var(--surface);
  border-top: 5px solid var(--primary-color);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 4px 8px var(--card-shadow);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px var(--card-shadow);
}

/* Styles for resin product cards in CAD/CAM section */
.resin-card .resin-img {
  margin-bottom: 1rem;
  text-align: center;
}

.resin-card .resin-img img {
  max-width: 100%;
  height: auto;
  display: inline-block;
}

.resin-card h3 {
  margin-top: 0;
}

.product-card .icon-wrapper {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 0.75rem;
}

.product-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--heading-color);
}

.product-card p {
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Subsection titles inside products section */
.subsection-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 3rem;
  margin-bottom: 1rem;
  color: var(--heading-color);
  text-align: center;
}

/* About section */
.about-section {
  padding: 4rem 0;
}

.about-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2rem;
}

.about-text {
  flex: 1 1 50%;
}

.about-text h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--heading-color);
}

.about-text p {
  margin-bottom: 1rem;
  font-size: 1rem;
}

.about-image {
  flex: 1 1 45%;
  text-align: center;
}

.about-image img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 8px var(--card-shadow);
}

/* Contact section */
.contact-section {
  background-color: var(--bg-muted);
  padding: 4rem 0;
}

.contact-inner {
  max-width: 900px;
  margin: 0 auto;
}

.contact-section h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--heading-color);
}

.contact-content {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.contact-details {
  flex: 1 1 40%;
  font-size: 1rem;
}

/* Product detail pages */
.product-hero {
  background-color: var(--bg-muted);
  padding: 4rem 0;
}

.product-hero-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2rem;
}

.product-hero-image {
  flex: 1 1 40%;
  text-align: center;
}

.product-hero-image img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 8px var(--card-shadow);
}

.product-hero-content {
  flex: 1 1 55%;
}

.product-hero-content h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--heading-color);
}

.product-hero-content p {
  font-size: 1.1rem;
  font-weight: 300;
}

.product-details {
  padding: 2rem 0 4rem;
}

.product-details h2 {
  font-size: 1.75rem;
  margin-top: 2rem;
  color: var(--heading-color);
}

.product-details h3 {
  font-size: 1.25rem;
  margin-top: 1.5rem;
  color: var(--heading-color);
}

.product-details p {
  margin-bottom: 1rem;
}

.product-details ul {
  margin-left: 1.5rem;
  list-style: disc;
  margin-bottom: 1rem;
}

.product-details li {
  margin-bottom: 0.5rem;
}

.product-details a {
  color: var(--primary-color);
  text-decoration: underline;
}

.product-details a:hover {
  text-decoration: none;
}

/* Ensure links remain readable */
.dark-mode .product-details a {
  color: var(--primary-color);
}

/* Make entire product cards clickable */
.product-card-link {
  display: block;
  color: inherit;
}

.product-card-link .product-card {
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.product-card-link:hover .product-card {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px var(--card-shadow);
}

.contact-details p {
  margin-bottom: 0.5rem;
}

.contact-details a {
  color: var(--primary-color);
  font-weight: 500;
}

.contact-form {
  flex: 1 1 55%;
  background-color: var(--surface);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 8px var(--card-shadow);
}

.contact-form .form-group {
  margin-bottom: 1rem;
}

.contact-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
  background-color: var(--input-bg);
  color: var(--text-color);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(224, 78, 57, 0.2);
}

.contact-form button {
  width: 100%;
  margin-top: 1rem;
  padding: 0.75rem;
  border: none;
  border-radius: 4px;
  background-color: var(--primary-color);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.contact-form button:hover {
  background-color: #a52f21;
}

/* Footer */
.site-footer {
  background-color: var(--footer-bg);
  color: #ffffff;
  padding: 2rem 0;
  font-size: 0.95rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
}

.footer-col {
  flex: 1 1 200px;
  min-width: 180px;
}

.footer-col h3 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: #ffffff;
}

.footer-col p,
.footer-col li {
  margin-bottom: 0.5rem;
}

.footer-menu {
  list-style: none;
  padding: 0;
}

.footer-menu a {
  color: #ffffff;
  transition: color 0.3s ease;
}

.footer-menu a:hover {
  color: var(--primary-color);
}

.social-icons a {
  display: inline-block;
  margin-right: 10px;
  color: #ffffff;
  font-size: 1.2rem;
  transition: color 0.3s ease;
}

.social-icons a:hover {
  color: var(--primary-color);
}

.footer-bottom {
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
  margin-top: 1rem;
}

/* Responsive adjustments */
@media (max-width: 960px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 12px 18px;
    align-items: center;
  }

  .main-nav {
    order: 3;
    width: 100%;
  }

  .main-nav ul {
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-top: 4px;
  }

  .header-controls {
    margin-left: auto;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

@media (max-width: 768px) {
  .container {
    width: min(100% - 24px, var(--container-max, 1200px));
  }

  .header-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .logo img {
    height: clamp(56px, 18vw, 72px);
  }

  .main-nav ul {
    margin-top: 0;
  }

  .header-controls {
    width: 100%;
    justify-content: space-between;
  }

  .header-controls > * {
    max-width: 100%;
  }

  .hero h1 {
    font-size: 1.8rem;
  }
  .hero p {
    font-size: 1rem;
  }
  .contact-content {
    flex-direction: column;
  }
  .contact-form {
    padding: 1.5rem;
  }
  .about-inner {
    flex-direction: column;
  }
}
/* RFQ mini-cart (B2B MVP) */
.rfq-add-btn {
  margin-top: 14px;
}

.rfq-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 120;
  border: 0;
  border-radius: 999px;
  background: var(--primary-color);
  color: #fff;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--card-shadow);
}

.rfq-count {
  display: inline-block;
  min-width: 18px;
  text-align: center;
  margin-left: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 1px 6px;
}

.rfq-panel {
  position: fixed;
  right: 16px;
  bottom: 64px;
  width: 340px;
  max-width: calc(100vw - 32px);
  max-height: 70vh;
  overflow: auto;
  z-index: 120;
  background: var(--surface);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 8px 24px var(--card-shadow);
  padding: 12px;
  display: none;
}

.rfq-panel.open {
  display: block;
}

.rfq-items {
  margin-bottom: 10px;
}

.rfq-item {
  border-bottom: 1px solid var(--border-color);
  padding: 8px 0;
}

.rfq-item-row {
  display: grid;
  grid-template-columns: 1fr 70px 30px;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
}

.rfq-item-row input,
.rfq-form input,
.rfq-form textarea {
  width: 100%;
  border: 1px solid var(--border-color);
  background: var(--input-bg);
  color: var(--text-color);
  border-radius: 6px;
  padding: 8px;
}

.rfq-remove {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}

.rfq-form {
  display: grid;
  gap: 8px;
}

.rfq-form textarea {
  min-height: 70px;
  resize: vertical;
}

.rfq-empty {
  color: var(--text-muted);
  margin: 8px 0;
}

.product-variant-picker {
  margin-top: 1rem;
  margin-bottom: 0.75rem;
}

.product-variant-title {
  margin: 0 0 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.product-variant-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.product-variant-btn {
  border: 1px solid var(--border-color);
  background: var(--surface);
  color: var(--text-color);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font: inherit;
  cursor: pointer;
}

.product-variant-btn.is-active {
  border-color: var(--primary-color);
  background: rgba(224, 78, 57, 0.12);
  color: var(--primary-color);
}

.cookie-consent-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: #1f2937;
  color: #fff;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.25);
}
.cookie-consent-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.cookie-consent-actions { display:flex; gap:8px; align-items:center; margin-left:auto; }
.cookie-consent-actions button {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.45);
  border-radius: 10px;
  padding: 9px 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}
.cookie-consent-actions button[data-action="accept"] {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}
.cookie-consent-actions button[data-action="accept"]:hover {
  filter: brightness(0.95);
}
.cookie-consent-actions button.btn-secondary {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.55);
}
.cookie-consent-actions button.btn-secondary:hover {
  background: rgba(255,255,255,0.16);
  color: #fff;
  border-color: rgba(255,255,255,0.85);
  filter: none;
}
.cookie-consent-actions a { color:#fff; text-decoration: underline; }
.cookie-settings-fab,
button.cookie-settings-fab.btn-secondary {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 9998;
  border: 1px solid var(--border-color) !important;
  border-radius: 12px;
  background: rgba(11, 27, 47, 0.92) !important;
  color: #fff !important;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(0,0,0,0.22);
}
.cookie-settings-fab:hover,
button.cookie-settings-fab.btn-secondary:hover {
  border-color: rgba(255,255,255,0.55) !important;
  background: rgba(11, 27, 47, 0.98) !important;
}
.cookie-settings-modal {
  border: none;
  border-radius: 16px;
  max-width: 580px;
  width: calc(100% - 24px);
  padding: 0;
  box-shadow: 0 18px 44px rgba(0,0,0,0.28);
}
.cookie-settings-modal::backdrop {
  background: rgba(4, 9, 16, 0.46);
  backdrop-filter: blur(1px);
}
.cookie-settings-card {
  padding: 18px;
  background: var(--surface);
  color: var(--text-color);
}
.cookie-settings-card h3 {
  margin: 0 0 6px;
  color: var(--heading-color);
  font-size: 1.8rem;
}
.cookie-settings-card p {
  margin: 0 0 12px;
  color: var(--text-muted);
}
.cookie-settings-card label {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 14px !important;
  color: var(--text-muted);
  font-weight: 500;
}
.cookie-settings-card input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary-color);
}
.cookie-settings-card .cookie-consent-actions {
  margin-left: 0;
  gap: 10px;
}
.cookie-settings-card .cookie-consent-actions button {
  border-radius: 12px;
  border: 1px solid var(--primary-color);
  padding: 10px 16px;
}
.cookie-settings-card .cookie-consent-actions button#cookieSettingsSaveBtn {
  background: var(--primary-color);
  color: #fff;
}
.cookie-settings-card .cookie-consent-actions button.btn-secondary {
  background: transparent;
  color: var(--text-color);
  border-color: var(--border-color);
}
.cookie-settings-card .cookie-consent-actions button.btn-secondary:hover {
  background: rgba(224, 78, 57, 0.08);
  color: var(--primary-color);
  border-color: var(--primary-color);
}

/* Knowledge hub */
.knowledge-hub {
  background: var(--bg, #f5f5f7);
  padding: 48px 0 64px;
}

.knowledge-hero {
  margin-bottom: 28px;
}

.knowledge-eyebrow {
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #4f5968;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.knowledge-lead {
  max-width: 840px;
  color: #4f5968;
}

.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}

.knowledge-search-wrap {
  margin-top: 18px;
}

.knowledge-search-input {
  width: min(620px, 100%);
  border: 1px solid #d8dde5;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  color: var(--text-color);
}

.knowledge-search-empty {
  margin-top: 18px;
  color: #4f5968;
  font-weight: 500;
}

.knowledge-card {
  background: #fff;
  border: 1px solid #d8dde5;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 0 rgba(19, 26, 41, 0.04);
}

.knowledge-card h3 {
  margin-top: 0;
  color: #e04e39;
}

.knowledge-card p {
  color: #4f5968;
}

.knowledge-card-meta {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.knowledge-card-meta a {
  color: #e04e39;
  text-decoration: none;
  font-weight: 700;
}

.knowledge-article {
  padding: 36px 0 64px;
}

.knowledge-back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: #e04e39;
  text-decoration: none;
  font-weight: 600;
}

.article-page-v2 {
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  border: 1px solid #d8dde5;
}

.article-page-v2 .lead {
  color: #4f5968;
}

.article-page-v2 .toc,
.article-page-v2 .toc ul {
  list-style: none;
  margin: 0;
  padding-left: 0;
}

.article-page-v2 .toc > li {
  margin: 8px 0;
}

.article-page-v2 .toc ul {
  margin-top: 8px;
  padding-left: 20px;
}

.article-page-v2 .toc a {
  color: #b43c14;
  text-decoration: none;
}

.article-page-v2 .toc a:hover {
  text-decoration: underline;
}

.article-page-v2 .section-anchor-offset {
  scroll-margin-top: 18px;
}

.article-page-v2 .device-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 280px));
  justify-content: center;
  gap: 16px;
  margin: 14px 0 22px;
}

.article-page-v2 .device-card {
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  border: 1px solid #d8dde5;
  border-radius: 10px;
  padding: 12px;
  background: #fafafa;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.article-page-v2 .device-card img {
  width: 100%;
  height: auto;
  max-height: 220px;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  display: block;
}

.article-page-v2 .device-card strong {
  display: block;
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.35;
}

.article-page-v2 .device-card small {
  display: block;
  margin-top: 4px;
  color: #666;
  font-size: 12px;
  line-height: 1.35;
}

.article-page-v2 .source-figure {
  margin: 16px auto 26px;
  max-width: 980px;
}

.article-page-v2 .source-figure img {
  width: 100%;
  height: auto;
  border: 1px solid #d8dde5;
  border-radius: 10px;
  background: #fff;
  display: block;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.article-page-v2 .source-figure figcaption {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.4;
  color: #555;
  text-align: center;
}

.article-page-v2 .source-figure.compact {
  max-width: 860px;
}

.article-page-v2 .article-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 12px 0;
}

.article-page-v2 table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 0.95rem;
}

.article-page-v2 th,
.article-page-v2 td {
  border: 1px solid #d8dde5;
  padding: 10px;
  min-width: 10.5rem;
  max-width: 18rem;
  text-align: left;
  vertical-align: top;
  white-space: normal !important;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: manual;
  font-size: inherit;
  line-height: 1.5;
}

.article-page-v2 table :is(th, td) > :where(p, ul, ol, li, span, strong, em, a) {
  font-size: inherit;
  line-height: inherit;
  white-space: inherit;
  overflow-wrap: inherit;
}

@media (max-width: 768px) {
  .article-page-v2 th,
  .article-page-v2 td {
    padding: 8px;
    min-width: 9rem;
    max-width: 14rem;
    font-size: 0.92rem;
  }

  .article-page-v2 .device-gallery {
    grid-template-columns: minmax(0, 1fr);
  }

  .article-page-v2 .device-card {
    max-width: 100%;
  }
}

.dark-mode .knowledge-card,
.dark-mode .article-page-v2 {
  background: #1f2735;
  border-color: #2f3d53;
}

.dark-mode .knowledge-card p,
.dark-mode .knowledge-lead,
.dark-mode .knowledge-search-empty,
.dark-mode .article-page-v2 .lead,
.dark-mode .article-page-v2 p,
.dark-mode .article-page-v2 li,
.dark-mode .article-page-v2 th,
.dark-mode .article-page-v2 td {
  color: #d8e0ef;
}

.dark-mode .article-page-v2 .device-card {
  background: #243041;
  border-color: #2f3d53;
}

.dark-mode .article-page-v2 .device-card img,
.dark-mode .article-page-v2 .source-figure img {
  border-color: #2f3d53;
  background: #1f2735;
}

.dark-mode .article-page-v2 .device-card small,
.dark-mode .article-page-v2 .source-figure figcaption {
  color: #b7c4d8;
}

.dark-mode .article-page-v2 th,
.dark-mode .article-page-v2 td {
  border-color: #2f3d53;
}

.dark-mode .knowledge-search-input {
  background: #1f2735;
  border-color: #2f3d53;
  color: #d8e0ef;
}


.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
