/* Blog Page Styles */
/* Adjust the main content positioning */
.blog-main {
  margin: 60px auto 0; /* Changed from 100px to 150px to match index.html sections */
  font-family: Montserrat, -apple-system, Roboto, Helvetica, sans-serif;
  margin-left: 70px; /* consistent left margin with index.html */
}

/* Adjust the blog header positioning to account for the new margin */
.blog-header {
  padding: 60px 5% 40px; /* Reduced top padding slightly to balance the increased margin */
  background-color: #fafafa;
}

.blog-header-container {
  max-width: 1200px;
  margin: 0 auto;
}

.blog-title {
  font-size: 42px;
  font-weight: 500;
  color: rgba(109, 110, 110, 1);
  margin-bottom: 16px;
  
}

.blog-title-bold {
  font-weight: 700;
}

.blog-subtitle {
  font-size: 18px;
  color: #666;
  max-width: 600px;
  line-height: 1.5;
}

/* Blog Filters */
.blog-filters {
  padding: 20px 5%;
  border-bottom: 1px solid #f0f0f0;
}

.blog-filters-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.blog-filter-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.blog-filter-button {
  padding: 8px 16px;
  border-radius: 20px;
  background: transparent;
  border: 1px solid #e0e0e0;
  color: #666;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.blog-filter-button:hover {
  background-color: rgba(107, 201, 239, 0.1);
  border-color: #41B8E8;
  color: #41B8E8;
}

.blog-filter-active {
  background-color: rgba(107, 201, 239, 0.1);
  border-color: #41B8E8;
  color: #41B8E8;
}

/* Updated search layout for your blog */
.blog-search {
  display: flex;
  align-items: stretch; /* This ensures children stretch to fill height */
  margin-bottom: 0px; 
  max-width: 600px;
  width: 100%;
  height: 54px; /* Set the same height as search-notification-wrapper */
  margin-right: auto;
  margin-top: auto;
  margin-bottom:auto;
  margin-left: 0px;
  position: relative;
}

#blog-search-input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #e0e0e0;
  border-radius: 20px 0 0 20px; /* Rounded left corners */
  font-size: 16px;
  outline: none;
  height: 46px; /* Set a specific height */
  box-sizing: border-box;
  background-color: #f8f9fa;
}

#blog-search-input:focus {
  border-color: #2aa4d4;
  box-shadow: 0 0 0 2px rgba(68,134,244,0.2);
}

#blog-search-button {
  display: inline-flex; /* Use inline-flex for better alignment */
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  background-color: #41B8E8;
  color: white;
  border: none;
  border-radius: 0 20px 20px 0; /* Rounded right corners */
  cursor: pointer;
  font-size: 16px;
  height: 46px; /* Match height of input field exactly */
  min-width: 60px;
  box-sizing: border-box;
  transition: background-color 0.2s;
}

#blog-search-button:hover {
  background-color: #2aa4d4;
}

/* Style for the search icon */
#blog-search-button i,
#blog-search-button svg {
  font-size: 18px;
  margin-right: 5px; /* Add space between icon and text if you have text */
  display: block; /* Ensure icon is visible */
}

/* If you're using only an icon without text */
#blog-search-button i:only-child,
#blog-search-button svg:only-child {
  margin-right: 0;
}

/* Style for the search clear button (x) */
.search-clear-button {
  position: absolute;
  right: 70px; /* Position before the search button */
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 20px;
  color: #999;
  cursor: pointer;
  padding: 0 8px;
  display: none; /* Hidden by default */
  z-index: 10;
}

.search-clear-button:hover {
  color: #41B8E8; /* Use your brand color on hover */
}

/* Featured Post */
.blog-featured {
  padding: 60px 5% 40px;
}

.blog-featured-container {
  max-width: 1200px;
  margin: 0 auto;
}

.blog-featured-post {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: center;
  margin-bottom: 60px;
}

.blog-featured-content {
  padding-right: 20px;
}

.blog-featured-image-container {
  max-height: 400px;
  overflow: hidden;
  border-radius: 8px;
}

