/*----------------- 2026.4.29 5G資訊圖地圖 -----------------*/
.map_box {
  float: left;
  width: 100%;
  background-image: url(../img/5g_bg.svg);
  background-size: 55%;
  background-position: right bottom;
  background-repeat: no-repeat;
  padding: 0 10px 0 45px;
  margin: 20px 0 40px 0;
  position: relative;
  min-width: 325px;
}

.map_box .map_title {
  float: left;
  width: calc(100% - 400px);
  color: #0f365e;
  padding: 12% 0 0 0;
  pointer-events: none;
  margin-left: -33px;
}

.map_box .map_title .title {
  font-size: 1.5em;
  position: relative;
  width: -moz-fit-content;
  width: fit-content;
  z-index: 2;
}

.map_box .map_title .title:before {
	content: "";
	width: 100%;
	height: 10px;
	position: absolute;
	bottom: 20px;
	background: #FEEFBF;
	z-index: -1;
}
.map_box .map_title .title_1 {
  font-size: 1.5em;
  position: relative;
  width: -moz-fit-content;
  width: fit-content;
  z-index: 2;
}
.map_box .map_title .title_1:before {
  content: "";
  width: 100%;
  height: 10px;
  position: absolute;
  bottom: 3px;
  background: #FEEFBF;
  z-index: -1;
}
.map_box .map_title .no {
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: 3em;
  color: #00b0f0;
  padding: 0 5px;
}
.map_box .map_title .font_s {
  font-size: 1em;
  position: relative;
  width: -moz-fit-content;
  width: fit-content;
  z-index: 2;
}
.map_box .map_title .font_s:before {
  content: "";
  width: 100%;
  height: 10px;
  position: absolute;
  bottom: -1px;
  background: #FEEFBF;
  z-index: -1;
}

.taiwan_map {
  float: left;
  max-width: 400px;
  width: 100%;
  position: relative;
}
.taiwan_map path {
  fill: #fff;
  stroke: #0f365e;
  stroke-width: 2px;
  cursor: no-drop;
  transition: 0.2s;
  outline: none;
  z-index: 1;
  pointer-events: none;
}
.taiwan_map path.active {
  fill: #f9c62e;
  cursor: pointer;
  pointer-events: auto;
}
.taiwan_map path.active:hover, .taiwan_map path.active:focus {
  fill: #8ACECB;
  stroke: #00b0f0;
  z-index: 9;
}
.taiwan_map path.active.flag_blue {
  fill: #8ACECB !important;
}
.taiwan_map path.tag {
  fill: #FEEFBF;
}
.taiwan_map path.is-hovered {
  fill: #8ACECB;
  stroke: #00b0f0;
  z-index: 9;
}

.link_broken {
  pointer-events: none;
}

.map_label {
    position: absolute;
    z-index: 9;
    margin-left: -20px;
}

.map_label .quantity {
    position: relative;
    color: #fff !important;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    font-weight: bold;
    font-size: 1.5em;
    background: #0D365E;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    border: 2px solid white;
    pointer-events: none;
    z-index: 10;
    text-align: center !important;
    display: inline-block;
}

.map_label .title {
    position: relative;
    display: inline-block;
    white-space: nowrap;
    background-color: #fff;
    border-radius: 20px;
    left: 17px;
    top: -4px;
    padding: 3px 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 0;
    font-size: 1.1em;
}
.map_label.Keelung {
  margin-left: 0 !important;
}
.map_label.Keelung .title {
  left: -15px;
}
.map_label.is-hovered .quantity {
    animation: labelBounce 0.6s infinite ease-in-out;
    color: #333 !important;
    z-index: 12;
    background: #FEEFBF;
}

.map_label.map_flag .title {
    padding-left: 20px;
    left: 19px;
}

.map_label.map_flag .title:before {
  content: "";
  background: url(../img/tag.svg);
  width: 10px;
  height: 17px;
  position: absolute;
  left: 8px;
  display: block;
  z-index: 10;
}
.map_label.map_flag_01 {
  width: 18px;
  height: 29px;
  margin-left: 0 !important;
  pointer-events: none;
}
.map_label.map_flag_01:before {
  content: "";
  background: url(../img/tag_yellow.svg);
  width: 18px;
  height: 29px;
  position: absolute;
  display: block;
  z-index: 10;
}

/* 動態效果：上下移動 */
@keyframes labelBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}
/* 彈窗樣式 */
.map_modal_overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  text-align: left !important;
  word-break: break-word !important;
}
.map_modal {
  background: white;
  padding: 40px;
  border-radius: 8px;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}
