/*
 * Custom Styles for Mr Shinez Detailing WordPress Blog Section
 * This file ensures the WordPress blog matches the main site design
 * and prevents horizontal scrolling issues
 */

/* Prevent horizontal scroll - Critical Fix */
html {
  overflow-x: hidden !important;
  width: 100%;
  max-width: 100vw;
}

body {
  overflow-x: hidden !important;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
}

/* Fix navbar horizontal scroll */
.navbar {
  overflow-x: hidden !important;
}

.navbar .container {
  overflow: visible !important;
}

.navbar .dropdown-menu {
  overflow: visible !important;
}

/* Desktop navigation - no scroll at all */
@media (min-width: 992px) {
  .navbar {
    overflow: visible !important;
  }

  .navbar-collapse {
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
  }

  .navbar-nav {
    overflow: visible !important;
  }
}

/* Mobile navigation scroll fix */
@media (max-width: 991.98px) {
  .navbar {
    overflow-x: hidden !important;
    overflow-y: visible !important;
  }

  .navbar-collapse {
    overflow: visible !important;
  }

  .navbar-collapse.show {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-height: calc(100vh - 80px);
  }

  .navbar-collapse.collapsing {
    overflow: hidden !important;
  }

  .navbar-nav {
    overflow: visible !important;
  }
}

/* Ensure all containers stay within viewport */
.wp-site-blocks,
.site-content,
.entry-content,
.wp-block-post-content,
* {
  box-sizing: border-box;
  /* max-width: 100%; */
}

/* Force black background on navigation - no banner in WordPress */
.navbar {
  background: #000000 !important;
}

.navbar.trans-navigation {
  background: #000000 !important;
}

/* Fix WordPress admin bar overlap */
body.admin-bar .navbar.fixed-top {
  top: 32px;
}

@media screen and (max-width: 782px) {
  body.admin-bar .navbar.fixed-top {
    top: 46px;
  }
}

/* Ensure images and media don't overflow */
img,
video,
iframe,
embed,
object {
  max-width: 100%;
  height: auto;
}

/* Fix WordPress Gutenberg blocks that might overflow */
.wp-block-image,
.wp-block-gallery,
.wp-block-embed,
.wp-block-video {
  max-width: 100%;
  overflow: hidden;
}

/* Prevent WordPress default margins from breaking layout */
.wp-block-post-content > * {
  max-width: 100%;
}