.blog-featured-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
}

.blog-featured-image:hover {
  transform: scale(1.02);
}

.blog-post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.blog-post-category {
  background-color: rgba(97, 85, 165, 0.1);
  color: #6155a5;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.blog-post-date {
  color: #888;
  font-size: 14px;
  text-align: right;
  margin-left: auto;
}

.blog-featured-title {
  font-size: 28px;
  color: rgba(109, 110, 110, 1);
  margin-bottom: 16px;
  font-weight: 600;
}

.blog-featured-excerpt {
  color: #666;
  line-height: 1.6;
  margin-bottom: 24px;
}

.blog-read-more {
  display: inline-block;
  color: #41B8E8;
  text-decoration: none;
  font-weight: 600;
  position: relative;
  transition: color 0.3s ease;
}

.blog-read-more::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #41B8E8;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.blog-read-more:hover {
  color: #2aa4d4;
}

.blog-read-more:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Blog Posts Grid */
.blog-posts {
  padding: 40px 5% 80px;
}

.blog-grid-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  position: relative; /* Ensure absolute positioning of children works */
  transition: min-height 0.3s ease; /* Smooth transition when height changes */
}

.blog-post {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-post:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.blog-post-image-container {
  width: 100%;
  overflow: hidden;
}

.blog-post-image {
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.blog-post:hover .blog-post-image {
  transform: scale(1.05);
}

.blog-post-content {
  padding: 20px;
}

.blog-post-title {
  font-size: 18px;
  font-weight: 600;
  margin: 10px 0;
  line-height: 1.4;
  color: #333;
}

.blog-post-excerpt {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 16px;
}

/* Pagination */
.blog-pagination {
  max-width: 1200px;
  margin: 40px auto 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 30px;
  position: relative; /* Keep position consistent */
  z-index: 10;
}

.blog-pagination-button {
  background: transparent;
  border: 1px solid #e0e0e0;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #666;
}

.blog-pagination-button:hover:not([disabled]) {
  background-color: rgba(107, 201, 239, 0.1);
  border-color: #41B8E8;
  color: #41B8E8;
}

.blog-pagination-button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.blog-pagination-current {
  font-size: 14px;
  color: #666;
}

.blog-pagination {
  display: flex !important; /* Force display */
  justify-content: center;
  margin: 40px auto;
  gap: 8px;
}

.blog-pagination-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background-color: #f8f9fa;
  color: #444;
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 16px; /* Ensure text is visible */
  border-radius: 8px;
}

.blog-pagination-item:hover {
  background-color: #e9ecef;
}

.blog-pagination-item.active {
  background-color: #41B8E8;
  color: white;
  font-weight: bold;
}

.blog-pagination-item.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Newsletter */
.blog-newsletter {
  background-color: #f9f9f9;
  padding: 60px 5%;
  margin-top: 60px;
}

.blog-newsletter-container {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.blog-newsletter-title {
  font-size: 28px;
  color: #333;
  margin-bottom: 10px;
}

.blog-newsletter-subtitle {
  color: #666;
  margin-bottom: 30px;
}

.blog-newsletter-form {
  display: flex;
  max-width: 500px;
  margin: 0 auto;
}

.blog-newsletter-input {
  flex-grow: 1;
  padding: 12px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 4px 0 0 4px;
  outline: none;
  font-size: 14px;
  border-radius: 20px 0 0 20px; /* Rounded left corners */
}

.blog-newsletter-button {
  background-color: #41B8E8;
  color: white;
  border: none;
  border-radius: 0 4px 4px 0;
  padding: 0 24px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
  border-radius: 0 20px 20px 0;
}

.blog-newsletter-button:hover {
  background-color: #2aa4d4;
}

/* Loading and Error Styles */
.loading {
    text-align: center;
    padding: 40px;
    font-style: italic;
    color: #666;
}

.blog-error {
    text-align: center;
    color: #e74c3c;
    padding: 40px;
    display: none;
}

/* Add to your CSS file */
.blog-post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
}
.blog-post-author {
  /* Updated author styles */
  text-align: right;
  font-style: italic;
  color: #666;
}

.blog-post-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.blog-post-img-container {
  width: 100%;
  height: 220px; /* Set a fixed height for consistency */
  overflow: hidden;
  position: relative;
}

.blog-post-img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* This ensures images cover the container without distortion */
  object-position: center; /* Centers the image */
  transition: transform 0.3s ease; /* Optional: for hover effects */
}

