/*
 Theme Name:   Maloomati V2
 Theme URI:    https://maloomati.com
 Description:  Astra child theme for maloomati.com — digital services guide hub
 Author:       maloomati.com
 Author URI:   https://maloomati.com
 Template:     astra
 Version:      2.0.6
 License:      GNU General Public License v2 or later
 Text Domain:  maloomati-v2
*/

/* ========================================
   DESIGN SYSTEM: Informed Clarity
   ======================================== */

:root {
  /* Primary Palette */
  --m-navy: #0F172A;
  --m-blue: #2563EB;
  --m-emerald: #059669;
  --m-bg: #F8FAFC;
  --m-charcoal: #1E293B;
  --m-white: #FFFFFF;

  /* Surface System */
  --m-surface: #F7F9FB;
  --m-surface-low: #F2F4F6;
  --m-surface-container: #ECEEF0;
  --m-surface-high: #E6E8EA;
  --m-border: #E2E8F0;
  --m-outline: #76777D;
  --m-outline-variant: #C6C6CD;

  /* Semantic */
  --m-info-bg: #EFF6FF;
  --m-info-border: #2563EB;
  --m-warn-bg: #FFFBEB;
  --m-warn-border: #D97706;
  --m-success-bg: #ECFDF5;
  --m-success-border: #059669;
  --m-error: #BA1A1A;
  --m-error-bg: #FEF2F2;

  /* Typography */
  --m-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  /* Spacing */
  --m-container: 1200px;
  --m-content: 720px;
  --m-gutter: 24px;
  --m-radius: 8px;
  --m-radius-sm: 4px;
}

/* ========================================
   BASE
   ======================================== */

body {
  font-family: var(--m-font);
  font-size: 18px;
  line-height: 1.65;
  color: var(--m-charcoal);
  background: var(--m-bg);
  -webkit-font-smoothing: antialiased;
}

@media (max-width: 768px) {
  body { font-size: 16px; }
}

/* ========================================
   HEADER
   ======================================== */

.ast-primary-header-bar,
.ast-header-stacked-main-header {
  background: var(--m-white) !important;
  border-bottom: 1px solid var(--m-border) !important;
  box-shadow: none !important;
}

.site-title a,
.ast-site-title a {
  font-family: var(--m-font) !important;
  font-weight: 700 !important;
  font-size: 24px !important;
  color: var(--m-navy) !important;
  text-decoration: none !important;
}

.main-header-menu a,
.ast-header-sections-navigation a {
  font-family: var(--m-font) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #45464D !important;
  letter-spacing: 0.01em;
  transition: color 0.2s;
}

.main-header-menu a:hover,
.main-header-menu .current-menu-item > a {
  color: var(--m-blue) !important;
}

/* ========================================
   FOOTER
   ======================================== */

.site-footer,
.ast-footer-overlay {
  background: var(--m-navy) !important;
}

.site-footer,
.site-footer a,
.site-footer p,
.site-footer .widget-title,
.ast-footer-copyright {
  color: rgba(255,255,255,0.7) !important;
}

.site-footer a:hover {
  color: #FFFFFF !important;
}

.ast-footer-copyright {
  border-top: 1px solid rgba(255,255,255,0.1) !important;
  font-size: 12px !important;
  letter-spacing: 0.05em;
}

/* ========================================
   CONTENT & TYPOGRAPHY
   ======================================== */

.entry-content,
.ast-single-post .entry-content {
  max-width: var(--m-content);
  font-size: 18px;
  line-height: 1.65;
  color: var(--m-charcoal);
}

@media (max-width: 768px) {
  .entry-content { font-size: 16px; line-height: 1.6; }
}

h1, .entry-title {
  font-family: var(--m-font);
  font-weight: 700;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--m-navy);
}

h2 {
  font-family: var(--m-font);
  font-weight: 600;
  font-size: 30px;
  line-height: 1.3;
  color: var(--m-navy);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

h3 {
  font-family: var(--m-font);
  font-weight: 600;
  font-size: 24px;
  line-height: 1.3;
  color: var(--m-navy);
}

h4, h5, h6 {
  font-family: var(--m-font);
  font-weight: 600;
  color: var(--m-navy);
}

a {
  color: var(--m-blue);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #1D4ED8;
  text-decoration: underline;
}

/* ========================================
   POST CARDS
   ======================================== */

.ast-article-post,
.m-post-card {
  background: var(--m-white);
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius);
  overflow: hidden;
  transition: box-shadow 0.3s;
}

