*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html,
body{
  font-family: "Noto Sans JP", sans-serif;
}
img{
  display: block;
  max-width: 100%;
}
.relationship-page{
  width: 100%;
  min-height: 100dvh;
  padding: clamp(20px, 5vw, 32px);
}

/*Back button*/
.back{
  position: absolute;
  display: block;
  width: clamp(30px, 5vw, 50px);
  left: 4%;
  top: 3%;
  z-index: 50;
  pointer-events: auto;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.back img{
  width: 100%;
  height: auto;
}

/*Relationship line*/
.relationship-lines{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}
.relationship-line{
  stroke:hwb(0 76% 24%);
  stroke-width: 3;
  stroke-linecap: round;
}

/*Relationship map*/
.relationship-map{
  position: relative;
  width: 100%;
  min-height: 650px;
}
.thumbnails{
  position: absolute;
  text-align: center;
  z-index: 2;
}
.thumbnails img{
  width: 100%;
  height: auto;
}
.deadwood{
  width: clamp(140px, 38vw, 240px);
  /*align thumbnail to middle*/
  left: 50%;
  top: 70%;
  transform: translate(-50%, -50%);
}
.funguses{
  width: clamp(120px, 38vw, 220px);
  top: 6%;
  right: 6%;
}
.insects{
  width: clamp(120px, 38vw, 220px);
  bottom: 50%;
  left: 6%;
}
.bryophyte{
  width: clamp(120px, 38vw, 220px);
  bottom: -20%;
  right: 5%;
}
.microorganisms{
  width: clamp(120px, 38vw, 220px);
  bottom: -30%;
  left: 5%;
}

/*Text*/
.thumbnails h1,
.thumbnails p{
  position: absolute;
  left: 10%;
  z-index: 3;
}
.thumbnails h1{
  bottom: 0%;
  left: 1%;
  font-size: clamp(2.6rem, 5vw, 5rem);
  line-height: 1;
  
  color: black;
  text-shadow:
    -2px -2px 0 #fff,
    2px -2px 0 #fff,
    -2px 2px 0 #fff,
    2px 2px 0 #fff;
}
.thumbnails p{
  bottom: -15%;
  left: 1%;
  font-size: clamp(1rem, 2.4vw, 2rem);

  color: black;
  text-shadow:
    -2px -2px 0 #fff,
    2px -2px 0 #fff,
    -2px 2px 0 #fff,
    2px 2px 0 #fff;
}

/* Clickable thumbnails */
.thumbnails{
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Information popup */
.info-popup{
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.info-popup.is-open{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.info-popup-card{
  position: relative;
  width: min(88vw, 520px);
  padding: 32px 26px 28px;
  background: #fff;
  border-radius: 24px;
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.18);
}

.info-popup-close{
  position: absolute;
  top: 10px;
  right: 14px;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
}

.info-popup-kana{
  margin: 0 0 2px;
  font-size: clamp(0.8rem, 2.5vw, 1rem);
  font-weight: 500;
}

.info-popup-title{
  margin: 0 0 18px;
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  line-height: 1.1;
}

.info-popup-description{
  margin: 0;
  font-size: clamp(0.95rem, 3.5vw, 1.1rem);
  line-height: 1.8;
}

/*Ipad*/
@media screen and (min-width: 768px){
  .relationship-map{
    transform: translateY(200px);
  }
}