/* 共通樣式 */

:root {
  --main-color: #000;
  --sub-color: #e47140;
  --gray-color: #727272;
}

* {
  letter-spacing: 1px;
  font-weight: 400;
  font-family: "Noto Sans TC", sans-serif !important;
}

p,
li {
  line-height: 32px;
  overflow-wrap: break-word;
  word-break: break-word;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  overflow-y: scroll;
}

.btn:focus,
.form-control:focus {
  border-color: var(--main-color) !important;
  box-shadow: none !important;
  outline: 0 none !important;
}

.badge {
  font-weight: 400 !important;
}

.navbar {
  background-color: var(--main-color) !important;

  .navbar-collapse {
    flex-grow: 0;
  }

  .navbar-brand {
    font-size: 50px;
    font-weight: 500;
    font-family: "Roboto Slab", serif !important;
    color: var(--sub-color);
    transition: all 0.3s;

    @media (max-width: 575px) {
      padding-left: 1rem;
      font-size: 35px;
    }

    &:hover {
      opacity: 0.9;
      color: var(--sub-color);
    }
  }
}

.blog-post-tags {
  .badge {
    background-color: var(--main-color);

    &:hover {
      color: var(--main-color);
      background-color: #fff;
      border: 1px solid var(--main-color);
    }
  }
}

.blog-post-title {
  margin: 10px 0 20px;

  a {
    font-size: 40px;
    font-weight: 500;

    @media (max-width: 575px) {
      font-size: 35px;
    }
  }
}

.pagination {
  justify-content: center;

  .page-link {
    color: var(--main-color);
  }

  .page-item.active .page-link {
    z-index: 3;
    color: #fff;
    background-color: var(--main-color);
    border-color: var(--main-color);
  }
}

.post-title {
  a {
    color: #000;
    text-decoration: none;
    font-size: 22px;
    font-weight: 500;
  }
}

.post-block-title {
  margin-bottom: 25px;
  position: relative;
  font-size: 20px;

  &::after {
    position: absolute;
    z-index: -10;
    top: 30px;
    left: 0;
    width: 100%;
    height: 0px;
    content: "";
    border-bottom: 1px solid var(--sub-color);
    bottom: 5px;
  }

  span {
    padding: 5px 20px;
    // font-weight: 500;
    color: #fff;
    font-weight: 300;
    background: var(--sub-color);
  }
}

.news-info {
  margin-top: 10px;
  line-height: 20px;

  a {
    padding: 0.1rem .3rem .2rem;
    font-size: 12px !important;
    font-weight: 500;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s;
    background-color: #7a7a7a;
    border-radius: 5px;

    &:hover {
      opacity: 0.8;
    }
  }

  small {
    color: var(--gray-color);
  }
}

.news-thumbnail {
  height: 100%;
  object-fit: cover;
}

// 文字省略
.line-clamp {
  max-width: 150px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-depiction {
  // max-width: 350px;
  margin: 10px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 26px;

  a {
    color: #7a7a7a;
    text-decoration: none;
  }
}

.top-btn {
  position: fixed;
  bottom: 15px;
  right: 15px;
  z-index: 10;
  opacity: 0; // scrollTop = 0
  transition: all 0.5s;

  button {
    border: none;
    background: var(--sub-color);
    border-radius: 100px;
    width: 55px;
    height: 55px;
  }
}

.show {
  opacity: 1; // scrollTop > 100
}

.blog-header {
  .nav-item {
    padding: 0 0.3rem;

    @media (max-width: 575px) {
      padding: 0 1rem;
    }
  }
}

/* sidebar.html Start */

.news-sidebar {
  position: sticky;
  top: 15px;

  .news-featured {
    position: unset;
  }
}

.search-btn {
  border: 1px solid var(--main-color) !important;

  svg {
    color: var(--main-color);
  }

  &:hover {
    background-color: var(--main-color) !important;

    svg {
      color: #fff;
    }
  }
}

.tags {
  margin: 0 5px 5px 0;
  padding: 7px 10px !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  color: var(--main-color) !important;
  border: 1px solid var(--main-color) !important;

  &:hover {
    color: #fff !important;
    background-color: var(--main-color);
  }
}

/* sidebar.html End */

/* single.html Start */

.blog-post.content {
  .content {
    padding-bottom: 3rem;

    img {
      max-height: 500px;
      object-fit: contain;
    }
  }

  .toc-container {
    padding: 1.5rem;
    margin: 3rem 0;
    background: #f9f9f9;
    border: 1px solid #aaa;
    border-radius: 5px;

    ul {
      margin-bottom: 0;
      list-style: disc;

      a {
        color: var(--sub-color);
        text-decoration: none;
      }
    }

    .title {
      display: block;
      margin-left: 1rem;
      margin-bottom: 0.5rem !important;
      font-size: 1.25rem;
      color: #000;
    }
  }

  h2 {
    padding-left: 1rem;
    margin: 5rem 0 1.5rem;
    border-left: 7px solid var(--sub-color);
  }

  h4 {
    margin-top: 3rem;
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 32px;

    a {
      padding: 5px 8px;
      margin-right: 3px;
      border: 1px solid #000;
      border-radius: 5px;
      font-size: 14px;

      &:hover {
        color: #fff !important;
      }
    }
  }
}

.back-link {
  color: #000;
  display: block;
  text-align: center;
  text-decoration: none;
  transition: all 0.3s;

  &:hover {
    opacity: 0.7;
  }
}

/* single.html End */

/* content.html Start */

.news-main {
  height: 100%;
  overflow: hidden;

  a {
    text-decoration: none;
  }

  .title-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    padding: 1rem;
    background: linear-gradient(to top,
        rgba(0, 0, 0, 0.95) 0%,
        rgba(0, 0, 0, 0.7) 50%,
        rgba(0, 0, 0, 0.3) 80%,
        transparent 100%);

    a,
    h2,
    small {
      color: #fff;
      letter-spacing: 1px;
    }

    h2 {
      line-height: 1.5;

      a {
        font-weight: 500;
        font-size: 1.25rem;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2; // 顯示兩行
        overflow: hidden;
        text-overflow: ellipsis;
        word-break: break-word;

        @media (max-width: 991px) {
          font-size: 1.25rem;
        }
      }
    }

    .badge-link {
      display: inline-block;
      padding: 1px 20px;
      margin-bottom: 10px;
      background-color: var(--sub-color);
      font-weight: 500;
    }
  }

  .post-title {
    a {
      font-size: 34px;
    }
  }

  img {
    height: 100%;
    object-fit: cover;
  }

  // .main-img {
  //   @media (max-width: 991px) {
  //     height: 50vw;
  //   }
  // }

  .news-info {
    a {
      font-size: 16px;
    }
  }
}

