/* =====================
   RESET / BASE
===================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  background: #f7f7f7;
  color: #222;
}

/* =====================
   HEADER / NAV
===================== */
.header {
  position: sticky;
  top: 0;
  height: 64px;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  z-index: 1000;
}

.nav-container {
  height: 64px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo{
  font-weight:700;
  letter-spacing:0.12em;
  font-size:0.85rem;
  text-transform:uppercase;

  text-decoration:none;
  color:#222;
}

.nav {
  display: flex;
  gap: 28px;
}

.nav a {
  text-decoration: none;
  color: #222;
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  position: relative;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 1px;
  background: #000;
  transition: width 0.3s;
}

.nav a:hover::after {
  width: 100%;
}

.menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
  z-index: 2001;
}

/* =====================
   HERO / HOME
===================== */
.hero {

  height: 80vh;

  background-image: url("img/portada.png");

  background-size: cover;

  background-position: center;

  background-repeat: no-repeat;

  background-attachment: fixed;

  display: flex;

  align-items: center;

  justify-content: center;

}

.hero-overlay {
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  padding: 80px 60px;
  text-align: center;
  border-radius: 16px;
  max-width: 680px;
}

.hero h1 {
  font-size: 3.4rem;
  margin-bottom: 12px;
}

.hero p {
  font-size: 1.1rem;
  opacity: 0.85;
}

.home-sections {
  max-width: 1100px;
  margin: 80px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
}

.home-card {
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: #222;
  box-shadow: 0 12px 30px rgba(0,0,0,0.08);
  transition: transform 0.3s, box-shadow 0.3s;
}

.home-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.home-card h2 {
  padding: 20px;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(0,0,0,0.15);
}

/* =====================
   FOOTER
===================== */
footer {
  text-align: center;
  padding: 40px;
  font-size: 14px;
  color: #777;
}

/* =====================
   OVERLAY NAV
===================== */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 900;
}

.nav-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* =====================
   🎵 CANCIONES
===================== */
.canciones-page {
  max-width: 900px;
  margin: 80px auto;
  padding: 0 20px;
}

.canciones-page .page-header {
  margin-bottom: 40px;
}

.canciones-page .page-header h1 {
  font-size: 2.2rem;
}

/* controles */
.canciones-page .songs-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 40px;
  position: sticky;
  top: 84px;
  background: #f7f7f7;
  padding: 14px 0;
  z-index: 50;
}

/* buscador */
.canciones-page .search-box {
  flex: 1;
  max-width: 480px;
}

.canciones-page #buscador {
  width: 100%;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.15);
  font-size: 0.9rem;
}

/* orden */
.canciones-page .sort-box select {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.15);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: #fff;
  cursor: pointer;
}

/* canciones */
.canciones-page .songs-list > div {
  background: #fff;
  padding: 30px;
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.08);
  margin-bottom: 40px;
}

.canciones-page pre {
  background: #fafafa;
  padding: 20px;
  border-radius: 14px;
  margin-top: 20px;
  line-height: 1.7;
  overflow: visible;
}

/* 🎧 audio responsive */
audio {
  margin-top: 20px;
  width: 60%;
  max-width: 100%;
  display: block;
  box-sizing: border-box;
}

/* acordes */
/* =====================
   ACORDES
===================== */
.chord {
  position: relative;
  display: inline-block;
  margin-right: 6px;
  font-weight: 700;
  color: #b30000;
  cursor: pointer;
  white-space: nowrap;
}

.chord-tooltip {
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.15);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  display: none;
  z-index: 9999;
}

.chord-tooltip img {
  width: 70px;
  height: auto;
  display: block;
}

.chord:hover .chord-tooltip {
  display: block;
}

/* scroll */
#scroll-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.15);
  background: #fff;
}

#scroll-controls .label {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
}

#scroll-controls button {
  border: none;
  background: #000;
  color: #fff;
  font-size: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
}

#scroll-controls button:hover {
  opacity: 0.8;
}

/* ==========================
   🎸 ACORDES INLINE + TOOLTIP
========================== */

.song {
  font-family: "Courier New", monospace;
  font-size: 13px;
  line-height: 2.4em;   /* espacio para el acorde arriba */
  white-space: pre;
}

.chord {
  position: absolute;
  top:1px;         /* baja el acorde para que no choque */
  left: 0;
  font-weight: bold;
  color: #c00;
  white-space: nowrap;
}

