/* ─────────────────────────────────────────────
   tools.css — extra styles for /tools/* pages.
   Loaded AFTER /styles.css and uses its tokens (--navy, --gold, --cream…).
   Mobile-first. Nothing here changes the homepage.
   NOTE: styles.css styles every <nav> element (sticky navy bar), so tool
   pages use <div>/<ul> for breadcrumbs and link lists, never extra <nav>.
   ───────────────────────────────────────────── */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 300;
  background: var(--gold-bright);
  color: var(--navy);
  padding: 10px 16px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus {
  left: 8px;
  top: 8px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
a.nav-logo {
  text-decoration: none;
}

/* ── Hero (reuses .hero, .hero-eyebrow, .hero-sub; animations off for LCP) ── */
.tool-hero {
  padding: 32px 5vw 40px;
}
.tool-hero .hero-eyebrow,
.tool-hero h1,
.tool-hero .hero-sub {
  animation: none;
}
.tool-hero-inner {
  position: relative; /* sits above the .hero decorative layers */
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
}
.tool-hero h1 {
  line-height: 1.05;
  margin-bottom: 16px;
}
.tool-hero .hero-sub {
  max-width: 680px;
  margin-bottom: 0;
}
.tool-hero .hero-eyebrow {
  margin-bottom: 18px;
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
}
.crumbs li + li::before {
  content: "›";
  margin-right: 8px;
  opacity: 0.6;
}
.crumbs a {
  color: var(--gold-bright);
  text-decoration: none;
}
.crumbs a:hover {
  text-decoration: underline;
}

/* ── Section spacing overrides ── */
.tool-section {
  padding-top: 28px;
  padding-bottom: 40px;
}
.content-section {
  padding-top: 44px;
  padding-bottom: 44px;
}
.content-section.alt {
  background: var(--cream-2);
}
.tool-prose {
  max-width: 760px;
}
.tool-prose p {
  color: var(--text-2);
  font-size: 16px;
  margin-bottom: 16px;
}
.tool-prose .section-h2 {
  margin-bottom: 18px;
}

/* ── Tool card (reuses .form-card + .field) ── */
.tool-card {
  padding: 20px 16px;
}
.tool-textarea {
  display: block;
  width: 100%;
  min-height: 220px;
  padding: 14px;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 16px; /* 16px stops iOS zooming on focus */
  font-weight: 300;
  line-height: 1.6;
  color: var(--text);
  background: var(--cream);
  border: 1px solid var(--border-md);
  border-radius: 6px;
  resize: vertical;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.tool-textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(196, 136, 26, 0.12);
  background: #fff;
}
.tool-textarea[readonly] {
  background: var(--cream-2);
}
.tool-card .field + .field {
  margin-top: 18px;
}

/* Options (checkboxes, radios, select) */
.tool-options {
  border: 0;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px 24px;
}
.tool-options legend {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  padding: 0;
  margin-bottom: 10px;
}
.tool-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
  min-height: 28px;
}
.tool-check input {
  accent-color: var(--gold);
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
}
.tool-note {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 12px;
}
.tool-select {
  width: 100%;
  max-width: 320px;
  padding: 11px 14px;
  font-family: "DM Sans", sans-serif;
  font-size: 16px;
  font-weight: 300;
  border: 1px solid var(--border-md);
  border-radius: 6px;
  background: var(--cream);
  color: var(--text);
}

/* Case-converter mode buttons */
.tool-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.tool-mode {
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  font-weight: 500;
  min-height: 44px;
  padding: 9px 14px;
  border-radius: 6px;
  border: 1px solid var(--border-md);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
}
.tool-mode:hover {
  border-color: var(--gold);
}
.tool-mode[aria-pressed="true"] {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.tool-mode:focus-visible,
.tool-btn:focus-visible,
.tool-select:focus-visible,
.tool-check input:focus-visible,
.tool-link-card a:focus-visible,
.tool-faq summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Live stats — fixed number of boxes, fixed min-height: no layout shift */
.tool-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 18px 0 0;
}
.tool-stats--wide {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.tool-stat {
  background: var(--cream-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  min-height: 78px;
}
.tool-stat dt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}
.tool-stat dd {
  margin: 4px 0 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.15;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* Buttons (reuses .btn-submit) */
.tool-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}
.tool-btn.btn-submit {
  width: auto;
  margin-top: 0;
  padding: 12px 22px;
  min-height: 44px;
}
.tool-btn--ghost.btn-submit {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--border-md);
  box-shadow: none;
}
.tool-btn--ghost.btn-submit:hover {
  background: var(--cream-2);
  box-shadow: none;
}
.tool-status {
  display: inline-block;
  min-width: 80px;
  min-height: 1.5em;
  font-size: 13px;
  font-weight: 500;
  color: var(--green);
}
.tool-privacy {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 14px;
}

/* How-to steps */
.tool-steps {
  list-style: none;
  counter-reset: step;
  margin: 0 0 8px;
  padding: 0;
  display: grid;
  gap: 14px;
}
.tool-steps li {
  counter-increment: step;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  color: var(--text-2);
  font-size: 16px;
}
.tool-steps li::before {
  content: counter(step);
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold-bright);
  font-family: "Cormorant Garamond", serif;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* FAQ — native <details>, works without JS */
