.blog-articles {
  display: grid;
  grid-gap: 1rem;
}

@media screen and (min-width: 750px) {
  .blog-articles {
    grid-template-columns: 1fr 1fr;
  }

  .blog-articles > *:first-child,
  .blog-articles > *:nth-child(4),
  .blog-articles > *:last-child:nth-child(2),
  .blog-articles > *:last-child:nth-child(5) {
    grid-column: span 2;
    text-align: center;
  }
}

/* ====== Component article card ====== */
.articles-wrapper.grid {
  margin: 0 0 5rem 0;
}

@media screen and (min-width: 750px) {
  .articles-wrapper.grid {
    margin-bottom: 7rem;
  }
}

.articles-wrapper .article {
  max-width: 100%;
}

@media screen and (max-width: 749px) {
  .articles-wrapper .article {
    width: 100%;
  }
}

.article {
  display: flex;
  align-items: center;
}

.article.grid__item {
  padding: 0;
}

.article-card {
  background-color: rgba(var(--color-foreground), 0.04);
  align-self: flex-start;
  flex: 0 1 100%;
  display: flex;
  align-items: flex-start;
  height: 100%;
}

.grid--peek .article-card {
  box-sizing: border-box;
}

.article-card__info {
  padding: 3rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.article-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.article-content:hover .article-card__title {
  text-decoration: underline;
  text-underline-offset: 0.3rem;
}

.article-card__image {
  overflow: hidden;
}

.article-content img {
  transition: transform var(--duration-default) ease;
}

.article-content:hover img {
  transform: scale(1.07);
}

.article-card__image-wrapper > a {
  display: block;
}

.article-card__title {
  text-decoration: none;
  word-break: break-word;
}

.article-card__link.link {
  padding: 0;
}

.article-card__link {
  text-underline-offset: 0.3rem;
}

.article-content:hover .article-card__link {
  text-decoration-thickness: 0.2rem;
}

.article-card__header {
  line-height: 0.8;
  margin-bottom: 1.2rem;
}

.article-card__header h2 {
  margin: 0 0 0.2rem;
}

.article-card__header h2:only-child {
  margin: 0;
}

.article-card__header h2:not(:first-child) {
  margin-top: 1rem;
}

.article-card__header h2 + span {
  display: inline-block;
  margin-top: 0.4rem;
}

.article-card__footer {
  letter-spacing: 0.1rem;
  font-size: 1.4rem;
}

.article-card__footer:not(:last-child) {
  margin-bottom: 1rem;
}

.article-card__footer:last-child {
  margin-top: auto;
}

.article-card__link:not(:only-child) {
  margin-right: 3rem;
}

@media screen and (min-width: 990px) {
  .article-card__link:not(:only-child) {
    margin-right: 4rem;
  }
}


/* ====== Component article card END ====== */



/* ====== Section blog post ====== */
.article-template > *:first-child:not(.article-template__hero-container) {
  margin-top: 5rem;
}

.article-template__hero-container {
  max-width: 130rem;
  margin: 0 auto;
}

@media screen and (min-width: 1320px) {
  .article-template__hero-container:first-child {
    margin-top: 5rem;
  }
}

.article-template__hero-medium {
  height: 15.6rem;
}

.article-template__hero-large {
  height: 19rem;
}

@media screen and (min-width: 750px) and (max-width: 989px) {
  .article-template__hero-medium {
    height: 34.9rem;
  }

  .article-template__hero-large {
    height: 42.3rem;
  }
}

@media screen and (min-width: 990px) {
  .article-template__hero-medium {
    height: 54.5rem;
  }

  .article-template__hero-large {
    height: 66rem;
  }
}

.article-template header {
  margin-top: 4.4rem;
  margin-bottom: 2rem;
  line-height: 0.8;
}

@media screen and (min-width: 750px) {
  .article-template header {
    margin-top: 5rem;
  }
}

.article-template__title {
  margin: 0;
}

.article-template__title:not(:only-child) {
  margin-bottom: 1rem;
}

.article-template__link {
  font-size: 1.8rem;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
}

.article-template__link .icon-wrap {
  margin-right: 1rem;
  transform: rotate(180deg);
}

.article-template__content {
  margin-top: 3rem;
  margin-bottom: 3rem;
}

.article-template__social-sharing {
  margin-top: 3rem;
}

.article-template__social-sharing + header, .article-template__social-sharing + .article-template__content {
  margin-top: 1.5rem;
}

.article-template__comment-wrapper {
  margin-top: 5rem;
}

@media screen and (min-width: 750px) {
  .article-template__comment-wrapper {
    margin-top: 6rem;
  }
}

.article-template__comment-wrapper h2 {
  margin-top: 0;
}

.article-template__comments {
  margin-bottom: 5rem;
}

@media screen and (min-width: 750px) {
  .article-template__comments {
    margin-bottom: 7rem;
  }
}

.article-template__comments-fields {
  margin-bottom: 4rem;
}

.article-template__comments-comment {
  color: rgba(var(--color-foreground), 0.75);
  background-color: rgb(var(--color-background));
  margin-bottom: 1.5rem;
  padding: 2rem 2rem 1.5rem;
}

@media screen and (min-width: 750px) {
  .article-template__comments-comment {
    padding: 2rem 2.5rem;
  }
}

.article-template__comments-comment p {
  margin: 0 0 1rem;
}

.article-template__comment-fields > * {
  margin-bottom: 3rem;
}

@media screen and (min-width: 750px) {
  .article-template__comment-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-column-gap: 4rem;
  }
}

