/* अध्ययनसार — Recovery Phase 4 shared hub visual cleanup
   A lightweight override layer for major index/gateway pages only.
   It normalizes spacing, heading scale, cards, overflow and mobile behavior
   without changing page data, routing or interaction logic.
*/

body[data-ds="2031"] :where(
  .ca2031-main,.geo-index,.history-hub-main,.economics-hub-main,
  main.as-home,.ca-topic-main,.pyq-front-main,.tests-hub
){min-width:0;}

body[data-ds="2031"] :where(
  .ca2031-main,.geo-index,.history-hub-main,.economics-hub-main,
  main.as-home,.ca-topic-main,.pyq-front-main,.tests-hub
) :where(h1,h2,h3,h4,strong,a){
  overflow-wrap:anywhere;
}

body[data-ds="2031"] :where(
  .ds-breadcrumb,.as-breadcrumb,.history-hub-breadcrumb,.economics-breadcrumb,.ca-breadcrumb
){
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:var(--ds-space-2);
  min-height:32px;
  margin-bottom:var(--ds-space-4);
  color:var(--ds-text-muted);
  font-size:var(--ds-text-xs);
  line-height:1.5;
}
body[data-ds="2031"] :where(
  .ds-breadcrumb,.as-breadcrumb,.history-hub-breadcrumb,.economics-breadcrumb,.ca-breadcrumb
) a{
  color:var(--ds-primary-strong);
  text-decoration:none;
}
body[data-ds="2031"] :where(
  .ds-breadcrumb,.as-breadcrumb,.history-hub-breadcrumb,.economics-breadcrumb,.ca-breadcrumb
) a:hover{text-decoration:underline;text-underline-offset:3px;}

/* Shared page-title rhythm */
body[data-ds="2031"] :where(
  .ca2031-hero h1,.geo-index>h1,.history-hub-head h1,.economics-hub-head h1,
  main.as-home>.as-home-heading h1,.ca-topic-head h1,.pyq-front-title h1,.tests-hub-head h1
){
  margin-top:0;
  color:var(--ds-heading);
  font-family:var(--ds-font-body);
  font-size:var(--ds-text-h1);
  font-weight:800;
  line-height:1.3;
  letter-spacing:0;
  text-wrap:balance;
}
body[data-ds="2031"] :where(
  .ca2031-hero-lead,.history-hub-head>p,.economics-hub-head>p,
  main.as-home>.as-home-heading>p,.ca-topic-head>p,.tests-hub-head>p
){
  max-width:72ch;
  color:var(--ds-text-muted);
  font-size:var(--ds-text-body);
  line-height:1.7;
}

/* Current Affairs */
body[data-ds="2031"] .ca2031-hero{padding:var(--ds-space-8) 0 var(--ds-space-6);}
body[data-ds="2031"] .ca2031-main{padding:var(--ds-space-6) 0 var(--ds-space-16);}
body[data-ds="2031"] .ca2031-grid{gap:var(--ds-space-5);}
body[data-ds="2031"] .ca2031-panel{
  border-radius:var(--ds-radius-md);
  box-shadow:none;
}
body[data-ds="2031"] .ca2031-panel-head{min-height:56px;padding-inline:var(--ds-space-4);}
body[data-ds="2031"] .ca2031-panel-head h2{font-size:var(--ds-text-h4)!important;line-height:1.4;}
body[data-ds="2031"] .ca2031-item{min-width:0;}
body[data-ds="2031"] .ca2031-item:hover{background:var(--ds-primary-soft);}

