/* Umbral Financiero — estilos globales. Colores extraídos de los archivos de marca (ver docs/arquitectura.md). */
:root {
  --navy: #04203d;        /* extraído del símbolo: ≈ #031F3B */
  --navy-deep: #021428;
  --blue: #1468d4;        /* azul eléctrico UI (accesible sobre blanco) */
  --blue-bright: #31a3e9; /* azul claro del símbolo */
  --gold: #d4a64a;
  --gold-light: #f3d089;  /* dorado claro del símbolo */
  --bg: #f7f9fc;
  --ink: #243247;
  --muted: #5b6b82;
  --line: #dfe6f0;
  --white: #fff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(4,32,61,.06), 0 8px 24px rgba(4,32,61,.07);
  --font-head: "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
/* Fuentes locales opcionales: coloca los .woff2 en public/fonts/ (ver README). */
@font-face { font-family: "Inter"; src: local("Inter"), url("/fonts/inter-variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Manrope"; src: local("Manrope"), url("/fonts/manrope-variable.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 400 1rem/1.65 var(--font-body); color: var(--ink); background: var(--bg); }
img { max-width: 100%; height: auto; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: #0d4fa8; }
h1, h2, h3 { font-family: var(--font-head); color: var(--navy); line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--blue-bright); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--gold); color: var(--navy); padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
.wrap { width: min(1180px, 100% - 2rem); margin-inline: auto; }
.wrap-full { width: 100%; }
.devbar { background: var(--gold); color: var(--navy); font-size: .8rem; text-align: center; padding: .3rem 1rem; font-weight: 600; }

/* Cabecera */
.site-header { background: var(--navy); position: sticky; top: 0; z-index: 50; border-bottom: 1px solid rgba(255,255,255,.08); }
.site-header__in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: #fff; }
.brand img { border-radius: 50%; }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font: 800 1.05rem var(--font-head); letter-spacing: .12em; color: #fff; }
.brand__name b { color: var(--gold); font-weight: 800; }
.brand__desc { font-size: .66rem; letter-spacing: .22em; text-transform: uppercase; color: #b9c6da; margin-top: 3px; }
.nav { display: flex; gap: .25rem; }
.nav a { color: #dbe5f3; text-decoration: none; padding: .55rem .8rem; border-radius: 8px; font-weight: 500; font-size: .93rem; }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a[aria-current="page"] { color: var(--gold-light); box-shadow: inset 0 -2px 0 var(--gold); border-radius: 8px 8px 0 0; }
.nav-toggle { display: none; background: none; border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 8px; padding: .4rem; cursor: pointer; }
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: var(--navy); padding: .5rem 1rem 1rem; border-bottom: 1px solid rgba(255,255,255,.1); }
  .nav.is-open { display: flex; }
  .nav a { padding: .8rem; }
}

/* Botones y chips */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: 700 .95rem var(--font-body); padding: .75rem 1.2rem; border-radius: 10px; text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: transform .15s, background .15s; }
.btn:hover { transform: translateY(-1px); }
.btn--gold { background: var(--gold); color: var(--navy); } .btn--gold:hover { background: var(--gold-light); color: var(--navy); }
.btn--primary { background: var(--blue); color: #fff; } .btn--primary:hover { background: #0d4fa8; color: #fff; }
.btn--ghost { border-color: rgba(255,255,255,.35); color: #fff; } .btn--ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.btn--disabled { opacity: .6; cursor: default; } .btn--disabled:hover { transform: none; background: none; }
.chip { display: inline-block; font-size: .75rem; font-weight: 600; padding: .2rem .65rem; border-radius: 99px; background: #e8eef8; color: var(--navy); text-decoration: none; margin: 0 .3rem .3rem 0; }
.chip--gold { background: #f8edd2; color: #6b4c0c; } .chip--info { background: #dfeefc; color: #0d4fa8; }
.chip--demo { background: #fde7c3; color: #7a4a00; } .chip--on { background: var(--navy); color: #fff; }
.chips { margin-bottom: 1.5rem; }
.chips .chip { font-size: .85rem; padding: .35rem .9rem; }
.eyebrow { font: 700 .75rem var(--font-head); letter-spacing: .16em; text-transform: uppercase; color: var(--blue); margin-bottom: .6rem; }
.eyebrow a { text-decoration: none; }
.eyebrow--gold { color: var(--gold-light); }

/* Hero */
.hero { background: radial-gradient(1200px 500px at 85% -10%, rgba(49,163,233,.28), transparent 60%), linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%); color: #fff; padding: clamp(2rem, 6vw, 4.5rem) 0; }
.hero__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.hero h1 { color: #fff; } .hero h1 span { color: var(--gold-light); }
.hero .lead { color: #c9d6ea; font-size: 1.15rem; max-width: 34rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.2rem 0 0; }
.hero__card { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: 18px; padding: clamp(1.1rem, 3vw, 1.8rem); backdrop-filter: blur(6px); animation: rise .6s ease both; }
.hero__card h2 { color: #fff; font-size: 1.45rem; } .hero__card h2 a { color: #fff; text-decoration: none; } .hero__card h2 a:hover { color: var(--gold-light); }
.hero__card p { color: #d0dbec; }
.hero__card .embed { margin: 1rem 0; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media (max-width: 860px) { .hero__grid { grid-template-columns: 1fr; } }
.ticker { background: #fff; border-bottom: 1px solid var(--line); min-height: 46px; }

/* Secciones */
.section { padding: clamp(2rem, 5vw, 3.5rem) 0; }
.section--tint { background: #eef3fa; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.more { font-weight: 600; text-decoration: none; white-space: nowrap; }
.wrap.section > section { margin-bottom: 2.5rem; } .wrap.section > section:last-child { margin-bottom: 0; }
.page-hero { background: linear-gradient(160deg, var(--navy), var(--navy-deep)); color: #fff; padding: clamp(2rem, 5vw, 3.4rem) 0; border-bottom: 3px solid var(--gold); }
.page-hero h1 { color: #fff; margin-bottom: .3em; } .page-hero .lead { color: #c9d6ea; max-width: 46rem; margin: 0; font-size: 1.1rem; }
.page-hero .eyebrow { color: var(--gold-light); }

/* Tarjetas y rejillas */
.grid { display: grid; gap: 1.25rem; margin-bottom: 1.25rem; }
.grid--3 { grid-template-columns: repeat(3, 1fr); } .grid--2 { grid-template-columns: repeat(2, 1fr); } .grid--2-1 { grid-template-columns: 2fr 1fr; }
@media (max-width: 960px) { .grid--3 { grid-template-columns: repeat(2, 1fr); } .grid--2-1 { grid-template-columns: 1fr; } }
@media (max-width: 680px) { .grid--3, .grid--2 { grid-template-columns: 1fr; } }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); min-width: 0; }
.card--flush { padding: 0; overflow: hidden; }
.card--soft { background: #f1f6fd; box-shadow: none; margin-top: 1.25rem; }
.card__title { font-size: 1.1rem; } .card__title small { color: var(--muted); font-weight: 500; }
.briefing { display: flex; flex-direction: column; padding: 0; overflow: hidden; transition: transform .2s; }
.briefing:hover { transform: translateY(-3px); }
.briefing__img img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.briefing__body { padding: 1.1rem 1.25rem 1.25rem; }
.briefing__title a, .article__title a { color: var(--navy); text-decoration: none; } .briefing__title a:hover, .article__title a:hover { color: var(--blue); }
.meta { color: var(--muted); font-size: .85rem; margin-bottom: .5rem; }
.tags { margin: .5rem 0 0; }
.note { font-size: .82rem; color: var(--muted); margin-top: .8rem; }
.list { padding-left: 1.2rem; } .list li { margin-bottom: .4rem; }
.empty { text-align: center; padding: 2.5rem 1rem; background: #fff; border: 1px dashed #c3d0e4; border-radius: var(--radius); }
.empty__icon { color: var(--navy); margin-bottom: .5rem; }
.empty h3 { margin-bottom: .3rem; } .empty p { color: var(--muted); max-width: 36rem; margin-inline: auto; }

/* Widgets */
.tv { width: 100%; background: #fff; }
.tv__ph { display: flex; align-items: center; justify-content: center; min-height: 80px; color: var(--muted); font-size: .9rem; padding: 1rem; margin: 0; text-align: center; }
.tradingview-widget-container { width: 100%; }

/* Divisas */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.fx__table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.fx__table th, .fx__table td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid var(--line); font-size: .93rem; white-space: nowrap; }
.fx__table thead th { background: #eef3fa; font: 700 .75rem var(--font-head); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.fx__table tbody tr:last-child > * { border-bottom: 0; }
.fx__pair { display: block; font-weight: 700; color: var(--navy); } .fx__country { font-size: .78rem; color: var(--muted); font-weight: 400; }
.fx__rate { font-weight: 700; color: var(--navy); font-size: 1rem !important; }
.fx__status { font-size: .82rem; color: var(--muted); margin: .6rem 0 0; }
.fx[data-fx="compact"] .table-wrap { border: 0; box-shadow: none; }
.fx[data-fx="compact"] th:nth-child(n+3), .fx[data-fx="compact"] td:nth-child(n+3) { display: none; }
.fx[data-fx="compact"] .fx__table th, .fx[data-fx="compact"] .fx__table td { padding: .55rem .4rem; }
.fx-tools { margin-top: 1.5rem; }
.field { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: .8rem; }
.field input, .field select { font: 500 1rem var(--font-body); padding: .65rem .8rem; border: 1px solid #c3d0e4; border-radius: 10px; color: var(--ink); background: #fff; width: 100%; }
.converter__row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.converter__out { display: block; font: 800 1.35rem var(--font-head); color: var(--navy); background: #eef3fa; padding: 1rem; border-radius: 10px; }
.fx-chart { min-height: 220px; } .fx-svg { width: 100%; height: auto; display: block; }

/* Contenido editorial */
.article-page { max-width: 820px; padding: clamp(1.5rem, 4vw, 3rem) 0; }
.article-page .lead { font-size: 1.2rem; color: var(--muted); }
.prose { max-width: 70ch; overflow-wrap: anywhere; } .prose h2 { margin-top: 1.8em; } .prose h3 { margin-top: 1.4em; }
.article-page .list { overflow-wrap: anywhere; }
.prose blockquote { border-left: 4px solid var(--gold); margin: 1.2em 0; padding: .1em 1.2em; color: var(--muted); background: #fff; border-radius: 0 10px 10px 0; }
.prose code { background: #eaf0f9; padding: .1em .35em; border-radius: 5px; font-size: .9em; }
.media { display: grid; gap: 1rem; margin: 1.5rem 0; }
.briefing-media { display: grid; grid-template-columns: repeat(2, minmax(0, 340px)); gap: 1rem; margin: 1.5rem 0; padding-top: 1rem; border-top: 1px solid var(--line); align-items: start; }
.briefing-media__item { min-width: 0; }
@media (max-width: 680px) { .briefing-media { grid-template-columns: minmax(0, 340px); } }
.embed { position: relative; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; background: #000; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed-spotify { width: 100%; border: 0; border-radius: 12px; }
.share { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .9rem; } .share span { color: var(--muted); }

/* CTA y pie */
.cta { background: linear-gradient(120deg, var(--navy), #0a3566); color: #fff; padding: 2.5rem 0; }
.cta__in { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.cta h2 { color: #fff; margin: 0 0 .2em; } .cta p { color: #c9d6ea; margin: 0; } .cta .hero__actions { margin: 0; }
.site-footer { background: var(--navy-deep); color: #b9c6da; padding-top: 2.5rem; font-size: .92rem; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 2rem; }
@media (max-width: 760px) { .footer__grid { grid-template-columns: 1fr; } }
.site-footer h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; color: var(--gold-light); }
.site-footer ul { list-style: none; padding: 0; margin: 0; } .site-footer li { margin-bottom: .4rem; }
.site-footer a { color: #dbe5f3; } .site-footer a:hover { color: var(--gold-light); }
.footer__logo { border-radius: 8px; margin-bottom: .8rem; }
.footer__legal { border-top: 1px solid rgba(255,255,255,.1); margin-top: 2rem; padding: 1.2rem 0 2rem; font-size: .78rem; color: #8fa0ba; }
.hero__grid > *, .footer__grid > * { min-width: 0; }

/* ───── Iteración 2: widgets con altura explícita, pestañas, cinta continua, rendimientos ───── */
.tv { height: var(--h, 400px); position: relative; }
.tv > .tradingview-widget-container { height: 100%; width: 100%; display: flex; flex-direction: column; }
.tv .tradingview-widget-container__widget { flex: 1 1 auto; min-height: 0; width: 100%; }
.tv .tradingview-widget-copyright { flex: 0 0 auto; font-size: .72rem; line-height: 1.6; text-align: right; padding: 2px 10px; color: var(--muted); }
.tv .tradingview-widget-copyright a { color: var(--blue); }
.tv--table { color-scheme: light; --tv-widget-font-family: var(--font-body); --tv-widget-accent-color: var(--blue); }
.tv--table tv-market-data, .tv--overview tv-market-overview { display: block; width: 100%; height: 100%; }
.tv__component-ph { position: absolute; inset: 0; }
tv-market-data:defined + .tv__component-ph, tv-market-overview:defined + .tv__component-ph { display: none; }
@media (max-width: 680px) { .tv { height: var(--hm, var(--h, 400px)); } }
.card--flush { display: flex; flex-direction: column; }
.card--flush > .tv { flex: 0 0 auto; }
.card__bar { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; min-height: 52px; padding: .55rem .9rem; border-bottom: 1px solid var(--line); background: #f3f7fc; font-size: .9rem; }
.muted { color: var(--muted); font-size: .8rem; }
.chips--tight { margin: 0; display: flex; flex-wrap: wrap; gap: .3rem; } .chips--tight .chip { margin: 0; }
.chip--btn { border: 0; cursor: pointer; font-family: inherit; } .chip--btn:hover { background: #d9e4f5; } .chip--btn.chip--on:hover { background: var(--navy); }
.chartpanel__cap { margin: 0; padding: 0 .9rem; height: 44px; display: flex; align-items: center; font-size: .85rem; color: var(--muted); border-bottom: 1px solid var(--line); overflow: hidden; }
.chartpanel__cap strong { color: var(--navy); margin-right: .3em; white-space: nowrap; }
.note--in { padding: 0 .9rem .6rem; margin: .5rem 0 0; }

/* Pestañas */
.tabs__list { display: flex; gap: .15rem; overflow-x: auto; background: #f3f7fc; border-bottom: 1px solid var(--line); padding: .35rem .5rem 0; }
.tabs__list [role="tab"] { font: 600 .88rem var(--font-body); border: 0; background: none; color: var(--muted); padding: .65rem .9rem; cursor: pointer; border-radius: 8px 8px 0 0; white-space: nowrap; }
.tabs__list [role="tab"]:hover { color: var(--navy); }
.tabs__list [role="tab"][aria-selected="true"] { color: var(--navy); background: #fff; box-shadow: inset 0 -3px 0 var(--gold); }
.tabs__panel[hidden] { display: none; }
.panel-pad { padding: 1rem; }

/* Cinta continua (dos copias del widget «Tickers» desplazadas por CSS) */
.ticker { position: relative; background: #fff; border-bottom: 1px solid var(--line); overflow: hidden; max-width: 100vw; contain: paint; min-height: 0; }
.ticker__track { display: flex; width: max-content; animation: ticker-scroll calc(var(--n, 12) * 6s) linear infinite; will-change: transform; }
.ticker[data-paused] .ticker__track { animation-play-state: paused !important; }

.ticker:has(.ticker__slot:focus-within) .ticker__track { animation-play-state: paused !important; }
.ticker__toggle { position: absolute; right: .25rem; top: 0; z-index: 1; border: 1px solid var(--line); border-radius: 4px; background: var(--white); color: var(--navy); font: 600 .65rem var(--font-body); padding: .2rem .4rem; cursor: pointer; }
.ticker__slot { display: flex; flex: 0 0 auto; width: calc(var(--n, 12) * 375px); }
.ticker__item { flex: 0 0 375px; min-width: 0; }
.ticker__name { display: block; height: 20px; padding: 1px 12px; font-size: .7rem; font-weight: 600; line-height: 18px; color: var(--navy); }
.ticker__slot tv-tickers { display: block; width: 100%; height: 62px; }
@keyframes ticker-scroll { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }
.ticker__src { font-size: .72rem; color: var(--muted); margin: .35rem auto 0; }
@media (prefers-reduced-motion: reduce) {
  /* Preferencia editorial explícita: automática también aquí, a menor velocidad.
     El botón de pausa permanece disponible; las demás animaciones sí se reducen. */
  .ticker__track { animation: ticker-scroll calc(var(--n, 12) * 8s) linear infinite !important; }
}

/* Rendimientos del Tesoro */
.yields__tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-bottom: .8rem; }
.ytile { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: .6rem .75rem; cursor: pointer; font-family: inherit; display: flex; flex-direction: column; gap: .1rem; }
.ytile.is-on { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(20,104,212,.18); }
.ytile__l { font-size: .75rem; color: var(--muted); font-weight: 600; }
.ytile__v { font: 800 1.35rem var(--font-head); color: var(--navy); }
.ytile__c { font-size: .78rem; color: var(--muted); } .ytile__c.up { color: #0b7a43; } .ytile__c.down { color: #b42318; }
.yields__chart { min-height: 230px; }
@media (max-width: 420px) { .yields__tiles { grid-template-columns: 1fr; } }
.fx__via, .fx__note { color: var(--muted); font-size: .8em; }
.fx__table .chip { white-space: normal; }
.fx[data-fx="compact"] th:nth-child(n+4), .fx[data-fx="compact"] td:nth-child(n+4) { display: none; }
.fx[data-fx="compact"] th:nth-child(n+3), .fx[data-fx="compact"] td:nth-child(n+3) { display: none; }
.fx__sub { display: block; font-size: .68rem; font-weight: 500; color: var(--muted); }
.card__bar { height: 52px; min-height: 0; flex-wrap: nowrap; overflow: hidden; flex: 0 0 auto; }
.card__bar .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__bar .chips--tight { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; }
.card__bar .chip { white-space: nowrap; flex: 0 0 auto; }
.fx__table .chip { border-radius: 10px; line-height: 1.3; }
.chartpanel__chips { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .9rem; }
.chartpanel__chips .chip { margin: 0; }
.chartpanel__lab { font-size: .8rem; font-weight: 700; color: var(--muted); margin-right: .2rem; }
.card__bar .chartpanel__cap { height: auto; padding: 0; border: 0; display: block; font-size: .85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
