/* IPEM N.º 320 "Jorge Cafrune" — Sistema de diseño "Editorial Juvenil Contemporánea" */
:root {
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --line: #E2E8F0;
  --ink: #0F172A;
  --muted: #475569;
  --blue: #1E3A8A;
  --blue-dark: #162B66;
  --orange: #EA580C;
  --orange-soft: #FFEDD5;
  --green: #0D9488;
  --green-soft: #CCFBF1;
  --sky-soft: #E0ECFF;
  --violet: #7C3AED;
  --violet-soft: #EDE9FE;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px -12px rgba(15,23,42,.12);
  --font-head: 'Space Grotesk', 'Outfit', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.65 var(--font-body); -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--blue); }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 6vw, 3.9rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 700; color: var(--blue); }
h3 { font-size: 1.2rem; font-weight: 600; color: var(--blue); }
p { margin: 0 0 1em; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.section { padding: 56px 0; }
.eyebrow { display: inline-block; font: 700 .75rem var(--font-head); letter-spacing: .14em; text-transform: uppercase; color: var(--orange); margin-bottom: 10px; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 680px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 10px; top: 10px; background: #fff; padding: 8px 12px; z-index: 100; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav-row { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { height: 42px; width: auto; border-radius: 6px; }
.brand b { font: 700 1rem var(--font-head); display: block; line-height: 1.1; }
.brand small { font-size: .72rem; color: var(--muted); }
.badge-25 { background: var(--orange); color: #fff; font: 700 .68rem var(--font-head); padding: 2px 8px; border-radius: 99px; margin-left: 6px; vertical-align: 2px; }
.nav { display: none; gap: 4px; }
.nav a { text-decoration: none; color: var(--ink); font: 600 .9rem var(--font-body); padding: 8px 14px; border-radius: 99px; }
.nav a:hover { background: var(--line); }
.nav a[aria-current="page"] { background: var(--blue); color: #fff; }
.menu-btn { background: none; border: 1px solid var(--line); border-radius: 10px; width: 44px; height: 44px; font-size: 1.3rem; cursor: pointer; color: var(--ink); }
.mobile-nav { display: none; flex-direction: column; padding: 8px 20px 16px; border-top: 1px solid var(--line); background: #fff; }
.mobile-nav.open { display: flex; }
.mobile-nav a { padding: 12px 8px; text-decoration: none; color: var(--ink); font-weight: 600; border-bottom: 1px solid var(--line); }
.mobile-nav a[aria-current="page"] { color: var(--orange); }
@media (min-width: 900px) { .nav { display: flex; } .menu-btn, .mobile-nav { display: none !important; } }

/* Botones y píldoras */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer; text-decoration: none; font: 700 .95rem var(--font-body); padding: 13px 22px; border-radius: 14px; transition: transform .15s, box-shadow .15s, background .15s; min-height: 46px; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--orange); color: #fff; box-shadow: 0 8px 20px -8px rgba(234,88,12,.7); }
.btn-primary:hover { background: #C2410C; }
.btn-ghost { background: #fff; color: var(--blue); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--blue); }
.pill { display: inline-block; font: 700 .72rem var(--font-head); letter-spacing: .04em; text-transform: uppercase; padding: 4px 11px; border-radius: 99px; background: var(--line); color: var(--ink); }
.pill-podcast { background: var(--green-soft); color: #115E59; }
.pill-escrito { background: var(--orange-soft); color: #9A3412; }
.pill-video { background: var(--sky-soft); color: var(--blue); }
.pill-cronica { background: var(--violet-soft); color: #5B21B6; }
.pill-docente { background: #FEF9C3; color: #854D0E; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--blue-dark), var(--blue)); color: #fff; padding: 56px 0 64px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -80px; top: -80px; width: 340px; height: 340px; border-radius: 50%; background: var(--orange); opacity: .22; }
.hero .grid { display: grid; gap: 36px; align-items: center; position: relative; z-index: 1; }
.hero h1 em { font-style: normal; color: #FDBA74; }
.hero p { color: #DBE5FF; font-size: 1.1rem; max-width: 560px; }
.hero .eyebrow { color: #FDBA74; }
.hero-photo { border-radius: 24px; overflow: hidden; border: 4px solid rgba(255,255,255,.9); box-shadow: 0 24px 50px -20px rgba(0,0,0,.6); transform: rotate(1.5deg); }
.hero-photo img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.hero .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
@media (min-width: 900px) { .hero .grid { grid-template-columns: 1.15fr .85fr; } .hero { padding: 80px 0; } }
.page-hero { background: var(--blue-dark); color: #fff; padding: 48px 0; }
.page-hero h1 { font-size: clamp(1.9rem, 5vw, 3rem); }
.page-hero p { color: #DBE5FF; max-width: 680px; margin: 0; }
.page-hero .eyebrow { color: #FDBA74; }

/* Bento */
.bento { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .bento { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .bento { grid-template-columns: repeat(4, 1fr); } .span-2 { grid-column: span 2; } .row-2 { grid-row: span 2; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); position: relative; }
a.card { text-decoration: none; color: inherit; display: block; transition: transform .2s, box-shadow .2s; }
a.card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -14px rgba(15,23,42,.25); }
.card h3 { margin-bottom: 8px; }
.card p:last-child { margin-bottom: 0; }
.card-blue { background: var(--blue); color: #fff; border-color: var(--blue); } .card-blue h3 { color: #fff; } .card-blue p { color: #DBE5FF; }
.card-orange { background: var(--orange); color: #fff; border-color: var(--orange); } .card-orange h3 { color: #fff; }
.card-green { background: var(--green); color: #fff; border-color: var(--green); } .card-green h3 { color: #fff; }
.card .ico { font-size: 1.8rem; margin-bottom: 10px; display: block; }
.stat { font: 700 clamp(2rem, 5vw, 2.8rem) var(--font-head); line-height: 1; }
.stat-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; opacity: .85; font-weight: 600; }
.polo-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.polo-list li { padding: 10px 14px; background: var(--bg); border-radius: 12px; border: 1px solid var(--line); font-weight: 600; font-size: .92rem; }

/* Producciones */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 24px; -webkit-overflow-scrolling: touch; }
.tab { flex: 0 0 auto; border: 1px solid var(--line); background: #fff; color: var(--ink); font: 600 .9rem var(--font-body); padding: 10px 18px; border-radius: 99px; cursor: pointer; min-height: 44px; }
.tab[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.prod-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.prod { display: flex; flex-direction: column; gap: 10px; }
.prod h3 { margin: 0; }
.prod .meta { font-size: .8rem; color: var(--muted); }
.prod blockquote { margin: 0; padding-left: 14px; border-left: 3px solid var(--orange); font-style: italic; color: var(--muted); }
.prod audio, .prod video { width: 100%; border-radius: 12px; }
.prod .more { margin-top: auto; font-weight: 700; font-size: .9rem; }
.audio-sim { display: flex; align-items: center; gap: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.audio-sim button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--green); color: #fff; cursor: pointer; font-size: .95rem; flex: none; }
.audio-sim .bar { flex: 1; height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.audio-sim .bar i { display: block; height: 100%; width: 0; background: var(--green); transition: width .3s linear; }
.audio-sim small { color: var(--muted); font-variant-numeric: tabular-nums; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); border: 2px dashed var(--line); border-radius: var(--radius); grid-column: 1/-1; }
.source-note { font-size: .8rem; color: var(--muted); margin-top: 20px; }

/* Memoria / proyectos */
.timeline { list-style: none; margin: 0; padding: 0 0 0 22px; border-left: 3px solid var(--orange); display: grid; gap: 22px; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -31px; top: 6px; width: 15px; height: 15px; border-radius: 50%; background: #fff; border: 4px solid var(--orange); }
.timeline .year { font: 700 1.3rem var(--font-head); color: var(--orange); }
.two-col { display: grid; gap: 24px; } @media (min-width: 900px) { .two-col { grid-template-columns: 1.2fr .8fr; } }
.station { display: grid; gap: 14px; }
.qr-box { width: 120px; height: 120px; background: #fff; border: 2px dashed var(--blue); border-radius: 14px; display: grid; place-items: center; color: var(--blue); font-size: .7rem; text-align: center; padding: 8px; font-weight: 700; }
.station-row { display: flex; gap: 16px; align-items: center; }
.guia select, .guia input, .guia textarea, .form input, .form select, .form textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; font: inherit; background: #fff; color: var(--ink); }
.guia label, .form label { font-weight: 600; font-size: .88rem; display: block; margin: 12px 0 6px; }
.team { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.team div { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; font-size: .9rem; }
.team b { display: block; font-family: var(--font-head); color: var(--blue); }
.steps { counter-reset: s; list-style: none; padding: 0; display: grid; gap: 14px; }
.steps li { counter-increment: s; padding-left: 52px; position: relative; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 38px; height: 38px; background: var(--orange); color: #fff; font: 700 1.1rem var(--font-head); border-radius: 12px; display: grid; place-items: center; }
code, pre { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
pre { background: var(--ink); color: #E2E8F0; padding: 16px; border-radius: 14px; overflow-x: auto; }
table.cols { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.cols th, table.cols td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap { overflow-x: auto; }

/* Footer */
.site-footer { background: var(--ink); color: #CBD5E1; padding: 44px 0 28px; margin-top: 48px; font-size: .9rem; }
.site-footer a { color: #FDBA74; }
.footer-grid { display: grid; gap: 28px; } @media (min-width: 800px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h4 { color: #fff; font-size: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-footer .legal { border-top: 1px solid #334155; margin-top: 28px; padding-top: 18px; font-size: .8rem; color: #94A3B8; }

/* Cafrunito Bot */
.bot-fab { position: fixed; right: 18px; bottom: 18px; z-index: 60; background: var(--orange); color: #fff; border: 3px solid #fff; border-radius: 99px; padding: 12px 18px; font: 700 .9rem var(--font-body); cursor: pointer; display: flex; gap: 8px; align-items: center; box-shadow: 0 12px 28px -8px rgba(234,88,12,.8); }
.bot-panel { position: fixed; right: 18px; bottom: 84px; z-index: 60; width: min(380px, calc(100vw - 36px)); height: min(560px, calc(100vh - 110px)); background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 30px 60px -20px rgba(15,23,42,.45); display: none; flex-direction: column; overflow: hidden; }
.bot-panel.open { display: flex; }
.bot-head { background: var(--blue); color: #fff; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; }
.bot-head b { font-family: var(--font-head); } .bot-head small { display: block; opacity: .8; font-size: .72rem; }
.bot-head button { background: none; border: 0; color: #fff; font-size: 1.4rem; cursor: pointer; min-width: 44px; min-height: 44px; }
.bot-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; font-size: .9rem; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.msg.bot { background: #fff; border: 1px solid var(--line); border-top-left-radius: 4px; align-self: flex-start; }
.msg.user { background: var(--blue); color: #fff; border-top-right-radius: 4px; align-self: flex-end; }
.msg.typing { opacity: .6; font-style: italic; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--line); background: #fff; }
.quick button { border: 1px solid var(--line); background: var(--bg); border-radius: 99px; font: 600 .75rem var(--font-body); padding: 7px 12px; cursor: pointer; color: var(--blue); }
.quick button:hover { border-color: var(--orange); color: var(--orange); }
.bot-form { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line); background: #fff; }
.bot-form input { flex: 1; border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; font: inherit; font-size: .9rem; min-width: 0; }
.bot-form button { background: var(--orange); color: #fff; border: 0; border-radius: 12px; padding: 0 16px; font-weight: 700; cursor: pointer; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
