// ═══════════════════════════════════════════════════════════════
// SECCIÓN — EDIBARAK
// Editoriales. Estética: Swiss Punk (Weingart, Brockmann roto).
// Helvética gritada, reglas gruesas, grid partido, rojo + negro,
// elementos rotados, mezcla de escalas extrema.
// ═══════════════════════════════════════════════════════════════

function EDSection({ initialSlug, onSlugChange, onChrome }) {
  const eds = window.EDITORIALES || [];
  const [openSlug, setOpenSlug] = React.useState(initialSlug || null);

  React.useEffect(() => {
    onChrome && onChrome({ accent: '#e60012', dark: '#0a0a0a', light: '#f4f1ea' });
  }, [onChrome]);

  React.useEffect(() => {
    setOpenSlug(initialSlug || null);
  }, [initialSlug]);

  const open = (slug) => {
    setOpenSlug(slug);
    onSlugChange && onSlugChange(slug);
  };
  const back = () => {
    setOpenSlug(null);
    onSlugChange && onSlugChange(null);
  };

  if (openSlug) {
    const ed = eds.find(e => e.slug === openSlug);
    if (!ed) return <EDIndex eds={eds} onOpen={open} />;
    return <EDReader ed={ed} onBack={back} eds={eds} onOpen={open} />;
  }
  return <EDIndex eds={eds} onOpen={open} />;
}