/* Override Twenty Twenty-One theme wide/full width blocks */
.entry-content > .alignwide,
.entry-content > .alignfull {
  max-width: 100vw;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

/* Fix container widths */
.site-main,
.entry-content {
  overflow-x: hidden;
}

/* Ensure navigation stays consistent */
.navbar {
  max-width: 100%;
  overflow-x: hidden;
}

/* Fix for mobile responsiveness */
@media (max-width: 991.98px) {
  body,
  html {
    overflow-x: hidden !important;
  }

  .container {
    /* max-width: 100%; */
    overflow-x: hidden;
  }
}

.section.blog-wrap {
  padding: 150px 0px;
}

/* Blog Typography - Match static site styles */
/* Fix for mobile responsiveness */
@media (max-width: 768px) {
  .section.blog-wrap {
    padding: 100px 0px;
  }
}

.blog-post {
  margin-bottom: 50px;
}

.blog-post img {
  border-radius: 5px;
}

.blog-post .post-author i,
.blog-post .post-info i {
  margin-right: 5px;
  font-size: 14px;
}

.blog-post .post-author span,
.blog-post .post-info span {
  font-size: 14px;
  margin-bottom: 0px !important;
}

/* Blog Post Typography - Base Heading Styles */
.blog-post h1,
.blog-post h2,
.blog-post h3,
.blog-post h4,
.blog-post h5,
.blog-post h6,
.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4,
.blog-content h5,
.blog-content h6,
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6,
.wp-block-post-content h1,
.wp-block-post-content h2,
.wp-block-post-content h3,
.wp-block-post-content h4,
.wp-block-post-content h5,
.wp-block-post-content h6 {
  font-family: "Poppins", sans-serif !important;
  font-weight: 600 !important;
  color: #232323 !important;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* H1 Specific */
.blog-post h1,
.blog-content h1,
.entry-content h1,
.wp-block-post-content h1 {
  font-size: 28px !important;
  line-height: 38px !important;
  margin-bottom: 1rem !important;
}

.blog-post h1 a {
  text-decoration: underline;
  color: #232323;
}

.blog-post h1 a:hover {
  text-decoration: none;
  color: #2092f5;
}

/* H2 Specific */
.blog-post h2,
.blog-content h2,
.entry-content h2,
.wp-block-post-content h2 {
  font-size: 22px !important;
  line-height: 32px !important;
  margin-bottom: 0px !important;
}

.blog-post h2 a {
  font-size: 1.5rem;
  color: #232323;
}

.blog-post h2 a:hover {
  color: #2092f5;
}

/* H3 Specific */
.blog-post h3,
.blog-content h3,
.entry-content h3,
.wp-block-post-content h3 {
  font-size: 18px !important;
  line-height: 26px !important;
  margin-bottom: 0px !important;
  color: #595757 !important;
  margin-top: 10px;
}

/* H4 Specific */
.blog-post h4,
.blog-content h4,
.entry-content h4,
.wp-block-post-content h4 {
  font-size: 16px !important;
  line-height: 24px !important;
  margin-bottom: 0px !important;
}

/* H5 Specific */
.blog-post h5,
.blog-content h5,
.entry-content h5,
.wp-block-post-content h5 {
  font-size: 14px !important;
  line-height: 20px !important;
  margin-bottom: 0px !important;
}

/* H6 Specific */
.blog-post h6,
.blog-content h6,
.entry-content h6,
.wp-block-post-content h6 {
  font-size: 12px !important;
  line-height: 18px !important;
  margin-bottom: 0px !important;
}

.blog-post p,
.blog-content p,
.entry-content p,
.wp-block-post-content p {
  line-height: 28px !important;
  font-size: 15px !important;
  font-family: "Rubik", sans-serif !important;
  color: #788487 !important;
  margin-top: 0.5rem !important;
}

.blog-post p a,
.blog-content p a,
.entry-content p a,
.wp-block-post-content p a {
  text-decoration: underline;
  color: #555c5e;
}

.blog-post p a:hover,
.blog-content p a:hover,
.entry-content p a:hover,
.wp-block-post-content p a:hover {
  text-decoration: none;
  color: #2092f5;
}

.blog-post p span,
.blog-content p span,
.entry-content p span,
.wp-block-post-content p span {
  color: #555c5e;
  font-weight: 600;
}

/* Blog Lists */
.blog-post ol,
.blog-post ul,
.blog-content ol,
.blog-content ul,
.entry-content ol,
.entry-content ul,
.wp-block-post-content ol,
.wp-block-post-content ul {
  padding-inline-start: 20px;
  padding-bottom: 10px;
}

.blog-post ol li,
.blog-post ul li,
.blog-content ol li,
.blog-content ul li,
.entry-content ol li,
.entry-content ul li,
.wp-block-post-content ol li,
.wp-block-post-content ul li {
  display: list-item;
  list-style: decimal;
  font-size: 15px !important;
  line-height: 28px !important;
  font-family: "Rubik", sans-serif !important;
  color: #788487 !important;
}

.blog-post ol li span,
.blog-post ul li span,
.blog-content ol li span,
.blog-content ul li span,
.entry-content ol li span,
.entry-content ul li span,
.wp-block-post-content ol li span,
.wp-block-post-content ul li span {
  font-weight: 600;
}

.blog-post ol ::marker,
.blog-post ul ::marker,
.blog-content ol ::marker,
.blog-content ul ::marker,
.entry-content ol ::marker,
.entry-content ul ::marker,
.wp-block-post-content ol ::marker,
.wp-block-post-content ul ::marker {
  font-size: 15px;
  color: #2092f5;
  font-weight: 600;
}

.blog-post ul li,
.blog-content ul li,
.entry-content ul li,
.wp-block-post-content ul li {
  list-style: disc;
}

.blog-post .blog-image {
  text-align: center;
}

.blog-post .list-inline-item {
  display: inline-block;
  font-size: 20px;
}

.blog-share-links h3 {
  font-size: 16px;
  line-height: 24px;
  margin-bottom: 0px !important;
}

/* Ensure WordPress content blocks inherit blog styles */
.blog-content,
.entry-content,
.wp-block-post-content {
  font-family: "Rubik", sans-serif;
}

/* WordPress Gutenberg Block Overrides */
.wp-block-heading {
  font-family: "Poppins", sans-serif !important;
  font-weight: 600 !important;
  color: #232323 !important;
}

.wp-block-paragraph {
  line-height: 28px !important;
  font-size: 15px !important;
  font-family: "Rubik", sans-serif !important;
  color: #788487 !important;
}

.wp-block-list li {
  font-size: 15px !important;
  line-height: 28px !important;
  font-family: "Rubik", sans-serif !important;
  color: #788487 !important;
}

/* Override WordPress default link colors */
.entry-content a,
.wp-block-post-content a {
  color: #555c5e;
}

.entry-content a:hover,
.wp-block-post-content a:hover {
  color: #2092f5;
}

/* Read More Link Styling */
.read-more {
  color: #2092f5;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  margin-top: 10px;
}

.read-more:hover {
  color: #1a7ad1;
}

.read-more i {
  margin-left: 5px;
  transition: margin-left 0.3s ease;
}

.read-more:hover i {
  margin-left: 10px;
}

/* Responsive Blog Grid */
@media (max-width: 991.98px) {
  .blog-post {
    margin-bottom: 40px;
  }

  .col-lg-4.col-md-4 {
    margin-bottom: 30px;
  }
}

@media (max-width: 767.98px) {
  .blog-post h2 {
    font-size: 20px !important;
    line-height: 28px !important;
  }

  .blog-post h1 {
    font-size: 24px !important;
    line-height: 32px !important;
  }

  .blog-post .post-author span,
  .blog-post .post-info span {
    font-size: 12px;
  }

  .blog-post .post-author i,
  .blog-post .post-info i {
    font-size: 12px;
  }
}

@media (max-width: 575.98px) {
  .blog-post {
    margin-bottom: 30px;
  }

  .blog-post .post-author span,
  .blog-post .post-info span {
    font-size: 11px;
  }
}

/* Blog Post Image Container - Fixed Aspect Ratio */
.blog-image-container {
  position: relative;
  width: 100%;
  padding-bottom: 66.67%; /* 3:2 aspect ratio */
  overflow: hidden;
}

.blog-image-container a {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.blog-image-container img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  object-position: center;
  display: block;
}
