/* DatasheetHub Pro — component sheet (2.5.1)
   Part-page header (scoped to .dsh-sheet, so the homepage's own .dsh-hero
   banner keeps its centred design), meta row, section nav, one shared
   section-card design for every block on the part page, compact listing
   cards for the category / tag / author / manufacturer pages, the back-to-top
   button, and a layout that adapts to the space the page sidebars leave.
   The stylesheet's version in header.php follows this file's modification
   time, so browsers pick up every change. */

.dsh-sheet { display: block; }
.dsh-sheet .dsh-panel__body .dsh-prose { max-width: none; }
.dsh-sheet .dsh-prose img { max-width: 100%; height: auto; }
.dsh-sheet .dsh-prose figure { margin: 1em 0; text-align: center; }
.dsh-sheet [id^="dsh-sec-"], .dsh-sheet #datasheet-preview, .dsh-sheet #comments { scroll-margin-top: 140px; }

/* Part-page header -------------------------------------------------------- */
/* Text on the left, the part's image on the right at a size that balances it. */
.dsh-sheet .dsh-hero { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: center;
  background: #fff; border: 1px solid var(--dsh-line); border-radius: 16px; padding: 24px 26px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -20px rgba(15, 23, 42, .25); }
.dsh-sheet .dsh-hero--noimg { grid-template-columns: minmax(0, 1fr); }
.dsh-sheet .dsh-hero__eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; color: var(--dsh-muted); margin-bottom: 10px; }
.dsh-sheet .dsh-hero__eyebrow a { color: var(--dsh-body); }
.dsh-sheet .dsh-hero__eyebrow a:hover { color: var(--dsh-accent); }
.dsh-sheet .dsh-hero__eyebrow svg { width: 15px; height: 15px; }
/* The maker's logo sits in the eyebrow line, never larger than the text around it. */
.dsh-sheet .dsh-hero__logo { display: block; height: 24px; width: auto; max-width: 120px; object-fit: contain; flex: 0 0 auto; }
.dsh-sheet .dsh-hero__title { margin: 0; font-size: clamp(21px, 3vw, 29px); line-height: 1.28; font-weight: var(--dsh-h-weight, 700); color: var(--dsh-ink); overflow-wrap: anywhere; }
.dsh-sheet .dsh-hero__title .dsh-pn { font-size: 1em; color: var(--dsh-accent); }
.dsh-sheet .dsh-hero__rest { font-weight: 600; }
.dsh-sheet .dsh-hero__pnrow { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.dsh-sheet .dsh-hero__pnrow .dsh-pn { font-size: 15px; }
.dsh-sheet .dsh-hero__title .dsh-copy { vertical-align: middle; font-size: 12px; font-weight: 500; }
.dsh-sheet .dsh-hero__desc { margin: 10px 0 0; color: var(--dsh-body); font-size: 15px; line-height: 1.55; }

.dsh-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; font-size: 13px; color: var(--dsh-muted); }
.dsh-meta > * { display: inline-flex; align-items: center; gap: 5px; }
.dsh-meta a { color: inherit; }
.dsh-meta a:hover { color: var(--dsh-accent); }
.dsh-meta svg { width: 14px; height: 14px; flex: 0 0 auto; }

.dsh-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.dsh-fact { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--dsh-line-2); color: var(--dsh-muted); }
.dsh-fact b { font-weight: 600; color: var(--dsh-ink); font-family: var(--dsh-mono); }

.dsh-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.dsh-actions .dsh-btn { padding: 9px 14px; border-radius: 10px; }
.dsh-actions .dsh-btn svg { width: 16px; height: 16px; }
/* The download button: short label, the file size as a small pill. */
.dsh-btn--dl { gap: 8px; box-shadow: 0 6px 16px -10px color-mix(in srgb, var(--dsh-accent) 80%, transparent); }
.dsh-btn--dl:hover { transform: translateY(-1px); }
.dsh-btn__meta { padding: 2px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 1.4;
  background: rgba(255, 255, 255, .2); color: inherit; }