// ─── INDEX ──────────────────────────────────────────────────
function EDIndex({ eds, onOpen }) {
  return (
    <div style={{
      width:'100%', height:'100%', background:'#f4f1ea', color:'#0a0a0a',
      fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",
      overflow:'auto', position:'relative',
      scrollbarWidth:'none',
    }} className="ed-scroll">
      <style>{`
        .ed-scroll::-webkit-scrollbar { display: none; }
        .ed-grid-noise {
          background-image:
            repeating-linear-gradient(0deg, rgba(0,0,0,0.04) 0 1px, transparent 1px 48px),
            repeating-linear-gradient(90deg, rgba(0,0,0,0.04) 0 1px, transparent 1px 48px);
        }
      `}</style>

      <div style={{ height: 20 }}/>

      {/* MASTHEAD — kilométrico */}
      <div style={{
        padding:'20px 16px 0', position:'relative',
        borderBottom:'10px solid #0a0a0a',
      }}>
        <h1 style={{
          fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",
          fontWeight: 900, fontSize: 112, lineHeight: 0.82,
          letterSpacing:'-0.055em', margin:'8px 0 4px',
          color:'#0a0a0a',
        }}>
          Edi<br/>
          <span style={{ color:'#e60012', fontStyle:'italic' }}>Barak</span>
        </h1>

        <div style={{
          display:'flex', justifyContent:'space-between', alignItems:'baseline',
          padding:'14px 0 10px',
          fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",
          fontSize: 10, fontWeight: 700, letterSpacing:'0.22em',
          textTransform:'uppercase', color:'#0a0a0a',
        }}>
          <span>Editoriales · opinión</span>
          <span style={{ color:'#e60012' }}>→ {eds.length} textos</span>
        </div>
      </div>

      {/* MANIFIESTO — giant rule + statement */}
      <div style={{
        padding:'22px 16px', background:'#0a0a0a', color:'#f4f1ea',
        position:'relative',
      }}>
        <div style={{
          fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",
          fontSize: 9, fontWeight: 700, letterSpacing:'0.32em',
          color:'#e60012', textTransform:'uppercase', marginBottom: 10,
        }}>
          ☛ Manifiesto / sin fecha
        </div>
        <div style={{
          fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",
          fontWeight: 900, fontSize: 30, lineHeight: 1.02,
          letterSpacing:'-0.02em', color:'#f4f1ea',
          textTransform:'uppercase',
        }}>
          A veces<br/>
          <span style={{ color:'#e60012' }}>no es solo</span><br/>
          hablar de<br/>
          cine.
        </div>
        <div style={{
          marginTop: 18,
          fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",
          fontSize: 11, fontWeight: 400, lineHeight: 1.5,
          color:'#a8a39a', maxWidth:'38ch',
        }}>
          Se supone que hablamos de cine, pero acá también hablamos de otras cosas.
        </div>
      </div>

      {/* LIST — grid partido, números gigantes */}
      <div style={{ padding:'0', borderTop:'1px solid #0a0a0a' }}>
        {eds.map((ed, i) => {
          const [year, ...rest] = ed.published.split('-');
          const mes = ed.published.split('-')[1];
          // Oldest = N°01, newest = N°(total). `eds` is sorted DESC by date,
          // so reverse the numbering at render time.
          const numStr = String(eds.length - i).padStart(2, '0');
          return (
            <button
              key={ed.slug}
              onClick={() => onOpen(ed.slug)}
              style={{
                display:'block', width:'100%', textAlign:'left',
                background: i % 2 === 0 ? '#f4f1ea' : '#eae5d8',
                border:'none', borderBottom:'1px solid #0a0a0a',
                padding: 0, cursor:'pointer', position:'relative',
                fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",
              }}>
              <div style={{
                display:'grid',
                gridTemplateColumns:'80px 1fr',
                minHeight: 180,
              }}>
                {/* Number column */}
                <div style={{
                  background:'#e60012', color:'#f4f1ea',
                  padding:'12px 0', position:'relative',
                  borderRight:'1px solid #0a0a0a',
                }}>
                  <div style={{
                    fontSize: 10, fontWeight: 700, letterSpacing:'0.22em',
                    textAlign:'center', marginBottom: 4,
                  }}>N°</div>
                  <div style={{
                    fontSize: 54, fontWeight: 900, letterSpacing:'-0.04em',
                    textAlign:'center', lineHeight: 0.9,
                  }}>{numStr}</div>
                  <div style={{
                    position:'absolute', bottom: 10, left: 0, right: 0,
                    textAlign:'center',
                    fontSize: 8, fontWeight: 700, letterSpacing:'0.2em',
                  }}>
                    {mes}<br/>{year}
                  </div>
                </div>

                {/* Content column */}
                <div style={{ padding:'14px 16px 16px', position:'relative' }}>
                  <div style={{
                    fontSize: 9, fontWeight: 700, letterSpacing:'0.28em',
                    color:'#0a0a0a', textTransform:'uppercase',
                    borderBottom:'2px solid #0a0a0a', paddingBottom: 6, marginBottom: 8,
                    display:'flex', justifyContent:'space-between',
                  }}>
                    <span>Editorial / {ed.topic}</span>
                    <span style={{ color:'#e60012' }}>↗</span>
                  </div>

                  <div style={{
                    fontWeight: 900, fontSize: 22, lineHeight: 1.02,
                    letterSpacing:'-0.02em', color:'#0a0a0a',
                    textTransform:'uppercase', marginBottom: 10,
                    textWrap:'balance',
                  }}>
                    {ed.title}
                  </div>

                  <div style={{
                    fontWeight: 400, fontSize: 12.5, lineHeight: 1.45,
                    color:'#3a3a3a', fontStyle:'italic',
                    maxWidth:'38ch',
                  }}>
                    {ed.excerpt}
                  </div>

                  <div style={{
                    position:'absolute', bottom: 10, right: 14,
                    fontSize: 9, fontWeight: 700, letterSpacing:'0.2em',
                    color:'#e60012', textTransform:'uppercase',
                  }}>
                    leer →
                  </div>
                </div>
              </div>
            </button>
          );
        })}
      </div>

      {/* FOOT */}
      <div style={{
        padding:'22px 16px 40px', background:'#0a0a0a', color:'#f4f1ea',
        display:'flex', justifyContent:'space-between', alignItems:'baseline',
      }}>
        <div style={{
          fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",
          fontSize: 10, fontWeight: 700, letterSpacing:'0.28em', textTransform:'uppercase',
        }}>Archivo 2021–2026</div>
        <div style={{
          fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",
          fontSize: 9, fontWeight: 400, letterSpacing:'0.2em', color:'#a8a39a', textTransform:'uppercase',
        }}>
          {eds.length.toString().padStart(2,'0')} · textos
        </div>
      </div>
    </div>
  );
}

