/*
 * v2 tools hub and tool pages (/tools/, /tools/<tool>/).
 *
 * Loaded after style.css, assets/v2/skin.css and home.css. The tool markup
 * itself comes from inc/ciralgo-tool-*.php and is not changed: these rules
 * only place it calmly inside the v2 layout. Class names and ids used by
 * the tools' scripts are never hidden or renamed.
 */

/* ------------------------------------------------------------------
   Hub
   ------------------------------------------------------------------ */

.cv2-tools-hero {
  padding-top: clamp(40px, 5vw, 72px);
  padding-bottom: clamp(48px, 5.6vw, 80px);
}

.cv2-tools-hero__title {
  max-width: 980px;
}

.cv2-tools-hero__lead {
  max-width: 640px;
}

.cv2-toolrows-wrap {
  padding-bottom: clamp(72px, 8.4vw, 120px);
}

.cv2-toolrow {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px 48px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
}

.cv2-toolrow:last-child {
  border-bottom: 1px solid var(--line);
}

.cv2-toolviz {
  display: block;
  width: 100%;
  height: auto;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--sage);
  box-sizing: border-box;
}

.cv2-toolrow__audience {
  color: var(--muted);
  font-size: 14px;
}

.cv2-toolrow__title {
  margin: 6px 0 0;
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.cv2-toolrow__title a {
  text-decoration: none;
}

.cv2-toolrow__title a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.cv2-toolrow__blurb {
  max-width: 620px;
  margin-top: 10px;
  color: var(--text);
  font-size: 17px;
  line-height: 1.5;
}

.cv2-tools-cta__p {
  max-width: 560px;
  margin-top: 16px;
  color: #454a44;
  font-size: 17px;
  line-height: 1.5;
}

/* ------------------------------------------------------------------
   Tool page: v2 head
   ------------------------------------------------------------------ */

.cv2-tool-hero {
  padding-top: clamp(32px, 4vw, 56px);
  padding-bottom: clamp(32px, 3.6vw, 48px);
}

.cv2-tool-hero__crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 14px;
}

.cv2-tool-hero__crumb a {
  color: var(--g2);
}

.cv2-tool-hero__title {
  max-width: 980px;
  font-size: clamp(38px, 5vw, 76px);
}

.cv2-tool-hero__lead {
  max-width: 700px;
}

.cv2-tool-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 24px;
  color: var(--text);
  font-size: 15px;
}

.cv2-tool-hero__meta li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cv2-tool-hero__meta li::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--g3);
}

/* ------------------------------------------------------------------
   Tool page: the existing tool markup
   ------------------------------------------------------------------ */

/* The tool's own hero and closing block are replaced by the v2 ones. */
body.cv2-site .cv2-tool-body .ci-tool-hero,
body.cv2-site .cv2-tool-body .ci-anon-cta {
  display: none;
}

body.cv2-site .cv2-tool-body .ci-tool {
  background: transparent;
  font-family: inherit;
}

/* Tool sections: same width and side padding as the rest of the page. */
body.cv2-site .cv2-tool-body .ci-tool > section {
  margin: 0;
  padding: 0 0 clamp(56px, 6.4vw, 96px);
  background: transparent;
}

body.cv2-site .cv2-tool-body .ci-tool > section > div,
body.cv2-site .cv2-tool-body [class$="__inner"] {
  max-width: 1320px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 32px;
  padding-right: 32px;
  box-sizing: border-box;
}

/* Section headings inside the tools follow the v2 type. */
body.cv2-site .cv2-tool-body h2 {
  font-size: clamp(26px, 2.6vw, 38px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--ink);
}

body.cv2-site .cv2-tool-body h2,
body.cv2-site .cv2-tool-body h3 {
  text-transform: none;
}

/* Buttons inside the tools: the v2 radius instead of pills. */
body.cv2-site .cv2-tool-body .ci-btn,
body.cv2-site .cv2-tool-body button {
  border-radius: 6px;
}

body.cv2-site .cv2-tool-body h3 {
  letter-spacing: -0.015em;
  color: var(--ink);
}

/* Eyebrow pills above headings: plain small labels. */
body.cv2-site .cv2-tool-body [class*="eyebrow"] {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

body.cv2-site .cv2-tool-body [class*="eyebrow"] [class*="dot"] {
  display: none;
}

/* Cards and panels: flat, bordered, no shadows. */
body.cv2-site .cv2-tool-body [class*="card"],
body.cv2-site .cv2-tool-body [class*="panel"] {
  box-shadow: none;
}

/* Form controls: calm borders and the v2 focus ring. */
body.cv2-site .cv2-tool-body input[type="text"],
body.cv2-site .cv2-tool-body input[type="number"],
body.cv2-site .cv2-tool-body textarea,
body.cv2-site .cv2-tool-body select {
  border: 1px solid var(--card-line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
}

body.cv2-site .cv2-tool-body textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

body.cv2-site .cv2-tool-body input:focus-visible,
body.cv2-site .cv2-tool-body textarea:focus-visible,
body.cv2-site .cv2-tool-body select:focus-visible,
body.cv2-site .cv2-tool-body button:focus-visible {
  outline: 3px solid var(--g3);
  outline-offset: 2px;
}

body.cv2-site .cv2-tool-body input[type="range"] {
  accent-color: var(--g2);
}

/* Wide tables scroll inside their box on narrow screens. */
body.cv2-site .cv2-tool-body table {
  width: 100%;
}

/* ------------------------------------------------------------------
   Tool page: other tools
   ------------------------------------------------------------------ */

.cv2-tool-others {
  padding-bottom: clamp(72px, 8.4vw, 120px);
}

.cv2-tool-others h2 {
  margin: 0 0 20px;
}

.cv2-tool-others__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 16px;
}

.cv2-tool-others__list a {
  display: grid;
  gap: 6px;
  height: 100%;
  padding: 16px;
  border: 1px solid var(--card-line);
  border-radius: 10px;
  background: var(--card);
  text-decoration: none;
  box-sizing: border-box;
}

.cv2-tool-others__list a:hover {
  border-color: var(--g3);
}

.cv2-tool-others__list .cv2-toolviz {
  margin-bottom: 10px;
}

.cv2-tool-others__title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.cv2-tool-others__aud {
  color: var(--muted);
  font-size: 14px;
}

/* ------------------------------------------------------------------
   Narrow screens
   ------------------------------------------------------------------ */

@media (max-width: 860px) {
  .cv2-toolrow {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .cv2-toolrow__cta {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 560px) {
  .cv2-toolrow {
    grid-template-columns: 1fr;
  }

  .cv2-toolrow .cv2-toolviz {
    max-width: 180px;
  }

  .cv2-toolrow__cta {
    grid-column: 1;
  }

  body.cv2-site .cv2-tool-body .ci-tool > section > div,
  body.cv2-site .cv2-tool-body [class$="__inner"] {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* LLM comparator: the "best" row marks only its first cell, not every
   cell (style.css draws the inset bar on each td). */
body.cv2-site .cv2-tool-body .ci-cmp-row--best td {
  box-shadow: none;
}

body.cv2-site .cv2-tool-body .ci-cmp-row--best td:first-child {
  box-shadow: inset 3px 0 0 var(--g2);
}

body.cv2-site .cv2-tool-body .ci-cmp-row--highlight td {
  background: var(--sage);
}