// .news-main {
//   height: 100%;
//   overflow: hidden;

//   .post-title {
//     a {
//       font-size: 34px;

//       @media (max-width: 991px) {
//         font-size: 22px;
//       }
//     }
//   }

//   img {
//     height: 100%;
//     object-fit: cover;
//   }

//   .news-info {
//     a {
//       font-size: 16px;
//     }
//   }
// }

/* content.html End */

/* focus.html Start */

.focus-content {
  position: sticky;
  top: 20px;
}

.focus-content,
.news-featured {
  img {
    width: 100%;
    height: 5vw;
    object-fit: cover;

    @media (max-width: 991px) {
      height: 15vw;
    }
  }

  .post-title {
    // 超過則省略
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-break: after-white-space;
    font-size: 1.125rem;
  }
}

/* focus.html End */

/* recent.html Start */

.recent-content {
  .news-list {
    margin: 0;

    li {
      margin: 15px 0;

      img {
        width: 140px;
        height: 105px;
        object-fit: cover;
      }

      small {
        display: block;
      }

      .news-info {
        margin-top: 0px;
      }
    }

    li:last-child {
      margin: 0;
    }
  }
}

/* recent.html End */

/* news-tab.html Start */

.tab-category {
  .nav-link {
    color: var(--main-color);
    font-weight: 500;
  }

  .nav-pills .nav-link.active,
  .nav-pills .show>.nav-link {
    color: var(--sub-color);
    background-color: var(--main-color);
  }
}

.tab-content {
  .bg-img {
    position: relative;
    height: 370px;
    // 設置背景混和模式為相乘模式
    background-blend-mode: multiply;
    background-size: cover;
    background-position: center center;
    cursor: pointer;

    @media (max-width: 991px) {
      height: 50vw;
    }

    section {
      padding: 10px 25px;
      position: absolute;
      bottom: 0;
      color: #fff;

      a {
        color: #fff;
        text-decoration: none;
      }

      small {
        font-size: 12px;
      }
    }
  }

  .post-title {
    line-height: 1;
  }

  .col-5 {
    img {
      width: 100%;
      height: 150px;
    }
  }
}

/* news-tab.html End */

/* news-all.html Start */

.news-all {
  .post-title {
    margin: 5px auto;

    a {
      font-size: 1.25rem;

      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2; // 顯示兩行
      overflow: hidden;
      text-overflow: ellipsis;
      word-break: break-word;
    }
  }

  .news-info {
    a {
      font-size: 14px;
    }
  }

  hr {
    margin: 1.5rem 0;
  }

  img {
    width: 100%;
    height: 12vw;
    object-fit: cover;

    @media (max-width: 991px) {
      height: 20vw;
    }

    @media (max-width: 575px) {
      height: 50vw;
    }
  }

  .line {
    padding: 0 12px;
  }

  // .first-img {
  //   height: 50vh;
  //   object-fit: cover;
  // }
}

/* news-all.html End */

/* news-featured.html Start */

