/* ==========================================================================
   MarathiGrammar.one — Theme stylesheet  (saffron & indigo)
   Layered on top of Bootstrap 5. Custom properties drive the whole palette.
   ========================================================================== */

:root {
  --mg-saffron:      #E8751A;
  --mg-saffron-600:  #cf6410;
  --mg-saffron-700:  #b1550c;
  --mg-saffron-050:  #FEF3E8;
  --mg-indigo:       #2D2A6E;
  --mg-indigo-700:   #232057;
  --mg-indigo-800:   #1b1945;
  --mg-indigo-050:   #EEEDF8;
  --mg-gold:         #F6B93B;
  --mg-purple:       #7a3fa0;
  --mg-ink:          #20233b;
  --mg-body:         #40465c;
  --mg-muted:        #6b7180;
  --mg-cream:        #FFF9F3;
  --mg-line:         #eceaf3;
  --mg-white:        #ffffff;

  --mg-font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --mg-font-head: 'Sora', 'Inter', system-ui, sans-serif;
  --mg-font-mr:   'Mukta', 'Noto Sans Devanagari', 'Inter', sans-serif;

  --mg-radius:     18px;
  --mg-radius-sm:  12px;
  --mg-shadow:     0 10px 30px rgba(28, 26, 74, 0.08);
  --mg-shadow-lg:  0 24px 60px rgba(28, 26, 74, 0.16);
  --mg-container:  1180px;
}

/* ----------------------------------------------------------------- Base */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--mg-font-body);
  color: var(--mg-body);
  font-size: 1.0625rem;
  line-height: 1.75;
  background: var(--mg-white);
  overflow-x: hidden;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--mg-font-head); color: var(--mg-ink); line-height: 1.2; font-weight: 700; }
p { margin: 0 0 1rem; }
a { color: var(--mg-saffron-600); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--mg-saffron-700); text-decoration: underline; }
img { max-width: 100%; height: auto; }
[lang="mr"], .mr { font-family: var(--mg-font-mr); font-feature-settings: "kern"; }
strong { color: var(--mg-ink); }
.container { max-width: var(--mg-container); }
section[id] { scroll-margin-top: 92px; }
::selection { background: rgba(232,117,26,.2); }

.mg-skip { position: absolute; left: -999px; top: 0; z-index: 3000;
  background: var(--mg-indigo); color: #fff; padding: .6rem 1rem; border-radius: 0 0 8px 0; }
.mg-skip:focus { left: 0; }

/* ----------------------------------------------------------------- Buttons */
.mg-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--mg-font-head); font-weight: 600; font-size: 1rem; line-height: 1;
  padding: .85rem 1.5rem; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; text-decoration: none; }
.mg-btn:hover { text-decoration: none; transform: translateY(-2px); }
.mg-btn--primary { background: linear-gradient(135deg, var(--mg-saffron), var(--mg-gold)); color: #fff;
  box-shadow: 0 10px 24px rgba(232,117,26,.35); }
