
/* ==========================================================
   CATEGORY PAGE
   Dimensions extracted from SangaiExpress_Prototype_v11(2).html
   ========================================================== */

.category-page {
  min-width: 0;
}

/* Category banner */

.category-page .category-banner {
  width: 100%;
  background: var(--section-world);
  color: white;
  padding: 36px 32px;
  margin: -28px -32px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.category-page .category-banner-info {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.category-page .category-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  flex: 0 0 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.category-page .category-heading,
.category-page .category-banner-copy {
  min-width: 0;
}

.category-page .category-title {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin: 0;
  color: white;
}

.category-page .category-desc {
  font-family: var(--font-ui);
  font-size: 13px;
  opacity: 0.85;
  margin: 4px 0 0;
  line-height: 1.5;
}

.category-page .subcategory-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.category-page .subcat-pill {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: white;
  background: transparent;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.category-page .subcat-pill:hover,
.category-page .subcat-pill.active {
  background: white;
  color: var(--category-color, var(--section-world));
}

/* Sort and filter bar */

.category-page .filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  gap: 16px;
}

.category-page .filter-left {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text-secondary);
}

.category-page .filter-btn {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.category-page .filter-btn.active {
  background: var(--primary);
  color: var(--bg-card);
  border-color: var(--primary);
}

.category-page .filter-right {
  display: flex;
  gap: 12px;
  align-items: center;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text-muted);
}

/* Featured story and Most Read */

.category-page .category-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
  align-items: start;
}

.category-page .featured-story {
  min-width: 0;
  cursor: pointer;
}

.category-page .category-featured-link,
.category-page .category-story-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.category-page .featured-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #4a6080, #2a4060);
  border-radius: 2px;
  margin-bottom: 16px;
  overflow: hidden;
}

.category-page .featured-headline {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  margin: 0 0 10px;
}

.category-page .category-featured-link:hover .featured-headline,
.category-page .category-story-link:hover .story-card-headline {
  color: var(--primary-mid);
}

.category-page .featured-deck {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0 0 12px;
}

.category-page .most-read-card {
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 20px;
}

.category-page .most-read-heading {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  padding-bottom: 10px;
  margin: 0 0 14px;
  border-bottom: 2px solid var(--primary);
  color: var(--text-primary);
}

.category-page .most-read-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-pale);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.category-page .most-read-item:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.category-page .most-read-num {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-faded);
  flex-shrink: 0;
  line-height: 1;
}

.category-page .most-read-copy,
.category-page .most-read-content {
  display: block;
  min-width: 0;
}

