/* ── Resources Layout ───────────────────────────────────────────────────── */
.resources-layout {
  display: flex;
  align-items: flex-start;
  gap: var(--md-2);
  padding: var(--md-2) 0 var(--lg-2);
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.resources-sidebar {
  flex: 0 0 300px;
  width: 300px;
  position: sticky;
  top: calc(64px + var(--sm-2));
  max-height: calc(100dvh - 80px);
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--dark-10);
  border-radius: var(--rad-lg);
  box-shadow: 0 4px 20px var(--dark-10), 0 1px 4px rgba(0,0,0,0.06);
}

/* Inner scroll wrapper */
.resources-sidebar__inner {
  width: 300px;
  overflow-y: auto;
  max-height: calc(100dvh - 80px);
  padding: var(--sm-2);
}

/* ── Nav body ────────────────────────────────────────────────────────────── */
.resources-sidebar__body {
  opacity: 1;
}

.resources-sidebar__group-label {
  font-size: var(--label-fs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dark-blue);
  padding-bottom: var(--xs-2);
  border-bottom: 2px solid var(--highlight-blue);
  margin: 0 0 var(--xs-1);
  white-space: nowrap;
}

.resources-sidebar__group-label + .resources-sidebar__group-label,
.resources-sidebar__nav + .resources-sidebar__group-label {
  margin-top: var(--sm-2);
}

.resources-sidebar__nav {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--xs-1);
  display: flex;
  flex-direction: column;
}

.resources-sidebar__nav li a {
  display: block;
  padding: var(--xs-2) var(--sm-3);
  font-size: var(--body-sm-fs);
  color: var(--body-blue);
  border-radius: var(--rad-sm);
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
}

.resources-sidebar__nav li a:hover {
  color: var(--dark-blue);
  background-color: var(--section-background);
  padding-left: var(--sm-2);
}

.resources-sidebar__nav li a.is-active {
  color: var(--dark-blue);
  background-color: var(--section-background);
  font-weight: 600;
  padding-left: var(--sm-2);
  border-left: 3px solid var(--highlight-blue);
}

/* ── Content Area ────────────────────────────────────────────────────────── */
.resources-content {
  flex: 1;
  min-width: 0;
}

/* ── Resource Section (partials) ─────────────────────────────────────────── */
.resource-section h2 {
  font-size: var(--headline-lg-fs);
  line-height: var(--headline-lg-lh);
  font-weight: 600;
  color: var(--dark-blue);
  margin-bottom: var(--sm-2);
}

.resource-section > p,
.resource-section > ul {
  font-size: var(--body-md-fs);
  line-height: var(--body-md-lh);
  color: var(--body-blue);
  margin-bottom: var(--sm-2);
}

/* ── Shared table styles ─────────────────────────────────────────────────── */
.table-wrapper {
  border: 1px solid var(--dark-10);
  border-radius: var(--rad-md);
  overflow: hidden;
}

.resource-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--body-sm-fs);
  line-height: var(--body-sm-lh);
}

.resource-table thead th {
  background-color: var(--dark-blue);
  color: var(--white);
  font-weight: 600;
  padding: 1.2rem 1.6rem;
  text-align: left;
  text-wrap: balance;
}

.resource-table td {
  padding: 1rem 1.6rem;
  border-bottom: 1px solid var(--dark-10);
  vertical-align: top;
}

.resource-table tbody tr:last-child td {
  border-bottom: none;
}

.resource-table tbody tr:hover {
  background-color: var(--section-background);
}

/* ── Hazard Grid ─────────────────────────────────────────────────────────── */
.hazard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--dark-25);
  border-radius: var(--rad-md);
  overflow: hidden;
}

.hazard-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--md-4) var(--sm-2) var(--sm-2);
  gap: var(--xs-1);
  border-right: 1px solid var(--dark-25);
  border-bottom: 1px solid var(--dark-25);
}

/* Remove right border on last column, bottom border on last row */
.hazard-item:nth-child(4n) { border-right: none; }
.hazard-item:nth-last-child(-n+4) { border-bottom: none; }

.hazard-item img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  margin-bottom: var(--xs-1);
}

.hazard-item h3 {
  font-size: var(--body-md-fs);
  font-weight: 700;
  color: var(--dark-blue);
  margin: 0 0 var(--xs-2);
}

