/* अध्ययनसार Design System 2031 — Geography Family
   Geography hub + long-form chapter pages + master topic compatibility.
   Depends on tokens.css, base.css, typography.css, layout.css, components.css, reading.css.
*/
body[data-ds="2031"].geo-page,
body[data-ds="2031"].master-topic-page,
body[data-ds="2031"]{background:var(--ds-bg);color:var(--ds-text);}

body[data-ds="2031"] .skip-link{
  position:fixed;left:12px;top:8px;z-index:5000;
  transform:translateY(-180%);
  padding:8px 12px;border-radius:var(--ds-radius-sm);
  background:var(--ds-surface-soft);color:var(--ds-heading);text-decoration:none;
  font-size:var(--ds-text-sm);font-weight:750;
}
body[data-ds="2031"] .skip-link:focus{transform:translateY(0);}

/* Geography master index */
body[data-ds="2031"] .geo-index{
  width:min(var(--ds-content-max),calc(100% - 32px));
  max-width:none;
  margin-inline:auto;
  padding:var(--ds-space-10) 0 var(--ds-space-20);
  background:transparent;
}
body[data-ds="2031"] .geo-index>h1{
  margin:0 0 var(--ds-space-8);
  color:var(--ds-heading);
  font-size:var(--ds-text-h1);
  line-height:var(--ds-leading-tight);
}
body[data-ds="2031"] .geo-list{
  overflow:hidden;
  border:1px solid var(--ds-border);
  border-radius:var(--ds-radius-card);
  background:var(--ds-surface);
  box-shadow:none;
}
body[data-ds="2031"] .geo-section{
  padding:0;
  border-bottom:1px solid var(--ds-border);
}
body[data-ds="2031"] .geo-section:last-child{border-bottom:0;}
body[data-ds="2031"] .topic-line{
  margin:0;
  padding:12px var(--ds-space-5);
  font-size:var(--ds-text-body);
  line-height:1.6;
}
body[data-ds="2031"] .topic-line a{color:inherit;text-decoration:none;}
body[data-ds="2031"] .topic-line a:hover{color:var(--ds-primary-strong);text-decoration:underline;text-underline-offset:3px;}
body[data-ds="2031"] .section-line{
  padding:var(--ds-space-4) var(--ds-space-5);
  background:var(--ds-surface-soft);
  color:var(--ds-heading);
  font-size:1.18rem;
  font-weight:800;
}
body[data-ds="2031"] .chapter-block+.chapter-block{border-top:1px solid var(--ds-border);}
body[data-ds="2031"] .chapter-line{
  padding-left:var(--ds-space-6);
  background:var(--ds-surface-soft);
  color:var(--ds-heading);
  font-weight:780;
}
body[data-ds="2031"] .sub-line{
  padding-left:var(--ds-space-10);
  border-top:1px solid color-mix(in srgb,var(--ds-border) 72%,transparent);
  color:var(--ds-text);
  font-weight:580;
}

