/* =======================================================================
   BugDorm Product Page House Style ¡V Usage Cheat Sheet (complete CSS)
   Scope: wrap page HTML with <div class="pt-description"> ¡K </div>
   Includes tooltip system with centered-on-trigger arrows + bubble shift
   ======================================================================= */

/* ------------------------
   Design tokens (variables)
   Used throughout for easy updates
------------------------- */
.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 (footnotes, field story, disclaimer) */
  --bd-warn: #b00020;            /* warning red (alerts, ! notes) */
  --bd-li-gap: .25rem;           /* vertical spacing between list items */
  --bd-para-gap: 1rem;           /* vertical spacing between paragraphs */
  --bd-h3-size: 1.125rem;        /* consistent H3 font size */
  --bd-tagline-size: clamp(1.25rem, 2vw + .8rem, 1.6rem); /* responsive tagline size */

  /* Tooltip spacing tokens: JS reads these so spacing stays in sync */
  --bd-tip-gap: 8px;             /* visual gap between trigger and bubble */
  --bd-tip-arrow: 6px;           /* triangle arrow size */

  /* NEW: bubble horizontal offset; arrow stays centered on trigger */
  --bd-tip-shift: 140px;         /* move bubble right by default; arrow stays on trigger center */
}

/* ------------------------
   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
------------------------- */
.pt-description p {
  margin: 0 0 var(--bd-para-gap) 0;
  line-height: 1.6;
  color: var(--bd-text);
}

/* ------------------------
   Lists
------------------------- */
.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)
------------------------- */
.pt-description a {
  text-decoration: underline;
  text-underline-offset: .08em;
}
.pt-description a:hover {
  text-decoration-thickness: auto;
}
.pt-description a:focus-visible {
  outline: 2px solid var(--bd-blue);
  outline-offset: 2px;
  text-decoration: none;
}

/* ------------------------
   Literature links (dense lists stay clean until hover)
------------------------- */
.pt-description a.literature-link { 
  text-decoration: none !important; 
}
.pt-description a.literature-link:hover { 
  text-decoration: underline !important; 
}

/* ------------------------
   Studies search link (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
   (except internal shop links & .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 underlines for mailto/tel/anchors */
.pt-description a[href^="mailto:"],
.pt-description a[href^="tel:"],
.pt-description a[href^="#"] { 
  text-decoration: underline; 
}

/* ------------------------
   Literature list layout ¡V two columns
------------------------- */
.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;
}

/* ------------------------
   Disclaimer block
------------------------- */
.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 Story block
------------------------- */
.pt-description .bd-fieldstory {
  margin: .25rem 0 1rem 0;
  font-size: .875rem;
  line-height: 1.6;
  color: var(--bd-muted);
}
.pt-description .bd-fieldstory .bd-fs-icon {
  margin-right: .2em;
}

/* ------------------------
   Authenticity block
------------------------- */
.pt-description .bd-auth {
  margin: 1rem 0;
  font-size: .9rem;
  line-height: 1.6;
  color: #444;
  border-left: 3px solid #8BAA35;
  padding: .5rem .75rem;
  background: #f9faf7;
}

/* ------------------------
   Alternative option note (inside <details>)
------------------------- */
.pt-description details p {
  margin: .3rem 0 0 0;
  font-size: .85rem;
  line-height: 1.6;
  color: var(--bd-muted);
}

/* ------------------------
   Warning styles
------------------------- */
.pt-description .bd-alert {
  margin: 1rem 0 1rem 0;
  line-height: 1.6;
  color: var(--bd-warn);
  font-size: .95rem;
}
.pt-description .bd-warn {
  color: var(--bd-warn);
  font-weight: 700;
}

/* ------------------------
   Utility classes
------------------------- */
.pt-description .list-note {
  margin: .35rem 0 1rem 1.25rem;
  font-size: .95em;
  color: var(--bd-muted);
}
.pt-description .no-underline { 
  text-decoration: none !important; 
}
.pt-description .no-ext::after { 
  display: none !important;
}

/* ------------------------
   Expand/Collapse image blocks
------------------------- */
.pt-description details summary {
  cursor: pointer;
  display: list-item;             /* keeps marker (?/¡¿) */
  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 {
  /* display: table;         /* shrink to content */
  /* margin: .4rem auto 0;   /* auto left+right centers it */
  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;
}

/* ¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w
   Tooltip: triggers, bubble, behavior (scoped)
   Simplified authoring: <abbr class="bd-tip" data-tip="¡K">Term</abbr>
   Optional: data-hide-delay="700", data-tip-url, data-tip-url-label
   NEW: --bd-tip-shift moves bubble right; arrows counter-shift to stay on trigger center
¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w */

/* Trigger (the underlined term) */
.pt-description abbr.bd-tip {
  position: relative;          /* anchor bubble to this */
  cursor: help;
}

/* Always dashed underline for tooltip triggers (and generic abbr) */
.pt-description a abbr.bd-tip,
.pt-description abbr.bd-tip,
.pt-description abbr[title] {
  text-decoration-line: underline !important;
  text-decoration-style: dashed;
}
@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 (older engines): emulate dashed underline */
@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 renders ABOVE the trigger) */
.pt-description abbr.bd-tip .bd-tip__bubble {
  position: absolute;
  inset-inline-start: 50%;
  /* NEW: bubble horizontally centered then shifted right by --bd-tip-shift */
  transform: translateX(calc(-50% + var(--bd-tip-shift, 0px)));
  z-index: 30;

  /* placement (above) with a variable gap */
  inset-block-end: calc(100% + var(--bd-tip-gap));

  /* box & size */
  display: block;                     /* solid box around multi-line text */
  box-sizing: border-box;
  min-inline-size: 20rem;             /* increase this for a wider minimum */
  max-inline-size: min(34rem, 90vw);  /* increase the first value for a wider cap */
  padding: .75rem .9rem;
  border-radius: .5rem;

  /* look & feel */
  background: #fff;
  color: #111;
  border: 1px solid #ddd;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);

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

  /* text */
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;

  /* hidden by default; JS toggles .is-open for linger */
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s ease, visibility .15s ease;
}

