/* ===================================================================
   Ported from NewsCategory.cshtml @section Page_Level_Css.

   ⚠️ EVERY RULE IS SCOPED UNDER `.page-category`. DO NOT REMOVE THE PREFIX.
   See the explanation at the top of home.css — Next.js keeps a route's
   stylesheet in the document after client-side navigation, so unscoped page
   CSS bleeds across pages.

   `.page-category` is set on the root .cust-details-wrapper in CategoryView.tsx.
   =================================================================== */

@media (max-width: 767px) {
  .page-category .imgcategoryswarajpost1 {
    height: 97px;
    overflow: hidden;
  }
}

@media (min-width: 768px) {
  .page-category .imgcategoryswarajpost1 {
    height: 180px;
    overflow: hidden;
  }
}

.page-category .imgcategoryswarajpost {
  height: 250px;
}

.page-category.categorypageswarajpostdiv a:hover,
.page-category .categorypageswarajpostdiv a:hover {
  color: black;
}

/* Section masthead — the H1 the page never had. Styled off the homepage's
   `.section-header h5` (red ink, red underline) so a category page and the
   homepage's section headings read as the same system, just one step larger. */
.page-category .sp-cat-head {
  margin-bottom: 18px;
}

/* Same left-bar treatment as the homepage section heads (see home.css), one
   step larger because here it is the page's H1 rather than a column label. */
.page-category .sp-cat-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--sp-accent);
  margin: 0;
  padding-left: 12px;
  /* Devanagari matras need the extra leading — see the note in globals.css. */
  line-height: 1.4;
  position: relative;
}

.page-category .sp-cat-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 5px;
  border-radius: 2px;
  background: var(--sp-accent);
}

.page-category .sp-cat-page {
  font-weight: 500;
  color: var(--sp-ink-meta);
  font-size: 18px;
}

.page-category .sp-cat-desc {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--sp-ink-lead);
  margin: 12px 0 0;
  /* Bounded measure — a description running the full 1400px viewport is
     unreadable no matter how well it is set. */
  max-width: 74ch;
}

@media (max-width: 767px) {
  .page-category .sp-cat-title {
    font-size: 22px;
  }

  .page-category .sp-cat-page {
    font-size: 15px;
  }

  .page-category .sp-cat-desc {
    font-size: 13.5px;
  }
}

/* Card headline — matched to the homepage card (16px/700) so a story looks the
   same whether it is met on the front page or in its section. */
.page-category .card-text {
  font-size: var(--sp-card) !important;
  font-weight: 700;
  color: var(--sp-ink-head);
  /* Room for Devanagari matras inside the clamp so they aren't clipped. */
  line-height: var(--sp-lh-card);
  margin-bottom: 0;
  /* NOT justified. Justification stretches the word gaps, and in Devanagari
     that pulls apart conjuncts inside a 3-line clamp — the rivers it opens are
     far more distracting than a ragged right edge. */
  text-align: left;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* #a3a3a3 was ~2.5:1 on white — below the WCAG AA floor. The shared meta ink
   clears it and still reads as secondary. */
.page-category .cust-date-time {
  display: inline-block;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--sp-ink-meta);
  letter-spacing: 0.01em;
}

.page-category.cust-details-wrapper,
.page-category .cust-details-wrapper {
  width: 100%;
  height: auto;
}

.page-category .pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.page-category .page-link {
  padding: 10px 15px;
  margin: 0 5px;
  background-color: #061b4d;
  color: white;
  border: 1px solid #ddd;
  text-decoration: none;
  font-size: 14px;
  font-weight: bold;
}

.page-category .page-link.active {
  background-color: red;
  color: white;
  outline: none;
}

.page-category .page-link.active:hover {
  background-color: #061b4d;
  color: white;
}

.page-category .page-link:hover {
  background-color: white;
  color: black;
}

@media (max-width: 576px) {
  .page-category .page-link {
    font-size: 12px;
    padding: 8px 10px;
  }
}

/* Tablet: the card grid lives in a col-md-10 with no sidebar beside it, so the
   empty two columns left a wide dead strip on the right of the page. On
   tablet/phone let the grid use the full width; desktop (≥1025) keeps the .NET
   col-md-10 proportions untouched. */
@media (max-width: 1024px) {
  .page-category .categorypageswarajpostdiv > .row > .col-md-10 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}
