/*
Theme Name: MyTradingDay
Theme URI: https://mytradingday.es
Author: mytradingday.es
Description: A fast, modern theme for a public trading journal. Dark hero with your live equity curve, KPI cards, custom logo and favicon. Works with the MyTradingDay Journal plugin. No external fonts or scripts.
Version: 2.0.1
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: mtdt
*/

:root {
  --bg: #f4f6fa; --surface: #ffffff; --surface-2: #f8fafc;
  --text: #0f172a; --muted: #64748b; --border: #e3e8ef;
  --accent: #059669; --accent-soft: rgba(5,150,105,.1); --accent-contrast: #ffffff;
  --pos: #059669; --neg: #dc2626;
  --navy: #0a1220; --navy-2: #111c31; --navy-text: #e8eef8; --navy-muted: #94a3b8; --glow: #34d399;
  --radius: 14px; --max: 1120px;
  --shadow: 0 1px 2px rgba(15,23,42,.05), 0 8px 24px -12px rgba(15,23,42,.15);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #080d17; --surface: #0f1829; --surface-2: #0c1423;
    --text: #e6ecf5; --muted: #8b9ab0; --border: #1b2740;
    --accent: #34d399; --accent-soft: rgba(52,211,153,.12); --accent-contrast: #04231a;
    --pos: #34d399; --neg: #f87171; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px -14px rgba(0,0,0,.6);
  }
}
*, *::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: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { line-height: 1.2; margin: 1.6em 0 .5em; letter-spacing: -.015em; }
h1 { font-size: 2.2rem; margin-top: 0; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.2rem; }
.wrap { width: min(100% - 2rem, var(--max)); margin-inline: auto; }
.screen-reader-text { position: absolute; left: -9999px; }
.skip-link:focus { left: 8px; top: 8px; z-index: 99; background: var(--surface); padding: 8px 12px; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--border); transition: box-shadow .2s; }
.site-header.is-scrolled { box-shadow: 0 6px 24px -12px rgba(15,23,42,.35); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--text); font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.brand .logo-mark { flex: none; border-radius: 10px; box-shadow: 0 4px 14px -4px rgba(5,150,105,.6); }
.brand small { display: block; font-size: .65rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.brand span.name { display: block; line-height: 1.1; }
.custom-logo { max-height: 42px; width: auto; }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 7px 14px; font: inherit; font-size: .95rem; cursor: pointer; }
.main-nav ul { list-style: none; display: flex; gap: .2rem; margin: 0; padding: 0; flex-wrap: wrap; align-items: center; }
.main-nav a { display: block; padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .95rem; transition: background .15s, color .15s; }
.main-nav a:hover { color: var(--text); background: var(--accent-soft); }
.main-nav .current-menu-item > a, .main-nav .current_page_item > a { color: var(--accent); background: var(--accent-soft); }
@media (max-width: 800px) {
  .nav-toggle { display: inline-block; }
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--border); padding: .5rem 1rem 1rem; box-shadow: var(--shadow); }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; }
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: radial-gradient(900px 420px at 85% -10%, rgba(52,211,153,.22), transparent 60%), radial-gradient(700px 380px at -5% 110%, rgba(59,130,246,.16), transparent 60%), linear-gradient(180deg, var(--navy), var(--navy-2)); color: var(--navy-text); padding: 4.5rem 0 7rem; }
.hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at 70% 30%, #000 20%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at 70% 30%, #000 20%, transparent 75%); pointer-events: none; }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; }
@media (max-width: 880px) { .hero-grid { grid-template-columns: 1fr; gap: 2rem; } .hero { padding: 3rem 0 6rem; } }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--glow); background: rgba(52,211,153,.1); border: 1px solid rgba(52,211,153,.25); padding: 6px 12px; border-radius: 999px; }
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--glow); box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
@media (prefers-reduced-motion: reduce) { .eyebrow::before { animation: none; } html { scroll-behavior: auto; } }
.hero h1 { font-size: clamp(2.3rem, 6vw, 3.9rem); line-height: 1.05; letter-spacing: -.035em; margin: 1.1rem 0 1rem; color: #fff; }
.hero h1 .accent { background: linear-gradient(90deg, #6ee7b7, #34d399 50%, #22d3ee); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 1.15rem; color: var(--navy-muted); max-width: 34em; margin: 0 0 1.8rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; }

.btn { display: inline-flex; align-items: center; gap: .4rem; background: var(--accent); color: var(--accent-contrast); padding: 11px 20px; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: .95rem; border: 1px solid transparent; transition: transform .15s, box-shadow .15s, background .15s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -8px rgba(5,150,105,.7); }
.btn-ghost { background: transparent; color: var(--accent); border-color: var(--border); }
.btn-ghost:hover { box-shadow: none; background: var(--accent-soft); }
.hero .btn { background: var(--glow); color: #04231a; }
.hero .btn-ghost { background: rgba(255,255,255,.06); color: #fff; border-color: rgba(255,255,255,.18); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.12); }

.glass { background: linear-gradient(160deg, rgba(255,255,255,.09), rgba(255,255,255,.03)); border: 1px solid rgba(255,255,255,.12); border-radius: 18px; padding: 1.3rem 1.4rem 1.1rem; backdrop-filter: blur(6px); box-shadow: 0 30px 60px -30px rgba(0,0,0,.7); }
.glass-head { display: flex; justify-content: space-between; align-items: baseline; color: var(--navy-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.glass-val { font-family: var(--mono); font-size: 2.3rem; font-weight: 700; color: #fff; margin: .3rem 0 .2rem; letter-spacing: -.03em; }
.glass-val.is-pos { color: #6ee7b7; } .glass-val.is-neg { color: #fca5a5; }
.spark { display: block; width: 100%; height: 110px; margin: .4rem 0 .8rem; }
.spark-line { fill: none; stroke: var(--spark, #34d399); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.glass-empty { height: 110px; display: grid; place-items: center; color: var(--navy-muted); font-size: .9rem; text-align: center; border: 1px dashed rgba(255,255,255,.15); border-radius: 12px; margin: .6rem 0 .8rem; }
.glass-foot { display: flex; gap: 1.5rem; border-top: 1px solid rgba(255,255,255,.1); padding-top: .8rem; }
.glass-foot div { display: flex; flex-direction: column; font-size: .72rem; color: var(--navy-muted); text-transform: uppercase; letter-spacing: .08em; }
.glass-foot b { font-family: var(--mono); font-size: 1.05rem; color: #fff; letter-spacing: 0; text-transform: none; }

/* ---------- KPI strip ---------- */
.kpis { position: relative; margin-top: -4.2rem; z-index: 2; }
.kpi-grid, .mtd-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kpi, .mtd-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem 1rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.kpi::before, .mtd-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(var(--accent), transparent); }
.kpi-label, .mtd-card-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; opacity: 1; }
.kpi-val, .mtd-card-val { font-family: var(--mono); font-size: 1.7rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.25; }
.kpi-hint { font-size: .78rem; color: var(--muted); }
.kpi-note { text-align: center; color: var(--muted); font-size: .85rem; margin: 1rem 0 0; }
.mtd-pos { color: var(--pos); } .mtd-neg { color: var(--neg); }

/* ---------- Sections ---------- */
.section { padding: 3.5rem 0 0; }
.section-title { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin: 0 0 1.3rem; }
.section-title h2 { margin: 0; font-size: 1.7rem; }
.section-title p { margin: .2rem 0 0; color: var(--muted); }
.link-arrow { font-weight: 700; text-decoration: none; white-space: nowrap; }
.link-arrow:hover { text-decoration: underline; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.step { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow); text-decoration: none; color: var(--text); transition: transform .2s, border-color .2s; display: block; }
a.step:hover { transform: translateY(-3px); border-color: var(--accent); }
.step-num { font-family: var(--mono); font-size: .8rem; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 3px 10px; display: inline-block; margin-bottom: .9rem; }
.step h3 { margin: 0 0 .4rem; font-size: 1.2rem; }
.step p { margin: 0; color: var(--muted); font-size: .95rem; }
.step .go { display: inline-block; margin-top: 1rem; font-weight: 700; color: var(--accent); font-size: .9rem; }

/* ---------- Inner pages ---------- */
.page-hero { background: radial-gradient(700px 260px at 90% -20%, rgba(52,211,153,.2), transparent 60%), linear-gradient(180deg, var(--navy), var(--navy-2)); color: #fff; padding: 2.6rem 0 4.2rem; }
.page-hero .eyebrow { margin-bottom: .8rem; }
.page-hero h1 { color: #fff; margin: 0; font-size: clamp(1.9rem, 4.5vw, 2.8rem); letter-spacing: -.03em; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.chip { font-size: .82rem; font-weight: 600; padding: 4px 12px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: #e2e8f0; font-family: var(--mono); }
.chip.pos { color: #6ee7b7; border-color: rgba(52,211,153,.4); background: rgba(52,211,153,.12); }
.chip.neg { color: #fca5a5; border-color: rgba(248,113,113,.4); background: rgba(248,113,113,.12); }
.site-main { padding-bottom: 3.5rem; }
.content-card { position: relative; margin-top: -2.2rem; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: clamp(1.25rem, 4vw, 2.6rem); box-shadow: var(--shadow); }
.entry-meta { color: var(--muted); font-size: .9rem; margin-bottom: 1rem; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content table { width: 100%; border-collapse: collapse; }
.entry-content th, .entry-content td { border-bottom: 1px solid var(--border); padding: 9px 10px; text-align: left; }
.entry-content blockquote { border-left: 4px solid var(--accent); margin-left: 0; padding: .2rem 0 .2rem 1rem; color: var(--muted); }
.entry-content img { border-radius: 10px; }
.entry-content ol li::marker, .mtd-rules-list li::marker { color: var(--accent); font-weight: 700; }
.mtd-rules-list { padding-left: 1.4rem; } .mtd-rules-list li { padding: .35rem 0 .35rem .3rem; }
.alignwide { width: min(100vw - 2rem, var(--max)); }
.post-thumb { margin: 0 0 1.5rem; }
.post-thumb img { border-radius: var(--radius); border: 1px solid var(--border); display: block; width: 100%; }

/* ---------- Plugin output, restyled ---------- */
.mtd-results, .mtd-single { margin: 0; }
.mtd-curve { margin: 1.5rem 0; }
.mtd-curve figcaption { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.mtd-curve svg { background: linear-gradient(180deg, var(--accent-soft), transparent); border: 1px solid var(--border); border-radius: var(--radius); }
.mtd-line { stroke: var(--accent); stroke-width: 2.4; }
.mtd-tabs { display: inline-flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); padding: 4px; border-radius: 999px; margin: .5rem 0 1rem; }
.mtd-tab { border: 0; background: transparent; color: var(--muted); padding: 7px 18px; border-radius: 999px; font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; transition: all .15s; }
.mtd-tab:hover { color: var(--text); }
.mtd-tab.is-active { background: var(--accent); color: var(--accent-contrast); border-color: transparent; }
.mtd-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.mtd-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.mtd-table thead th { background: var(--surface-2); font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.mtd-table th, .mtd-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.mtd-table tbody tr:last-child td, .mtd-table tbody tr:last-child th { border-bottom: 0; }
.mtd-table tbody tr:hover { background: var(--accent-soft); }
.mtd-table td.mtd-pos, .mtd-table td.mtd-neg { font-family: var(--mono); font-weight: 700; }
.mtd-single .mtd-table { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.mtd-single .mtd-table th { width: 38%; color: var(--muted); font-weight: 600; background: var(--surface-2); }
.mtd-note { font-size: .82rem; color: var(--muted); margin-top: 1rem; }
.mtd-checks li { padding: .2rem 0; font-weight: 600; }
.mtd-checks .ok { color: var(--pos); } .mtd-checks .ko { color: var(--neg); }

/* ---------- Lists / archives ---------- */
.post-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.post-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .2s; display: flex; flex-direction: column; }
.post-item:hover { transform: translateY(-3px); }
.post-item .pi-img img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.post-item .pi-body { padding: 1.2rem 1.4rem 1.4rem; }
.post-item h2 { margin: 0 0 .3em; font-size: 1.2rem; }
.post-item h2 a { text-decoration: none; color: var(--text); }
.post-item h2 a:hover { color: var(--accent); }
.post-item p { margin: .4em 0 0; color: var(--muted); font-size: .95rem; }
.pagination { margin-top: 2rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.pagination .page-numbers { padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; background: var(--surface); }
.pagination .current { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: var(--navy-muted); margin-top: 2rem; padding: 3.2rem 0 2rem; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2.5rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer .brand { color: #fff; } .site-footer .brand small { color: var(--navy-muted); }
.site-footer p { margin: .9rem 0 0; max-width: 32em; }
.footer-nav h4 { color: #fff; font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; margin: 0 0 .8rem; }
.footer-nav ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.footer-nav a { color: var(--navy-muted); text-decoration: none; } .footer-nav a:hover { color: var(--glow); }
.site-footer .risk-note { max-width: none; margin: 2.2rem 0 0; padding: 1rem 1.2rem; border: 1px solid rgba(255,255,255,.1); border-left: 3px solid #f59e0b; border-radius: 10px; background: rgba(255,255,255,.03); line-height: 1.55; font-size: .85rem; }
.copyright { margin: 1.6rem 0 0; font-size: .82rem; opacity: .8; }

/* Forms */
input[type=text], input[type=email], input[type=search], textarea { width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text); font: inherit; }
input[type=submit], button.submit { background: var(--accent); color: var(--accent-contrast); border: 0; padding: 11px 22px; border-radius: 999px; font: inherit; font-weight: 700; cursor: pointer; }
