/* Praça — sitio legal y de presentación. Tipografía del sistema, sin recursos externos. Contraste AA comprobado
   (texto ≥ 7:1, enlaces ≥ 5,5:1 en claro y ≥ 7:1 en oscuro). El naranja (#FF7A1A) solo como detalle decorativo. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #f3f6fc;
  --border: #d7deeb;
  --text: #141a26;
  --muted: #4a5468;
  --brand: #2457e0;
  --link: #2457e0;
  --on-brand: #ffffff;
  --accent: #ff7a1a;
  --focus: #2457e0;
  --marker-bg: #fff1e6;
  --marker-text: #7a2e00;
  --maxw: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1320;
    --surface: #182033;
    --border: #2b3550;
    --text: #e9edf5;
    --muted: #a9b3c7;
    --link: #8eadff;
    --focus: #8eadff;
    --marker-bg: #3a2210;
    --marker-text: #ffd3b3;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1rem;
}

a {
  color: var(--link);
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

main:focus {
  outline: none;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -10rem;
  padding: 0.5rem 1rem;
  background: var(--brand);
  color: var(--on-brand);
  border-radius: 0.5rem;
  z-index: 10;
}

.skip:focus {
  top: 0.5rem;
}

/* Cabecera */
.site-header {
  border-bottom: 1px solid var(--border);
  position: relative;
}

.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 4rem;
  height: 3px;
  background: var(--accent);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.75rem;
  padding-bottom: 0.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.2rem;
  text-decoration: none;
}

.brand img {
  border-radius: 8px;
}

.site-header ul,
.site-footer ul,
.stores,
.choices,
.root-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.langs ul {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.langs a {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  text-decoration: none;
}

.langs a[aria-current="true"] {
  color: var(--text);
  background: var(--surface);
  font-weight: 600;
}

.main-nav ul {
  display: flex;
  gap: 0.25rem 1.25rem;
  flex-wrap: wrap;
  padding: 0.25rem 0 0.75rem;
}

.main-nav a {
  display: inline-block;
  padding: 0.25rem 0;
  text-decoration: none;
  font-weight: 500;
}

.main-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 0.4em;
}

/* Contenido */
main {
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 2rem 0 0.5rem;
}

h1 {
  font-size: clamp(1.75rem, 5vw, 2.4rem);
  margin-top: 0.5rem;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.4rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

h3 {
  font-size: 1.1rem;
  margin-top: 1.5rem;
}

h2[id],
h3[id] {
  scroll-margin-top: 1rem;
}

p,
ul,
ol {
  margin: 0.5rem 0 1rem;
}

.lead {
  font-size: 1.15rem;
  color: var(--text);
}

.updated {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 0;
}

address {
  font-style: normal;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-radius: 0.75rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface);
  padding: 0.1em 0.35em;
  border-radius: 0.3em;
}

.toc {
  background: var(--surface);
  border-radius: 0.75rem;
  padding: 0.25rem 1.25rem 0.5rem;
  margin: 1.5rem 0;
}

.toc h2 {
  border: 0;
  margin-top: 0.75rem;
  font-size: 1rem;
}

.toc ol {
  margin: 0.25rem 0 0.5rem;
  padding-left: 1.25rem;
}

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}

caption {
  text-align: left;
  color: var(--muted);
  padding-bottom: 0.5rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.75rem 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

thead th {
  color: var(--muted);
  font-weight: 600;
}

.legal-review {
  border-left: 3px solid var(--border);
  padding-left: 1rem;
}

/* Redacción jurídica provisional (LEGAL_REVIEWED = false en web/content/site.mjs) */
.legal-draft {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.marker {
  background: var(--marker-bg);
  color: var(--marker-text);
  padding: 0 0.25em;
  border-radius: 0.25em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
}

/* Portada */
.hero {
  padding: 1rem 0 0.5rem;
}

.hero h1 {
  margin-top: 1rem;
}

.hero-logo {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: 22px;
}

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 0.5rem;
}

.store {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.6rem 1.1rem;
  border-radius: 0.75rem;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 600;
  text-decoration: none;
}

.store.is-pending {
  background: var(--surface);
  color: var(--text);
  border: 1px dashed var(--border);
}

.features {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.features li {
  background: var(--surface);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
}

.features h3 {
  margin-top: 0;
}

.features h3::before {
  content: "";
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  margin-right: 0.5rem;
  border-radius: 0.2rem;
  background: var(--accent);
  vertical-align: 0.1em;
}

.features p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

/* Raíz (elección de idioma) y 404 */
.root-choice,
.not-found {
  text-align: center;
  padding-top: 3rem;
}

.root-choice .hero-logo,
.not-found .brand {
  margin: 0 auto;
}

.choices {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.choices a {
  display: inline-block;
  min-width: 9rem;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 600;
  text-decoration: none;
}

.root-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  font-size: 0.95rem;
}

.not-found section {
  margin-top: 1.5rem;
}

.not-found h1,
.not-found h2 {
  border: 0;
}

/* Pie */
.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  padding: 1rem 0 2rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin-bottom: 0.75rem !important;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media print {
  .site-header nav,
  .skip,
  .stores {
    display: none;
  }
}
