/**
 * =========================================================================
 * GK TODAY HINDI — Category Page Layout & Modern Subject Hub Styles
 * 100% Full-Width Edge-to-Edge with Auto Flex-Centered Grid
 * =========================================================================
 */

:root {
  --cat-primary: #4f46e5;
  --cat-primary-dark: #3730a3;
  --cat-accent: #059669;
  --cat-bg: #f8fafc;
  --cat-card-border: #e2e8f0;
  --cat-text-main: #0f172a;
  --cat-text-muted: #64748b;
}

/* 1. Full-Width Edge-to-Edge Page Wrapper (No Wasted Blank Margins) */
.category-page-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 10px 40px 10px !important;
  box-sizing: border-box !important;
  font-family: var(--site-font, 'Plus Jakarta Sans', 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
}
@media (min-width: 768px) {
  .category-page-wrapper {
    padding: 0 16px 50px 16px !important;
  }
}
@media (min-width: 1440px) {
  .category-page-wrapper {
    padding: 0 20px 60px 20px !important;
  }
}

/* Breadcrumb Navigation */
.cat-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: var(--cat-text-muted);
  margin: 12px 0 16px 0;
}
.cat-breadcrumbs a {
  color: var(--cat-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s;
}
.cat-breadcrumbs a:hover {
  color: var(--cat-primary-dark);
  text-decoration: underline;
}
.cat-breadcrumbs .sep {
  color: #cbd5e1;
}

/* Category Hero Banner Card */
.cat-hero-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
  border-radius: 20px;
  padding: 26px 20px;
  color: #ffffff;
  margin-bottom: 22px;
  box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.25);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
@media (min-width: 768px) {
  .cat-hero-card {
    padding: 32px 30px;
  }
}
.cat-hero-card::after {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.22) 0%, rgba(99, 102, 241, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
}
.cat-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 5px 14px;
  border-radius: 50px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  color: #e0e7ff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.cat-hero-title {
  font-size: clamp(22px, 3.2vw, 34px);
  font-weight: 800;
  line-height: 1.3;
  margin: 0 0 10px 0;
  color: #ffffff;
  font-family: var(--site-font, 'Plus Jakarta Sans', 'Noto Sans Devanagari', sans-serif);
}
.cat-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Category Intro SEO Card */
.cat-intro-card {
  background: #ffffff;
  border: 1.5px solid var(--cat-card-border);
  border-radius: 18px;
  padding: 22px 20px;
  margin-bottom: 24px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}
.cat-intro-content {
  font-size: 14.5px;
  line-height: 1.8;
  color: #334155;
  word-break: break-word;
}
.cat-intro-content h2,
.cat-intro-content h3 {
  color: #0f172a;
  font-weight: 800;
  font-size: 18px;
  margin: 16px 0 10px 0;
}
.cat-intro-content p {
  margin: 0 0 12px 0;
}
.cat-intro-content p:last-child {
  margin-bottom: 0;
}
.cat-intro-content ol,
.cat-intro-content ul {
  padding-left: 20px;
  margin: 8px 0 14px 0;
}
.cat-intro-content li {
  margin-bottom: 6px;
}

/* Subjects Section Header */
.subjects-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}
.subjects-title-text {
  font-size: 20px;
  font-weight: 800;
  color: var(--cat-text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--site-font, 'Plus Jakarta Sans', 'Noto Sans Devanagari', sans-serif);
}
.subjects-count-badge {
  font-size: 12px;
  color: #475569;
  font-weight: 700;
  background: #f1f5f9;
  padding: 4px 12px;
  border-radius: 50px;
  border: 1px solid #e2e8f0;
}

/* =========================================================================
   FLEX-CENTERED SUBJECTS GRID (Centered When Rows Have Fewer Items)
   ========================================================================= */
.subjects-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 35px;
  width: 100%;
}

.subject-card {
  flex: 0 0 calc(50% - 6px);
  max-width: calc(50% - 6px);
  background: #ffffff;
  border: 1.5px solid var(--cat-card-border);
  border-radius: 18px;
  padding: 22px 16px 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none !important;
  color: var(--cat-text-main);
  position: relative;
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  box-sizing: border-box;
}

/* Top Accent Bar */
.subject-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--subj-accent, #4f46e5);
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  transition: height 0.2s ease;
}