/* Arrow for the default (above) position (TOP arrow) */
/* NEW: keep arrow aligned to trigger center by counter-shifting */
.pt-description abbr.bd-tip .bd-tip__bubble::after {
  content: "";
  position: absolute;
  inset-block-start: 100%;                     /* under the bubble */
  inset-inline-start: calc(50% - var(--bd-tip-shift, 0px));
  transform: none;                             
  border: var(--bd-tip-arrow) solid transparent;
  border-top-color: #fff;                      /* arrow matches bubble background */
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.1));
  opacity: 1;
}

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

/* CSS-only fallback (only if JS didn't load) */
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;
}

/* Link behavior inside bubble */
.pt-description abbr.bd-tip .bd-tip__bubble a {
  text-decoration: underline;
  text-underline-offset: .08em;
  hyphens: auto;              /* nicer wrapping if labels are long */
  -webkit-hyphens: auto;      /* Safari/iOS */
}
.pt-description abbr.bd-tip .bd-tip__bubble a:focus-visible {
  outline: 2px solid var(--bd-blue);
  outline-offset: 2px;
  text-decoration: none;
}
/* Keep links inline¡Xdo NOT force the last link onto a new line */
.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;
}

/* Flip BELOW (via JS adding .bd-tip--below) */
.pt-description abbr.bd-tip.bd-tip--below .bd-tip__bubble {
  inset-block-end: auto;
  inset-block-start: calc(100% + var(--bd-tip-gap)); /* same variable gap when below */
}

/* Bottom arrow (when below) lives on ::before; counter-shift identical to top arrow */
.pt-description abbr.bd-tip .bd-tip__bubble::before {
  /* reset legacy full-width styles, then define triangle */
  inset-inline: auto;
  inset-inline-start: calc(50% - var(--bd-tip-shift, 0px));
  inset-inline-end: auto;
  bottom: auto;
  width: 0;
  height: 0;
  box-sizing: content-box;
  pointer-events: none;

  content: "";
  position: absolute;
  transform: none;
  top: calc(var(--bd-tip-arrow, 6px) * -1);
  border-style: solid;
  border-width: var(--bd-tip-arrow, 6px);
  border-color: transparent;
  border-bottom-color: #fff;          /* arrow fill matches bubble bg */
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.1));
  opacity: 0;                         /* hidden unless flipped below */
}

/* When below: show bottom arrow, hide top arrow */
.pt-description abbr.bd-tip.bd-tip--below .bd-tip__bubble::after { opacity: 0; }
.pt-description abbr.bd-tip.bd-tip--below .bd-tip__bubble::before { opacity: 1; }

/* Dedicated hover bridge element (not a pseudo) */
.pt-description abbr.bd-tip .bd-tip__bubble > i.bd-tip__bridge {
  position: absolute;
  left: 0; right: 0;
  height: 12px;
  bottom: -12px;                      /* default: bridge below bubble */
  display: block;
  pointer-events: none;
}
.pt-description abbr.bd-tip.bd-tip--below .bd-tip__bridge {
  bottom: auto;
  top: -12px;                         /* bridge above bubble when below */
}

/* Small screens: prefer below for readability; also reduce default shift */
@media (max-width: 520px) {
  .pt-description abbr.bd-tip .bd-tip__bubble {
    inset-block-end: auto;
    inset-block-start: calc(100% + var(--bd-tip-gap));
    min-inline-size: 14rem;
    max-inline-size: 92vw;
  }
  .pt-description {
    --bd-tip-shift: 60px; /* gentler default; JS (optional) can still clamp further */
  }
}

/* (Optional) Popover styles you carry for image popovers) */
.pt-description .bd-pop[data-pop] > figure { display: none; }
.pt-description .bd-popover {
  position: fixed;
  z-index: 9999;
  max-width: min(92vw, 640px);
  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 #1a73e8; outline-offset: 2px; }
.pt-description .bd-popover figure { margin: 0; }
.pt-description .bd-popover img { display:block; height:auto; max-width:100%; border-radius:.35rem; }
.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;
}
@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);
  }
}

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

/* Checklist inline title: body-size, bold, not competing with section H3 */
.pt-description .bd-checklist__title {
  font-size: 1rem;         /* match list item/body size */
  line-height: 1.6;
  font-weight: 600;        /* bold, but not larger */
  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: #e6f0da; }

.pt-description .bd-checklist {
  margin: .25rem 0 0 1.25rem;  /* align with site-wide list style */
  padding: 0;
  list-style: none;            /* we¡¦ll render our own checkboxes */
}

.pt-description .bd-checklist li {
  position: relative;
  margin: var(--bd-li-gap) 0;
  line-height: 1.6;
  display: flex;
  align-items: center;
  gap: .5rem;
}

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

.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;
}

/* EOF BugDorm Product Page House Style*/
/* ============================================================ */