.tool-faq details {
  background: #fff;
  border: 1px solid var(--border-md);
  border-radius: 10px;
  margin-bottom: 10px;
}
.tool-faq details[open] {
  border-color: var(--gold);
}
.tool-faq summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 48px 16px 18px;
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  position: relative;
}
.tool-faq summary::-webkit-details-marker {
  display: none;
}
.tool-faq summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  font-weight: 400;
  color: var(--gold);
}
.tool-faq details[open] summary::after {
  content: "\2212";
}
.tool-faq details p {
  margin: 0;
  padding: 0 18px 18px;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.7;
}

/* Related-tool / hub cards */
.tool-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.tool-link-card a {
  display: block;
  height: 100%;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text);
  transition:
    border-color 0.2s,
    transform 0.15s;
}
.tool-link-card a:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}
.tool-link-card strong {
  display: block;
  font-family: "Cormorant Garamond", serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 4px;
}
.tool-link-card span {
  display: block;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.55;
}
.tool-more {
  margin-top: 18px;
  font-size: 15px;
}
.tool-more a,
.tool-prose a {
  color: #8a5c0c;
  font-weight: 500;
}

/* Footer (reuses footer; raises contrast, adds link list) */
.tool-footer {
  color: rgba(255, 255, 255, 0.72);
  padding: 28px 5vw;
}
.tool-footer ul {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
}
.tool-footer a {
  color: var(--gold-bright);
  text-decoration: none;
}
.tool-footer a:hover {
  text-decoration: underline;
}
.tool-footer p {
  margin: 0;
}

@media (min-width: 700px) {
  .tool-hero {
    padding: 44px 5vw 52px;
  }
  .tool-card {
    padding: 32px 32px;
  }
  .tool-textarea {
    min-height: 260px;
  }
  .tool-options--cols {
    grid-template-columns: 1fr 1fr;
  }
  .tool-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .tool-stat dd {
    font-size: 32px;
  }
}
@media (min-width: 960px) {
  .tool-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (prefers-reduced-motion: reduce) {
  .tool-link-card a,
  .tool-mode,
  .tool-textarea {
    transition: none;
  }
  .tool-link-card a:hover {
    transform: none;
  }
}

/* ─────────────── Meta title & description checker ─────────────── */
.field .tool-input {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 300;
  color: var(--text);
  background: var(--cream);
  border: 1px solid var(--border-md);
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field .tool-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(196, 136, 26, 0.12);
  background: #fff;
}
.tool-textarea.meta-desc {
  min-height: 96px;
}
.meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 18px;
}
.meta-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  margin: 24px 0 10px;
}

/* length meters: fixed height so nothing moves while typing */
.meta-meter {
  margin-top: 8px;
}
.meta-meter-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 12px;
  font-size: 13px;
  min-height: 20px;
}
.meta-status {
  font-weight: 600;
  color: var(--text-2);
}
.meta-count {
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.meta-bar {
  height: 8px;
  margin-top: 6px;
  background: var(--cream-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.meta-bar-fill {
  height: 100%;
  width: 0;
  background: var(--border-md);
  transition: width 0.15s;
}
.meta-meter[data-state="good"] .meta-bar-fill { background: var(--green); }
.meta-meter[data-state="good"] .meta-status { color: var(--green); }
.meta-meter[data-state="short"] .meta-bar-fill { background: var(--gold); }
.meta-meter[data-state="short"] .meta-status { color: #8a5c0c; }
.meta-meter[data-state="long"] .meta-bar-fill { background: #b3261e; }
.meta-meter[data-state="long"] .meta-status { color: #b3261e; }

/* Google-style result. Uses Arial on purpose: the pixel maths assumes it. */
.serp {
  background: #fff;
  border: 1px solid var(--border-md);
  border-radius: 12px;
  padding: 18px 16px;
  overflow-x: auto;
  font-family: Arial, "Liberation Sans", Helvetica, sans-serif;
}
.serp-inner {
  width: 600px;
  max-width: 100%;
}
.serp[data-device="mobile"] .serp-inner {
  width: 360px;
}
.serp-site {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.serp-fav {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f1f3f4;
  border: 1px solid #dadce0;
  color: #5f6368;
  font-size: 13px;
  line-height: 26px;
  text-align: center;
  text-transform: uppercase;
}
.serp-site-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.serp-name {
  font-size: 14px;
  line-height: 18px;
  color: #202124;
}
.serp-url {
  font-size: 12px;
  line-height: 18px;
  color: #4d5156;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.serp-title {
  font-size: 20px;
  line-height: 26px;
  color: #1a0dab;
  min-height: 26px;
  white-space: nowrap;
  overflow: hidden;
}
.serp[data-device="mobile"] .serp-title {
  white-space: normal;
  min-height: 52px;
}
.serp-desc {
  margin-top: 3px;
  font-size: 14px;
  line-height: 22px;
  color: #4d5156;
  min-height: 44px;
  overflow-wrap: anywhere;
}
.serp[data-device="mobile"] .serp-desc {
  min-height: 66px;
}
.serp-desc b {
  color: #202124;
  font-weight: 700;
}
.serp .is-placeholder {
  opacity: 0.45;
}

/* checks: always six rows, so the list height never changes */
.meta-checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.meta-checks li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-height: 44px;
  padding: 10px 12px;
  background: var(--cream-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-2);
}
.meta-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--border-md);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.meta-checks li[data-state="pass"] .meta-icon { background: var(--green); }
.meta-checks li[data-state="warn"] .meta-icon { background: #b3261e; }
.meta-checks li[data-state="warn"] { color: var(--text); }

@media (min-width: 700px) {
  .meta-grid { grid-template-columns: 1fr 1fr; }
  .serp { padding: 22px 24px; }
}
