/* MarchaMotor — estilos globales
   Paleta: rojo templo + dorado (Tailandia), verde selva + azul Pacífico (Costa Rica) */

:root {
  --bg: #f8f3ea;
  --surface: #ffffff;
  --surface-2: #f1e8da;
  --ink: #2b2622;
  --ink-2: #4f4740;
  --muted: #6b625a;
  --line: #e2d6c4;
  --red: #9e1b1e;
  --red-soft: #f6e1df;
  --gold: #7a5718;        /* dorado oscurecido para texto (AA sobre fondo claro) */
  --gold-bright: #d9a441;
  --gold-soft: #f8ecd3;
  --green: #1e6b4e;
  --green-soft: #dcefe6;
  --blue: #0d5c7a;
  --blue-soft: #dceef5;
  --focus: #0d5c7a;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgb(43 38 34 / .06), 0 6px 20px rgb(43 38 34 / .07);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-th: "Noto Sans Thai", "Plus Jakarta Sans", system-ui, sans-serif;
  --max: 1120px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
}
:lang(th) body, body:lang(th) { font-family: var(--font-th); line-height: 1.85; }
:lang(th) h1, :lang(th) h2, :lang(th) h3 { line-height: 1.45; }

img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-underline-offset: .18em; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.2; color: var(--ink); margin: 0 0 .6em; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); letter-spacing: -.01em; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: .35em; }

.container { width: min(100% - 32px, var(--max)); margin-inline: auto; }
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: .6em 1em; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 12px; color: #fff; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.notice-bar {
  background: var(--ink); color: #f3ece2; font-size: .85rem; text-align: center; padding: .45em 16px;
}
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgb(248 243 234 / .94);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 68px; }
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.15rem; }
.brand:hover { color: var(--ink); }
.brand svg { width: 34px; height: 34px; }
.brand span small { display: block; font-weight: 500; font-size: .72rem; color: var(--muted); letter-spacing: .02em; }

.nav-toggle {
  margin-left: auto; display: inline-flex; align-items: center; gap: .4rem;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: .5em .9em; font: inherit; font-size: .95rem; cursor: pointer;
}
.nav-toggle svg { width: 20px; height: 20px; }
.primary-nav { display: none; }
.primary-nav.is-open {
  display: block; position: absolute; left: 0; right: 0; top: 100%;
  background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  padding: .5rem 16px 1rem;
}
.primary-nav ul { list-style: none; margin: 0; padding: 0; }
.primary-nav a {
  display: block; padding: .6em .75em; border-radius: var(--radius-sm);
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem;
}
.primary-nav a:hover { background: var(--surface-2); color: var(--ink); }
.primary-nav a[aria-current="page"] { color: var(--red); background: var(--red-soft); }

.lang-switch {
  display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface);
  font-size: .9rem; font-weight: 700;
}
.lang-switch a, .lang-switch span { padding: .4em .8em; text-decoration: none; color: var(--ink-2); }
.lang-switch [aria-current="true"] { background: var(--ink); color: #fff; }
.lang-switch a:hover { background: var(--surface-2); color: var(--ink); }

@media (min-width: 1040px) {
  .nav-toggle { display: none; }
  .primary-nav, .primary-nav.is-open {
    display: block; position: static; margin-left: auto; background: none; border: 0; box-shadow: none; padding: 0;
  }
  .primary-nav ul { display: flex; gap: .1rem; }
  .primary-nav a { padding: .5em .6em; font-size: .9rem; }
}

/* ---------- Layout blocks ---------- */
main { display: block; }
.section { padding: clamp(2.5rem, 5vw, 4.5rem) 0; }
.section-alt { background: var(--surface-2); }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--red); margin-bottom: .6rem;
}
:lang(th) .eyebrow { letter-spacing: .02em; text-transform: none; font-size: .9rem; }
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 62ch; }
.prose { max-width: 72ch; }
.prose h2 { margin-top: 1.8em; }
.prose h3 { margin-top: 1.4em; }

