/* ======================================================================
   BugDorm Product Page House Style ˇX MERGED & STRUCTURED (with comments)
   Scope: wrap product content in <div class="pt-description"> ˇK </div>
   Includes:
   ˇE Design tokens, base typography, links, literature layout
   ˇE <details> blocks + figures
   ˇE Tooltip system (bubble, arrow, mobile tuning)
   ˇE Field Checklist (wrap, controls, counters)
   ˇE Checklist label/counter underline control + checkbox nudge
   ˇE Optional popover styles (with legacy close-button alias)
   ˇE No-JS fallbacks + cross-browser prefixes where useful
   ˇE NEW: normalized underline thickness/offset for consistent link look
   ====================================================================== */


/* ==============================
   Design tokens (scoped)
   ============================== */
.pt-description {
  --bd-green: #7ba43d;                 /* primary green (links, accents) */
  --bd-green-hover: #6a8f34;           /* darker green for hover states */
  --bd-blue: #0a58ca;                  /* primary blue (icons, focus outlines) */
  --bd-text: #2b2b2b;                  /* main body text color */
  --bd-muted: #555;                    /* muted grey (field story, disclaimer) */
  --bd-warn: #b00020;                  /* warning red (alerts) */

  --bd-li-gap: .25rem;                 /* vertical spacing between list items */
  --bd-para-gap: 1rem;                 /* vertical spacing between paragraphs */
  --bd-h3-size: 1.125rem;              /* consistent H3 size */
  --bd-tagline-size: clamp(1.25rem, 2vw + .8rem, 1.6rem);

  /* Tooltip tokens (JS reads these so runtime and CSS match) */
  --bd-tip-gap: 8px;                   /* gap between trigger and bubble */
  --bd-tip-arrow: 6px;                 /* bubble arrow size */
  --bd-tip-shift: 140px;               /* bubble horizontal shift; arrow stays centered */

  /* Checkbox baseline nudge (optical alignment; tune per OS/engine) */
  --bd-checkbox-nudge: -3px;

  /* NEW: link underline tokens (for consistent, readable underlines) */
  --bd-underline-thickness: .075em;    /* try .08ˇV.10em to taste */
  --bd-underline-thin:      .075em;    /* used only for crowded literature items */
  --bd-underline-offset:    .08em;
}


/* ==============================
   Headings
   ============================== */
.pt-description h1,
.pt-description h2 {
  padding-top: .75rem;
  margin: 0 0 .75rem 0;
  font-weight: 400;
  line-height: 1.25;
  font-size: var(--bd-tagline-size);
  color: var(--bd-text);
}

.pt-description h3 {
  margin: 1.5rem 0 .5rem 0;
  font-size: var(--bd-h3-size);
  line-height: 1.35;
  font-weight: 600;
  color: var(--bd-text);
}


/* ==============================
   Paragraphs & simple lists
   ============================== */
.pt-description p {
  margin: 0 0 var(--bd-para-gap) 0;
  line-height: 1.6;
  color: var(--bd-text);
}

.pt-description ul {
  margin: .25rem 0 1rem 1.25rem;
  padding: 0;
  list-style: disc outside;
}

.pt-description li {
  margin: var(--bd-li-gap) 0;
  line-height: 1.6;
}


/* ==============================
   Links (general) + accessibility focus
   ============================== */
.pt-description a {
  text-decoration: underline;
  text-decoration-thickness: var(--bd-underline-thickness);  /* normalized thickness */
  text-underline-offset: var(--bd-underline-offset);         /* normalized offset */
}

.pt-description a:hover {
  text-decoration-thickness: var(--bd-underline-thickness);  /* keep stable on hover */
}

.pt-description a:focus-visible {
  outline: 2px solid var(--bd-blue);
  outline-offset: 2px;
  text-decoration: none;
}

/* Dense literature links: keep clean until hover */
.pt-description a.literature-link {
  text-decoration: none !important;
}

.pt-description a.literature-link:hover {
  text-decoration: underline !important;
}

/* ˇ§Search moreˇ¨ helper link in H3 (e.g., Zotero) */
.pt-description h3 a.studies-link,
.pt-description h3 a[href*="zotero.org"] {
  color: var(--bd-green);
  font-weight: 400;
  text-decoration: underline;
}

.pt-description h3 a.studies-link:hover,
.pt-description h3 a[href*="zotero.org"]:hover {
  color: var(--bd-blue);
}

