/*
Theme Name: The Forex Store
Theme URI: https://theforexstore.com
Description: Tema propio para biblioteca de referencia de forex y MetaTrader. Rapido, sin dependencias, con soporte de migas, indice, preguntas frecuentes y datos estructurados.
Author: Martin Alejandro Bamonte
Version: 1.2.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: theforexstore
*/

/* ============ TOKENS ============ */
:root {
  --bg: #0e1116;
  --bg-soft: #151a21;
  --bg-card: #1a212b;
  --line: #262e3a;
  --line-soft: #1e2630;
  --text: #dfe5ec;
  --text-dim: #9aa6b5;
  --text-faint: #6b7787;
  --accent: #f08a24;
  --accent-soft: rgba(240, 138, 36, .12);
  --accent-line: rgba(240, 138, 36, .35);
  --link: #6db3f2;
  --ok: #4ec98a;
  --warn: #e8b45a;
  --radius: 10px;
  --wrap: 1180px;
  --read: 760px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ============ BASE ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.7 var(--font);
  -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.45rem; margin-top: 2em; }
h3 { font-size: 1.15rem; margin-top: 1.6em; }
p, ul, ol, table { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: .4em; }
code { font-family: var(--mono); font-size: .9em; background: var(--bg-card); padding: .15em .4em; border-radius: 4px; color: #e8c07d; }
pre { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1em; overflow-x: auto; }
pre code { background: none; padding: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
blockquote { margin: 1.5em 0; padding: .2em 0 .2em 1.2em; border-left: 3px solid var(--accent-line); color: var(--text-dim); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: var(--accent); color: #111; padding: .5em 1em; border-radius: 6px; z-index: 100; }

/* ============ CABECERA ============ */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14, 17, 22, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.head-in { display: flex; align-items: center; gap: 28px; height: 62px; }
.brand { display: flex; align-items: baseline; gap: 8px; font-weight: 800; font-size: 1.12rem; color: var(--text); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--accent); }
.nav { display: flex; gap: 22px; margin-left: auto; flex-wrap: wrap; }
.nav a { color: var(--text-dim); font-size: .94rem; font-weight: 500; }
.nav a:hover, .nav a.on { color: var(--text); text-decoration: none; }
.nav a.on { box-shadow: inset 0 -2px 0 var(--accent); }
.burger { display: none; margin-left: auto; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 7px 10px; cursor: pointer; }

/* ============ LAYOUT ============ */
.main { padding: 32px 0 64px; }
.lede { color: var(--text-dim); font-size: 1.12rem; margin-bottom: 1.6em; }
.crumbs { font-size: .85rem; color: var(--text-faint); margin-bottom: 1.2em; }
.crumbs a { color: var(--text-faint); }
.crumbs a:hover { color: var(--text-dim); }
.crumbs span { margin: 0 .45em; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 48px; align-items: start; }
.article { max-width: var(--read); }
.aside { position: sticky; top: 86px; font-size: .9rem; }

/* indice */
.toc { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--bg-soft); }
.toc h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); margin: 0 0 .7em; }
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 0 0 .5em; line-height: 1.4; }
.toc a { color: var(--text-dim); }
.toc a:hover { color: var(--text); text-decoration: none; }

/* ============ TARJETAS Y HUBS ============ */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin: 1.5em 0 2.5em; }
.card {
  display: block; padding: 18px 20px; background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--accent-line); text-decoration: none; transform: translateY(-1px); }
.card h3 { margin: 0 0 .4em; font-size: 1.02rem; color: var(--text); }
.card p { margin: 0; color: var(--text-dim); font-size: .92rem; line-height: 1.55; }
.card .kicker { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-bottom: .5em; }

.list { list-style: none; padding: 0; margin: 1.2em 0 2em; }
.list li { border-bottom: 1px solid var(--line-soft); padding: .8em 0; margin: 0; }
.list li:last-child { border-bottom: 0; }
.list a { color: var(--text); font-weight: 600; }
.list .sub { display: block; color: var(--text-dim); font-size: .92rem; font-weight: 400; margin-top: .2em; }

/* ============ TABLAS ============ */
.table-wrap { overflow-x: auto; margin: 1.5em 0; }
table { border-collapse: collapse; width: 100%; font-size: .94rem; }
th, td { text-align: left; padding: .7em .9em; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--text-faint); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
tbody tr:hover { background: var(--bg-soft); }

