/* ============================================
   Substack-Style Typography for Entire Blog
   Charter (serif) for content, System fonts for headings
   ============================================ */

/* Import Charter font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Charter:ital,wght@0,400;0,700;1,400;1,700&display=swap');

/* Base typography - Charter for all text content (Substack style) */
body,
p,
span,
div,
li,
td,
th,
input,
textarea,
select,
button,
a,
.entry-content,
.entry-summary,
.page-content,
.comment-content,
.widget {
  font-family: "Charter", "Georgia", "Times New Roman", serif !important;
  letter-spacing: normal !important;
  word-spacing: normal !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}

/* Site description - Substack subtitle style */
.site-description {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif !important;
  font-size: 19px !important;
  line-height: 28px !important;
  font-weight: 400 !important;
  color: #666 !important;
  letter-spacing: normal !important;
  word-spacing: normal !important;
  margin: 4px 0 0 !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}

/* Headings - System fonts stack (Substack style) */
h1, h2, h3, h4, h5, h6,
.entry-title,
.entry-title a,
.site-title,
.site-title a,
.widget-title,
.elementor-heading-title,
.elementor-widget-heading .elementor-heading-title {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif !important;
  font-weight: bold !important;
  letter-spacing: -0.015em !important;
  word-spacing: normal !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}

/* Override Elementor fonts to use Substack style */
.elementor-kit-24 {
  --e-global-typography-primary-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif !important;
  --e-global-typography-secondary-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif !important;
  --e-global-typography-text-font-family: "Charter", "Georgia", serif !important;
  --e-global-typography-accent-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif !important;
  font-family: "Charter", "Georgia", serif !important;
}

/* Force Elementor widgets to use Substack fonts */
.elementor-widget-heading .elementor-heading-title {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif !important;
  font-weight: 600 !important;
  letter-spacing: -0.02em !important;
}

.elementor-widget-text-editor,
.elementor-widget-text-editor p,
.elementor-widget-text-editor span,
.elementor-widget-text-editor div,
.elementor-widget-text-editor * {
  font-family: "Charter", "Georgia", serif !important;
}

/* Override inline Arial and other font styles */
span[style*="font-family: Arial"],
span[style*="font-family:Arial"],
p[style*="font-family: Arial"],
p[style*="font-family:Arial"],
[style*="font-family: Arial"],
[style*="font-family:Arial"],
[style*="font-family: Roboto"],
[style*="font-family: Lora"],
[style*="font-family: Spectral"] {
  font-family: "Charter", "Georgia", serif !important;
}

/* Ensure all text in Elementor uses Charter */
.elementor-element p,
.elementor-element span:not(.elementor-heading-title),
.elementor-element div:not(.elementor-heading-title),
.elementor-element li {
  font-family: "Charter", "Georgia", serif !important;
}

/* Ensure all headings in Elementor use system fonts */
.elementor-element h1,
.elementor-element h2,
.elementor-element h3,
.elementor-element h4,
.elementor-element h5,
.elementor-element h6,
.elementor-heading-title,
.elementor-widget-heading .elementor-heading-title {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif !important;
  font-weight: 600 !important;
  letter-spacing: -0.02em !important;
}

/* Navigation and UI elements - system fonts */
#site-navigation ul li a,
.menu-toggle,
.site-title,
.widget-title,
.cat-links a,
.entry-meta,
.entry-meta a {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif !important;
}

/* Buttons and interactive elements */
button,
input[type="submit"],
input[type="button"],
.mt-readmore-btn,
.bttn {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif !important;
}

/* Code and monospace elements keep monospace */
code,
kbd,
pre,
tt,
var {
  font-family: "Monaco", "Menlo", "Ubuntu Mono", "Consolas", "source-code-pro", monospace !important;
}

/* Improve line height for better readability (Substack style) */
body,
p,
.entry-content,
.entry-summary,
.elementor-widget-text-editor {
  line-height: 1.7 !important;
}

/* Headings line height */
h1, h2, h3, h4, h5, h6,
.entry-title,
.elementor-heading-title {
  line-height: 1.3 !important;
}

/* Ensure post thumbnails and images are visible - CRITICAL FIX */
.post-thumbnail,
.post-thumbnail img,
.wp-post-image,
.attachment-wp-diary-full-width,
.attachment-wp-diary-post-auto,
.attachment-wp-diary-full-width img,
article img,
article .post-thumbnail img,
.entry-content img,
.elementor-widget-image img,
.single .post-thumbnail,
.single .post-thumbnail img,
.single article .post-thumbnail,
.single article .post-thumbnail img,
.single #content article .post-thumbnail,
.single #content article .post-thumbnail img,
.single #content .post-thumbnail,
.single #content .post-thumbnail img {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  max-width: 100% !important;
  height: auto !important;
  width: auto !important;
  position: relative !important;
  overflow: visible !important;
}