.ast-article-post:hover,
.m-post-card:hover {
  box-shadow: 0 4px 12px rgba(15,23,42,0.05);
}

/* Category Badge */
.m-cat-badge {
  display: inline-block;
  background: rgba(37,99,235,0.1);
  color: var(--m-blue);
  padding: 2px 8px;
  border-radius: var(--m-radius-sm);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ========================================
   CALLOUT BOXES
   ======================================== */

.m-callout {
  padding: 1.5rem;
  border-left: 4px solid;
  border-radius: 0 var(--m-radius) var(--m-radius) 0;
  margin: 1.5rem 0;
}

.m-callout-info {
  background: var(--m-info-bg);
  border-color: var(--m-blue);
}

.m-callout-warn {
  background: var(--m-warn-bg);
  border-color: var(--m-warn-border);
}

.m-callout-success {
  background: var(--m-success-bg);
  border-color: var(--m-emerald);
}

.m-callout-error {
  background: var(--m-error-bg);
  border-color: var(--m-error);
}

/* Quick Answer Box */
.m-quick-answer {
  background: rgba(219,225,255,0.3);
  border-left: 4px solid var(--m-blue);
  padding: 1.5rem;
  border-radius: 0 var(--m-radius) var(--m-radius) 0;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px rgba(15,23,42,0.03);
}

.m-quick-answer h2 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin: 0 0 0.75rem;
  color: #00174B;
}

/* ========================================
   TABLE OF CONTENTS
   ======================================== */

.m-toc {
  background: var(--m-surface-low);
  border: 1px solid var(--m-outline-variant);
  border-radius: var(--m-radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.m-toc h3, .m-toc h4 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #45464D;
  margin: 0 0 1rem;
}

.m-toc ul, .m-toc ol {
  padding: 0 0 0 1.25rem;
  margin: 0;
}

.m-toc li {
  margin-bottom: 0.75rem;
}

.m-toc a {
  color: var(--m-blue);
  font-size: 14px;
  font-weight: 500;
}

.m-toc a:hover {
  text-decoration: underline;
}

/* ========================================
   AD SLOTS
   ======================================== */

.m-ad-slot {
  background: var(--m-surface-low);
  border: 1px dashed var(--m-outline-variant);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--m-radius);
  color: var(--m-outline);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.m-ad-300x250 { width: 300px; height: 250px; }
.m-ad-300x600 { width: 300px; height: 600px; }
.m-ad-728x90 { width: 100%; max-width: 728px; height: 90px; margin: 1.5rem auto; }

/* ========================================
   BREADCRUMBS
   ======================================== */

.ast-breadcrumbs,
.m-breadcrumbs {
  font-size: 14px;
  font-weight: 500;
  color: #45464D;
  margin-bottom: 1rem;
}

.m-breadcrumbs a {
  color: #45464D;
}

.m-breadcrumbs a:hover {
  color: var(--m-blue);
}

/* ========================================
   SIDEBAR
   ======================================== */

.widget-area .widget {
  background: var(--m-white);
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.widget-title {
  font-size: 14px !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--m-navy) !important;
  border-bottom: 1px solid var(--m-border);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem !important;
}

/* Trending Numbers */
.m-trending-num {
  color: var(--m-blue);
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
}

/* ========================================
   BUTTONS
   ======================================== */

.m-btn-primary,
.wp-block-button__link {
  background: var(--m-blue) !important;
  color: var(--m-white) !important;
  padding: 0.75rem 1.5rem;
  border-radius: var(--m-radius-sm);
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none !important;
  display: inline-block;
}

.m-btn-primary:hover,
.wp-block-button__link:hover {
  background: #1D4ED8 !important;
  transform: translateY(-1px);
}

/* ========================================
   FORMS
   ======================================== */

input[type="text"],
input[type="email"],
input[type="number"],
input[type="url"],
input[type="search"],
textarea,
select {
  background: var(--m-white);
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius-sm);
  padding: 0.5rem 1rem;
  font-family: var(--m-font);
  font-size: 16px;
  color: var(--m-charcoal);
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--m-blue);
  box-shadow: 0 0 0 2px rgba(37,99,235,0.2);
  outline: none;
}