/* evita que se vayan a otra línea solos */
.chord::after {
  content: "";
  display: inline-block;
  width: 0.4em;
}

/* TOOLTIP */
.chord-tooltip {
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
}

.chord-tooltip img {
  width: 110px;
  height: auto;
  display: block;
}

/* mostrar tooltip */
.chord:hover .chord-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(-6px);
}

/* ==========================
   🎼 CONTROLES DE TONO
========================== */

#up,
#down {
  border: none;
  background: #111;
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

#up:hover,
#down:hover {
  background: #333;
}

/* =====================
   BIOGRAFÍA
===================== */

.bio-page {
  max-width: 900px;
  margin: 80px auto;
  padding: 0 20px;
}

/* header de sección (similar a canciones) */
.bio-page .page-header {
  margin-bottom: 40px;
}

.bio-page .page-header h1 {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.bio-page .page-header p {
  color: #555;
  font-size: 0.95rem;
}

/* =====================
   HERO BIOGRAFÍA
===================== */

.bio-page .hero-small {
  height: 60vh; /* un poco más chico que el home */
  background-image: url("img/pintura.jpg");
  background-size: cover;
  background-position: top;
}

.bio-page .hero-small2 {
  height: 60vh; /* un poco más chico que el home */
  background-image: url("img/canciones3.png");
  background-size: cover;
  background-position: center;
}

.bio-page .hero-small3 {
  height: 60vh; /* un poco más chico que el home */
  background-image: url("img/cuentos3.jpg");
  background-size: cover;
  background-position: top;
}
.bio-page .hero-small4 {
  height: 60vh; /* un poco más chico que el home */
  background-image: url("img/pediatra.png");
  background-size: cover;
  background-position: top;
}
/* bloque principal */
.bio-section {
  background: #fff;
  padding: 40px;
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}

/* títulos internos */
.bio-section h2 {
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  padding-bottom: 12px;
}

/* lista cronológica */
.bio-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.bio-list li {
  font-size: 0.9rem;
  line-height: 1.6;
  padding-left: 16px;
  border-left: 3px solid #ddd;
}

.bio-list li strong {
  font-weight: 700;
  color: #000;
}

/* =====================
   HERO CHICO (BIO)
===================== */

.hero.hero-small {
  height: 45vh;
}

.hero.hero-small .hero-overlay {
  padding: 60px 50px;
}

.hero.hero-small h1 {
  font-size: 2.6rem;
}

/* =====================
   RESPONSIVE BIO
===================== */

@media (max-width: 768px) {
  .bio-section {
    padding: 28px;
  }

  .bio-list li {
    font-size: 0.85rem;
  }

  .hero.hero-small h1 {
    font-size: 2.1rem;
  }
}

/* =====================
   RESPONSIVE
===================== */
@media (max-width: 768px) {
  .menu-btn {
    display: block;
  }

  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    height: 100vh;
    background: #fafafa;
    flex-direction: column;
    padding: 120px 40px;
    gap: 28px;
    transition: right 0.35s ease;
    z-index: 2000;
  }

  .nav.active {
    right: 0;
  }

  .home-card img {
  width: 100%;
  height: 40vh;
  object-fit: cover;
}

}

/* ==========================
   FIX ACORDES – PARCHE SEGURO
   (no rompe nada existente)
========================== */

.chord-cell {
  display: inline-block;
  width: 3.5ch;        /* ancho real del acorde */
  position: relative;
}

/* =====================
   📖 CUENTOS
===================== */

.cuentos-page{
max-width:900px;
margin:80px auto;
padding:0 20px;
}

.page-header{
margin-bottom:40px;
}

.page-header h1{
font-size:2.2rem;
}

/* CONTROLES */

.cuentos-controls{
display:flex;
align-items:center;
gap:16px;
margin-bottom:40px;
position:sticky;
top:84px;
background:#f7f7f7;
padding:14px 0;
z-index:50;
}

#buscador-cuentos{
width:420px;
padding:12px 18px;
border-radius:999px;
border:1px solid rgba(0,0,0,0.15);
font-size:0.9rem;
}

#orden-cuentos{
padding:10px 14px;
border-radius:999px;
border:1px solid rgba(0,0,0,0.15);
font-size:0.7rem;
letter-spacing:0.14em;
text-transform:uppercase;
background:#fff;
cursor:pointer;
}

/* TARJETA */