/* Optional: Add a subtle zoom effect on hover */
.blog-post:hover .blog-post-img {
  transform: scale(1.05);
}

/* Rounded styling for all interactive elements */

/* Clear search button */
.clear-search-button {
  background-color: #41B8E8; /* Using the same blue color as the search button */
  color: white;
  border: none;
  border-radius: 20px; /* Rounded corners */
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.clear-search-button:hover {
  background-color: #2aa4d4;
}

/* Email subscription form */
.newsletter-form {
  display: flex;
  gap: 10px;
  max-width: 600px;
  margin: 0 auto;
}

.newsletter-email {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #e0e0e0;
  border-radius: 20px; /* Rounded corners */
  font-size: 16px;
  outline: none;
  height: 46px;
  box-sizing: border-box;
  background-color: #f8f9fa;
}

.newsletter-email:focus {
  border-color: #2aa4d4;
  box-shadow: 0 0 0 2px rgba(68,134,244,0.2);
}

.newsletter-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  background-color: #41B8E8; /* Same blue color */
  color: white;
  border: none;
  border-radius: 20px; /* Rounded corners */
  cursor: pointer;
  font-size: 16px;
  height: 46px;
  min-width: 100px;
  box-sizing: border-box;
  transition: background-color 0.2s;
}

.newsletter-submit:hover {
  background-color: #3a75d8;
}

/* Loading and Error Styles */
.loading {
    text-align: center;
    padding: 40px;
    font-style: italic;
    color: #666;
}

.blog-error {
    text-align: center;
    color: #e74c3c;
    padding: 40px;
    display: none;
}

/* Add to your CSS file */
.blog-post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
}
.blog-post-author {
  /* Updated author styles */
  text-align: right;
  font-style: italic;
  color: #666;
}

.blog-post-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.blog-post-img-container {
  width: 100%;
  height: 220px; /* Set a fixed height for consistency */
  overflow: hidden;
  position: relative;
}

.blog-post-img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* This ensures images cover the container without distortion */
  object-position: center; /* Centers the image */
  transition: transform 0.3s ease; /* Optional: for hover effects */
}

/* Optional: Add a subtle zoom effect on hover */
.blog-post:hover .blog-post-img {
  transform: scale(1.05);
}

/* Rounded styling for all interactive elements */

/* Clear search button */
.clear-search-button {
  background-color: #41B8E8; /* Using the same blue color as the search button */
  color: white;
  border: none;
  border-radius: 20px; /* Rounded corners */
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.clear-search-button:hover {
  background-color: #2aa4d4;
}

/* Email subscription form */
.newsletter-form {
  display: flex;
  gap: 10px;
  max-width: 600px;
  margin: 0 auto;
}

.newsletter-email {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #e0e0e0;
  border-radius: 20px; /* Rounded corners */
  font-size: 16px;
  outline: none;
  height: 46px;
  box-sizing: border-box;
  background-color: #f8f9fa;
}

.newsletter-email:focus {
  border-color: #2aa4d4;
  box-shadow: 0 0 0 2px rgba(68,134,244,0.2);
}

.newsletter-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  background-color: #41B8E8; /* Same blue color */
  color: white;
  border: none;
  border-radius: 20px; /* Rounded corners */
  cursor: pointer;
  font-size: 16px;
  height: 46px;
  min-width: 100px;
  box-sizing: border-box;
  transition: background-color 0.2s;
}

.newsletter-submit:hover {
  background-color: #3a75d8;
}

