/* =====================================================================
   Blog · diseño A "Matchday"
   Extiende la portada: titulares en Archivo ancha cursiva, chips inclinados
   y la pista vista desde arriba como portada de cada guía.
   Usa los tokens de /styles.css y los componentes mx-* de /landing.css.
   ===================================================================== */

/* ---------- Color por tema ---------- */
.blog-a, .blog-a .tone-cyan { --accent: var(--cyan); --accent-glow: rgba(76, 201, 240, .34); }
.blog-a .tone-lime, .blog-a.tone-lime { --accent: var(--lime); --accent-glow: rgba(212, 255, 58, .30); }
.blog-a .tone-coral, .blog-a.tone-coral { --accent: var(--coral); --accent-glow: rgba(255, 158, 122, .32); }

/* ---------- Ruta de navegación ---------- */
.blog-crumbs { position: relative; padding-block: 14px 0; font-size: .875rem; color: var(--text-2); }
.blog-crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; }
.blog-crumbs li { min-width: 0; overflow-wrap: anywhere; }
.blog-crumbs li + li::before { content: "›"; color: var(--text-light); margin-right: 10px; }
.blog-crumbs a { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: .22em; }
.blog-crumbs a:hover { color: var(--lime); }
.blog-crumbs [aria-current] { color: var(--text-light); }

.blog-preview-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: 16px; }
.blog-preview-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 0 5px; color: var(--text-light); font-size: .8125rem; }
.blog-preview-switch span { margin-inline-end: 4px; }
.blog-preview-switch a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 8px; color: var(--text-2); text-decoration: none; }
.blog-preview-switch a:hover, .blog-preview-switch a[aria-current] { color: var(--lime); text-decoration: underline; text-underline-offset: .24em; }
@media (max-width: 639px) {
    .blog-preview-switch a { padding-inline: 6px; }
}

