@charset "UTF-8";
/* Modal de mapas históricos compartido */
/* Variables visuales del componente. Los temas de cada libro pueden redefinirlas. */
:root {
  --map-paper: #f2eadc;
  --map-paper-light: #fffdf8;
  --map-text: #403328;
  --map-muted: #756757;
  --map-accent: #b57d43;
  --map-accent-dark: #302016;
  --map-medium: #69472f;
  --map-accent-soft: #d8b27f;
  --map-line: rgba(143, 101, 55, 0.24);
}

/* ==================================================
   ENLACES DE LUGARES HISTÓRICOS
================================================== */
.historical-place {
  display: inline-flex;
  align-items: baseline;
  gap: 0.28em;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--map-medium);
  font: inherit;
  font-weight: 700;
  line-height: inherit;
  text-align: inherit;
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease;
}
.historical-place:hover {
  color: var(--map-accent);
  border-bottom-style: solid;
}
.historical-place:focus-visible {
  border-bottom-color: transparent;
  border-radius: 0.18rem;
  outline: 0.18rem solid var(--map-accent);
  outline-offset: 0.2rem;
}

/* ==================================================
   MODAL DEL MAPA
================================================== */
.place-map {
  --place-map-marker-color: var(--map-accent);
  --place-map-marker-dark: var(--map-accent-dark);
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(0.4rem, 0.8vw, 0.75rem);
}
.place-map[hidden] {
  display: none;
}
.place-map__backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 35%, rgba(60, 39, 24, 0.26), rgba(8, 6, 5, 0.88) 78%), rgba(8, 6, 5, 0.72);
  backdrop-filter: blur(0.3rem);
  cursor: pointer;
}
.place-map__card {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: min(120rem, 100vw - 1rem);
  height: min(72rem, 100dvh - 1rem);
  max-height: calc(100dvh - 1rem);
  overflow: auto;
  padding: clamp(0.9rem, 1.4vw, 1.45rem);
  border: 0.1rem solid var(--map-accent);
  border-radius: 0.85rem;
  background: linear-gradient(rgba(255, 253, 248, 0.94), rgba(242, 234, 220, 0.98)), var(--map-paper);
  box-shadow: 0 1.8rem 5rem rgba(0, 0, 0, 0.48), inset 0 0 0 0.35rem rgba(255, 255, 255, 0.42), inset 0 0 0 0.45rem var(--map-line);
  color: var(--map-text);
  outline: none;
  animation: place-map-enter 220ms ease-out both;
}
.place-map__close {
  position: absolute;
  top: clamp(0.75rem, 2vw, 1.25rem);
  right: clamp(0.75rem, 2vw, 1.25rem);
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0 0 0.14rem;
  border: 0.1rem solid var(--map-accent);
  border-radius: 50%;
  background: linear-gradient(180deg, var(--map-medium), var(--map-accent-dark));
  box-shadow: 0 0.35rem 0.8rem rgba(48, 32, 22, 0.2);
  color: var(--map-paper-light);
  font-family: "Source Sans 3", "Times New Roman", serif;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
.place-map__close:hover {
  transform: rotate(6deg) scale(1.06);
  background: var(--map-accent);
  box-shadow: 0 0.45rem 1rem rgba(48, 32, 22, 0.28);
}
.place-map__close:focus-visible {
  outline: 0.2rem solid var(--map-accent);
  outline-offset: 0.25rem;
}
.place-map__header {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.place-map__eyebrow {
  margin: 0 0 0.35rem;
  color: var(--map-accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.place-map__title {
  margin: 0;
  color: var(--map-accent-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 500;
  line-height: 1.05;
}
.place-map__layout {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 1.8vw, 1.75rem);
  align-items: stretch;
  padding-top: clamp(0.8rem, 1.4vw, 1.2rem);
}
.place-map__visual {
  position: relative;
  isolation: isolate;
  width: min(100%, 120vh);
  margin-inline: auto;
  aspect-ratio: 16/9;
  overflow: hidden;
  border: 0.1rem solid var(--map-line);
  border-radius: 0.5rem;
  background: #d9c7aa;
  box-shadow: 0 0.75rem 1.6rem rgba(48, 32, 22, 0.2), inset 0 0 0 0.24rem rgba(255, 255, 255, 0.32);
}
.place-map__canvas {
  position: absolute;
  inset: 0;
  transform: translate(var(--map-translate-x, 0), var(--map-translate-y, 0)) scale(var(--map-zoom, 1));
  transform-origin: 0 0;
  transition: transform 3.2s ease-in-out;
  will-change: transform;
}
.place-map__neighbors {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 320ms ease 2.6s;
}
.place-map__neighbor {
  position: absolute;
  left: var(--neighbor-x);
  top: var(--neighbor-y);
  display: flex;
  align-items: center;
  gap: 0.28rem;
  transform: translate(-0.22rem, -50%) scale(var(--map-inverse-zoom, 1));
  transform-origin: left center;
  white-space: nowrap;
}
.place-map__neighbor-dot {
  flex: 0 0 auto;
  width: 0.7rem;
  height: 0.7rem;
  border: 0.08rem solid rgba(255, 250, 239, 0.95);
  border-radius: 50%;
  background: rgba(85, 59, 39, 0.76);
  box-shadow: 0 0.08rem 0.18rem rgba(35, 24, 16, 0.28);
}
.place-map__neighbor-label {
  display: inline-block;
  color: rgba(72, 48, 31, 0.92);
  font-family: "Source Sans 3", "Times New Roman", serif;
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  text-shadow: 0.5px 0 rgba(255, 250, 239, 0.9), -0.5px 0 rgba(255, 250, 239, 0.9), 0 0.5px rgba(255, 250, 239, 0.9), 0 -0.5px rgba(255, 250, 239, 0.9);
}
.place-map__neighbor--approximate .place-map__neighbor-dot {
  border-style: dashed;
  background: rgba(255, 250, 239, 0.86);
}
.place-map__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.place-map__information {
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  line-height: 1.65;
}
.place-map__zoom-controls {
  position: absolute;
  z-index: 5;
  right: clamp(0.65rem, 1.2vw, 1rem);
  bottom: clamp(0.65rem, 1.2vw, 1rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 0.08rem solid rgba(112, 76, 45, 0.58);
  border-radius: 0.55rem;
  background: rgba(255, 250, 239, 0.94);
  box-shadow: 0 0.35rem 0.9rem rgba(41, 28, 18, 0.25);
  opacity: 0;
  transform: translateY(0.45rem);
  transition: opacity 220ms ease, transform 220ms ease;
}
.place-map__zoom-controls[hidden] {
  display: none;
}
.place-map__zoom-button {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  padding: 0 0 0.12rem;
  border: 0;
  background: transparent;
  color: var(--map-accent-dark);
  font-family: "Source Sans 3", "Times New Roman", serif;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}
.place-map__zoom-button + .place-map__zoom-button {
  border-top: 0.08rem solid rgba(112, 76, 45, 0.28);
}
.place-map__zoom-button:hover:not(:disabled) {
  background: var(--map-accent-dark);
  color: var(--map-paper-light);
}
.place-map__zoom-button:focus-visible {
  position: relative;
  z-index: 1;
  outline: 0.18rem solid var(--map-accent);
  outline-offset: -0.24rem;
}
.place-map__zoom-button:disabled {
  background: rgba(112, 76, 45, 0.09);
  color: var(--map-muted);
  cursor: default;
  opacity: 0.46;
}
.place-map__location {
  margin: 0 0 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 0.1rem solid var(--map-line);
  color: var(--map-medium);
  font-weight: 700;
}
.place-map__location::before {
  content: "◆";
  margin-right: 0.55rem;
  color: var(--map-accent);
  font-size: 0.72em;
}
.place-map__period {
  margin: 0 0 1rem;
  color: var(--map-muted);
}
.place-map__period[hidden] {
  display: none;
}
.place-map__information-label {
  display: block;
  margin-bottom: 0.12rem;
  color: var(--map-accent);
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.place-map__description {
  margin: 0;
}
.place-map__note {
  margin: 1.15rem 0 0;
  padding: 0.85rem 1rem;
  border-left: 0.25rem solid var(--map-accent);
  border-radius: 0 0.35rem 0.35rem 0;
  background: color-mix(in srgb, var(--map-accent-soft) 18%, transparent);
  color: var(--map-muted);
  font-size: 0.92em;
}
.place-map__note[hidden] {
  display: none;
}
.place-map {
  /* El punto del mapa se coloca con dos variables escritas por JavaScript. */
}
.place-map__marker {
  position: absolute;
  z-index: 2;
  left: var(--place-x);
  top: var(--place-y);
  width: 1.25rem;
  height: 2rem;
  opacity: 0;
  transform: translate(-50%, -100%) scale(0.82);
  filter: drop-shadow(0 0.24rem 0.18rem rgba(37, 22, 13, 0.38));
  pointer-events: none;
  transition: left 3.2s ease-in-out, top 3.2s ease-in-out, opacity 300ms ease 2.6s, transform 300ms ease 2.6s;
}
.place-map__marker[hidden] {
  display: none;
}
.place-map__marker::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0.95rem;
  width: 0;
  height: 0;
  border-right: 0.3rem solid transparent;
  border-left: 0.3rem solid transparent;
  border-top: 0.88rem solid var(--place-map-marker-dark);
  transform: translateX(-50%);
}
.place-map__marker-dot {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 0;
  display: grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  border: 0.14rem solid var(--map-paper-light);
  border-radius: 50%;
  background: var(--place-map-marker-dark);
  box-shadow: 0 0 0 0.12rem var(--place-map-marker-color);
  transform: translateX(-50%);
}
.place-map__marker-dot::after {
  content: "";
  width: 0.28rem;
  height: 0.28rem;
  border-radius: 50%;
  background: var(--map-paper-light);
}
.place-map__marker-pulse {
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: -0.08rem;
  width: 0.72rem;
  height: 0.28rem;
  border: 0.12rem solid var(--place-map-marker-color);
  border-radius: 50%;
  transform: translateX(-50%);
  animation: place-map-pulse 1.8s ease-out infinite;
}
.place-map__marker-label {
  position: absolute;
  left: calc(100% + 0.55rem);
  top: -0.08rem;
  z-index: 3;
  padding: 0.38rem 0.68rem 0.42rem;
  border: 0.08rem solid rgba(112, 76, 45, 0.55);
  border-radius: 0.32rem;
  background: rgba(255, 250, 239, 0.96);
  box-shadow: 0 0.22rem 0.55rem rgba(41, 28, 18, 0.2);
  color: var(--map-accent-dark);
  font-family: "Source Sans 3", "Times New Roman", serif;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.place-map__marker--approximate .place-map__marker-dot {
  border-style: dashed;
  background: var(--map-paper-light);
}
.place-map__marker--approximate .place-map__marker-dot::after {
  background: var(--place-map-marker-dark);
}
.place-map__marker--approximate::after {
  border-top-color: var(--map-paper-light);
}

.place-map--zoomed .place-map__neighbors {
  opacity: 1;
}
.place-map--zoomed .place-map__marker {
  left: 50%;
  top: 50%;
  opacity: 1;
  transform: translate(-50%, -100%) scale(1);
}

.place-map--overview .place-map__neighbors {
  opacity: 0;
  transition-delay: 0ms;
}
.place-map--overview .place-map__marker {
  opacity: 1;
  transform: translate(-50%, -100%) scale(0.82);
}

.place-map--controls-ready .place-map__zoom-controls {
  opacity: 1;
  transform: translateY(0);
}

.has-open-place-map {
  overflow: hidden;
}

@keyframes place-map-enter {
  from {
    opacity: 0;
    transform: translateY(0.8rem) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes place-map-pulse {
  0% {
    opacity: 0.75;
    transform: translateX(-50%) scale(0.7);
  }
  75%, 100% {
    opacity: 0;
    transform: translateX(-50%) scale(1.8);
  }
}
/* ==================================================
   TABLET Y MÓVIL
================================================== */
@media (max-width: 52rem) {
  .place-map {
    place-items: end center;
    padding: 0.75rem;
  }
  .place-map__card {
    width: 100%;
    height: auto;
    max-height: calc(100dvh - 1.5rem);
    border-radius: 0.75rem;
  }
  .place-map__visual {
    width: 100%;
  }
  .place-map__zoom-button {
    width: 3rem;
    height: 3rem;
    font-size: 1.9rem;
  }
  .place-map__information {
    /* En móvil, el mapa queda arriba y la explicación debajo. */
    padding: 0.25rem 0.15rem 0;
  }
}
@media (max-width: 32rem) {
  .historical-place {
    gap: 0.2em;
  }
  .place-map {
    padding: 0;
  }
  .place-map__card {
    max-height: 100dvh;
    padding: 1.25rem;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 0;
  }
  .place-map__close {
    top: 0.7rem;
    right: 0.7rem;
    width: 2.45rem;
    height: 2.45rem;
  }
  .place-map__header {
    padding-right: 2.8rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .historical-place,
  .place-map__card,
  .place-map__canvas,
  .place-map__close,
  .place-map__marker,
  .place-map__neighbors,
  .place-map__zoom-controls,
  .place-map__zoom-button,
  .place-map__marker-pulse {
    animation: none;
    transition: none;
  }
}

/*# sourceMappingURL=place-map.css.map */