// ─── READER ──────────────────────────────────────────────────
function EDReader({ ed, onBack, eds, onOpen }) {
  const idx = eds.findIndex(e => e.slug === ed.slug);
  const next = eds[(idx + 1) % eds.length];
  // Oldest = N°01 (eds is sorted DESC, so reverse).
  const editionNum = String(eds.length - idx).padStart(2, '0');

  return (
    <div style={{
      width:'100%', height:'100%', background:'#f4f1ea', color:'#0a0a0a',
      fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",
      overflow:'auto', position:'relative',
      scrollbarWidth:'none',
    }} className="ed-reader">
      <style>{`.ed-reader::-webkit-scrollbar { display: none; }`}</style>

      <div style={{ height: 20 }}/>

      {/* TOP BAR — right padding clears the hamburger button (top:14, 44×44) */}
      <div style={{
        padding:'14px 64px 10px 16px',
        display:'flex', justifyContent:'space-between', alignItems:'center',
        borderBottom:'2px solid #0a0a0a',
      }}>
        <button onClick={onBack} style={{
          background:'#0a0a0a', color:'#f4f1ea',
          border:'none', padding:'6px 10px 6px 8px',
          fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",
          fontSize: 10, fontWeight: 700, letterSpacing:'0.22em',
          textTransform:'uppercase', cursor:'pointer',
        }}>← ÍNDICE</button>
        <div style={{
          fontSize: 10, fontWeight: 700, letterSpacing:'0.28em',
          textTransform:'uppercase', color:'#e60012',
        }}>EdiBarak N° {editionNum}</div>
      </div>

      {/* SPLIT HEADER */}
      <div style={{
        display:'grid', gridTemplateColumns:'40% 60%',
        borderBottom:'10px solid #0a0a0a',
      }}>
        {/* Left: big N°+date block */}
        <div style={{
          background:'#0a0a0a', color:'#f4f1ea',
          padding:'18px 14px', position:'relative',
        }}>
          <div style={{
            fontSize: 9, fontWeight: 700, letterSpacing:'0.3em',
            color:'#e60012', marginBottom: 8,
          }}>N°{editionNum}</div>

          <div style={{
            fontSize: 58, fontWeight: 900, lineHeight: 0.88,
            letterSpacing:'-0.04em', color:'#f4f1ea',
            whiteSpace:'nowrap',
          }}>
            {ed.published.split('-')[0]}
          </div>
          <div style={{
            fontSize: 11, fontWeight: 700, letterSpacing:'0.22em',
            textTransform:'uppercase', marginTop: 8, color:'#a8a39a',
          }}>
            {(() => {
              const M = ['ENE','FEB','MAR','ABR','MAY','JUN','JUL','AGO','SEP','OCT','NOV','DIC'];
              const [y,m,d] = ed.published.split('-');
              return `${d} · ${M[+m-1]} · ${y}`;
            })()}
          </div>

          <div style={{
            position:'absolute', bottom: 10, left: 14,
            fontSize: 8, fontWeight: 700, letterSpacing:'0.3em',
            color:'#e60012', textTransform:'uppercase',
          }}>
            {ed.topic}
          </div>
        </div>

        {/* Right: title */}
        <div style={{
          padding:'18px 14px', background:'#e60012', color:'#0a0a0a',
          position:'relative',
        }}>
          <div style={{
            fontSize: 9, fontWeight: 700, letterSpacing:'0.3em',
            textTransform:'uppercase', marginBottom: 10, color:'#0a0a0a',
          }}>Editorial ☛</div>

          <h1 style={{
            fontWeight: 900, fontSize: 28, lineHeight: 0.98,
            letterSpacing:'-0.02em', margin: 0,
            textTransform:'uppercase', color:'#0a0a0a',
            textWrap:'balance',
          }}>
            {ed.title}
          </h1>
        </div>
      </div>

      {/* PULL QUOTE (excerpt) */}
      <div style={{
        padding:'32px 16px 22px 16px', background:'#eae5d8',
        borderBottom:'1px solid #0a0a0a',
        position:'relative',
      }}>
        <span aria-hidden="true" style={{
          position:'absolute', top: -18, left: 10,
          fontSize: 110, fontWeight: 900, color:'#e60012',
          lineHeight: 1, fontFamily:"Georgia, serif",
          pointerEvents:'none',
        }}>"</span>
        <div style={{
          fontWeight: 400, fontSize: 18, lineHeight: 1.32, fontStyle:'italic',
          color:'#0a0a0a', maxWidth:'32ch',
          paddingLeft: 0, paddingTop: 8,
          textWrap:'balance', position:'relative',
        }}>
          {ed.excerpt}
        </div>
      </div>

      {/* BODY */}
      <article style={{ padding:'24px 18px 20px' }}>
        {ed.blocks.map((b, i) => {
          if (b.kind === 'h' || b.kind === 'meta') return null; // header ya visual arriba
          if (b.kind === 'h2') {
            return (
              <div key={i} style={{
                margin:'28px 0 14px', paddingBottom: 6,
                borderBottom:'4px solid #0a0a0a',
                display:'flex', alignItems:'center', gap: 8,
              }}>
                <div style={{ width: 18, height: 18, background:'#e60012' }}/>
                <h2 style={{
                  fontWeight: 900, fontSize: 22, margin: 0,
                  lineHeight: 1.0, letterSpacing:'-0.015em',
                  textTransform:'uppercase',
                }}>{b.text}</h2>
              </div>
            );
          }
          if (b.kind === 'img') {
            return (
              <figure key={i} style={{
                margin:'22px 0 22px',
                padding: 0,
              }}>
                <img src={b.src} alt={b.alt || ''} loading="lazy" style={{
                  display:'block', width:'100%', aspectRatio:'16/9',
                  objectFit:'cover', background:'#1a1510',
                  border:'1px solid #0a0a0a',
                }}/>
                {b.alt && (
                  <figcaption style={{
                    marginTop: 6,
                    fontFamily:"'Crimson Pro', Georgia, serif",
                    fontStyle:'italic', fontSize: 12,
                    color:'#3a3a3a', lineHeight: 1.35,
                    borderLeft:'3px solid #e60012', paddingLeft: 8,
                  }}>{b.alt}</figcaption>
                )}
              </figure>
            );
          }
          if (b.kind === 'pull') {
            return (
              <blockquote key={i} style={{
                margin:'24px 0',
                padding:'16px 18px',
                borderTop:'3px solid #0a0a0a',
                borderBottom:'3px solid #0a0a0a',
                fontFamily:"'Playfair Display', 'Times New Roman', serif",
                fontStyle:'italic', fontWeight: 700,
                fontSize: 22, lineHeight: 1.18,
                color:'#0a0a0a', textAlign:'center',
              }}>
                "{b.text}"
              </blockquote>
            );
          }
          return (
            <p key={i} style={{
              fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",
              fontSize: 14.5, lineHeight: 1.55, fontWeight: 400,
              color:'#0a0a0a', margin:'0 0 14px',
              textWrap:'pretty',
            }}>
              {i === 2 ? (
                <>
                  <span style={{
                    float:'left', fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",
                    fontWeight: 900, fontSize: 60, lineHeight: 0.82,
                    color:'#e60012', paddingRight: 6, paddingTop: 3,
                  }}>{b.text[0]}</span>
                  {b.text.slice(1)}
                </>
              ) : b.text}
            </p>
          );
        })}
      </article>

      {/* END RULE */}
      <div style={{
        margin:'8px 18px 0', padding:'16px 0',
        borderTop:'10px solid #0a0a0a',
        display:'flex', justifyContent:'space-between', alignItems:'center',
      }}>
        <div style={{
          fontSize: 9, fontWeight: 700, letterSpacing:'0.28em',
          color:'#0a0a0a', textTransform:'uppercase',
        }}>Fin del texto</div>
        <div style={{ width: 24, height: 24, background:'#e60012' }}/>
      </div>

      {/* SEGUÍ LEYENDO — cross-section related items */}
      <EDRelated ed={ed} eds={eds} />

      {/* NEXT */}
      <button
        onClick={() => onOpen(next.slug)}
        style={{
          margin:'20px 18px 0', width:'calc(100% - 36px)',
          background:'#0a0a0a', color:'#f4f1ea',
          border:'none', padding:'18px 14px 20px',
          textAlign:'left', cursor:'pointer',
          display:'flex', justifyContent:'space-between', alignItems:'center',
          fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",
          gap: 14,
        }}>
        <div style={{ flex: 1, minWidth: 0 }}>
          <div style={{
            fontSize: 9, fontWeight: 700, letterSpacing:'0.28em',
            color:'#e60012', textTransform:'uppercase', marginBottom: 6,
          }}>Siguiente editorial →</div>
          <div style={{
            fontWeight: 900, fontSize: 17, lineHeight: 1.08,
            letterSpacing:'-0.015em', color:'#f4f1ea',
            textTransform:'uppercase',
            wordBreak:'break-word',
          }}>
            {next.title}
          </div>
        </div>
        <div style={{
          fontSize: 36, fontWeight: 900, color:'#e60012',
          flex:'0 0 auto', lineHeight: 1,
        }}>→</div>
      </button>
      {/* bottom spacer — keeps the CTA clear of the browser's bottom chrome */}
      <div style={{ height: 96 }}/>
    </div>
  );
}