.hero { padding: clamp(2rem, 5vw, 4rem) 0 clamp(2rem, 4vw, 3rem); }
.hero-grid { display: grid; gap: 2rem; align-items: center; }
.hero-art { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--surface); }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.05fr 1fr; } }

.page-hero { padding: clamp(2rem, 4vw, 3.2rem) 0; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--gold-soft), var(--bg)); }
.page-hero.cr { background: linear-gradient(180deg, var(--green-soft), var(--bg)); }
.page-hero-grid { display: grid; gap: 1.5rem; align-items: center; }
@media (min-width: 900px) { .page-hero-grid { grid-template-columns: 1.3fr 1fr; } }
.page-hero figure { margin: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }

.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem; padding: .75em 1.25em; border-radius: 999px;
  font-weight: 700; text-decoration: none; border: 2px solid transparent; font-size: 1rem;
  transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: #7f1518; color: #fff; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.btn-secondary:hover { background: var(--ink); color: #fff; transform: translateY(-1px); }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 1.1rem; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem;
  box-shadow: 0 1px 2px rgb(43 38 34 / .04);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card p:last-child { margin-bottom: 0; }
a.card { display: block; text-decoration: none; color: inherit; }
a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--gold-bright); color: inherit; }
a.card h3 { color: var(--ink); }
.card .more { color: var(--blue); font-weight: 700; font-size: .95rem; }
.icon-badge {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; margin-bottom: .9rem;
  background: var(--gold-soft); color: var(--gold);
}
.icon-badge svg { width: 24px; height: 24px; }
.icon-badge.red { background: var(--red-soft); color: var(--red); }
.icon-badge.green { background: var(--green-soft); color: var(--green); }
.icon-badge.blue { background: var(--blue-soft); color: var(--blue); }

.flag-tag {
  display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 700;
  padding: .2em .7em; border-radius: 999px; margin-bottom: .6rem;
}
.flag-tag.th { background: var(--gold-soft); color: var(--gold); }
.flag-tag.cr { background: var(--green-soft); color: var(--green); }

.stat { font-size: 2rem; font-weight: 800; line-height: 1.1; color: var(--red); }
.stat.green { color: var(--green); }

/* ---------- Callouts ---------- */
.callout {
  border-left: 5px solid var(--blue); background: var(--blue-soft); border-radius: var(--radius-sm);
  padding: 1rem 1.2rem; margin: 1.5rem 0;
}
.callout.warn { border-color: var(--red); background: var(--red-soft); }
.callout.gold { border-color: var(--gold-bright); background: var(--gold-soft); }
.callout p:last-child { margin-bottom: 0; }

/* ---------- Steps ---------- */
.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: .9rem; }
.steps li {
  counter-increment: step; position: relative; padding: 1rem 1rem 1rem 3.6rem; margin: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.steps li::before {
  content: counter(step); position: absolute; left: 1rem; top: 1rem;
  width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: #fff; font-weight: 800; font-size: .95rem;
}

/* ---------- Comparison table ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.compare { width: 100%; border-collapse: collapse; min-width: 640px; font-size: .98rem; }
.compare caption { text-align: left; padding: 1rem 1.2rem; font-weight: 700; }
.compare th, .compare td { padding: .9rem 1.1rem; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
.compare thead th { background: var(--surface-2); font-size: .9rem; border-top: 0; }
.compare thead th.th { color: var(--gold); }
.compare thead th.cr { color: var(--green); }
.compare tbody th { width: 22%; font-weight: 700; color: var(--ink-2); }
.compare tbody tr:hover { background: #fcf9f4; }
.pill { display: inline-block; font-size: .78rem; font-weight: 700; padding: .1em .6em; border-radius: 999px; margin-left: .3rem; }
.pill.same { background: var(--green-soft); color: var(--green); }
.pill.diff { background: var(--gold-soft); color: var(--gold); }

@media (max-width: 700px) {
  .compare.stack { min-width: 0; }
  .compare.stack thead { display: none; }
  .compare.stack tr { display: block; border-top: 1px solid var(--line); padding: .8rem 1rem; }
  .compare.stack th, .compare.stack td { display: block; border: 0; padding: .25rem 0; width: auto; }
  .compare.stack tbody th { font-size: 1rem; color: var(--ink); }
  .compare.stack td::before { content: attr(data-label); display: block; font-size: .78rem; font-weight: 700; color: var(--muted); }
}

/* ---------- Timeline ---------- */
.timeline-cols { display: grid; gap: 2rem; }
@media (min-width: 880px) { .timeline-cols { grid-template-columns: 1fr 1fr; } }
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.6rem; position: relative; }
.timeline::before { content: ""; position: absolute; left: .45rem; top: .4rem; bottom: .4rem; width: 3px; border-radius: 3px; background: var(--gold-bright); }
.timeline.cr::before { background: var(--green); }
.timeline li { position: relative; margin: 0 0 1.1rem; }
.timeline li::before {
  content: ""; position: absolute; left: -1.6rem; top: 1.25rem; width: 1.15rem; height: 1.15rem; border-radius: 50%;
  background: var(--surface); border: 4px solid var(--red);
}
.timeline.cr li::before { border-color: var(--blue); }
.timeline .card { padding: 1rem 1.2rem; }
.timeline time { display: inline-block; font-weight: 800; color: var(--red); font-size: 1.05rem; margin-bottom: .2rem; }
.timeline.cr time { color: var(--blue); }