/* Ensure post-thumbnail container is visible */
article .post-thumbnail,
.single article .post-thumbnail,
.single #content article .post-thumbnail {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  overflow: visible !important;
  min-height: auto !important;
}

/* Override any display:none on images */
img.wp-post-image,
img.attachment-wp-diary-full-width,
img.attachment-wp-diary-post-auto,
.post-thumbnail img {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 1 !important;
}

/* Ensure pseudo-elements don't hide images */
article .post-thumbnail::before {
  z-index: 0 !important;
}

.single #content article .post-thumbnail::before {
  display: none !important;
  z-index: -1 !important;
}

/* ============================================
   Article Content Styling - Substack Style
   ============================================ */

/* Main article content container - Substack style */
.single .entry-content,
.single article .entry-content,
.entry-content {
  font-size: 19px !important;
  line-height: 1.6em !important;
  letter-spacing: normal !important;
  word-spacing: normal !important;
  color: #0a0a0a !important;
  max-width: 680px !important;
  margin: 0 auto !important;
  padding: 0 24px !important;
  font-family: "Charter", "Georgia", "Times New Roman", serif !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}

/* Reduce padding on mobile - Substack style */
@media (max-width: 650px) {
  .single .entry-content,
  .single article .entry-content,
  .entry-content {
    padding: 0 16px !important;
  }
}

/* Hide custom-header on contact page to match other pages structure */
.custom-header.no-bg-img {
  display: none !important;
}

/* Ensure contact page has same structure as other pages on mobile */
@media (max-width: 768px) {
  /* Hide custom header on all pages for consistency */
  .custom-header.no-bg-img {
    display: none !important;
  }
  
  /* Ensure contact page content area matches other pages */
  .page .entry-content,
  body.page .entry-content {
    padding: 0 16px !important;
    max-width: 680px !important;
    margin: 0 auto !important;
  }
  
  /* Ensure consistent container structure */
  .page #content .mt-container,
  body.page #content .mt-container {
    padding: 0 !important;
  }
  
  .page #primary,
  body.page #primary {
    padding: 0 !important;
  }
  
  /* Ensure site-content structure is consistent */
  .page #content,
  body.page #content {
    padding: 0 !important;
  }
  
  /* Main-menu-wrapper positioning handled in mobile section below */
}

/* Article wrapper - ensure proper centering */
.single #content,
.single article,
.single .content-area {
  max-width: 100% !important;
}

.single #primary,
.single .site-main {
  max-width: 100% !important;
  padding: 0 !important;
}

/* Paragraphs in articles - Substack style (exact match) */
.single .entry-content p,
.single article .entry-content p,
.entry-content p,
.elementor-widget-text-editor p,
.elementor-widget-text-editor p span {
  margin-bottom: 12px !important;
  margin-top: 0 !important;
  font-size: 19px !important;
  line-height: 1.6em !important;
  letter-spacing: normal !important;
  word-spacing: normal !important;
  color: #0a0a0a !important;
  font-family: "Charter", "Georgia", "Times New Roman", serif !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}

/* Remove empty paragraphs - Best Practice (CSS fallback for any remaining) */
.single .entry-content p:empty,
.entry-content p:empty,
.elementor-widget-text-editor p:empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  line-height: 0 !important;
}

/* Hide paragraphs with only whitespace or &nbsp; (using attribute selectors) */
.single .entry-content p[style*="margin-top: 0pt"][style*="margin-bottom: 0pt"]:empty,
.entry-content p[style*="margin-top: 0pt"][style*="margin-bottom: 0pt"]:empty,
.elementor-widget-text-editor p[style*="margin-top: 0pt"][style*="margin-bottom: 0pt"]:empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  line-height: 0 !important;
}

/* Hide paragraphs containing only <br> or <span><br></span> - Best Practice */
.single .entry-content p:has(> span:only-child > br:only-child),
.entry-content p:has(> span:only-child > br:only-child),
.elementor-widget-text-editor p:has(> span:only-child > br:only-child),
.single .entry-content p:has(> br:only-child),
.entry-content p:has(> br:only-child),
.elementor-widget-text-editor p:has(> br:only-child) {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  line-height: 0 !important;
}

/* Fallback for browsers without :has() - hide paragraphs with margin 0px that likely contain only spacing */
.single .entry-content p[style*="margin-top: 0px"][style*="margin-bottom: 0px"]:not(:has(img)):not(:has(strong)):not(:has(em)):not(:has(a)):not(:has(code)) {
  min-height: 0 !important;
}

/* Additional rule: hide paragraphs with only whitespace in spans */
.single .entry-content p > span:only-child:empty,
.entry-content p > span:only-child:empty,
.elementor-widget-text-editor p > span:only-child:empty {
  display: none !important;
}

/* Proper spacing between content elements - Best Practice (Substack style) */
/* First element has no top margin */
.single .entry-content > *:first-child,
.entry-content > *:first-child,
.elementor-widget-text-editor > *:first-child {
  margin-top: 0 !important;
}

