/* ============================================================
   PockBox shared module stylesheet
   Version 1.0  |  19 August 2026

   Enqueue ONCE site-wide (Divi > Theme Options > Custom CSS, or a
   child-theme wp_enqueue_style). Do NOT paste this into individual
   page modules; page modules should contain markup only.

   Everything is scoped under .pb-mod so nothing leaks into Divi.

   NO HORIZONTAL SCROLL is a hard requirement of this sheet:
   - no fixed pixel widths on any layout element
   - min-width:0 on every descendant (the real cause of grid/flex overflow)
   - overflow-wrap:anywhere on all text
   - images capped at 100%
   - chip rows wrap, they never scroll sideways
   ============================================================ */

.pb-mod{
  --pb-ink:#151a21;
  --pb-body:#4a545f;
  --pb-muted:#77828f;
  --pb-line:#e4e8ee;
  --pb-line-2:#f0f3f7;
  --pb-surface:#ffffff;
  --pb-sunken:#f7f9fb;
  --pb-brand:#ef4541;
  --pb-brand-dark:#cf322e;
  --pb-brand-tint:#fff5f5;
  --pb-gold:#8a6410;
  --pb-gold-bg:#fdf3dc;
  --pb-green:#0f7b4f;
  --pb-green-bg:#e8f6ef;
  --pb-radius:14px;
  --pb-shadow:0 1px 2px rgba(21,26,33,.05), 0 4px 14px rgba(21,26,33,.06);

  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  color:var(--pb-body);
  font-size:16px;
  line-height:1.55;
  max-width:100%;
  overflow-x:clip;
  -webkit-text-size-adjust:100%;
}
/* Each section ships as its own Code module, so sibling .pb-mod blocks sit flush against
   each other. Divi gives them no margin and the section-opening h2 has its top margin
   zeroed below, which left headings touching the paragraph above them. */
.pb-mod + .pb-mod{ margin-top:38px; }
.pb-sticky + .pb-mod, .pb-mod + .pb-sticky{ margin-top:0; }

.pb-mod *,.pb-mod *::before,.pb-mod *::after{ box-sizing:border-box; min-width:0; }
.pb-mod img{ max-width:100%; height:auto; }
.pb-mod p,.pb-mod dd,.pb-mod dt,.pb-mod li,.pb-mod h2,.pb-mod h3,.pb-mod h4,.pb-mod td,.pb-mod th{ overflow-wrap:anywhere; }
.pb-mod [hidden]{ display:none !important; }

/* ---------- shared focus ---------- */
.pb-mod a:focus-visible,.pb-mod button:focus-visible,
.pb-mod summary:focus-visible,.pb-mod select:focus-visible{
  outline:3px solid #1a73e8; outline-offset:2px;
}

/* ============================================================
   1. DISCLOSURE
   ============================================================ */
.pb-disclosure{
  margin:0 0 16px; padding:10px 12px;
  background:var(--pb-sunken); border:1px solid var(--pb-line);
  border-radius:10px; font-size:13px; line-height:1.5; color:var(--pb-muted);
}
.pb-disclosure a{ color:var(--pb-body); text-decoration:underline; }

/* ============================================================
   2. CTA BUTTONS
   ============================================================ */
