* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-weight: normal;
  font-family: "Noto Sans TC", sans-serif;
}
body {
  background-color: #e9ecef;
  dialog.sign-in-popup,
  dialog.sign-up-popup {
    max-width: 340px;
    border-radius: 5px;
    border: none;
    background-color: white;
    position: fixed;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    transition: top 0.5s ease-out;
    div.gradient-bar {
      display: block;
      width: 100%;
      height: 10px;
      background-image: linear-gradient(60deg, #66aabb, #337788);
      border-top-right-radius: 5px;
      border-top-left-radius: 5px;
    }
    img {
      width: 16px;
      height: 16px;
      position: absolute;
      top: 27px;
      right: 17px;
      cursor: pointer;
    }
    div.sign-in,
    div.sign-up {
      display: flex;
      flex-direction: column;
      flex-wrap: wrap;
      align-items: center;
      h4 {
        font-size: 24px;
        font-weight: 700;
        color: #666666;
        margin: 15px 0px;
      }
      input,
      button#sign-in-submit-btn,
      button#sign-up-submit-btn {
        width: 310px;
        height: 46px;
        margin: 0px 15px;
        padding: 15px;
        font-size: 16px;
        border: 1px solid #cccccc;
        border-radius: 5px;
      }
      input {
        margin-bottom: 10px;
      }
      button#sign-in-submit-btn,
      button#sign-up-submit-btn {
        background-color: #448899;
        color: white;
        font-size: 19px;
        border: none;
        cursor: pointer;
        line-height: 23px;
        margin-bottom: 15px;
      }
      p {
        font-weight: 500;
      }
      button#to-sign-up,
      button#to-sign-in {
        border: none;
        color: #666666;
        background: none;
        font-weight: 500;
        margin-bottom: 15px;
        font-size: 16px;
        cursor: pointer;
      }
    }
  }
  dialog.show {
    top: 80px;
  }
  dialog.sign-up-popup {
    top: 80px;
  }
  dialog.sign-in-popup {
    box-shadow: 0px 4px 60px #aaaaaa;
  }
  dialog.sign-in-popup::backdrop {
    background: rgba(0, 0, 0, 0.25);
  }
  dialog.sign-up-popup::backdrop {
    background: none;
  }
  header {
    background-color: #e9ecef;
    position: sticky;
    top: 0;
    z-index: 1;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
    div.header {
      margin: 0px auto;
      max-width: 1200px;
      display: flex;
      justify-content: space-between;
      div.header-left {
        margin: 10px 10px;
        h1 {
          font-size: 30px;
          font-weight: 700;
          color: #448899;
        }
      }
      div.header-right {
        margin: 10px 0px;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        a {
          text-decoration: none;
          color: #666666;
          font-size: 15px;
          font-weight: 450;
          div {
            width: 80px;
            height: 30px;
            margin-right: 10px;
            background-color: #e9ecef;
            box-shadow: 5px 5px 8px rgba(0, 0, 0, 0.2),
              -5px -5px 8px rgba(255, 255, 255, 0.9);
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: center;
            border-radius: 5px;
            &:hover {
              box-shadow: inset -5px -5px 8px rgba(255, 255, 255, 0.9),
                inset 5px 5px 8px rgba(0, 0, 0, 0.2);
            }
          }
        }
      }
    }
  }
  section#hero {
    background-image: url("/static/img/welcome.png");
    background-size: cover;
    background-position: center top;
    max-width: 1920px;
    height: 320px;
    display: grid;
    justify-content: center;
    align-content: center;

    div {
      display: grid;
      grid-template-columns: minmax(auto, 1180px);
      grid-template-rows: 39px 39px 78px;
      padding: 10px;
      margin: 5px;

      h4 {
        color: #f8f8f8;
        font-size: 28px;
        font-weight: 700;
        align-self: end;
      }
      p {
        color: #f8f8f8;
        font-weight: 700;
        font-size: 16px;
        align-self: end;
      }
      search {
        align-self: end;
        input {
          width: 400px;
          height: 46px;
          padding: 0rem 1rem;
          font-size: 16px;
          font-weight: 500;
          border: none;
          border-top-left-radius: 5px;
          border-bottom-left-radius: 5px;
        }
        button {
          border-top-right-radius: 5px;
          border-bottom-right-radius: 5px;
          width: 60px;
          height: 46px;
          border: none;
          cursor: pointer;
          background-color: #448899;
          position: relative;
          top: 7px;
        }
      }
    }
  }
  nav {
    margin: auto;
    padding: 20px;
    margin-top: 40px;
    margin-bottom: 20px;
    height: 50px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    max-width: 1200px;
    overflow: hidden;
    img {
      width: 24px;
      height: 24px;
      cursor: pointer;
    }
    div {
      max-width: 1100px;
      overflow-x: scroll;
      white-space: nowrap;
      margin: 10px;
      &::-webkit-scrollbar {
        display: none;
      }
      /* Hide scrollbar for Chrome, Safari and Opera */
      -ms-overflow-style: none;
      /* IE and Edge */
      scrollbar-width: none;
      /* Firefox */
      scroll-behavior: smooth;
      button {
        background-color: #e9ecef;
        cursor: pointer;
        border: none;
        /* background-color: white; */
        color: #666666;
        padding: 5px 15px;
        font-size: 16px;
        font-weight: 400;
        &:hover {
          color: black;
        }
      }
    }
  }
  main {
    background-color: #e9ecef;
    padding: 15px;
    section#attraction-section {
      margin: auto;
      max-width: 1200px;
      display: grid;
      grid-template-columns: repeat(4, minmax(270px, 1fr));
      grid-auto-rows: 242px;
      grid-gap: 30px;
      justify-content: center;
      div.attraction {
        border-radius: 5px;
        border: 1px solid #e8e8e8;
        box-shadow: 5px 5px 8px rgba(0, 0, 0, 0.2),
          -5px -5px 8px rgba(255, 255, 255, 0.9);
        transition: 0.3s;
        &:hover {
          transform: scale(1.03, 1.03);
          box-shadow: 6px 6px 6px rgba(0, 0, 0, 0.3),
            -6px -6px 6px rgba(255, 255, 255, 1);
          cursor: pointer;
        }
        a {
          display: block;
          text-decoration: none;
        }
        figure {
          position: relative;
          border-radius: 5px;
          height: 197px;
          img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-top-left-radius: 5px;
            border-top-right-radius: 5px;
          }
          figcaption {
            display: block;
            width: 100%;
            height: 40px;
            position: absolute;
            bottom: 0;
            background-color: #00000099;
            color: white;
            font-size: 14px;
            padding: 10px;
          }
        }
        div.attraction-tag {
          display: flex;
          flex-direction: row;
          flex-wrap: wrap;
          justify-content: space-between;
          align-items: center;
          height: 45px;
          p {
            font-size: 14px;
            padding: 10px;
            color: #757575;
          }
        }
      }
    }
  }
  div#observer-target {
    height: 1px;
  }
  footer {
    background-color: #757575;
    height: 100px;
    margin-top: 40px;
    p {
      color: white;
      font-size: 14px;
    }
    display: grid;
    place-content: center;
  }
}

@media (max-width: 1200px) {
  body {
    main {
      section#attraction-section {
        grid-template-columns: repeat(3, minmax(270px, 1fr));
      }
    }
  }
}
@media (max-width: 900px) {
  body {
    main {
      section#attraction-section {
        grid-template-columns: repeat(2, minmax(270px, 1fr));
      }
    }
  }
}
@media (max-width: 600px) {
  body {
    main {
      section#attraction-section {
        grid-template-columns: repeat(1, minmax(270px, 1fr));
        grid-auto-rows: 280px;
        div.attraction {
          figure {
            position: relative;
            height: 235px;
            img {
              height: 235px;
            }
            figcaption {
              position: absolute;
              bottom: 0;
            }
          }
        }
      }
    }

    section#hero {
      background-size: 1400px;
      background-position: center bottom;
    }
  }
}
@media (max-width: 500px) {
  body {
    section#hero {
      div {
        search {
          input {
            width: 260px;
          }
        }
      }
    }
  }
}