.hazard-item p {
  font-size: var(--body-sm-fs);
  color: var(--body-blue);
  line-height: var(--body-sm-lh);
  margin: 0;
  text-align: left;
}

@media (max-width: 767.98px) {
  .hazard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hazard-item:nth-child(4n) { border-right: 1px solid var(--dark-25); }
  .hazard-item:nth-last-child(-n+4) { border-bottom: 1px solid var(--dark-25); }
  .hazard-item:nth-child(2n) { border-right: none; }
  .hazard-item:nth-last-child(-n+2) { border-bottom: none; }
}

/* ── Incompatible list ───────────────────────────────────────────────────── */
.incompat-guidelines {
  list-style: disc;
  padding-left: var(--sm-2);
  display: flex;
  flex-direction: column;
  gap: var(--xs-2);
}

/* ── Periodic PDF ────────────────────────────────────────────────────────── */
.pdf-buttons {
  display: flex;
  gap: var(--sm-3);
  flex-wrap: wrap;
  margin-bottom: var(--sm-2);
}

.pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--xs-1);
  padding: var(--xs-1) var(--sm-2);
  border-radius: var(--rad-sm);
  font-size: var(--body-sm-fs);
  font-weight: 600;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.pdf-btn-outline {
  border: 2px solid var(--dark-blue);
  color: var(--dark-blue);
}

.pdf-btn-outline:hover {
  background-color: var(--dark-blue);
  color: var(--white);
}

.pdf-btn-filled {
  background-color: var(--dark-blue);
  color: var(--white);
  border: 2px solid var(--dark-blue);
}

.pdf-btn-filled:hover {
  background-color: var(--highlight-blue);
  border-color: var(--highlight-blue);
  color: var(--white);
}

.periodic-wrapper {
  border: 1px solid var(--dark-10);
  border-radius: var(--rad-md);
  overflow: hidden;
}

.periodic-pdf {
  display: block;
  width: 100%;
  height: 640px;
  border: none;
}

/* ── Content loading states ──────────────────────────────────────────────── */
.resources-content p.loading,
.resources-content p.error {
  font-size: var(--body-md-fs);
  color: var(--body-blue);
  padding: var(--md-1) 0;
}

.resources-content p.error {
  color: var(--error);
}

/* ── Mobile ───────────────────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .resources-layout {
    flex-direction: column;
    gap: var(--sm-2);
  }

  .resources-sidebar {
    flex: none !important;
    width: 100% !important;
    position: static;
    max-height: none;
    overflow: visible;
  }

  .resources-sidebar__inner {
    width: 100%;
    max-height: none;
    overflow: visible;
  }

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

  .resources-content {
    overflow-x: hidden;
    width: 100%;
  }

  .table-wrapper {
    width: 100%;
    overflow-x: auto;
  }

  .periodic-pdf {
    height: 60vw;
    min-height: 280px;
  }
}

/* ── Page Banner (shared with products) ─────────────────────────────────── */
.page-banner {
  position: relative;
  background: var(--powder-blue);
  overflow: hidden;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.page-banner__inner {
  position: relative;
  z-index: 2;
  padding: var(--md-2) var(--sm-1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sm-2);
}

.page-banner__title {
  font-size: var(--headline-lg-fs);
  line-height: var(--headline-lg-lh);
  font-weight: 600;
  color: var(--dark-blue);
  margin: 0;
}

.page-banner__molecule {
  position: absolute;
  width: clamp(140px, 14vw, 200px);
  max-width: 40%;
  pointer-events: none;
  z-index: 1;
}

.page-banner__molecule--left  { left: 0;  bottom: 0; transform: translate(-10%, 10%); }
.page-banner__molecule--right { right: 0; bottom: 0; transform: translate(0, 10%); }

.page-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--xs-1);
  font-size: var(--breadcrumb-default-fs);
  line-height: var(--breadcrumb-default-lh);
  flex-wrap: wrap;
  justify-content: center;
}

.page-breadcrumb a { color: var(--dark-blue); }
.page-breadcrumb a:hover { color: var(--highlight-blue); }
.page-breadcrumb__sep { color: var(--dark-50); }
.page-breadcrumb__active { color: var(--body-blue); font-weight: 600; }