/* External-link badge (not for internal shop links or .no-ext) */
.pt-description a[href^="http"]:not([href*="//shop.bugdorm.com"]):not(.no-ext)::after {
  content: "";
  display: inline-block;
  width: .9em;
  height: .9em;
  margin-left: .25em;
  vertical-align: super;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 13 13"><g fill="%231a73e8"><path d="M10.5 8.5v3a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1h3v1h-3v8h8v-3h1z"/><path d="M12 1v4h-1V2.707L6.854 6.854l-.708-.708L10.293 2H8V1h4z"/></g></svg>');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
}

/* Keep underline on mail/tel/same-page anchors */
.pt-description a[href^="mailto:"],
.pt-description a[href^="tel:"],
.pt-description a[href^="#"] {
  text-decoration: underline;
}


/* ==============================
   Literature list layout (with vendor prefixes)
   ============================== */
.pt-description .literature-list {
  margin: .25rem 0 1rem 1.25rem;
  padding: 0;
  list-style: disc outside;
  column-width: 21rem;
  column-gap: 2.25rem;
  column-count: 2;
  column-fill: balance;
  line-height: 1.6;
  -webkit-column-width: 21rem;
  -webkit-column-gap: 2.25rem;
  -webkit-column-count: 2;
  -moz-column-width: 21rem;
  -moz-column-gap: 2.25rem;
  -moz-column-count: 2;
}

.pt-description .literature-list li {
  margin: .25rem 0;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  -moz-column-break-inside: avoid;
}

/* On hover/focus: show a thinner underline using the thin token */
.pt-description .literature-list li > a.literature-link:hover,
.pt-description .literature-list li > a.literature-link:focus-visible {
  text-decoration-line: underline !important;
  text-decoration-thickness: var(--bd-underline-thin) !important;
  text-underline-offset: 2px !important; /* a bit of breathing room */
}


/* ==============================
   Disclaimer callout
   ============================== */
.pt-description .bd-disclaimer {
  margin: .25rem 0 1rem 0;
  font-size: .875rem;
  line-height: 1.6;
  color: var(--bd-muted);
}

.pt-description .bd-disclaimer .bd-info-badge {
  display: inline-block;
  margin-right: .4em;
  color: var(--bd-blue);
  background: #eef4ff;
  border: 1px solid var(--bd-blue);
  border-radius: 4px;
  padding: 0 .25em;
  line-height: 1.1;
  font-size: .85em;
}


/* ==============================
   Field Application / Field Story / Authenticity callout
   (v3: unified .bd-auth)
   ============================== */
