/* ============================================================
   GoodLives — Guided breathing widget ([gl_breathe] shortcode)
   Horizontal / landscape card that sits inline in a blog post.
   Everything is scoped under .gl-breathe AND every inner class is
   namespaced glb-* so the widget never collides with the blog's own
   .gl-btn / .gl-title / .gl-dot system (no bleed either way).
   Palette: logo green #49AF7C + sage #394B42 + white/off-white with
   hue-true green tints only. Quicksand.
   ============================================================ */

.gl-breathe{
  /* LOCKED dark-green immersive palette — always on, does not follow the
     viewer's light/dark. The GoodLives look for interactive blog widgets. */
  --gl-green:#5CC08C;
  --gl-green-dark:#49AF7C;
  --gl-sage:#0f1714;
  --gl-card:#1C2A24;        /* widget surface */
  --gl-stage:#17241E;
  --gl-stage-2:#1F3029;
  --gl-track:#2C4438;       /* the box track */
  --gl-text:#EAF5EF;
  --gl-muted:#A6C2B4;
  --gl-border:rgba(234,245,239,.10);
  --gl-shadow:0 20px 50px -24px rgba(0,0,0,.65), 0 2px 12px -6px rgba(0,0,0,.5);
  --gl-shadow-soft:0 12px 32px -20px rgba(0,0,0,.6);
  --gl-orb-core:#6FD3A6;
  --gl-orb-edge:#2F8A5E;
  --gl-orb-glow:rgba(92,192,140,.30);
  color-scheme:dark;

  --gl-radius-lg:24px;
  --gl-radius-sm:12px;
  --gl-font:"Quicksand", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;

  /* the card: a wide, balanced block that spans the content column */
  width:100%;
  max-width:720px;
  margin:32px auto;
  background:var(--gl-card);
  color:var(--gl-text);
  font-family:var(--gl-font);
  -webkit-font-smoothing:antialiased;
  border:1px solid var(--gl-border);
  border-radius:var(--gl-radius-lg);
  box-shadow:var(--gl-shadow);
  overflow:hidden;
  display:grid;
  grid-template-columns:minmax(0,0.92fr) minmax(0,1.08fr);  /* animation + readout | text */
  align-items:stretch;
}

.gl-breathe *{box-sizing:border-box;}

/* --- left: the breathing stage + live readout, stacked (layout B) --- */
.gl-breathe__stage{
  position:relative;
  background:linear-gradient(160deg, var(--gl-stage) 0%, var(--gl-stage-2) 100%);
  border-right:1px solid var(--gl-border);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:16px;
  padding:30px 24px;
}
.gl-breathe .glb-stage{
  position:relative;
  width:100%;
  aspect-ratio:1/1;
  max-width:232px;
  display:grid;
  place-items:center;
}
.gl-breathe .glb-stage svg{width:100%;height:100%;display:block;overflow:visible;}

.gl-breathe .glb-box-track{
  fill:none;
  stroke:var(--gl-track);
  stroke-width:3;
  stroke-linecap:round;
}
.gl-breathe .glb-box-prog{
  fill:none;
  stroke:var(--gl-green);
  stroke-width:4;
  stroke-linecap:round;
  filter:drop-shadow(0 1px 3px var(--gl-orb-glow));
}
.gl-breathe .glb-dot{
  fill:var(--gl-green);
  filter:drop-shadow(0 0 7px var(--gl-orb-glow));
}
.gl-breathe .glb-dot-ring{fill:var(--gl-card);stroke:var(--gl-green);stroke-width:2.5;}

/* the breathing orb lives in HTML (for smooth transforms + glow) */
.gl-breathe .glb-orb-wrap{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  pointer-events:none;
}
.gl-breathe .glb-orb{
  width:58%;
  aspect-ratio:1/1;
  border-radius:50%;
  background:
    radial-gradient(circle at 34% 30%,
      color-mix(in srgb, var(--gl-orb-core) 92%, white) 0%,
      var(--gl-orb-core) 34%,
      var(--gl-orb-edge) 100%);
  box-shadow:
    0 0 0 10px color-mix(in srgb, var(--gl-green) 9%, transparent),
    0 0 40px 6px var(--gl-orb-glow),
    inset 0 -10px 24px -8px rgba(0,0,0,.22),
    inset 0 10px 22px -6px rgba(255,255,255,.55);
  transform:scale(.56);
  will-change:transform;
  /* transform is set every frame by JS when running; this eases idle changes */
  transition:transform .5s cubic-bezier(.4,0,.2,1), box-shadow .5s ease;
}
.gl-breathe .glb-orb.is-running{transition:box-shadow .5s ease;}

