* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: Arial, sans-serif; background: #f0f6fc; color: #222; }
.sitio-header { background: #0a3d62; color: #fff; display: flex; justify-content: space-between; align-items: center; padding: 12px 24px; flex-wrap: wrap; gap: 10px; }
.marca { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-size: 1.3rem; font-weight: bold; }
.logo { height: 45px; width: auto; background: #fff; padding: 3px; border-radius: 6px; }
.logo-texto { font-size: 1.8rem; }
.sitio-header nav a { color: #cfe8ff; text-decoration: none; margin-left: 16px; }
.sitio-header nav a:hover { color: #fff; text-decoration: underline; }
.contenedor { max-width: 1000px; margin: 30px auto; padding: 0 16px; }
.sitio-footer { background: #0a3d62; color: #cfe8ff; text-align: center; padding: 16px; margin-top: 40px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.tarjeta { background: #fff; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.08); overflow: hidden; }
.tarjeta img { width: 100%; height: 170px; object-fit: cover; display: block; }
.tarjeta .cuerpo { padding: 14px; }
.tarjeta h3 { margin-bottom: 6px; }
.tarjeta .meta { color: #777; font-size: .85rem; margin-bottom: 8px; }
.tarjeta a { color: #0a3d62; font-weight: bold; text-decoration: none; }

.historia-img { max-width: 100%; border-radius: 10px; margin: 16px 0; }

/* Galería de hasta 3 imágenes por historia */
.galeria-imgs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.galeria-imgs .historia-img { width: 100%; height: 220px; object-fit: cover; margin: 16px 0; cursor: zoom-in; }
.galeria-imgs .historia-img:only-child { grid-column: 1 / -1; height: auto; max-height: 520px; }

/* Selector de imágenes en los formularios */
.lista-imagenes { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.item-imagen { border: 1px solid #ddd; border-radius: 8px; padding: 6px; background: #fff; text-align: center; }
.item-imagen img { height: 90px; width: auto; display: block; border-radius: 4px; }
.item-imagen .quitar { margin: 6px 0 0; font-weight: normal; font-size: .85rem; display: flex; gap: 5px; align-items: center; justify-content: center; }
form .ayuda { display: block; color: #666; font-size: .82rem; margin-top: 4px; }

/* Indicador de imágenes adicionales en la tarjeta */
.tarjeta { position: relative; }
.contador-imgs { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: .8rem; font-weight: bold; padding: 3px 8px; border-radius: 20px; }
.historia-video { width: 100%; max-width: 700px; border-radius: 10px; margin: 16px 0; }
.contenido { line-height: 1.7; white-space: pre-wrap; margin-top: 12px; }

form .campo { margin-bottom: 14px; }
form label { display: block; font-weight: bold; margin-bottom: 4px; }
form input[type=text], form input[type=email], form input[type=password], form textarea, form select {
    width: 100%; padding: 9px; border: 1px solid #bbb; border-radius: 6px; font-size: 1rem;
}
form textarea { min-height: 220px; }
.btn { display: inline-block; background: #0a3d62; color: #fff; border: none; padding: 10px 18px; border-radius: 6px; cursor: pointer; text-decoration: none; font-size: 1rem; }
.btn:hover { background: #145a8a; }
.btn-rojo { background: #b71c1c; }
.btn-rojo:hover { background: #d32f2f; }
.btn-sec { background: #666; }
.alerta { background: #ffe0e0; color: #8a0000; padding: 10px; border-radius: 6px; margin-bottom: 14px; }
.exito { background: #d8f3dc; color: #1b5e20; padding: 10px; border-radius: 6px; margin-bottom: 14px; }

table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 10px; border: 1px solid #ddd; text-align: left; }
th { background: #0a3d62; color: #fff; }
.panel-links a { display: inline-block; margin: 6px 10px 6px 0; }

.banner { position: relative; width: 100%; height: 300px; overflow: hidden; border-radius: 10px; margin-bottom: 24px; background: #0a3d62; }
.banner-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1s; }
.banner-img.activa { opacity: 1; }
.banner-flecha { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,.4); color: #fff; border: none; font-size: 1.4rem; padding: 8px 12px; cursor: pointer; border-radius: 6px; }
.banner-flecha:hover { background: rgba(0,0,0,.7); }
.banner-flecha.izq { left: 10px; }
.banner-flecha.der { right: 10px; }
.banner-play { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.4); color: #fff; border: none; font-size: 1.1rem; padding: 6px 10px; cursor: pointer; border-radius: 6px; }
.banner-play:hover { background: rgba(0,0,0,.7); }
.banner-dots { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.dot { width: 10px; height: 10px; background: rgba(255,255,255,.5); border-radius: 50%; cursor: pointer; }
.dot.activo { background: #fff; }
