/* ============================================
   CLASE 2 – HISTORIA DE LA IA
   Estilo editorial académico · IAforTeachers
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Source+Sans+3:ital,wght@0,300;0,400;0,600;0,700;1,400&display=swap');

/* — Variables — */
:root {
  --purple: #663399;
  --purple-deep: #4A1A7A;
  --purple-light: rgba(102,51,153,0.08);
  --pink: #E91E63;
  --pink-light: rgba(233,30,99,0.08);
  --green: #4CAF50;
  --green-light: rgba(76,175,80,0.08);
  --bg: #FAFAF8;
  --bg-card: #FFFFFF;
  --text: #2D2A2E;
  --text-light: #6B6770;
  --border: #E8E4EC;
  --heading: 'Libre Baskerville', Georgia, serif;
  --body: 'Source Sans 3', 'Segoe UI', sans-serif;
  --max-w: 1140px;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(102,51,153,0.07);
  --shadow-lg: 0 8px 30px rgba(102,51,153,0.10);
}

/* — Reset — */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* — Base — */
html { scroll-behavior: smooth; font-size: 17px; }

body {
  font-family: var(--body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--purple); text-decoration: none; transition: color .2s; }
a:hover { color: var(--pink); }

/* — Typography — */
h1, h2, h3, h4 { font-family: var(--heading); color: var(--purple-deep); line-height: 1.3; }
h1 { font-size: 2.4rem; margin-bottom: 0.6em; }
h2 { font-size: 1.6rem; margin-bottom: 0.5em; }
h3 { font-size: 1.15rem; margin-bottom: 0.4em; }
p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

/* — Top Navigation — */
.site-nav {
  background: var(--purple-deep);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.site-nav__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem;
  height: 60px;
}
.site-nav__brand {
  font-family: var(--heading);
  color: #fff;
  font-size: .95rem;
  white-space: nowrap;
  opacity: .92;
}
.site-nav__brand strong { font-weight: 700; }
.site-nav__links {
  display: flex; gap: 6px;
  list-style: none;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.site-nav__links::-webkit-scrollbar { display: none; }
.site-nav__links a {
  color: rgba(255,255,255,.75);
  font-size: .82rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
  transition: all .2s;
}
.site-nav__links a:hover,
.site-nav__links a.active {
  color: #fff;
  background: rgba(255,255,255,.12);
}

/* — Hero — */
.hero {
  background: linear-gradient(135deg, var(--purple-deep) 0%, var(--purple) 40%, var(--pink) 100%);
  color: #fff;
  padding: 5rem 2rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 80%, rgba(76,175,80,.15) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(233,30,99,.1) 0%, transparent 50%);
}
.hero__content { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; }
.hero h1 { color: #fff; font-size: 2.8rem; margin-bottom: .4em; }
.hero__sub { font-size: 1.2rem; opacity: .9; font-family: var(--body); font-weight: 300; }
.hero--small { padding: 3.5rem 2rem 2.5rem; }
.hero--small h1 { font-size: 2rem; margin-bottom: .2em; }
.hero--small .hero__sub { font-size: 1.05rem; }
.hero__label {
  display: inline-block;
  font-family: var(--body);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  opacity: .7;
  margin-bottom: .8rem;
}

/* — Content wrapper — */
.content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

/* — Cards — */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  transition: box-shadow .3s, transform .3s;
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card--purple { border-left: 4px solid var(--purple); }
.card--pink { border-left: 4px solid var(--pink); }
.card--green { border-left: 4px solid var(--green); }
.card--purple-top { border-top: 4px solid var(--purple); border-left: none; }
.card--pink-top { border-top: 4px solid var(--pink); border-left: none; }
.card--green-top { border-top: 4px solid var(--green); border-left: none; }

.card--flat { box-shadow: none; border: 1px solid var(--border); }
.card--flat:hover { box-shadow: var(--shadow); transform: none; }

.card__label {
  font-family: var(--body);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-light);
  margin-bottom: .6rem;
}

/* — Grid layouts — */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.8rem; }
  .hero--small h1 { font-size: 1.5rem; }
  .content { padding: 2rem 1.2rem; }
  .site-nav__brand { display: none; }
}

