/* "DR vs USA" (src/pages/compare.js). Tokens only, from site.css; shared parts from parts.css. */

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- page head: the title only; "The short version" comes right under it (2026-11-17) */
.compare-head { padding-bottom: 0; }
.compare-head + .compare-short { padding-top: clamp(1rem, 3vw, 1.8rem); }
/* after the short version: the two-shores picture (scenes/compare.js) over "Before you read" (what the
   page covers, its date, the disclaimer, the exchange rate); its shape comes from drawing.css (.drawing--wide) */
.compare-about { padding-top: 0; }
.compare-drawing { margin-top: 0; }
.compare-note {
  margin-top: 1.8rem; max-width: 46rem; padding: 1.1rem 1.3rem 1.2rem;
  background: var(--card); border: 2px solid var(--ink); border-left-width: 6px; border-left-color: var(--gold);
  border-radius: 4px 12px 6px 14px; box-shadow: 4px 5px 0 var(--rule);
}
.compare-note__title { font-size: 1.25rem; margin-bottom: 0.5rem; }
.compare-note p { font-size: 1.02rem; line-height: 1.55; }
.compare-note p + p { margin-top: 0.55rem; }
.compare-note__date { font-weight: 700; }

/* ---------- the index of subjects */
.compare-index { padding-block: clamp(1.5rem, 4vw, 2.5rem); }
.page-head + .compare-index { padding-top: 0; }
.compare-index__title { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-bottom: 1rem; }
.compare-index__list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: 0.6rem 1.2rem;
}
.compare-index__list a {
  display: flex; align-items: center; gap: 0.75rem; min-height: 3rem; padding: 0.45rem 0.6rem;
  font-weight: 600; font-size: 1.05rem; text-decoration: none; color: var(--ink);
  border-bottom: 1.5px dashed var(--rule);
}
.compare-index__list a:hover { color: var(--gold-deep); background: color-mix(in srgb, var(--gold-light) 22%, transparent); }
.compare-index__n {
  display: grid; place-items: center; flex: none; width: 2.1rem; height: 2.1rem;
  font-family: var(--font-display); font-weight: 700; font-size: 1rem;
  background: var(--gold); border: 2px solid var(--ink); border-radius: 46% 54% 50% 50% / 52% 48% 52% 48%;
}

/* ---------- one subject */
/* 1rem at line-height 1.6 and a gap of one line: the text sits on the ruled lines of the fine print */
.compare-list { margin: 0; padding-left: 1.15em; display: grid; gap: 1.6rem; font-size: 1rem; line-height: 1.6; }
.compare-list li::marker { color: var(--gold-deep); }
.pair__print .compare-list li::marker { color: var(--coral-deep); }
/* sub-headings inside a long fine print ("Staying legally") */
.compare-list > li.compare-list__head { list-style: none; margin: 0.4rem 0 -0.8rem -1.15em; }
.compare-list__title { font-size: min(1.12rem, 5vw); line-height: 1.3; overflow-wrap: normal; }
.compare-list__link { font-weight: 600; }
/* kept on one line only where it fits: on a phone a long Spanish link ("Quién hereda y los pasos de los
   herederos") ran past its card and scrolled the page sideways (the live test of 2026-11-21) */
@media (min-width: 30rem) { .compare-list__link { white-space: nowrap; } }
/* verbatim wording keeps the sentence's own quotation marks */
q.verbatim { quotes: none; }

.compare-figs__title { font-size: 1.3rem; margin: 2.6rem 0 0.6rem; }
.compare-figs { max-width: 52rem; }
.compare-figs__value { font-weight: 650; }
.compare-figs__note { display: block; font-size: 0.95rem; color: var(--ink-soft); margin-top: 0.15rem; }

.compare-more { margin-top: 2rem; }
.compare-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem 1.6rem; margin-top: 2.2rem; }
.compare-ask { padding: 0.6rem 1.05rem; font-size: 0.98rem; box-shadow: 2px 3px 0 var(--ink); }
.compare-back { font-size: 0.98rem; }
.compare-back::before { content: "\2191\FE0E  "; }

