:root {
  --color-fondo: #fdf6e3;
  --color-texto: #3e3e3e;
  --color-header: #7b1e1e;
  --color-nav: #a94444;
  --color-articulo: #ffffff;
  --color-borde: #ccc;
  --color-borde-articulo: #ddd;
  --color-footer: #7b1e1e;
  --color-link: #ffffff;
  --fuente-principal: 'Times New Roman', serif;
  --max-ancho: 1000px;
  --sombra-suave: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/*======= GENERAL ===========*/
body {
  font-family: var(--fuente-principal);
  background-color: var(--color-fondo);
  margin: 0;
  padding: 0;
  color: var(--color-texto);
  transition: background-color 0.5s ease;
}

.contenedor {
  max-width: var(--max-ancho);
  margin: auto;
  animation: fadeIn 1s ease-in;
}


p {
  font-family: 'Cormorant Garamond', var(--fuente-principal), serif;
  font-size: 1.1em;
  line-height: 1.7;
  color: var(--color-texto);
  margin-bottom: 20px;
  text-align: justify;
  text-indent: 20px;
  animation: fadeInParagraph 0.8s ease-in;
}

footer p {
  color: var(--color-link); /* blanco */
  font-family: 'Cormorant Garamond', var(--fuente-principal), serif;
  font-size: 1.1em;
  line-height: 1.6;
  margin: 0;
  text-align: center;
  animation: fadeInParagraph 0.8s ease-in;
}


/* Animación suave de entrada */
@keyframes fadeInParagraph {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/*======= HEADER ===========*/
header {
  background-color: var(--color-header);
  color: var(--color-link);
  padding: 20px;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 125px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-logo {
  width: 80px;
  height: auto;
  animation: fadeInLogo 1s ease-out;
}

.header-text {
  text-align: center;
}

.header-text h1 {
  margin: 0;
  font-size: 1.8em;
}

.header-text p {
  font-family: 'Cormorant Garamond', var(--fuente-principal), serif;
  font-size: 1.1em;
  color: var(--color-link);
  margin: 5px 0 0;
  letter-spacing: 0.5px;
  animation: fadeInHeaderText 1s ease-out;
}

/* Animaciones suaves */
@keyframes fadeInLogo {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeInHeaderText {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/*======= NAV ===========*/
nav {
  background-color: var(--color-nav, #3e2a18);
  position: fixed;
  top: 155px;
  left: 0;
  width: 100%;
  height: 65px;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  box-sizing: border-box;
}

/*======= MENÚ HAMBURGUESA GENERAL ===========*/
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
  position: absolute;
  top: 20px;
  right: 20px;
}

.menu-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  margin: 5px 0;
  background-image: linear-gradient(to right, #ffffff, #fce8d5);
  border-radius: 2px;
  transition: all 0.3s ease;
}


/*======= LISTA PRINCIPAL ===========*/
nav ul.menu {
  list-style: none;
  display: flex;
  gap: 40px;
  margin: 0;
  padding: 0;
  transition: all 0.3s ease;
}

nav li {
  display: inline-block;
}

nav a {
  color: var(--color-link, #fce8d5);
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1em;
  padding: 10px 5px;
  position: relative;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: var(--color-link, #fce8d5);
  transition: width 0.3s ease;
}

nav a:hover::after {
  width: 100%;
}


/*======= TÍTULOS H1 & H2 ===========*/

h1 {
  font-family: 'Cormorant Garamond', var(--fuente-principal), serif;
  text-align: center;
  margin-bottom: 20px;
  position: relative;
  animation: fadeInTitle 1s ease-out;
  letter-spacing: 0.5px;
}

/* Estilo específico para H1 */
h1 {
  font-size: 2.5em;
  color: var(--color-link); /* blanco */
}


h2 {
  font-family: 'Cormorant Garamond', var(--fuente-principal), serif;
  font-size: 2em;
  color: var(--color-header);
  text-align: center;
  margin-bottom: 20px;
  position: relative;
  animation: fadeInTitle 1s ease-out;
  letter-spacing: 0.5px;
}

/* Línea decorativa debajo del título */
h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(to right, var(--color-header), var(--color-nav));
  margin: 10px auto 0;
  border-radius: 2px;
}

/* Animación de entrada */
@keyframes fadeInTitle {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/*======= MAIN ===========*/
main {
  padding: 250px 20px 60px;
  position: relative;
  z-index: 1;
}

section {
  margin-bottom: 40px;
  border-bottom: 1px solid var(--color-borde);
  padding-bottom: 20px;
  animation: fadeInUp 0.8s ease;
}

article {
  background-color: var(--color-articulo);
  padding: 15px;
  border: 1px solid var(--color-borde-articulo);
  margin-top: 10px;
  box-shadow: var(--sombra-suave);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

article:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.origen-img,
.campaña-img,
.legado-img {
  width: 100%;
  max-width: 400px;
  height: auto;
  display: block;
  margin: 15px auto;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/*======= VISUAL SECTION ===========*/
.visual {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: space-between;
  gap: 30px;
  padding: 20px 0;
  margin: 0;
}

.visual-img {
  flex: 1 1 40%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.visual-img-element {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: var(--sombra-suave);
  transition: transform 0.6s ease, filter 0.6s ease;
}

.visual-img-element:hover {
  transform: scale(1.05);
  filter: brightness(1.1) contrast(1.05);
}

.visual-text {
  flex: 1 1 55%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.visual-text h2 {
  font-size: 1.8em;
  margin-bottom: 10px;
  color: var(--color-header);
}

.visual-text p {
  line-height: 1.6;
  color: var(--color-texto);
}

/*======= FOOTER ===========*/
footer {
  background-color: var(--color-footer);
  color: var(--color-link);
  text-align: center;
  padding: 15px;
  font-size: 0.9em;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

/*======= BOTÓN ARRIBA ===========*/
#botonArriba {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: linear-gradient(145deg, #a94444, #c75c5c);
  color: #fff;
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  line-height: 50px;
  border-radius: 50%;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  z-index: 9999;
  transition: all 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

#botonArriba:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5);
  background: linear-gradient(145deg, #c75c5c, #a94444);
}

/*======= BOTÓN LEER MÁS ===========*/

#leerMas {
  font-family: var(--fuente-principal);
  font-size: 1.1em;
  padding: 8px 25px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--color-header), var(--color-nav));
  color: var(--color-link);
  box-shadow:
    inset 0 0 10px rgba(255, 255, 255, 0.15),
    0 4px 10px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
}

#leerMas::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 60%);
  transform: rotate(45deg);
  transition: opacity 0.4s ease;
  opacity: 0;
}

#leerMas:hover::before {
  opacity: 1;
  animation: resplandor 1.2s ease-out forwards;
}

#leerMas:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 0 12px rgba(255, 255, 255, 0.3),
    0 6px 14px rgba(0, 0, 0, 0.4);
}

@keyframes resplandor {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0.3;
  }
  100% {
    transform: translate(0%, 0%) scale(1.5);
    opacity: 0;
  }
}




/*======= RESPONSIVE ===========*/
@media screen and (max-width: 768px) {
  nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: auto;
    min-height: 100px;
    padding: 20px;
    box-sizing: border-box;
    background-color: var(--color-nav, #3e2a18);
    position: fixed;
    top: 145px;
    left: 0;
    width: 100%;
    z-index: 999;
  }

  .menu-toggle {
    display: block;
    position: absolute;
    top: 45px;
    right: 20px;
    z-index: 1001;
    background: none;
    border: none;
    cursor: pointer;
  }

  .menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px 0;
    background-image: linear-gradient(to right, #ffffff, #fce8d5);
    background-size: 100% 100%;
    background-repeat: no-repeat;
    border-radius: 2px;
    transition: transform 0.3s ease, background-color 0.3s ease;
  }

  nav ul.menu {
    flex-direction: column;
    align-items: center;
    width: 100%;
    display: none;
    margin-top: 60px;
    gap: 20px;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  nav ul.menu.active {
    display: flex;
    position: absolute;
    left: 0;
    width: 100%;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(to bottom, rgba(169, 68, 68, 0.95), rgba(169, 68, 68, 0.6));
    backdrop-filter: blur(4px);
    border-radius: 0 0 15px 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    padding: 20px 0;
    z-index: 998;
    opacity: 1;
    transform: translateY(0);
  }

  nav ul.menu li a {
    font-size: 1.2em;
    padding: 12px 10px;
    width: 100%;
    text-align: center;
    color: #fce8d5;
    text-decoration: none;
    transition: background-color 0.3s ease;
  }

  nav ul.menu li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
  }

  main {
    padding-top: 280px;
  }

  .visual {
    flex-direction: column;
    gap: 20px;
    padding: 10px 0;
  }

  .visual-img {
    width: 100%;
    height: auto;
  }

  .visual-text {
    width: 100%;
    text-align: center;
    padding: 15px;
  }

  .visual-img-element {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
  }

  footer {
    padding: 10px;
    font-size: 0.8em;
  }
}


/*======= PAGINA HISTORIA ===========*/
.legion-section {
  background-color: #f4f1e9;
  padding: 40px 20px;
  font-family: 'Georgia', serif;
  border-top: 3px solid #8b5e3c;
}

.legion-section h2 {
  font-size: 2em;
  color: #5a3e2b;
  margin-bottom: 10px;
}

.legion-section .intro {
  font-size: 1.1em;
  color: #333;
  margin-bottom: 20px;
}

#leerMas {
  background-color: #8b5e3c;
  color: #fff;
  border: none;
  padding: 10px 20px;
  font-size: 1em;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#leerMas:hover {
  background-color: #a06c47;
}

#contenidoLegion {
  margin-top: 20px;
  font-size: 1em;
  color: #444;
  line-height: 1.6;
}

.hidden {
  display: none;
}


.leyendas-section-segunda {
  background-color: #fdf8f2;
  padding: 40px 20px;
  font-family: 'Georgia', serif;
  border-top: 3px solid #a67c52;
}

.leyendas-section-segunda h2 {
  font-size: 2em;
  color: #5a3e2b;
  margin-bottom: 10px;
}

.leyendas-section-segunda .intro {
  font-size: 1.1em;
  color: #333;
  margin-bottom: 30px;
}

.leyendas-section-segunda .gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.leyendas-section-segunda .card {
  background-color: #fff;
  border: 1px solid #d8c4aa;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.1);
  width: 300px;
  padding: 15px;
  text-align: center;
}

.leyendas-section-segunda .card img {
  width: 100%;
  height: auto;
  border-bottom: 1px solid #ccc;
}

.leyendas-section-segunda .card h3 {
  margin-top: 10px;
  font-size: 1.2em;
  color: #6b4c2e;
}

.leyendas-section-segunda .card p {
  font-size: 0.95em;
  color: #444;
}

#toggleLeyendasSegunda {
  margin-top: 30px;
  background-color: #a67c52;
  color: #fff;
  border: none;
  padding: 10px 20px;
  font-size: 1em;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#toggleLeyendasSegunda:hover {
  background-color: #c08f5d;
}

#leyendasExtraSegunda {
  margin-top: 20px;
  font-size: 1em;
  color: #444;
  line-height: 1.6;
}

.hidden {
  display: none;
}

/*======= ANIMACIONES .CARD===========*/

.card {
  background-color: #fff;
  border: 1px solid #d8c4aa;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.1);
  width: 300px;
  padding: 15px;
  text-align: center;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease forwards;
  animation-delay: var(--delay, 0s);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 4px 6px 12px rgba(0, 0, 0, 0.15);
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/*======= SECCIÓN LEYENDA EXCLUSIVA ===========*/
.seccion-leyenda {
  background-color: #fdf4e3;
  padding: 50px 25px;
  margin-bottom: 60px;
  border-top: 2px solid #a67c52;
  border-bottom: 2px solid #a67c52;
  box-shadow: inset 0 0 12px rgba(166, 124, 82, 0.15);
  animation: fadeInLeyenda 1s ease forwards;
  opacity: 0;
}

@keyframes fadeInLeyenda {
  to {
    opacity: 1;
  }
}

.seccion-leyenda .contenido {
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
  transition: transform 0.3s ease;
}

.seccion-leyenda .contenido:hover {
  transform: scale(1.01);
}

.seccion-leyenda .contenido.reverso {
  flex-direction: row-reverse;
}

.seccion-leyenda .imagen {
  max-width: 280px;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
}

.seccion-leyenda .imagen:hover {
  transform: scale(1.05);
}

.seccion-leyenda .texto {
  flex: 1;
  min-width: 260px;
}

.seccion-leyenda .texto h2 {
  font-size: 1.8em;
  color: #5a3e2b;
  margin-bottom: 15px;
}

.seccion-leyenda .texto p {
  font-size: 1.1em;
  color: #3a2a1a;
  line-height: 1.6;
  margin-bottom: 15px;
  text-align: justify;
}

/* Responsive exclusivo */
@media screen and (max-width: 768px) {
  .seccion-leyenda {
    padding: 40px 20px;
  }

  .seccion-leyenda .contenido,
  .seccion-leyenda .contenido.reverso {
    flex-direction: column;
    text-align: center;
  }

  .seccion-leyenda .imagen {
    max-width: 90%;
    margin: 0 auto 20px;
  }

  .seccion-leyenda .texto h2 {
    font-size: 1.5em;
  }

  .seccion-leyenda .texto p {
    font-size: 1em;
  }
}


/*======= ANIMACIONES ===========*/
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
