/* Color Themes */
:root {
  --header-height: 0px;
  --announcement-height: 0px;
  --top-offset: 0px;
  /* Primitives */
  --base-white: #fff;
  --base-black: #000;

  --teal-900: #239092;
  --teal-700: #81c0c1;
  --teal-500: #addedf;
  --teal-300: #d2eceb;
  --teal-100: #eff8f8;
  --teal-alpha-a500: rgba(173, 222, 223, 0.5);

  --gray-900: #363c45;
  --gray-800: #4E535B;
  --gray-700: #666B72;
  --gray-600: #82868C;
  --gray-500: #9a9da2;
  --gray-400: #afb1b5;
  --gray-300: #c3c4c7;
  --gray-200: #d7d8da;
  --gray-100: #ebebec;
  --gray-50: #f9f9f9;

  --gray-alpha-white-a90: rgba(255, 255, 255, 0.9);
  --gray-alpha-white-a80: rgba(255, 255, 255, 0.8);
  --gray-alpha-white-a70: rgba(255, 255, 255, 0.7);
  --gray-alpha-white-a60: rgba(255, 255, 255, 0.6);
  --gray-alpha-white-a50: rgba(255, 255, 255, 0.5);
  --gray-alpha-white-a40: rgba(255, 255, 255, 0.4);
  --gray-alpha-white-a30: rgba(255, 255, 255, 0.3);
  --gray-alpha-white-a20: rgba(255, 255, 255, 0.2);
  --gray-alpha-white-a10: rgba(255, 255, 255, 0.1);

  --gray-alpha-dark-a90: rgba(54, 60, 69, 0.9);
  --gray-alpha-dark-a80: rgba(54, 60, 69, 0.8);
  --gray-alpha-dark-a70: rgba(54, 60, 69, 0.7);
  --gray-alpha-dark-a60: rgba(54, 60, 69, 0.6);
  --gray-alpha-dark-a50: rgba(54, 60, 69, 0.5);
  --gray-alpha-dark-a40: rgba(54, 60, 69, 0.4);
  --gray-alpha-dark-a30: rgba(54, 60, 69, 0.3);
  --gray-alpha-dark-a20: rgba(54, 60, 69, 0.2);
  --gray-alpha-dark-a10: rgba(54, 60, 69, 0.1);
  --gray-alpha-dark-a5: rgba(54, 60, 69, 0.03);

  --gray-alpha-gray-a90: rgba(195, 196, 199, 0.9);
  --gray-alpha-gray-a80: rgba(195, 196, 199, 0.8);
  --gray-alpha-gray-a70: rgba(195, 196, 199, 0.7);
  --gray-alpha-gray-a60: rgba(195, 196, 199, 0.6);
  --gray-alpha-gray-a50: rgba(195, 196, 199, 0.5);
  --gray-alpha-gray-a40: rgba(195, 196, 199, 0.4);
  --gray-alpha-gray-a30: rgba(195, 196, 199, 0.3);
  --gray-alpha-gray-a20: rgba(195, 196, 199, 0.2);
  --gray-alpha-gray-a10: rgba(195, 196, 199, 0.1);

  /* Common alpha tokens used in CSS */
  --white-a70: rgba(255, 255, 255, 0.7);
  --black-a5: rgba(0, 0, 0, 0.05);
  --transition-image-hover: 150ms;

  --yellow-500: #fdd273;

  --red-900: #CC0A06;
  --red-700: #ED5555;
  --red-500: #FAADAD;
  --red-300: #FFE4E3;
  --red-100: #FFF2F1;

  --green-900: #207C34;
  --green-700: #3AA262;
  --green-500: #92C9A1;
  --green-300: #D4F2DE;
  --green-100: #EDFAF0;

  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
}

.overlay-max-width-sm,
.overlay-max-width-md,
.overlay-max-width-lg {
  max-width: 500px;
}

/* Layout */
/* 讓 footer 一定貼在畫面底部：body 撐滿至少一個 viewport 高度，
   main 吃掉剩餘空間，footer 維持自身高度不被壓縮。 */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body>main {
  flex: 1 0 auto;
}

.custom-footer {
  flex-shrink: 0;
}

