/* ============================================================
   CONVERTEREN — converter.css
   Tool-page content styles (templates/converter.php):
   article layout, SEO sections, how-to steps, comparison
   table, format cards, related tools, ad placeholders.

   Design tokens + the converter widget (.conv-app) live in
   assets/css/main.css — this file only ADDS tool-page styles
   and may be enqueued on tool pages only (CONTRACT §10/§13).
   ============================================================ */

/* ------------------------------------------------------------
   1. TOOL LAYOUT
   ------------------------------------------------------------ */
.cnv-tool { margin: 4px 0 8px; }

.cnv-article {
  max-width: 860px;
  margin-top: clamp(40px, 6vw, 56px);
}

.cnv-seo { margin-bottom: clamp(36px, 5vw, 44px); }
.cnv-seo h2 {
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 16px;
}
/* fact / intro paragraphs */
.cnv-seo > p {
  margin: 0 0 12px;
  color: var(--cnv-text-muted);
  line-height: 1.7;
}
.cnv-seo > p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------
   2. HOW-TO STEPS (numbered)
   ------------------------------------------------------------ */
.cnv-steps {
  counter-reset: step;
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cnv-steps li {
  counter-increment: step;
  position: relative;
  padding: 16px 18px 16px 62px;
  background: var(--cnv-surface);
  border: 1px solid var(--cnv-border);
  border-radius: var(--cnv-radius);
  box-shadow: var(--cnv-shadow-sm);
  color: var(--cnv-text-muted);
  line-height: 1.65;
}
.cnv-steps li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--cnv-radius-pill);
  background: var(--cnv-accent-soft);
  color: var(--cnv-accent-text);
  font-weight: 700;
  font-size: 0.92rem;
}

/* ------------------------------------------------------------
   3. COMPARISON TABLE (from vs to)
   ------------------------------------------------------------ */
.cnv-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--cnv-surface);
  box-shadow: 0 0 0 1px var(--cnv-border);
  border-radius: var(--cnv-radius);
  font-size: 0.94rem;
}
.cnv-table th,
.cnv-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--cnv-border);
  text-align: left;
  vertical-align: top;
}
.cnv-table thead th {
  background: var(--cnv-hover);
  font-weight: 600;
  white-space: nowrap;
}
.cnv-table thead th:first-child { border-top-left-radius: var(--cnv-radius); }
.cnv-table thead th:last-child { border-top-right-radius: var(--cnv-radius); }
.cnv-table tbody tr:nth-child(even) { background: var(--cnv-zebra); }
.cnv-table tbody tr:last-child td { border-bottom: 0; }
.cnv-table tbody tr:last-child td:first-child { border-bottom-left-radius: var(--cnv-radius); }
.cnv-table tbody tr:last-child td:last-child { border-bottom-right-radius: var(--cnv-radius); }
.cnv-table tbody tr:hover { background: var(--cnv-accent-fade); }

/* narrow screens: the table scrolls horizontally without a wrapper */
@media (max-width: 720px) {
  .cnv-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .cnv-table th,
  .cnv-table td { white-space: nowrap; }
}

/* ------------------------------------------------------------
   4. FORMAT CARDS (from / to format info)
   ------------------------------------------------------------ */
.cnv-format-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 720px) {
  .cnv-format-cards { grid-template-columns: 1fr; }
}

.cnv-format-card {
  padding: 20px;
  background: var(--cnv-surface);
  border: 1px solid var(--cnv-border);
  border-radius: var(--cnv-radius);
  box-shadow: var(--cnv-shadow-sm);
}
.cnv-format-card h3,
.cnv-format-card > *:first-child {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 700;
}
/* supports both bare dt/dd pairs and div-wrapped rows */
.cnv-format-card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px 16px;
  margin: 0;
}
.cnv-format-card dl > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  grid-column: 1 / -1;
}
.cnv-format-card dt {
  color: var(--cnv-text-faint);
  font-size: 0.85rem;
}
.cnv-format-card dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
  font-size: 0.9rem;
}

/* ------------------------------------------------------------
   5. RELATED TOOLS
   ------------------------------------------------------------ */
.cnv-related {
  margin-top: 8px;
  padding-top: 28px;
  border-top: 1px solid var(--cnv-border);
}
.cnv-related__group + .cnv-related__group { margin-top: 26px; }
.cnv-related__group h2 {
  font-size: 1.08rem;
  font-weight: 700;
  margin: 0 0 12px;
}
.cnv-related__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cnv-related__list a {
  display: inline-block;
  padding: 3px 0;
  color: var(--cnv-text-muted);
  font-size: 0.93rem;
  overflow-wrap: anywhere;
}
.cnv-related__list a:hover {
  color: var(--cnv-accent-text);
  text-decoration: underline;
}

/* ------------------------------------------------------------
   6. AD PLACEHOLDERS (dashed neutral boxes)
   ------------------------------------------------------------ */
.cnv-ad {
  display: grid;
  place-items: center;
  min-height: 96px;
  margin: 32px 0;
  border: 1.5px dashed var(--cnv-border-strong);
  border-radius: var(--cnv-radius);
  background: var(--cnv-hover);
  color: var(--cnv-text-faint);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.cnv-ad::after { content: "Advertisement"; }

/* ------------------------------------------------------------
   7. SMALL-SCREEN TUNING
   ------------------------------------------------------------ */
@media (max-width: 640px) {
  .cnv-article { margin-top: 32px; }
  .cnv-steps li { padding-left: 56px; }
  .cnv-steps li::before { left: 12px; width: 30px; height: 30px; }
}