/* ========================================
   CALCULATOR WIDGET
   ======================================== */

.m-calculator {
  background: var(--m-white);
  border: 1px solid var(--m-border);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(15,23,42,0.03);
}

.m-calc-result {
  background: var(--m-surface-container);
  border-radius: var(--m-radius);
  padding: 2rem;
  text-align: center;
}

.m-calc-result .percentage {
  font-size: 48px;
  font-weight: 700;
  color: var(--m-navy);
}

.m-grade-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 700;
}

.m-grade-a { background: var(--m-success-bg); color: var(--m-emerald); }
.m-grade-b { background: var(--m-info-bg); color: var(--m-blue); }
.m-grade-c { background: var(--m-surface-container); color: var(--m-charcoal); }
.m-grade-f { background: var(--m-error-bg); color: var(--m-error); }

/* ========================================
   ACCORDION / FAQ
   ======================================== */

.m-accordion {
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius);
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.m-accordion-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--m-white);
  border: none;
  cursor: pointer;
  font-family: var(--m-font);
  font-size: 14px;
  font-weight: 700;
  color: var(--m-navy);
  text-align: left;
  transition: background 0.2s;
}

.m-accordion-btn:hover {
  background: var(--m-surface-low);
}

.m-accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease;
  padding: 0 1rem;
  background: var(--m-white);
  color: #45464D;
  font-size: 16px;
  line-height: 1.6;
}

.m-accordion-content.open {
  max-height: 500px;
  padding-bottom: 1rem;
}

/* ========================================
   HELPLINE CALLOUT
   ======================================== */

.m-helplines {
  background: var(--m-bg);
  border-left: 4px solid var(--m-emerald);
  padding: 1.5rem;
  border-radius: 0 var(--m-radius) var(--m-radius) 0;
  box-shadow: 0 1px 3px rgba(15,23,42,0.03);
}

/* ========================================
   HERO (Homepage)
   ======================================== */

.m-hero {
  background: var(--m-navy);
  color: #FFFFFF;
  padding: 4rem var(--m-gutter);
  text-align: center;
}

.m-hero h1 {
  color: #FFFFFF;
  margin-bottom: 1.5rem;
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
}

.m-hero-search {
  max-width: 42rem;
  margin: 0 auto 2rem;
  position: relative;
}

.m-hero-search input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  border-radius: var(--m-radius);
  border: 1px solid var(--m-outline-variant);
  font-size: 18px;
  background: var(--m-white);
}

.m-hero-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.m-hero-pill {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #FFFFFF;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.2s;
  backdrop-filter: blur(4px);
  text-decoration: none;
}

.m-hero-pill:hover {
  background: rgba(255,255,255,0.2);
  color: #FFFFFF;
}

/* Official Portals Strip */
.m-portals-strip {
  background: #DBE1FF;
  border-top: 1px solid #B4C5FF;
  border-bottom: 1px solid #B4C5FF;
  padding: 1rem var(--m-gutter);
}

/* ========================================
   PILLAR CARDS
   ======================================== */