// ─── RELATED (cross-section) ─────────────────────────────────
// EdiBarak reader shouldn't dead-end: surface 4 handpicked items that
// bridge into other sections (Vamos Viendo críticas + Inmenso Bastardo).
// We prefer editorial.relatedFull if present; otherwise fall back to
// the 3 most-recent críticas + 1 IB chapter.
function EDRelated({ ed, eds }) {
  const ibSlugs = React.useMemo(() => {
    const s = new Set();
    (window.IB_CAPITULOS || []).forEach(c => s.add(c.slug));
    return s;
  }, []);
  const criticasBySlug = React.useMemo(() => {
    const m = {};
    (window.CRITICAS || []).forEach(c => { m[c.slug] = c; });
    return m;
  }, []);
  const ibBySlug = React.useMemo(() => {
    const m = {};
    (window.IB_CAPITULOS || []).forEach(c => { m[c.slug] = c; });
    return m;
  }, []);
  const posterMap = window.__RT_POSTER_MAP__ || {};

  // Build candidates: first from ed.relatedFull (if any), then fallback
  // to mixing recent críticas + first IB chapter so there's always a
  // non-dead-end.
  const items = [];
  const seen = new Set();
  const push = (obj) => {
    if (!obj || !obj.slug || seen.has(obj.slug)) return;
    seen.add(obj.slug);
    items.push(obj);
  };
  const buildCritica = (slug) => {
    const c = criticasBySlug[slug];
    if (!c) return null;
    const film = c.film || {};
    const isIB = ibSlugs.has(slug)
      || (Array.isArray(c.series) && c.series.includes('inmenso-bastardo'));
    return {
      slug,
      kind: isIB ? 'ib' : 'vv',
      href: isIB ? `#/ib/${slug}` : `#/vv/${slug}`,
      title: film.title || c.filmTitle || c.title,
      year: film.year || c.year || '',
      director: Array.isArray(film.director) ? film.director[0] : (c.director || ''),
      poster: c.poster || posterMap[slug] || c.cover,
      sectionLabel: isIB ? 'Inmenso Bastardo' : 'Vamos Viendo',
    };
  };
  const buildIB = (slug) => {
    const c = ibBySlug[slug];
    if (!c) return null;
    return {
      slug,
      kind: 'ib',
      href: `#/ib/${slug}`,
      title: c.filmTitle || c.title,
      year: c.year || '',
      director: Array.isArray(c.director) ? c.director[0] : (c.director || ''),
      poster: c.poster || posterMap[slug] || c.cover,
      sectionLabel: 'Inmenso Bastardo',
    };
  };
  const buildEditorial = (slug) => {
    if (slug === ed.slug) return null;
    const e = (eds || []).find(x => x.slug === slug);
    if (!e) return null;
    return {
      slug,
      kind: 'ed',
      href: `#/ed/${slug}`,
      title: e.title,
      year: (e.published || '').split('-')[0] || '',
      director: e.topic || '',
      poster: null,
      sectionLabel: 'EdiBarak',
    };
  };

  // 1) anything explicit on the editorial
  (ed.relatedFull || []).forEach(r => {
    if (!r || !r.slug) return;
    if (r.type === 'editorial') push(buildEditorial(r.slug));
    else if (r.type === 'critica') push(buildCritica(r.slug));
    else if (r.type === 'ib') push(buildIB(r.slug));
  });

  // 2) fallback — if we have < 4, fill with recent críticas (VV + IB mix)
  if (items.length < 4) {
    const recentCriticas = (window.CRITICAS || []).slice(0, 12);
    for (const c of recentCriticas) {
      if (items.length >= 4) break;
      const built = buildCritica(c.slug);
      if (built) push(built);
    }
  }
  // 3) ensure at least one IB chapter so cross-section nav is visible
  if (items.length < 4) {
    const firstIB = (window.IB_CAPITULOS || [])[0];
    if (firstIB) push(buildIB(firstIB.slug));
  }
  // 4) add another editorial if still short
  if (items.length < 4) {
    const otherEd = (eds || []).find(e => e.slug !== ed.slug);
    if (otherEd) push(buildEditorial(otherEd.slug));
  }

  const resolved = items.slice(0, 4);
  if (!resolved.length) return null;

  return (
    <div style={{
      margin:'24px 18px 8px',
      padding:'18px 0 4px',
      borderTop:'1px solid #0a0a0a',
      borderBottom:'1px solid #0a0a0a',
      fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif",
    }}>
      <div style={{
        display:'flex', alignItems:'baseline', gap: 10,
        marginBottom: 14,
        borderBottom:'4px solid #0a0a0a', paddingBottom: 8,
      }}>
        <div style={{ width: 14, height: 14, background:'#e60012' }}/>
        <div style={{
          fontSize: 10, fontWeight: 900, letterSpacing:'0.28em',
          textTransform:'uppercase', color:'#0a0a0a',
        }}>Seguí leyendo ↗</div>
        <div style={{
          marginLeft:'auto',
          fontSize: 9, fontWeight: 700, letterSpacing:'0.22em',
          textTransform:'uppercase', color:'#e60012',
        }}>otras secciones</div>
      </div>

      <div style={{
        display:'grid', gridTemplateColumns:'1fr 1fr', gap: 10,
      }}>
        {resolved.map((r, i) => {
          const accent = r.kind === 'ed' ? '#0a0a0a' : '#e60012';
          const labelBg = r.kind === 'ed' ? '#e60012' : '#0a0a0a';
          return (
            <a
              key={r.slug}
              href={r.href}
              style={{
                textDecoration:'none', color:'inherit',
                display:'flex', flexDirection:'column',
                background:'#eae5d8',
                border:'1px solid #0a0a0a',
                padding: 0,
                position:'relative',
                minHeight: 150,
              }}>
              <div style={{
                background: labelBg, color:'#f4f1ea',
                fontSize: 9, fontWeight: 900, letterSpacing:'0.22em',
                textTransform:'uppercase', padding:'5px 8px',
                display:'flex', justifyContent:'space-between',
              }}>
                <span>→ {r.sectionLabel}</span>
                <span style={{ color: r.kind === 'ed' ? '#0a0a0a' : '#e60012' }}>
                  {r.kind === 'ib' ? 'IB' : r.kind === 'ed' ? 'ED' : 'VV'}
                </span>
              </div>
              <div style={{
                padding:'10px 10px 12px', flex: 1,
                display:'flex', flexDirection:'column',
              }}>
                <div style={{
                  fontWeight: 900, fontSize: 14, lineHeight: 1.02,
                  letterSpacing:'-0.015em', color:'#0a0a0a',
                  textTransform:'uppercase', marginBottom: 6,
                  wordBreak:'break-word',
                }}>{r.title}</div>
                {(r.year || r.director) && (
                  <div style={{
                    fontSize: 9, fontWeight: 400, letterSpacing:'0.08em',
                    color:'#3a3a3a', textTransform:'uppercase',
                    marginTop:'auto',
                  }}>
                    {[r.year, r.director].filter(Boolean).join(' · ')}
                  </div>
                )}
                <div style={{
                  marginTop: 8,
                  fontSize: 9, fontWeight: 700, letterSpacing:'0.2em',
                  color: accent, textTransform:'uppercase',
                }}>
                  Leer →
                </div>
              </div>
            </a>
          );
        })}
      </div>
    </div>
  );
}

window.EDSection = EDSection;
