/* ================================
   J News & Blog Display - Frontend Styles
   ================================ */

/* 基礎樣式 */
.jnbd-news-container,
.jnbd-blog-list {
  width: 100%;
  margin: 0 auto;
  padding: 20px 0;
}

/* 錯誤訊息 */
.jnbd-error,
.jnbd-no-posts {
  padding: 20px;
  background-color: #f8f8f8;
  border-left: 4px solid #d63638;
  color: #333;
  text-align: center;
}

/* ================================
   最新消息 - 卡片式佈局
   ================================ */
.jnbd-layout-card {
  display: grid;
  gap: 30px;
}

.jnbd-layout-card.jnbd-columns-1 {
  grid-template-columns: 1fr;
}

.jnbd-layout-card.jnbd-columns-2 {
  grid-template-columns: repeat(2, 1fr);
}

.jnbd-layout-card.jnbd-columns-3 {
  grid-template-columns: repeat(3, 1fr);
}

.jnbd-layout-card.jnbd-columns-4 {
  grid-template-columns: repeat(4, 1fr);
}

.jnbd-layout-card .jnbd-news-item {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.jnbd-layout-card .jnbd-news-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.jnbd-news-thumbnail {
  position: relative;
  width: 100%;
  padding-top: 60%;
  overflow: hidden;
  background-color: #f0f0f0;
}

.jnbd-news-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.jnbd-news-item:hover .jnbd-news-thumbnail img {
  transform: scale(1.05);
}

.jnbd-news-content {
  padding: 20px;
}

.jnbd-news-date {
  font-size: 14px;
  color: #999;
  margin-bottom: 10px;
}

.jnbd-news-title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 15px 0;
}

.jnbd-news-title a {
  color: #333;
  text-decoration: none;
  transition: color 0.3s ease;
}

.jnbd-news-title a:hover {
  color: #0073aa;
}

.jnbd-news-excerpt {
  font-size: 14px;
  line-height: 1.6;
  color: #666;
  margin-bottom: 15px;
}

.jnbd-read-more {
  display: inline-block;
  padding: 8px 20px;
  background-color: #0073aa;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-size: 14px;
  transition: background-color 0.3s ease;
}

.jnbd-read-more:hover {
  background-color: #005a87;
}

/* ================================
   最新消息 - 列表式佈局
   ================================ */
.jnbd-layout-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.jnbd-layout-list .jnbd-news-item {
  display: flex;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.jnbd-layout-list .jnbd-news-thumbnail {
  flex-shrink: 0;
  width: 300px;
  padding-top: 0;
  height: 200px;
}

.jnbd-layout-list .jnbd-news-thumbnail img {
  position: static;
}

/* ================================
   最新消息 - 時間軸佈局
   ================================ */
.jnbd-layout-timeline {
  position: relative;
  padding-left: 40px;
}

.jnbd-layout-timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: #ddd;
}

.jnbd-layout-timeline .jnbd-news-item {
  position: relative;
  margin-bottom: 30px;
  padding-left: 30px;
}

.jnbd-layout-timeline .jnbd-news-item::before {
  content: '';
  position: absolute;
  left: -29px;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #0073aa;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #0073aa;
}

/* ================================
   文章列表樣式
   ================================ */
.jnbd-blog-item {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.jnbd-blog-thumbnail {
  width: 100%;
  overflow: hidden;
}

.jnbd-blog-thumbnail img {
  width: 100%;
  height: auto;
  transition: transform 0.3s ease;
}

.jnbd-blog-item:hover .jnbd-blog-thumbnail img {
  transform: scale(1.05);
}

.jnbd-blog-content {
  padding: 30px;
}

.jnbd-blog-title {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 15px 0;
}

.jnbd-blog-title a {
  color: #333;
  text-decoration: none;
  transition: color 0.3s ease;
}

.jnbd-blog-title a:hover {
  color: #0073aa;
}

.jnbd-blog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  font-size: 14px;
  color: #999;
  margin-bottom: 15px;
}

.jnbd-blog-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.jnbd-blog-meta i {
  font-size: 16px;
}

.jnbd-blog-excerpt {
  font-size: 16px;
  line-height: 1.7;
  color: #666;
  margin-bottom: 20px;
}

.jnbd-blog-categories a {
  color: #0073aa;
  text-decoration: none;
}

.jnbd-blog-categories a:hover {
  text-decoration: underline;
}

/* ================================
   分頁樣式
   ================================ */
.jnbd-pagination {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

.jnbd-pagination .page-numbers {
  display: inline-block;
  padding: 8px 12px;
  margin: 0 5px;
  background-color: #fff;
  border: 1px solid #ddd;
  color: #333;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.jnbd-pagination .page-numbers:hover {
  background-color: #0073aa;
  color: #fff;
  border-color: #0073aa;
}

.jnbd-pagination .page-numbers.current {
  background-color: #0073aa;
  color: #fff;
  border-color: #0073aa;
}

/* ================================
   Campaign Section - Japanese Style
   ================================ */
.campaign-section {
  background: #fff;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
  height: 700px;
  display: flex;
  flex-direction: column;
}

.campaign-section h3 {
  font-size: 20px;
  font-weight: 600;
  color: #333;
  margin: 0 0 20px 0;
  padding-bottom: 15px;
  border-bottom: 2px solid #f0f0f0;
}

.campaign-section h3 i {
  color: #e67e23;
  margin-right: 8px;
}

.campaign-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 8px;
}

/* 滾動條樣式 */
.campaign-content::-webkit-scrollbar {
  width: 8px;
}

.campaign-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.campaign-content::-webkit-scrollbar-thumb {
  background: #e67e23;
  border-radius: 4px;
}