/* Legacy Geography note -> stable 2031 reading page */
body[data-ds="2031"] main:has(.geo-note){padding:var(--ds-space-8) 0 var(--ds-space-20);}
body[data-ds="2031"] .geo-note{
  width:min(var(--ds-reading-max),calc(100% - 32px));
  max-width:none;
  margin-inline:auto;
  padding:clamp(20px,4vw,36px);
  background:var(--ds-surface);
  border:1px solid var(--ds-border);
  border-radius:var(--ds-radius-card);
  box-shadow:none;
  color:var(--ds-text);
  overflow-wrap:anywhere;
}
body[data-ds="2031"] .note-breadcrumb{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:6px;
  margin:0 0 var(--ds-space-5);
  color:var(--ds-text-muted);
  font-size:var(--ds-text-sm);
  line-height:1.55;
}
body[data-ds="2031"] .note-breadcrumb a{color:inherit;text-decoration:none;}
body[data-ds="2031"] .note-breadcrumb a:hover{color:var(--ds-primary);}
body[data-ds="2031"] .geo-note>h1{
  margin:0 0 var(--ds-space-8);
  padding-bottom:var(--ds-space-4);
  border-bottom:1px solid var(--ds-border);
  color:var(--ds-heading);
  font-family:var(--ds-font-body);
  font-size:var(--ds-text-h1);
  line-height:var(--ds-leading-tight);
}
body[data-ds="2031"] .geo-note :where(h2,h3,h4,h5){color:var(--ds-heading);font-family:var(--ds-font-body);scroll-margin-top:96px;}
body[data-ds="2031"] .geo-note h2{
  margin:var(--ds-space-10) 0 var(--ds-space-4);
  padding-bottom:var(--ds-space-3);
  border-bottom:1px solid var(--ds-border);
  font-size:var(--ds-text-h2);
  line-height:1.35;
}
body[data-ds="2031"] .geo-note h3{margin:var(--ds-space-8) 0 var(--ds-space-3);font-size:var(--ds-text-h3);line-height:1.42;}
body[data-ds="2031"] .geo-note h4{margin:var(--ds-space-6) 0 var(--ds-space-3);font-size:var(--ds-text-h4);line-height:1.48;}
body[data-ds="2031"] .geo-note h5{margin:var(--ds-space-5) 0 var(--ds-space-2);font-size:1.05rem;line-height:1.5;}
body[data-ds="2031"] .geo-note :where(p,li){
  color:var(--ds-text);
  font-size:var(--ds-text-body);
  line-height:var(--ds-leading-body);
}
body[data-ds="2031"] .geo-note p{margin:0 0 1.05em;}
body[data-ds="2031"] .geo-note :where(ul,ol){margin:var(--ds-space-2) 0 var(--ds-space-5);padding-inline-start:1.45em;}
body[data-ds="2031"] .geo-note li+li{margin-top:.45em;}
body[data-ds="2031"] .geo-note strong{color:var(--ds-heading);}
body[data-ds="2031"] .section-break{border:0;border-top:1px solid var(--ds-border);margin:var(--ds-space-6) 0 var(--ds-space-2);}

/* Tables remain locally scrollable; page never scrolls sideways */
body[data-ds="2031"] .table-wrap{
  max-width:100%;
  overflow-x:auto;
  margin:var(--ds-space-5) 0 var(--ds-space-6);
  border:1px solid var(--ds-border);
  border-radius:var(--ds-radius-md);
  background:var(--ds-surface);
  -webkit-overflow-scrolling:touch;
}
body[data-ds="2031"] .geo-note table{width:100%;min-width:640px;border-collapse:collapse;background:var(--ds-surface);}
body[data-ds="2031"] .geo-note :where(th,td){
  padding:12px 14px;
  border-bottom:1px solid var(--ds-border);
  border-right:1px solid var(--ds-border);
  color:var(--ds-text);
  font-size:var(--ds-text-ui);
  line-height:1.6;
  text-align:left;
  vertical-align:top;
}
body[data-ds="2031"] .geo-note th{background:var(--ds-surface-soft);color:var(--ds-heading);font-weight:780;}
body[data-ds="2031"] .geo-note :where(th,td):last-child{border-right:0;}
body[data-ds="2031"] .geo-note tr:last-child td{border-bottom:0;}

/* Stable study-note variants */
body[data-ds="2031"] :where(.fact-line,.key-line,.detail-link,.quote-note,.next-topic){
  margin:var(--ds-space-4) 0 var(--ds-space-5);
  padding:var(--ds-space-3) var(--ds-space-4);
  border:1px solid var(--ds-border);
  border-left:4px solid var(--ds-primary);
  border-radius:var(--ds-radius-md);
  background:var(--ds-surface-soft);
  color:var(--ds-text);
}
body[data-ds="2031"] :where(.fact-line,.key-line,.short-line){font-weight:700;}
body[data-ds="2031"] :where(.detail-link,.next-topic) a{color:var(--ds-primary-strong);text-decoration:none;font-weight:750;}
body[data-ds="2031"] :where(.detail-link,.next-topic) a:hover{text-decoration:underline;text-underline-offset:3px;}
body[data-ds="2031"] .fact-list{margin:var(--ds-space-2) 0 var(--ds-space-5);padding-inline-start:1.45em;}