.category-page .most-read-title {
  display: block;
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

.category-page .most-read-item:hover .most-read-title {
  color: var(--primary-mid);
}

.category-page .most-read-sub {
  display: block;
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.category-page .view-all-row {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.category-page .category-view-all {
  font-size: 11px;
  padding: 7px 16px;
  text-decoration: none;
}

/* More stories */

.category-page .category-more {
  min-width: 0;
}

.category-page .category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  width: 100%;
}

.category-page .category-grid .story-card {
  min-width: 0;
}

.category-page .category-grid .story-card-image {
  width: 100%;
}

.category-page .category-grid .story-card-headline {
  overflow-wrap: anywhere;
}

/* Load more */

.category-page .load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

/* Shared prototype styles */

.category-page .section-tag {
  margin-bottom: 8px;
}

.category-page .byline-mini {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text-muted);
}

.category-page .byline-mini strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Responsive layout */

@media (max-width: 900px) {
  .category-page .category-layout {
    grid-template-columns: 1fr;
  }

  .category-page .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .category-page .category-title {
    font-size: 26px;
  }

  .category-page .category-banner {
    margin: -20px -16px 28px;
    padding: 28px 16px;
  }

  .category-page .filter-bar {
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .category-page .category-banner {
    align-items: flex-start;
  }

  .category-page .category-banner-info {
    gap: 12px;
  }

  .category-page .category-icon {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    font-size: 20px;
  }

  .category-page .subcategory-tabs {
    width: 100%;
  }

  .category-page .filter-bar {
    flex-direction: column;
  }

  .category-page .filter-right {
    width: 100%;
    justify-content: space-between;
  }

  .category-page .featured-headline {
    font-size: 22px;
  }

  .category-page .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}

/* Category banner colors */
.category-page.national .category-banner {
    background: #080808 !important;
}

.category-page.world .category-banner {
    background: #0B4775 !important;
}

.category-page.business .category-banner {
    background: #00551F !important;
}

.category-page.sport .category-banner {
    background: #651078 !important;
}

.category-page.science .category-banner {
    background: #006B6B !important;
}

.category-page.opinion .category-banner {
    background: #7B4300 !important;
}

.category-page.cities .category-banner {
    background: #202020 !important;
}

/* Dark circle beside the category title */
.category-page .category-icon {
    background: rgba(0, 0, 0, 0.25);
}




/* ==========================================
   MOST READ - FINAL CARD LAYOUT
========================================== */

/* Outer Most Read container */
.category-page .most-read-card {
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 22px 20px 24px;
}

/* Results */
.category-page .most-read-results {
    display: flex;
    flex-direction: column;
    gap: 11px;
    height: auto;
    max-height: none;
    overflow: visible;
}

/* Individual cards */
.category-page .most-read-results .most-read-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 9px;

    width: 100%;
    min-height: 96px;
    height: auto;
    box-sizing: border-box;

    margin: 0;
    padding: 19px 16px !important;

    border: 1px solid #eee9df;
    border-bottom: 1px solid #eee9df !important;
    border-radius: 9px;

    background: #fff;
    overflow: visible;

    transition:
        transform 300ms cubic-bezier(.2,.8,.2,1),
        box-shadow 300ms cubic-bezier(.2,.8,.2,1),
        border-color 250ms ease;
}

.category-page .most-read-results .most-read-item:hover {
    transform: translateY(-4px);
    border-color: #d4bd95;
    box-shadow: 0 9px 24px rgba(0,0,0,.08);
    z-index: 2;
}

/* Ranking number: compact width */
.category-page .most-read-results .most-read-num {
    flex: 0 0 auto;
    width: 19px;
    margin: 0;
    font-family: Georgia, serif;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.45;
    color: #ad8950;
}

/* Title and reading time */
.category-page .most-read-results .most-read-copy {
    display: flex !important;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 9px;
    min-width: 0;
}

.category-page .most-read-results .most-read-title {
    display: block;
    margin: 0;
    font-family: Georgia, serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    color: #242424;
    overflow-wrap: break-word;
    word-break: normal;
}

.category-page .most-read-results .most-read-sub {
    margin: 0;
    font-family: Inter, sans-serif;
    font-size: 11px;
    line-height: 1.4;
    color: #858585;
}

/* Dark mode */
html[data-mode="dark"] .category-page .most-read-card {
    background: #191919;
    border-color: #383838;
}

html[data-mode="dark"] .category-page .most-read-heading {
    color: #f1eee8;
    border-color: #c29a5d;
}

html[data-mode="dark"] .category-page .most-read-results .most-read-item {
    background: #222;
    border-color: #393939;
}

html[data-mode="dark"] .category-page .most-read-results .most-read-item:hover {
    background: #292929;
    border-color: #a78b5b;
    box-shadow: 0 9px 24px rgba(0,0,0,.3);
}

html[data-mode="dark"] .category-page .most-read-results .most-read-num {
    color: #c7a46c;
}

html[data-mode="dark"] .category-page .most-read-results .most-read-title {
    color: #f0ece5;
}

html[data-mode="dark"] .category-page .most-read-results .most-read-sub {
    color: #aaa;
}

/* Mobile */
@media (max-width: 600px) {
    .category-page .most-read-card {
        padding: 16px;
    }

    .category-page .most-read-results .most-read-item {
        min-height: 85px;
        padding: 16px 13px !important;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .category-page .most-read-results .most-read-item {
        transition: none;
    }

    .category-page .most-read-results .most-read-item:hover {
        transform: none;
    }
}