/* ---------- the two pictures */
.compare-chart { margin-top: 2.8rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.6rem 2.4rem; align-items: start; }
.compare-chart > * { min-width: 0; }
.compare-chart__figure { margin: 0; min-width: 0; }
.compare-chart__title { font-size: 1.3rem; margin-bottom: 0.8rem; }
.compare-chart__axis { margin-top: 0.5rem; font-size: 0.98rem; color: var(--ink-soft); text-align: center; max-width: 34rem; }
.compare-chart__caption { margin-top: 0.7rem; font-size: 0.98rem; color: var(--ink-soft); max-width: 44rem; }

.chart {
  display: block; width: 100%; height: auto; overflow: visible;
  background: var(--card); border: 2px solid var(--ink); border-radius: 6px 3px 8px 4px; box-shadow: 4px 5px 0 var(--rule);
  font-family: var(--font-body);
}
.chart text { fill: var(--ink-soft); }
.chart .chart__name { fill: var(--ink); }
.chart .chart__value { fill: var(--ink); font-weight: 650; }
.chart__grid { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 4 4; }
.chart__axis { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.chart__bar {
  fill: color-mix(in srgb, var(--sea) 30%, var(--card)); stroke: var(--ink); stroke-width: 1.6;
  stroke-linejoin: round; stroke-linecap: round;
}
.chart__bar--tax { fill: color-mix(in srgb, var(--gold) 45%, var(--card)); }

.compare-chart--tax .chart { max-width: 34rem; }
.compare-dr {
  padding: 1.2rem 1.3rem 1.3rem; background: var(--card);
  border: 2px dashed var(--ink); border-radius: 12px 4px 14px 6px;
}
.compare-dr__title { font-size: 1.2rem; margin-bottom: 0.5rem; }
.compare-dr p { font-size: 1.05rem; }
.compare-chart__caption--wide {
  grid-column: 1 / -1; max-width: 52rem; margin-top: 0;
  padding: 0.8rem 1.1rem; font-size: 1.02rem; color: var(--ink);
  background: color-mix(in srgb, var(--gold-light) 28%, var(--paper));
  border-left: 4px solid var(--gold); border-radius: 2px 10px 4px 12px;
}

@media (min-width: 56rem) {
  .compare-chart--tax { grid-template-columns: minmax(0, 34rem) minmax(0, 22rem); }
}

/* ---------- the closing band */
.compare-cta__links { font-size: 1rem; }

/* ---------- the index head: title, open-all button, hint */
.compare-index__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem 1.5rem; margin-bottom: 0.6rem; }
.compare-index__head .compare-index__title { margin-bottom: 0; }
.compare-index__hint { color: var(--ink-soft); font-size: 1.02rem; margin-bottom: 1.2rem; max-width: 44rem; }
.compare-toggle { padding: 0.7rem 1.15rem; font-size: 1rem; }

/* ---------- the subjects: one native <details> each, closed on arrival */
.compare-subjects { padding-top: 0; }
.compare-fold { border-top: 2px dashed var(--rule); }
.compare-fold:last-child { border-bottom: 2px dashed var(--rule); }
.compare-fold__summary {
  list-style: none; cursor: pointer;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1rem 1.6rem;
  padding: 1.35rem 0.5rem 1.4rem; border-radius: 6px;
}
.compare-fold__summary::-webkit-details-marker { display: none; }
.compare-fold__summary::marker { content: ""; }
.compare-fold__summary:hover { background: color-mix(in srgb, var(--gold-light) 18%, transparent); }
.compare-fold__summary:hover .compare-fold__title { color: var(--gold-deep); }
.compare-fold__text { display: grid; gap: 0.4rem; min-width: 0; }
.compare-fold__n { margin: 0; }
.compare-fold__title { font-size: clamp(1.55rem, 2.6vw, 2.1rem); }
.compare-fold__lede { color: var(--ink-soft); font-size: 1.05rem; line-height: 1.5; max-width: 46rem; }
.compare-fold__mark { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 650; color: var(--ink); }
/* a 50px drawn button: plus when closed, minus when open */
.compare-fold__sign {
  position: relative; flex: none; width: 2.8rem; height: 2.8rem;
  background: var(--gold); border: 2px solid var(--ink); border-radius: 46% 54% 50% 50% / 52% 48% 52% 48%;
  box-shadow: 2px 3px 0 var(--ink);
}
.compare-fold__sign::before, .compare-fold__sign::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 1.15rem; height: 3px; border-radius: 2px;
  background: var(--ink); transform: translate(-50%, -50%);
}
.compare-fold__sign::after { transform: translate(-50%, -50%) rotate(90deg); transition: transform 0.2s ease; }
.compare-fold[open] .compare-fold__sign { background: var(--card); }
.compare-fold[open] .compare-fold__sign::after { transform: translate(-50%, -50%) rotate(0deg); }
.compare-fold__word--close, .compare-fold[open] .compare-fold__word--open { display: none; }
.compare-fold[open] .compare-fold__word--close { display: inline; }
.compare-fold__summary:focus-visible { outline: 3px solid var(--sea); outline-offset: 2px; }
.compare-fold__body { padding: 1.4rem 0 3.2rem; }
@media (prefers-reduced-motion: reduce) { .compare-fold__sign::after { transition: none; } }

