/* ════════════════════════════════
   article_list.css  （延用 property_list.css 基礎）
════════════════════════════════ */

/* ── 頁首 ── */
.page-header {
  background: var(--dark);
  color: var(--text-light);
  padding: 2.5rem 2rem 2rem;
  margin-top: 73px;
}
.page-header h1 {
  font-family: var(--font-head);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: .05em;
}
.page-header .subtitle {
  margin-top: .4rem;
  font-size: .875rem;
  color: rgba(255,255,255,.5);
}
.page-header .subtitle span {
  color: var(--primary);
  font-weight: 600;
}

/* ── 篩選列 ── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  background: var(--page-bg, var(--light-bg));
  padding: 30px 0 10px;
  /* border-bottom: 1px solid #eee; */
  justify-content: center;
}

.filter-group {
  display: flex;
  flex-direction: row;
  gap: 5px;
  flex-wrap: wrap;
  min-width: 0;
  align-items: baseline;
}

.filter-group__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  padding-top: 6px;
  min-width: 36px;
  letter-spacing: .04em;
}

.filter-group__tags {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-actions {
  margin-left: 20px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ── 下拉選單 ── */
.filter-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding: 6px 32px 6px 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  background-color: #fff;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
}
.filter-select::-ms-expand { display: none; }
.filter-select:focus { border-color: var(--primary); }

/* ── 標籤 ── */
.tag {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1.5px solid #ddd;
  font-size: 0.85rem;
  color: var(--text-dark);
  background: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
.tag:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.tag--active {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--text-on-primary) !important;
}

/* ── 搜尋區域 ── */
.filter-search {
  display: flex;
  align-items: center;
  gap: 8px;
}
.filter-search__input {
  padding: 5px 12px;
  border: 1.5px solid #ddd;
  border-radius: 20px;
  font-size: 0.85rem;
  outline: none;
  background: #fff;
  transition: border-color 0.2s;
  min-width: 200px;
}
.filter-search__input:focus { border-color: var(--primary); }
.filter-search__btn {
  padding: 5px 16px;
  background: var(--dark);
  color: var(--text-on-dark);
  border: none;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}
.filter-search__btn:hover {
  background: var(--primary);
  color: var(--text-on-primary);
}
.btn-reset,
.filter-search__clear {
  color: #999;
  font-size: 1rem;
  text-decoration: none;
  padding: 5px;
}
.btn-reset:hover { color: var(--primary); }

/* ── 文章列表 ── */
.property-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  padding: 20px;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
}
.empty-state p {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ── 文章卡片 ── */
.property-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 8px;
  display: flex;
  flex-direction: column;   /* 文章卡片改為上圖下文 */
  overflow: hidden;
  transition: box-shadow .2s;
  text-decoration: none;
  color: inherit;
}
.property-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,.1);
}

.card-image {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  flex-shrink: 0;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
.property-card:hover .card-image img {
  transform: scale(1.04);
}

.article_badge {
  position: absolute;
    top: .6rem;
    left: .6rem;
    font-size: .7rem;
    font-weight: 500;
    letter-spacing: .06em;
    padding: 2px 4px;
    border-radius: 3px;
    text-transform: uppercase;
}

.card-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.card-title {
  /* font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-dark); */
  font-weight: 500;
  line-height: 1.4;
  font-size: 1.2rem !important;
  width: 100%;             
  display: block;
  white-space: nowrap;     /* 強制單行，這是顯示省略號的關鍵 */
  overflow: hidden;        /* 隱藏超出範圍的文字 */
  text-overflow: ellipsis;
}
.card-area {
  font-size: .8rem;
  color: var(--text-muted);
}
.card-price {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: .2rem;
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .9rem;
  font-size: .8rem;
  color: var(--text-dark);
}
.card-meta span::before {
  content: attr(data-label) '：';
  color: var(--text-muted);
}

.article-footer{
  display: flex;
  font-size: 18px;
  justify-content: center;
  margin: 40px auto;
  color: var(--primary);
}


/* 1024px */
@media (max-width: 1024px) {
  .property-list {
    grid-template-columns: repeat(5, 1fr); /* 平板維持三欄 */
  }
}

/* 768px */
@media (max-width: 768px) {
  .property-list {
    grid-template-columns: repeat(4, 1fr); /* 小平板兩欄 */
  }
  .filter-group {
    flex: 1 1 100%; /* 篩選器改為全寬堆疊 */
  }
  .filter-bar{
        flex-direction: column;
        gap: 5px;
        padding: 20px 15px 20px;
        align-content: center;
  }
}

/* 640px 手機版建議：大圖模式下文字縮放控制 */
@media (max-width: 640px) {
  .property-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start; /* 改成 flex-start 防止兩張卡片中間空太開 */
    padding: 10px;
    gap: 10px; /* 手機版間距小一點，20px 太佔空間 */
    box-sizing: border-box;
  }

  .property-card {
    /* 核心修正：50% 扣掉一半的 gap (10px/2 = 5px) */
    width: calc(50% - 5px); 
    
    /* 確保寬度包含 padding 和 border */
    box-sizing: border-box; 
    
    margin-bottom: 10px;
    flex: 0 0 auto; /* 防止被 flex 壓縮 */
  }
  /* 避免後台設定的「巨大」字體在手機上爆開 */
  .card-title {
    font-size: clamp(1rem, 5vw, 1rem) !important; 
    padding: 0 4px;
  }
  .card-body {
    padding: 5px 5px;
  }
  
  .filter-bar{
        flex-direction: column;
        gap: 5px;
        padding: 20px 15px 20px;
        align-content: center;
  }

  .article-footer{
    margin: 20px auto 40px;
  }
}