.dsh-sheet .dsh-hero__media { width: 300px; margin: 0; }
.dsh-sheet .dsh-hero__media a { display: block; border: 1px solid var(--dsh-line); border-radius: 12px; overflow: hidden; background: #fff; aspect-ratio: 1 / 1; }
.dsh-sheet .dsh-hero__media img { display: block; width: 100%; height: 100%; object-fit: contain; border: 0; border-radius: 0; }
.dsh-sheet .dsh-hero__media figcaption { font-size: 11.5px; color: var(--dsh-faint); text-align: center; margin-top: 6px; }

/* Section nav ----------------------------------------------------------- */
.dsh-sheetnav { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 4px; margin: 14px 0 16px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.dsh-sheetnav a { flex: 0 0 auto; font-size: 12.5px; padding: 5px 12px; border: 1px solid var(--dsh-line); border-radius: 999px; background: #fff; color: var(--dsh-body); text-decoration: none; white-space: nowrap; }
.dsh-sheetnav a:hover, .dsh-sheetnav a:focus-visible { border-color: var(--dsh-accent); color: var(--dsh-accent); }

/* Section cards: one design for every block on the part page ------------ */
.dsh-sheet .dsh-panel { border-radius: 14px; overflow: hidden; border-color: var(--dsh-line);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 26px -24px rgba(15, 23, 42, .3); }
.dsh-sheet .dsh-panel__head { gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--dsh-line-2);
  background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--dsh-line-2) 55%, #fff)); }
/* the heading icon becomes a small tinted tile */
.dsh-sheet .dsh-panel__head > svg { box-sizing: content-box; flex: none; width: 16px; height: 16px; padding: 6px; border-radius: 9px;
  color: var(--dsh-accent); background: var(--dsh-tint); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--dsh-accent) 14%, transparent); }
.dsh-sheet .dsh-panel__head h2 { margin: 0; font-size: 15.5px; font-weight: 700; letter-spacing: -.005em; color: var(--dsh-ink); }
.dsh-sheet .dsh-panel__body { padding: 18px; }

/* Key specifications: tiles inside the card */
.dsh-sheet .dsh-specgrid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; background: none; border: 0; border-radius: 0; overflow: visible; }
.dsh-sheet .dsh-specgrid__item { position: relative; padding: 12px 14px 12px 16px; border-radius: 11px; background: color-mix(in srgb, var(--dsh-line-2) 70%, #fff);
  border: 1px solid var(--dsh-line-2); transition: border-color .15s, background .15s; }
.dsh-sheet .dsh-specgrid__item::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0;
  background: color-mix(in srgb, var(--dsh-accent) 55%, transparent); }
.dsh-sheet .dsh-specgrid__item:hover { border-color: color-mix(in srgb, var(--dsh-accent) 35%, var(--dsh-line)); background: #fff; }
.dsh-sheet .dsh-specgrid__k { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--dsh-muted); }
.dsh-sheet .dsh-specgrid__v { margin-top: 4px; font-family: var(--dsh-font); font-size: 15px; font-weight: 650; line-height: 1.35; color: var(--dsh-ink); overflow-wrap: anywhere; }

/* Datasheet card */
.dsh-sheet .dsh-ds { align-items: center; gap: 16px; }
.dsh-sheet .dsh-ds__ico { width: 50px; height: 50px; border-radius: 13px; color: var(--dsh-accent);
  background: linear-gradient(145deg, var(--dsh-tint), color-mix(in srgb, var(--dsh-tint) 60%, var(--dsh-accent) 12%));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--dsh-accent) 16%, transparent); }
.dsh-sheet .dsh-ds__name { font-size: 15px; }
.dsh-sheet .dsh-ds__meta { gap: 6px; margin-top: 6px; }
.dsh-sheet .dsh-ds__meta > span:not(.dsh-badge) { padding: 1px 8px; border-radius: 999px; background: var(--dsh-line-2); color: var(--dsh-body); }
.dsh-sheet .dsh-ds__actions .dsh-btn { padding: 9px 14px; border-radius: 10px; }
.dsh-sheet .dsh-ds__src { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--dsh-line); }

/* PDF preview card */
.dsh-sheet .dsh-pdfsec .dsh-panel__head { flex-wrap: wrap; }
.dsh-sheet .dsh-pdfsec__meta { margin-left: auto; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--dsh-line-2); color: var(--dsh-muted); }
.dsh-sheet .dsh-pdfsec__body { padding: 12px; }
.dsh-sheet .dsh-pdfsec__body .dpv { border-radius: 10px; }