.m-pillar-card {
  background: var(--m-white);
  border: 1px solid var(--m-border);
  padding: 1.5rem;
  border-radius: var(--m-radius);
  transition: box-shadow 0.3s;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.m-pillar-card:hover {
  box-shadow: 0 4px 12px rgba(15,23,42,0.05);
}

.m-pillar-icon {
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  background: rgba(37,99,235,0.1);
  color: var(--m-blue);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========================================
   GOVERNMENT DISCLAIMER
   ======================================== */

.m-disclaimer {
  background: var(--m-warn-bg);
  border-left: 4px solid var(--m-warn-border);
  padding: 1rem 1.5rem;
  border-radius: 0 var(--m-radius) var(--m-radius) 0;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px rgba(15,23,42,0.03);
}

/* ========================================
   MOBILE STICKY AD
   ======================================== */

@media (max-width: 768px) {
  .m-mobile-sticky-ad {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: var(--m-surface-high);
    border-top: 1px solid var(--m-border);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    box-shadow: 0 -4px 12px rgba(15,23,42,0.05);
    font-size: 12px;
    color: var(--m-outline);
  }
}

@media (min-width: 769px) {
  .m-mobile-sticky-ad { display: none; }
}

/* ========================================
   COMING SOON PAGE
   ======================================== */

.m-maintenance {
  background: var(--m-navy);
  color: #F8FAFC;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.m-maintenance .glass-panel {
  background: rgba(15,23,42,0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(226,232,240,0.1);
  border-radius: 12px;
  padding: 3rem;
}

/* ========================================
   CUSTOM 404
   ======================================== */

.m-404 {
  text-align: center;
  padding: 6rem var(--m-gutter);
}

.m-404 h1 {
  font-size: 96px;
  color: var(--m-blue);
  margin-bottom: 1rem;
}

/* ========================================
   RESPONSIVE CONTAINER
   ======================================== */

.ast-container,
.site-content .ast-container {
  max-width: var(--m-container) !important;
}

/* Hide Astra page title on static front page */
.page-id-home .entry-title,
.home .entry-title,
.page-template-default.page .ast-article-single .entry-title[style*="disabled"] {
  display: none;
}

/* Article content width */
.single-post .entry-content {
  max-width: var(--m-content);
}

/* ========================================
   DARK MODE TOGGLE (CSS only, enhanced by JS)
   ======================================== */

.m-dark-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--m-navy);
  padding: 0.5rem;
  border-radius: 9999px;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.m-dark-toggle:hover {
  background: var(--m-surface-container);
}

/* ========================================
   CUSTOM TEMPLATE OVERRIDES
   ======================================== */

/* Hide Astra's header/footer when our templates are active */
.ast-above-header-wrap,
.ast-below-header-wrap,
#ast-desktop-header,
#masthead,
.ast-mobile-header-wrap,
.site-header,
.ast-footer-overlay,
.site-footer,
#colophon,
.ast-small-footer {
  display: none !important;
}

/* Our custom header */
.m-header {
  background: var(--m-white);
  border-bottom: 1px solid var(--m-border);
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
}

.m-header-inner {
  max-width: var(--m-container);
  margin: 0 auto;
  padding: 0 var(--m-gutter);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.m-logo {
  font-family: 'Inter', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--m-navy);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.m-logo img {
  height: 65px !important;
  width: 65px !important;
}

.m-logo:hover {
  color: var(--m-navy);
}

.m-nav-desktop {
  display: none;
}

@media (min-width: 768px) {
  .m-nav-desktop {
    display: flex;
  }
  .m-mobile-menu-btn {
    display: none !important;
  }
}

.m-nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.m-nav-links li {
  margin: 0;
  padding: 0;
}

.m-nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--m-text-secondary);
  text-decoration: none;
  transition: color 0.2s;
  letter-spacing: 0.01em;
}

.m-nav-links a:hover,
.m-nav-links .current-menu-item a {
  color: var(--m-blue);
}

.m-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.m-mobile-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--m-navy);
  padding: 0.5rem;
}

/* Our custom footer */
.m-footer {
  background: var(--m-navy);
  color: rgba(255,255,255,0.8);
  margin-top: auto;
}

.m-footer-inner {
  max-width: var(--m-container);
  margin: 0 auto;
  padding: 64px var(--m-gutter);
}

.m-footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .m-footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 2rem;
  }
}

.m-footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.m-footer-logo {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.m-footer-logo img {
  height: 28px;
  width: auto;
}

.m-footer-copyright {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-top: auto;
}

.m-footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.m-footer-col h4 {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.5rem;
}

.m-footer-col a {
  font-size: 16px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: color 0.2s;
}

.m-footer-col a:hover {
  color: #fff;
  text-decoration: underline;
}

/* Main content wrapper */
.m-main {
  flex-grow: 1;
}

/* Container */
.m-container {
  max-width: var(--m-container);
  margin: 0 auto;
  padding-left: var(--m-gutter);
  padding-right: var(--m-gutter);
}

.m-section {
  padding: 64px 0;
}

.m-section-title {
  font-size: 30px;
  font-weight: 600;
  color: var(--m-navy);
  margin-bottom: 1.5rem;
}

@media (max-width: 767px) {
  .m-section-title {
    font-size: 24px;
  }
}

/* Content + Sidebar Layout */
.m-content-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .m-content-sidebar {
    flex-direction: row;
    gap: 2rem;
  }
  .m-main-feed {
    flex: 1;
    min-width: 0;
  }
  .m-sidebar {
    width: 300px;
    flex-shrink: 0;
  }
}

