/* ============================================================================
 * common/pages/post.css — 跨主題共用貼文頁面（列表 + 詳情）
 * ============================================================================
 *
 * 用途：
 *   提供 6 個前台主題共用的貼文頁面樣式 baseline：貼文列表頁
 *   （posts/index）的舊版與新版兩種卡片佈局、貼文詳情頁
 *   （posts/show）的標題、內文、章節標題、區段標題等。
 *
 * 設計意圖：
 *   - common/pages/post.css = default baseline（未來所有網站的基礎標準）
 *   - themes/default/pages/post.css 故意保持空殼（default 不需覆寫自己的 baseline）
 *   - 其他主題透過 themes/{theme}/pages/post.css 對 baseline 做差異化覆寫
 *
 * 內容索引：
 *   區段 1: 舊版列表卡片（.blog-img / .blog-title / .blog-desc / .blog-item /
 *           .blog-item .blog-desc::before/::after 裝飾 / hover 動畫 / .read-more）
 *   區段 2: 新版列表卡片（.blog-item-2 / .blog-title-2 / .blog-title-border /
 *           .blog-image / .blog-desc / .read-more / .blog-item-2:hover）
 *   區段 3: 貼文詳情頁（.blog-details-area / .blog-details-title /
 *           .blog-description（含 p img、img 巢狀規則）/ .blog-section-title）
 *
 * 使用頁面：
 *   - resources/views/web/posts/index.blade.php（貼文列表）
 *   - resources/views/web/posts/show.blade.php（貼文詳情）
 *
 * 載入順序：
 *   common/{base,header,sidebar,footer,widget}.css → themes/default/{同}.css →
 *   common/pages/post.css（本檔）→ themes/default/pages/post.css → custom.css
 *
 * 抽取來源：public/web/css/default.css 3 個區段：
 *   - line 4948~5041：舊版列表卡片
 *   - line 5098~5189：新版列表卡片
 *   - line 5836~5906：貼文詳情頁
 *
 * 詳細規格：openspec/specs/web-theme-css/spec.md（Requirement R.FUNC.1 / R.FUNC.8）
 * 變更記錄：openspec/changes/issue518-web-theme-css-modularization/（task 6.2）
 * ============================================================================
 */


/* ============================================================================
 * 區段 1：舊版列表卡片（.blog-img / .blog-title / .blog-desc / .blog-item / .read-more）
 *   抽取自 default.css line 4948~5041
 *   對應 blade：posts/index.blade.php（舊版佈局）
 * ============================================================================
 */

.blog-desc p {
  margin-bottom: 25px;
}

.read-more a {
  color: #2c2c2c;
  font-size: 16px;
  padding: 10px 16px;
  text-transform: uppercase;
}

/* ============================================================================
 * 區段 2：新版列表卡片（.blog-item-2 系列）
 *   抽取自 default.css line 5098~5189
 *   對應 blade：posts/index.blade.php（新版佈局）
 * ============================================================================
 */

.blog-item-2 {
  margin-bottom: 30px;
  background: #ffffff;
  border-radius: 0px;
  overflow: hidden;
}

.blog-item-2 img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  transition: all 0.3s ease 0s;
}

.blog-item-2 .blog-desc {
  text-align: start;
  padding: 10px 20px 10px 0;
}

.blog-title-2 {
  color: #333333;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: capitalize;
  white-space: nowrap;
}

.blog-title-2>a {
  padding-bottom: 4px;
}

.blog-title-2>a:hover {
  color: #2c2c2c;
}