/* Last element has no bottom margin */
.single .entry-content > *:last-child,
.entry-content > *:last-child,
.elementor-widget-text-editor > *:last-child {
  margin-bottom: 0 !important;
}

/* Proper spacing: paragraphs after headings (Substack style) */
.single .entry-content h1 + p,
.single .entry-content h2 + p,
.single .entry-content h3 + p,
.single .entry-content h4 + p,
.single .entry-content h5 + p,
.single .entry-content h6 + p,
.entry-content h1 + p,
.entry-content h2 + p,
.entry-content h3 + p,
.entry-content h4 + p,
.entry-content h5 + p,
.entry-content h6 + p,
.elementor-widget-text-editor h1 + p,
.elementor-widget-text-editor h2 + p,
.elementor-widget-text-editor h3 + p,
.elementor-widget-text-editor h4 + p,
.elementor-widget-text-editor h5 + p,
.elementor-widget-text-editor h6 + p {
  margin-top: 0 !important;
  margin-bottom: 12px !important;
}

/* Proper spacing: headings after paragraphs (Substack style) */
.single .entry-content p + h1,
.single .entry-content p + h2,
.single .entry-content p + h3,
.single .entry-content p + h4,
.single .entry-content p + h5,
.single .entry-content p + h6,
.entry-content p + h1,
.entry-content p + h2,
.entry-content p + h3,
.entry-content p + h4,
.entry-content p + h5,
.entry-content p + h6,
.elementor-widget-text-editor p + h1,
.elementor-widget-text-editor p + h2,
.elementor-widget-text-editor p + h3,
.elementor-widget-text-editor p + h4,
.elementor-widget-text-editor p + h5,
.elementor-widget-text-editor p + h6 {
  margin-top: 1em !important;
  margin-bottom: 0.625em !important;
}

/* Proper spacing: images (Substack style) */
.single .entry-content p + img,
.single .entry-content img + p,
.entry-content p + img,
.entry-content img + p,
.elementor-widget-text-editor p + img,
.elementor-widget-text-editor img + p {
  margin-top: 12px !important;
  margin-bottom: 12px !important;
}

/* Proper spacing: blockquotes (Substack style) */
.single .entry-content p + blockquote,
.single .entry-content blockquote + p,
.entry-content p + blockquote,
.entry-content blockquote + p,
.elementor-widget-text-editor p + blockquote,
.elementor-widget-text-editor blockquote + p {
  margin-top: 12px !important;
  margin-bottom: 12px !important;
}

/* Proper spacing: lists (Substack style) */
.single .entry-content p + ul,
.single .entry-content p + ol,
.single .entry-content ul + p,
.single .entry-content ol + p,
.entry-content p + ul,
.entry-content p + ol,
.entry-content ul + p,
.entry-content ol + p,
.elementor-widget-text-editor p + ul,
.elementor-widget-text-editor p + ol,
.elementor-widget-text-editor ul + p,
.elementor-widget-text-editor ol + p {
  margin-top: 12px !important;
  margin-bottom: 12px !important;
}

/* Headings in articles - Substack style (exact match) */
.single .entry-content h1,
.single .entry-content h2,
.single .entry-content h3,
.single .entry-content h4,
.single .entry-content h5,
.single .entry-content h6,
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6,
.elementor-widget-text-editor h1,
.elementor-widget-text-editor h2,
.elementor-widget-text-editor h3,
.elementor-widget-text-editor h4,
.elementor-widget-text-editor h5,
.elementor-widget-text-editor h6 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif !important;
  font-weight: bold !important;
  letter-spacing: -0.015em !important;
  word-spacing: normal !important;
  margin: 1em 0 0.625em !important;
  color: #0a0a0a !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}

/* Override spans inside headings to match heading styles - CRITICAL for consistency */
.single .entry-content h1 span,
.single .entry-content h2 span,
.single .entry-content h3 span,
.single .entry-content h4 span,
.single .entry-content h5 span,
.single .entry-content h6 span,
.entry-content h1 span,
.entry-content h2 span,
.entry-content h3 span,
.entry-content h4 span,
.entry-content h5 span,
.entry-content h6 span,
.elementor-widget-text-editor h1 span,
.elementor-widget-text-editor h2 span,
.elementor-widget-text-editor h3 span,
.elementor-widget-text-editor h4 span,
.elementor-widget-text-editor h5 span,
.elementor-widget-text-editor h6 span,
.single .entry-content div h1 span,
.single .entry-content div h2 span,
.single .entry-content div h3 span,
.single .entry-content div h4 span,
.single .entry-content div h5 span,
.single .entry-content div h6 span,
.entry-content div h1 span,
.entry-content div h2 span,
.entry-content div h3 span,
.entry-content div h4 span,
.entry-content div h5 span,
.entry-content div h6 span,
.elementor-widget-text-editor div h1 span,
.elementor-widget-text-editor div h2 span,
.elementor-widget-text-editor div h3 span,
.elementor-widget-text-editor div h4 span,
.elementor-widget-text-editor div h5 span,
.elementor-widget-text-editor div h6 span {
  font-family: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  color: inherit !important;
  letter-spacing: inherit !important;
  line-height: inherit !important;
  text-align: inherit !important;
  font-style: normal !important;
  text-decoration: none !important;
  background-color: transparent !important;
  white-space: normal !important;
}