/* Sidebar */
.m-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.m-sidebar-sticky .m-sidebar-inner {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.m-widget {
  background: var(--m-white);
  border: 1px solid var(--m-border);
  padding: 1.5rem;
  border-radius: 8px;
}

.m-widget-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.m-widget-header /* Archive / Category pages */
.m-archive-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--m-border);
}

.m-archive-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--m-navy);
  margin: 0 0 0.5rem;
}

.m-archive-desc {
  font-size: 16px;
  color: #45464D;
  margin: 0;
  max-width: 600px;
}

.m-pagination {
  margin-top: 2rem;
  text-align: center;
}

.m-pagination .nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.m-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.5rem;
  border-radius: var(--m-radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--m-charcoal);
  text-decoration: none;
  transition: all 0.2s;
}

.m-pagination .page-numbers.current {
  background: var(--m-blue);
  color: #fff;
}

.m-pagination .page-numbers:hover:not(.current) {
  background: var(--m-surface-container);
}

.m-category-badge {
  display: inline-block;
  background: rgba(37,99,235,0.1);
  color: var(--m-blue);
  padding: 2px 10px;
  border-radius: var(--m-radius-sm);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.material-symbols-outlined {
  color: var(--m-blue);
}

.m-widget-header h3,
.m-widget h3 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--m-navy);
  margin: 0;
}

.m-widget-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--m-navy);
  border-bottom: 1px solid var(--m-border);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.m-widget-empty {
  font-size: 14px;
  color: var(--m-text-secondary);
}

/* Trending items */
.m-trending-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.5rem 0;
}

.m-trending-num {
  color: var(--m-blue);
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
  margin-top: 2px;
}

.m-trending-item a {
  font-size: 14px;
  font-weight: 500;
  color: var(--m-navy);
  text-decoration: none;
  transition: color 0.2s;
}

.m-trending-item a:hover {
  color: var(--m-blue);
}

/* NTN Calculator widget overrides */
.m-ntn-result {
  border-top: 1px solid var(--m-border);
  padding-top: 1rem;
  margin-top: 1rem;
}

.m-ntn-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0;
}

.m-ntn-row span {
  font-size: 12px;
  color: var(--m-text-secondary);
}

.m-ntn-row strong {
  font-weight: 700;
  color: var(--m-navy);
}

.m-text-accent {
  color: var(--m-blue) !important;
}

.m-calc-disclaimer {
  font-size: 10px;
  color: var(--m-text-secondary);
  margin-top: 0.5rem;
  line-height: 1.4;
}

.m-btn-full {
  width: 100%;
}

/* Post cards (horizontal layout for homepage) */
.m-post-card {
  background: var(--m-white);
  border: 1px solid var(--m-border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.3s;
  margin-bottom: 1.5rem;
}

.m-post-card:hover {
  box-shadow: 0 4px 12px rgba(15,23,42,0.08);
}

@media (min-width: 640px) {
  .m-post-card {
    flex-direction: row;
  }
  .m-post-thumb {
    width: 33.333%;
    flex-shrink: 0;
  }
  .m-post-content {
    width: 66.666%;
  }
}

.m-post-thumb {
  height: 200px;
  overflow: hidden;
  background: var(--m-surface-container);
}

.m-post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.m-post-card:hover .m-post-thumb img {
  transform: scale(1.05);
}

.m-post-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.m-post-content .m-category-badge {
  display: inline-block;
  width: fit-content;
  margin-bottom: 0.75rem;
}

.m-post-content h3 {
  font-size: 24px;
  font-weight: 600;
  color: var(--m-navy);
  margin: 0 0 0.5rem;
  line-height: 1.3;
}

.m-post-content h3 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.m-post-content h3 a:hover {
  color: var(--m-blue);
}

.m-post-content p {
  color: var(--m-text-secondary);
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.m-post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 12px;
  font-weight: 500;
  color: var(--m-text-secondary);
  letter-spacing: 0.05em;
  margin-top: auto;
}

.m-post-meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.m-post-meta .material-symbols-outlined {
  font-size: 16px;
}

/* Empty state */
.m-empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--m-text-secondary);
}