.blog-desc>p {
  color: #333333;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.blog-item-2 .blog-image {
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.date-box {
  margin: 8px;
  width: fit-content;
}

.date-text {
  margin-bottom: 0;
  /* font-size: 14px; */
  text-align: end;
}

.read-more {
  width: 100px;
}

/* .read-more a {
  padding: 10px 16px;
} */

@media screen and (max-width: 767.98px) {
  .blog-item-2 .blog-image {
    padding: 16px;
    border-radius: 10px;
    overflow: hidden;
  }

  .blog-item-2 .blog-image img {
    border-radius: 10px;
  }
}

.blog-item-2:hover img {
  opacity: 0.4;
  transform: scale3d(1.1, 1.1, 1);
}


/* ============================================================================
 * 區段 3：貼文詳情頁（.blog-details-area / .blog-details-title / .blog-description / .blog-section-title）
 *   抽取自 default.css line 5836~5906
 *   對應 blade：posts/show.blade.php
 * ============================================================================
 */

.blog-details-area {
  background: #ffffff;
  border-radius: 10px;
  min-height: 300px;
  height: fit-content;
  padding: 40px 20px;
}

.blog-details-area .blog-description {
  font-size: 16px;
  line-height: 28px;
  color: #333333;
}

.blog-details-area .blog-description p img {
  width: auto;
  max-width: 100%;
  height: auto !important;
  aspect-ratio: auto;

}

.blog-details-area .blog-description img {
  width: auto;
  max-width: 100%;
  height: auto !important;
  aspect-ratio: auto;

}

@media screen and (max-width: 767.98px) {

  .blog-details-area {
    overflow-x: hidden;
  }

  .blog-details-area .blog-description p img {
    width: auto;
    max-width: 100%;
    height: auto !important;
    aspect-ratio: auto;
  }
}

/* .blog-section-title 已遷至 common/base.css；contactUs / 其他頁面亦使用 */

/* ============================================================================
 * 骨架語意化（issue #715）：posts/index 原 Bootstrap grid 的等價規則。
 * 客戶主題 3ffood 於 themes/3ffood/pages/post.css 以原 grid 結構為 hook 完全
 * 覆寫本版面（水平卡），選擇器已同步遷移至本語意類；其餘主題沿用 BS 預設欄寬
 * （col-md-6=50%＠768、col-lg-6=50%＠992），故此處鏡射 BS 生效值。
 * ============================================================================ */

/* 原外層 row（貼文卡兩欄流）＋ col-md-6 */
.blog-list {
  --bs-gutter-x: 1.5rem;
  --bs-gutter-y: 0;
  display: flex;
  flex-wrap: wrap;
  margin-right: calc(-0.5 * var(--bs-gutter-x));
  margin-left: calc(-0.5 * var(--bs-gutter-x));
}

.blog-list__item {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  padding-right: calc(var(--bs-gutter-x) * 0.5);
  padding-left: calc(var(--bs-gutter-x) * 0.5);
  margin-top: var(--bs-gutter-y);
}

@media (min-width: 768px) {
  .blog-list__item {
    flex: 0 0 auto;
    width: 50%;
  }
}

/* 原 blog-item-2 內層 row ＋ col-lg-6 圖／文 */
.blog-item-2__row {
  --bs-gutter-x: 1.5rem;
  --bs-gutter-y: 0;
  display: flex;
  flex-wrap: wrap;
  margin-right: calc(-0.5 * var(--bs-gutter-x));
  margin-left: calc(-0.5 * var(--bs-gutter-x));
}

.blog-item-2__col {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  padding-right: calc(var(--bs-gutter-x) * 0.5);
  padding-left: calc(var(--bs-gutter-x) * 0.5);
  margin-top: var(--bs-gutter-y);
}

@media (min-width: 992px) {
  .blog-item-2__col {
    flex: 0 0 auto;
    width: 50%;
  }
}

/* 原日期列 d-flex justify-content-end */
.blog-date-align {
  display: flex;
  justify-content: flex-end;
}

/* 原分頁 row ＋ col-lg-12 */
.blog-pagination-row {
  --bs-gutter-x: 1.5rem;
  --bs-gutter-y: 0;
  display: flex;
  flex-wrap: wrap;
  margin-right: calc(-0.5 * var(--bs-gutter-x));
  margin-left: calc(-0.5 * var(--bs-gutter-x));
}

.blog-pagination-row__body {
  flex: 0 0 auto;
  width: 100%;
  padding-right: calc(var(--bs-gutter-x) * 0.5);
  padding-left: calc(var(--bs-gutter-x) * 0.5);
}

/* 原空狀態 col-md-12 ＋ text-center */
.blog-empty__inner {
  text-align: center;
}

/* ============================================================================
 * 骨架語意化（issue #716）：posts/show 原 Bootstrap grid／佈局 utility 的等價規則。
 * 3ffood 於 post.css 以 .col-lg-12.col-12.order-2.d-block 為 hook 覆寫關聯輪播,
 * 選擇器已同步遷移至 .blog-related。響應式顯示（d-lg-block/d-lg-flex/d-none）為
 * 版面骨架,轉語意類；圖片 desktopImg 的 d-none（BS 切換狀態）保留於 blade。
 * ============================================================================ */

/* 原主佈局 row justify-content-lg-start ＋ col-lg-9 主欄 ＋ col-lg-3 側欄 */
.blog-detail-row {
  --bs-gutter-x: 1.5rem;
  --bs-gutter-y: 0;
  display: flex;
  flex-wrap: wrap;
  margin-right: calc(-0.5 * var(--bs-gutter-x));
  margin-left: calc(-0.5 * var(--bs-gutter-x));
}

@media (min-width: 992px) {
  .blog-detail-row {
    justify-content: flex-start;
  }
}

.blog-detail-main,
.blog-detail-side,
.blog-related {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  padding-right: calc(var(--bs-gutter-x) * 0.5);
  padding-left: calc(var(--bs-gutter-x) * 0.5);
  margin-top: var(--bs-gutter-y);
}

@media (min-width: 992px) {
  .blog-detail-main {
    flex: 0 0 auto;
    width: 75%;
  }

  .blog-detail-side {
    flex: 0 0 auto;
    width: 25%;
  }
}

/* 原側欄的 d-lg-block d-none（<992 隱藏、≥992 block） */
.blog-detail-side {
  display: none;
}

@media (min-width: 992px) {
  .blog-detail-side {
    display: block;
  }
}

/* 原關聯輪播的 col-lg-12 col-12 order-2 d-block（恆滿寬、order 2 排最後） */
.blog-related {
  order: 2;
  display: block;
}

/* 原關聯輪播標題列 d-flex justify-content-between align-items-center */
.blog-related__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 原標題 h5 的 mb-0（BS mb-0 帶 !important,須鏡射否則被 3ffood .widget-title hook margin 蓋回） */
.blog-related__title {
  margin-bottom: 0 !important;
}

/* 原輪播導航 d-lg-flex justify-content-end d-none（<992 隱藏、≥992 flex 靠右） */
.blog-related__nav {
  display: none;
}

@media (min-width: 992px) {
  .blog-related__nav {
    display: flex;
    justify-content: flex-end;
  }
}

/* 原隱藏 aside（本身 d-none）內的 row d-flex flex-wrap ＋ product-item col-lg-3 col-12 */
.blog-related-hidden__grid {
  --bs-gutter-x: 1.5rem;
  --bs-gutter-y: 0;
  display: flex;
  flex-wrap: wrap;
  margin-right: calc(-0.5 * var(--bs-gutter-x));
  margin-left: calc(-0.5 * var(--bs-gutter-x));
}

.blog-related-hidden__item {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  padding-right: calc(var(--bs-gutter-x) * 0.5);
  padding-left: calc(var(--bs-gutter-x) * 0.5);
}

@media (min-width: 992px) {
  .blog-related-hidden__item {
    flex: 0 0 auto;
    width: 25%;
  }
}

/* 原 content_type!=1 摘要欄的 col-md-6 text-center（dead branch,語意化保留） */
.blog-detail-summary-col {
  text-align: center;
}
