/* ================================================================
   MOBILE FIX — Prevents all horizontal overflow / layout breaks
   ================================================================ */

/* ── 1. Global overflow lock ─────────────────────────────────────── */
html {
  overflow-x: hidden;
  max-width: 100%;
}
body {
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
  position: relative;
}
* {
  max-width: 100%;
}

/* ── 2. All containers must stay within viewport ─────────────────── */
.mmt-container,
.mmt-container-wide,
.mmt-header-inner,
.mmt-nav-inner,
.mmt-post-layout,
.mmt-archive-layout,
.mmt-footer-grid {
  box-sizing: border-box;
  max-width: 100%;
}

/* ── 3. Images never overflow ────────────────────────────────────── */
img, svg, video, iframe {
  max-width: 100%;
  height: auto;
}

/* ── 4. Utility responsive grid class ───────────────────────────── */
.mmt-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* ── 5. Disclaimer bar ───────────────────────────────────────────── */
.mmt-disclaimer-bar {
  word-break: break-word;
  overflow-wrap: break-word;
}

/* ── 6. Top bar ──────────────────────────────────────────────────── */
.mmt-top-bar {
  flex-wrap: wrap;
}
.mmt-top-bar-left {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── 7. Hero section ─────────────────────────────────────────────── */
.mmt-hero {
  overflow: hidden;
}
.mmt-hero h1 {
  word-break: break-word;
  hyphens: auto;
}
.mmt-hero-amount {
  max-width: 100%;
  flex-wrap: wrap;
}

/* ── 8. Entry content ────────────────────────────────────────────── */
.entry-content {
  overflow-x: auto;
  word-break: break-word;
  overflow-wrap: break-word;
}
.entry-content table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.entry-content pre {
  overflow-x: auto;
}

/* ── 9. Nav list on desktop — horizontal scroll, no wrap ─────────── */
.mmt-nav-list {
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
}

/* ── 10. Eligibility grid ────────────────────────────────────────── */
.mmt-eligibility-grid {
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .mmt-eligibility-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── 11. Post / archive layout ───────────────────────────────────── */
.mmt-post-layout,
.mmt-archive-layout {
  grid-template-columns: 1fr;
}
@media (min-width: 1025px) {
  .mmt-post-layout,
  .mmt-archive-layout {
    grid-template-columns: 1fr 320px;
  }
}

/* ── 12. Footer grid ─────────────────────────────────────────────── */
.mmt-footer-grid {
  grid-template-columns: 1fr;
}
@media (min-width: 600px) {
  .mmt-footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (min-width: 1025px) {
  .mmt-footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

/* ── 13. Card grids ──────────────────────────────────────────────── */
.mmt-grid-4 {
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 400px) {
  .mmt-grid-4 {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 900px) {
  .mmt-grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.mmt-grid-3 {
  grid-template-columns: 1fr;
}
@media (min-width: 600px) {
  .mmt-grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}
@media (min-width: 900px) {
  .mmt-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.mmt-grid-2 {
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .mmt-grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.mmt-docs-grid,
.mmt-news-grid,
.mmt-related-grid {
  grid-template-columns: 1fr;
}
@media (min-width: 520px) {
  .mmt-docs-grid,
  .mmt-news-grid,
  .mmt-related-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (min-width: 900px) {
  .mmt-news-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .mmt-related-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

/* ── 14. Post card on mobile — stacked ───────────────────────────── */
.mmt-post-card {
  flex-direction: column;
}
.mmt-post-card-thumb {
  width: 100% !important;
  min-height: 200px;
  height: 200px;
}
.mmt-post-card-thumb img {
  width: 100% !important;
  height: 200px !important;
  object-fit: cover;
}
@media (min-width: 768px) {
  .mmt-post-card {
    flex-direction: row;
  }
  .mmt-post-card-thumb {
    width: 260px !important;
    height: auto;
    min-height: 190px;
  }
  .mmt-post-card-thumb img {
    width: 260px !important;
    height: 100% !important;
    min-height: 190px;
  }
}

/* ── 15. Steps — hide the vertical line on mobile ────────────────── */
@media (max-width: 600px) {
  .mmt-steps::before {
    display: none;
  }
  .mmt-step {
    padding: 18px 16px;
  }
}

/* ── 16. Status tool ─────────────────────────────────────────────── */
.mmt-status-tool {
  max-width: 100%;
  box-sizing: border-box;
}

/* ── 17. Quick links ─────────────────────────────────────────────── */
.mmt-quick-links li a {
  white-space: normal;
  word-break: break-word;
}

/* ── 18. Hero CTA buttons ────────────────────────────────────────── */
@media (max-width: 520px) {
  .mmt-hero-cta {
    flex-direction: column;
    align-items: stretch;
  }
  .mmt-btn-primary,
  .mmt-btn-outline {
    justify-content: center;
    text-align: center;
  }
}

/* ── 19. Hero stats ──────────────────────────────────────────────── */
@media (max-width: 480px) {
  .mmt-hero-stats {
    gap: 16px;
  }
  .mmt-hero-stat-num {
    font-size: 20px;
  }
}

/* ── 20. Section padding on small screens ───────────────────────── */
@media (max-width: 480px) {
  .mmt-section {
    padding: 44px 15px;
  }
  .mmt-hero {
    padding: 48px 15px 80px;
  }
  .mmt-container,
  .mmt-container-wide {
    padding: 0 15px;
  }
  .mmt-post-content-area {
    padding: 22px 16px;
  }
  .mmt-post-layout,
  .mmt-archive-layout {
    padding: 16px 12px;
  }
  .mmt-archive-hero {
    padding: 40px 15px;
  }
  .mmt-page-hero {
    padding: 40px 15px;
  }
}

/* ── 21. Header fix on mobile ────────────────────────────────────── */
@media (max-width: 480px) {
  .mmt-header-inner {
    padding: 8px 14px;
  }
  .mmt-top-bar {
    padding: 6px 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
  .mmt-top-bar-left {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    font-size: 11.5px;
  }
  .mmt-disclaimer-bar {
    padding: 8px 14px;
    font-size: 12px;
  }
  .mmt-lang-switcher {
    gap: 5px;
  }
  .mmt-lang-btn {
    padding: 4px 10px;
    font-size: 11.5px;
  }
}

/* ── 22. CRITICAL: inline grid overrides for mobile ─────────────── */
/* These override front-page.php inline styles */
@media (max-width: 767px) {
  /* About section 2-col */
  .mmt-about-grid {
    grid-template-columns: 1fr !important;
  }
  /* Do's & Don'ts 2-col */
  .mmt-dos-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ── 23. Mobile nav drawer full width ────────────────────────────── */
.mmt-mobile-nav {
  width: 100%;
  box-sizing: border-box;
}

/* ── 24. Back to top button ──────────────────────────────────────── */
#mmt-back-to-top {
  bottom: 70px; /* above mobile browser chrome */
}
@media (min-width: 600px) {
  #mmt-back-to-top {
    bottom: 24px;
  }
}

/* ── 25. FAQ text wrapping ───────────────────────────────────────── */
.mmt-faq-q {
  word-break: break-word;
  hyphens: auto;
}
@media (max-width: 480px) {
  .mmt-faq-q {
    font-size: 14.5px;
    padding: 15px 16px;
  }
  .mmt-faq-a {
    padding: 0 16px 15px;
    font-size: 14px;
  }
}

/* ── 26. Card text overflow fix ──────────────────────────────────── */
.mmt-card h3,
.mmt-card p,
.mmt-news-card-body h3,
.mmt-news-card-body p,
.mmt-related-card-body h4,
.mmt-post-card-body h2,
.mmt-post-card-body p {
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* ── 27. Footer on mobile ────────────────────────────────────────── */
@media (max-width: 480px) {
  .mmt-footer {
    padding: 44px 15px 0;
  }
  .mmt-footer-grid {
    gap: 20px;
  }
  .mmt-footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }
  .mmt-footer-bottom-links {
    justify-content: center;
  }
}

/* ── 28. Sidebar on mobile — full width ──────────────────────────── */
@media (max-width: 1024px) {
  .mmt-sidebar {
    position: static !important;
    width: 100%;
  }
}

/* ── 29. Post hero on mobile ─────────────────────────────────────── */
@media (max-width: 600px) {
  .mmt-post-hero {
    min-height: 280px;
  }
  .mmt-post-hero-content {
    padding: 20px 15px;
  }
  .mmt-post-meta {
    gap: 10px;
    font-size: 12.5px;
  }
}

/* ── 30. Table responsive ────────────────────────────────────────── */
.entry-content table {
  min-width: 300px;
}

/* ── 31. Grid responsive breakpoints ─────────────────────────────── */
@media (min-width: 768px) {
  .mmt-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 900px) {
  .mmt-grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ── 32. min-width:0 on ALL grid children — prevents overflow ────── */
.mmt-grid > *,
.mmt-grid-2 > *,
.mmt-grid-3 > *,
.mmt-grid-4 > *,
.mmt-news-grid > *,
.mmt-related-grid > *,
.mmt-docs-grid > *,
.mmt-posts-grid > *,
.mmt-eligibility-grid > *,
.mmt-footer-grid > *,
.mmt-about-grid > *,
.mmt-dos-grid > * {
  min-width: 0;
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ── 33. About section — mobile full width ───────────────────────── */
.mmt-about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: start;
}
@media (min-width: 900px) {
  .mmt-about-grid {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 52px;
  }
}

/* ── 34. Dos/Donts — mobile stack ────────────────────────────────── */
.mmt-dos-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 640px) {
  .mmt-dos-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── 35. Scheme glance box — fit mobile ──────────────────────────── */
.mmt-scheme-glance {
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  word-break: break-word;
}

/* ── 36. Post nav grid — stack on small mobile ───────────────────── */
@media (max-width: 400px) {
  .mmt-post-nav-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ── 37. Lang buttons — never wrap weirdly ───────────────────────── */
.mmt-lang-btn {
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── 38. Eligibility list items — don't break ────────────────────── */
.mmt-eligibility-list li {
  min-width: 0;
  flex-wrap: nowrap;
  align-items: flex-start;
}
.mmt-eligibility-list li > span:last-child {
  min-width: 0;
  word-break: break-word;
  flex: 1;
}

/* ── 39. Step content — don't overflow ───────────────────────────── */
.mmt-step {
  min-width: 0;
}
.mmt-step-content {
  min-width: 0;
  flex: 1;
}
.mmt-step-content h3,
.mmt-step-content p {
  word-break: break-word;
  overflow-wrap: break-word;
}

/* ── 40. Sidebar widget content ──────────────────────────────────── */
.mmt-widget {
  min-width: 0;
  overflow: hidden;
}
.mmt-widget h4 {
  white-space: normal;
  word-break: break-word;
}

/* ── 41. Brand name on very small screen ─────────────────────────── */
@media (max-width: 360px) {
  .mmt-brand-name {
    font-size: 13px;
  }
  .mmt-nav-toggle span:last-child {
    display: none;
  }
  .mmt-lang-btn {
    padding: 3px 8px;
    font-size: 11px;
  }
}

/* ── 42. Scheme at a glance card ─────────────────────────────────── */
.mmt-scheme-glance > div {
  min-width: 0;
  word-break: break-word;
}

/* ── 43. Hero amount box ─────────────────────────────────────────── */
@media (max-width: 360px) {
  .mmt-hero-amount {
    padding: 12px 18px;
  }
  .mmt-hero-amount .amount-num {
    font-size: 32px;
  }
}

/* ── 44. News card footer — don't overflow ───────────────────────── */
.mmt-news-card-footer {
  flex-wrap: wrap;
  gap: 8px;
}

/* ── 45. Post meta — wrap on small screens ───────────────────────── */
.mmt-post-meta {
  flex-wrap: wrap;
  gap: 10px;
}
@media (max-width: 480px) {
  .mmt-post-meta-item:last-child {
    margin-left: 0 !important;
    width: 100%;
  }
}

/* ── 46. Alert boxes ─────────────────────────────────────────────── */
.mmt-alert {
  word-break: break-word;
  overflow-wrap: break-word;
}

/* ── 47. Breadcrumb — wrap on mobile ─────────────────────────────── */
.mmt-breadcrumb {
  flex-wrap: wrap;
  gap: 4px;
}
.mmt-breadcrumb .current {
  word-break: break-word;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── 48. Footer social buttons ───────────────────────────────────── */
.mmt-footer-social {
  flex-wrap: wrap;
}

/* ── 49. Form groups ─────────────────────────────────────────────── */
.mmt-form-group input,
.mmt-form-group select {
  max-width: 100%;
  box-sizing: border-box;
}
.mmt-btn-submit {
  max-width: 100%;
  box-sizing: border-box;
}

/* ── 50. Share buttons ───────────────────────────────────────────── */
.mmt-share-btn {
  white-space: nowrap;
  flex-shrink: 0;
}
div:has(> .mmt-share-btn) {
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════════
   v6.1 PATCH — Full Width · Button Fix · Inline Related · Clean URLs
   ════════════════════════════════════════════════════════════════ */

/* 1. FULL WIDTH — remove excess horizontal margins on all screens */
.mmt-container,
.mmt-container-wide {
  max-width: 100%;
  padding: 0 16px;
}

@media (min-width: 1200px) {
  .mmt-container      { max-width: 1200px; padding: 0 24px; }
  .mmt-container-wide { max-width: 1400px; padding: 0 24px; }
}

/* 2. POST LAYOUT — full width on mobile, proper max on desktop */
.mmt-post-layout {
  max-width: 100%;
  padding: 24px 16px;
  gap: 24px;
}
@media (min-width: 1024px) {
  .mmt-post-layout {
    max-width: 1200px;
    padding: 44px 24px;
    margin: 0 auto;
  }
}

/* 3. POST CONTENT — reduce padding on mobile */
.mmt-post-content-area {
  padding: 24px 18px;
}
@media (min-width: 768px) {
  .mmt-post-content-area { padding: 36px 40px; }
}

/* 4. BUTTONS — never overflow, always show full text */
.mmt-btn-primary,
.mmt-btn-outline,
.mmt-btn-submit,
.mmt-join-btn,
.mmt-topic-card {
  white-space: normal;
  word-break: break-word;
  min-width: 0;
  overflow: visible;
  text-overflow: unset;
}

/* Topic card label — never clip text */
.mmt-topic-label {
  white-space: normal;
  word-break: break-word;
  overflow: visible;
  text-overflow: unset;
  line-height: 1.3;
}

/* Join buttons — wrap text properly */
.mmt-join-btn {
  padding: 10px 16px;
  font-size: 13.5px;
  line-height: 1.3;
  height: auto;
  min-height: 44px;
}

/* 5. ENTRY CONTENT full width */
.entry-content {
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* 6. INLINE RELATED POSTS — New Updates block after 1st paragraph */
.mmt-inline-related {
  margin: 24px 0 20px;
  padding: 18px 20px;
  background: #EEF2FF;
  border-radius: 12px;
  border-left: 4px solid #1565C0;
}
.mmt-inline-related-title {
  font-size: 14px;
  font-weight: 800;
  color: #1565C0;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.mmt-inline-related-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mmt-inline-related-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #fff;
  border-radius: 8px;
  text-decoration: none;
  color: #1a237e;
  font-weight: 600;
  font-size: 14px;
  transition: box-shadow .18s;
  border: 1px solid #C5CAE9;
}
.mmt-inline-related-item:hover {
  box-shadow: 0 4px 14px rgba(21,101,192,.14);
  text-decoration: none;
  color: #1565C0;
}
.mmt-inline-related-thumb {
  flex-shrink: 0;
  width: 64px;
  height: 44px;
  border-radius: 6px;
  overflow: hidden;
  background: #E8EAF6;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mmt-inline-related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}
.mmt-inline-related-no-thumb {
  color: #5C6BC0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mmt-inline-related-text {
  flex: 1;
  line-height: 1.4;
}

/* 7. SECTION PADDING — tighter on mobile */
.mmt-section        { padding: 44px 0; }
.mmt-section-alt    { padding: 44px 0; }
@media (max-width: 600px) {
  .mmt-section      { padding: 28px 0; }
  .mmt-section-alt  { padding: 28px 0; }
  .mmt-post-content-area { padding: 18px 14px; }
  .entry-content    { font-size: 15.5px; }
}

/* 8. TOPICS GRID — better fit on small screens */
.mmt-topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
@media (max-width: 480px) {
  .mmt-topics-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .mmt-topic-card  { padding: 12px 6px 10px; }
  .mmt-topic-label { font-size: 11.5px; }
  .mmt-topic-icon  { width: 38px; height: 38px; }
}

/* 9. POST SIDEBAR — single column on mobile */
@media (max-width: 900px) {
  .mmt-post-layout {
    grid-template-columns: 1fr;
  }
  .mmt-sidebar {
    position: static;
  }
}

/* 10. PAGE CONTENT — full width */
.mmt-page-content {
  max-width: 100%;
}
@media (min-width: 960px) {
  .mmt-page-content { max-width: 960px; }
}

/* 11. HERO — ensure no horizontal overflow */
.mmt-post-hero,
.mmt-hero {
  overflow: hidden;
}


/* ═══════════════════════════════════════════════════════════════════
   v6.2 PATCH — TRUE EDGE-TO-EDGE FULL WIDTH on Mobile
   ════════════════════════════════════════════════════════════════ */

/* Body and page wrapper — zero horizontal overflow */
html, body, #page, .site {
  overflow-x: hidden;
  width: 100%;
}

/* Containers — 0 padding below 480px for true full width */
@media (max-width: 480px) {
  .mmt-container,
  .mmt-container-wide {
    padding-left: 0 !important;
    padding-right: 0 !important;
    max-width: 100% !important;
  }

  /* Post layout — flush to edges */
  .mmt-post-layout {
    padding: 0 !important;
    gap: 0 !important;
  }

  /* Content card — no border radius, no side borders, flush edges */
  .mmt-post-content-area {
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    padding: 16px 14px !important;
    box-shadow: none !important;
    margin: 0 !important;
  }

  /* Sidebar also flush */
  .mmt-sidebar {
    padding: 0 12px !important;
    gap: 14px !important;
  }

  /* Sections — full bleed */
  .mmt-section,
  .mmt-section-alt {
    padding: 24px 0 !important;
  }

  /* Section content inside — small side padding */
  .mmt-section > .mmt-container > *,
  .mmt-section-alt > .mmt-container > * {
    padding-left: 14px;
    padding-right: 14px;
  }

  /* Page main area */
  .mmt-page-main {
    padding: 0 !important;
  }
  .mmt-page-main .mmt-container {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .mmt-page-header,
  .mmt-page-content {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
  /* .mmt-page-content now lives inside .mmt-post-content-area (sidebar
     parity with Posts) — that wrapper already adds 14px side padding,
     so drop mmt-page-content's own to avoid doubling it. */
  .mmt-post-content-area .mmt-page-content {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Widget cards in sidebar — no radius */
  .mmt-widget {
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
  }

  /* Inline related — flush */
  .mmt-inline-related {
    border-radius: 0 !important;
    border-left-width: 4px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* 481px – 768px: give a little breathing room */
@media (min-width: 481px) and (max-width: 768px) {
  .mmt-container,
  .mmt-container-wide {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  .mmt-post-layout {
    padding: 16px 12px !important;
  }
  .mmt-post-content-area {
    border-radius: 8px !important;
    padding: 20px 18px !important;
  }
}

/* Footer — full bleed */
@media (max-width: 768px) {
  .mmt-footer {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
  .mmt-footer-grid {
    gap: 28px !important;
  }
  .mmt-footer-disclaimer {
    border-radius: 0 !important;
    margin-left: -14px !important;
    margin-right: -14px !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
}

/* FAQ Section — remove card gaps on mobile */
@media (max-width: 480px) {
  .mmt-faq-section,
  .mmt-faq-wrapper {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .mmt-faq-item {
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
  }
  .mmt-faq-q {
    padding: 16px 14px !important;
    font-size: 15px !important;
  }
  .mmt-faq-a {
    padding: 0 14px 14px !important;
  }
}