/* ============ BLOQUES DE CONFIANZA ============ */
.faq { margin: 2.5em 0 1em; }
.faq h3 { font-size: 1.04rem; margin: 1.4em 0 .3em; }
.faq p { color: var(--text-dim); }
.meta-updated { color: var(--text-faint); font-size: .86rem; margin: 2em 0 .8em; }
.author-box {
  display: flex; gap: 16px; align-items: flex-start;
  border-left: 3px solid var(--accent); background: var(--bg-soft);
  padding: 16px 18px; border-radius: 0 var(--radius) var(--radius) 0; margin: 0 0 2em;
  font-size: .94rem; line-height: 1.6;
}
.author-box p { margin: 0; color: var(--text-dim); }
.author-box b { color: var(--text); }
.notice {
  border: 1px solid var(--line); border-left: 3px solid var(--warn);
  background: var(--bg-soft); padding: 14px 16px; border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .92rem; color: var(--text-dim); margin: 1.6em 0;
}
.notice b { color: var(--text); }

/* ============ HOME ============ */
.hero { padding: 54px 0 34px; border-bottom: 1px solid var(--line); margin-bottom: 36px; }
.hero h1 { font-size: 2.6rem; max-width: 26ch; margin-bottom: .35em; }
.hero p { font-size: 1.16rem; color: var(--text-dim); max-width: 62ch; margin: 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 2.6em 0 .4em; }
.section-title h2 { margin: 0; font-size: 1.3rem; }
.section-title a { font-size: .88rem; }

/* ============ PIE ============ */
.site-foot { border-top: 1px solid var(--line); background: var(--bg-soft); padding: 34px 0; margin-top: 60px; font-size: .9rem; color: var(--text-dim); }
.foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 26px; margin-bottom: 26px; }
.foot-grid h3 { font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); margin-bottom: .8em; }
.foot-grid a { display: block; color: var(--text-dim); margin-bottom: .45em; }
.foot-grid a:hover { color: var(--text); text-decoration: none; }
.foot-legal { border-top: 1px solid var(--line); padding-top: 20px; color: var(--text-faint); font-size: .84rem; line-height: 1.65; }
.foot-legal a { color: var(--text-faint); text-decoration: underline; }

/* ============ RESPONSIVE ============ */
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .aside { position: static; margin-bottom: 2em; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  h1 { font-size: 1.7rem; }
  .hero h1 { font-size: 1.9rem; }
  .hero { padding: 34px 0 24px; }
  .burger { display: block; }
  .nav { display: none; position: absolute; top: 62px; left: 0; right: 0; background: var(--bg-soft); border-bottom: 1px solid var(--line); flex-direction: column; gap: 0; padding: 8px 20px 16px; }
  .nav.open { display: flex; }
  .nav a { padding: .6em 0; border-bottom: 1px solid var(--line-soft); }
  .author-box { flex-direction: column; gap: 10px; }
}
@media print {
  .site-head, .site-foot, .aside, .burger { display: none; }
  body { background: #fff; color: #000; }
}

/* ============ CALCULADORAS ============ */
.calc {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-soft); padding: 20px 22px; margin: 1.8em 0;
}
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 18px; }
.calc label { display: block; font-size: .82rem; color: var(--text-dim); margin-bottom: .35em; }
.calc input, .calc select {
  width: 100%; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 7px; padding: .55em .7em;
  font: inherit; font-size: .95rem;
}
.calc input:focus, .calc select:focus { outline: 2px solid var(--accent-line); outline-offset: 1px; }
.calc-out { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.calc-out dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 18px; margin: 0; }
.calc-out dt { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); margin-bottom: .2em; }
.calc-out dd { margin: 0; font-size: 1.28rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.calc-out dd.big { color: var(--accent); font-size: 1.5rem; }
.calc-note { margin: 14px 0 0; font-size: .88rem; color: var(--text-faint); }
.calc-note.warn { color: var(--warn); }
.calc noscript p { color: var(--warn); margin: 0 0 1em; }

/* ============ RELOJ DE SESIONES ============ */
.ses-state { font-weight: 600; padding: 12px 14px; border-radius: var(--radius); margin: 0 0 1em; font-size: .95rem; }
.ses-state.open { background: rgba(78, 201, 138, .1); border: 1px solid rgba(78, 201, 138, .3); color: var(--ok); }
.ses-state.shut { background: rgba(232, 180, 90, .08); border: 1px solid rgba(232, 180, 90, .28); color: var(--warn); }
.ses-open { color: var(--ok); font-weight: 600; }
.ses-shut { color: var(--text-faint); }
