/* ==========================================================================
   TGC India – brand typography (2026-11-23)
   Headings, buttons, prices: Sora (geometric, square-ish brand face, 100–800)
   Body, menus, forms:        Hanken Grotesk (clean grotesque, 100–900 + italics)
   Hindi characters fall back automatically to Noto Sans Devanagari.
   Icon fonts (FontAwesome .fa, site icons .icon-*, .glyphicon, YouTube player) are excluded.
   To undo: remove the TGC typography <link> lines from layouts/app.blade.php.
   ========================================================================== */

:root {
  --tgc-font: "Hanken Grotesk", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --tgc-head: "Sora", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* NOTE: keep the :not() conditions glued to :where(...) with NO spaces or line breaks –
   whitespace there turns them into a descendant selector and icons would lose their font. */

/* 1. Body family everywhere text appears (overrides older Open Sans / Inter / system / "comic" rules) */
html body,
body :where(h1,h2,h3,h4,h5,h6,p,a,span,li,dt,dd,button,input,select,textarea,option,label,legend,td,th,strong,b,em,small,blockquote,figcaption,div,section,article,aside,nav,header,footer):not(.fa):not([class^="fa-"]):not([class*=" fa-"]):not(.glyphicon):not([class^="icon-"]):not([class*=" icon-"]):not([class*="ytp"]) {
  font-family: var(--tgc-font) !important;
}

/* 2. Brand face for headings, buttons and prices (same specificity as rule 1, later = wins) */
body :where(h1,h2,h3,h4,h5,h6,button,.btn,input[type="submit"],[class*="price"],[class*="fee"]):not(.fa):not([class^="fa-"]):not([class*=" fa-"]):not(.glyphicon):not([class^="icon-"]):not([class*=" icon-"]):not([class*="ytp"]) {
  font-family: var(--tgc-head) !important;
}

/* 3. Rendering */
html body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 4. Headings: confident weights; Sora is wide, so spacing is tightened a little.
      Sizes are left to the existing layout so nothing reflows. */
body h1 { font-weight: 800 !important; letter-spacing: -0.025em !important; line-height: 1.15; }
body h2 { font-weight: 700 !important; letter-spacing: -0.02em !important; line-height: 1.2; }
body h3, body h4 { font-weight: 700 !important; letter-spacing: -0.015em; line-height: 1.25; }
body h5, body h6 { font-weight: 600; letter-spacing: -0.01em; }

/* 5. Readable body copy */
body p { line-height: 1.65; }
body li { line-height: 1.6; }

/* 6. Buttons and form controls */
body button, body .btn, body input[type="submit"] { font-weight: 600; letter-spacing: -0.005em; }
body input, body select, body textarea { font-size: 16px; } /* 16px stops iPhone zoom-on-focus */
body label { font-weight: 600; }

/* 7. Prices, phone numbers, dates line up neatly */
body .price, body [class*="fee"], body [class*="price"] { font-variant-numeric: tabular-nums; }

/* 8. Category menu: keep the one-line menu from wrapping more than before */
@media (min-width: 992px) {
  body .navbar-collapse .navbar-nav > li > a { font-size: 13px !important; }
}

/* ==========================================================================
   LAYOUT & LEGIBILITY LAYER (2026-11-23) – mobile first
   px units on purpose: the legacy CSS sets html { font-size: 10px }, so rem would be wrong.
   Scope: page titles everywhere; full type/spacing scale only inside the long-form reading
   containers below, so cards, menus and banners keep their existing layout.
   Reading containers: .blog_single_content (blog posts) · .uk-accordion-content (course details)
                       · .welcome (about) · .tgg-body (student guides)
   ========================================================================== */
:root {
  /* type scale: phone → desktop (fluid between 375px and 1280px) */
  --fs-small: 14px;
  --fs-body:  clamp(16px, 15.6px + 0.11vw, 17px);
  --fs-lead:  clamp(18px, 17.2px + 0.22vw, 20px);
  --fs-h4:    clamp(18px, 17.2px + 0.22vw, 20px);
  --fs-h3:    clamp(20px, 18.3px + 0.44vw, 24px);
  --fs-h2:    clamp(24px, 20.7px + 0.88vw, 32px);
  --fs-h1:    clamp(30px, 24.2px + 1.55vw, 44px);
  /* spacing scale (8px rhythm) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;
  --measure: 72ch;
}

/* L1. Page titles: one consistent size on every template
       (.homepage-seo-heading is a deliberately hidden SEO heading and is left alone) */
body h1:not(.homepage-seo-heading) {
  font-size: var(--fs-h1) !important;
  line-height: 1.2 !important;          /* 1.2 keeps Hindi vowel marks clear of the line above */
  margin-top: 0;
  margin-bottom: var(--sp-4);
  overflow-wrap: break-word;
}

/* L2. Long-form reading containers: type scale, comfortable line length, vertical rhythm */
body :is(.blog_single_content, .uk-accordion-content, .welcome, .tgg-body) :is(p, li, dd, blockquote) {
  font-size: var(--fs-body) !important;
  line-height: 1.7 !important;
}
body :is(.blog_single_content, .uk-accordion-content, .welcome, .tgg-body) :is(p, ul, ol, blockquote, table) {
  max-width: var(--measure);
}
body :is(.blog_single_content, .uk-accordion-content, .welcome, .tgg-body) p { margin: 0 0 1em; }
body :is(.blog_single_content, .uk-accordion-content, .welcome, .tgg-body) :is(ul, ol) { margin: 0 0 1.2em; padding-left: 1.25em; }
body :is(.blog_single_content, .uk-accordion-content, .welcome, .tgg-body) li { margin-bottom: 0.45em; }
body :is(.blog_single_content, .uk-accordion-content, .welcome, .tgg-body) h2 {
  font-size: var(--fs-h2) !important; line-height: 1.25 !important; margin: 1.6em 0 0.55em !important;
}
body :is(.blog_single_content, .uk-accordion-content, .welcome, .tgg-body) h3 {
  font-size: var(--fs-h3) !important; line-height: 1.3 !important; margin: 1.4em 0 0.5em !important;
}
body :is(.blog_single_content, .uk-accordion-content, .welcome, .tgg-body) h4 {
  font-size: var(--fs-h4) !important; line-height: 1.35 !important; margin: 1.2em 0 0.45em !important;
}
body :is(.blog_single_content, .uk-accordion-content, .welcome, .tgg-body) > :is(h2, h3, h4):first-child { margin-top: 0 !important; }
body :is(.blog_single_content, .uk-accordion-content, .welcome, .tgg-body) img { max-width: 100%; height: auto; margin: var(--sp-5) 0; border-radius: 8px; }
body :is(.blog_single_content, .uk-accordion-content, .welcome, .tgg-body) blockquote { margin: var(--sp-5) 0; padding: var(--sp-4) var(--sp-5); }
/* wide tables scroll inside their own box instead of pushing the page sideways */
body :is(.blog_single_content, .uk-accordion-content, .welcome, .tgg-body) table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; border-collapse: collapse; margin: var(--sp-5) 0; }
body :is(.blog_single_content, .uk-accordion-content, .welcome, .tgg-body) :is(td, th) { padding: var(--sp-2) var(--sp-3); vertical-align: top; }

/* L3. Wrapping safety: long words, URLs and mixed-script text never spill out of their box */
body :where(p, li, dd, dt, td, th, figcaption, blockquote, h1, h2, h3, h4, h5, h6, label) { overflow-wrap: break-word; }
body :is(.blog_single_content, .uk-accordion-content, .welcome, .tgg-body) a { overflow-wrap: anywhere; }
body :where(pre, code) { white-space: pre-wrap; overflow-wrap: anywhere; }
body :where(img, video, iframe) { max-width: 100%; }
body h2, body h3 { line-height: 1.25; }   /* room for Devanagari marks in mixed headings */

/* L4. Blog list: card titles were rendering at 7px – make them readable */
body .blog-tile .blog-info h2 {
  font-size: 17px !important;
  line-height: 1.35 !important;
  height: auto !important;
  max-height: calc(2 * 1.35em);
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* L4b. Course cards (article.course-info, used in listings): titles were 8px, review text 5px */
body article.course-info h2 { font-size: 16px !important; line-height: 1.35 !important; }
body article.course-info .reviewtext,
body .reviewstars .totalreviews { font-size: 13px !important; line-height: 1.4 !important; }
body article.course-info li span,
body article.course-info li a { font-size: 13px !important; }

/* L4d. Blog post meta line ("Last updated on …") was 6px */
body .blog-title-details .publish-date { font-size: 13px !important; line-height: 1.5 !important; color: #5b5b63; }

/* L4e. Blog page counters ("211+ Videos" etc.) were 6px */
body .count-tile .details p { font-size: 13px !important; line-height: 1.4 !important; }

/* L4c. Student review quotes on course pages: keep lines readable instead of 1,000px+ wide */
body .customer-review p { max-width: var(--measure); font-size: var(--fs-body); line-height: 1.65; }

/* L5. Footer: 12–13px text raised to 14px with comfortable line height */
body footer :is(p, li, a, span, address) { font-size: var(--fs-small) !important; line-height: 1.6 !important; }

/* L6. Phones: comfortable tap targets for real buttons and footer links */
@media (max-width: 767px) {
  body :where(button, .btn, input[type="submit"], input[type="button"]) { min-height: 44px; }
  body footer li a { display: inline-block; padding: 6px 0; }
  body :is(.blog_single_content, .uk-accordion-content, .welcome, .tgg-body) { padding-left: 0; padding-right: 0; }
}