/* --- right: the roomy text + controls panel (layout B) --- */
.gl-breathe__panel{
  display:flex;
  flex-direction:column;
  justify-content:center;
  text-align:center;
  padding:48px 40px;
}
.gl-breathe .glb-eyebrow{
  display:inline-flex;
  align-items:center;
  align-self:center;
  gap:8px;
  font-size:12px;
  font-weight:600;
  letter-spacing:.09em;
  text-transform:uppercase;
  color:var(--gl-green-dark);
  margin-bottom:24px;
}
.gl-breathe .glb-eyebrow-dot{
  width:7px;height:7px;border-radius:50%;
  background:var(--gl-green);
  box-shadow:0 0 0 4px color-mix(in srgb, var(--gl-green) 18%, transparent);
}

.gl-breathe .glb-title{
  margin:0 0 16px;
  font-size:25px;
  font-weight:700;
  letter-spacing:-.01em;
  line-height:1.25;
  color:var(--gl-text);
}
.gl-breathe .glb-sub{
  margin:0 auto 38px;
  font-size:14px;
  font-weight:500;
  line-height:1.65;
  color:var(--gl-muted);
  max-width:34ch;
}

/* --- phase readout (sits under the orb, in the left stage) --- */
.gl-breathe .glb-readout{
  display:flex;
  align-items:baseline;
  justify-content:center;
  gap:10px;
  min-height:30px;
}
.gl-breathe .glb-phase{
  font-size:21px;
  font-weight:600;
  letter-spacing:.01em;
  color:var(--gl-text);
  transition:color .3s ease;
}
.gl-breathe .glb-count{
  font-size:21px;
  font-weight:600;
  font-variant-numeric:tabular-nums;
  color:var(--gl-green-dark);
  min-width:1.2ch;
  text-align:left;
}
.gl-breathe .glb-count.is-idle{color:var(--gl-muted);opacity:.5;}

.gl-breathe .glb-hint{
  font-size:12.5px;
  font-weight:500;
  letter-spacing:.02em;
  color:var(--gl-muted);
  text-align:center;
  min-height:18px;
  margin:-6px 0 0;
}

/* --- controls --- */
.gl-breathe .glb-controls{
  display:flex;
  align-items:center;
  gap:10px;
}
.gl-breathe .glb-btn{
  appearance:none;
  font-family:inherit;
  font-weight:600;
  cursor:pointer;
  border-radius:var(--gl-radius-sm);
  transition:background .2s, color .2s, border-color .2s, transform .08s, box-shadow .2s;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:9px;
  margin:0;
  line-height:1;
}
.gl-breathe .glb-btn:active{transform:scale(.97);}
.gl-breathe .glb-btn:focus-visible{outline:2px solid var(--gl-green);outline-offset:2px;}

.gl-breathe .glb-btn svg{width:19px;height:19px;flex:none;}

.gl-breathe .glb-btn--primary{
  flex:1;
  height:50px;
  font-size:16px;
  background:var(--gl-green);
  color:#fff;
  border:1px solid transparent;
  box-shadow:var(--gl-shadow-soft);
}
.gl-breathe .glb-btn--primary:hover{background:var(--gl-green-dark);}

.gl-breathe .glb-btn--ghost{
  height:50px;
  padding:0 16px;
  background:transparent;
  color:var(--gl-text);
  border:1px solid var(--gl-border);
}
.gl-breathe .glb-btn--ghost:hover{background:var(--gl-stage);}

.gl-breathe .glb-btn--icon{
  width:50px;height:50px;padding:0;
  background:transparent;
  color:var(--gl-text);
  border:1px solid var(--gl-border);
}
.gl-breathe .glb-btn--icon:hover{background:var(--gl-stage);}
.gl-breathe .glb-btn--icon.is-off{color:var(--gl-muted);}
.gl-breathe .glb-btn--icon .ico-off{display:none;}
.gl-breathe .glb-btn--icon.is-off .ico-on{display:none;}
.gl-breathe .glb-btn--icon.is-off .ico-off{display:block;}

/* --- stack to vertical on narrow screens / phones --- */
@media (max-width:560px){
  .gl-breathe{
    grid-template-columns:1fr;
  }
  .gl-breathe__stage{
    border-right:none;
    border-bottom:1px solid var(--gl-border);
    padding:28px 24px;
  }
  .gl-breathe .glb-stage{max-width:220px;}
  .gl-breathe__panel{
    padding:26px 20px 24px;
  }
  .gl-breathe .glb-sub{margin-bottom:22px;}
}

@media (max-width:420px){
  .gl-breathe .glb-title{font-size:22px;}
  .gl-breathe .glb-phase,.gl-breathe .glb-count{font-size:20px;}
  .gl-breathe .glb-btn--primary{font-size:15px;}
}

@media (prefers-reduced-motion: reduce){
  .gl-breathe .glb-orb{transition:none;}
  .gl-breathe .glb-btn{transition:none;}
}
