/**
 * SlideGenius lead-gen tool pages.
 *
 * Built to the theme's own design system rather than a generic app look, so a
 * tool page reads as a slidegenius.com page. Values are taken from sg_theme:
 * container 1248px, body #474d5e, heading navy #0F2044, accent red #C20012
 * (hover #8a000d), button blue #005a8c, Montserrat headings, #e1f7fb hero tint.
 *
 * Fonts are deliberately never declared — the theme's stack cascades in, which
 * is what makes these pages match. Only size, weight and rhythm are set here.
 *
 * Scoped under .sg-tool* so nothing leaks into the theme. Two exceptions are
 * unavoidable and marked as such: the theme's global `h1 { font-size: 4.5rem }`
 * and `.entry-content` having no container of its own.
 */

/* ----------------------------------------------------------------- shell -- */

/**
 * The theme gives .entry-content no max-width — blocks each supply their own
 * .row/.container. These pages are plain HTML, so they supply their own too.
 * 1248px matches the theme's .container exactly; the 24px gutter is ours.
 */
.sg-tool-hero__inner,
.sg-tool-copy__inner,
.sg-tool {
  width: 100%;
  max-width: 1248px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
  box-sizing: border-box;
}

/* ------------------------------------------------------------------ hero -- */

/**
 * Full-bleed tint band. .entry-content is full width, so a plain block element
 * spans the viewport without a negative-margin trick.
 */
.sg-tool-hero {
  background: #e1f7fb;
  padding: 72px 0 96px;
  text-align: center;
}

.sg-tool-hero__inner {
  max-width: 860px;
}