.m-empty-state .material-symbols-outlined {
  font-size: 48px;
  color: var(--m-border);
  margin-bottom: 1rem;
}

/* Pillar cards (on homepage) */
.m-pillar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.m-pillar-header h3 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--m-navy);
  margin: 0;
}

.m-pillar-links {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  flex-grow: 1;
}

.m-pillar-links li {
  padding: 0.4rem 0;
}

.m-pillar-links a {
  font-size: 16px;
  color: var(--m-text);
  text-decoration: none;
  transition: color 0.2s;
}

.m-pillar-links a:hover {
  color: var(--m-blue);
}

.m-pillar-empty {
  font-size: 14px;
  color: var(--m-text-secondary);
  font-style: italic;
}

.m-view-all {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 14px;
  font-weight: 500;
  color: var(--m-blue);
  text-decoration: none;
  margin-top: auto;
}

.m-view-all:hover {
  text-decoration: underline;
}

.m-view-all .material-symbols-outlined {
  font-size: 14px;
}

/* Article layout */
.m-article-layout {
  display: flex;
  flex-direction: column;
  gap: var(--m-gutter);
  padding-top: 2rem;
  padding-bottom: 4rem;
}

@media (min-width: 1024px) {
  .m-article-layout {
    flex-direction: row;
  }
  .m-article {
    flex: 1;
    max-width: var(--m-content);
  }
}

.m-article-header {
  margin-bottom: 2rem;
}

.m-article-header h1 {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--m-navy);
  margin: 0.5rem 0;
}

@media (min-width: 768px) {
  .m-article-header h1 {
    font-size: 48px;
    line-height: 1.2;
    letter-spacing: -0.02em;
  }
}

.m-category-badge-lg {
  font-size: 14px;
  padding: 0.25rem 0.75rem;
}

.m-article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: 12px;
  font-weight: 500;
  color: var(--m-text-secondary);
  letter-spacing: 0.05em;
  padding-top: 1rem;
  border-top: 1px solid var(--m-border);
  margin-top: 1rem;
}

.m-author-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.m-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.m-meta-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--m-border);
}

.m-article-meta .material-symbols-outlined {
  font-size: 16px;
  vertical-align: text-bottom;
}

/* Article body */
.m-article-body {
  font-size: 18px;
  line-height: 1.65;
  color: var(--m-text);
}

.m-article-body h2 {
  font-size: 30px;
  font-weight: 600;
  color: var(--m-navy);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

/* Related items in sidebar */
.m-related-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--m-surface-container);
}

.m-related-item:last-child {
  border-bottom: none;
}

.m-related-item a {
  font-size: 14px;
  font-weight: 500;
  color: var(--m-navy);
  text-decoration: none;
  display: block;
  margin-bottom: 0.25rem;
}

.m-related-item a:hover {
  color: var(--m-blue);
}

.m-related-meta {
  font-size: 12px;
  color: var(--m-text-secondary);
}

/* Ad slots */
.m-ad-300x600 {
  width: 300px;
  height: 600px;
  background: var(--m-surface-low);
  border: 1px dashed var(--m-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--m-text-secondary);
  letter-spacing: 0.05em;
  border-radius: 4px;
}

/* Mobile sticky ad */
.m-mobile-sticky-ad {
  display: none;
}

@media (max-width: 767px) {
  .m-mobile-sticky-ad {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: var(--m-surface-high);
    border-top: 1px solid var(--m-border);
    align-items: center;
    justify-content: center;
    z-index: 50;
    font-size: 12px;
    color: var(--m-text-secondary);
    letter-spacing: 0.05em;
    box-shadow: 0 -4px 12px rgba(15,23,42,0.05);
  }
}

/* Hero pills as links */
.m-hero-pills a {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #FFFFFF;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: background 0.2s;
  backdrop-filter: blur(4px);
}

.m-hero-pills a:hover {
  background: rgba(255,255,255,0.2);
  color: #FFFFFF;
}

/* Portals strip layout */
.m-portals-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.m-portals-label .material-symbols-outlined {
  color: var(--m-blue);
}