/* Tags */
.dsh-tagcloud { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.dsh-tag { display: inline-flex; align-items: center; gap: 2px; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 500;
  color: var(--dsh-body); background: #fff; border: 1px solid var(--dsh-line); text-decoration: none; transition: border-color .15s, color .15s, background .15s; }
.dsh-tag::before { content: "#"; color: var(--dsh-accent); font-weight: 700; opacity: .8; }
.dsh-tag:hover { text-decoration: none; color: var(--dsh-accent); border-color: color-mix(in srgb, var(--dsh-accent) 45%, var(--dsh-line)); background: var(--dsh-tint); }

/* Lists ------------------------------------------------------------------ */
.dsh-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; color: var(--dsh-body); line-height: 1.55; }
.dsh-list li { position: relative; padding-left: 20px; }
.dsh-list li::before { content: ""; position: absolute; left: 5px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--dsh-accent); opacity: .7; }
.dsh-list li.dsh-list__head { padding-left: 0; font-weight: 600; color: var(--dsh-ink); margin-top: 8px; grid-column: 1 / -1; }
.dsh-list li.dsh-list__head:first-child { margin-top: 0; }
.dsh-list li.dsh-list__head + li.dsh-list__head { margin-top: 0; font-weight: 500; color: var(--dsh-muted); }
.dsh-list li.dsh-list__head::before { display: none; }
.dsh-list--cols { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); column-gap: 24px; }

/* Overview + more ------------------------------------------------------- */
.dsh-overview__lead { font-size: 15.5px; color: var(--dsh-ink); }
.dsh-more { margin-top: 10px; }
.dsh-more > summary { cursor: pointer; color: var(--dsh-link); font-size: 13px; padding: 6px 0; list-style: none; }
.dsh-more > summary::-webkit-details-marker { display: none; }
.dsh-more > summary::before { content: "▸ "; }
.dsh-more[open] > summary::before { content: "▾ "; }