/* Newer master-topic Geography pages */
body[data-ds="2031"] .master-topic-main{padding:var(--ds-space-8) 0 var(--ds-space-20);}
body[data-ds="2031"] .master-topic-shell{width:min(var(--ds-content-max),calc(100% - 32px));max-width:var(--ds-content-max);margin-inline:auto;}
body[data-ds="2031"] .master-topic{
  width:min(var(--ds-reading-max),100%);
  margin-inline:auto;
  padding:clamp(20px,4vw,36px);
  border:1px solid var(--ds-border);
  border-radius:var(--ds-radius-card);
  background:var(--ds-surface);
  box-shadow:none;
}
body[data-ds="2031"] .master-topic-head{padding:0 0 var(--ds-space-6);border-bottom:1px solid var(--ds-border);}
body[data-ds="2031"] .master-topic-head>span{color:var(--ds-primary);font-size:var(--ds-text-sm);font-weight:800;}
body[data-ds="2031"] .master-topic-head h1{margin:6px 0 var(--ds-space-3);font-size:var(--ds-text-h1);line-height:var(--ds-leading-tight);}
body[data-ds="2031"] .master-topic-head p{margin:0;color:var(--ds-text-muted);font-size:var(--ds-text-body);line-height:var(--ds-leading-body);}
body[data-ds="2031"] .master-topic-toc{
  display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px;
  margin:var(--ds-space-5) 0 var(--ds-space-8);padding:var(--ds-space-4);
  border:1px solid var(--ds-border);border-radius:var(--ds-radius-md);background:var(--ds-surface-soft);}
body[data-ds="2031"] .master-topic-toc strong{color:var(--ds-heading);font-size:var(--ds-text-sm);}
body[data-ds="2031"] .master-topic-toc a{color:var(--ds-text);font-size:var(--ds-text-sm);text-decoration:none;}
body[data-ds="2031"] .master-topic-toc a:hover{color:var(--ds-primary);}
body[data-ds="2031"] .master-topic-section{padding:var(--ds-space-6) 0;border-top:1px solid var(--ds-border);}
body[data-ds="2031"] .master-topic-section:first-child{border-top:0;}
body[data-ds="2031"] :where(.master-topic-section,.master-study-box,.master-revision)>h2,
body[data-ds="2031"] .master-pyq6>h2{margin:0 0 var(--ds-space-3);font-size:var(--ds-text-h3);line-height:1.4;}
body[data-ds="2031"] :where(.master-topic-section p,.master-study-box li,.master-revision li,.master-pyq6 article>p,.master-pyq6 article>ol){
  color:var(--ds-text);font-size:var(--ds-text-body);line-height:var(--ds-leading-body);}
body[data-ds="2031"] .master-topic-section p{margin:0;}
body[data-ds="2031"] :where(.master-study-box,.master-revision,.master-current){
  margin-top:var(--ds-space-6);padding:var(--ds-space-5);
  border:1px solid var(--ds-border);border-left:4px solid var(--ds-primary);
  border-radius:var(--ds-radius-md);background:var(--ds-surface-soft);}
body[data-ds="2031"] :where(.master-study-box,.master-revision) ul{margin:0;padding-inline-start:1.4em;}
body[data-ds="2031"] .master-exam-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--ds-space-3);margin-top:var(--ds-space-6);}
body[data-ds="2031"] .master-exam-grid>div{padding:var(--ds-space-5);border:1px solid var(--ds-border);border-left:4px solid var(--ds-primary);border-radius:var(--ds-radius-md);background:var(--ds-surface);}
body[data-ds="2031"] .master-exam-grid span{display:block;margin-bottom:6px;color:var(--ds-text-muted);font-size:var(--ds-text-sm);font-weight:800;}
body[data-ds="2031"] .master-exam-grid p{margin:0;color:var(--ds-text);font-size:var(--ds-text-body);line-height:1.75;}
body[data-ds="2031"] .master-current>span{color:var(--ds-primary);font-size:var(--ds-text-sm);font-weight:800;}
body[data-ds="2031"] .master-current h2{margin:5px 0 8px;font-size:1.15rem;}
body[data-ds="2031"] .master-current a{font-size:var(--ds-text-sm);font-weight:750;}
body[data-ds="2031"] .master-pyq6{margin-top:var(--ds-space-8);}
body[data-ds="2031"] .master-pyq6 article{padding:var(--ds-space-4) 0;border-top:1px solid var(--ds-border);}
body[data-ds="2031"] .master-pyq6 article:first-of-type{border-top:0;}
body[data-ds="2031"] .master-pyq6 article>div{display:flex;flex-wrap:wrap;gap:6px;}
body[data-ds="2031"] .master-pyq6 article>div span{padding:4px 8px;border:1px solid var(--ds-border);border-radius:var(--ds-radius-pill);background:var(--ds-surface-soft);color:var(--ds-text-muted);font-size:var(--ds-text-xs);font-weight:750;}
body[data-ds="2031"] .study7-network{margin-top:var(--ds-space-6);padding:var(--ds-space-4);border:1px solid var(--ds-border);border-radius:var(--ds-radius-md);background:var(--ds-surface-soft);}
body[data-ds="2031"] .study7-network>strong{display:block;margin-bottom:var(--ds-space-3);color:var(--ds-heading);font-size:var(--ds-text-ui);}
body[data-ds="2031"] .study7-network>div{display:flex;flex-wrap:wrap;gap:var(--ds-space-2);}
body[data-ds="2031"] .study7-network :where(a,span){display:inline-flex;align-items:center;min-height:36px;padding:7px 10px;border:1px solid var(--ds-border);border-radius:var(--ds-radius-sm);background:var(--ds-surface);color:var(--ds-text);text-decoration:none;font-size:var(--ds-text-sm);font-weight:700;}