.map_modal .close-btn {
  background: transparent;
  border: none;
  position: absolute;
  top: 10px;
  right: 10px;
  color: #333;
  border-radius: 5px;
  padding: 5px;
  cursor: pointer;
}
.map_modal .close-btn:focus {
  outline: 2px solid #00b0f0;
}
.map_modal #m-title {
  font-size: 1.5em;
  font-weight: bold;
  color: #0D365E;
  padding: 3px 10px 5px 10px;
  position: relative;
  z-index: 1;
}
.map_modal #m-title:before {
  content: "";
  display: block;
  position: absolute;
  width: 85%;
  height: 45px;
  z-index: -1;
  background-color: #F9C72D;
  box-shadow: 6px 6px #0D365E;
  transform: skew(25deg);
  top: -5px;
  left: -20px;
}
.map_modal #m-title:after {
  content: "";
  display: block;
  position: absolute;
  width: 30px;
  height: 55px;
  z-index: -1;
  background-color: #fff;
  top: -5px;
  left: -30px;
}
.map_modal #info-container {
  max-height: calc(80vh - 110px);
  overflow-y: scroll;
}

.city-info {
  display: none;
  text-align: left;
  line-height: 1.6;
  margin: 15px 0;
}

.city-info.active {
  display: block;
}

.city-info .city {
    float: left;
    width: 100%;
    background: #fdf2cd;
    padding: 5px 10px 3px 10px;
    font-weight: bold;
    font-size: 1.1em;
    margin-top: 5px;
    white-space: normal !important;
}

.city-info .item {
  float: left;
  width: 100%;
  padding: 10px 0 7px 10px;
  border-bottom: 2px dotted #eee;
}
.city-info .item .title_box {
  float: left;
  width: calc(100% - 100px);
}

.city-info .item .title_box .title {
    font-size: 1em;
    display: inline-block;
    text-align: left !important;
    word-break: break-word !important;
}

.city-info .item .title_box .type {
  background: #b5eeea;
  color: #333;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.9em;
  text-align: left !important;
  word-break: break-word !important;
}

.city-info .item .file {
    float: left;
    width: 100px;
    font-size: 0.9em;
}

.city-info .item .file a {
    padding: 8px 10px;
    background: #0f365e;
    color: #fff;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9em;
}

.city-info .item .file a:focus, .city-info .item .file a:hover {
    outline: 2px solid #00b0f0;
    background: #333;
}
.city-info .item .file i:before {
  padding-right: 3px;
}

[lang=en] .map_box .map_label .title {
  font-size: 0.8em;
}
[lang=en] .map_box .map_title {
    font-size: 0.9em;
}
[lang=en] .map_box .map_title .no {
  font-size: 2em;
}
[lang=en] .map_box .map_title .title:before {
  bottom: 7px;
}
[lang=en] .map_modal {
    font-size: 0.9em;
}
[lang=en] .city-info .item .title_box {
  width: calc(100% - 106px);
}
[lang=en] .city-info .item .file {
  width: 106px;
}

@media (max-width: 991px) {
  .map_box .map_title {
    width: 365px;
    position: absolute;
    left: 390px;
  }
}
@media (max-width: 767px) {
  .map_box {
    background-image: none;
    padding: 0 0 0 50px;
  }
  .map_box .map_title {
    top: 150px;
    right: 0;
    left: auto;
  }
  [lang=en] .map_box .map_title {
    padding: 17% 0 0 0;
  }
  [lang=en] .city-info .item .title_box {
    width: 100%;
  }
  [lang=en] .city-info .item .file {
    width: 100%;
    margin-top: 10px;
  }
  [lang=en] .city-info .item .file a {
    float: right;
  }
}

@media (max-width: 500px) {
  .map_box {
    margin-bottom: 50px;
  }

    .map_box .map_title {
        font-size: 0.7em;
        width: calc(100% + 70px);
        position: relative;
        padding: 0 0 30px 0;
        margin-left: -50px;
        top: 0;
    }

    .map_box .map_label {
        font-size: 0.7em;
        margin-left: 4px;
    }

  .map_box .map_label .quantity {
    width: 30px;
    height: 30px;
    padding: 0;
  }
  .map_box .map_label .quantity:before {
    left: 5px;
    top: 2px;
    width: 30px;
    height: 30px;
  }

    .map_box .map_label .title {
        left: -7px;
        top: -2px;
        padding: 3px 7px;
        margin-right: -22px;
        font-size:0.9em;
    }
  .map_box .map_label.Keelung .title {
    left: -11px;
  }
  .map_box .map_label.map_flag .title {
    padding: 3px 7px 3px 20px;
  }
  .map_box .map_label.map_flag .title:before {
    width: 8px;
    height: 14px;
    left: 8px;
  }
  .map_box .map_label.map_flag_01 {
    width: 12px;
    height: 19px;
    z-index:8;
  }
  .map_box .map_label.map_flag_01:before {
    width: 12px;
    height: 19px;
  }
  .map_modal {
    padding: 20px;
  }
  .map_modal .city-info .file a {
    padding: 5px 8px;
    font-size: 0.9em;
  }
    [lang=en] .map_box .map_title {
        top: -50px;
        font-size: 0.7em;
    }
  [lang=en] .map_box .map_label {
    margin-left: -7px;
  }
}

@media (max-width: 420px) {
  .city-info .item .title_box {
    width: 100%;
  }
  .city-info .item .file {
    width: 100%;
    margin-top: 10px;
  }
  .city-info .item .file a {
    float: right;
  }
}