/* — Section headers — */
.section-header {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #fff;
  padding: 1.2rem 1.8rem;
  border-radius: var(--radius) var(--radius) 0 0;
  margin-bottom: 0;
}
.section-header--purple { background: linear-gradient(135deg, #4A1A7A, #7B42B0); }
.section-header--pink { background: linear-gradient(135deg, #C2185B, #F06292); }
.section-header--green { background: linear-gradient(135deg, #388E3C, #66BB6A); }
.section-header__label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: .7;
}
.section-header h2 { color: #fff; font-size: 1.4rem; margin-top: 4px; }

.section-body {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
  border: 1px solid var(--border);
  border-top: none;
}

/* — Highlight blocks — */
.highlight {
  padding: 1.2rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}
.highlight--purple { background: var(--purple-light); border-left: 3px solid var(--purple); }
.highlight--pink { background: var(--pink-light); border-left: 3px solid var(--pink); }
.highlight--green { background: var(--green-light); border-left: 3px solid var(--green); }

/* — Timeline — */
.timeline { position: relative; padding-left: 3rem; margin: 2rem 0; }
.timeline::before {
  content: '';
  position: absolute; left: 10px; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--purple), var(--pink), var(--green));
  border-radius: 2px;
}
.timeline__item { position: relative; margin-bottom: 2rem; }
.timeline__item::before {
  content: '';
  position: absolute;
  left: -2.55rem; top: 6px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--purple);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--purple);
}
.timeline__item:nth-child(even)::before { background: var(--pink); box-shadow: 0 0 0 2px var(--pink); }
.timeline__item:nth-child(3n)::before { background: var(--green); box-shadow: 0 0 0 2px var(--green); }
.timeline__year {
  font-family: var(--heading);
  font-size: 1.1rem;
  color: var(--pink);
  font-weight: 700;
  margin-bottom: .2rem;
}
.timeline__title { font-family: var(--heading); font-size: .95rem; color: var(--purple-deep); margin-bottom: .3rem; }
.timeline__text { font-size: .92rem; color: var(--text-light); }

/* — Person card — */
.person { text-align: center; }
.person__name { font-family: var(--heading); color: var(--purple-deep); font-size: 1.1rem; margin-bottom: .2rem; }
.person__dates { font-size: .82rem; color: var(--text-light); margin-bottom: .6rem; }
.person__bio { font-size: .92rem; text-align: justify; margin-bottom: 1rem; }
.person__tag {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 20px;
  margin: 2px;
}
.person__tag--purple { background: var(--purple-light); color: var(--purple); }
.person__tag--pink { background: var(--pink-light); color: var(--pink); }
.person__tag--green { background: var(--green-light); color: var(--green); }

/* — Index card grid — */
.index-card {
  display: block;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.8rem;
  border: 1px solid var(--border);
  transition: all .3s;
  text-decoration: none;
  color: var(--text);
}
.index-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  color: var(--text);
}
.index-card__number {
  font-family: var(--heading);
  font-size: 2rem;
  font-weight: 700;
  opacity: .15;
  margin-bottom: .4rem;
}
.index-card__title {
  font-family: var(--heading);
  font-size: 1.05rem;
  color: var(--purple-deep);
  margin-bottom: .5rem;
  line-height: 1.35;
}
.index-card__desc { font-size: .88rem; color: var(--text-light); line-height: 1.5; }

.index-card--purple { border-top: 4px solid var(--purple); }
.index-card--pink { border-top: 4px solid var(--pink); }
.index-card--green { border-top: 4px solid var(--green); }

/* — Pagination — */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.pagination a {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: .92rem;
  padding: 10px 18px;
  border-radius: 8px;
  background: var(--purple-light);
  color: var(--purple);
  transition: all .2s;
}
.pagination a:hover { background: var(--purple); color: #fff; }

/* — Footer — */
.site-footer {
  background: var(--purple-deep);
  color: rgba(255,255,255,.6);
  text-align: center;
  padding: 2rem;
  font-size: .85rem;
}
.site-footer a { color: rgba(255,255,255,.8); }
.site-footer a:hover { color: #fff; }

/* — Utilities — */
.text-justify { text-align: justify; }
.text-center { text-align: center; }
.text-small { font-size: .88rem; }
.text-muted { color: var(--text-light); }
.text-italic { font-style: italic; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

/* — Animations — */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp .6s ease-out both; }
.fade-up-d1 { animation-delay: .1s; }
.fade-up-d2 { animation-delay: .2s; }
.fade-up-d3 { animation-delay: .3s; }
.fade-up-d4 { animation-delay: .4s; }