.m-portals-label span:last-child {
  font-size: 14px;
  font-weight: 500;
  color: #00174B;
}

.m-portals-links {
  display: flex;
  gap: 1rem;
}

.m-portals-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--m-blue);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.m-portals-links a:hover {
  text-decoration: underline;
}

.m-portals-links .material-symbols-outlined {
  font-size: 14px;
}

/* Helplines in sidebar */
.m-helplines {
  background: var(--m-surface);
  border-left: 4px solid var(--m-emerald);
  padding: 1.5rem;
  border-radius: 0 8px 8px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.m-helplines-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.m-helplines-header .material-symbols-outlined {
  color: var(--m-emerald);
}

.m-helplines-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--m-navy);
  margin: 0;
}

.m-helplines ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.m-helplines li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--m-border);
  font-size: 14px;
}

.m-helplines li:last-child {
  border-bottom: none;
}

.m-helplines li span {
  color: var(--m-text-secondary);
}

.m-helplines li strong {
  color: var(--m-navy);
  font-weight: 700;
}

/* Astra overrides for our templates */
body.page-template-default .ast-separate-container .ast-article-post,
body.page-template-default .ast-separate-container .ast-article-single,
body.single .ast-separate-container .ast-article-single,
body.home .ast-separate-container {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.ast-separate-container .site-content > .ast-container {
  max-width: none;
  padding: 0;
}

#primary, #secondary {
  padding: 0;
  margin: 0;
}

.entry-content {
  margin: 0;
}

/* ========================================
   CRITICAL LAYOUT FIXES
   ======================================== */

/* Force hide ALL Astra header/footer elements */
body .ast-above-header-wrap,
body .ast-below-header-wrap,
body #ast-desktop-header,
body .ast-main-header-wrap,
body #masthead,
body .ast-mobile-header-wrap,
body .site-header,
body .ast-footer-overlay,
body .site-footer,
body #colophon,
body .ast-small-footer,
body .ast-above-header,
body .ast-below-header,
body .main-header-bar-wrap,
body .ast-primary-header-bar,
body #ast-mobile-header {
  display: none !important;
}

/* Header layout fix */
.m-header {
  background: #FFFFFF !important;
  border-bottom: 1px solid #E2E8F0 !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 999 !important;
  width: 100% !important;
}