/* Geography master index: compact enough for hundreds of entries, still touch-safe */
body[data-ds="2031"] .geo-index{
  width:min(var(--ds-content-max),calc(100% - 32px));
  padding:var(--ds-space-8) 0 var(--ds-space-16);
}
body[data-ds="2031"] .geo-index>h1{margin-bottom:var(--ds-space-6);}
body[data-ds="2031"] .geo-list{border-radius:var(--ds-radius-md);box-shadow:none;}
body[data-ds="2031"] .topic-line{
  min-width:0;
  padding-block:10px;
  font-size:var(--ds-text-ui);
  line-height:1.55;
}
body[data-ds="2031"] .section-line{
  padding-block:var(--ds-space-3);
  background:var(--ds-primary-soft);
  font-size:1.05rem;
}
body[data-ds="2031"] .chapter-line{font-size:var(--ds-text-ui);}
body[data-ds="2031"] .sub-line{font-size:var(--ds-text-sm);}

/* History */
body[data-ds="2031"] .history-hub-main{padding:var(--ds-space-6) 0 var(--ds-space-16);}
body[data-ds="2031"] .history-hub-head{padding:var(--ds-space-6) 0 var(--ds-space-5);}
body[data-ds="2031"] .history-taxonomy-group{
  margin-top:var(--ds-space-8);
  overflow:hidden;
  border:1px solid var(--ds-border);
  border-radius:var(--ds-radius-md);
  background:var(--ds-surface);
}
body[data-ds="2031"] .history-taxonomy-head{padding:var(--ds-space-4);}
body[data-ds="2031"] .history-topic-row{
  min-height:68px;
  grid-template-columns:44px minmax(0,1fr) 28px;
  padding:var(--ds-space-3) var(--ds-space-4);
}
body[data-ds="2031"] .history-topic-row:hover{background:var(--ds-primary-soft);}

/* Economy */
body[data-ds="2031"] .economics-hub-main{padding:var(--ds-space-6) 0 var(--ds-space-16);}
body[data-ds="2031"] .economics-hub-head{padding:var(--ds-space-6) 0 var(--ds-space-5);}
body[data-ds="2031"] :where(.economics-chapter-list,.economics-advanced-list){
  overflow:hidden;
  border-radius:var(--ds-radius-md);
  box-shadow:none;
}
body[data-ds="2031"] .economics-chapter-row{
  min-height:84px;
  grid-template-columns:46px minmax(0,1fr) 34px;
  gap:var(--ds-space-3);
  padding:var(--ds-space-3) var(--ds-space-4);
  transition:background var(--ds-transition-fast);
}
body[data-ds="2031"] .economics-chapter-row:hover{
  background:var(--ds-primary-soft);
  transform:none;
}
body[data-ds="2031"] .economics-chapter-row strong{font-size:1rem;line-height:1.45;}
body[data-ds="2031"] .economics-row-english{font-size:var(--ds-text-xs);}

/* Environment hub, which intentionally reuses lightweight home primitives */
body[data-ds="2031"] main.as-home{
  width:min(var(--ds-content-max),calc(100% - 32px));
  margin-inline:auto;
  padding:var(--ds-space-8) 0 var(--ds-space-16);
}
body[data-ds="2031"] main.as-home>.as-breadcrumb{margin-bottom:var(--ds-space-5);}
body[data-ds="2031"] main.as-home>.as-home-heading{
  padding-bottom:var(--ds-space-5);
  border-bottom:1px solid var(--ds-border);
}
body[data-ds="2031"] main.as-home>.as-home-heading h1{margin-bottom:var(--ds-space-2);}
body[data-ds="2031"] main.as-home>.as-home-heading p{margin:0;}
body[data-ds="2031"] main.as-home>.as-home-section{margin-top:var(--ds-space-8);}
body[data-ds="2031"] main.as-home>.as-home-section>h2{
  margin:0 0 var(--ds-space-3);
  padding-bottom:var(--ds-space-3);
  border-bottom:1px solid var(--ds-border);
  color:var(--ds-heading);
  font-size:var(--ds-text-h3);
}
body[data-ds="2031"] main.as-home .as-home-row:hover,
body[data-ds="2031"] main.as-home .as-home-subjects a:hover{background:var(--ds-primary-soft);}

