/* ============================================================
   TOOL PAGE HERO — /tools/{slug}/
   Registered with page_css() from app/Views/tool.php, so it loads
   after goji-main.css and refines the .gs-th-* rules that live
   there rather than fighting them at equal specificity.

   ⚠ MOBILE-FIRST. Every breakpoint below WIDENS (min-width); do
     not add a max-width query here — the base rules are the phone
     layout and a narrowing query would have to undo them.

   ⚠ Every var() carries a literal fallback. An undefined custom
     property inside a shorthand is invalid at computed-value time
     and drops the WHOLE declaration (a border disappears entirely
     rather than falling back to a colour).
   ============================================================ */

/* ---------- band ------------------------------------------------
   The house hero wash — purple in, green out — the same one .cat-hero,
   .cmp-hero and the homepage already use, so a tool page opens in the
   site's colours instead of on bare white. Every tool page gets it;
   the illustrated ones get it a shade deeper, because the white cards
   floating in the artwork need something to sit against.

   ⚠ GRADIENTS ONLY, NO POSITIONED BLOBS. The blob pattern elsewhere
     needs `position:relative;overflow:hidden` on the band, and the
     illustration inside this one deliberately overflows its stage —
     clipping it would cut the corner tiles off.
   ⚠ The wash is kept light on purpose: the copy, the chips and the
     price on this band are all dark-on-light, and a mid-tone ground
     would drop the muted text under its contrast floor. What darkens
     below is the muted text, not the background. */