.article-template__comment-warning {
  margin: 2rem 0 2.5rem;
}

@media screen and (min-width: 990px) {
  .article-template__comments .pagination-wrapper {
    margin: 5rem 0 8rem;
  }
}

  /* ====== Section blog post END ====== */
/* =========================================
   Bling：部落格列表縮圖統一尺寸（無黑框）
   貼到 blog.css 最底部
   ========================================= */

/* 1) 取消精選跨欄：避免第1篇/第4篇等特別大 */
@media screen and (min-width: 750px) {
  .blog-articles > *:first-child,
  .blog-articles > *:nth-child(4),
  .blog-articles > *:last-child:nth-child(2),
  .blog-articles > *:last-child:nth-child(5) {
    grid-column: auto !important;
    text-align: left !important;
  }
}

/* 2) 固定「圖片框」比例，讓每張縮圖區塊一樣大 */
.blog-articles .article-card__image.media{
  width: 100%;
  aspect-ratio: 4 / 3; /* ✅ 想要正方形：改成 1 / 1 */
  overflow: hidden;
  position: relative;

  /* ✅ 空白區不顯示黑框：跟網站背景同色（通常是白） */
  background: rgb(var(--color-background)) !important;
}

/* 3) Bling 的 .media 常用 ::before 撐高度，這裡關掉以免打架 */
.blog-articles .article-card__image.media::before{
  content: none !important;
}

/* 4) 圖片填滿圖片框：不裁切完整顯示（會有留白但不會黑框） */
.blog-articles .article-card__image.media > img,
.blog-articles .article-card__image.media > picture > img{
  width: 100% !important;
  height: 100% !important;
  display: block;

  object-fit: contain !important;   /* ✅ 不裁切 */
  object-position: center !important;
}
/* 平板：2 欄（可留著） */
@media screen and (min-width: 750px) {
  .blog-articles{
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* 桌機：3 欄 */
@media screen and (min-width: 990px) {
  .blog-articles{
    grid-template-columns: repeat(4, 1fr) !important;
  }
}
/* =========================
   Blog 列表：文字區塊變矮、底部空白變少
   ========================= */

/* 1) 卡片不要被撐到同一排一樣高（減少底部空白） */
.blog-articles{
  align-items: start !important;
}
.blog-articles .blog-articles__article{
  align-self: start !important;
}
.blog-articles .article-card{
  height: auto !important;
}

/* 2) 文字區塊 padding 變小（原本 3rem 太高） */
.blog-articles .article-card__info{
  padding: 1.2rem 1.6rem !important;  /* 想更矮可改 1rem 1.2rem */
}

/* 3) 標題/資訊區的上下距離縮小 */
.blog-articles .article-card__header{
  margin-bottom: 0.6rem !important;
  line-height: 1.15 !important;
}
.blog-articles .article-card__header h2{
  margin: 0 0 0.2rem !important;
}

/* 4) 摘要文字限制行數（最有效降低高度） */
.blog-articles .article-card__info p{
  margin: 0.6rem 0 0 !important;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;      /* 想更矮：改 2 */
  overflow: hidden;
}

/* 5) 底部資訊（日期/分類等）不要被推到底，減少空白 */
.blog-articles .article-card__footer:last-child{
  margin-top: 0.8rem !important;  /* 原本是 auto 會把底部撐出空白 */
}