/* ===== Réplica del estilo de Google Sites =====
   Colores del tema original: #1c4587 (azul principal), #073763 (azul oscuro)
   Fuentes: Lato (títulos y texto), Roboto (interfaz) */

:root {
  --primary: #1c4587;
  --primary-dark: #073763;
  --text: #444444;
  --text-light: #666666;
  --bg: #ffffff;
  --bg-alt: #f8f9fa;
  --header-h: 64px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  margin: 0;
  font-family: 'Lato', 'Roboto', Arial, sans-serif;
  font-size: 18px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

/* ===== BARRA SUPERIOR ===== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
  z-index: 100;
}

.header-inner {
  height: 100%;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
}

.menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary);
  padding: 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.menu-btn:hover { background: rgba(28, 69, 135, .08); }

.site-title {
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: .5px;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-nav { margin-left: auto; }

.nav-link {
  font-family: 'Roboto', sans-serif;
  font-size: 15px;
  color: var(--text-light);
  text-decoration: none;
  padding: 8px 14px;
  border-bottom: 3px solid transparent;
}
.nav-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 500;
}
.nav-link:hover { color: var(--primary); }

/* ===== MENÚ LATERAL ===== */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
  z-index: 150;
}
.drawer-overlay.open { opacity: 1; visibility: visible; }

.drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 300px;
  max-width: 85vw;
  background: #fff;
  box-shadow: 4px 0 12px rgba(0, 0, 0, .2);
  transform: translateX(-105%);
  transition: transform .25s ease;
  z-index: 160;
  overflow-y: auto;
}
.drawer.open { transform: translateX(0); }

.drawer-header {
  padding: 20px 24px;
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .4px;
  color: var(--primary);
  border-bottom: 1px solid #e0e0e0;
}

.drawer-nav { display: flex; flex-direction: column; padding: 8px 0; }

.drawer-nav a {
  padding: 12px 24px;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  transition: background .15s;
}
.drawer-nav a:hover { background: rgba(28, 69, 135, .07); color: var(--primary); }

/* ===== PORTADA ===== */
.hero {
  position: relative;
  height: 420px;
  margin-top: var(--header-h);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.hero-overlay {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: linear-gradient(to top, rgba(7, 55, 99, .72), rgba(7, 55, 99, .25) 55%, rgba(7, 55, 99, .05));
  padding-bottom: 56px;
}

.hero-overlay h1 {
  margin: 0;
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 5vw, 48px);
  letter-spacing: 1px;
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .35);
  padding: 0 24px;
}

/* ===== CONTENIDO ===== */
.content { background: var(--bg); }

.toc {
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 24px 8px;
}
.toc-title {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
}
.toc ul {
  margin: 0;
  padding-left: 22px;
  columns: 2;
  column-gap: 48px;
}
.toc li { margin-bottom: 6px; break-inside: avoid; }
.toc a { color: var(--primary); text-decoration: none; font-size: 16px; }
.toc a:hover { text-decoration: underline; }

/* Banda de título de sección (estilo Google Sites) */
.band {
  background: var(--primary);
  padding: 56px 24px;
  margin-top: 48px;
}
.band-title {
  margin: 0 auto;
  max-width: 980px;
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  font-size: clamp(24px, 4vw, 34px);
  letter-spacing: .5px;
  color: #fff;
  text-align: center;
}

/* Cuerpo de cada sección */
.section-body {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 24px 8px;
}

.section-intro {
  font-size: 19px;
  color: var(--text);
  margin: 8px 0 28px;
}

/* Filas texto + imagen alternadas */
.row {
  display: flex;
  align-items: center;
  gap: 36px;
  padding: 22px 0;
}

.row-text { flex: 1 1 58%; }

.row-text h3 {
  margin: 0 0 10px;
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  font-size: 24px;
  color: var(--primary-dark);
}

.row-text p { margin: 0; }

.row:nth-child(even) .row-text { order: 2; }
.row:nth-child(even) .row-img  { order: 1; }

/* Imagen de cada fila (ilustración SVG generada; sustituible por foto real) */
.row-img { flex: 1 1 38%; }

.row-img img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

/* Visor de PDF embebido */
.pdf-embed { padding: 22px 0; }

.pdf-embed h3 {
  margin: 0 0 10px;
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  font-size: 24px;
  color: var(--primary-dark);
}

.pdf-embed iframe {
  display: block;
  width: 100%;
  height: 640px;
  border: 1px solid #dadce0;
  border-radius: 8px;
}

.pdf-link { margin: 8px 0 0; font-size: 14px; }
.pdf-link a { color: var(--primary); }

code {
  font-family: 'Source Code Pro', Consolas, monospace;
  font-size: .9em;
  background: rgba(28, 69, 135, .08);
  color: var(--primary-dark);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Referencias */
.refs p {
  margin: 0 0 16px;
  padding-left: 32px;
  text-indent: -32px;
  font-size: 17px;
}
.refs a { color: var(--primary); word-break: break-all; }
.refs a:hover { text-decoration: underline; }

/* ===== BOTÓN VOLVER ARRIBA ===== */
.back-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .25s, transform .25s, visibility .25s;
  z-index: 90;
}
.back-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-top:hover { background: var(--primary-dark); }

/* ===== PIE DE PÁGINA ===== */
.site-footer {
  margin-top: 64px;
  border-top: 1px solid #e0e0e0;
  background: var(--bg-alt);
}
.footer-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: 'Roboto', sans-serif;
  font-size: 13px;
  color: var(--text-light);
}
.footer-inner a { color: var(--primary); text-decoration: none; }
.footer-inner a:hover { text-decoration: underline; }
.footer-sep { color: #ccc; }
.footer-copy {
  padding: 0 24px 18px;
  text-align: center;
  font-family: 'Roboto', sans-serif;
  font-size: 13px;
  color: #6b7280;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  body { font-size: 16px; }
  .hero { height: 300px; }
  .row { flex-direction: column; align-items: stretch; gap: 18px; }
  .row:nth-child(even) .row-text { order: 0; }
  .row:nth-child(even) .row-img  { order: 0; }
  .toc ul { columns: 1; }
  .band { padding: 40px 20px; }
}