.subject-card:hover {
  transform: translateY(-4px);
  border-color: var(--subj-accent, #4f46e5);
  box-shadow: 0 14px 28px -6px rgba(79, 70, 229, 0.16);
  text-decoration: none !important;
}
.subject-card:hover::before {
  height: 6px;
}
.subject-card:active {
  transform: translateY(-1px);
}

/* Responsive Columns with Equal Width and Perfect Centering */
@media (min-width: 640px) {
  .subjects-grid { gap: 14px; }
  .subject-card {
    flex: 0 0 calc(33.333% - 10px);
    max-width: calc(33.333% - 10px);
  }
}
@media (min-width: 1024px) {
  .subjects-grid { gap: 16px; }
  .subject-card {
    flex: 0 0 calc(25% - 12px);
    max-width: calc(25% - 12px);
  }
}
@media (min-width: 1440px) {
  .subjects-grid { gap: 18px; }
  .subject-card {
    flex: 0 0 calc(20% - 15px);
    max-width: calc(20% - 15px);
  }
}
@media (min-width: 1800px) {
  .subjects-grid { gap: 20px; }
  .subject-card {
    flex: 0 0 calc(16.666% - 17px);
    max-width: calc(16.666% - 17px);
  }
}

/* Subject Icon Container */
.subject-icon-box {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--subj-bg, #eef2ff);
  color: var(--subj-accent, #4f46e5);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  border: 1.5px solid var(--subj-border, rgba(99, 102, 241, 0.18));
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.subject-card:hover .subject-icon-box {
  transform: scale(1.08);
  box-shadow: 0 6px 16px -4px rgba(15, 23, 42, 0.12);
}
.subject-icon-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}
.subject-icon-glyph {
  font-size: 27px;
  line-height: 1;
  color: var(--subj-accent, #4f46e5);
}

/* Subject Title */
.subject-title {
  font-size: 15.5px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 6px 0;
  line-height: 1.35;
  transition: color 0.15s;
  font-family: var(--site-font, 'Plus Jakarta Sans', 'Noto Sans Devanagari', sans-serif);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
}
.subject-card:hover .subject-title {
  color: var(--subj-accent, #4f46e5);
}

/* Subject Optional 1-2 Line Subtitle */
.subject-subtitle {
  font-size: 11.5px;
  font-weight: 500;
  color: #64748b;
  margin: 0 0 10px 0;
  line-height: 1.38;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 31px;
}

/* Highlight Badge Chip (when not overridden by Today Bell) */
.subject-badge-chip {
  position: absolute;
  top: 9px;
  right: 9px;
  background: var(--subj-bg, #eef2ff);
  color: var(--subj-accent, #4f46e5);
  border: 1px solid var(--subj-border, rgba(99, 102, 241, 0.22));
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 50px;
  z-index: 2;
}

/* Subject Meta Badges */
.subject-meta-pill {
  background: #f8fafc;
  color: #475569;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 50px;
  border: 1px solid #e2e8f0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 12px;
  transition: all 0.15s ease;
}
.subject-card:hover .subject-meta-pill {
  background: var(--subj-bg, #eef2ff);
  color: var(--subj-accent, #4f46e5);
  border-color: rgba(99, 102, 241, 0.25);
}

/* Subject Card Footer */
.subject-card-footer {
  margin-top: auto;
  width: 100%;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: var(--subj-accent, #4f46e5);
}
.footer-arrow {
  transition: transform 0.2s ease;
}
.subject-card:hover .footer-arrow {
  transform: translateX(4px);
}

/* Header-Style Circle Notification Bell + Digit Badge on Subject Cards */
.subject-new-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.subject-card:hover .subject-new-tag {
  transform: scale(1.07);
  background: #f1f5f9;
  color: #0f172a;
}
.subject-new-tag .bell-ring {
  font-size: 13.5px;
  line-height: 1;
}
.subject-notif-digit {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  font-family: var(--site-font, 'Plus Jakarta Sans', 'Noto Sans Devanagari', sans-serif);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.38);
  pointer-events: none;
}
@media (max-width: 480px) {
  .subject-new-tag {
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
  }
  .subject-new-tag .bell-ring {
    font-size: 12.5px;
  }
}
.bell-ring {
  animation: bellSwing 2s ease-in-out infinite;
  transform-origin: top center;
  display: inline-block;
}
@keyframes bellSwing {
  0% { transform: rotate(0deg); }
  10% { transform: rotate(20deg); }
  20% { transform: rotate(-20deg); }
  30% { transform: rotate(14deg); }
  40% { transform: rotate(-14deg); }
  50% { transform: rotate(6deg); }
  60% { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}

/* Bottom Syllabus & Study Notes Card */
.cat-notes-card {
  background: #ffffff;
  border: 1.5px solid var(--cat-card-border);
  border-radius: 18px;
  padding: 24px 20px;
  margin-top: 24px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

/* Ad Placement Containers (0 CLS) */
.category-ad-wrapper {
  width: 100%;
  min-height: 90px;
  margin: 15px 0 22px 0;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
}