.pt-description .bd-auth {
  margin: .5rem 0 1rem 0;              /* aligns with v3 vertical rhythm */
  padding: .55rem .75rem;              /* a touch more breathable */
  font-size: .9rem;
  line-height: 1.6;
  color: var(--bd-text, #2b2b2b);      /* token with fallback */
  background: #f7faf5;                 /* slightly warmer than #f9faf7 */
  border-left: 3px solid var(--bd-green, #8BAA35);
}

/* Bold labels (Field Application / Field Story / Authenticity) */
.pt-description .bd-auth strong { font-weight: 600; }

/* Tight margins for inner paragraphs/lists so edges are clean */
.pt-description .bd-auth :is(p,ul,ol) { margin: .25rem 0 0 0; }
.pt-description .bd-auth :is(p,ul,ol):first-child { margin-top: 0; }
.pt-description .bd-auth :is(p,ul,ol):last-child  { margin-bottom: 0; }

/* Link styling inside callouts (explicit colors + states) */
.pt-description .bd-auth a {
  color: var(--bd-brown, #7a4a12);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: var(--bd-underline-thickness, .08em);
  overflow-wrap: anywhere;
}

/* visited comes BEFORE hover so it doesn't override hover color */
.pt-description .bd-auth a:visited {
  color: var(--bd-brown-visited, var(--bd-brown, #7a4a12));
}

/* hover/focus takes precedence (works for both fresh and visited links) */
.pt-description .bd-auth a:is(:hover, :focus-visible) {
  color: var(--bd-blue, #1a73e8);  /* BugDorm Blue */
  text-decoration-thickness: var(--bd-underline-thickness, .08em); /* steady underline */
  outline: none;
}

/* explicitly handle visited+hover */
.pt-description .bd-auth a:visited:is(:hover, :focus-visible) {
  color: var(--bd-blue, #1a73e8);
}

/* When stacking multiple callouts, keep them visually tight */
.pt-description .bd-auth + .bd-auth { margin-top: .5rem; }

/* Print: keep the left cue, drop the fill for clarity */
@media print {
  .pt-description .bd-auth {
    background: transparent;
    border-left-color: #999;
    color: #000;
  }
}

/* ================================================================
   BugDorm brand badge (optional)
   - Add the brand mark before the label when using .bd-auth--brand
   - Inherits tint from --bd-brand-icon-color (defaults to --bd-green)
   ================================================================ */
/* Register image path (scoped globally) */
:root {
  --bugdorm-mark-mask: url('/favicon.ico');
  --bd-brand-icon-color: var(--bd-green, #8BAA35);
}

.pt-description .bd-auth.bd-auth--brand::before {
  content: "";
  display: inline-block;
  inline-size: 1.05em;
  block-size: 1.05em;
  margin-right: .4em;
  vertical-align: -.2em;

  color: var(--bd-brand-icon-color);
  background-color: currentColor;
  -webkit-mask: var(--bugdorm-mark-mask) no-repeat center / 100% 100%;
          mask: var(--bugdorm-mark-mask) no-repeat center / 100% 100%;
  mask-mode: alpha;
}

@media (forced-colors: active) {
  .pt-description .bd-auth.bd-auth--brand::before {
    -webkit-mask: none; mask: none;
    background-color: ButtonText;
    inline-size: .9em; block-size: .9em;
  }
}


/* ==============================
   Featured Video (slot-first)
   ============================== */
/* Make the video block sit flush with what precedes it */
.pt-description .bd-video {
  margin: 0 0 1rem 0;
}

/* Featured Video label: tight spacing when the H3 sits inside .bd-video */
.pt-description .bd-video > h3.bd-video__heading {
  margin: 0 0 .5rem 0;
  line-height: 1.35;
  font-weight: 600;
}

/* Smoothly scale the featured video slot:
   never smaller than 360px, ~45vw mid, cap at 720px */
.pt-description .bd-video__slot {
  max-width: clamp(360px, 45vw, 720px);
  margin: 0 auto 1rem;         /* center + space below */
}

/* Tight spacing around the responsive player */
.pt-description .bd-video__slot .embed-responsive {
  margin: .25rem 0 !important;
}

/* Optional: treat any paragraph in the slot as the note */
.pt-description .bd-video__slot > p {
  margin: .25rem 0 .75rem 0;
  font-size: .9rem;
  line-height: 1.4;
  color: var(--bd-muted, #6b7280);
}

/* Links under the featured video: brown default ˇ÷ blue on hover */
.pt-description .bd-video__slot a {
  color: var(--bd-brown, #7a4a12);                 /* default BugDorm brown */
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: var(--bd-underline-thickness, .08em);
  /* override muted paragraph color */
}

/* put :visited BEFORE hover to avoid overriding */
.pt-description .bd-video__slot a:visited {
  color: var(--bd-brown-visited, var(--bd-brown, #7a4a12));
}

/* hover/focus: BugDorm blue, steady underline */
.pt-description .bd-video__slot a:is(:hover, :focus-visible),
.pt-description .bd-video__slot a:visited:is(:hover, :focus-visible) {
  color: var(--bd-blue, #1a73e8);
  text-decoration-thickness: var(--bd-underline-thickness, .08em);
  outline: none;
}

@media (max-width: 600px) {
  .pt-description .bd-video__slot { max-width: 100%; }
}


/* ==============================
   Utility classes
   ============================== */
.pt-description .list-note {
  margin: .35rem 0 1rem 1.25rem;
  font-size: .95em;
  color: var(--bd-muted);
}

.pt-description .list-note a {
  text-decoration-thickness: var(--bd-underline-thickness);
}

.pt-description .no-underline {
  text-decoration: none !important;
}

.pt-description .no-ext::after {
  display: none !important;
}


/* ==============================
   Warnings (used by BT1011, etc.)
   ============================== */
.pt-description .bd-alert {
  margin: 1rem 0 1rem 0;
  line-height: 1.6;
  color: var(--bd-warn);
  font-size: .95rem;
}


/* ==============================
   <details> blocks + figures
   ============================== */
.pt-description details summary {
  cursor: pointer;
  display: list-item;
  list-style: revert;
  line-height: 1.35;
  color: var(--bd-blue);
  text-decoration: underline dotted;
  text-underline-offset: .08em;
  margin: .2rem 0;
}

.pt-description details summary:hover {
  color: var(--bd-green);
}

.pt-description details.bd-spacer {
  margin-bottom: .75rem;
}

.pt-description details figure {
  margin: .4rem 0 0 0;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: .5rem;
}

.pt-description details figure img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 6px;
}

.pt-description details figure figcaption {
  font-size: .9rem;
  color: #333;
  margin-top: .3rem;
  text-align: center;
  line-height: 1.35;
}

/* Smaller, muted paragraphs inside details (e.g., ˇ§alternative optionˇ¨) */
.pt-description details p {
  margin: .3rem 0 0 0;
  font-size: .85rem;
  line-height: 1.6;
  color: var(--bd-muted);
}

/* Two-figure layout helper */
.pt-description .bd-flex-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
}


/* ==============================
   Tooltip system (scoped)
   ============================== */

/* Trigger */
.pt-description abbr.bd-tip {
  position: relative;
  cursor: help;
}

/* Dashed underline for abbrev triggers */
.pt-description a abbr.bd-tip,
.pt-description abbr.bd-tip,
.pt-description abbr[title] {
  text-decoration-line: underline !important;
  text-decoration-style: dashed;
}

/* Modern underline tuning */
@supports (text-underline-offset: 0.15em) {
  .pt-description a abbr.bd-tip,
  .pt-description abbr.bd-tip,
  .pt-description abbr[title] {
    text-underline-offset: 0.15em;
    text-decoration-thickness: .08em;
    text-decoration-skip-ink: auto;
  }
}

/* Fallback: dashed border-bottom (older engines) */
@supports not (text-underline-offset: 0.15em) {
  .pt-description a abbr.bd-tip,
  .pt-description abbr.bd-tip,
  .pt-description abbr[title] {
    text-decoration: none !important;
    border-bottom: 1px dashed #666 !important;
    padding-bottom: 1px;
  }
  .pt-description a abbr.bd-tip:hover,
  .pt-description abbr.bd-tip:hover,
  .pt-description abbr[title]:hover {
    border-bottom-color: #1a73e8;
  }
}

/* Bubble (default: above trigger) */
.pt-description abbr.bd-tip .bd-tip__bubble {
  position: absolute;
  left: 50%;
  transform: translateX(calc(-50% + var(--bd-tip-shift, 0px)));
  z-index: 30;

  bottom: calc(100% + var(--bd-tip-gap));
  display: block;
  box-sizing: border-box;

  min-inline-size: 20rem;
  max-inline-size: min(34rem, 90vw);

  padding: .75rem .9rem;
  border-radius: .5rem;
  background: #fff;
  color: #111;
  border: 1px solid #ddd;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);

  font-family: "Segoe UI", Arial, sans-serif;
  font-size: .85rem;
  font-weight: 400;
  line-height: 1.45;

  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;

  /* ensure arrow can render outside the panel */
  overflow: visible;

  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s ease, visibility .15s ease;
}

/* Links inside bubble */
.pt-description abbr.bd-tip .bd-tip__bubble a {
  text-decoration: underline;
  text-underline-offset: .08em;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.pt-description abbr.bd-tip .bd-tip__bubble a:focus-visible {
  outline: 2px solid var(--bd-blue);
  outline-offset: 2px;
  text-decoration: none;
}
/* Keep the last link inline (prevents awkward wrap) */
.pt-description abbr.bd-tip .bd-tip__bubble > a:last-child {
  display: inline;
  margin-top: 0;
  margin-inline-start: 0;
  padding-inline-start: 0;
  text-indent: 0;
}

/* ===== Twin-triangle arrows: border under, white fill on top ===== */
.pt-description abbr.bd-tip .bd-tip__bubble::before,  /* BORDER (under) */
.pt-description abbr.bd-tip .bd-tip__bubble::after {  /* FILL (over)  */
  content: "";
  position: absolute;
  left: calc(50% - var(--bd-tip-shift, 0px));
  width: 0;
  height: 0;
  pointer-events: none;
}

/* --- Default (bubble above): arrow points DOWN just outside bottom edge --- */
/* BORDER triangle (underneath, #ddd outline) */
.pt-description abbr.bd-tip .bd-tip__bubble::before {
  top: 100%;
  border-style: solid;
  border-color: transparent;
  border-width: calc(var(--bd-tip-arrow, 6px) + 1px);
  border-top-color: #ddd;
  z-index: 30; /* under fill */
}
/* FILL triangle (white, sits 1px higher to merge edges) */
.pt-description abbr.bd-tip .bd-tip__bubble::after {
  top: calc(100% - 1px);
  border-style: solid;
  border-color: transparent;
  border-width: var(--bd-tip-arrow, 6px);
  border-top-color: #fff;
  z-index: 31; /* above border */
}

/* Show bubble */
.pt-description abbr.bd-tip.is-open .bd-tip__bubble {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* No-JS graceful open */
html:not(.bd-js) .pt-description abbr.bd-tip:hover .bd-tip__bubble,
html:not(.bd-js) .pt-description abbr.bd-tip:focus-within .bd-tip__bubble,
html:not(.bd-js) .pt-description abbr.bd-tip .bd-tip__bubble:hover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Flip: bubble below trigger (arrow points UP at top edge) */
.pt-description abbr.bd-tip.bd-tip--below .bd-tip__bubble {
  bottom: auto;
  top: calc(100% + var(--bd-tip-gap));
}

/* BORDER triangle for UP arrow (under) */
.pt-description abbr.bd-tip.bd-tip--below .bd-tip__bubble::before {
  top: auto;
  bottom: 100%;
  border-style: solid;
  border-color: transparent;
  border-width: calc(var(--bd-tip-arrow, 6px) + 1px);
  border-bottom-color: #ddd;
  z-index: 30; /* under fill */
}
/* FILL triangle for UP arrow (white, over) */
.pt-description abbr.bd-tip.bd-tip--below .bd-tip__bubble::after {
  top: auto;
  bottom: calc(100% - 1px);
  border-style: solid;
  border-color: transparent;
  border-width: var(--bd-tip-arrow, 6px);
  border-bottom-color: #fff;
  z-index: 31; /* above border */
}

/* Hover bridge to prevent flicker across the gap */
.pt-description abbr.bd-tip .bd-tip__bubble > i.bd-tip__bridge {
  position: absolute;
  left: 0;
  right: 0;
  height: 12px;
  bottom: -12px;
  display: block;
  pointer-events: none;
}
.pt-description abbr.bd-tip.bd-tip--below .bd-tip__bridge {
  bottom: auto;
  top: -12px;
}

/* Mobile tuning */
@media (max-width: 520px) {
  .pt-description abbr.bd-tip .bd-tip__bubble {
    bottom: auto;
    top: calc(100% + var(--bd-tip-gap));
    min-inline-size: 14rem;
    max-inline-size: 92vw;
  }
  .pt-description { --bd-tip-shift: 60px; }
}

/* Accessibility polish */
/* 1) Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .pt-description abbr.bd-tip .bd-tip__bubble {
    transition: none;
  }
}

/* 2) High-contrast / forced-colors support */
@media (forced-colors: active) {
  .pt-description abbr.bd-tip .bd-tip__bubble {
    border: 1px solid ButtonText;
    background: Canvas;
    color: CanvasText;
    box-shadow: none;
  }
}


/* ==============================
   Field Checklist ˇX layout & controls
   ============================== */
.pt-description .bd-checklist__wrap {
  margin: .25rem 0 1rem 0;
  padding: .5rem .75rem;
  border-left: 3px solid var(--bd-green);
  background: #f9faf7;
}

.pt-description .bd-checklist__title {
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 600;
  color: var(--bd-text);
  margin: 0 0 .35rem 0;
}

.pt-description .bd-checklist__controls {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin: 0 0 .5rem 0;
}

.pt-description .bd-checklist__btn {
  appearance: none;
  border: 1px solid #d8e3c4;
  background: #eef6e3;
  padding: .3rem .6rem;
  border-radius: .4rem;
  font-size: .875rem;
  cursor: pointer;
}

.pt-description .bd-checklist__btn:hover {
  background: #d7e6c5;
}

/* ==============================
   Checklist items ˇX chip layout
   ============================== */
.pt-description .bd-checklist {
  display: flex;
  flex-wrap: wrap;           /* multi-row chips */
  gap: .5rem .75rem;         /* row gap | column gap */
  list-style: none;
  margin: .25rem 0 0 0;      /* no left indent */
  padding: 0;
}

.pt-description .bd-checklist li {
  display: inline-flex;      /* shrink-wrap to checkbox + label */
  align-items: center;
  gap: .25rem;                /* closer spacing between checkbox & text */
  padding: .1rem .4rem;      /* breathing room inside chip */
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.pt-description .bd-checklist li:hover {
  background-color: rgba(26, 115, 232, 0.08); /* hover only around clickable unit */
}

.pt-description .bd-checklist li input[type="checkbox"] {
  inline-size: 1.05rem;
  block-size: 1.05rem;
  margin: 0;
  cursor: pointer;
}

.pt-description .bd-checklist li label {
  cursor: pointer;
  user-select: none;
}

.pt-description .bd-checklist li.is-done label {
  color: #555;
  text-decoration: line-through;
  text-decoration-thickness: .06em;
  text-underline-offset: .08em;
}

/* Accessible focus ring ˇX only on the checkbox */
.pt-description .bd-checklist li input[type="checkbox"]:focus-visible {
  outline: 2px solid #1a73e8;   /* blue focus ring */
  outline-offset: 2px;          /* little breathing room */
  border: 2px solid #1a73e8;    /* keep the checkbox border blue */
}

/* ==============================
   Checklist counters & summary label underline control
   ============================== */
/* Prevent parent <summary> underline from painting across children (accordions only) */
.pt-description .bd-checklist-accordion > summary {
  text-decoration: none;
}

/* Underline only the wrapped label text in <summary> */
.pt-description .bd-checklist-accordion > summary .bd-checklist__label {
  text-decoration: underline dotted;
  text-underline-offset: .08em;
}

/* Hover color on the label (counter remains muted) */
.pt-description .bd-checklist-accordion > summary:hover .bd-checklist__label {
  color: var(--bd-green);
}

/* Counter: clean look (no underline), small gap, muted color */
.pt-description .bd-checklist__count {
  margin-left: .35em;
  font-size: .9em;
  color: var(--bd-muted);
  text-decoration: none !important;
}


/* ==============================
   Checkbox baseline nudge
   ============================== */
@supports (translate: 0) {
  .pt-description .bd-checklist li input[type="checkbox"] {
    translate: 0 var(--bd-checkbox-nudge);
  }
}

@supports not (translate: 0) {
  .pt-description .bd-checklist li input[type="checkbox"] {
    position: relative;
    top: var(--bd-checkbox-nudge);
  }
}


/* ==============================
   No-JS fallback for checklist <summary>
   ============================== */
html:not(.bd-js) .pt-description .bd-checklist-accordion > summary {
  text-decoration: underline dotted;
  text-underline-offset: .08em;
}


/* ==============================
   (Optional) Popover styles (image popovers)
   ============================== */
/* Hide inline popover figures by default; script can move into .bd-popover */
.pt-description .bd-pop[data-pop] > figure {
  display: none;
}

/* Popover shell */
.pt-description .bd-popover {
  position: fixed;
  z-index: 9999;
  max-width: min(92vw, 640px);
  max-height: 92vh;
  background: #fff;
  color: #111;
  border: 1px solid #ddd;
  border-radius: .5rem;
  box-shadow: 0 12px 30px rgba(0,0,0,.2);
  padding: .5rem;
  outline: none;
}

.pt-description .bd-popover:focus {
  outline: 2px solid var(--bd-blue);
  outline-offset: 2px;
}

/* Popover content */
.pt-description .bd-popover figure {
  margin: 0;
}

.pt-description .bd-popover figure img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: .35rem;
}

.pt-description .bd-popover figure figcaption {
  margin-top: .4rem;
  font-size: .9rem;
  color: #333;
  line-height: 1.4;
}

/* Close button (new & legacy class) */
.pt-description .bd-popover .bd-popover__close,
.pt-description .bd-popover .bd-pop-close {
  position: absolute;
  top: .35rem;
  right: .35rem;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: .35rem;
  padding: .15rem .4rem;
  cursor: pointer;
}

/* Mobile: full-screen popover */
@media (max-width: 520px) {
  .pt-description .bd-popover {
    inset: 0 !important;
    max-width: none;
    max-height: none;
    border-radius: 0;
    border: none;
    padding: 1rem;
    background: rgba(255,255,255,0.98);
  }
}