/* Ensure headings inside divs also have correct styles */
.single .entry-content div h1,
.single .entry-content div h2,
.single .entry-content div h3,
.single .entry-content div h4,
.single .entry-content div h5,
.single .entry-content div h6,
.entry-content div h1,
.entry-content div h2,
.entry-content div h3,
.entry-content div h4,
.entry-content div h5,
.entry-content div h6,
.elementor-widget-text-editor div h1,
.elementor-widget-text-editor div h2,
.elementor-widget-text-editor div h3,
.elementor-widget-text-editor div h4,
.elementor-widget-text-editor div h5,
.elementor-widget-text-editor div h6 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif !important;
  font-weight: bold !important;
  letter-spacing: -0.015em !important;
  word-spacing: normal !important;
  margin: 1em 0 0.625em !important;
  color: #0a0a0a !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}

.single .entry-content div h1,
.entry-content div h1 {
  font-size: 2em !important;
  margin-top: 0 !important;
  margin-bottom: 0.625em !important;
}

.single .entry-content div h2,
.entry-content div h2 {
  font-size: 1.625em !important;
}

.single .entry-content div h3,
.entry-content div h3 {
  font-size: 1.375em !important;
}

.single .entry-content div h4,
.entry-content div h4 {
  font-size: 1.125em !important;
}