/* Search notification - container for clear search button */
.search-notification {
  background-color: #f1f8ff;
  border: 1px solid #d1e9ff;
  border-radius: 20px; /* Match the rounded style */
  padding: 10px 16px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  color: #333;
  margin-top: auto;
  margin-bottom: auto;
  margin-left: auto;
}

/* Full blog post styles */
.blog-post-full {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

.blog-post-full-header {
  margin-bottom: 30px;
  text-align: left;
}

.blog-post-full-title {
  font-size: 42px;
  font-weight: 700;
  color: #333;
  margin: 10px 0;
  line-height: 1.2;
}

.blog-post-full-meta {
  display: flex;
  align-items: center;
  gap: 15px;
}

.blog-post-full-author {
  font-size: 16px;
  color: #666;
  margin-bottom: 20px;
}

.blog-post-full-featured-image {
  width: 100%;
  margin-bottom: 30px;
  border-radius: 8px;
  overflow: hidden;
}

.blog-post-full-featured-image img {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
}

.blog-post-full-content {
  font-size: 18px;
  line-height: 1.8;
  color: #444;
  margin-bottom: 40px;
}

.blog-post-full-content p {
  margin-bottom: 20px;
}

.blog-post-full-content h2 {
  font-size: 28px;
  font-weight: 600;
  margin: 40px 0 20px;
}

.blog-post-full-content h3 {
  font-size: 24px;
  font-weight: 500;
  margin: 30px 0 15px;
}

.blog-post-full-content a {
  color: #41B8E8;
  text-decoration: none;
}

.blog-post-full-content a:hover {
  text-decoration: underline;
}

.blog-post-full-content img {
  max-width: 100%;
  height: auto;
  margin: 20px 0;
  border-radius: 4px;
}

.blog-post-full-content ul,
.blog-post-full-content ol {
  margin: 20px 0;
  padding-left: 20px;
}

.blog-post-full-content li {
  margin-bottom: 8px;
}

.blog-post-full-content blockquote {
  border-left: 4px solid #41B8E8;
  padding-left: 20px;
  margin: 30px 0;
  font-style: italic;
  color: #555;
}

.blog-post-full-content code {
  background-color: #f5f5f5;
  padding: 2px 5px;
  border-radius: 4px;
  font-family: monospace;
}

.blog-post-full-content pre {
  background-color: #f5f5f5;
  padding: 15px;
  border-radius: 4px;
  overflow-x: auto;
  margin: 20px 0;
}

.blog-post-full-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 40px 0;
}

.blog-post-tag {
  background-color: #f5f5f5;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 14px;
  color: #666;
}

.blog-post-full-share {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 40px;
}

.blog-post-share-label {
  font-weight: 500;
  color: #333;
}

.blog-post-share-icons {
  display: flex;
  gap: 10px;
}

.blog-share-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  transition: all 0.3s ease;
}

.blog-share-icon:hover {
  background-color: #41B8E8;
  color: white;
}

.blog-back-button {
  background-color: #f5f5f5;
  border: none;
  border-radius: 30px;
  padding: 10px 20px;
  color: #333;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 30px;
  margin-bottom: 60px;
}

.blog-back-button:hover {
  background-color: #e5e5e5;
}

.blog-back-button:focus {
  outline: 2px solid #41B8E8;
  outline-offset: 2px;
}

/* Loading and error states */
.loading {
  text-align: center;
  padding: 40px;
  font-style: italic;
}

.blog-error {
  text-align: center;
  color: #e74c3c;
  padding: 40px;
}

/* Responsive styles */
@media (max-width: 991px) {
  .blog-post-full-title {
    font-size: 32px;
  }
  
  .blog-post-full-content {
    font-size: 16px;
  }
}

@media (max-width: 767px) {
  .blog-post-full-title {
    font-size: 28px;
  }
  
  .blog-post-full-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
  
  .blog-post-full-share {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .blog-main {
    margin-left: 55px;
  }

  .blog-featured-post {
    grid-template-columns: 1fr; /* Stack featured post on smaller screens */
  }
  .blog-filters {
    padding-left: 0 !important;
  }

  .blog-featured {
    padding-left: 0 !important;
  }

}