/* Mobile Dropdown Styles */
.custom-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: none;
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 12px 8px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--bs-gray-400);
  border-radius: 4px;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--bs-gray-500);
  transition: all 0.2s ease;
  box-shadow: none;
  width: 100%;
  height: 48px;
  background-color: var(--bs-white);
  font-family: inherit;
}

.custom-select:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.1);
}

/* Hide default arrow in IE */
select::-ms-expand {
  display: none;
}

/* Custom arrow for better cross-browser support */
.select-arrow {
  pointer-events: none;
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.select-arrow svg {
  width: 17px;
  height: 10px;
  transition: transform 0.3s ease;
  transform-origin: center;
  color: var(--bs-primary);
}

/* Add rotation when select is focused */
.custom-select:focus + .select-arrow svg {
  transform: rotate(180deg);
}

/* Hover and focus states */
.custom-select:hover {
  border-color: var(--bs-primary-800);
}

/* Make sure the dropdown has proper z-index */
.position-relative {
  position: relative;
}

/* Ensure the custom arrow is properly positioned */
.select-arrow {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* Remove default focus outline and add custom focus styles */
.custom-select:focus {
  outline: none;
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.1);
}

/* Style the dropdown options */
.custom-select option {
  padding: 0.5rem 1rem;
  background: var(--bs-white);
  color: var(--bs-primary);
}

/* Style the dropdown when it's open */
.custom-select:focus {
  border-color: var(--bs-primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(var(--bs-primary-rgb), 0.2);
}

/* Ensure the form elements have proper spacing */
.form-select {
  margin-bottom: 0;
}

/* Make sure the dropdown has a white background */
.custom-select {
  background-color: var(--bs-white);
}

/* Style the dropdown when it's read-only */
.custom-select:read-only {
  background-color: var(--bs-white);
  border-color: var(--bs-gray-400);
  cursor: not-allowed;
  color: var(--bs-gray-500);
}

/* Style the dropdown when it's in a form group */
.form-group {
  margin-bottom: 1rem;
}

/* Ensure the dropdown has proper spacing in a form */
.form-control {
  margin-bottom: 1rem;
}

/* Make sure the dropdown has proper width in a form */
.form-select {
  width: 100%;
}

/* Make sure the dropdown has proper height */
select.form-select {
  height: 48px;
  min-height: 48px;
  padding: 0.5rem 1rem;
  line-height: 1.5;
}

.custom-select {
  background-color: var(--bs-white);
  color: var(--bs-gray-500);
  border-color: var(--bs-gray-400);
}

.custom-select option {
  background-color: var(--bs-white);
  color: var(--bs-gray-800);
  padding: 8px 12px;
}

/* For WebKit browsers (Chrome, Safari) */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  .custom-select option:checked,
  .custom-select option:focus,
  .custom-select option:active {
    background: var(--bs-primary)
      linear-gradient(0deg, var(--bs-primary) 0%, var(--bs-primary) 100%);
    color: var(--bs-white);
  }
}

/* For Firefox */
@-moz-document url-prefix() {
  .custom-select option:checked,
  .custom-select option:focus,
  .custom-select option:active {
    background: var(--bs-primary);
    color: var(--bs-white);
  }
}

/* Fallback for other browsers */
.custom-select:focus option:checked {
  background: var(--bs-primary);
  color: var(--bs-white);
}

.custom-select:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.3);
}

/* Base styles */
.blog-section {
  padding-top: 3.75rem;
  padding-bottom: 6.875rem;
}

@media (max-width: 61.99875rem) {
  .blog-section {
    padding-top: 3.75rem;
    padding-bottom: 5.625rem;
  }
}

.blog-filters {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  flex: 0 0 auto;
  padding: 0.75rem 2.5rem;
  font-weight: 400;
  font-size: 1rem;
  text-align: center;
  border-radius: 3.125rem;
  --bs-border-width: 0.125rem;
}

.blog-listing {
  padding: 3.75rem 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  row-gap: 3.75rem;
  column-gap: 2.5rem;
  align-items: start;
}

.blog-listing > *:first-child {
  grid-column: 1 / -1;

  flex-direction: row-reverse;
  align-items: flex-start;
  gap: 2rem;
  .blog-image-container {
    max-width: 41.25rem;
    width: 100%;
    flex: 0 0 auto;
    .blog-image {
      aspect-ratio: 660 / 386;
    }
  }
  .blog-title {
    font-family: Poppins;
    font-weight: 700;
    font-size: 1.5625rem;
    line-height: 2.1875rem;
  }
  .blog-excerpt {
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.5rem;
    color: var(--bs-gray-600);
    margin-top: auto;
  }
}