/* ---------- Portada ilustrada (pista desde arriba) ---------- */
.cover-flat {
    position: relative; overflow: hidden; isolation: isolate;
    background:
        radial-gradient(ellipse 75% 95% at var(--gx, 80%) var(--gy, 10%), var(--accent-glow), transparent 64%),
        linear-gradient(135deg, #12305E 0%, #0F2850 55%, #0B1D3D 100%);
}
.cover-flat::before {
    content: ""; position: absolute; inset: -30% -20%; z-index: -1; pointer-events: none;
    background: linear-gradient(100deg, transparent 42%, rgba(212, 255, 58, .07) 50%, transparent 58%);
}
.ct-svg { display: block; width: 100%; height: 100%; }
.blog-cover-image { display: block; width: 100%; height: 100%; object-fit: cover; }
.ct-court { fill: rgba(255, 255, 255, .035); stroke: rgba(255, 255, 255, .62); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.ct-line { stroke: rgba(255, 255, 255, .5); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.ct-net { stroke: rgba(255, 255, 255, .92); stroke-width: 2.6; vector-effect: non-scaling-stroke; }
.ct-path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 4 7; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ct-arrow { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ct-ball, .ct-bounce { fill: var(--accent); }
.ct-bounce { opacity: .6; }
.ct-glow { fill: var(--accent); opacity: .22; }
.ct-player { fill: var(--accent); stroke: var(--navy); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.ct-player-alt { fill: var(--text-main); }
.ct-hot .ct-court { fill: var(--accent-glow); stroke: var(--accent); }
.ct-label { fill: rgba(255, 255, 255, .6); font: 800 8.5px var(--font-display); letter-spacing: .06em; }
.ct-hot .ct-label { fill: var(--accent); }

/* ---------- Chips ---------- */
.ba-chip {
    display: inline-flex; align-items: center; min-height: 26px; padding: 4px 11px;
    background: var(--accent); color: var(--navy);
    font-size: 11px; font-weight: 800; letter-spacing: .08em; line-height: 1.2; text-transform: uppercase; text-decoration: none;
    transform: skewX(-12deg);
}
a.ba-chip { min-height: 44px; }
a.ba-chip:hover { box-shadow: 0 0 0 3px var(--accent-glow); }

.ba-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px;
    color: var(--text-light); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}

/* ---------- Cabecera del índice ---------- */
.ba-hero {
    border-bottom: 1px solid var(--border-color);
    background: radial-gradient(ellipse at 85% 0%, #163149, var(--bg-body) 72%);
}
.ba-index-head {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 29%);
    align-items: center; gap: 10px 24px; padding-block: 12px 10px;
}
.ba-title { font-size: clamp(1.9rem, 4.6vw, 3.85rem); line-height: .99; overflow-wrap: anywhere; }
.ba-title em { font-style: inherit; color: var(--lime); }
.ba-index-lead { max-width: 47ch; color: var(--text-2); font-size: .95rem; line-height: 1.45; }
.ba-lead { max-width: 58ch; color: var(--text-2); font-size: clamp(1.05rem, 1.6vw, 1.25rem); line-height: 1.55; }

.ba-tabs { display: flex; flex-wrap: wrap; gap: 0 8px; }
.ba-tab {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 14px;
    border-bottom: 3px solid transparent;
    color: var(--text-light); font-family: var(--font-display); font-stretch: 112%; font-weight: 800; font-size: .9rem; text-transform: uppercase; text-decoration: none;
    white-space: nowrap; transition: color .2s, border-color .2s;
}
.ba-tab span {
    padding: 3px 7px; background: var(--surface-3); color: var(--text-2);
    font-family: var(--font-body); font-size: 11px; font-variant-numeric: tabular-nums; transform: skewX(-10deg);
}
.ba-tab:hover { color: var(--lime); }
.ba-tab[aria-current] { color: var(--lime); border-bottom-color: var(--lime); }
.ba-tab[aria-current] span { background: var(--lime); color: var(--navy); }

/* ---------- Fichas ---------- */
.ba-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.ba-card {
    position: relative; display: flex; flex-direction: column; min-width: 0;
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius); overflow: hidden;
    transition: transform .25s var(--ease-out), border-color .25s ease, box-shadow .25s ease;
}
.ba-card:hover { transform: translateY(-6px); border-color: var(--accent); box-shadow: 0 24px 50px -24px var(--accent-glow); }
.ba-card-cover { aspect-ratio: 16 / 9; border-bottom: 1px solid var(--border-color); }
.ba-card-cover .ba-chip { position: absolute; left: 16px; bottom: 14px; }
.ba-card-body { display: flex; flex: 1; flex-direction: column; gap: 10px; padding: 20px 22px 18px; }
.ba-card-topic { color: var(--accent); }
.ba-card h3 { font-family: var(--font-display); font-stretch: 112%; font-weight: 800; font-size: clamp(1.18rem, 1.6vw, 1.36rem); line-height: 1.14; letter-spacing: -.01em; overflow-wrap: anywhere; }
.ba-card h3 a { color: var(--text-main); text-decoration: none; }
.ba-card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.ba-card-summary {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
    color: var(--text-2); font-size: .95rem; line-height: 1.55;
}
.ba-card-more {
    display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 14px;
    border-top: 1px solid var(--border-color);
    color: var(--accent); font-size: 12.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.ba-card-more .mx-ic { transition: transform .22s var(--ease-out); }
.ba-card:hover .ba-card-more .mx-ic { transform: translateX(4px); }

.ba-archive { padding-block: 18px clamp(32px, 5vw, 64px); }
.ba-archive .ba-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ba-archive .ba-card-cover { aspect-ratio: auto; height: clamp(94px, 9vw, 116px); }
.ba-archive .ba-card-cover .ct-svg { width: min(100%, 212px); margin-inline: auto; }
.ba-archive .ba-card-cover .ba-chip { left: 12px; bottom: 8px; min-height: 20px; padding: 3px 7px; font-size: .625rem; }
.ba-archive .ba-card-body { gap: 5px; padding: 11px 13px 13px; }
.ba-archive .ba-meta { gap: 1px 6px; font-size: .6875rem; }
.ba-archive .ba-card h3 { font-size: clamp(.98rem, 1.55vw, 1.22rem); font-stretch: 100%; line-height: 1.16; }
.ba-archive .ba-card-summary { -webkit-line-clamp: 2; font-size: .875rem; line-height: 1.42; }

/* ---------- Artículo: cabecera ---------- */
.ba-progress { position: fixed; z-index: 60; top: 0; left: 0; right: 0; height: 3px; pointer-events: none; }
.ba-progress span { display: block; height: 100%; background: var(--lime); box-shadow: 0 0 12px rgba(212, 255, 58, .7); transform: scaleX(0); transform-origin: 0 50%; }
.ba-post-hero {
    position: relative; overflow: hidden; border-bottom: 1px solid var(--border-color);
    background: radial-gradient(ellipse 50% 90% at 85% 10%, var(--accent-glow), transparent 70%), var(--bg-body);
}
.ba-post-hero::after {
    content: ""; position: absolute; left: -10%; right: -10%; top: 55%; height: 200px; pointer-events: none;
    background: linear-gradient(90deg, rgba(212, 255, 58, 0), rgba(212, 255, 58, .07), rgba(212, 255, 58, 0));
    transform: rotate(-8deg);
}
.ba-post-hero-grid {
    position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(260px, .8fr);
    align-items: center; gap: clamp(28px, 5vw, 72px); padding-block: clamp(20px, 3vw, 36px) clamp(44px, 6vw, 76px);
}
.ba-post-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; color: var(--text-light); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.ba-post-title { margin: 20px 0 20px; font-size: clamp(2.1rem, 4.5vw, 4rem); line-height: .95; overflow-wrap: anywhere; }
.ba-byline { display: flex; align-items: center; gap: 14px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--border-color); color: var(--text-light); font-size: .875rem; }
.ba-byline .brand-mark { width: 40px; height: 40px; }
.ba-byline strong { display: block; color: var(--text-main); font-size: .95rem; }
.ba-post-cover {
    aspect-ratio: 4 / 3; border: 1px solid var(--border-strong); border-radius: var(--radius);
    box-shadow: 0 40px 80px -36px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .04);
    transform: perspective(1400px) rotateY(-9deg) rotateX(3deg);
}
.ba-post-cover:has(.blog-cover-image) { aspect-ratio: 16 / 9; }

/* ---------- Artículo: índice y texto ---------- */
.ba-post-body {
    display: grid; grid-template-columns: 250px minmax(0, 720px); justify-content: center;
    gap: clamp(32px, 6vw, 96px); padding-block: clamp(36px, 6vw, 72px) clamp(56px, 8vw, 96px);
}
.ba-aside { position: sticky; top: 104px; align-self: start; display: grid; gap: 24px; }
.ba-toc h2 { margin-bottom: 12px; color: var(--lime); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.ba-toc ol { border-left: 2px solid var(--border-color); }
.ba-toc a {
    display: flex; gap: 12px; margin-left: -2px; padding: 9px 0 9px 16px; border-left: 2px solid transparent;
    color: var(--text-light); font-size: .875rem; font-weight: 600; line-height: 1.4; text-decoration: none; transition: color .15s, border-color .15s;
}
.ba-toc a span { flex: none; min-width: 20px; color: var(--text-mute); font-family: var(--font-display); font-stretch: 125%; font-style: italic; font-weight: 800; }
.ba-toc a:hover { color: var(--text-main); }
.ba-toc a[aria-current] { border-left-color: var(--lime); color: var(--lime); }
.ba-toc a[aria-current] span { color: var(--lime); }
.ba-back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--text-2); font-size: .875rem; font-weight: 700; text-decoration: none; }
.ba-back .mx-ic { width: 16px; height: 16px; color: var(--lime); transform: scaleX(-1); }
.ba-back:hover { color: var(--lime); }

.ba-copy { min-width: 0; color: var(--text-2); font-size: clamp(1.03rem, 1.4vw, 1.125rem); line-height: 1.75; overflow-wrap: anywhere; }
.ba-copy > section + section { margin-top: clamp(40px, 5vw, 56px); }
.ba-copy h2 {
    display: flex; align-items: baseline; gap: 14px; margin-bottom: 16px; scroll-margin-top: 12px;
    color: var(--text-main); font-family: var(--font-display); font-stretch: 112%; font-weight: 800;
    font-size: clamp(1.45rem, 2.6vw, 2rem); line-height: 1.15; letter-spacing: -.01em;
}
.ba-copy h2 span { flex: none; color: var(--lime); font-stretch: 125%; font-style: italic; font-weight: 900; font-size: .78em; }
.ba-copy p + p { margin-top: 16px; }
.ba-steps { counter-reset: paso; display: grid; gap: 10px; margin-top: 18px; }
.ba-steps li {
    counter-increment: paso; position: relative; padding: 16px 18px 16px 66px;
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius); line-height: 1.6;
}
.ba-steps li::before {
    content: counter(paso); position: absolute; left: 18px; top: 15px; width: 32px; height: 32px;
    display: grid; place-items: center; background: var(--lime); color: var(--navy);
    font-family: var(--font-display); font-stretch: 125%; font-style: italic; font-weight: 900; font-size: 15px;
    transform: skewX(-10deg);
}
.ba-items { display: grid; gap: 12px; margin-top: 18px; }
.ba-items li { position: relative; padding-left: 28px; }
.ba-items li::before { content: ""; position: absolute; left: 3px; top: .62em; width: 10px; height: 10px; background: var(--lime); transform: skewX(-12deg); }
.ba-copy .blog-resource-links { display: grid; gap: 8px; margin-top: 22px; }
.ba-copy .blog-resource-links a {
    display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 54px; padding: 12px 18px;
    background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius);
    color: var(--text-main); font-size: 1rem; font-weight: 700; line-height: 1.4; text-decoration: none; transition: border-color .2s, color .2s;
}
.ba-copy .blog-resource-links a::after { content: "→"; flex: none; color: var(--lime); font-size: 1.15rem; transition: transform .2s var(--ease-out); }
.ba-copy .blog-resource-links a:hover { border-color: var(--lime); color: var(--lime); }
.ba-copy .blog-resource-links a:hover::after { transform: translateX(4px); }
.ba-sources { margin-top: clamp(44px, 6vw, 64px); padding-top: 24px; border-top: 1px solid var(--border-color); }
.ba-copy .ba-sources h2 { color: var(--text-light); font-family: var(--font-body); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.ba-sources .blog-resource-links a { min-height: 48px; background: transparent; font-size: .95rem; font-weight: 600; color: var(--text-2); }

/* ---------- Siguiente paso ---------- */
.ba-cta { padding-bottom: clamp(56px, 8vw, 96px); }
.ba-cta-panel {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px 48px;
    padding: clamp(30px, 4.4vw, 56px) clamp(30px, 5vw, 72px);
    background: var(--accent); color: var(--navy);
    clip-path: polygon(2.5% 0, 100% 0, 97.5% 100%, 0 100%);
}
.ba-cta-panel h2 { font-size: clamp(1.9rem, 3.8vw, 3.2rem); }
.ba-cta-panel p:not(.mx-eyebrow) { max-width: 52ch; margin-top: 14px; color: #1C2840; font-size: 1.05rem; line-height: 1.55; }

/* ---------- Relacionadas ---------- */
.ba-related { padding-block: clamp(48px, 7vw, 88px); border-top: 1px solid var(--border-color); background: var(--bg-deep); }
.ba-related-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin-bottom: 26px; }
.ba-related-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.8rem); }
.ba-related-head em { font-style: inherit; color: var(--accent); }
.ba-related .ba-card { background: var(--bg-card); }