.sg-tool-eyebrow {
  margin: 0 0 14px;
  color: #c20012;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/**
 * The theme sets a global `h1 { font-size: 4.5rem }` — 72px, which is a
 * homepage-slider size and dwarfs everything else on a tool page. Overriding it
 * needs this specificity; a bare .sg-tool-hero h1 loses to it on some templates.
 */
.sg-tool-hero .sg-tool-hero__inner h1 {
  margin: 0 0 18px;
  color: #0f2044;
  font-size: clamp(2rem, 4.4vw, 3.25rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.sg-tool-tagline {
  margin: 0 auto;
  max-width: 640px;
  color: #474d5e;
  font-size: 1.1875rem;
  line-height: 1.6;
}

/* ------------------------------------------------------------------ tool -- */

.sg-tool {
  --sg-accent: #c20012;
  --sg-blue: #005a8c;
  --sg-border: #dfe4ea;
  --sg-muted: #6b7280;
  --sg-navy: #0f2044;
  max-width: 880px;

  /* Overlaps the hero band so the card reads as the page's next step rather
     than as an unrelated widget floating below a colored stripe. */
  margin-top: -56px;
  margin-bottom: 0;
  position: relative;
  z-index: 1;
  color: #474d5e;
  font-size: 16px;
  line-height: 1.6;
}

/* Card. .sg-tool keeps the gutter; the padding lives on the panels so the card
   edge lands inside the gutter on small screens instead of touching it. */
.sg-tool__upload,
.sg-tool__result,
.sg-tool__gate {
  background: #fff;
  border: 1px solid var(--sg-border);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(15, 32, 68, 0.08);
  padding: 32px;
}

.sg-tool__result,
.sg-tool__gate {
  margin-top: 24px;
}

.sg-tool__noscript {
  margin: 0 0 16px;
  padding: 14px 16px;
  background: #fff4ed;
  border: 1px solid #fcd9c0;
  border-radius: 8px;
}

/* ---------------------------------------------------------------- upload -- */

.sg-tool__drop {
  display: block;
  border: 2px dashed #c7d4de;
  border-radius: 10px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  background: #fafcfd;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.sg-tool__drop:hover,
.sg-tool__drop:focus-within {
  border-color: var(--sg-blue);
  background: #f2f9fc;
}
.sg-tool__file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.sg-tool__droptext {
  color: var(--sg-muted);
  font-size: 1rem;
}
/* Set by the script once a file is chosen. */
.sg-tool__drop--filled {
  border-style: solid;
  border-color: var(--sg-blue);
  background: #f2f9fc;
}

/* --------------------------------------------------------------- options -- */

.sg-tool__options {
  display: grid;
  gap: 18px;
}
.sg-tool__options:not(:empty) {
  margin-top: 24px;
}
.sg-tool__option {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sg-tool__option-label {
  color: var(--sg-navy);
  font-weight: 600;
  font-size: 0.9375rem;
}
.sg-tool__option-help {
  color: var(--sg-muted);
  font-size: 0.8125rem;
}
.sg-tool__option input,
.sg-tool__option select {
  padding: 11px 12px;
  border: 1px solid var(--sg-border);
  border-radius: 8px;
  font: inherit;
  width: 100%;
  box-sizing: border-box;
}
.sg-tool__option input:focus,
.sg-tool__option select:focus,
.sg-tool__row input:focus {
  outline: 2px solid var(--sg-blue);
  outline-offset: 1px;
  border-color: var(--sg-blue);
}

/* ---------------------------------------------------------------- action -- */

/* Blue with a red hover, matching a.wp-block-button__link across the site. */
.sg-tool__run,
.sg-tool__submit {
  margin-top: 24px;
  padding: 15px 34px;
  background: var(--sg-blue);
  color: #fff;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.15s ease;
}
.sg-tool__run:hover:not([disabled]),
.sg-tool__submit:hover {
  background: var(--sg-accent);
}
.sg-tool__run[disabled] {
  background: #b9c4cd;
  cursor: not-allowed;
}
.sg-tool__privacy {
  margin: 14px 0 0;
  color: var(--sg-muted);
  font-size: 0.8125rem;
}
.sg-tool__error {
  margin: 14px 0 0;
  padding: 12px 14px;
  background: #fef3f2;
  border: 1px solid #fcd7d4;
  border-radius: 8px;
  color: #b42318;
  font-size: 0.9375rem;
  line-height: 1.55;
}
/* The oversize message routes to sales, so its link has to look like one. */
.sg-tool__error-link,
.sg-tool__error-link:visited {
  color: var(--sg-accent);
  font-weight: 700;
  text-decoration: underline;
}

/* ---------------------------------------------------------------- result -- */

.sg-tool__summary {
  margin: 8px 0 0;
  padding-left: 20px;
}
.sg-tool__json {
  max-height: 420px;
  overflow: auto;
  background: #f6f8fa;
  border: 1px solid var(--sg-border);
  padding: 16px;
  border-radius: 8px;
  font-size: 0.8125rem;
}
/* -------------------------------------------------------------------- cta -- */

/**
 * Deliberately the heaviest element in the result card. The visitor has just
 * been shown a problem with their own deck — that is the highest-intent moment
 * on the page, and the previous grey sentence with no link wasted it.
 */
.sg-tool__cta {
  margin: 28px -32px -32px;
  padding: 28px 32px 32px;
  background: #0f2044;
  border-radius: 0 0 13px 13px;
  color: #dfe6f2;
}
.sg-tool__cta-title {
  margin: 0 0 10px;
  color: #fff;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.25;
}
.sg-tool__cta-body {
  margin: 0 0 22px;
  max-width: 52ch;
  font-size: 0.9375rem;
  line-height: 1.6;
}
.sg-tool__cta-btn,
.sg-tool__cta-btn:visited {
  display: inline-block;
  padding: 14px 32px;
  background: var(--sg-accent);
  color: #fff;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease;
}
.sg-tool__cta-btn:hover,
.sg-tool__cta-btn:focus {
  background: #8a000d;
  color: #fff;
}
.sg-tool__cta-note {
  margin: 16px 0 0;
  color: #9fb0cc;
  font-size: 0.8125rem;
}

@media (max-width: 782px) {
  .sg-tool__cta {
    margin: 24px -20px -24px;
    padding: 24px 20px;
  }
}

/* ------------------------------------------------------------------ gate -- */

.sg-tool__gate {
  background: #f7fbfd;
}
.sg-tool__gate-title {
  margin: 0 0 6px;
  color: var(--sg-navy);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.25;
}
.sg-tool__gate-sub {
  margin: 0 0 24px;
  color: var(--sg-muted);
}
.sg-tool__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.sg-tool__row label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--sg-navy);
  font-size: 0.875rem;
  font-weight: 600;
}
.sg-tool__row input {
  padding: 11px 12px;
  border: 1px solid var(--sg-border);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-weight: 400;
}
.sg-tool__form-note {
  margin: 14px 0 0;
  color: var(--sg-muted);
  font-size: 0.8125rem;
}
.sg-tool__form-note--error {
  color: #b42318;
}

/* Honeypot and the Salesforce response sink: present for bots and the browser,
   invisible and unreachable for people. `display:none` is avoided on the
   honeypot because some bots skip hidden inputs. */
.sg-tool__hp {
  position: absolute;
  left: -9999px;
  top: -9999px;
  height: 0;
  overflow: hidden;
}
.sg-tool__sink {
  display: none;
}

/* ------------------------------------------------------------- renderers -- */

.sg-tool__verdict {
  margin: 0 0 20px;
  color: var(--sg-navy);
  font-size: 1.125rem;
  line-height: 1.45;
}
.sg-tool__verdict--warn {
  color: #b54708;
  font-weight: 700;
}
.sg-tool__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.sg-tool__table th,
.sg-tool__table td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--sg-border);
}
.sg-tool__table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sg-muted);
  border-bottom-width: 2px;
}
.sg-tool__fontname {
  color: var(--sg-navy);
  font-weight: 600;
}
.sg-tool__ok {
  color: var(--sg-muted);
}
.sg-tool__warn {
  color: #b54708;
  font-weight: 600;
}
.sg-tool__swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.sg-tool__swatch {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 8px;
  border: 1px solid var(--sg-border);
  border-radius: 999px;
  font-size: 0.8125rem;
}
.sg-tool__chip {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(15, 32, 68, 0.15);
  display: inline-block;
  flex: none;
}
.sg-tool__chip-count {
  color: var(--sg-muted);
}
.sg-tool__subhead {
  margin: 28px 0 10px;
  color: var(--sg-navy);
  font-size: 1rem;
  font-weight: 700;
}
.sg-tool__subhead:first-child {
  margin-top: 0;
}

