/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  padding-top: 0;
  margin-top: 0px;
}

/* Fixed header */
header {
  padding: 0 40px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 40px;
}

.banner {
  font-size: 1.8em;
  font-weight: 700;
  width: 180px;
  flex-shrink: 0;
  letter-spacing: -0.5px;
}

.navbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex: 1;
}

.menu-toggle {
  display: none;
  font-size: 1.8em;
  cursor: pointer;
  padding: 8px;
}

.nav-list {
  list-style: none;
  display: flex;
  gap: 8px;
  padding: 0;
  margin: 0;
}

.nav-list li {
  position: relative;
}

.nav-list li a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95em;
  padding: 10px 18px;
  display: block;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.dropdown .submenu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  list-style: none;
  padding: 8px;
  margin: 0;
  border-radius: 12px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.dropdown:hover .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.submenu li a {
  padding: 12px 16px;
  font-size: 0.9em;
  font-weight: 500;
  border-radius: 8px;
  margin-bottom: 4px;
}

.submenu li:last-child a {
  margin-bottom: 0;
}

/* Main layout */
main {
  position: relative;
  min-height: calc(100vh - 120px);
  padding: 10px 40px 40px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Sections */
section {
  min-height: calc(100vh - 160px);
  width: 100%;
  max-width: 1400px;
  margin: 0 auto 20px;
  padding: 30px 40px;
  border-radius: 20px;
  scroll-margin-top: 100px;
}

#home {
  margin-top: 80px;
  scroll-margin-top: 100px;
}

/* Noticias styles */
.tarjetas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

.tarjeta {
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
}

.tarjeta:hover {
  transform: translateY(-8px);
}

.tarjeta img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.tarjeta-contenido {
  padding: 24px;
}

.tarjeta h3 {
  margin: 0 0 12px;
  font-size: 1.3em;
  font-weight: 600;
  line-height: 1.3;
}

.tarjeta p {
  margin: 0;
  font-size: 0.95em;
  line-height: 1.6;
}

.noticia {
  max-width: 900px;
  margin: 40px auto;
  border-radius: 16px;
  padding: 50px;
}

.noticia img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  margin-bottom: 30px;
}

.noticia h1 {
  font-size: 2.5em;
  margin-bottom: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.noticia h2 {
  font-size: 1.4em;
  margin-bottom: 24px;
  font-weight: 500;
  line-height: 1.4;
}

.noticia .autor {
  font-style: italic;
  margin-bottom: 24px;
  font-size: 0.95em;
}

.noticia .extracto {
  font-weight: 600;
  margin-bottom: 30px;
  font-size: 1.1em;
  line-height: 1.6;
}

.noticia .contenido {
  line-height: 1.8;
  font-size: 1.05em;
}

/* Footer */
footer {
  text-align: center;
  padding: 20px;
  margin-top: 40px;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

footer p {
  margin: 0;
  font-size: 0.9em;
}

/* Responsive */
@media (max-width: 768px) {
  html, body {
    padding-top: 0;
    margin-top: 80px;
  }

  header {
    flex-direction: row;
    align-items: center;
    height: 80px;
    padding: 15px 20px;
    gap: 15px;
  }

  .banner {
    width: auto;
    font-size: 1.2em;
    flex-shrink: 1;
  }

  .navbar {
    width: auto;
    flex: 0;
  }

  .nav-list {
    display: none;
    flex-direction: column;
    width: 100%;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 15px;
    gap: 8px;
  }

  .nav-list.active {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }

  .dropdown .submenu {
    position: absolute;
    opacity: 1;
    visibility: visible;
    transform: none;
    margin-left: 0;
    margin-top: 0;
    display: none;
    left: 0;
    right: 0;
    top: 100%;
  }

  .dropdown.active .submenu {
    display: block;
  }

  main {
    padding: 10px 20px 20px;
  }

  section {
    padding: 40px 24px;
    margin-bottom: 20px;
    border-radius: 16px;
  }

  .tarjetas-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .noticia {
    padding: 30px 24px;
  }

  .noticia h1 {
    font-size: 2em;
  }
}