/* 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;
}

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

/* 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;
  box-sizing: border-box;
}

.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-700);
}

.custom-article-content {
  width: 100%;
}

/* 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;
}

.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: 24px 0;
}

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

.download-app-block .description {
  display: block;
  text-align: center;
  margin-top: 12px;
}

.download-app-block .img-list {
  margin-top: 32px;
}

.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 img,
.download-app-block .img-list .android-icon img {
  width: 100%;
  max-width: 160px;
}

.coverage-block {
  margin-top: 40px;
  margin-left: -24px;
  margin-right: -24px;
  padding: 24px;
  background-color: var(--gray-50);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

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

.coverage-block .description {
  text-align: center;
}

.coverage-block .registration-btn {
  background-color: #4A5565;
  max-width: 180px;
  text-align: center;
  border-radius: 999px;
}

.coverage-block .registration-btn a {
  display: block;
  color: var(--base-white);
  text-decoration: none;
  padding: 8px 24px;
  font-weight: 700;
}

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

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

.more-articles {
  padding: 24px;
}

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

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

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

/* 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;
  }
}

/* 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;
  }
}