.campaign-content::-webkit-scrollbar-thumb:hover {
  background: #c86d1e;
}

.campaign-item {
  display: flex;
  flex-direction: row-reverse;
  gap: 15px;
  padding: 15px;
  background: #fafafa;
  /* border-left: 4px solid #e67e23;
  border-radius: 4px; */
  transition: all 0.3s ease;
}

.campaign-item:hover {
  background: #f5f5f5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 縮圖樣式（左側固定尺寸） */
.campaign-thumbnail {
  flex-shrink: 0;
  width: 138px;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
}

.campaign-thumbnail a {
  display: block;
  width: 100%;
  height: 100%;
}

.campaign-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 文字內容區塊 */
.campaign-content-wrapper {
  flex: 1;
  min-width: 0;
  border-radius: 8px;
}

/* 日期與標籤同一行 */
.campaign-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.campaign-meta .campaign-date,
.campaign-meta .campaign-tags {
  margin: 0 !important;
}

/* 日期樣式 */
.campaign-date {
  font-size: 14px;
  color: #999;
  margin: 0 0 10px 0 !important;
}

/* 標籤容器 */
.campaign-tags {
  margin: 0 0 10px 0 !important;
}

/* 標籤基本樣式 */
.campaign-item .tag {
  display: inline-block;
  padding: 4px 12px;
  background: #e67e23;
  color: #fff;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-right: 10px;
}

/* 內容文字 */
.campaign-text {
  margin: 0 !important;
  line-height: 1.6;
}

.campaign-title {
  display: block;
  color: #e67e23;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 8px;
}

.campaign-title:hover {
  text-decoration: underline;
  color: #c86d1e;
}

.campaign-content {
  display: block;
  color: #666;
  font-size: 14px;
  line-height: 1.6;
  margin-top: 5px;
}

/* 分類類型樣式 - 統一使用橙色 */
.campaign-item-campaign,
.campaign-item-news,
.campaign-item-event,
.campaign-item-notice {
  border-left-color: #e67e23;
}

.tag-campaign,
.tag-news,
.tag-event,
.tag-notice {
  background: #e67e23;
}

/* ================================
   News Section - Japanese Style
   ================================ */
.news-section {
  background: #fff;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
  height: 700px;
  display: flex;
  flex-direction: column;
}

.news-section h3 {
  font-size: 20px;
  font-weight: 600;
  color: #333;
  margin: 0 0 20px 0;
  padding-bottom: 15px;
  border-bottom: 2px solid #f0f0f0;
}

.news-section h3 i {
  color: #e67e23;
  margin-right: 8px;
}

.news-content {
  display: flex;
  flex-direction: column;
  gap: 15px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: #ffffff;
  border-radius: 8px;
}

/* 滾動條樣式 */
.news-content::-webkit-scrollbar {
  width: 8px;
}

.news-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.news-content::-webkit-scrollbar-thumb {
  background: #e67e23;
  border-radius: 4px;
}

.news-content::-webkit-scrollbar-thumb:hover {
  background: #c86d1e;
}

.news-item {
  display: flex;
  gap: 15px;
  padding: 15px;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.3s ease;
}

.news-item:last-child {
  border-bottom: none;
}

.news-item:hover {
  background-color: #fafafa;
}

.news-thumbnail {
  flex-shrink: 0;
  width: 96px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
  font-size: 32px;
}

.news-thumbnail a {
  display: block;
  width: 100%;
  height: 100%;
}

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

.news-content-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.news-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  text-decoration: none;
  margin-bottom: 5px;
  display: block;
}

.news-title:hover {
  color: #e67e23;
}

.news-date {
  font-size: 13px;
  color: #999;
}

.news-excerpt {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  margin-top: 8px;
}

.more-link {
  text-align: center;
  padding-top: 20px;
  margin-top: 20px;
  border-top: 1px solid #f0f0f0;
}

.more-link a {
  display: inline-block;
  padding: 10px 30px;
  background: #e67e23;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 600;
  transition: background-color 0.3s ease;
}

.more-link a:hover {
  background: #c86d1e;
}

/* ================================
   響應式設計
   ================================ */
@media (max-width: 1024px) {
  .jnbd-layout-card.jnbd-columns-4 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .jnbd-layout-card.jnbd-columns-3,
  .jnbd-layout-card.jnbd-columns-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .jnbd-layout-list .jnbd-news-item {
    flex-direction: column;
  }

  .jnbd-layout-list .jnbd-news-thumbnail {
    width: 100%;
  }

  .jnbd-blog-content {
    padding: 20px;
  }

  .jnbd-blog-title {
    font-size: 20px;
  }

  .campaign-section,
  .news-section {
    padding: 20px;
  }

  .campaign-section h3,
  .news-section h3 {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .jnbd-layout-card.jnbd-columns-2,
  .jnbd-layout-card.jnbd-columns-3,
  .jnbd-layout-card.jnbd-columns-4 {
    grid-template-columns: 1fr;
  }

  .jnbd-news-title {
    font-size: 18px;
  }

  .jnbd-blog-title {
    font-size: 18px;
  }

  .jnbd-blog-meta {
    flex-direction: column;
    gap: 8px;
  }

  .campaign-section,
  .news-section {
    padding: 15px;
  }

  .campaign-section h3,
  .news-section h3 {
    font-size: 16px;
  }

  .news-item {
    flex-direction: column;
  }

  .news-thumbnail {
    width: 100%;
    height: 120px;
  }

  .campaign-item .tag {
    font-size: 11px;
    padding: 3px 10px;
  }

  .campaign-item {
    flex-direction: column;
  }

  .campaign-thumbnail {
    width: 100%;
    height: 120px;
  }

  .campaign-title {
    font-size: 15px;
  }
}