/* Override inline styles on headings - ensure consistency across all articles */
.single .entry-content h1[style],
.single .entry-content h2[style],
.single .entry-content h3[style],
.single .entry-content h4[style],
.single .entry-content h5[style],
.single .entry-content h6[style],
.entry-content h1[style],
.entry-content h2[style],
.entry-content h3[style],
.entry-content h4[style],
.entry-content h5[style],
.entry-content h6[style],
.elementor-widget-text-editor h1[style],
.elementor-widget-text-editor h2[style],
.elementor-widget-text-editor h3[style],
.elementor-widget-text-editor h4[style],
.elementor-widget-text-editor h5[style],
.elementor-widget-text-editor h6[style],
.single .entry-content div h1[style],
.single .entry-content div h2[style],
.single .entry-content div h3[style],
.single .entry-content div h4[style],
.single .entry-content div h5[style],
.single .entry-content div h6[style],
.entry-content div h1[style],
.entry-content div h2[style],
.entry-content div h3[style],
.entry-content div h4[style],
.entry-content div h5[style],
.entry-content div h6[style] {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif !important;
  font-weight: bold !important;
  letter-spacing: -0.015em !important;
  margin: 1em 0 0.625em !important;
  color: #0a0a0a !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}

.single .entry-content h1[style],
.entry-content h1[style] {
  font-size: 2em !important;
  margin-top: 0 !important;
  margin-bottom: 0.625em !important;
}

.single .entry-content h2[style],
.entry-content h2[style] {
  font-size: 1.625em !important;
}

.single .entry-content h3[style],
.entry-content h3[style] {
  font-size: 1.375em !important;
}

.single .entry-content h4[style],
.entry-content h4[style],
.single .entry-content div h4[style],
.entry-content div h4[style] {
  font-size: 1.125em !important;
}

.single .entry-content h1,
.entry-content h1 {
  font-size: 2em !important;
  margin-top: 0 !important;
  margin-bottom: 0.625em !important;
}

.single .entry-content h2,
.entry-content h2 {
  font-size: 1.625em !important;
}

.single .entry-content h3,
.entry-content h3 {
  font-size: 1.375em !important;
}

.single .entry-content h4,
.entry-content h4 {
  font-size: 1.125em !important;
}

/* Lists in articles - Substack style */
.single .entry-content ul,
.single .entry-content ol,
.entry-content ul,
.entry-content ol,
.elementor-widget-text-editor ul,
.elementor-widget-text-editor ol {
  margin: 12px 0 !important;
  padding-left: 1.5em !important;
  line-height: 1.6 !important;
}

.single .entry-content li,
.entry-content li,
.elementor-widget-text-editor li {
  margin: 8px 0 0 32px !important;
  font-size: 19px !important;
  line-height: 1.6 !important;
  font-family: "Charter", "Georgia", "Times New Roman", serif !important;
}

.single .entry-content ul li,
.entry-content ul li {
  list-style-type: disc !important;
}

.single .entry-content ol li,
.entry-content ol li {
  list-style-type: decimal !important;
}

/* Blockquotes - Substack style */
.single .entry-content blockquote,
.entry-content blockquote,
.elementor-widget-text-editor blockquote {
  margin: 1em 0 !important;
  padding-left: 1.5em !important;
  border-left: 4px solid var(--background_pop, #226216) !important;
  font-style: italic !important;
  color: #0a0a0a !important;
  font-size: 19px !important;
  line-height: 1.6 !important;
  font-family: "Charter", "Georgia", "Times New Roman", serif !important;
}

/* Links in articles - Substack style */
.single .entry-content a,
.entry-content a,
.elementor-widget-text-editor a {
  color: #226216 !important;
  text-decoration: none !important;
  border-bottom: 1px solid #226216 !important;
  transition: border-color 0.2s ease !important;
}

.single .entry-content a:hover,
.entry-content a:hover,
.elementor-widget-text-editor a:hover {
  color: #1a4d11 !important;
  border-bottom-color: #1a4d11 !important;
}

/* Strong and emphasis */
.single .entry-content strong,
.single .entry-content b,
.entry-content strong,
.entry-content b,
.elementor-widget-text-editor strong,
.elementor-widget-text-editor b {
  font-weight: 700 !important;
  color: #1a1a1a !important;
}

.single .entry-content em,
.single .entry-content i,
.entry-content em,
.entry-content i,
.elementor-widget-text-editor em,
.elementor-widget-text-editor i {
  font-style: italic !important;
}

/* Code blocks */
.single .entry-content code,
.entry-content code,
.elementor-widget-text-editor code {
  background-color: #f5f5f5 !important;
  padding: 2px 6px !important;
  border-radius: 3px !important;
  font-size: 16px !important;
  font-family: "Monaco", "Menlo", "Ubuntu Mono", "Consolas", monospace !important;
}

.single .entry-content pre,
.entry-content pre,
.elementor-widget-text-editor pre {
  background-color: #f5f5f5 !important;
  padding: 1.5em !important;
  border-radius: 6px !important;
  overflow-x: auto !important;
  margin: 1.5em 0 !important;
  font-size: 16px !important;
  line-height: 1.6 !important;
}

.single .entry-content pre code,
.entry-content pre code,
.elementor-widget-text-editor pre code {
  background: none !important;
  padding: 0 !important;
}

/* Images in articles - Substack style */
.single .entry-content img,
.entry-content img,
.elementor-widget-text-editor img {
  max-width: 100% !important;
  height: auto !important;
  margin: 12px 0 !important;
  border-radius: 0 !important;
  display: block !important;
}

/* Horizontal rules */
.single .entry-content hr,
.entry-content hr,
.elementor-widget-text-editor hr {
  margin: 2em 0 !important;
  border: none !important;
  border-top: 1px solid #e0e0e0 !important;
}

/* Entry header spacing - Substack style */
.single .entry-header,
.single article .entry-header {
  margin-bottom: 0.8em !important;
  max-width: 680px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 0 24px !important;
}

.single .entry-title,
.single article .entry-title {
  font-size: 42px !important;
  line-height: 1.15 !important;
  margin-bottom: 0.3em !important;
  font-weight: 700 !important;
  letter-spacing: -0.025em !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif !important;
  color: #0a0a0a !important;
}

/* Entry meta styling - Substack style */
.single .entry-meta,
.single article .entry-meta {
  font-size: 15px !important;
  color: #666 !important;
  margin-bottom: 1.2em !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif !important;
  max-width: 680px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 0 24px !important;
}

/* Elementor content wrapper - Substack style */
.single .elementor,
.single article .elementor {
  max-width: 680px !important;
  margin: 0 auto !important;
  padding: 0 24px !important;
}

/* Remove excessive padding from Elementor sections */
.single .elementor-section,
.single article .elementor-section {
  padding: 0 !important;
  margin: 0 !important;
}

.single .elementor-container,
.single article .elementor-container {
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Better spacing for Elementor text editor - Substack style */
.single .elementor-widget-text-editor,
.single article .elementor-widget-text-editor {
  padding: 0 !important;
  margin: 0 !important;
}

.single .elementor-widget-text-editor .elementor-widget-container,
.single article .elementor-widget-text-editor .elementor-widget-container {
  padding: 0 !important;
  margin: 0 !important;
}

/* Remove all inline margin/padding styles from Elementor - Substack style */
.single .elementor-widget-text-editor [style*="margin"],
.single article .elementor-widget-text-editor [style*="margin"],
.elementor-widget-text-editor [style*="margin"] {
  margin-top: 0 !important;
  margin-bottom: 12px !important;
}

.single .elementor-widget-text-editor [style*="margin-top: 0px"],
.single article .elementor-widget-text-editor [style*="margin-top: 0px"],
.elementor-widget-text-editor [style*="margin-top: 0px"] {
  margin-top: 0 !important;
}

.single .elementor-widget-text-editor [style*="margin-bottom: 0px"],
.single article .elementor-widget-text-editor [style*="margin-bottom: 0px"],
.elementor-widget-text-editor [style*="margin-bottom: 0px"] {
  margin-bottom: 12px !important;
}

/* Override inline styles from Elementor - Substack exact match */
.single .elementor-widget-text-editor p[style],
.single article .elementor-widget-text-editor p[style],
.elementor-widget-text-editor p[style] {
  margin-top: 0 !important;
  margin-bottom: 12px !important;
  font-size: 19px !important;
  line-height: 1.6 !important;
  color: #0a0a0a !important;
  font-family: "Charter", "Georgia", "Times New Roman", serif !important;
}

.single .elementor-widget-text-editor h4[style],
.single article .elementor-widget-text-editor h4[style],
.elementor-widget-text-editor h4[style] {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif !important;
  font-weight: bold !important;
  font-size: 1.125em !important;
  margin: 1em 0 0.625em !important;
  color: #0a0a0a !important;
  letter-spacing: -0.02em !important;
}

.single .elementor-widget-text-editor span[style],
.single article .elementor-widget-text-editor span[style],
.elementor-widget-text-editor span[style] {
  font-family: "Charter", "Georgia", "Times New Roman", serif !important;
  color: #0a0a0a !important;
  font-size: 19px !important;
  line-height: 1.6 !important;
}

/* Related Posts - Reduce line spacing (more specific to override .single .entry-title) */
.single .mt-single-related-posts .entry-title,
.single .mt-single-related-posts .entry-title a,
.mt-single-related-posts .entry-title,
.mt-single-related-posts .entry-title a {
  line-height: 1.8 !important;
  margin-bottom: 4px !important;
  font-size: inherit !important; /* Override any font-size from .single .entry-title */
}

.mt-single-related-posts .entry-meta {
  line-height: 1.3 !important;
  margin-top: 4px !important;
}

.mt-single-related-posts .cat-links {
  line-height: 1.3 !important;
  margin-bottom: 6px !important;
}

.mt-single-related-posts .mt-cats-list {
  margin-bottom: 6px !important;
}

.mt-single-related-posts .entry-header {
  margin-bottom: 4px !important;
}

/* Ensure images in Related Posts are visible */
.mt-single-related-posts .post-thumbnail,
.mt-single-related-posts .post-thumbnail img,
.mt-single-related-posts article .post-thumbnail,
.mt-single-related-posts article .post-thumbnail img,
.mt-single-related-posts .wp-post-image,
.mt-single-related-posts .attachment-wp-diary-full-width,
.mt-single-related-posts article img,
.mt-single-related-posts article .post-thumbnail img,
.mt-single-related-posts .post-thumbnail img.wp-post-image,
.mt-single-related-posts .post-thumbnail img.attachment-wp-diary-full-width,
.mt-related-posts-wrapper .post-thumbnail,
.mt-related-posts-wrapper .post-thumbnail img,
.mt-related-posts-wrapper article .post-thumbnail,
.mt-related-posts-wrapper article .post-thumbnail img,
.mt-related-posts-wrapper .wp-post-image,
.mt-related-posts-wrapper .attachment-wp-diary-full-width,
.mt-related-posts-wrapper article img {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  max-width: 100% !important;
  height: auto !important;
  width: auto !important;
  position: relative !important;
  overflow: visible !important;
  z-index: 1 !important;
}

/* Ensure post-thumbnail container in Related Posts is visible */
.mt-single-related-posts article .post-thumbnail,
.mt-related-posts-wrapper article .post-thumbnail {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  overflow: visible !important;
  min-height: auto !important;
}

/* Hide social media icons in header - moved to footer */
.mt-header-social-wrapper,
header .mt-header-social-wrapper,
#masthead .mt-header-social-wrapper,
.site-header .mt-header-social-wrapper,
.mt-logo-row-wrapper .mt-header-social-wrapper,
body .mt-header-social-wrapper,
body.home .mt-header-social-wrapper,
body.page .mt-header-social-wrapper,
body.single .mt-header-social-wrapper {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  width: 0 !important;
  overflow: hidden !important;
  position: absolute !important;
  left: -9999px !important;
}

/* Mobile Menu/Header - Logo left, Menu button right */
@media (max-width: 768px) {
  /* Modern SaaS Header - toolbar style - single line */
  .site-header,
  #masthead,
  header {
    position: relative !important;
  }
  
  .mt-logo-row-wrapper {
    padding: 0 !important;
    position: relative !important;
    background: transparent !important;
    border-bottom: none !important;
  }
  
  .mt-logo-row-wrapper .mt-container {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
    position: relative !important;
    padding: 12px 16px !important;
    padding-right: 100px !important; /* Make space for menu button */
    max-width: 100% !important;
    min-height: 56px !important;
  }
  
  /* Logo on mobile - aligned left */
  .custom-logo {
    max-width: 160px !important;
    height: auto !important;
  }
  
  /* Hide site description on mobile */
  .site-description {
    display: none !important;
  }
  
  /* Site branding - left aligned */
  .site-branding {
    margin: 0 !important;
    padding: 0 !important;
    flex: 0 0 auto;
    text-align: left;
    display: flex;
    align-items: center;
    height: 100%;
  }
  
  /* Menu wrapper - position it on the right */
  .site-header .main-menu-wrapper,
  #masthead .main-menu-wrapper,
  header .main-menu-wrapper,
  .main-menu-wrapper {
    position: absolute !important;
    right: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 10 !important;
    display: flex !important;
    align-items: center !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  /* Menu toggle - green button with white text - visible only on mobile */
  .menu-toggle,
  .page .menu-toggle,
  body.page .menu-toggle {
    display: flex !important;
    cursor: pointer !important;
    visibility: visible !important;
    margin: 0 !important;
    align-items: center !important;
    height: auto !important;
    background: transparent !important;
    background-color: transparent !important;
  }
  
  /* Hide desktop navigation on mobile */
  #site-navigation,
  .main-navigation {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    background-color: #fff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    display: none !important;
  }
  
  #site-navigation.active,
  #site-navigation[style*="display: block"] {
    display: block !important;
  }
  
  #site-navigation .menu {
    flex-direction: column !important;
    gap: 0 !important;
  }
  
  #site-navigation .menu li {
    width: 100% !important;
    border-bottom: 1px solid #f5f5f5 !important;
  }
  
  #site-navigation .menu a {
    padding: 14px 0 !important;
    width: 100% !important;
    border-radius: 0 !important;
  }
  
  .menu-toggle a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 8px 14px !important;
    background-color: #009877 !important;
    background: #009877 !important;
    color: #fff !important;
    text-decoration: none !important;
    border: none !important;
    height: 36px !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    line-height: 1;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 152, 119, 0.2);
  }
  
  .menu-toggle a i {
    margin: 0 !important;
    font-size: 16px !important;
    display: inline-block;
    line-height: 1;
    color: #fff !important;
  }
  
  .menu-toggle a:hover {
    background-color: #007a63 !important;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(0, 152, 119, 0.3);
    transform: translateY(-1px);
  }
  
  /* Hide navigation by default on mobile - use max-height/opacity for smooth animation */
  #site-navigation,
  .page #site-navigation,
  body.page #site-navigation,
  .main-navigation,
  .page .main-navigation {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    background-color: #fff !important;
    background: #fff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    z-index: 999 !important;
    padding: 0 !important;
    border-top: 1px solid #f0f0f0 !important;
    margin-top: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px);
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s ease-out, 
                padding 0.35s ease-out,
                visibility 0.3s ease-out,
                transform 0.3s ease-out;
    display: block !important; /* Keep as block for animation to work */
  }
  
  /* Show navigation when active */
  #site-navigation.active,
  .page #site-navigation.active,
  body.page #site-navigation.active,
  .main-navigation.active,
  #site-navigation[style*="display: block"],
  .page #site-navigation[style*="display: block"],
  body.page #site-navigation[style*="display: block"],
  .main-navigation[style*="display: block"],
  #site-navigation[style*="display:block"],
  .page #site-navigation[style*="display:block"],
  body.page #site-navigation[style*="display:block"] {
    max-height: 600px !important;
    padding: 12px 16px 16px !important;
    opacity: 1 !important;
    visibility: visible !important;
    overflow: visible !important;
    display: block !important;
    transform: translateY(0) !important;
  }
  
  #site-navigation .menu {
    flex-direction: column !important;
    gap: 0 !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  #site-navigation .menu li {
    width: 100% !important;
    border-bottom: 1px solid #f5f5f5 !important;
    margin: 0 !important;
  }
  
  #site-navigation .menu li:last-child {
    border-bottom: none !important;
  }
  
  #site-navigation .menu a {
    display: block !important;
    padding: 14px 0 !important;
    width: 100% !important;
    color: #333 !important;
    text-decoration: none !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    transition: color 0.2s ease !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif !important;
  }
  
  #site-navigation .menu a:hover,
  #site-navigation .menu li.current-menu-item > a {
    color: #009877 !important;
  }
  
  /* Hide close button (X) on mobile menu */
  #site-navigation .mt-form-close,
  .page #site-navigation .mt-form-close,
  body.page #site-navigation .mt-form-close {
    display: none !important;
  }
}