/* Static GK + Reference index pages */
body[data-ds="2031"] .ca-topic-main{padding:var(--ds-space-6) 0 var(--ds-space-16);}
body[data-ds="2031"] .ca-topic-shell{
  width:min(var(--ds-content-max),calc(100% - 32px));
  max-width:var(--ds-content-max);
}
body[data-ds="2031"] .ca-topic-head{padding-bottom:var(--ds-space-5);}
body[data-ds="2031"] .ca-topic-article>section{margin-top:var(--ds-space-8);}
body[data-ds="2031"] .ca-topic-article>section>h2{
  margin:0 0 var(--ds-space-3)!important;
  color:var(--ds-heading);
  font-size:var(--ds-text-h3)!important;
  line-height:1.4;
}
body[data-ds="2031"] .ca-related>div{gap:var(--ds-space-2);}
body[data-ds="2031"] .ca-related a{
  min-width:0;
  min-height:52px;
  border-radius:var(--ds-radius-md);
  background:var(--ds-surface);
}
body[data-ds="2031"] .ca-related a:hover{background:var(--ds-primary-soft);}

/* PYQ gateway */
body[data-ds="2031"] .pyq-front-main{padding:var(--ds-space-6) 0 var(--ds-space-16);}
body[data-ds="2031"] .pyq-front-title{padding:var(--ds-space-4) 0 var(--ds-space-5);}
body[data-ds="2031"] .pyq-front-cards{gap:var(--ds-space-4);}
body[data-ds="2031"] .pyq-front-card{
  min-height:164px;
  border-radius:var(--ds-radius-md);
  box-shadow:none;
}
body[data-ds="2031"] .pyq-front-card-inner{
  min-height:164px;
  padding:var(--ds-space-6);
}
body[data-ds="2031"] .pyq-front-card:hover{background:var(--ds-primary-soft);}

/* Tests gateway: remove its one-off oversized/shadowed visual language */
body[data-ds="2031"] .tests-hub{
  min-height:0;
  padding:var(--ds-space-6) var(--ds-space-4) var(--ds-space-16);
}
body[data-ds="2031"] .tests-hub-shell{
  width:min(var(--ds-content-max),100%);
  margin-inline:auto;
}
body[data-ds="2031"] .tests-hub-head{margin-bottom:var(--ds-space-5);}
body[data-ds="2031"] .tests-hub-head h1{margin:0 0 var(--ds-space-2);}
body[data-ds="2031"] .tests-hub-head p{margin:0;}
body[data-ds="2031"] .tests-grid{gap:var(--ds-space-4);}
body[data-ds="2031"] .exam-card{
  gap:var(--ds-space-4);
  padding:var(--ds-space-5);
  border:1px solid var(--ds-border);
  border-radius:var(--ds-radius-md);
  background:var(--ds-surface);
  box-shadow:none;
  transition:background var(--ds-transition-fast),border-color var(--ds-transition-fast);
}
body[data-ds="2031"] .exam-card:hover{
  transform:none;
  border-color:var(--ds-border-strong);
  background:var(--ds-primary-soft);
  box-shadow:none;
}
body[data-ds="2031"] .exam-card-label{color:var(--ds-primary);font-size:var(--ds-text-xs);}
body[data-ds="2031"] .exam-card h2{
  margin:0 0 var(--ds-space-2);
  color:var(--ds-heading);
  font-size:1.05rem;
  line-height:1.45;
}
body[data-ds="2031"] .exam-card p{
  margin:0;
  color:var(--ds-text-muted);
  font-size:var(--ds-text-sm);
  line-height:1.6;
}