/* Accessibility / regression guards */
body[data-ds="2031"] .geo-note :where(img,svg,video,canvas),
body[data-ds="2031"] .master-topic :where(img,svg,video,canvas){max-width:100%;height:auto;}
body[data-ds="2031"] :where(.geo-note,.master-topic){min-width:0;}
body[data-ds="2031"] :where(.geo-note,.master-topic) :where(pre,code){white-space:pre-wrap;overflow-wrap:anywhere;}

@media(max-width:47.999rem){
  body[data-ds="2031"] .geo-index{width:min(100% - 24px,var(--ds-content-max));padding:var(--ds-space-6) 0 var(--ds-space-16);}
  body[data-ds="2031"] .topic-line{padding-inline:var(--ds-space-4);}
  body[data-ds="2031"] .chapter-line{padding-left:var(--ds-space-4);}
  body[data-ds="2031"] .sub-line{padding-left:var(--ds-space-6);}
  body[data-ds="2031"] main:has(.geo-note){padding:var(--ds-space-5) 0 var(--ds-space-16);}
  body[data-ds="2031"] .geo-note{width:min(100% - 24px,var(--ds-reading-max));padding:18px 16px;}
  body[data-ds="2031"] .geo-note>h1{font-size:var(--ds-text-h1);margin-bottom:var(--ds-space-6);}
  body[data-ds="2031"] .geo-note h2{font-size:var(--ds-text-h2);margin-top:var(--ds-space-8);}
  body[data-ds="2031"] .geo-note h3{font-size:var(--ds-text-h3);margin-top:var(--ds-space-6);}
  body[data-ds="2031"] .master-topic-main{padding:var(--ds-space-5) 0 var(--ds-space-16);}
  body[data-ds="2031"] .master-topic-shell{width:min(100% - 24px,var(--ds-content-max));}
  body[data-ds="2031"] .master-topic{padding:18px 16px;}
  body[data-ds="2031"] .master-exam-grid{grid-template-columns:1fr;}
  body[data-ds="2031"] .study7-network>div{display:grid;}
  body[data-ds="2031"] .study7-network :where(a,span){width:100%;}
}