/* Justify text in FAQ page */
.page.page-id-28 .entry-content,
.page.page-id-28 .elementor-widget-text-editor,
.page.page-id-28 .entry-content p,
.page.page-id-28 .elementor-widget-text-editor p {
  text-align: justify !important;
}

/* Hide social media icons in header - moved to footer */
.mt-header-social-wrapper,
header .mt-header-social-wrapper,
#masthead .mt-header-social-wrapper,
.site-header .mt-header-social-wrapper,
.mt-logo-row-wrapper .mt-header-social-wrapper,
body .mt-header-social-wrapper,
body.home .mt-header-social-wrapper,
body.page .mt-header-social-wrapper,
body.single .mt-header-social-wrapper {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  width: 0 !important;
  overflow: hidden !important;
  position: absolute !important;
  left: -9999px !important;
}

/* Modern SaaS Footer Styling */
#top-footer,
.footer-widgets-wrapper {
  background-color: transparent;
  border-top: none !important;
  border: none !important;
  padding: 16px 0 !important;
  margin-top: 0;
}

#top-footer .mt-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.footer-widgets-area {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 40px;
}

.mt-footer-widget-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  width: 100%;
}

.mt-footer-widget {
  flex: 0 1 auto;
  min-width: 200px;
  text-align: left;
}