/* ---------- the source list, folded like a subject (closed on arrival) */
.compare-sources__summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.7rem 0.5rem; border-block: 2px dashed var(--rule); border-radius: 6px;
}
.compare-sources__summary::-webkit-details-marker { display: none; }
.compare-sources__summary::marker { content: ""; }
.compare-sources__summary:hover { background: color-mix(in srgb, var(--gold-light) 18%, transparent); }
.compare-sources__summary .sources__title { margin: 0; }
.compare-sources__summary:focus-visible { outline: 3px solid var(--sea); outline-offset: 2px; }
.compare-sources[open] > .compare-sources__summary { margin-bottom: 1rem; }
.compare-sources[open] .compare-fold__sign { background: var(--card); }
.compare-sources[open] .compare-fold__sign::after { transform: translate(-50%, -50%) rotate(0deg); }
.compare-sources[open] .compare-fold__word--open { display: none; }
.compare-sources[open] .compare-fold__word--close { display: inline; }

/* ---------- phone */
@media (max-width: 40rem) {
  /* the folds right below are the same list with their ledes, so the index keeps only its extra link */
  .compare-index__list li:not(.compare-index__extra) { display: none; }
  .compare-fold__word { display: none !important; }
  .compare-fold__summary { padding-inline: 0.2rem; gap: 0.8rem; }
  .compare-fold__lede { font-size: 1rem; }
}

/* ---------- print (parts.css does the rest): every subject open, no fold controls.
   The page script opens the folds on beforeprint; ::details-content covers a browser that
   prints without running it. */
@media print {
  .compare-toggle, .compare-fold__mark, .compare-back, .compare-index__hint { display: none !important; }
  .compare-fold::details-content, .compare-sources::details-content { content-visibility: visible; display: block; block-size: auto; }
  .chart { break-inside: avoid; }
}

/* ---------- "The short version": three dreams and three fine prints at the top */
.compare-short__more { margin-top: 1.2rem; font-weight: 650; }

/* ---------- a boxed note inside a subject (Staying legally: buyers born in the Dominican Republic) */
.compare-box {
  margin-top: 1.6rem; padding: 1.1rem 1.3rem 1.2rem;
  background: var(--card); border: 2px dashed var(--ink-soft); border-radius: 8px 14px 6px 16px;
}
.compare-box__title { font-size: 1.25rem; margin-bottom: 0.8rem; }
.compare-box .compare-list { gap: 1rem; }

/* ---------- large text (a 24px browser default): nothing may push the page sideways */
.compare-list > li { min-width: 0; overflow-wrap: anywhere; }
.page--compare h1, .page--compare h2, .page--compare h3 { hyphens: manual; overflow-wrap: break-word; }

/* headings with large text on a narrow phone: they shrink with the window (a long word such as
   "earthquakes" / "terremotos" keeps to its line), and below 30rem the fold's sign goes under the title */
.compare-fold__title { font-size: clamp(min(1.55rem, 7.2vw), 2.6vw, 2.1rem); }
.compare-dr__title { font-size: min(1.2rem, 5.6vw); }
.compare-box__title { font-size: min(1.25rem, 5.6vw); }
@media (max-width: 30rem) {
  .compare-fold__summary { grid-template-columns: minmax(0, 1fr); }
  .compare-fold__mark { justify-self: start; }
}
