/*
 * Telegram Blog 风格分类页面
 * 仅由 category.php 加载，不影响首页。
 */

.telegram-category-container {
  width: 100%;
  max-width: 1028px;
  margin-right: auto;
  margin-left: auto;
}

.telegram-category-page,
.telegram-category-page * {
  box-sizing: border-box;
}

.telegram-category-page {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 38px 15px 64px;
}

.telegram-category-header {
  margin-bottom: 34px;
  text-align: center;
}

.telegram-category-brand {
  margin-bottom: 7px;
  color: #8c969f;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.telegram-category-title {
  margin: 0;
  color: #333;
  font-size: 27px;
  font-weight: 600;
  line-height: 1.3;
}

.telegram-category-description {
  max-width: 650px;
  margin: 12px auto 0;
  color: #73818f;
  font-size: 15px;
  line-height: 1.7;
}

.telegram-category-description p {
  margin: 0;
}

/* 两列文章卡片 */
.telegram-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 34px 30px;
  margin: 0;
}

.telegram-category-card-link {
  display: block;
  float: none;
  width: auto;
  min-width: 0;
  padding: 0;
  color: inherit;
  text-decoration: none;
}

.telegram-category-card-link:hover,
.telegram-category-card-link:focus {
  color: inherit;
  text-decoration: none;
}

.telegram-category-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  transition: transform 0.18s ease;
}

.telegram-category-card-link:hover .telegram-category-card {
  transform: translateY(-3px);
}

.telegram-category-image-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 10px;
  background: #eef4f7;
  aspect-ratio: 16 / 9;
}

.telegram-category-image {
  display: block;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  margin: 0 !important;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.telegram-category-card-link:hover .telegram-category-image {
  transform: scale(1.025);
}

.telegram-category-card-content {
  flex: 1;
  padding: 17px 2px 0;
}

.telegram-category-card-title {
  margin: 0 0 9px;
  padding: 0;
  color: #0088cc;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
}

.telegram-category-card-excerpt {
  margin: 0;
  padding: 0;
  color: #596875;
  font-size: 14px;
  line-height: 1.65;
}

.telegram-category-card-date {
  display: block;
  margin-top: 12px;
  padding: 0 2px;
  color: #9aa3ab;
  font-size: 13px;
  line-height: 1.4;
}

/* Telegram 官网类似的简单翻页 */
.telegram-category-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  margin-top: 44px;
}

.telegram-category-pagination > div {
  min-width: 120px;
}

.telegram-category-older {
  margin-left: auto;
  text-align: right;
}

.telegram-category-pagination a {
  display: inline-block;
  padding: 7px 16px;
  border: 1px solid rgba(0, 136, 204, 0.24);
  border-radius: 999px;
  color: #0088cc;
  font-size: 14px;
  line-height: 1.4;
  text-decoration: none;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease;
}

.telegram-category-pagination a:hover,
.telegram-category-pagination a:focus {
  border-color: rgba(0, 136, 204, 0.48);
  background: rgba(0, 136, 204, 0.07);
  text-decoration: none;
}

/* 无文章 */
.telegram-category-empty {
  max-width: 600px;
  margin: 55px auto;
  text-align: center;
}

.telegram-category-empty h2 {
  margin: 0 0 10px;
  color: #333;
  font-size: 23px;
}

.telegram-category-empty p {
  margin: 0 0 20px;
  color: #7b8791;
  font-size: 15px;
}

.telegram-category-empty a {
  color: #0088cc;
}

/* 深色模式兼容 */
html[data-theme="dark"] .telegram-category-title,
html[data-theme="dark"] .telegram-category-empty h2 {
  color: var(--d-text);
}

html[data-theme="dark"] .telegram-category-brand,
html[data-theme="dark"] .telegram-category-description,
html[data-theme="dark"] .telegram-category-card-date,
html[data-theme="dark"] .telegram-category-empty p {
  color: var(--d-text-muted);
}

html[data-theme="dark"] .telegram-category-card-title {
  color: var(--d-accent-bright);
}

html[data-theme="dark"] .telegram-category-card-excerpt {
  color: var(--d-text);
}

html[data-theme="dark"] .telegram-category-image-wrap {
  background: var(--d-surface);
}

html[data-theme="dark"] .telegram-category-pagination a {
  border-color: var(--d-border);
  color: var(--d-accent-bright);
}

html[data-theme="dark"] .telegram-category-pagination a:hover,
html[data-theme="dark"] .telegram-category-pagination a:focus {
  border-color: var(--d-accent);
  background: var(--d-accent-soft);
}

/* 平板和手机 */
@media (max-width: 767px) {
  .telegram-category-page {
    padding: 28px 15px 50px;
  }

  .telegram-category-header {
    margin-bottom: 26px;
  }

  .telegram-category-title {
    font-size: 24px;
  }

  .telegram-category-grid {
    grid-template-columns: 1fr;
    gap: 34px;
    max-width: 520px;
    margin-right: auto;
    margin-left: auto;
  }

  .telegram-category-card-title {
    font-size: 19px;
  }

  .telegram-category-pagination {
    max-width: 520px;
    margin-right: auto;
    margin-left: auto;
  }
}

@media (max-width: 420px) {
  .telegram-category-page {
    padding-right: 12px;
    padding-left: 12px;
  }

  .telegram-category-pagination a {
    padding: 7px 12px;
    font-size: 13px;
  }
}