.gs-tool-heroband {
  background:
    radial-gradient(760px 420px at 88% 6%, rgba(124, 58, 237, .16), transparent 68%),
    radial-gradient(620px 380px at 2% 98%, rgba(61, 139, 55, .10), transparent 70%),
    linear-gradient(158deg, #F1ECFF 0%, #FBF9FF 44%, #F4FBF3 100%);
  border-bottom: 1px solid var(--gs-bd0, #e2e8f0);
}
.gs-tool-heroband.has-visual {
  background:
    radial-gradient(900px 470px at 82% 12%, rgba(124, 58, 237, .21), transparent 70%),
    radial-gradient(680px 420px at 0% 100%, rgba(61, 139, 55, .12), transparent 70%),
    linear-gradient(158deg, #EAE3FF 0%, #F8F5FF 46%, #F1FAF1 100%);
}

[data-theme="dark"] .gs-tool-heroband,
[data-theme="dark"] .gs-tool-heroband.has-visual {
  background:
    radial-gradient(900px 470px at 82% 12%, rgba(139, 92, 246, .22), transparent 70%),
    radial-gradient(680px 420px at 0% 100%, rgba(34, 197, 94, .10), transparent 70%),
    linear-gradient(158deg, #1A0B3D 0%, #0C0E14 52%, #071407 100%);
}

/* ---------- text on the wash ------------------------------------
   Tertiary grey (#6B7280) is specified against white. On the tinted
   ground it reads washed out, so the secondary tone carries the
   breadcrumb, the tagline and the meta row instead. Scoped to the
   band — the same classes on white pages keep their own colour. */
.gs-tool-heroband .gs-breadcrumb a { color: var(--gs-tx1, #374151); }
.gs-tool-heroband .gs-breadcrumb a:hover { color: var(--gs-cp-t, #5b21b6); }
.gs-tool-heroband .gs-th .gs-cat-lead { color: var(--gs-tx1, #374151); }
.gs-tool-heroband .gs-th-meta,
.gs-tool-heroband .gs-th-meta.text-muted { color: var(--gs-tx1, #374151); }
.gs-tool-heroband .gs-th-eyebrow,
.gs-tool-heroband .gs-th-per { color: var(--gs-tx1, #374151); }
[data-theme="dark"] .gs-tool-heroband .gs-breadcrumb a,
[data-theme="dark"] .gs-tool-heroband .gs-th .gs-cat-lead,
[data-theme="dark"] .gs-tool-heroband .gs-th-meta,
[data-theme="dark"] .gs-tool-heroband .gs-th-meta.text-muted { color: var(--gs-tx1, #B4BAD0); }

/* ---------- layout ---------------------------------------------- */
.gs-th { display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: start; }
.gs-th-main { min-width: 0; }

.gs-th-head { display: flex; align-items: center; gap: 1.1rem; margin-bottom: 1rem; }

.gs-th .gs-tc-logo-lg {
  width: 84px; height: 84px; flex: 0 0 84px;
  border-radius: 22px;
  background: var(--gs-sf0, #ffffff);
  border: 1px solid var(--gs-bd0, #e2e8f0);
  box-shadow: 0 10px 30px -18px rgba(15, 23, 42, .35);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.1rem;
  color: var(--gs-cp, #5b21b6);
  overflow: hidden;
}
.gs-th .gs-tc-logo-lg img { width: 100%; height: 100%; object-fit: contain; padding: .55rem; }

.gs-th h1.gs-cat-h1 {
  font-size: clamp(1.9rem, 5.2vw, 3rem);
  line-height: 1.08;
  letter-spacing: -.02em;
  margin: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem;
}
.gs-th .gs-cat-lead {
  font-size: 1.0625rem;
  line-height: 1.6;
  max-width: 34rem;
  color: var(--gs-tx2, #64748b);
  margin: 0 0 1.1rem;
}

/* ---------- benefit chips --------------------------------------
   Per-tool copy (App\Core\ToolHero) — never hardcoded, because
   this one view also renders a CRM and a helpdesk. */
.gs-th-chips {
  display: flex; flex-wrap: wrap; gap: .5rem;
  list-style: none; margin: 0 0 1.1rem; padding: 0;
}
.gs-th-chip {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .45rem .8rem;
  border-radius: 999px;
  background: var(--gs-sf0, #ffffff);
  border: 1px solid var(--gs-bd0, #e2e8f0);
  font-size: .8125rem;
  font-weight: 600;
  color: var(--gs-tx0, #0f172a);
  white-space: nowrap;
}
.gs-th-chip > i { color: var(--gs-cp, #5b21b6); font-size: .95rem; }

.gs-th-meta { margin-bottom: 1.35rem; }

/* ---------- actions --------------------------------------------
   .gs-th-actions and .gs-th-iconbtn are declared in goji-main.css;
   these override the compact right-rail sizing now that the row
   sits under the copy it belongs to. */
.gs-th .gs-th-actions { flex-wrap: wrap; gap: .6rem; }
.gs-th .gs-th-actions .gs-btn { min-height: 48px; border-radius: 13px; font-weight: 700; }
.gs-th .gs-th-actions .gs-btn-primary { padding-inline: 1.6rem; font-size: 1rem; }
.gs-th .gs-th-iconbtn { width: 48px; min-width: 48px; padding-inline: 0; font-size: 1.05rem; }
.gs-th .gs-th-actions form { margin: 0; }

/* The trial terms, under the buttons rather than three scrolls down inside a pricing card — it is
   the answer to "what does it cost me to try this", which is the question the button raises. */
.gs-th-trial {
  display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
  margin: .9rem 0 0;
  font-size: .8125rem; color: var(--gs-tx1, #334155);
}
.gs-th-trial > i { color: var(--gs-cs, #3d8b37); }

/* ---------- price rail ------------------------------------------ */
.gs-th-aside { min-width: 0; }
.gs-th .gs-th-pricebox { text-align: left; margin-bottom: 1.25rem; }
.gs-th .gs-th-price { font-size: 2rem; }

@media (min-width: 992px) {
  /* 44%: the four benefit chips have to clear one line in the text column at this width. */
  .gs-th { grid-template-columns: minmax(0, 1fr) minmax(0, 44%); gap: 2.5rem; }
  .gs-th-head { gap: 1.35rem; }
  .gs-th .gs-tc-logo-lg { width: 104px; height: 104px; flex: 0 0 104px; border-radius: 26px; font-size: 2.6rem; }
  .gs-th .gs-th-pricebox { text-align: right; margin-bottom: .5rem; }
  .gs-th .gs-th-price { font-size: 2.25rem; }
}

/* ============================================================
   THE ILLUSTRATION
   Decorative and aria-hidden; hidden below lg because six brand
   tiles and two floating cards at 360px is clutter in front of
   the copy that sells the product.
   ============================================================ */
.thv { display: none; }

@media (min-width: 992px) {
  .thv { display: block; }
}

.thv-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 560 / 400;
  color: var(--gs-cp, #5b21b6);
}

.thv-wires { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .5; }
.thv-deco { opacity: .45; }
.thv-deco-dots { opacity: .28; }

/* brand tiles ---------------------------------------------------- */
.thv-ic {
  position: absolute;
  width: 8.4%;
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 26%;
  background: var(--gs-sf0, #ffffff);
  border: 1px solid var(--gs-bd0, #e2e8f0);
  box-shadow: 0 14px 30px -16px rgba(15, 23, 42, .4);
  font-size: 1.55rem;
  color: var(--mk, #5b21b6);
}

/* the post card -------------------------------------------------- */
.thv-card {
  position: absolute;
  left: 16%; top: 33%; width: 60%;
  background: var(--gs-sf0, #ffffff);
  border: 1px solid var(--gs-bd0, #e2e8f0);
  border-radius: 16px;
  box-shadow: 0 26px 50px -26px rgba(15, 23, 42, .45);
  padding: .85rem .95rem;
}
.thv-card-hd { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .7rem; }
.thv-card-t { font-weight: 800; font-size: 1rem; color: var(--gs-tx0, #0f172a); }
.thv-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .7rem; font-weight: 700;
  color: #047857;
  background: rgba(16, 185, 129, .12);
  border-radius: 999px;
  padding: .2rem .5rem;
}
.thv-dot { width: 6px; height: 6px; border-radius: 50%; background: #10b981; display: inline-block; }

.thv-card-bd { display: flex; align-items: center; gap: .7rem; margin-bottom: .75rem; }
.thv-thumb {
  width: 34%; aspect-ratio: 16 / 10;
  border-radius: 9px;
  flex: 0 0 auto;
  background: linear-gradient(150deg, #a5b4fc 0%, #c4b5fd 45%, #99f6e4 100%);
}
.thv-lines { flex: 1 1 auto; display: flex; flex-direction: column; gap: .45rem; }
.thv-lines i { display: block; height: 8px; border-radius: 4px; background: var(--gs-bd0, #e2e8f0); }
.thv-lines i:last-child { width: 62%; }

.thv-card-ft { display: flex; justify-content: flex-end; }
.thv-btn {
  display: inline-block;
  background: var(--gs-cp, #5b21b6);
  color: var(--gs-cp-fg, #ffffff);
  font-size: .75rem; font-weight: 700;
  border-radius: 8px;
  padding: .32rem .8rem;
}

/* the result card ------------------------------------------------ */
.thv-stat {
  position: absolute;
  left: 24%; top: 79%; width: 46%;
  display: flex; align-items: center; gap: .6rem;
  background: var(--gs-sf0, #ffffff);
  border: 1px solid var(--gs-bd0, #e2e8f0);
  border-radius: 14px;
  box-shadow: 0 22px 44px -24px rgba(15, 23, 42, .45);
  padding: .6rem .75rem;
}
.thv-stat-ic {
  width: 30px; height: 30px; flex: 0 0 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px;
  background: rgba(124, 58, 237, .12);
  color: var(--gs-cp, #5b21b6);
  font-size: .9rem;
}
.thv-stat-tx { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.thv-stat-tx b { font-size: .8125rem; font-weight: 700; color: var(--gs-tx0, #0f172a); white-space: nowrap; }
.thv-stat-up { margin-left: auto; color: var(--gs-cp, #5b21b6); font-size: 1.15rem; }

/* ---------- dark ------------------------------------------------
   The surfaces (--gs-sf0/--gs-bd0/--gs-tx*) alias tokens that already
   flip per theme, so the tiles and cards follow on their own. Only
   the hardcoded rgba() accents below need a dark value.

   ⚠ Three states, not two: an explicit choice stamps data-theme, and
     the DEFAULT "system" setting stamps nothing — so the un-stamped
     document needs prefers-color-scheme, guarded with
     :not([data-theme="light"]) so an explicit light choice still wins.
     These rules must never sit outside the media query: on their own
     they would repaint the light page too. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .gs-tool-heroband.has-visual {
    background:
      radial-gradient(900px 420px at 82% 18%, rgba(167, 139, 250, .13), transparent 70%),
      radial-gradient(700px 380px at 8% 4%, rgba(167, 139, 250, .09), transparent 68%);
  }
  :root:not([data-theme="light"]) .thv-pill { color: #6ee7b7; background: rgba(16, 185, 129, .18); }
  :root:not([data-theme="light"]) .thv-stat-ic { background: rgba(167, 139, 250, .18); }
  :root:not([data-theme="light"]) .thv-ic { color: var(--mk-d, #f0f2f8); }
}
:root[data-theme="dark"] .gs-tool-heroband.has-visual {
  background:
    radial-gradient(900px 420px at 82% 18%, rgba(167, 139, 250, .13), transparent 70%),
    radial-gradient(700px 380px at 8% 4%, rgba(167, 139, 250, .09), transparent 68%);
}
:root[data-theme="dark"] .thv-pill { color: #6ee7b7; background: rgba(16, 185, 129, .18); }
:root[data-theme="dark"] .thv-ic { color: var(--mk-d, #f0f2f8); }
:root[data-theme="dark"] .thv-stat-ic { background: rgba(167, 139, 250, .18); }