@media(max-width:47.999rem){
  body[data-ds="2031"] :where(
    .ca2031-hero-lead,.history-hub-head>p,.economics-hub-head>p,
    main.as-home>.as-home-heading>p,.ca-topic-head>p,.tests-hub-head>p
  ){font-size:1rem;line-height:1.65;}

  body[data-ds="2031"] .ca2031-hero{padding:var(--ds-space-5) 0;}
  body[data-ds="2031"] .ca2031-main{padding:var(--ds-space-5) 0 var(--ds-space-12);}
  body[data-ds="2031"] .ca2031-panel-head{min-height:52px;}

  body[data-ds="2031"] .geo-index{
    width:calc(100% - 32px);
    padding:var(--ds-space-5) 0 var(--ds-space-12);
  }
  body[data-ds="2031"] .geo-index>h1{margin-bottom:var(--ds-space-4);}
  body[data-ds="2031"] .topic-line{padding:9px var(--ds-space-3);font-size:.9rem;line-height:1.5;}
  body[data-ds="2031"] .section-line{padding:var(--ds-space-3);font-size:1rem;}
  body[data-ds="2031"] .chapter-line{padding-inline-start:var(--ds-space-4);font-size:.9rem;}
  body[data-ds="2031"] .sub-line{padding-inline-start:var(--ds-space-6);font-size:.84rem;}

  body[data-ds="2031"] :where(.history-hub-main,.economics-hub-main){
    padding:var(--ds-space-4) 0 var(--ds-space-12);
  }
  body[data-ds="2031"] :where(.history-hub-head,.economics-hub-head){
    padding:var(--ds-space-5) 0 var(--ds-space-4);
  }
  body[data-ds="2031"] .history-taxonomy-group{margin-top:var(--ds-space-6);}
  body[data-ds="2031"] .history-topic-row{
    min-height:62px;
    grid-template-columns:36px minmax(0,1fr) 24px;
    gap:var(--ds-space-2);
    padding:var(--ds-space-3);
  }
  body[data-ds="2031"] .economics-chapter-row{
    min-height:76px;
    grid-template-columns:36px minmax(0,1fr) 26px;
    gap:var(--ds-space-2);
    padding:var(--ds-space-3);
  }
  body[data-ds="2031"] .economics-chapter-row strong{font-size:.92rem;}

  body[data-ds="2031"] main.as-home{
    width:calc(100% - 32px);
    padding:var(--ds-space-5) 0 var(--ds-space-12);
  }

  body[data-ds="2031"] .ca-topic-main{padding:var(--ds-space-5) 0 var(--ds-space-12);}
  body[data-ds="2031"] .ca-topic-shell{width:calc(100% - 32px);}
  body[data-ds="2031"] .ca-topic-article>section{margin-top:var(--ds-space-6);}
  body[data-ds="2031"] .ca-related a{
    align-items:flex-start;
    flex-direction:column;
    gap:var(--ds-space-1);
    padding:var(--ds-space-3);
  }

  body[data-ds="2031"] .pyq-front-main{padding:var(--ds-space-5) 0 var(--ds-space-12);}
  body[data-ds="2031"] .pyq-front-title{padding:var(--ds-space-3) 0 var(--ds-space-4);}
  body[data-ds="2031"] .pyq-front-cards{grid-template-columns:1fr;gap:var(--ds-space-3);}
  body[data-ds="2031"] .pyq-front-card,
  body[data-ds="2031"] .pyq-front-card-inner{min-height:132px;}
  body[data-ds="2031"] .pyq-front-card-inner{padding:var(--ds-space-4);}

  body[data-ds="2031"] .tests-hub{
    padding:var(--ds-space-4) var(--ds-space-4) var(--ds-space-12);
  }
  body[data-ds="2031"] .tests-grid{grid-template-columns:1fr;gap:var(--ds-space-3);}
  body[data-ds="2031"] .exam-card{padding:var(--ds-space-4);}
  body[data-ds="2031"] .exam-card h2{font-size:1rem;}
}

@media(max-width:22.5rem){
  body[data-ds="2031"] .history-topic-row,
  body[data-ds="2031"] .economics-chapter-row{
    grid-template-columns:30px minmax(0,1fr) 22px;
  }
  body[data-ds="2031"] .ca-related a{padding-inline:var(--ds-space-2);}
}