/* FAQ ------------------------------------------------------------------- */
.dsh-faq details { border-bottom: 1px solid var(--dsh-line-2); padding: 11px 0; }
.dsh-faq details:first-child { padding-top: 0; }
.dsh-faq details:last-child { border-bottom: 0; padding-bottom: 0; }
.dsh-faq summary { cursor: pointer; font-weight: 600; color: var(--dsh-ink); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.dsh-faq summary::-webkit-details-marker { display: none; }
.dsh-faq summary::after { content: "+"; color: var(--dsh-muted); font-weight: 400; font-size: 18px; line-height: 1; }
.dsh-faq details[open] summary::after { content: "–"; }
.dsh-faq details p { margin: 8px 0 0; color: var(--dsh-body); line-height: 1.6; }

/* Aside details --------------------------------------------------------- */
.dsh-sheet .dsh-details td { font-family: var(--dsh-font); }
.dsh-sheet .dsh-details td.is-mono { font-family: var(--dsh-mono); }

/* Comments -------------------------------------------------------------- */
.dsh-comment--reply { margin-left: 26px; border-left: 3px solid var(--dsh-line); }
.dsh-comment__reply { margin-top: 8px; padding: 0; border: 0; background: none; color: var(--dsh-link); font-size: 12.5px; cursor: pointer; }
.dsh-comment__reply:hover { text-decoration: underline; }
/* the comment count beside the heading reads as a small pill, not a stray number */
.dsh-comments__title [data-bh-comment-count] { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px; margin-left: 4px;
  border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1; vertical-align: middle; color: var(--dsh-accent-hover); background: var(--dsh-tint); }

/* Listing cards (category, tag, author and manufacturer pages) ---------- */
.dsh-pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.dsh-pcard { position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 14px; background: #fff;
  border: 1px solid var(--dsh-line); border-radius: 14px; isolation: isolate;
  transition: border-color .15s, box-shadow .15s, transform .15s; }
.dsh-pcard:hover { border-color: color-mix(in srgb, var(--dsh-accent) 45%, var(--dsh-line)); box-shadow: 0 12px 26px -20px rgba(15, 23, 42, .45); transform: translateY(-1px); }
.dsh-pcard__thumb { display: grid; place-items: center; flex: none; width: 76px; height: 76px; border-radius: 11px; overflow: hidden;
  background: #fff; border: 1px solid var(--dsh-line-2); color: var(--dsh-accent); }
.dsh-pcard__thumb img { width: 100%; height: 100%; object-fit: contain; }
.dsh-pcard__thumb svg { width: 26px; height: 26px; opacity: .6; }
.dsh-pcard__body { min-width: 0; flex: 1; }
.dsh-pcard__title { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.dsh-pcard__title a { color: var(--dsh-ink); text-decoration: none; }
.dsh-pcard__title a.dsh-pn { color: var(--dsh-accent); font-size: 1em; }
.dsh-pcard__title a::after { content: ""; position: absolute; inset: 0; z-index: 0; border-radius: inherit; }   /* whole card clickable */
.dsh-pcard:hover .dsh-pcard__title a { text-decoration: underline; text-underline-offset: 2px; }
.dsh-pcard__mfr { margin-top: 2px; font-size: 12.5px; font-weight: 600; color: var(--dsh-muted); }
.dsh-pcard__desc { margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: var(--dsh-body);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dsh-pcard__chips { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.dsh-pchip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500;
  color: var(--dsh-muted); background: var(--dsh-line-2); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dsh-pchip svg { width: 12px; height: 12px; flex: none; }
.dsh-pchip--mono { font-family: var(--dsh-mono); }
.dsh-pchip--ds { color: var(--dsh-accent-hover); background: var(--dsh-tint); }
a.dsh-pchip:hover { text-decoration: none; color: var(--dsh-accent); background: var(--dsh-tint-2); }

/* Back to top ------------------------------------------------------------- */
.dsh-totop { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 60; display: grid; place-items: center;
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; color: #fff; background: var(--dsh-accent);
  box-shadow: 0 10px 24px -10px rgba(15, 23, 42, .55), 0 0 0 1px rgba(255, 255, 255, .25) inset;
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s, background .15s; }
.dsh-totop.is-on { opacity: 1; transform: none; pointer-events: auto; }
.dsh-totop:hover { background: var(--dsh-accent-hover); }
.dsh-totop:focus-visible { outline: 3px solid color-mix(in srgb, var(--dsh-accent) 40%, transparent); outline-offset: 2px; }
.dsh-totop svg { width: 20px; height: 20px; }

@media (prefers-reduced-motion: reduce) {
  .dsh-pcard, .dsh-btn--dl, .dsh-totop { transition: none; }
  .dsh-pcard:hover, .dsh-btn--dl:hover { transform: none; }
}

/* Layout: adapt to the room the page sidebars leave --------------------- */
.dsh-shell__main { container-type: inline-size; }
@container (max-width: 920px) {
  .dsh-sheet .dsh-detail--sidebar { grid-template-columns: minmax(0, 1fr); }
  .dsh-sheet .dsh-hero { grid-template-columns: minmax(0, 1fr) 240px; gap: 22px; }
  .dsh-sheet .dsh-hero__media { width: 240px; }
}
@container (max-width: 580px) {
  .dsh-sheet .dsh-hero { grid-template-columns: minmax(0, 1fr); padding: 18px; }
  .dsh-sheet .dsh-hero__media { order: -1; width: 100%; max-width: 260px; margin: 0 auto; }
  .dsh-comment--reply { margin-left: 12px; }
  .dsh-pcards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .dsh-sheet .dsh-hero { grid-template-columns: minmax(0, 1fr); padding: 18px; }
  .dsh-sheet .dsh-hero__media { order: -1; width: 100%; max-width: 260px; margin: 0 auto; }
  .dsh-sheet .dsh-panel__body { padding: 14px; }
  .dsh-sheet .dsh-specgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .dsh-pcards { grid-template-columns: minmax(0, 1fr); }
  .dsh-pcard__thumb { width: 64px; height: 64px; }
  .dsh-totop { right: 12px; width: 42px; height: 42px; }
}
@media print {
  .dsh-sheetnav, .dsh-actions, .dsh-comments, .dsh-pdfsec, .dsh-totop { display: none !important; }
}

/* Form success message: large and unmistakable (Form Builder) ---------- */
.fb .fb-success { align-items: center; gap: 16px; padding: 22px 24px; border-radius: 16px; background: #ecfdf5; border: 2px solid #34d399; color: #065f46; box-shadow: 0 12px 30px -18px rgba(5, 150, 105, .55); animation: dsh-pop .35s ease-out; scroll-margin-top: 140px; }
.fb .fb-success__icon { width: 44px; height: 44px; padding: 8px; border-radius: 50%; background: #10b981; color: #fff; box-sizing: border-box; }
.fb .fb-success p { font-size: 15.5px; line-height: 1.55; color: #065f46; }
.fb .fb-success p::first-line { font-size: 19px; font-weight: 800; color: #047857; }
@keyframes dsh-pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fb .fb-success { animation: none; } }

/* Pages: same width as part pages ------------------------------------------ */
.dsh-page { width: 100%; }
.dsh-page .dsh-prose { max-width: none; }
.dsh-page .dsh-prose .fb { max-width: 900px; }