.news-featured {
  position: sticky;
  top: 20px;

  .post-title {
    a {
      font-size: 18px;
    }
  }
}

/* news-featured.html End */

/* news-video.html Start */

.news-video,
.local-video {
  .post-block-title {
    span {
      display: block;
      width: 100%;
      text-align: center;
    }
  }

  .post-title {
    a {
      font-size: 18px;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      text-overflow: ellipsis;
    }
  }

  .news-info {
    a {
      font-size: 14px;
    }
  }
}

/* news-video.html End */

.local-video {
  img {
    width: 100%;
    height: 140px;
  }
}

.news-main {
  .left-content {
    height: 30vh;
  }

  .right-content {
    height: 56.6vh;
  }

  .bottom-content {
    height: 35vh;
  }

  .left-content,
  .right-content,
  .bottom-content {
    @media (max-width: 991px) {
      height: 50vw;
    }
  }

  // /* 限制輪播高度 */
  // .video-swiper {
  //   height: 650px;
  //   /* 固定高度，讓 vertical 不會跑版 */
  //   overflow: hidden;

  //   /* 確保 slide 高度自適應 */
  //   .swiper-slide {
  //     height: auto !important;

  //     .cover-img {
  //       height: auto;

  //     }
  //   }
  // }
}

.tags-list {
  .cover-img {
    width: 100%;
    height: 230px;
    object-fit: cover;
    object-position: 0 25%;
  }
}

.feature-article {
  .float-right {
    float: right;
    max-width: 60%;
    margin: 1rem 0 1rem 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  .float-left {
    float: left;
    max-width: 60%;
    margin: 1rem 1.5rem 0 0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  .float-right,
  .float-left {
    @media (max-width: 768px) {
      float: none;
      display: block;
      max-width: 100%;
      margin: 1rem auto;
      /* 圖片置中 */
    }
  }

  figure {
    margin: 2rem 0;
    text-align: center;
  }

  figure img {
    width: 100%;
    height: auto;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  }

  h1 {
    font-size: 3rem;
    margin: 3rem auto;
    padding-top: 1.5rem;
    border-top: 12px solid var(--sub-color);
  }

  h2 {
    padding: 1.5rem 0;
    margin: 2.5rem auto;
    border-top: 1px solid var(--sub-color);
    border-bottom: 1px solid var(--sub-color);
    text-align: center;
    color: var(--sub-color);
    font-size: 2.5rem;
    font-weight: 500;
    // position: relative;
    // display: inline-block;
    // line-height: 1.2;
    // isolation: isolate;

    // &::after {
    //   content: "";
    //   position: absolute;
    //   left: -10px;
    //   right: -2px;
    //   bottom: -4px;
    //   height: 20px;
    //   background: rgba(255, 234, 0, 0.4);
    //   transform: skewX(-30deg);
    //   transform-origin: left bottom;
    //   z-index: -1;
    //   pointer-events: none;
    // }
  }

  h3,
  h4 {
    margin-bottom: 1rem;
    color: var(--sub-color);
    line-height: 1.5;
  }

  h3 {
    font-size: 1.625rem;
  }

  h4 {
    font-size: 1.5rem;
  }

  hr {
    margin: 3rem 0;
  }

  .feature-body {

    div,
    p {
      margin: 1.5rem 0 0;
      line-height: 2;
      font-size: 1.05rem;
      color: #222;
    }
  }

  .lead {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    margin-bottom: 1.5rem;
    background-color: #f8f8f8;
    border-left: 5px solid var(--sub-color);
    border: 2px dotted #ccc;
  }

  ul {
    list-style: disc;

    li {
      margin-top: .5rem;
    }
  }

  ol {
    list-style: auto;
  }

  b,
  strong {
    font-weight: 700;
  }

  .toc {
    margin: 3rem 0;
    background: #f9f9f9;
    padding: 1rem 1.5rem;
    border-left: 4px solid var(--sub-color);
    font-size: 0.95rem;

    .toc-title {
      font-size: 1.25rem;
      font-weight: bold;
      margin: 1rem 0;
    }

    ul {
      list-style: none;
      padding-left: 0;

      li {
        margin: 0.15rem 0;
        font-size: 1rem;

        a {
          text-decoration: none;
          color: var(--sub-color);

          &:hover {
            text-decoration: underline;
          }
        }

        // 解決空 li 造成的空白
        &:empty {
          display: none;
        }
      }
    }
  }

  .quote-accent {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 1rem 0;
    font-size: 2rem;
    font-weight: 600;
    border-top: 4px solid var(--sub-color);

    &::before {
      content: "“";
      flex: 0 0 auto;
      font-family: Georgia, "Times New Roman", serif;
      font-size: 2.8em;
      line-height: 0.6;
      color: var(--sub-color);
      margin-top: 0.1em;
    }

    &>p {
      margin: 0;
    }
  }
}