/* ---------- Acciones, paginación, vacío y 404 ---------- */
.blog-action { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--lime); font-weight: 800; text-decoration: none; }
.blog-action:hover { text-decoration: underline; text-underline-offset: .22em; }
.blog-pages { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 24px; margin-top: 32px; color: var(--text-2); font-size: .9rem; }
.blog-empty { padding: 28px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius); color: var(--text-2); }
.blog-error { max-width: 730px; margin: 40px auto 72px; }
.blog-error h1 { margin-bottom: 12px; color: var(--text-main); font: 900 italic clamp(1.8rem, 5vw, 3rem)/1 var(--font-display); font-stretch: 125%; text-transform: uppercase; }

/* ---------- Foco ---------- */
.blog-a a:focus-visible, .blog-crumbs a:focus-visible, .blog-error a:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
.ba-tabs .ba-tab:focus-visible { outline-offset: -4px; }
.ba-card:has(h3 a:focus-visible) { outline: 3px solid var(--lime); outline-offset: 4px; }
.ba-card h3 a:focus-visible { outline: none; }

/* ---------- Adaptación ---------- */
@media (max-width: 1023px) {
    .ba-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ba-archive .ba-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ba-post-hero-grid { grid-template-columns: minmax(0, 1fr); }
    .ba-post-cover { aspect-ratio: 16 / 9; transform: none; }
    .ba-post-body { grid-template-columns: minmax(0, 720px); }
    .ba-aside { position: static; }
    .ba-toc { padding: 20px 22px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius); }
}
@media (max-width: 899px) {
    .ba-cta-panel { grid-template-columns: minmax(0, 1fr); clip-path: none; }
    .ba-cta-panel .mx-btn { justify-self: start; max-width: 100%; height: auto; min-height: 52px; padding-block: 10px; white-space: normal; text-align: center; }
}
@media (max-width: 639px) {
    .ba-grid { grid-template-columns: minmax(0, 1fr); }
    .ba-hero .blog-preview-row { align-items: center; column-gap: 8px; }
    .ba-hero .blog-crumbs { padding-block: 0; }
    .ba-hero .blog-preview-switch { gap: 0; }
    .ba-index-head { grid-template-columns: minmax(0, 1fr); gap: 8px; padding-block: 8px; }
    .ba-index-lead { font-size: .875rem; }
    .ba-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
    .ba-tab { justify-content: space-between; gap: 6px; padding-inline: 3px; font-family: var(--font-body); font-size: .76rem; white-space: normal; }
    .ba-archive { padding-top: 12px; }
    .ba-archive .ba-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .ba-archive .ba-card-cover { height: clamp(70px, 19vw, 100px); }
    .ba-archive .ba-card-cover .ba-chip { left: 7px; bottom: 5px; max-width: calc(100% - 14px); }
    .ba-archive .ba-card-body { padding: 9px 9px 11px; }
    .ba-archive .ba-meta { letter-spacing: .01em; }
    .ba-archive .ba-card-topic ~ :is(time, .ba-date-divider) { display: none; }
    .ba-archive .ba-card-summary { display: none; }
    .ba-post-hero .blog-crumbs [aria-current] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .ba-post-hero .blog-crumbs li:last-child::before { display: none; }
    .ba-post-title { font-size: clamp(1.95rem, 7.8vw, 2.8rem); font-stretch: 112%; }
    .ba-cta-panel .mx-btn { width: 100%; }
    .ba-steps li { padding-left: 60px; }
}
@media (prefers-reduced-motion: reduce) {
    .ba-card, .ba-card-more .mx-ic, .ba-copy .blog-resource-links a::after { transition: none; }
    .ba-card:hover { transform: none; }
}