.template-breadcrumbs {
  padding: 24px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

/* 手動接在 {{breadcrumbs}} 後面的當前頁面（例如文章標題），
   因為 breadcrumbs helper 本身不包含當前頁面。 */
.breadcrumb-current {
  font-size: 13px;
  color: var(--gray-900);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 450px;
}

.breadcrumb-current::before {
  content: "/";
  margin: 0 4px;
  color: var(--gray-600);
}

.custom-category-container {
  width: 100%;
}

span.excerpt {
  margin: 12px 0 0;
  text-align: left;
}

/* Header */
.custom-header {
  background-color: var(--teal-300);
  padding: 16px 20px;
  display: flex;
  justify-content: center;
}

.custom-header-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.custom-header-container,
.custom-header-logo,
.custom-header-logo a,
.custom-header-logo img {
  width: 100%;
}

.custom-header-logo {
  width: 160px;
  height: 40px;
  aspect-ratio: 4/1;
}

.custom-header-logo a {
  display: block;
}

.custom-header-search {
  position: relative;
  width: 100%;
  max-width: 400px;
}

.custom-header-container .header-search {
  border: none
}

.custom-header-container .header-search .search-icon {
  width: 20px;
  height: 20px;
}

/* Hides the header search on specific pages (class added in document_head.hbs) */
.hide-header-search .custom-header-search {
  display: none;
}

/* Hides the footer on custom pages (class added in document_head.hbs) */
.hide-footer .custom-footer {
  display: none;
}

/* ---------- */

/* Footer */
.custom-footer {
  background-color: var(--teal-300);
  padding: 40px 0;
  display: flex;
  justify-content: center;
}

.footer-container,
.footer-description {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

}

.footer-container {
  gap: 24px;

}

.footer-description {
  gap: 8px;
  padding: 0 24px;
}

.footer-padding {
  width: 15px;
}

.footer-cards {
  display: flex;
  gap: 24px;
  width: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 0 15px;
}

.footer-cards::-webkit-scrollbar {
  display: none;
}

.footer-card {
  flex: 0 0 275px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background-color: var(--base-white);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
}

.footer-card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--gray-50);
  color: var(--gray-900);
}

.footer-card-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 8px 24px;
  border-radius: 999px;
  background-color: var(--teal-500);
  text-decoration: none;
  border: none;
  box-sizing: border-box;
  font-weight: 700;
}

.footer-card-button:hover {
  background-color: var(--teal-300);
  text-decoration: none;
  color: var(--gray-900);
}

/* ---------- */

/* Home Page */
.home-page {
  display: flex;
  justify-content: center;
}

.home-page-overlay {
  padding: 24px 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.home-page-section {
  padding: 24px;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 24px;
}

.home-page-section-header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

.header-description {
  text-align: center;
  color: var(--gray-700);
}

.home-page-section-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.home-page-section-content.accessories-section {
  margin-top: 16px;
}

.home-page-section-content .section-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  /* gap: 16px; */
  width: 100%;
}

.home-page-section-content .w-1\/2.section-card-link {
  width: calc(50% - 8px);
}

.home-page-section-content .w-1\/3.section-card-link {
  width: calc(33.333% - 6px);
}

.home-page-section-content .section-card-link:hover {
  text-decoration: none;
}

.home-page-section-content .section-card {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #EFEFEF;
  border-radius: 12px;
  padding: 0 16px 24px 16px;
  text-align: center;
}

.home-page-section-content .section-card-image {
  width: 100%;
  /* max-width: 280px; */
  height: auto;
}

.home-page-section-content .card-name {
  font-weight: 700;
}

.home-page-section-content.grid-container {
  display: initial;
}

.home-page-section-content.grid-container .section-cards {
  display: grid;
  grid-template-columns: repeat(2, calc(50% - 6px));
  grid-template-rows: repeat(2, calc(50% - 6px));
  gap: 12px;
}

.home-page-section-content .section-card.category-general-topics {
  padding: 16px 8px;
  gap: 8px;
  justify-content: flex-start;
}

.home-page-section-content .section-card-icon {
  width: 40px;
  height: 40px;
}

.popular-articles .article-item {
  display: flex;
  flex-direction: column;
}

.popular-articles .article-item:not(:last-child)::after {
  content: "";
  display: block;
  width: 100%;
  height: 1px;
  background-color: var(--gray-200);
  margin: 16px 0;
}

.popular-articles .custom-font-h3 {
  text-align: left;
}

.popular-articles .learn-more {
  color: var(--teal-900);
}

.custom-article-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Category Template */
.custom-category-name {
  padding: 24px;
  text-align: center;
}

