/* AGENT_TARGET: castle-journey-map-styles — cohesion hub for new adventure destinations */

.journey-map-modal {
  position: fixed;
  inset: 0;
  z-index: 10158;
  display: grid;
  place-items: center;
  padding: 16px;
}

.journey-map-modal[hidden] {
  display: none;
}

.journey-map-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(48, 40, 64, 0.64);
  backdrop-filter: blur(4px);
}

.journey-map-shell {
  position: relative;
  display: grid;
  gap: 12px;
  width: min(1120px, calc(100vw - 24px));
  max-height: min(92vh, 900px);
  overflow: auto;
  padding: 15px;
  border: 3px solid #d7a436;
  border-radius: 12px;
  background: #fffdf7;
  color: #2f3048;
  box-shadow: 0 24px 70px rgba(48, 40, 64, 0.34);
}

.journey-map-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  min-width: 44px;
  min-height: 44px;
  border: 2px solid rgba(47, 48, 72, 0.16);
  border-radius: 8px;
  background: #fff;
  color: #6b2c59;
  font: 900 24px/1 Arial, sans-serif;
  cursor: pointer;
}

.journey-map-header {
  width: min(720px, calc(100% - 56px));
  padding: 2px 4px 0;
}

.journey-map-header span,
.journey-map-card small {
  display: block;
  color: #6b2c59;
  font:
    900 12px/1.2 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.journey-map-header h2 {
  margin: 3px 0;
  color: #2f3048;
  font:
    900 25px/1.08 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  letter-spacing: 0;
}

.journey-map-header p,
.journey-map-card p,
.journey-map-finale span {
  margin: 0;
  color: #5c5f70;
  font: 800 13px/1.34 "Trebuchet MS", Arial, sans-serif;
}

.journey-map-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.journey-map-card {
  display: grid;
  grid-template-rows: auto minmax(118px, 1fr) auto;
  gap: 9px;
  min-width: 0;
  padding: 10px;
  border: 2px solid rgba(47, 48, 72, 0.14);
  border-radius: 8px;
  background: #fff;
}

.journey-map-card.ready {
  border-color: #d7a436;
  background: #fff8ea;
}

.journey-map-card.visited {
  background: #edf9f4;
}

.journey-map-picture {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 7px;
  background: #2f3048;
}

.journey-map-picture img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.journey-map-copy {
  display: grid;
  gap: 5px;
}

.journey-map-card h3 {
  margin: 0;
  color: #2f3048;
  font:
    900 17px/1.12 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
}

.journey-map-card button,
.journey-map-finale button {
  min-height: 46px;
  border: 2px solid rgba(47, 48, 72, 0.16);
  border-radius: 8px;
  background: #fff;
  color: #2f3048;
  font:
    900 12px/1.1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  cursor: pointer;
}

.journey-map-card.ready button,
.journey-map-finale button {
  border-color: #d7a436;
  background: #ffdf8d;
}

.journey-map-finale {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  align-items: center;
  padding: 12px;
  border: 2px solid rgba(47, 48, 72, 0.13);
  border-radius: 8px;
  background: #f2fbff;
}

.journey-map-finale strong {
  color: #1c5d84;
  font:
    900 18px/1.1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
}

.journey-map-finale button {
  grid-row: 1 / span 2;
  grid-column: 2;
  min-width: 128px;
}

.journey-map-close:focus-visible,
.journey-map-card button:focus-visible,
.journey-map-finale button:focus-visible {
  outline: 3px solid rgba(107, 44, 89, 0.72);
  outline-offset: 3px;
}

@media (max-width: 960px) {
  .journey-map-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .journey-map-modal {
    align-items: start;
    padding: 8px;
  }
  .journey-map-shell {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    padding: 10px;
    border-radius: 10px;
  }
  .journey-map-header {
    width: calc(100% - 56px);
  }
  .journey-map-header h2 {
    font-size: 21px;
  }
  .journey-map-grid,
  .journey-map-finale {
    grid-template-columns: 1fr;
  }
  .journey-map-card {
    grid-template-rows: auto auto auto;
  }
  .journey-map-finale button {
    grid-row: auto;
    grid-column: auto;
    width: 100%;
  }
}