/* First widget (copyright) - left aligned */
.mt-footer-widget:first-child {
  text-align: left;
}

/* Second widget (social media) - right aligned on desktop */
.mt-footer-widget:nth-child(2) {
  text-align: right;
  margin-left: auto;
}

/* Footer social media icons styling - Modern SaaS style */
.mt-footer-social-wrapper {
  text-align: right;
  padding: 0;
}

.mt-footer-social-wrapper .widget-title,
.mt-footer-social-wrapper h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif !important;
}

.mt-footer-social-wrapper .mt-social-icon-wrap {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0;
}

.mt-footer-social-wrapper .mt-social-icon {
  margin: 0 12px;
  display: inline-block;
}

.mt-footer-social-wrapper .mt-social-icon a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  text-decoration: none;
  color: #666;
  font-size: 18px;
  transition: all 0.2s ease;
  line-height: 1;
  border-radius: 6px;
}

.mt-footer-social-wrapper .mt-social-icon a:hover {
  color: #009877;
  background-color: #f0f0f0;
  transform: translateY(-2px);
}

/* Copyright section - Modern SaaS style */
#top-footer .widget_block {
  text-align: center;
  color: #999;
  font-size: 14px;
  line-height: 1.6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif !important;
}

#top-footer .widget_block div {
  margin: 0;
  padding: 0;
}

