/**
 * Butterfly Weft comparison page (Mesh vs PU).
 *
 * Attached by alias in sach_vogue_preprocess_html(), following the same
 * pattern as pages.colour_match. Every selector is namespaced under
 * .sv-bw so no other node is affected — in particular the generic
 * `.sv-node__content table { display: block }` rule in
 * compatibility/legacy-content.css is left untouched globally.
 *
 * Uses the theme's existing design tokens only. No new font system.
 */

.sv-bw {
  --bw-rule: var(--sv-border, rgba(31, 31, 31, 0.12));
  --bw-ink: var(--sv-color-charcoal, #262220);
  --bw-muted: var(--sv-color-muted, #6c635a);
  --bw-ivory: var(--sv-color-ivory, #f7f4ef);
  --bw-gold: var(--sv-color-gold, #9b7748);
}

.sv-bw .sv-guide-section {
  margin-block: clamp(2.5rem, 5vw, 4rem);
}

.sv-bw h2 {
  font-family: var(--sv-font-serif);
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  line-height: 1.2;
  margin: 0 0 0.85rem;
}

.sv-bw h3 {
  font-family: var(--sv-font-sans);
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bw-muted);
  margin: 2rem 0 0.75rem;
}

.sv-bw p,
.sv-bw li {
  max-width: 68ch;
  line-height: 1.75;
}

.sv-bw ul {
  padding-left: 1.15rem;
}

.sv-bw li {
  margin-bottom: 0.4rem;
}

/* -------------------------------------------------------------------------
   Comparison table
   ------------------------------------------------------------------------- */

.sv-bw-compare {
  margin-block: 1.5rem;
}

.sv-bw-compare table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.sv-bw-compare caption {
  text-align: left;
  font-family: var(--sv-font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--bw-muted);
  padding-bottom: 0.9rem;
}

.sv-bw-compare th,
.sv-bw-compare td {
  text-align: left;
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--bw-rule);
  vertical-align: top;
}

.sv-bw-compare thead th {
  font-family: var(--sv-font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--bw-muted);
  border-bottom: 1px solid var(--bw-ink);
}

.sv-bw-compare tbody th {
  font-weight: 500;
  color: var(--bw-ink);
  width: 30%;
}

.sv-bw-compare tbody tr:nth-child(odd) {
  background: var(--bw-ivory);
}

/* -------------------------------------------------------------------------
   Manufacturing principle / production format
   ------------------------------------------------------------------------- */

.sv-bw-principle {
  background: var(--bw-ivory);
  border-left: 2px solid var(--bw-gold);
  padding: clamp(1.5rem, 3vw, 2rem);
  margin-block: 1.75rem;
}

.sv-bw-principle p {
  margin: 0;
}

.sv-bw-principle__lead {
  font-family: var(--sv-font-serif);
  font-size: clamp(1.15rem, 1.9vw, 1.4rem);
  line-height: 1.35;
  color: var(--bw-ink);
}

.sv-bw-format {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  display: grid;
  gap: 0.5rem;
}

.sv-bw-format li {
  display: flex;
  gap: 0.9rem;
  align-items: baseline;
  font-family: var(--sv-font-sans);
  border-bottom: 1px solid var(--bw-rule);
  padding-bottom: 0.5rem;
  margin: 0;
}

.sv-bw-format b {
  min-width: 4.5rem;
  font-weight: 600;
  color: var(--bw-ink);
}

/* Product-family disambiguation note. */
.sv-bw-note {
  border: 1px solid var(--bw-rule);
  padding: 1.15rem 1.35rem;
  margin-block: 1.5rem;
}

.sv-bw-note p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--bw-muted);
}

/* -------------------------------------------------------------------------
   Explore cards — intentionally NOT links until the child pages exist.
   ------------------------------------------------------------------------- */

.sv-bw-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.sv-bw-card {
  border: 1px solid var(--bw-rule);
  padding: clamp(1.35rem, 2.5vw, 1.85rem);
}

.sv-bw-card h3 {
  margin: 0 0 0.5rem;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--sv-font-serif);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--bw-ink);
}

.sv-bw-card p {
  font-size: 0.92rem;
  color: var(--bw-muted);
  margin: 0 0 0.9rem;
}

.sv-bw-card__status {
  display: inline-block;
  font-family: var(--sv-font-sans);
  font-size: 0.68rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--bw-muted);
}

/* -------------------------------------------------------------------------
   Mobile: the three-column comparison becomes labelled stacked blocks.
   ------------------------------------------------------------------------- */

@media (max-width: 767px) {
  .sv-bw-compare thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .sv-bw-compare table,
  .sv-bw-compare tbody,
  .sv-bw-compare tr,
  .sv-bw-compare th,
  .sv-bw-compare td {
    display: block;
    width: auto;
  }

  /* A caption inside a display:block table loses its width context and
     wraps to one word per line — restore it to a full-width block. */
  .sv-bw-compare caption {
    display: block;
    width: 100%;
    max-width: none;
  }

  .sv-bw-compare tr {
    border: 1px solid var(--bw-rule);
    padding: 0.35rem 0.9rem 0.9rem;
    margin-bottom: 1rem;
    background: none;
  }

  .sv-bw-compare tbody tr:nth-child(odd) {
    background: none;
  }

  .sv-bw-compare tbody th {
    width: auto;
    padding: 0.75rem 0 0.5rem;
    border-bottom: 1px solid var(--bw-rule);
    font-family: var(--sv-font-sans);
    font-size: 0.72rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--bw-muted);
  }

  .sv-bw-compare td {
    padding: 0.7rem 0 0;
    border: 0;
  }

  .sv-bw-compare td::before {
    content: attr(data-label);
    display: block;
    font-family: var(--sv-font-sans);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bw-gold);
    margin-bottom: 0.15rem;
  }

  .sv-bw-cards {
    grid-template-columns: 1fr;
  }
}
