@font-face {
  font-family: "Sans";
  src: url("./fonts/FreeSans.otf");
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Sans", sans-serif;
  font-size: 13px;
  background: #f8f9fa;
  min-height: 100vh;
  overscroll-behavior: none;
}

a {
  text-decoration: none;
  color: #a4a4a4;
  font-size: 13px;
}

/* ===== NAV ===== */
nav {
  position: fixed;
  display: flex;
  width: 100%;
  justify-content: space-between;
  top: 0;
  padding: 8px 16px;
  background-color: white;
  z-index: 6;
  align-items: center;
}

.title {
  color: black;
}

nav ul {
  display: flex;
  align-items: center;
  list-style: none;
}

nav ul li {
  margin-left: 1rem;
}

.menuButton {
  display: none;
  padding: 0;
  border: none;
  cursor: pointer;
  background: none;
  font-family: "Sans", sans-serif;
  font-size: 13px;
  color: #a4a4a4;
}

.hidden-menu {
  position: fixed;
  flex-direction: column;
  width: 100%;
  z-index: 5;
  display: none;
  top: 34px;
}

.hidden-menu a {
  font-size: 13px;
  display: flex;
  width: 100%;
  text-decoration: none;
  color: #a4a4a4;
  padding: 8px 16px;
  margin-bottom: 2px;
  background-color: white;
}

.mapa {
  display: block;
  position: fixed;
  padding: 30px;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 1;
}

.link {
  stroke: #999;
  stroke-width: 0.5px;
}

.nodo image {
  cursor: pointer;
}
.nodo image:hover {
  opacity: 0.8;
}
.nodo.activo image {
  opacity: 0.4;
}

.panel-texto {
  position: fixed;
  top: 50%;
  left: 2rem;
  transform: translateY(-50%);
  width: 420px;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  padding-left: 1rem;
}

.panel-texto.visible {
  opacity: 1;
}

.panel-texto time {
  display: block;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #aaa;
  margin-bottom: 0.6rem;
}

.panel-texto p {
  font-size: 12px;
  line-height: 1.7;
  color: #1a1a1a;
}

.grid-movil {
  display: none;
}

@media (max-width: 768px) {
  .mapa,
  .panel-texto {
    display: none;
  }

  .grid-movil {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 50px 10px 40px;
  }

  .grid-item {
    position: relative;
  }

  .grid-item.abierto {
    grid-column: 1 / -1;
  }

  .grid-img-btn {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
  }

  .grid-img-btn img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 2px;
  }

  .grid-item.abierto .grid-img-btn img {
    opacity: 0.55;
  }

  .grid-texto {
    background: rgba(248, 249, 250, 0.97);
    border: 1px solid #e0e0e0;
    padding: 0.8rem 0.7rem;
    margin-top: 0.4rem;
    animation: aparecer 0.25s ease-out;
  }

  .grid-texto time {
    display: block;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #aaa;
    margin-bottom: 0.5rem;
  }

  .grid-texto p {
    font-size: 12px;
    line-height: 1.6;
    color: #1a1a1a;
  }

  @keyframes aparecer {
    from {
      opacity: 0;
      transform: translateY(-6px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

@media (max-width: 1024px) {
  nav ul {
    display: none;
  }
  .menuButton {
    display: block;
  }
}

.about-popup {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 320px;
  max-height: calc(100vh - 6rem);
  background: white;
  border: 1px solid #ddd;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

.about-popup.minimized {
  transform: translateY(150%);
  opacity: 0;
  pointer-events: none;
}

.about-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  background: #f1f3f5;
  font-size: 12px;
}

.about-close {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #666;
}

.about-content {
  padding: 1rem;
  font-size: 12px;
  line-height: 1.6;
  color: #333;
  overflow-y: auto;
}

.about-tab {
  position: fixed;
  z-index: 10000;
  right: 16px;
  bottom: 16px;
  display: none;
  color: black;
  background: #a4a4a4;
  padding: 8px;
  border: none;
  font-family: "Sans", sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.about-tab.visible {
  display: flex;
}

.about-tab:hover {
  background: #8c8c8c;
}

@media (max-width: 1024px) {
  .about-popup {
    width: 100%;
    left: 0;
    right: 0;
    top: 34px;
    bottom: auto;
    max-height: calc(100vh - 34px);
    border: none;
  }

  .about-tab,
  .about-tab.visible {
    display: none;
  }
}