/* Bottom footer - Modern SaaS style */
#bottom-footer {
  display: block !important;
  background-color: transparent;
  border-top: none;
  padding: 12px 0 !important;
}

#bottom-footer .mt-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

#bottom-footer .site-info {
  text-align: center;
  color: #999;
  font-size: 13px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif !important;
}

#bottom-footer .mt-copyright-text {
  color: #666;
}

#bottom-footer .sep {
  margin: 0 8px;
  color: #ddd;
}

#bottom-footer a {
  color: #666;
  text-decoration: none;
  transition: color 0.2s ease;
}

#bottom-footer a:hover {
  color: #009877;
}

/* Mobile padding improvements - all pages except articles */
@media (max-width: 768px) {
  /* Header and navigation padding */
  .mt-logo-row-wrapper,
  .mt-container,
  .main-menu-wrapper {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  
  /* Site branding padding */
  .site-branding {
    padding: 0 16px !important;
  }
  
  /* Footer padding */
  #top-footer {
    padding: 20px 0 !important;
    margin-top: 0;
  }
  
  #top-footer .mt-container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  
  #bottom-footer {
    padding: 10px 0 !important;
  }
  
  #bottom-footer .mt-container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  
  /* Footer widgets - stack on mobile */
  .footer-widgets-area,
  .mt-footer-widget-wrapper {
    flex-direction: column;
    gap: 24px;
    align-items: center;
  }
  
  .mt-footer-widget {
    max-width: 100%;
    min-width: 100%;
    text-align: center !important;
  }
  
  .mt-footer-widget:first-child {
    text-align: center !important;
  }
  
  .mt-footer-widget:nth-child(2) {
    text-align: center !important;
    margin-left: 0 !important;
  }
  
  .mt-footer-social-wrapper {
    text-align: center !important;
  }
  
  .mt-footer-social-wrapper .mt-social-icon-wrap {
    justify-content: center !important;
  }
  
  /* Sidebar padding */
  #secondary,
  #secondary .widget {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  
  /* Content area padding (not articles) */
  .page #content,
  .page #content .mt-container,
  .page #primary,
  .blog #content,
  .blog #content .mt-container,
  .blog #primary {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  
  /* Archive pages padding */
  .archive #content,
  .archive #content .mt-container,
  .category #content,
  .category #content .mt-container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  
  /* Footer social icons - smaller on mobile */
  .mt-footer-social-wrapper .mt-social-icon {
    margin: 0 4px;
  }
  
  .mt-footer-social-wrapper .mt-social-icon a {
    font-size: 18px;
  }
}

/* Mobile UX/UI improvements */
@media (max-width: 768px) {
  /* Better touch targets */
  .menu-toggle a,
  #site-navigation .menu a,
  .mt-readmore-btn,
  button,
  input[type="submit"],
  input[type="button"] {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Logo already handled in Mobile Menu Fix section above */
  
  /* Footer improvements - already handled above */
  
  /* Widget spacing */
  #secondary .widget {
    margin-bottom: 24px;
  }
  
  /* Better menu toggle visibility */
  .menu-toggle {
    margin: 12px 0;
  }
}