.blog-listing > *:not(:first-child) {
  .blog-read-more {
    display: none;
  }
}
.load-more-section {
  display: flex;
  justify-content: center;
  align-items: center;
}

@media (max-width: 61.99875rem) {
  .blog-listing {
    grid-template-columns: 1fr;
    padding: 2.5rem 0;
    row-gap: 3.125rem;
  }

  .blog-listing > *:first-child {
    grid-column: 1;
    flex-direction: column;

    .blog-image-container {
      max-width: 41.25rem;
      width: 100%;
      flex: 0 0 auto;
      .blog-image {
        aspect-ratio: 428 / 310;
      }
    }
  }
  .load-more-section {
    .btn {
      width: 100%;
    }
  }
}

.blog-item {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  height: 100%;
}

.blog-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1 1 auto;
}
.blog-category {
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.5rem;
  text-transform: uppercase;
  color: var(--bs-gray-500);
  a {
    color: var(--bs-gray-500);
  }
}
.blog-title {
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.875rem;
  color: var(--bs-gray-800);
  margin-bottom: 0;
}
.blog-date {
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.5rem;
  text-transform: uppercase;
  color: var(--bs-primary-800);
}
.blog-image {
  width: 100%;
  height: auto;
  aspect-ratio: 428 / 310;
  border-radius: 1.25rem;
  object-fit: cover;
  object-position: center;
}
.blog-excerpt {
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.5rem;
  color: var(--bs-gray-600);
  margin-top: auto;
}
.blog-read-more {
  margin-top: 1rem;
}
.blog-read-more-link {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  color: var(--bs-primary);
  span {
    text-decoration: underline;
  }
  &:hover {
    color: var(--bs-secondary);
    text-decoration: none;
  }

  .blog-read-more-icon {
    transform: rotate(-45deg);
  }
}

.blog-details-page {
  padding-top: 10rem;
}
.back-to-blog-btn-section {
  margin-left: -2rem;
  margin-right: -2rem;
}
.back-to-blog-btn {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  color: var(--bs-primary);
  span {
    text-decoration: underline;
  }
  &:hover {
    color: var(--bs-secondary);
    text-decoration: none;
  }

  .back-to-blog-btn-icon {
    transform: rotate(45deg);
  }
}

.blog-details-container {
  max-width: 70rem;
  margin: 0 auto;
}
.blog-details-header {
  display: flex;
  flex-direction: column;
  gap: 0rem;
  padding: 3.125rem 0;
  .blog-category {
    color: var(--bs-gray-500);
  }
  .blog-title {
    font-size: 2.25rem;
    line-height: 2.625rem;
  }
  .blog-excerpt {
    margin-top: 1rem;
  }
}
.blog-details-image-container {
  .blog-details-image {
    width: 100%;
    height: auto;
    max-height: 33.5rem;
    aspect-ratio: 1120 / 536;
    border-radius: 1.25rem;
    object-fit: cover;
    object-position: center;
  }
}
.blog-details-content {
  padding-top: 3.125rem;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.5rem;
  color: var(--bs-gray-600);
  p {
    margin-bottom: 1rem;
    &:last-child {
      margin-bottom: 0;
    }
  }
  strong {
    margin-bottom: 0rem;
    font-weight: 700;
    font-size: 1.5rem;
    line-height: 2.125rem;
    color: var(--bs-gray-800);
  }
}

.related-blogs {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  margin: 3.75rem 0;
  align-items: center;
  @media (max-width: 61.99875rem) {
    margin: 3.125rem 0;
  }
}
.related-blogs-title {
  font-weight: 400;
  font-size: 2.5rem;
  line-height: 3.438rem;
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    font-weight: 400;
    font-size: 2.5rem;
    line-height: 3.438rem;
  }
  span {
    color: var(--bs-primary);
  }
  .font-serif {
    font-size: 3.438rem;
    line-height: 3.438rem;
    font-weight: 400;
  }
}
.related-blogs-listing {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  .blog-read-more {
    display: none;
  }
}

@media (max-width: 61.99875rem) {
  .related-blogs-listing {
    grid-template-columns: 1fr;
  }
  .related-blogs-title {
    font-size: 2.5rem;
    line-height: 3.438rem;
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
      font-size: 2.5rem;
      line-height: 3.438rem;
    }
    .font-serif {
      font-size: 3.438rem;
      line-height: 3.438rem;
    }
  }
}