/* ---------------------------------------------------------- tools index -- */

.sg-tools-index {
  padding: 72px 0 0;
}
.sg-tools-index__inner,
.sg-tools-cta__inner {
  width: 100%;
  max-width: 1248px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

.sg-tools-grid {
  display: grid;
  /* auto-fit, not auto-fill: with six cards a fixed column count leaves a ragged
     last row on common widths. This lets the row breathe instead. */
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 24px;
}

.sg-tool-card {
  display: flex;
  flex-direction: column;
  padding: 28px;
  background: #fff;
  border: 1px solid #dfe4ea;
  border-radius: 14px;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.sg-tool-card:hover,
.sg-tool-card:focus {
  border-color: #005a8c;
  box-shadow: 0 12px 28px rgba(15, 32, 68, 0.1);
  transform: translateY(-2px);
}
.sg-tool-card__title {
  margin: 0 0 10px;
  color: #0f2044;
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.3;
}
.sg-tool-card__tagline {
  margin: 0 0 20px;
  color: #474d5e;
  font-size: 0.9375rem;
  line-height: 1.6;
  /* Pushes the affordance to the bottom so every card's link lines up. */
  flex: 1;
}
.sg-tool-card__go {
  color: #c20012;
  font-size: 0.875rem;
  font-weight: 700;
}
.sg-tool-card__go::after {
  content: " →";
}

/* CTA band closing the index. Same offer as the in-tool CTA, same destination. */
.sg-tools-cta {
  margin-top: 88px;
  padding: 72px 0;
  background: #0f2044;
  text-align: center;
  color: #dfe6f2;
}
.sg-tools-cta__inner > h2 {
  margin: 0 0 14px;
  color: #fff;
  font-size: clamp(1.6rem, 3vw, 2.125rem);
  font-weight: 800;
  line-height: 1.2;
}
.sg-tools-cta__inner > p {
  margin: 0 auto 28px;
  max-width: 60ch;
  font-size: 1.0625rem;
  line-height: 1.65;
}
.sg-tools-cta__btn,
.sg-tools-cta__btn:visited {
  display: inline-block;
  padding: 15px 36px;
  background: #c20012;
  color: #fff;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease;
}
.sg-tools-cta__btn:hover,
.sg-tools-cta__btn:focus {
  background: #8a000d;
  color: #fff;
}

@media (max-width: 782px) {
  .sg-tools-index {
    padding-top: 48px;
  }
  .sg-tools-cta {
    margin-top: 56px;
    padding: 56px 0;
  }
}

/* ------------------------------------------------------------------ copy -- */

/**
 * Explanatory copy sits BELOW the tool: the hero tagline already says what the
 * tool does, so the visitor can act immediately, and this section carries the
 * detail that has to be in the HTML for the page to rank.
 */
.sg-tool-copy {
  padding: 88px 0;
}
.sg-tool-copy__inner {
  max-width: 820px;
  color: #474d5e;
  font-size: 1.0625rem;
  line-height: 1.75;
}
.sg-tool-copy__inner > h2 {
  margin: 0 0 20px;
  color: #0f2044;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.25;
}
.sg-tool-copy__inner > p {
  margin: 0 0 20px;
}
.sg-tool-copy__inner > p:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------- mobile --- */

@media (max-width: 782px) {
  .sg-tool-hero {
    padding: 48px 0 72px;
  }
  .sg-tool__upload,
  .sg-tool__result,
  .sg-tool__gate {
    padding: 24px 20px;
  }
  .sg-tool-copy {
    padding: 56px 0;
  }
}

@media (max-width: 560px) {
  .sg-tool__row {
    grid-template-columns: 1fr;
  }
  .sg-tool__run,
  .sg-tool__submit {
    width: 100%;
  }
  .sg-tool__drop {
    padding: 28px 16px;
  }
}