.m-header-inner {
  max-width: 1280px !important;
  margin: 0 auto !important;
  padding: 0 24px !important;
  height: 64px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.m-logo {
  font-family: 'Inter', sans-serif !important;
  font-size: 24px !important;
  font-weight: 700 !important;
  color: #0F172A !important;
  text-decoration: none !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}



/* Nav menu - override WP default list styles */
.m-nav-desktop {
  display: none !important;
}

@media (min-width: 768px) {
  .m-nav-desktop {
    display: block !important;
  }
  .m-mobile-menu-btn {
    display: none !important;
  }
}

.m-nav-desktop .m-nav-links,
.m-nav-desktop ul {
  display: flex !important;
  align-items: center !important;
  gap: 1.5rem !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.m-nav-desktop .m-nav-links li,
.m-nav-desktop ul li {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.m-nav-desktop .m-nav-links li::before,
.m-nav-desktop ul li::before {
  display: none !important;
  content: none !important;
}

.m-nav-desktop .m-nav-links a,
.m-nav-desktop ul a {
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #45464D !important;
  text-decoration: none !important;
  letter-spacing: 0.01em !important;
  transition: color 0.2s !important;
}

.m-nav-desktop .m-nav-links a:hover,
.m-nav-desktop ul a:hover,
.m-nav-desktop .current-menu-item a {
  color: #2563EB !important;
}

.m-header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

/* Hero search form fix */
.m-hero-search form {
  position: relative !important;
  max-width: 42rem !important;
  margin: 0 auto !important;
}

.m-hero-search .m-search-icon {
  position: absolute !important;
  left: 16px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: #76777D !important;
  z-index: 1 !important;
  pointer-events: none !important;
}

.m-hero-search input[type="search"] {
  width: 100% !important;
  padding: 16px 120px 16px 48px !important;
  border-radius: 4px !important;
  border: 1px solid #C6C6CD !important;
  font-size: 18px !important;
  background: #FFFFFF !important;
  color: #191C1E !important;
  box-sizing: border-box !important;
  outline: none !important;
}

.m-hero-search input[type="search"]:focus {
  border-color: #2563EB !important;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.3) !important;
}

.m-hero-search .m-btn-primary {
  position: absolute !important;
  right: 8px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  padding: 8px 24px !important;
}

/* Hero pills as horizontal flex */
.m-hero-pills {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 0.75rem !important;
  margin-top: 2rem !important;
}

.m-hero-pills a {
  background: rgba(255,255,255,0.1) !important;
  border: 1px solid rgba(255,255,255,0.2) !important;
  color: #FFFFFF !important;
  padding: 0.5rem 1rem !important;
  border-radius: 9999px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  letter-spacing: 0.05em !important;
  text-decoration: none !important;
  backdrop-filter: blur(4px) !important;
  transition: background 0.2s !important;
}

.m-hero-pills a:hover {
  background: rgba(255,255,255,0.2) !important;
  color: #FFFFFF !important;
}

/* Portals strip horizontal layout */
.m-portals-strip {
  background: #DBE1FF !important;
  border-top: 1px solid #B4C5FF !important;
  border-bottom: 1px solid #B4C5FF !important;
}

.m-portals-inner {
  max-width: 1280px !important;
  margin: 0 auto !important;
  padding: 1rem 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 1rem !important;
}

/* Pillar grid - 3 columns on desktop */
.m-pillar-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 1.5rem !important;
}

@media (min-width: 768px) {
  .m-pillar-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* Pillar cards */
.m-pillar-card {
  background: #FFFFFF !important;
  border: 1px solid #E0E3E5 !important;
  padding: 1.5rem !important;
  border-radius: 8px !important;
  display: flex !important;
  flex-direction: column !important;
  transition: box-shadow 0.3s !important;
}

.m-pillar-card:hover {
  box-shadow: 0 4px 16px rgba(15,23,42,0.08) !important;
}

.m-pillar-header {
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
  margin-bottom: 1.5rem !important;
}

.m-pillar-header h3 {
  font-size: 14px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  color: #0F172A !important;
  margin: 0 !important;
}

.m-pillar-icon {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  background: rgba(37,99,235,0.1) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #2563EB !important;
  flex-shrink: 0 !important;
}

/* Content + sidebar */
.m-content-sidebar {
  display: flex !important;
  flex-direction: column !important;
  gap: 2rem !important;
}

@media (min-width: 1024px) {
  .m-content-sidebar {
    flex-direction: row !important;
  }
  .m-main-feed {
    flex: 1 !important;
    min-width: 0 !important;
  }
  .m-sidebar {
    width: 300px !important;
    flex-shrink: 0 !important;
  }
}

/* Sections */
.m-section {
  padding: 64px 0 !important;
}

.m-container {
  max-width: 1280px !important;
  margin: 0 auto !important;
  padding-left: 24px !important;
  padding-right: 24px !important;
}

/* Footer fix */
.m-footer {
  background: #0F172A !important;
  color: rgba(255,255,255,0.8) !important;
  margin-top: auto !important;
}

.m-footer-inner {
  max-width: 1280px !important;
  margin: 0 auto !important;
  padding: 64px 24px !important;
}

.m-footer-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 2rem !important;
}

@media (min-width: 768px) {
  .m-footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr !important;
  }
}

/* Override Astra's separate container */
body .ast-separate-container {
  background: transparent !important;
}

body .ast-separate-container .ast-article-post,
body .ast-separate-container .ast-article-single,
body .ast-separate-container .ast-article-inner {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

body .site-content > .ast-container {
  max-width: none !important;
  padding: 0 !important;
}

body #primary {
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}

body #secondary {
  display: none !important;
}

/* Astra's page wrapper overrides */
.ast-page-builder-template .site-content > .ast-container,
.ast-plain-container .site-content > .ast-container {
  max-width: 100% !important;
  padding: 0 !important;
}

/* Remove Astra's breadcrumb if showing */
.ast-breadcrumbs-wrapper {
  display: none !important;
}

/* Fix body background */
body {
  background: #F8FAFC !important;
}

/* Ensure material symbols show */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined' !important;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24 !important;
}