.template-breadcrumbs .breadcrumbs {
  margin: 0;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.template-breadcrumbs .breadcrumbs li+li::before {
  content: "/";
  margin: 0 4px;
}

.template-breadcrumbs .breadcrumbs li a:visited,
.template-breadcrumbs .breadcrumbs a {
  color: var(--gray-900);
}

.custom-category-content {
  padding: 24px 24px 48px 24px;
}

.custom-category-template,
.custom-section-template,
.custom-article-template {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.custom-category-template .custom-category-cards {
  padding: 0 24px 48px 24px;
  display: grid;
  grid-template-columns: repeat(2, calc(50% - 8px));
  grid-template-rows: repeat(2, calc(50% - 8px));
  gap: 16px;
}

.custom-category-card {
  background-color: #EFEFEF;
  border-radius: 12px;
  padding: 16px;
  min-height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-weight: 700;
}

.custom-category-card:hover {
  text-decoration: none;
}

/* ---------- */

/* Sections Template */
.custom-section-template .custom-section-name {
  padding: 24px;
  text-align: center;
}

.custom-section-cards {
  padding: 0 24px 48px 24px;
}

.custom-section-cards .article-list-item:before {
  content: "";
  display: block;
  width: 100%;
  height: 1px;
  background-color: var(--gray-200);
  margin: 24px 0;
}

.custom-section-cards .article-list-item {
  padding: 0;
}

.article-list-item .article-list-link:hover {
  text-decoration: none;
}

.article-title.custom-font-h3 {
  text-align: left;
}

/* ---------- */

/* Article Template */
.custom-article-template {
  padding: 24px 0;
}

.custom-article-template .article-title,
.custom-article-template .custom-article-body {
  padding: 24px;
}

.custom-article-template p {
  margin: 0
}

.custom-article-template .article-votes {
  border: none;
  padding: 24px;
  width: 100%;
}

.custom-article-template .article-votes-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px 0;
}

.custom-article-template .article-vote {
  margin: 0;
  padding: 8px 4px;
  line-height: normal;
  min-width: 120px;
  justify-content: center;
}

.custom-article-template .article-vote-up {
  background-color: var(--gray-900);
  color: var(--base-white);
}

.custom-article-template .button.button-primary:focus {
  opacity: 0.8;
}

/* ---------- */

/* Custom content block */
.download-app-block {
  padding: 60px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.download-app-block .title {
  text-align: center;
  margin: 0;
}

.download-app-block .description {
  display: block;
  text-align: center;
}

.download-app-block .img-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 16px;
}

.download-app-block .img-list .logo-icon {
  display: flex;
  justify-content: center;
}

.download-app-block .img-list .logo-icon,
.download-app-block .img-list .iso-icon,
.download-app-block .img-list .android-icon {
  margin: 0;
}

.download-app-block .apps {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.download-app-block .img-list .iso-icon,
.download-app-block .img-list .android-icon {
  width: calc(50% - 6px);
}

.coverage-block,
.related-articles {
  /* margin-top: 24px; */
  padding: 48px 24px;
  display: flex;
  justify-content: center;
  background-color: var(--gray-50);
  width: 100%;
}

.related-articles[hidden] {
  display: none;
}

.coverage-block .coverage-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.coverage-block .coverage-content .title,
.coverage-block .coverage-content .description,
.related-articles__inner .related-articles__title {
  text-align: center;
}

.coverage-block .registration-btn {
  background-color: #4A5565;
  text-align: center;
  border-radius: 999px;
  padding: 8px 20px;
  color: var(--base-white);
  font-weight: 600;
}

.divider {
  width: 100%;
  margin: 24px 0;
  padding: 0 24px;
  display: flex;
  justify-content: center;
}

.divider::after {
  content: "";
  display: block;
  width: 100%;
  height: 1px;
  background-color: var(--gray-500);
}

.more-articles {
  padding: 24px;
}

.more-articles .more-articles-list,
.related-articles .related-articles__list {
  margin-top: 32px;
}

.more-articles .more-articles-list li a {
  display: block;
  margin-bottom: 16px;
  font-weight: 500;
  text-decoration: underline;
}

.related-articles .related-articles__list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.related-articles .related-articles__item .related-articles__item-title {
  line-height: normal;
  padding: 0 16px;
}

.related-articles .related-articles__item .related-articles__item-text {
  line-height: normal;
  padding: 12px 16px 0;
}

.related-articles__item-more {
  color: var(--teal-900);
}

.related-articles .related-articles__item:not(:last-child)::after {
  content: "";
  display: block;
  width: 100%;
  height: 1px;
  background-color: var(--gray-200);
  margin: 24px 0;
}

/* ---------- */

/* Custom search result page */
.search-results-container {
  /* padding: 24px; */
}

.search-results-container .search-results-heading {
  padding: 24px;
  text-align: center;
}

.search-results-container .search-results {
  padding: 0 24px 48px 24px;
}

.search-results-container .results-list li:before {
  content: "";
  display: block;
  width: 100%;
  height: 1px;
  background-color: var(--gray-200);
  margin: 24px 0;
}


/* ---------- */
/* pagination */
.pagination {
  margin: 0 0 60px 0;
}

.pagination .pagination-first a,
.pagination .pagination-prev a,
.pagination .pagination-next a,
.pagination .pagination-last a {
  padding: 4px 12px;
  min-height: 28px;
}

.pagination-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* 1. 四顆按鈕的內容都置中 */
.pagination-first-link,
.pagination-prev-link,
.pagination-next-link,
.pagination-last-link {
  display: flex;
  align-items: center;
  justify-content: center;
}

.pagination-first-link:hover span,
.pagination-prev-link:hover span,
.pagination-next-link:hover span,
.pagination-last-link:hover span {
  color: var(--base-white);
}

.custom-search-results-template {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Get Started Page */
.get-started-page {
  width: 100%;
  min-height: 100%;
}

.get-started-page .banner-img {
  width: 100%;
}

.get-started-page .content {
  background-color: var(--base-white);
  border-radius: 20px 20px 0 0;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
}

.get-started-page .content .description {
  font-weight: 500;
}

.get-started-page .content .content-header {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.get-started-page .content-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.get-started-page .content-actions .action-btn {
  border: 1px solid var(--gray-900);
  border-radius: 16px;
  padding: 12px;
  width: 100%;
  max-width: 400px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.get-started-page .content-actions .btn-image {
  width: 96px;
  height: auto;
}

.get-started-page .content-actions .action-btn .btn-text{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.get-started-page .content-actions .action-btn .btn-text h4{
font-weight: 500;
}

.get-started-page .content-actions .action-btn .btn-text h4::after{
content: "\25B6"; 
margin-left: 8px;
}

.get-started-page .btn-link {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* width >= 600px */
@media screen and (min-width: 600px) {

  .overlay-max-width-sm,
  .overlay-max-width-md {
    max-width: 800px;
  }

  .overlay-max-width-lg {
    max-width: 1400px;
  }

  .home-page-section {
    gap: 32px;
  }

}

/* width >= 900px */
@media screen and (min-width: 900px) {
  .footer-cards {
    justify-content: center;
  }

  .home-page-section-header {
    gap: 24px;
  }

  .home-page-section-content .section-card.category-general-topics {
    padding: 24px 12px;
    gap: 24px;
  }

  .home-page-section-content .w-1\/2.section-card-link {
    width: calc(50% - 12px);
  }

  .home-page-section-content.accessories-section {
    margin-top: 60px;
  }

  .home-page-section-content.product-section {
    margin-top: 40px;
  }

  .home-page-section-content .section-card-icon {
    width: 60px;
    height: 60px;
  }

  .home-page-section-content {
    gap: 32px;
  }

  .divider {
    padding: 0;
  }

  .download-app-block,
  .coverage-block,
  .related-articles {
    padding: 100px 60px;
  }

  .related-articles .related-articles__list {
    margin-top: 60px;
  }

  .custom-article-template .article-votes {
    padding: 60px;
  }

  .custom-article-template .article-title,
  .custom-footer,
  .home-page-section,
  .more-articles {
    padding: 60px 0;
  }

  .custom-article-template .custom-article-body {
    padding: 0 0 60px 0;
  }

  .more-articles .more-articles-list {
    margin-top: 60px;
  }

  .download-app-block {
    gap: 24px;
  }

  span.excerpt {
    margin: 24px 0 0;
  }

  .related-articles .related-articles__item .related-articles__item-title {
    padding: 0 24px;
  }

  .related-articles .related-articles__item .related-articles__item-text {
    padding: 24px 24px 0;
  }

  .related-articles .related-articles__item:not(:last-child)::after,
  .popular-articles .article-item:not(:last-child)::after {
    margin: 32px 0;
  }

  .footer-description {
    gap: 16px;
  }

  .footer-container {
    gap: 40px;
  }
}

/* width >= 1024px */
@media screen and (min-width: 1024px) {
  .overlay-max-width-sm {
    max-width: 800px;
  }

  .overlay-max-width-lg,
  .overlay-max-width-md {
    max-width: 1400px;
  }

  .custom-header-container {
    flex-direction: row;
    justify-content: space-between;
  }

  .custom-header {
    padding: 24px 40px;
  }
}