.mg-btn--primary:hover { color: #fff; box-shadow: 0 14px 30px rgba(232,117,26,.45); }
.mg-btn--indigo { background: var(--mg-indigo); color: #fff; }
.mg-btn--indigo:hover { color: #fff; background: var(--mg-indigo-700); }
.mg-btn--light { background: #fff; color: var(--mg-indigo); }
.mg-btn--light:hover { color: var(--mg-saffron-700); }
.mg-btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.mg-btn--ghost:hover { color: #fff; border-color: #fff; background: rgba(255,255,255,.08); }
.mg-btn--outline { background: transparent; color: var(--mg-indigo); border-color: var(--mg-line); }
.mg-btn--outline:hover { color: var(--mg-saffron-700); border-color: var(--mg-saffron); }
.mg-btn--lg { padding: 1rem 1.8rem; font-size: 1.05rem; }
.mg-btn--sm { padding: .55rem 1rem; font-size: .9rem; }

/* ----------------------------------------------------------------- Topbar */
.mg-topbar { background: var(--mg-indigo-800); color: rgba(255,255,255,.82); font-size: .82rem; padding: .4rem 0; }
.mg-topbar__tag { letter-spacing: .01em; }
.mg-topbar__social a { color: rgba(255,255,255,.75); font-size: 1rem; margin-left: .9rem; }
.mg-topbar__social a:hover { color: #fff; }

/* ----------------------------------------------------------------- Header / Nav */
.mg-header { position: sticky; top: 0; z-index: 1020; background: #fff; border-bottom: 1px solid var(--mg-line);
  box-shadow: 0 2px 14px rgba(28,26,74,.05); }
.mg-navbar { padding: .55rem 0; }

.mg-brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; }
.mg-brand:hover { text-decoration: none; }
.mg-brand__mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--mg-saffron), var(--mg-gold)); color: #fff; font-size: 1.4rem;
  font-family: var(--mg-font-mr); font-weight: 700; box-shadow: 0 6px 16px rgba(232,117,26,.35); }
.mg-brand__text { display: inline-flex; align-items: baseline; }
.mg-brand__name { font-family: var(--mg-font-head); font-weight: 800; font-size: 1.28rem; color: var(--mg-indigo); letter-spacing: -.01em; }
.mg-brand__name span { color: var(--mg-saffron); }
.mg-brand__dot { font-family: var(--mg-font-head); font-weight: 700; color: var(--mg-muted); font-size: 1.05rem; }

.mg-navbar .nav-link { color: var(--mg-ink); font-weight: 500; padding: .5rem .85rem; border-radius: 8px; position: relative; }
.mg-navbar .nav-link:hover, .mg-navbar .nav-link.active { color: var(--mg-saffron-700); text-decoration: none; }
.mg-navbar .nav-link.active::after { content: ""; position: absolute; left: .85rem; right: .85rem; bottom: .2rem; height: 2px;
  background: var(--mg-saffron); border-radius: 2px; }

/* Mega menu */
.mg-mega { border: 0; border-radius: 16px; box-shadow: var(--mg-shadow-lg); padding: 1.6rem 0; margin-top: .5rem;
  width: min(940px, 94vw); }
.mg-mega .container { max-width: 100%; }
.mg-mega__title { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700;
  color: var(--mg-saffron-600); margin-bottom: .7rem; }
.mg-mega__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .35rem; }
.mg-mega__list a { color: var(--mg-body); font-weight: 500; font-size: .95rem; text-decoration: none; }
.mg-mega__list a:hover { color: var(--mg-saffron-700); }
.mg-mega__all { display: inline-flex; align-items: center; gap: .4rem; margin-top: 1.2rem; margin-left: calc(var(--bs-gutter-x, 1.5rem) * .5);
  font-family: var(--mg-font-head); font-weight: 600; color: var(--mg-indigo); }
.mg-mega__all:hover { color: var(--mg-saffron-700); }

@media (min-width: 992px) {
  .mg-mega-parent { position: static; }
  .mg-mega { left: 50%; transform: translateX(-50%); }
  .mg-mega-parent:hover > .dropdown-menu { display: block; }
  .navbar-nav { gap: .1rem; }
}

/* Search box */
.mg-search { display: flex; align-items: center; background: var(--mg-cream); border: 1px solid var(--mg-line);
  border-radius: 999px; padding: .15rem .15rem .15rem .9rem; margin-left: .6rem; }
.mg-search input { border: 0; background: transparent; outline: none; font-size: .92rem; width: 150px; box-shadow: none; padding: .3rem 0; }
.mg-search input:focus { box-shadow: none; }
.mg-search button { border: 0; background: var(--mg-saffron); color: #fff; width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center; cursor: pointer; }
.mg-search button:hover { background: var(--mg-saffron-700); }
@media (max-width: 991.98px) {
  .mg-nav-search { margin-top: .8rem; }
  .mg-search { margin-left: 0; }
  .mg-search input { width: 100%; }
  .mg-mega { box-shadow: none; padding: .4rem 0 .8rem; margin-top: 0; width: auto; }
  .mg-mega .row { --bs-gutter-y: 1rem; }
  .mg-mega__all { margin-left: 0; }
}

/* ----------------------------------------------------------------- Breadcrumb */
.mg-breadcrumb { background: var(--mg-cream); border-bottom: 1px solid var(--mg-line); padding: .65rem 0; font-size: .9rem; }
.mg-breadcrumb .breadcrumb { --bs-breadcrumb-divider: '›'; }
.mg-breadcrumb .breadcrumb-item a { color: var(--mg-muted); text-decoration: none; }
.mg-breadcrumb .breadcrumb-item a:hover { color: var(--mg-saffron-700); }
.mg-breadcrumb .breadcrumb-item.active { color: var(--mg-indigo); font-weight: 600; }
.mg-breadcrumb .breadcrumb-item + .breadcrumb-item::before { color: var(--mg-muted); }

/* ----------------------------------------------------------------- Sections & headings */
.mg-section { padding: 72px 0; position: relative; }
.mg-section--tint { background: var(--mg-cream); }
.mg-section--indigo { background:
  radial-gradient(700px 300px at 100% 0, rgba(122,63,160,.35), transparent 60%),
  linear-gradient(160deg, var(--mg-indigo-700), var(--mg-indigo)); color: rgba(255,255,255,.86); }
.mg-section--indigo h2, .mg-section--indigo h3, .mg-section--indigo .mg-h2, .mg-section--indigo .mg-h3 { color: #fff; }
.mg-section--indigo .mg-h2 span[lang="mr"] { color: var(--mg-gold); }

.mg-eyebrow { display: inline-flex; align-items: center; gap: .45rem; text-transform: uppercase;
  letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--mg-saffron-600); margin-bottom: .6rem; }
.mg-eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--mg-saffron); display: inline-block; }
.mg-h2 { font-family: var(--mg-font-head); font-weight: 800; font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  color: var(--mg-indigo); line-height: 1.15; margin-bottom: 1rem; letter-spacing: -.01em; }
.mg-h2 span[lang="mr"] { color: var(--mg-saffron-600); font-weight: 700; }
.mg-h3 { font-family: var(--mg-font-head); font-weight: 700; font-size: 1.3rem; color: var(--mg-indigo); margin: 1.8rem 0 .7rem; }
.mg-lead { font-size: 1.16rem; color: var(--mg-ink); line-height: 1.7; }
.mg-section__head { max-width: 760px; margin: 0 auto 2.6rem; text-align: center; }
.mg-section__head .mg-eyebrow { justify-content: center; }
.mg-prose p { margin-bottom: 1rem; }
.mg-prose ul, .mg-prose ol { margin: 0 0 1.1rem; padding-left: 1.2rem; }
.mg-prose li { margin-bottom: .4rem; }

/* ----------------------------------------------------------------- Cards */
.mg-card { background: #fff; border: 1px solid var(--mg-line); border-radius: var(--mg-radius);
  padding: 1.6rem; height: 100%; transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  box-shadow: 0 1px 2px rgba(20,20,50,.04); }