/* Geography Note Master v1 — shared concept/article reader */
body[data-ds="2031"] .geo-note.geo-note-master{
  --gnm-sidebar:260px;
  --gnm-gap:1.5rem;
  width:min(1240px,calc(100% - 32px));
  max-width:1240px;
  margin-inline:auto;
  padding:0;
  border:0;
  background:transparent;
  box-shadow:none;
  display:grid;
  grid-template-columns:minmax(220px,var(--gnm-sidebar)) minmax(0,1fr);
  gap:var(--gnm-gap);
  align-items:start;
  overflow:visible;
}
body[data-ds="2031"] .geo-note-master .geo-note-master-head{
  grid-column:1/-1;
  margin:0;
  padding:1.8rem 1.8rem 1.55rem;
  border-bottom:4px solid #ea580c;
  border-radius:16px;
  background:linear-gradient(135deg,#0f172a 0%,#1e3a8a 58%,#1e40af 100%);
  color:#fff;
  box-shadow:0 8px 24px rgba(15,23,42,.07);
}
body[data-ds="2031"] .geo-note-master .geo-note-master-head .note-breadcrumb{
  margin:0 0 .8rem;
  color:#bfdbfe;
  font-size:.8rem;
}
body[data-ds="2031"] .geo-note-master .geo-note-master-head .note-breadcrumb a{
  color:#dbeafe;
}
body[data-ds="2031"] .geo-note-master .geo-note-master-head>h1{
  margin:0;
  padding:0;
  border:0;
  color:#fff;
  font-size:clamp(1.55rem,2.6vw,2.2rem);
  line-height:1.35;
  text-wrap:balance;
}
body[data-ds="2031"] .geo-note-master .geo-note-master-prelude{
  grid-column:2;
  margin:0;
  padding:1.35rem 1.5rem;
  border:1px solid var(--ds-border);
  border-radius:14px;
  background:var(--ds-surface);
  box-shadow:0 5px 18px rgba(15,23,42,.045);
}
body[data-ds="2031"] .geo-note-master .geo-note-master-toc{
  grid-column:1;
  position:sticky;
  top:5.7rem;
  max-height:calc(100dvh - 7rem);
  overflow:auto;
  margin:0;
  padding:0;
  border:1px solid var(--ds-border);
  border-radius:12px;
  background:var(--ds-surface);
  box-shadow:0 3px 14px rgba(15,23,42,.045);
  scrollbar-width:thin;
}
body[data-ds="2031"] .geo-note-master .geo-note-master-toc>strong{
  position:sticky;
  top:0;
  z-index:1;
  display:block;
  padding:.9rem 1rem;
  border-bottom:1px solid var(--ds-border);
  background:var(--ds-surface);
  color:var(--ds-heading);
  font-size:.9rem;
}
body[data-ds="2031"] .geo-note-master .geo-note-master-toc>div{
  display:flex;
  flex-direction:column;
  gap:.12rem;
  padding:.7rem;
}
body[data-ds="2031"] .geo-note-master .geo-note-master-toc a{
  display:block;
  padding:.46rem .58rem;
  border-left:3px solid transparent;
  border-radius:7px;
  color:var(--ds-text);
  text-decoration:none;
  font-size:.81rem;
  font-weight:650;
  line-height:1.48;
}
body[data-ds="2031"] .geo-note-master .geo-note-master-toc a:hover,
body[data-ds="2031"] .geo-note-master .geo-note-master-toc a[aria-current="location"]{
  color:var(--ds-primary);
  border-left-color:var(--ds-primary);
  background:var(--ds-surface-soft);
}
body[data-ds="2031"] .geo-note-master .geo-note-master-section{
  grid-column:2;
  min-width:0;
  margin:0;
  padding:1.45rem 1.55rem;
  border:1px solid var(--ds-border);
  border-radius:14px;
  background:var(--ds-surface);
  box-shadow:0 5px 18px rgba(15,23,42,.045);
}
body[data-ds="2031"] .geo-note-master .geo-note-master-section>h2:first-child{
  margin:0 0 1rem;
  padding:0 0 .75rem;
  border-bottom:2px solid var(--ds-border);
  color:var(--ds-heading);
  font-size:1.28rem;
  line-height:1.42;
}
body[data-ds="2031"] .geo-note-master .geo-note-master-section h3{
  margin:1.35rem 0 .55rem;
  font-size:1.08rem;
}
body[data-ds="2031"] .geo-note-master :where(.table-wrap,table,img,svg,video,canvas){
  max-width:100%;
}
body[data-ds="2031"] .geo-note-master .geo-note-master-section :where(p,li),
body[data-ds="2031"] .geo-note-master .geo-note-master-prelude :where(p,li){
  font-size:var(--as-reader-font,var(--ds-text-body));
  line-height:1.86;
}
body[data-ds="2031"] .geo-note-master .next-topic{
  margin-bottom:0;
}
.geo-note-master-progress{
  position:fixed;
  inset:0 0 auto 0;
  z-index:1200;
  height:4px;
  background:rgba(148,163,184,.18);
  pointer-events:none;
}
.geo-note-master-progress>span{
  display:block;
  width:0;
  height:100%;
  background:linear-gradient(90deg,#2563eb,#ea580c,#059669);
  transition:width .08s linear;
}
@media(max-width:980px){
  body[data-ds="2031"] .geo-note.geo-note-master{
    width:min(100% - 20px,820px);
    grid-template-columns:minmax(0,1fr);
    gap:1rem;
  }
  body[data-ds="2031"] .geo-note-master :is(.geo-note-master-head,.geo-note-master-prelude,.geo-note-master-toc,.geo-note-master-section){
    grid-column:1;
  }
  body[data-ds="2031"] .geo-note-master .geo-note-master-toc{
    position:static;
    max-height:none;
  }
  body[data-ds="2031"] .geo-note-master .geo-note-master-head{
    padding:1.35rem 1.1rem 1.2rem;
    border-radius:13px;
  }
  body[data-ds="2031"] .geo-note-master .geo-note-master-section,
  body[data-ds="2031"] .geo-note-master .geo-note-master-prelude{
    padding:1.1rem 1rem;
    border-radius:12px;
  }
}
