/*
 * Version control
 * 2026-10-26 : Add a cross-input focus fallback for article-category controls.
 * 2026-10-26 : Move the article-category family layout from inline CSS into a scoped mobile-first asset.
 */

.article-catalog-modern {
  padding: 0.15rem 0 0;
}

.article-catalog-modern .article-tab-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.52rem;
  margin: 0.2rem 0 0.95rem;
}

.article-catalog-modern .article-tab-link,
.article-catalog-modern .article-tab-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.36rem 0.9rem;
  border: 1px solid rgba(90, 140, 170, 0.3);
  border-radius: 999px;
  font-size: 0.83rem;
  line-height: 1.2;
  text-decoration: none;
}

.article-catalog-modern .article-tab-link {
  background: #f3f9fd;
  color: #245c7a;
  transition: transform 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.article-catalog-modern .article-tab-link:hover {
  border-color: rgba(46, 124, 167, 0.48);
  background: #e3f2fb;
  transform: translateY(-1px);
}

.article-catalog-modern .article-tab-current {
  border-color: rgba(16, 101, 143, 0.88);
  background: linear-gradient(135deg, #1180b2, #1d95c7);
  color: #fff;
  font-weight: 700;
}

.article-catalog-modern .article-tab-link:focus,
.article-catalog-modern .article-row-cover:focus,
.article-catalog-modern .article-row-title a:focus,
.article-catalog-modern .article-row-summary a:focus,
.article-catalog-modern .article-chip:focus,
.article-catalog-modern .article-pagination-link:focus {
  outline: 3px solid #1478a6;
  outline-offset: 3px;
}

.article-catalog-modern .article-list-shell {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.article-catalog-modern .article-empty-state {
  padding: 1.1rem 1rem;
  border: 1px solid rgba(122, 160, 184, 0.32);
  border-radius: 14px;
  background: #f5fafd;
  color: #4c6072;
  font-size: 0.92rem;
}

.article-catalog-modern .article-row-shell {
  padding: 1px;
  border-radius: 18px;
  background: linear-gradient(140deg, rgba(24, 127, 172, 0.22), rgba(255, 255, 255, 0.86) 42%, rgba(24, 127, 172, 0.12));
  box-shadow: 0 14px 30px rgba(13, 41, 56, 0.08);
}

.article-catalog-modern .article-row-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.7rem;
  padding: 0.72rem;
  border: 1px solid rgba(120, 157, 182, 0.28);
  border-radius: 17px;
  background: #fbfdff;
  animation: articleCategoryFadeUp 0.6s cubic-bezier(0.2, 0.78, 0.2, 1) both;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.article-catalog-modern .article-row-shell:nth-child(2) .article-row-card { animation-delay: 0.05s; }
.article-catalog-modern .article-row-shell:nth-child(3) .article-row-card { animation-delay: 0.1s; }
.article-catalog-modern .article-row-shell:nth-child(4) .article-row-card { animation-delay: 0.15s; }
.article-catalog-modern .article-row-shell:nth-child(5) .article-row-card { animation-delay: 0.2s; }
.article-catalog-modern .article-row-shell:nth-child(n+6) .article-row-card { animation-delay: 0.25s; }

.article-catalog-modern .article-row-shell:hover .article-row-card {
  border-color: rgba(42, 142, 191, 0.5);
  box-shadow: 0 22px 38px rgba(16, 66, 91, 0.14);
  transform: translateY(-3px);
}

.article-catalog-modern .article-row-cover {
  display: flex;
  flex: none;
  width: 100%;
  min-height: 182px;
  color: inherit;
  text-decoration: none;
}

.article-catalog-modern .article-cover-frame {
  position: relative;
  display: flex;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(125, 156, 178, 0.34);
  border-radius: 12px;
  background: radial-gradient(circle at 25% 10%, rgba(34, 145, 198, 0.16), rgba(14, 41, 61, 0.04) 40%, rgba(250, 251, 253, 0.92));
}

.article-catalog-modern .article-cover-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-catalog-modern .article-cover-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100%;
  background: linear-gradient(140deg, #edf4f9, #f9fcff);
  color: #567086;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

.article-catalog-modern .article-cover-fallback[hidden],
.article-catalog-modern .article-cover-image[hidden] {
  display: none;
}

.article-catalog-modern .article-video-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(8, 17, 26, 0.68);
  color: #fff;
  font-size: 0.9rem;
  transform: translate(-50%, -50%);
}

.article-catalog-modern .article-row-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.42rem;
  min-width: 0;
}

.article-catalog-modern .article-row-title {
  margin: 0;
  color: #0f1b28;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.36;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.article-catalog-modern .article-row-title a,
.article-catalog-modern .article-row-summary a {
  color: inherit;
  text-decoration: none;
  transition: color 0.25s ease;
}

.article-catalog-modern .article-row-title a:hover,
.article-catalog-modern .article-row-summary a:hover {
  color: #1478a6;
}

.article-catalog-modern .article-row-summary {
  margin: 0;
  color: #506274;
  font-size: 0.93rem;
  line-height: 1.62;
  overflow-wrap: anywhere;
}

.article-catalog-modern .article-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-top: 0.08rem;
}

.article-catalog-modern .article-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.24rem 0.62rem;
  border: 1px solid rgba(58, 142, 181, 0.26);
  border-radius: 999px;
  background: #e7f4fb;
  color: #1f4e68;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  line-height: 1.2;
  white-space: nowrap;
}

.article-catalog-modern .article-chip-date {
  border-color: rgba(111, 133, 151, 0.26);
  background: #f1f5f9;
  color: #4f6275;
}

.article-catalog-modern .article-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin-top: 1.05rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid rgba(124, 157, 181, 0.27);
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(246, 252, 255, 0.95), rgba(241, 248, 253, 0.92));
}

.article-catalog-modern .article-pagination-link,
.article-catalog-modern .article-pagination-current {
  min-width: 36px;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  font-size: 0.83rem;
  text-align: center;
  text-decoration: none;
}

.article-catalog-modern .article-pagination-link {
  border: 1px solid rgba(70, 124, 153, 0.28);
  background: #fff;
  color: #1d4f6d;
  transition: transform 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.article-catalog-modern .article-pagination-link:hover {
  border-color: rgba(45, 132, 176, 0.52);
  background: #def1fc;
  transform: translateY(-1px);
}

.article-catalog-modern .article-pagination-current {
  border: 1px solid rgba(15, 104, 147, 0.88);
  background: linear-gradient(135deg, #1280b1, #1c92c7);
  color: #fff;
  font-weight: 700;
}

.article-catalog-modern .article-pagination-status {
  width: 100%;
  padding-top: 0.12rem;
  color: #536678;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
}

@keyframes articleCategoryFadeUp {
  from {
    opacity: 0;
    filter: blur(3px);
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@media screen and (min-width: 737px) {
  .article-catalog-modern {
    padding: 0.5rem 0 0.2rem;
  }

  .article-catalog-modern .article-row-card {
    flex-direction: row;
    gap: 1rem;
    padding: 0.78rem 0.95rem;
  }

  .article-catalog-modern .article-row-cover {
    flex: 0 0 218px;
    width: auto;
    max-width: 218px;
    min-height: 108px;
  }

  .article-catalog-modern .article-pagination-status {
    width: auto;
    margin-left: auto;
    padding-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .article-catalog-modern .article-row-card,
  .article-catalog-modern .article-tab-link,
  .article-catalog-modern .article-row-title a,
  .article-catalog-modern .article-row-summary a,
  .article-catalog-modern .article-pagination-link {
    animation: none !important;
    transition: none !important;
  }
}