.mg-card:hover { transform: translateY(-5px); box-shadow: var(--mg-shadow); border-color: #e2ddf0; }
.mg-card__icon { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem;
  background: var(--mg-saffron-050); color: var(--mg-saffron-600); margin-bottom: 1rem; }
.mg-card__icon--indigo { background: var(--mg-indigo-050); color: var(--mg-indigo); }
.mg-card__title { font-family: var(--mg-font-head); font-weight: 700; color: var(--mg-indigo); font-size: 1.15rem; margin-bottom: .4rem; }
.mg-card__text { color: var(--mg-muted); font-size: .97rem; margin: 0; }
.mg-card--link { display: block; text-decoration: none; color: inherit; }
.mg-card--link:hover { text-decoration: none; color: inherit; }
.mg-card__meta { display: flex; align-items: center; gap: .5rem; margin-top: 1rem; font-size: .85rem; color: var(--mg-muted); }
.mg-card__num { width: 40px; height: 40px; border-radius: 50%; background: var(--mg-indigo); color: #fff;
  display: grid; place-items: center; font-family: var(--mg-font-head); font-weight: 700; margin-bottom: .9rem; }
.mg-card__link { font-family: var(--mg-font-head); font-weight: 600; color: var(--mg-saffron-600); display: inline-flex; align-items: center; gap: .35rem; margin-top: .8rem; }

/* ----------------------------------------------------------------- Pills / badges */
.mg-pill { display: inline-block; background: var(--mg-saffron-050); color: var(--mg-saffron-700);
  border-radius: 999px; padding: .18em .8em; font-size: .82rem; font-weight: 600; }
.mg-pill--indigo { background: var(--mg-indigo-050); color: var(--mg-indigo); }
.mg-pill--soft { background: rgba(255,255,255,.14); color: #fff; }

/* ----------------------------------------------------------------- Callout boxes */
.mg-box { border-radius: 14px; padding: 1.1rem 1.25rem; margin: 1.5rem 0; border-left: 5px solid; background: #f7f7fb; }
.mg-box p:last-child { margin-bottom: 0; }
.mg-box__title { font-family: var(--mg-font-head); font-weight: 700; font-size: 1rem; margin-bottom: .4rem; display: flex; align-items: center; gap: .45rem; }
.mg-box__title::before { font-size: 1.05rem; }
.mg-box--tip { border-color: #1a9d6b; background: #eafaf3; }
.mg-box--tip .mg-box__title { color: #12805a; } .mg-box--tip .mg-box__title::before { content: "💡"; }
.mg-box--note { border-color: #3a6df0; background: #eef3ff; }
.mg-box--note .mg-box__title { color: #2749c9; } .mg-box--note .mg-box__title::before { content: "📝"; }
.mg-box--warn { border-color: #e0a800; background: #fff8e6; }
.mg-box--warn .mg-box__title { color: #98700a; } .mg-box--warn .mg-box__title::before { content: "⚠️"; }
.mg-box--example { border-color: var(--mg-saffron); background: var(--mg-saffron-050); }
.mg-box--example .mg-box__title { color: var(--mg-saffron-700); } .mg-box--example .mg-box__title::before { content: "🔎"; }
.mg-box--insight { border-color: var(--mg-purple); background: #f5eefb; }
.mg-box--insight .mg-box__title { color: #5f2d86; } .mg-box--insight .mg-box__title::before { content: "🎓"; }

/* ----------------------------------------------------------------- Tables */
.mg-table { width: 100%; margin: 0; background: #fff; border-collapse: separate; border-spacing: 0; }
.table-responsive { border-radius: 14px; border: 1px solid var(--mg-line); margin: 1.4rem 0; overflow: hidden; box-shadow: 0 1px 2px rgba(20,20,50,.03); }
.mg-table thead th { background: var(--mg-indigo); color: #fff; font-family: var(--mg-font-head); font-weight: 600;
  border: 0; padding: .8rem .9rem; font-size: .95rem; vertical-align: middle; }
.mg-table tbody td, .mg-table tbody th { padding: .7rem .9rem; border-top: 1px solid var(--mg-line); vertical-align: top; color: var(--mg-body); }
.mg-table tbody th { font-weight: 600; color: var(--mg-ink); }
.mg-table--zebra tbody tr:nth-child(odd) { background: #faf9fd; }
.mg-table td[lang="mr"], .mg-table th[lang="mr"], .mg-table .mr { font-family: var(--mg-font-mr); font-size: 1.05rem; }
.mg-table caption { caption-side: bottom; padding: .6rem .2rem; color: var(--mg-muted); font-size: .85rem; }

/* ----------------------------------------------------------------- Examples & practice */
.mg-eg { background: #fff; border: 1px dashed var(--mg-saffron); border-radius: 12px; padding: 1rem 1.2rem; margin: 1.1rem 0; }
.mg-eg__mr { font-family: var(--mg-font-mr); font-size: 1.28rem; color: var(--mg-indigo); font-weight: 500; margin-bottom: .3rem; line-height: 1.5; }
.mg-eg__en { color: var(--mg-muted); font-style: italic; margin: 0; }

.mg-practice { background: var(--mg-indigo-050); border-radius: 12px; padding: 1.05rem 1.25rem; margin: 1.1rem 0; }
.mg-practice__q { font-weight: 600; color: var(--mg-indigo); margin-bottom: .5rem; }
.mg-answer summary { cursor: pointer; color: var(--mg-saffron-700); font-weight: 600; list-style: none; display: inline-flex; align-items: center; gap: .4rem; }
.mg-answer summary::-webkit-details-marker { display: none; }
.mg-answer summary::before { content: "▸"; transition: transform .15s; }
.mg-answer[open] summary::before { content: "▾"; }
.mg-answer > div { margin-top: .55rem; color: var(--mg-body); }
.mg-answer > div p:last-child { margin-bottom: 0; }

/* ----------------------------------------------------------------- Hero */
.mg-hero { position: relative; isolation: isolate; color: #fff; padding: 96px 0 84px; overflow: hidden;
  background:
    radial-gradient(1100px 480px at 12% -10%, rgba(232,117,26,.38), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(122,63,160,.45), transparent 55%),
    linear-gradient(160deg, #211d55 0%, var(--mg-indigo) 55%, #3a2f7a 100%); }
.mg-hero__watermark { position: absolute; inset: 0; z-index: -1; display: grid; place-items: center; pointer-events: none;
  user-select: none; font-family: var(--mg-font-mr); font-weight: 700; font-size: 44vw; line-height: 1; color: rgba(255,255,255,.045); }
.mg-hero__eyebrow { display: inline-flex; align-items: center; gap: .5rem; background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2); color: #fff; padding: .4rem .9rem; border-radius: 999px; font-size: .84rem; font-weight: 600; margin-bottom: 1.3rem; }
.mg-hero h1 { font-family: var(--mg-font-head); font-weight: 800; font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.08; color: #fff; margin-bottom: 1.1rem; letter-spacing: -.015em; }
.mg-hero h1 span[lang="mr"] { color: var(--mg-gold); }
.mg-hero__lead { font-size: 1.2rem; color: rgba(255,255,255,.86); max-width: 600px; margin-bottom: 1.8rem; }
.mg-hero__cta { display: flex; gap: .8rem; flex-wrap: wrap; }
.mg-hero__stats { display: flex; gap: 2.2rem; flex-wrap: wrap; margin-top: 2.4rem; }
.mg-stat__num { font-family: var(--mg-font-head); font-weight: 800; font-size: 1.9rem; color: var(--mg-gold); line-height: 1; }
.mg-stat__label { font-size: .88rem; color: rgba(255,255,255,.7); margin-top: .2rem; }

.mg-hero__card { background: rgba(255,255,255,.08); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.18);
  border-radius: 22px; padding: 1.5rem; box-shadow: var(--mg-shadow-lg); }
.mg-hero__card h3 { color: #fff; font-size: 1.05rem; margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem; }
.mg-hero__barakhadi { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.mg-hero__cell { background: rgba(255,255,255,.1); border-radius: 10px; text-align: center; padding: .55rem .2rem;
  font-family: var(--mg-font-mr); font-size: 1.3rem; color: #fff; border: 1px solid rgba(255,255,255,.12); }
.mg-hero__cell span { display: block; font-family: var(--mg-font-body); font-size: .62rem; color: rgba(255,255,255,.6); margin-top: .1rem; }

/* ----------------------------------------------------------------- Rating widget */
.mg-rating { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.6rem; background: #fff;
  border: 1px solid var(--mg-line); border-radius: 16px; padding: 1rem 1.3rem; box-shadow: 0 1px 2px rgba(20,20,50,.04); }
.mg-rating__summary { display: flex; align-items: center; gap: .6rem; }
.mg-rating__score { font-family: var(--mg-font-head); font-weight: 800; font-size: 1.8rem; color: var(--mg-indigo); }
.mg-stars { position: relative; display: inline-block; font-size: 1.15rem; line-height: 1; letter-spacing: 2px; }
.mg-stars__base { color: #d9d9e3; }
.mg-stars__fill { position: absolute; left: 0; top: 0; overflow: hidden; white-space: nowrap; color: var(--mg-gold); }
.mg-rating__meta { color: var(--mg-muted); font-size: .9rem; }
.mg-rating__cta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.mg-rating__label { font-weight: 600; color: var(--mg-ink); }
.mg-rating__input { display: inline-flex; gap: .1rem; }
.mg-rating__star { background: none; border: 0; font-size: 1.55rem; color: #d9d9e3; cursor: pointer; padding: 0 2px; line-height: 1; transition: transform .12s, color .12s; }
.mg-rating__star:hover, .mg-rating__star.is-hover, .mg-rating__star.is-active { color: var(--mg-gold); transform: scale(1.12); }
.mg-rating__thanks { color: #12805a; font-weight: 600; margin: 0; }
.mg-rating--compact { padding: .6rem .9rem; gap: .6rem 1rem; }
.mg-rating--compact .mg-rating__score { font-size: 1.3rem; }

/* ----------------------------------------------------------------- FAQ */
.mg-faq .accordion-item { border: 1px solid var(--mg-line); border-radius: 12px !important; margin-bottom: .7rem; overflow: hidden; }
.mg-faq .accordion-button { font-family: var(--mg-font-head); font-weight: 600; color: var(--mg-indigo); font-size: 1.02rem; }
.mg-faq .accordion-button:not(.collapsed) { background: var(--mg-saffron-050); color: var(--mg-saffron-700); box-shadow: none; }
.mg-faq .accordion-button:focus { box-shadow: 0 0 0 .2rem rgba(232,117,26,.22); border-color: var(--mg-saffron); }
.mg-faq .accordion-body { color: var(--mg-body); }
.mg-faq .accordion-button::after { background-size: 1.1rem; }

/* ----------------------------------------------------------------- Testimonials */
.mg-quote { background: #fff; border: 1px solid var(--mg-line); border-radius: var(--mg-radius); padding: 1.6rem; height: 100%; box-shadow: 0 1px 2px rgba(20,20,50,.04); }
.mg-quote__stars { color: var(--mg-gold); letter-spacing: 2px; margin-bottom: .6rem; }
.mg-quote__text { color: var(--mg-ink); font-size: 1.02rem; }
.mg-quote__author { display: flex; align-items: center; gap: .75rem; margin-top: 1.1rem; }
.mg-quote__avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  font-family: var(--mg-font-head); font-weight: 700; background: linear-gradient(135deg, var(--mg-indigo), var(--mg-purple)); }
.mg-quote__name { font-weight: 600; color: var(--mg-indigo); line-height: 1.2; }
.mg-quote__role { font-size: .85rem; color: var(--mg-muted); }

/* ----------------------------------------------------------------- Newsletter & CTA */
.mg-newsletter { background: linear-gradient(135deg, var(--mg-saffron), var(--mg-gold)); color: #fff; border-radius: 24px; padding: 2.6rem; box-shadow: var(--mg-shadow); }
.mg-newsletter h2 { color: #fff; }
.mg-newsletter .form-control { border: 0; border-radius: 999px; padding: .85rem 1.2rem; }
.mg-newsletter .mg-btn--indigo { box-shadow: 0 8px 20px rgba(0,0,0,.15); }
.mg-cta { background: radial-gradient(600px 240px at 80% 0, rgba(122,63,160,.4), transparent 60%), var(--mg-indigo);
  color: #fff; border-radius: 24px; padding: 2.8rem; text-align: center; box-shadow: var(--mg-shadow); }
.mg-cta h2 { color: #fff; }
.mg-cta__lead { color: rgba(255,255,255,.82); max-width: 620px; margin: 0 auto 1.6rem; }

/* ----------------------------------------------------------------- Contact form */
.mg-form .form-label { font-weight: 600; color: var(--mg-ink); margin-bottom: .3rem; }
.mg-form .form-control { border: 1px solid var(--mg-line); border-radius: 12px; padding: .7rem .9rem; }
.mg-form .form-control:focus { border-color: var(--mg-saffron); box-shadow: 0 0 0 .2rem rgba(232,117,26,.15); }
.mg-contact-card { background: #fff; border: 1px solid var(--mg-line); border-radius: var(--mg-radius); padding: 2rem; box-shadow: var(--mg-shadow); }
.mg-note { font-size: .85rem; color: var(--mg-muted); }

/* ----------------------------------------------------------------- Footer */
.mg-footer { background: var(--mg-indigo-800); color: rgba(255,255,255,.72); padding: 58px 0 26px; }
.mg-footer a { color: rgba(255,255,255,.72); text-decoration: none; }
.mg-footer a:hover { color: #fff; text-decoration: none; }
.mg-footer__about { font-size: .95rem; margin: 1.1rem 0; max-width: 340px; }
.mg-footer__title { color: #fff; font-family: var(--mg-font-head); font-weight: 700; font-size: 1rem; margin-bottom: 1rem; }
.mg-footer__links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .55rem; font-size: .95rem; }
.mg-footer__social { display: flex; gap: .9rem; font-size: 1.25rem; margin-top: .3rem; }
.mg-brand--footer .mg-brand__name { color: #fff; }
.mg-brand--footer .mg-brand__dot { color: rgba(255,255,255,.6); }
.mg-footer__disclaimer { border-top: 1px solid rgba(255,255,255,.12); margin-top: 2.2rem; padding-top: 1.3rem; font-size: .85rem; color: rgba(255,255,255,.6); }
.mg-footer__disclaimer strong { color: rgba(255,255,255,.8); }
.mg-footer__bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; margin-top: 1.1rem; font-size: .85rem; color: rgba(255,255,255,.55); }
.mg-footer__bottom p { margin: 0; }

/* ----------------------------------------------------------------- Back to top */
.mg-totop { position: fixed; right: 20px; bottom: 20px; width: 46px; height: 46px; border-radius: 50%; border: 0;
  background: var(--mg-saffron); color: #fff; font-size: 1.2rem; box-shadow: 0 8px 22px rgba(232,117,26,.45);
  opacity: 0; visibility: hidden; transform: translateY(12px); transition: .25s; z-index: 1030; cursor: pointer; }
.mg-totop.is-visible { opacity: 1; visibility: visible; transform: none; }
.mg-totop:hover { background: var(--mg-saffron-700); }

/* ----------------------------------------------------------------- Misc helpers */
.mg-divider { height: 1px; background: var(--mg-line); border: 0; margin: 2rem 0; }
.mg-tag-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.text-gold { color: var(--mg-gold); }
.mg-ad { background: var(--mg-cream); border: 1px dashed var(--mg-line); border-radius: 12px; padding: .6rem; text-align: center; color: var(--mg-muted); font-size: .8rem; margin: 1.5rem 0; }

/* ----------------------------------------------------------------- Responsive tweaks */
@media (max-width: 991.98px) {
  .mg-hero { padding: 64px 0 56px; }
  .mg-hero__stats { gap: 1.4rem; }
  .navbar-collapse { max-height: 80vh; overflow-y: auto; padding-bottom: 1rem; }
}
@media (max-width: 575.98px) {
  .mg-section { padding: 52px 0; }
  .mg-newsletter, .mg-cta, .mg-contact-card { padding: 1.6rem; }
  .mg-hero__barakhadi { grid-template-columns: repeat(3, 1fr); }
  .mg-footer__bottom { flex-direction: column; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* ==========================================================================
   PHASE 2 COMPONENTS — interior pages, lessons, tools, listings
   ========================================================================== */

/* ---- Sub-hero (interior page header) ---- */
.mg-subhero { position: relative; overflow: hidden; color: #fff; padding: 60px 0 56px;
  background: radial-gradient(700px 300px at 100% -10%, rgba(122,63,160,.4), transparent 60%),
              linear-gradient(160deg, #211d55 0%, var(--mg-indigo) 60%, #3a2f7a 120%); }
.mg-subhero h1 { color: #fff; font-family: var(--mg-font-head); font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.7rem); line-height: 1.12; margin-bottom: .8rem; }
.mg-subhero h1 span[lang="mr"] { color: var(--mg-gold); }
.mg-subhero .mg-eyebrow { color: var(--mg-gold); }
.mg-subhero__lead { color: rgba(255,255,255,.85); font-size: 1.12rem; max-width: 720px; margin-bottom: 0; }
.mg-subhero__meta { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; margin-top: 1.1rem; color: rgba(255,255,255,.8); font-size: .9rem; }
.mg-subhero__meta i { color: var(--mg-gold); }

/* ---- Page wrapper ---- */
.mg-page { padding: 56px 0; }

/* ---- Article (lesson / blog body) ---- */
.mg-article { font-size: 1.05rem; color: var(--mg-body); }
.mg-article h2 { font-family: var(--mg-font-head); color: var(--mg-indigo); font-size: 1.6rem;
  font-weight: 700; margin: 2.3rem 0 .8rem; padding-bottom: .4rem; border-bottom: 2px solid var(--mg-line); scroll-margin-top: 92px; }
.mg-article h2 span[lang="mr"], .mg-article h3 span[lang="mr"] { color: var(--mg-saffron-600); }
.mg-article h3 { font-family: var(--mg-font-head); color: var(--mg-indigo); font-size: 1.25rem; font-weight: 700; margin: 1.7rem 0 .6rem; scroll-margin-top: 92px; }
.mg-article h4 { font-family: var(--mg-font-head); color: var(--mg-ink); font-size: 1.08rem; font-weight: 700; margin: 1.3rem 0 .5rem; }
.mg-article p { margin-bottom: 1rem; }
.mg-article ul, .mg-article ol { margin: 0 0 1.15rem; padding-left: 1.35rem; }
.mg-article li { margin-bottom: .45rem; }
.mg-article a { color: var(--mg-saffron-700); }
.mg-article strong { color: var(--mg-ink); }
.mg-article img { border-radius: 12px; margin: 1rem 0; }
.mg-article blockquote { border-left: 4px solid var(--mg-saffron); background: var(--mg-saffron-050);
  margin: 1.4rem 0; padding: .9rem 1.2rem; border-radius: 0 12px 12px 0; color: var(--mg-ink); }

/* ---- Article header ---- */
.mg-artmeta { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.2rem; color: var(--mg-muted); font-size: .9rem; margin: .3rem 0 0; }
.mg-artmeta i { color: var(--mg-saffron-600); }

/* ---- Sidebar ---- */
.mg-side-card { background: #fff; border: 1px solid var(--mg-line); border-radius: 16px; padding: 1.25rem; margin-bottom: 1.2rem; box-shadow: 0 1px 2px rgba(20,20,50,.04); }
.mg-side-card h4 { font-family: var(--mg-font-head); font-size: 1rem; color: var(--mg-indigo); margin-bottom: .8rem; display: flex; align-items: center; gap: .45rem; }
.mg-side-card h4 i { color: var(--mg-saffron-600); }
.mg-side-list { list-style: none; padding: 0; margin: 0; }
.mg-side-list li { border-bottom: 1px dashed var(--mg-line); }
.mg-side-list li:last-child { border-bottom: 0; }
.mg-side-list a { display: block; padding: .5rem 0; color: var(--mg-body); font-weight: 500; font-size: .95rem; text-decoration: none; }
.mg-side-list a:hover { color: var(--mg-saffron-700); }
@media (min-width: 992px) { .mg-sticky { position: sticky; top: 92px; } }

/* ---- Prev / next pager ---- */
.mg-pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.6rem; flex-wrap: wrap; }
.mg-pager a { flex: 1 1 240px; border: 1px solid var(--mg-line); border-radius: 14px; padding: 1rem 1.2rem; background: #fff; text-decoration: none; transition: border-color .2s, box-shadow .2s, transform .2s; }
.mg-pager a:hover { border-color: var(--mg-saffron); box-shadow: var(--mg-shadow); transform: translateY(-2px); }
.mg-pager__label { font-size: .78rem; color: var(--mg-muted); text-transform: uppercase; letter-spacing: .08em; }
.mg-pager__title { font-family: var(--mg-font-head); font-weight: 700; color: var(--mg-indigo); }
.mg-pager--next { text-align: right; }

/* ---- Author box ---- */
.mg-author { display: flex; gap: 1rem; align-items: center; background: var(--mg-cream); border: 1px solid var(--mg-line); border-radius: 16px; padding: 1.2rem; margin-top: 2rem; }
.mg-author__avatar { flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-family: var(--mg-font-head); font-weight: 700; font-size: 1.2rem; background: linear-gradient(135deg, var(--mg-indigo), var(--mg-purple)); }
.mg-author__name { font-family: var(--mg-font-head); font-weight: 700; color: var(--mg-indigo); }
.mg-author__bio { color: var(--mg-muted); font-size: .92rem; margin: .15rem 0 0; }

/* ---- Related ---- */
.mg-related { margin-top: 2.6rem; }
.mg-related h2 { font-family: var(--mg-font-head); color: var(--mg-indigo); font-size: 1.4rem; margin-bottom: 1.1rem; }

/* ---- In-article CTA ---- */
.mg-inline-cta { background: radial-gradient(500px 200px at 90% 0, rgba(122,63,160,.4), transparent 60%), var(--mg-indigo); color: #fff; border-radius: 16px; padding: 1.6rem 1.8rem; margin: 2.2rem 0; }
.mg-inline-cta h3 { color: #fff; margin-bottom: .5rem; }
.mg-inline-cta p { color: rgba(255,255,255,.85); margin-bottom: 1rem; }

/* ---- Filter chips / tabs ---- */
.mg-tabs { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-bottom: 2rem; }
.mg-chip { border: 1px solid var(--mg-line); background: #fff; color: var(--mg-ink); border-radius: 999px; padding: .45rem 1rem; font-family: var(--mg-font-head); font-weight: 600; font-size: .9rem; cursor: pointer; text-decoration: none; transition: all .18s; }
.mg-chip:hover { border-color: var(--mg-saffron); color: var(--mg-saffron-700); text-decoration: none; }
.mg-chip.is-active { background: var(--mg-indigo); color: #fff; border-color: var(--mg-indigo); }

/* ---- Level badge ---- */
.mg-level { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 700; padding: .15em .7em; border-radius: 999px; }
.mg-level--Beginner { background: #eafaf3; color: #12805a; }
.mg-level--Core { background: var(--mg-indigo-050); color: var(--mg-indigo); }
.mg-level--Advanced { background: #f5eefb; color: #5f2d86; }

/* ---- Tool UI ---- */
.mg-tool { background: #fff; border: 1px solid var(--mg-line); border-radius: 18px; padding: 1.6rem; box-shadow: var(--mg-shadow); }
.mg-tool label { font-weight: 600; color: var(--mg-ink); margin-bottom: .3rem; display: block; }
.mg-tool select, .mg-tool input[type="text"], .mg-tool input[type="number"], .mg-tool textarea, .mg-tool input[type="search"] {
  border: 1px solid var(--mg-line); border-radius: 10px; padding: .65rem .85rem; width: 100%; font-size: 1rem; background: #fff; color: var(--mg-ink); }
.mg-tool select:focus, .mg-tool input:focus, .mg-tool textarea:focus { outline: none; border-color: var(--mg-saffron); box-shadow: 0 0 0 .2rem rgba(232,117,26,.15); }
.mg-tool textarea[lang="mr"], .mg-tool input[lang="mr"] { font-family: var(--mg-font-mr); }
.mg-tool__row { display: flex; gap: .7rem; flex-wrap: wrap; align-items: flex-end; }
.mg-tool__row > * { flex: 1 1 180px; }
.mg-tool__result { margin-top: 1.3rem; background: var(--mg-cream); border: 1px dashed var(--mg-line); border-radius: 12px; padding: 1.1rem 1.2rem; }
.mg-tool__result .mr, .mg-tool__result [lang="mr"] { font-family: var(--mg-font-mr); }
.mg-tool__hint { color: var(--mg-muted); font-size: .9rem; }
.mg-toolbar { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1.1rem; }
.mg-toolbtn { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--mg-line); background: #fff; color: var(--mg-indigo); border-radius: 999px; padding: .45rem .95rem; font-family: var(--mg-font-head); font-weight: 600; font-size: .88rem; cursor: pointer; transition: all .18s; }
.mg-toolbtn:hover { border-color: var(--mg-saffron); color: var(--mg-saffron-700); }
.mg-toolbtn i { font-size: 1rem; }

/* Barakhadi / letter grid */
.mg-bkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: .5rem; }
.mg-bkcell { border: 1px solid var(--mg-line); border-radius: 10px; text-align: center; padding: .55rem .2rem; font-family: var(--mg-font-mr); font-size: 1.4rem; color: var(--mg-indigo); background: #fff; }
.mg-bkcell span { display: block; font-family: var(--mg-font-body); font-size: .62rem; color: var(--mg-muted); margin-top: .15rem; }

/* Quiz widget */
.mg-quiz__q { font-family: var(--mg-font-head); font-weight: 600; color: var(--mg-indigo); font-size: 1.1rem; margin-bottom: .9rem; }
.mg-quiz__opts { display: grid; gap: .55rem; }
.mg-opt { border: 1px solid var(--mg-line); border-radius: 10px; padding: .65rem .95rem; background: #fff; cursor: pointer; text-align: left; font-size: 1rem; transition: all .15s; width: 100%; }
.mg-opt:hover { border-color: var(--mg-saffron); }
.mg-opt.is-correct { border-color: #1a9d6b; background: #eafaf3; color: #12805a; font-weight: 600; }
.mg-opt.is-wrong { border-color: #dc3545; background: #fdecea; color: #b02a37; }
.mg-opt:disabled { cursor: default; }
.mg-quiz__score { font-family: var(--mg-font-head); font-weight: 800; font-size: 1.5rem; color: var(--mg-indigo); }
.mg-progress { height: 8px; background: var(--mg-line); border-radius: 999px; overflow: hidden; margin: .4rem 0 1rem; }
.mg-progress__bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--mg-saffron), var(--mg-gold)); transition: width .3s; }

/* Flashcards */
.mg-flip { perspective: 1000px; min-height: 210px; cursor: pointer; }
.mg-flip__inner { position: relative; width: 100%; min-height: 210px; transition: transform .55s; transform-style: preserve-3d; }
.mg-flip.is-flipped .mg-flip__inner { transform: rotateY(180deg); }
.mg-flip__face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border: 1px solid var(--mg-line); border-radius: 16px; display: grid; place-items: center; padding: 1.5rem; text-align: center; background: #fff; }
.mg-flip__face--back { transform: rotateY(180deg); background: var(--mg-indigo-050); }
.mg-flip__face .mr, .mg-flip__face [lang="mr"] { font-family: var(--mg-font-mr); font-size: 1.8rem; color: var(--mg-indigo); }

/* Vocabulary cards */
.mg-vocab-card { background: #fff; border: 1px solid var(--mg-line); border-radius: 14px; padding: 1rem 1.2rem; height: 100%; transition: transform .2s, box-shadow .2s; }
.mg-vocab-card:hover { transform: translateY(-3px); box-shadow: var(--mg-shadow); }
.mg-vocab-card__mr { font-family: var(--mg-font-mr); font-size: 1.4rem; color: var(--mg-indigo); font-weight: 500; }
.mg-vocab-card__en { color: var(--mg-body); }
.mg-vocab-card__eg { color: var(--mg-muted); font-style: italic; font-size: .9rem; margin: .4rem 0 0; }

/* Table of contents (used by blog in Phase 3) */
.mg-toc { background: var(--mg-cream); border: 1px solid var(--mg-line); border-radius: 14px; padding: 1.1rem 1.3rem; margin: 1.5rem 0; }
.mg-toc__title { font-family: var(--mg-font-head); font-weight: 700; color: var(--mg-indigo); margin-bottom: .5rem; display: flex; align-items: center; gap: .4rem; }
.mg-toc ol { margin: 0; padding-left: 1.2rem; }
.mg-toc a { color: var(--mg-body); }

/* Search page */
.mg-searchbar { max-width: 640px; margin: 0 auto; display: flex; gap: .5rem; }
.mg-searchbar input { flex: 1; border: 1px solid var(--mg-line); border-radius: 999px; padding: .8rem 1.2rem; font-size: 1rem; }
.mg-result { border: 1px solid var(--mg-line); border-radius: 14px; padding: 1.1rem 1.2rem; margin-bottom: .9rem; background: #fff; transition: border-color .2s, box-shadow .2s; }
.mg-result:hover { border-color: var(--mg-saffron); box-shadow: var(--mg-shadow); }
.mg-result a.mg-result__title { font-family: var(--mg-font-head); font-weight: 700; color: var(--mg-indigo); font-size: 1.12rem; text-decoration: none; }
.mg-result__url { color: #1a7f52; font-size: .8rem; word-break: break-all; }
.mg-result__excerpt { color: var(--mg-body); font-size: .95rem; margin: .3rem 0 0; }
.mg-result__type { float: right; }

/* 404 */
.mg-404 { text-align: center; padding: 70px 0; }
.mg-404__code { font-family: var(--mg-font-head); font-weight: 800; font-size: clamp(4rem, 14vw, 7rem); line-height: 1; background: linear-gradient(135deg, var(--mg-saffron), var(--mg-gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Toast (tool actions) */
.mg-toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px); background: var(--mg-indigo); color: #fff; padding: .7rem 1.2rem; border-radius: 999px; font-weight: 600; font-size: .9rem; box-shadow: var(--mg-shadow-lg); opacity: 0; visibility: hidden; transition: all .25s; z-index: 2000; }
.mg-toast.is-visible { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* Print: show only tool results cleanly */
@media print {
  .mg-topbar, .mg-header, .mg-footer, .mg-totop, .mg-toolbar, .mg-breadcrumb, .mg-subhero__meta, form { display: none !important; }
  body { font-size: 12pt; }
  .mg-tool { border: 0; box-shadow: none; padding: 0; }
}

/* ==========================================================================
   PHASE 3 — blog, sharing, reading progress, accessibility
   ========================================================================== */

/* Post hero with featured image */
.mg-subhero--post { position: relative; }
.mg-subhero--post::before { content: ""; position: absolute; inset: 0; background-image: var(--post-img); background-size: cover; background-position: center; opacity: .22; }
.mg-subhero--post .container { position: relative; z-index: 1; }
.mg-subhero__overlay { display: none; }

/* Reading progress bar */
.mg-readbar { position: fixed; top: 0; left: 0; height: 4px; width: 0; background: linear-gradient(90deg, var(--mg-saffron), var(--mg-gold)); z-index: 1100; transition: width .08s linear; }

/* Featured image inside article */
.mg-post-figure { margin: 0 0 1.6rem; }
.mg-post-figure img { width: 100%; border-radius: 16px; box-shadow: var(--mg-shadow); display: block; }

/* Share row */
.mg-share { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: 0 0 1.4rem; }
.mg-share__label { font-weight: 600; color: var(--mg-muted); }
.mg-share a.mg-toolbtn { text-decoration: none; }

/* Blog feature card */
.mg-feature { display: grid; grid-template-columns: 1.25fr 1fr; background: #fff; border: 1px solid var(--mg-line); border-radius: 20px; overflow: hidden; text-decoration: none; color: inherit; box-shadow: var(--mg-shadow); transition: transform .22s, box-shadow .22s; }
.mg-feature:hover { box-shadow: var(--mg-shadow-lg); transform: translateY(-3px); text-decoration: none; color: inherit; }
.mg-feature__img img { width: 100%; height: 100%; object-fit: cover; min-height: 300px; display: block; }
.mg-feature__body { padding: 2rem; align-self: center; }
.mg-feature__title { font-family: var(--mg-font-head); color: var(--mg-indigo); font-size: 1.6rem; font-weight: 800; margin: .7rem 0; line-height: 1.2; }
.mg-feature__ex { color: var(--mg-body); }
@media (max-width: 767.98px) { .mg-feature { grid-template-columns: 1fr; } .mg-feature__img img { min-height: 200px; } .mg-feature__body { padding: 1.4rem; } }

/* Blog post cards */
.mg-postcard { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--mg-line); border-radius: 16px; overflow: hidden; text-decoration: none; color: inherit; height: 100%; transition: transform .22s, box-shadow .22s; box-shadow: 0 1px 2px rgba(20,20,50,.04); }
.mg-postcard:hover { box-shadow: var(--mg-shadow); transform: translateY(-4px); text-decoration: none; color: inherit; }
.mg-postcard__img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.mg-postcard__body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .45rem; }
.mg-postcard__title { font-family: var(--mg-font-head); color: var(--mg-indigo); font-size: 1.08rem; font-weight: 700; margin: .2rem 0; line-height: 1.3; }

/* Accessibility — visible focus for keyboard users */
:focus-visible { outline: 3px solid rgba(45,42,110,.65); outline-offset: 2px; border-radius: 4px; }
.mg-btn:focus-visible, .mg-chip:focus-visible, .mg-toolbtn:focus-visible, .mg-rating__star:focus-visible { outline: 3px solid var(--mg-saffron); outline-offset: 2px; }
.mg-navbar .nav-link:focus-visible { outline: 2px solid var(--mg-saffron); outline-offset: 2px; }
a.mg-skip:focus { outline: 3px solid #fff; }