.pb-cta{
  display:block; width:100%; margin-top:auto;
  padding:16px 18px;
  background:var(--pb-brand); color:#fff !important;
  font-size:17px; font-weight:800; letter-spacing:.01em;
  text-align:center; text-decoration:none !important;
  border-radius:11px; box-shadow:0 2px 0 var(--pb-brand-dark);
  transition:transform .12s ease, background .15s ease;
}
.pb-cta:hover{ background:var(--pb-brand-dark); transform:translateY(1px); box-shadow:0 1px 0 var(--pb-brand-dark); }
.pb-cta--alt{ background:var(--pb-ink); box-shadow:0 2px 0 #000; }
.pb-cta--alt:hover{ background:#000; }
.pb-cta--ghost{
  background:transparent; color:var(--pb-body) !important;
  border:1px solid var(--pb-line); box-shadow:none;
  font-size:15px; font-weight:700; padding:12px 16px;
}
.pb-cta--ghost:hover{ background:#fff; border-color:#c9d1db; transform:none; }
.pb-cta--sm{ font-size:15px; padding:13px 16px; }
.pb-cta__note{ margin:7px 0 0; font-size:12px; color:var(--pb-muted); text-align:center; }

/* ============================================================
   3. DIRECTORY CARDS
   ============================================================ */
.pb-controls{ display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin:0 0 18px; }
.pb-filters{ display:flex; flex-wrap:wrap; gap:8px; flex:1 1 auto; }
.pb-chip{
  appearance:none; border:1px solid var(--pb-line); background:var(--pb-surface);
  color:var(--pb-body); font:inherit; font-size:14px; font-weight:600; line-height:1.2;
  padding:9px 14px; border-radius:999px; cursor:pointer;
  transition:background .15s ease,border-color .15s ease,color .15s ease;
}
.pb-chip:hover{ border-color:#c9d1db; background:var(--pb-sunken); }
.pb-chip.is-on{ background:var(--pb-ink); border-color:var(--pb-ink); color:#fff; }
.pb-sort{ display:flex; align-items:center; gap:6px; flex:0 0 auto; }
.pb-sort__label{ font-size:13px; color:var(--pb-muted); font-weight:600; }
.pb-sort select{
  font:inherit; font-size:14px; font-weight:600; color:var(--pb-body);
  padding:8px 10px; border:1px solid var(--pb-line); border-radius:9px;
  background:var(--pb-surface); max-width:100%;
}
.pb-empty{ font-size:15px; padding:18px 0; }
.pb-linkbtn{
  appearance:none; border:0; background:none; padding:0; font:inherit;
  font-weight:700; color:var(--pb-brand); text-decoration:underline; cursor:pointer;
}

/* Divi sets h2{font-size:16px} on the entry content, which beat the component rules and
   left every h2 smaller than the h3s under it. Restore a real hierarchy inside .pb-mod.
   Component headings below re-declare their own size and still win on specificity. */
.pb-mod h2{ margin:34px 0 10px; font-size:23px; line-height:1.22; font-weight:800; color:var(--pb-ink); letter-spacing:-.015em; }
.pb-mod h3{ margin:26px 0 8px; font-size:18px; line-height:1.3; font-weight:700; color:var(--pb-ink); letter-spacing:-.01em; }
.pb-mod h4{ margin:20px 0 6px; font-size:16px; line-height:1.35; font-weight:700; color:var(--pb-ink); }
.pb-mod > h2:first-child, .pb-mod > h3:first-child{ margin-top:0; }
@media (min-width:600px){
  .pb-mod h2{ font-size:26px; }
  .pb-mod h3{ font-size:19px; }
}

/* Directory section headings are h2s, so they take the scale above. Margin only. */
.pb-mod .pb-sec{ margin:26px 0 4px; }
.pb-mod .pb-sec--first{ margin-top:0; }
.pb-mod .pb-sec__note{ margin:0 0 14px; font-size:13px; color:var(--pb-muted); }
.pb-sec + .pb-grid{ margin-top:14px; }

.pb-grid{ display:grid; grid-template-columns:1fr; gap:14px; }

.pb-card{
  background:var(--pb-surface); border:1px solid var(--pb-line);
  border-radius:var(--pb-radius); box-shadow:var(--pb-shadow);
  padding:16px; display:flex; flex-direction:column;
}
.pb-card--plain{ box-shadow:none; background:var(--pb-sunken); }

.pb-card__head{ display:flex; align-items:center; gap:12px; margin-bottom:14px; }
.pb-card__id{ display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.pb-mod .pb-card__name{ margin:0; font-size:20px; font-weight:800; color:var(--pb-ink); letter-spacing:-.01em; line-height:1.2; }

/* Product shot inside a card. Fixed aspect box so the reserved space matches the file and
   the card does not jump when a lazy image arrives. */
.pb-card__shot{
  display:block; width:100%; height:auto; aspect-ratio:3/2; object-fit:cover;
  border:1px solid var(--pb-line); border-radius:10px; margin:0 0 14px; background:var(--pb-sunken);
}
.pb-card__shot--wide{ aspect-ratio:1024/530; object-fit:contain; }
.pb-pick{
  display:inline-block; background:var(--pb-gold-bg); color:var(--pb-gold);
  font-size:11px; font-weight:800; letter-spacing:.06em; text-transform:uppercase;
  padding:4px 8px; border-radius:6px; white-space:nowrap;
}
.pb-pick--fit{ background:var(--pb-green-bg); color:var(--pb-green); }

/* avatar: real icon over a monogram fallback */
.pb-avatar{
  position:relative; flex:0 0 auto; width:52px; height:52px;
  border-radius:13px; border:1px solid var(--pb-line);
  background:linear-gradient(160deg,#fff,#eef2f7); overflow:hidden;
}
.pb-avatar--light{ background:#fff; }
.pb-avatar::before{
  content:attr(data-mono); position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
  font-size:20px; font-weight:800; color:var(--pb-ink); letter-spacing:-.02em;
}
.pb-icon{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; background:#fff; }
.pb-icon--pad{ object-fit:contain; padding:6px; }
.pb-avatar.is-missing .pb-icon{ display:none; }

/* stats: rows on mobile, columns on wider */
.pb-stats{
  margin:0 0 14px; padding:12px 14px; background:var(--pb-sunken);
  border-radius:11px; display:grid; grid-template-columns:1fr; gap:8px;
}
.pb-card--plain .pb-stats{ background:#fff; }
.pb-stat{
  display:flex; align-items:baseline; justify-content:space-between; gap:12px;
  padding-bottom:8px; border-bottom:1px solid var(--pb-line-2);
}
.pb-stat:last-child{ padding-bottom:0; border-bottom:0; }
.pb-stat dt{ font-size:13px; color:var(--pb-muted); flex:1 1 auto; }
.pb-stat dd{ margin:0; font-size:15px; font-weight:800; color:var(--pb-ink); text-align:right; flex:0 1 auto; }

.pb-card__desc{ margin:0 0 12px; font-size:15px; line-height:1.6; }

.pb-note{
  margin:0 0 12px; padding:9px 12px;
  background:var(--pb-brand-tint); border-left:3px solid var(--pb-brand);
  border-radius:0 8px 8px 0; font-size:14px; font-weight:600; color:var(--pb-ink);
}
.pb-note--info{ background:var(--pb-sunken); border-left-color:var(--pb-ink); font-weight:500; }

/* Divi styles .entry-content li with list-style:disc at a higher specificity than a
   bare .pb-tags rule, which put a bullet on every chip. Match it on both elements. */
.pb-mod .pb-tags{ list-style:none; margin:0 0 14px; padding:0; display:flex; flex-wrap:wrap; gap:6px; }
.pb-mod .pb-tags li{
  list-style:none; display:inline-flex; align-items:center;
  font-size:12px; font-weight:700; color:var(--pb-body);
  background:var(--pb-sunken); border:1px solid var(--pb-line);
  padding:4px 9px; border-radius:6px; margin:0;
}
.pb-mod .pb-tags li::marker{ content:none; }
.pb-mod .pb-card--plain .pb-tags li{ background:#fff; }

.pb-more{ margin-top:14px; border-top:1px solid var(--pb-line-2); padding-top:12px; }
.pb-more summary{
  cursor:pointer; list-style:none; font-size:14px; font-weight:700; color:var(--pb-body);
  display:inline-flex; align-items:center; gap:6px;
}
.pb-more summary::-webkit-details-marker{ display:none; }
.pb-more summary::after{
  content:""; width:7px; height:7px;
  border-right:2px solid currentColor; border-bottom:2px solid currentColor;
  transform:rotate(45deg) translateY(-2px); transition:transform .18s ease;
}
.pb-more[open] summary::after{ transform:rotate(-135deg) translateY(-2px); }
.pb-facts{ margin:12px 0 0; }
.pb-facts dt{ font-size:13px; font-weight:800; color:var(--pb-ink); margin-top:10px; }
.pb-facts dt:first-child{ margin-top:0; }
.pb-facts dd{ margin:2px 0 0; font-size:14px; line-height:1.55; }
.pb-review{ display:inline-block; margin-top:14px; font-size:14px; font-weight:700; color:var(--pb-brand); text-decoration:underline; }

/* ============================================================
   4. ALTERNATIVES BLOCK  ("Looking for something like X?")
   ============================================================ */
.pb-alt{ display:grid; grid-template-columns:1fr; gap:12px; margin:0 0 8px; }
.pb-alt__item{
  border:1px solid var(--pb-line); border-radius:var(--pb-radius);
  background:var(--pb-surface); padding:16px;
}
.pb-alt__q{ margin:0 0 8px; font-size:17px; font-weight:800; color:var(--pb-ink); line-height:1.3; }
.pb-alt__a{ margin:0 0 12px; font-size:15px; line-height:1.6; }
.pb-alt__ctas{ display:flex; flex-wrap:wrap; gap:8px; }
.pb-alt__ctas .pb-cta{ flex:1 1 200px; width:auto; margin-top:0; }

/* ============================================================
   5. AMOUNT PICKER
   ============================================================ */
.pb-amounts{ display:grid; grid-template-columns:1fr; gap:8px; margin:0 0 18px; }
.pb-amounts a{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:14px 16px; border:1px solid var(--pb-line); border-radius:11px;
  background:var(--pb-surface); text-decoration:none !important;
  font-size:16px; font-weight:700; color:var(--pb-ink) !important;
  transition:border-color .15s ease, background .15s ease;
}
.pb-amounts a:hover{ border-color:var(--pb-brand); background:var(--pb-brand-tint); }
.pb-amounts span{ font-size:13px; font-weight:600; color:var(--pb-muted); text-align:right; }

/* ============================================================
   6. SUMMARY TABLE  (stacks on mobile, never scrolls)
   ============================================================ */
.pb-table{ margin:0 0 18px; }
.pb-table__row{
  border:1px solid var(--pb-line); border-radius:12px;
  background:var(--pb-surface); padding:14px; margin-bottom:10px;
}
.pb-mod .pb-table__name{ margin:0 0 8px; font-size:16px; font-weight:800; color:var(--pb-ink); }
.pb-table__cells{ display:grid; grid-template-columns:1fr; gap:6px; margin:0; }
.pb-table__cell{ display:flex; justify-content:space-between; gap:12px; font-size:14px; }
.pb-table__cell dt{ color:var(--pb-muted); }
.pb-table__cell dd{ margin:0; font-weight:700; color:var(--pb-ink); text-align:right; }

/* ============================================================
   7. NEED-MORE BAND  (routes to /canada-loans/ or the LC iframe)
   ============================================================ */
.pb-band{
  margin:18px 0 0; padding:20px 18px;
  border:1px solid var(--pb-line); border-radius:var(--pb-radius);
  background:linear-gradient(165deg,#fbfcfe,#f2f5f9);
}
.pb-band__eyebrow{ margin:0 0 4px; font-size:12px; font-weight:800; letter-spacing:.07em; text-transform:uppercase; color:var(--pb-brand); }
.pb-mod .pb-band__head{ margin:0 0 8px; font-size:20px; font-weight:800; color:var(--pb-ink); line-height:1.25; letter-spacing:-.01em; }
.pb-band__desc{ margin:0 0 14px; font-size:15px; }

/* ============================================================
   8. IFRAME WRAPPER  (Loans Canada widget)
   ============================================================ */
.pb-iframe{ margin:0 0 8px; max-width:100%; }
.pb-iframe iframe{ display:block; width:100% !important; max-width:100% !important; border:0; }

/* ============================================================
   9. STICKY MOBILE CTA  (mobile only, dismissible)
   ============================================================ */
.pb-sticky{
  position:fixed; left:0; right:0; bottom:0; z-index:9999;
  display:flex; align-items:center; gap:10px;
  padding:10px 12px calc(10px + env(safe-area-inset-bottom));
  background:rgba(255,255,255,.97); border-top:1px solid var(--pb-line);
  box-shadow:0 -4px 18px rgba(21,26,33,.10);
  transform:translateY(110%); transition:transform .22s ease;
}
.pb-sticky.is-up{ transform:translateY(0); }
.pb-sticky__txt{ flex:1 1 auto; font-size:13px; line-height:1.3; color:var(--pb-body); }
.pb-sticky__txt strong{ display:block; font-size:14px; color:var(--pb-ink); }
.pb-sticky .pb-cta{ flex:0 0 auto; width:auto; margin:0; padding:12px 16px; font-size:15px; }
.pb-sticky__x{
  appearance:none; border:0; background:none; padding:6px; cursor:pointer;
  font-size:18px; line-height:1; color:var(--pb-muted); flex:0 0 auto;
}
@media (min-width:900px){ .pb-sticky{ display:none; } }

/* ============================================================
   10. FOOTER / PROVENANCE
   ============================================================ */
.pb-verify{
  margin:20px 0 0; padding-top:14px; border-top:1px solid var(--pb-line-2);
  font-size:13px; color:var(--pb-muted);
}
.pb-verify a{ color:var(--pb-body); text-decoration:underline; }

/* ============================================================
   BREAKPOINTS  (mobile-first: everything above is the default)
   ============================================================ */
@media (min-width:600px){
  .pb-stats{ grid-template-columns:repeat(3,1fr); gap:0; padding:14px; }
  .pb-stat{ display:block; text-align:center; padding:0 12px; border-bottom:0; border-right:1px solid var(--pb-line-2); }
  .pb-stat:last-child{ border-right:0; }
  .pb-stat dt{ display:block; font-size:12px; margin-bottom:3px; }
  .pb-stat dd{ text-align:center; font-size:16px; }
  .pb-cta{ width:auto; min-width:230px; margin-right:auto; }
  .pb-cta__note{ text-align:left; }
  .pb-amounts{ grid-template-columns:repeat(3,1fr); }
  .pb-amounts a{ flex-direction:column; align-items:flex-start; gap:2px; }
  .pb-amounts span{ text-align:left; }
  .pb-table__cells{ grid-template-columns:repeat(2,1fr); gap:6px 18px; }
  .pb-band{ padding:26px 24px; }
}

@media (min-width:900px){
  .pb-grid{ grid-template-columns:repeat(2,1fr); gap:16px; }
  .pb-card{ padding:20px; }
  .pb-alt{ grid-template-columns:repeat(2,1fr); }
  .pb-mod .pb-band__head{ font-size:23px; }
  .pb-band__desc{ max-width:62ch; }
  .pb-table__cells{ grid-template-columns:repeat(4,1fr); }
}

@media (prefers-reduced-motion:reduce){
  .pb-mod *,.pb-sticky{ transition:none !important; animation:none !important; }
}

/* ---------- byline ---------- */
.pb-byline{
  margin:0 0 16px; font-size:13px; line-height:1.5; color:var(--pb-muted);
}
.pb-byline a{ color:var(--pb-body); text-decoration:underline; }
.pb-byline__sep{ margin:0 4px; }

/* ---------- author bio ---------- */
.pb-author{
  display:flex; gap:14px; align-items:flex-start;
  margin:24px 0 0; padding:16px;
  background:var(--pb-sunken); border:1px solid var(--pb-line);
  border-radius:var(--pb-radius);
}
.pb-author__img{
  flex:0 0 auto; width:64px; height:64px;
  border-radius:50%; object-fit:cover; background:#fff;
  border:1px solid var(--pb-line);
}
.pb-mod .pb-author__name{ margin:0 0 6px; font-size:16px; font-weight:800; color:var(--pb-ink); }
.pb-mod .pb-author__name a{ color:inherit; text-decoration:none; }
.pb-mod .pb-author__name a:hover{ text-decoration:underline; }
.pb-author__bio{ margin:0; font-size:14px; line-height:1.6; }
@media (min-width:600px){
  .pb-author{ padding:20px; gap:18px; }
  .pb-author__img{ width:88px; height:88px; }
}