/* ---------- FAQ (details) ---------- */
.faq { display: grid; gap: .7rem; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.faq summary {
  cursor: pointer; list-style: none; padding: 1rem 3rem 1rem 1.2rem; font-weight: 700; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 1.2rem; top: 50%; width: .6rem; height: .6rem; margin-top: -.4rem;
  border-right: 2.5px solid var(--ink-2); border-bottom: 2.5px solid var(--ink-2); transform: rotate(45deg);
  transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -.1rem; }
.faq details > div { padding: 0 1.2rem 1.1rem; color: var(--ink-2); }

/* ---------- Sources ---------- */
.sources {
  margin-top: 2.5rem; padding: 1rem 1.2rem; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px dashed var(--line); font-size: .88rem; color: var(--muted);
}
.sources h2 { font-size: 1rem; margin: 0 0 .5rem; color: var(--ink-2); }
.sources ol { margin: 0; padding-left: 1.2em; }
.sources a { word-break: break-word; }
sup a { text-decoration: none; font-weight: 700; font-size: .8em; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 1rem; }
.field label { display: block; font-weight: 700; margin-bottom: .3rem; }
.field .hint { font-size: .85rem; color: var(--muted); margin-top: .25rem; }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1.5px solid #b9ab97; border-radius: var(--radius-sm); padding: .7em .85em;
}
.field input:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.field textarea { min-height: 150px; resize: vertical; }
.check { display: flex; gap: .6rem; align-items: flex-start; }
.check input { width: 1.2rem; height: 1.2rem; margin-top: .3rem; accent-color: var(--blue); }
button.btn { cursor: pointer; font-family: inherit; }

.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .9rem; }
.contact-list li { display: flex; gap: .8rem; align-items: flex-start; margin: 0; }
.contact-list svg { width: 22px; height: 22px; flex: none; margin-top: .25rem; color: var(--red); }

/* ---------- Footer ---------- */
.site-footer { background: #241f1c; color: #e9e0d4; padding: 3rem 0 1.5rem; margin-top: 0; font-size: .95rem; }
.site-footer a { color: #f2d48f; }
.site-footer a:hover { color: #fff; }
.site-footer h2 { color: #fff; font-size: 1rem; margin-bottom: .8rem; }
.footer-grid { display: grid; gap: 2rem; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; } }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer address { font-style: normal; }
.disclaimer-box {
  border: 1px solid #5a4f47; border-radius: var(--radius-sm); padding: .9rem 1rem; margin: 2rem 0 1.2rem;
  background: #2e2824; font-size: .9rem;
}
.footer-bottom { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; font-size: .85rem; color: #bfb3a5; border-top: 1px solid #3d3530; padding-top: 1.2rem; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
  .site-header, .notice-bar, .site-footer .footer-grid, .btn-row { display: none; }
  body { background: #fff; }
}
