/* v3.8.93 – India-style spacing and card dimensions across the U.S. site.
   Design reference: India v3.34.89.99. No content, search, trading, or results code changes. */
:root {
  --nw-shell: min(1240px, calc(100vw - 56px));
  --shell: min(1240px, calc(100vw - 56px));
}
.nw-shell { width: var(--nw-shell); max-width: 1240px; margin-inline: auto; }
/* Stable editorial rhythm. Sections retain their own background colours. */
@media (min-width: 901px) {
  .section-pad { padding-top: clamp(66px, 6vw, 88px); padding-bottom: clamp(66px, 6vw, 88px); }
  .section-heading { margin-bottom: clamp(28px, 3vw, 42px); }
}
/* The U.S. Education Hub has multiple full-width sections without a shell.
   Preserve the same responsive side gutters as India's education template. */
.education-hub-page :is(.education-library,.education-paths,.educate-glossary,.educate-tools) {
  padding-left: clamp(22px,7vw,112px);
  padding-right: clamp(22px,7vw,112px);
}
/* The education hub's content is not wrapped in .nw-shell in the U.S. template;
   constrain the actual section children so labels and two-up cards match India. */
.education-hub-page :is(.education-library,.education-paths,.educate-glossary,.educate-tools) > :is(
  .education-section-head,.education-guide-filters,.education-guide-groups,.education-guide-empty,
  .education-level-track-grid,.educate-glossary__head,.educate-searchbar,
  .educate-glossary__groups,.educate-tools__compact-head,.educate-tool-links
) { max-width: 1240px; width: 100%; margin-left: auto; margin-right: auto; }
.education-hub-page .education-library .education-guide-group {
  grid-template-columns: 220px minmax(0,1fr); gap: 34px; padding: 34px 0;
}
.education-hub-page .education-library .education-guide-grid {
  display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px;
}
.education-hub-page .education-library .education-guide-card {
  min-width: 0; min-height: 235px; height: auto; padding: 20px; border-radius: 16px;
}
/* India-style heights, but never fix the height: long titles and translated content
   must be free to grow instead of being clipped. */
@media (min-width: 901px) {
  :is(.learn-card-grid,.guide-grid,.story-grid) > a,
  .all-tools-grid > a,.feature-tool-card { min-height: 220px; height: auto; }
  .market-data-hub__cards > a { min-height: 225px; height: auto; }
  .education-topic-hub .topic-guide-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .education-topic-hub .education-guide-card { min-height: 235px; height: auto; }
  .market-discovery-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .etf-catalog { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
/* Keep full-bleed hero backgrounds, but bring their content into the same
   maximum reading width on larger screens. */
@media (min-width: 1250px) {
  .education-hub-page .educate-hero,
  .guide-page-parity .guide-hero,
  .nivata-us-quick-library .educate-hero {
    padding-left: max(28px,calc((100vw - 1240px) / 2));
    padding-right: max(28px,calc((100vw - 1240px) / 2));
  }
  .education-hub-page .search-answer-card,
  .guide-page-parity .search-answer-card {
    padding-left: max(28px,calc((100vw - 1240px) / 2));
    padding-right: max(28px,calc((100vw - 1240px) / 2));
  }
}
/* Quick Library is another unwrapped section. Match the education reading width. */
body.nivata-investing-books-page .nivata-book-library > :is(
  .education-section-head,.nivata-book-controls,.nivata-book-count,
  .nivata-book-categories,.nivata-book-empty
) { max-width: 1240px; width: 100%; margin-left: auto; margin-right: auto; }
/* The U.S. guide article and its navigation should not spread across an
   ultra-wide monitor, but the hero and background bands remain edge-to-edge. */
.guide-page-parity :is(.guide-content,.guide-jump) { max-width: 1240px; margin-left: auto; margin-right: auto; }
@media (min-width: 901px) {
  .guide-page-parity .guide-content { width: min(1240px,calc(100vw - 56px)); padding-left: 0; padding-right: 0; }
}
@media (max-width: 900px) {
  :root { --nw-shell: min(100% - 44px,820px); --shell: min(100% - 44px,820px); }
  .education-hub-page .education-library .education-guide-group { grid-template-columns: minmax(0,1fr); gap: 24px; }
  .education-hub-page .education-library .education-guide-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .education-hub-page .education-library .education-guide-card { min-height: 210px; }
}
@media (max-width: 680px) {
  :root { --nw-shell: calc(100% - 36px); --shell: calc(100% - 36px); }
  .education-hub-page .education-library .education-guide-grid,
  .education-topic-hub .topic-guide-grid { grid-template-columns: minmax(0,1fr); }
  .education-hub-page .education-library .education-guide-card { min-height: 0; }
  :is(.learn-card-grid,.guide-grid,.story-grid) > a,.all-tools-grid > a,
  .feature-tool-card { min-height: 0; height: auto; }
  .guide-page-parity .guide-content { width: auto; }
}
@media (max-width: 390px) {
  :root { --nw-shell: calc(100% - 30px); --shell: calc(100% - 30px); }
}