.cuento-card{
background:#fff;
padding:30px;
border-radius:18px;
box-shadow:0 12px 30px rgba(0,0,0,0.08);
margin-bottom:26px;
cursor:pointer;
transition:all .25s ease;
}

.cuento-card:hover{
transform:translateY(-2px);
}

/* CABECERA */

.cuento-header{
display:flex;
justify-content:space-between;
align-items:center;
}

.cuento-header h3{
font-size:1.3rem;
margin:0;
}

.cuento-meta{
font-size:0.8rem;
color:#777;
margin-top:4px;
}

/* FLECHA */

.cuento-toggle{
font-size:1.2rem;
color:#888;
transition:transform .3s;
}

.cuento-card.abierto .cuento-toggle{
transform:rotate(180deg);
}

/* TEXTO */

.cuento-texto{
margin-top:22px;
display:none;
}

.cuento-card.abierto .cuento-texto{
display:block;
animation:fadeIn .35s ease;
}

.cuento-texto p{
margin-bottom:18px;
line-height:1.85;
font-size:0.96rem;
color:#333;
}

/* ANIMACIÓN */

@keyframes fadeIn{
from{opacity:0;transform:translateY(-5px);}
to{opacity:1;transform:translateY(0);}
}

@media(max-width:768px){

  .hero{

    background-size: cover;

  background-position: center;

  background-repeat: no-repeat;


  }

}

/* 🔒 Evita que todo se salga horizontalmente */
body {
  overflow-x: hidden;
}

/* 🎵 contenedor de canciones */
.songs-list {
  width: 100%;
  max-width: 100%;
  padding: 0 15px;
  box-sizing: border-box;
}

/* 🎼 bloque de canción */
.song {
  white-space: pre-wrap;   /* clave: rompe líneas correctamente */
  word-break: break-word;  /* evita overflow por palabras largas */
  overflow-wrap: anywhere;  /* refuerzo mobile */
  max-width: 100%;
}

/* 🎸 acordes no deben romper línea */
.chord-cell {
  display: inline-block;
}

/* 🔥 importante para mobile */
@media (max-width: 768px) {
  .songs-page, .canciones-page {
    overflow-x: hidden;
  }

   /* 🎧 audio responsive */
audio {
  margin-top: 20px;
  width: 100%;
  max-width: 100%;
  display: block;
  box-sizing: border-box;
}

}

@media(max-width:425px){

  .hero{

    background-size: cover;

  background-position: center;

  background-repeat: no-repeat;


  }

  /* 🎧 audio responsive */
audio {
  margin-top: 20px;
  width: 100%;
  max-width: 100%;
  display: block;
  box-sizing: border-box;
}

}

/* 🔒 Evita que todo se salga horizontalmente */
body {
  overflow-x: hidden;
}

/* 🎵 contenedor de canciones */
.songs-list {
  width: 100%;
  max-width: 100%;
  padding: 0 15px;
  box-sizing: border-box;
}

/* 🎼 bloque de canción */
.song {
  white-space: pre-wrap;   /* clave: rompe líneas correctamente */
  word-break: break-word;  /* evita overflow por palabras largas */
  overflow-wrap: anywhere;  /* refuerzo mobile */
  max-width: 100%;
}

/* 🎸 acordes no deben romper línea */
.chord-cell {
  display: inline-block;
}

/* 🔥 importante para mobile */
@media (max-width: 425px) {
  .songs-page, .canciones-page {
    overflow-x: hidden;
  }
}

@media(max-width:375px){

  .hero{

    background-size: cover;

  background-position: center;

  background-repeat: no-repeat;


  }

}

/* 🔒 Evita que todo se salga horizontalmente */
body {
  overflow-x: hidden;
}

/* 🎵 contenedor de canciones */
.songs-list {
  width: 100%;
  max-width: 100%;
  padding: 0 15px;
  box-sizing: border-box;
}

/* 🎼 bloque de canción */
.song {
  white-space: pre-wrap;   /* clave: rompe líneas correctamente */
  word-break: break-word;  /* evita overflow por palabras largas */
  overflow-wrap: anywhere;  /* refuerzo mobile */
  max-width: 100%;
}

/* 🎸 acordes no deben romper línea */
.chord-cell {
  display: inline-block;
}

/* 🔥 importante para mobile */
@media (max-width: 375px) {
  .songs-page, .canciones-page {
    overflow-x: hidden;
  }
}

