/**
 * MS Projects Shortcode Styles for Matilde Saunders Plugin
 * Clean, modern, and responsive design for the projects shortcode
 */

/* ==========================================================================
   Projects Container and Layout
   ========================================================================== */

.matilde-projects-container {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 80px;
}

/* ==========================================================================
   Category Filters
   ========================================================================== */

.matilde-category-filters {
  border-radius: 12px;
}

.matilde-category-filters h3 {
  margin: 0 0 1rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #2c3e50;
}

.matilde-category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: center;
  max-width: 940px;
  margin: 0 auto;
}

/* Mobile Category Dropdown */
.matilde-category-dropdown {
  display: none;
  width: 100%;
  margin: 0 auto;
}

.matilde-dropdown-container {
  position: relative;
  width: 100%;
}

.matilde-category-select {
  width: 100%;
  padding: 12px 16px;
  background-color: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  color: #2f3b4b;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Inter", Sans-serif;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px 8px;
  padding-right: 40px;
}

.matilde-category-select:hover {
  border-color: #e60002;
  box-shadow: 0 2px 8px rgba(230, 0, 2, 0.1);
}

.matilde-category-select:focus {
  outline: none;
  border-color: #e60002;
  box-shadow: 0 2px 8px rgba(230, 0, 2, 0.15);
}

.matilde-category-select option {
  padding: 8px 12px;
  font-size: 16px;
  font-weight: 500;
  color: #2f3b4b;
  background-color: #ffffff;
}

.matilde-category-select option:hover {
  background-color: #f8fafc;
}

.matilde-category-select option:checked {
  background-color: #fef2f2;
  color: #e60002;
  font-weight: 600;
}

.matilde-category-pill {
  font-family: "Inter", Sans-serif !important;
  padding: 8px 20px !important;
  text-transform: none !important;
  font-weight: 400 !important;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #596f7e;
  border: 2px solid #596f7e;
  border-radius: 3px;
  font-size: 16px;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.matilde-category-pill.active {
  background: #e60002;
  border-color: #e60002;
  font-weight: 700;
  box-shadow: none;
}

.matilde-category-pill .matilde-category-count {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ==========================================================================
   Projects Grid
   ========================================================================== */

.matilde-projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
}

.matilde-project-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.matilde-project-card-link:hover {
  text-decoration: none;
}

.matilde-project-card-link:hover .matilde-project-card {
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.matilde-project-card {
  background: #ffffff;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #e2e8f0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.matilde-project-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.matilde-project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.matilde-project-content {
  padding: 1.5rem;
}

.matilde-project-category {
  font-family: "Inter", Sans-serif !important;
  display: inline-block;
  background: #e60002;
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
}

.matilde-project-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #2c3e50;
  margin: 0 0 0.75rem 0;
  line-height: 1.3;
}

.matilde-project-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.matilde-project-meta-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #64748b;
  flex-direction: column;
}

.matilde-project-meta-item strong {
  font-weight: 600;
  color: #475569;
  min-width: 80px;
}

/* Meta labels and values for project cards */
.ms-meta-label {
  font-family: "Inter", Sans-serif !important;
  font-weight: 400;
  font-size: 16px;
  min-width: 60px;
}

.ms-meta-value {
  font-family: "Inter", Sans-serif !important;
  font-weight: 700;
  font-size: 16px;
  color: #475569;
}

.matilde-project-description {
  margin: 1rem 0;
  padding: 0.75rem;
  background: #f8f9fa;
  border-left: 3px solid #e60002;
  border-radius: 0 6px 6px 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #495057;
  font-style: italic;
}

.matilde-project-header {
  padding: 40px;
  background-color: #ffffff;
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
}

.matilde-project-description:empty {
  display: none;
}

.matilde-project-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.matilde-project-view-more {
  color: #ffffff;
  padding: 4px 15px !important;
  border-radius: 2px !important;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 10px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-top: auto;
  box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25) !important;
}

/* ==========================================================================
   Pagination Styles
   ========================================================================== */

.matilde-pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.matilde-pagination-info {
  font-size: 0.875rem;
  color: #64748b;
  text-align: center;
}

.matilde-pagination-controls {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.matilde-per-page-selector {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background-color: #f8f9fa;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.matilde-per-page-selector:hover {
  border-color: #e60002;
  background-color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.matilde-per-page-selector label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #475569;
  margin: 0;
}

.matilde-per-page-selector select {
  padding: 0.375rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background-color: #ffffff;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 60px;
}

.matilde-per-page-selector select:hover,
.matilde-per-page-selector select:focus {
  border-color: #e60002;
  outline: none;
  box-shadow: 0 0 0 3px rgba(230, 0, 2, 0.1);
}

.matilde-pagination-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.matilde-pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  color: #374151;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.matilde-pagination-link:hover {
  background-color: #f9fafb;
  border-color: #e60002;
  color: #e60002;
  text-decoration: none;
}

.matilde-pagination-link.active {
  background-color: #e60002;
  border-color: #e60002;
  color: #ffffff;
}

.matilde-pagination-link.active:hover {
  background-color: #c50002;
  border-color: #c50002;
  color: #ffffff;
}

.matilde-pagination-prev,
.matilde-pagination-next {
  min-width: auto;
  padding: 0 1rem;
}

.matilde-pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  color: #9ca3af;
  font-size: 0.875rem;
}

/* ==========================================================================
   Loading and No Results States
   ========================================================================== */

.matilde-projects-loading {
  text-align: center;
  padding: 3rem;
  color: #64748b;
}

.matilde-projects-loading .spinner {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  border: 3px solid #e2e8f0;
  border-top: 3px solid #e60002;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.matilde-projects-no-results {
  text-align: center;
  padding: 3rem;
  color: #64748b;
}

.matilde-projects-no-results h3 {
  margin: 0 0 1rem 0;
  color: #475569;
}

.matilde-projects-no-results p {
  margin: 0;
  font-size: 0.875rem;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
  /* Show mobile dropdown, hide desktop pills */
  .matilde-category-pills-desktop {
    display: none;
  }

  .matilde-category-dropdown-mobile {
    display: block;
  }

  .matilde-projects-container {
    gap: 60px;
  }

  .matilde-projects-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .matilde-project-content {
    padding: 1rem;
  }

  .matilde-project-title {
    font-size: 1.125rem;
  }

  .matilde-project-actions {
    flex-direction: column;
  }

  .matilde-project-view-more {
    text-align: center;
    justify-content: center;
  }

  .matilde-pagination-controls {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }

  .matilde-per-page-selector {
    padding: 0.375rem 0.75rem;
    gap: 0.5rem;
  }

  .matilde-per-page-selector label {
    font-size: 0.8rem;
  }

  .matilde-per-page-selector select {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
  }

  .matilde-pagination-links {
    gap: 0.25rem;
  }

  .matilde-pagination-link {
    min-width: 36px;
    height: 36px;
    font-size: 0.8rem;
    padding: 0 0.5rem;
  }

  .matilde-pagination-prev,
  .matilde-pagination-next {
    padding: 0 0.75rem;
  }
}

@media (min-width: 769px) {
  /* Show desktop pills, hide mobile dropdown */
  .matilde-category-pills-desktop {
    display: flex;
  }

  .matilde-category-dropdown-mobile {
    display: none;
  }
}

@media (max-width: 480px) {
  .matilde-category-pills {
    justify-content: flex-start;
  }

  .matilde-category-pill {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
  }

  .matilde-pagination-controls {
    gap: 0.75rem;
  }

  .matilde-per-page-selector {
    padding: 0.25rem 0.5rem;
    gap: 0.375rem;
  }

  .matilde-per-page-selector label {
    font-size: 0.75rem;
  }

  .matilde-per-page-selector select {
    font-size: 0.75rem;
    padding: 0.25rem 0.375rem;
    min-width: 50px;
  }

  .matilde-pagination-links {
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .matilde-pagination-link {
    min-width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }
}

/* Responsive adjustments for project description */
@media (max-width: 768px) {
  .matilde-project-description {
    margin: 0.75rem 0;
    padding: 0.5rem;
    font-size: 0.85rem;
  }
}

/* ==========================================================================
   Related Projects Static
   ========================================================================== */

.ms-related-projects-static {
  border-top: 2px solid #e60002;
  border-bottom: 2px solid #e60002;
  background-color: #e6e6e6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.ms-related-projects-container {
  position: relative;
  width: 100%;
  margin: 0 auto;
  padding: 0 3rem;
}

.ms-related-projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  width: 100%;
  justify-items: center;
}

/* Center projects when there are fewer than 3 projects */
.ms-related-projects-grid:has(
    .ms-related-project-item:nth-child(1):last-child
  ) {
  grid-template-columns: 1fr;
  max-width: 400px;
  margin: 0 auto;
}

.ms-related-projects-grid:has(
    .ms-related-project-item:nth-child(2):last-child
  ) {
  grid-template-columns: repeat(2, 1fr);
  max-width: 800px;
  margin: 0 auto;
}

.ms-related-project-item {
  position: relative;
  transform: translateZ(0);
  backface-visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ms-related-project-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.ms-related-project-card-link:hover {
  text-decoration: none;
}

.ms-related-project-item .ms-related-project-card {
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #e2e8f0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.ms-related-project-card-link:hover .ms-related-project-card {
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.ms-related-project-item .ms-related-project-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.ms-related-project-item .ms-related-project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.ms-related-project-item .ms-related-project-content {
  padding: 1.5rem;
  background-color: #ffffff;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.ms-related-project-item .ms-related-project-category {
  display: inline-block;
  background: #e60002;
  color: #ffffff;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
  align-self: flex-start;
}

.ms-related-project-item .ms-related-project-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.ms-related-project-item .ms-related-project-meta-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #64748b;
  flex-direction: column;
}

.ms-related-project-item .ms-meta-label {
  font-family: "Inter", Sans-serif !important;
  font-weight: 400;
  min-width: 60px;
  font-size: 18px;
}

.ms-related-project-item .ms-meta-value {
  font-family: "Inter", Sans-serif !important;
  font-weight: 700;
  color: #475569;
  font-size: 18px;
}

.ms-related-project-item .ms-related-project-view-more {
  color: #ffffff;
  padding: 10px 30px !important;
  border-radius: 2px !important;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 10px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-top: auto;
  box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
}

/* ==========================================================================
   Related Projects Carousel
   ========================================================================== */

.ms-related-projects-carousel {
  border-top: 2px solid #e60002;
  border-bottom: 2px solid #e60002;
  background-color: #e6e6e6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 80px;
}

.ms-related-projects-header {
  text-align: center;
}

.ms-gallery-back-button {
  font-family: "Lexend Giga", Sans-serif !important;
  padding: 4px 24px !important;
  font-size: 14px !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25) !important;
}

.ms-related-projects-title {
  font-family: "Lexend Giga", Sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #2f3b4b;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ms-related-projects-carousel-container {
  position: relative;
  width: 100%;
  margin: 0 auto;
  padding: 0 3rem;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ms-related-carousel-container {
  overflow: hidden;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.ms-related-carousel-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  backface-visibility: hidden;
  perspective: 1000px;
}

.ms-related-carousel-slide {
  flex: 0 0 33.333%;
  min-width: 0;
  padding: 0 0.5rem;
  transform: translateZ(0);
  backface-visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.ms-related-carousel-slide .ms-related-project-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.ms-related-carousel-slide .ms-related-project-card-link:hover {
  text-decoration: none;
}

.ms-related-carousel-slide
  .ms-related-project-card-link:hover
  .ms-related-project-card {
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

/* All slides - same size and opacity */
.ms-related-carousel-slide.ms-related-slide-center,
.ms-related-carousel-slide.ms-related-slide-left,
.ms-related-carousel-slide.ms-related-slide-right {
  transform: scale(1) translateZ(0);
  z-index: 1;
  opacity: 1;
}

.ms-related-project-card {
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #e2e8f0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.ms-related-project-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.ms-related-project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.ms-related-project-content {
  padding: 1.5rem;
  background-color: #ffffff;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.ms-related-project-category {
  font-family: "Inter", Sans-serif !important;
  display: inline-block;
  background: #e60002;
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 2px;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
  align-self: flex-start;
}

.ms-related-project-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #2c3e50;
  margin: 0 0 1rem 0;
  line-height: 1.3;
  flex-shrink: 0;
}

.ms-related-project-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.ms-related-project-meta-item {
  display: flex;
  align-items: flex-start;
  gap: 2px;
  font-size: 0.875rem;
  color: #64748b;
  flex-direction: column;
}

.ms-related-project-description {
  margin: 1rem 0;
  padding: 0.75rem;
  background: #f8f9fa;
  border-left: 3px solid #e60002;
  border-radius: 0 6px 6px 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #495057;
  font-style: italic;
  flex: 1;
}

.ms-related-project-description:empty {
  display: none;
}

.ms-related-project-view-more {
  font-family: "Lexend Giga", Sans-serif !important;
  color: #ffffff;
  padding: 10px 30px !important;
  border-radius: 2px !important;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 10px !important;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-top: auto;
  box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
}

/* Related Projects Carousel Arrows */
.ms-related-carousel-arrow {
  position: absolute;
  padding: 0;
  top: 50%;
  transform: translateY(-50%);
  background: transparent !important;
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: none !important;
  z-index: 10;
}

.ms-related-carousel-arrow:hover,
.ms-related-carousel-arrow:focus {
  background: transparent;
}

.ms-related-carousel-arrow:active {
  transform: translateY(-50%) scale(0.95);
}

.ms-related-carousel-arrow:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: translateY(-50%);
}

.ms-related-carousel-arrow:disabled:hover {
  background: transparent;
  color: inherit;
  transform: translateY(-50%);
}

.ms-related-carousel-prev {
  left: 0;
}

.ms-related-carousel-next {
  right: 0;
}

.ms-related-carousel-arrow svg {
  width: 26px;
  height: 43px;
  transition: all 0.3s ease;
}

.ms-related-carousel-arrow svg rect {
  fill: #2f3b4b;
}

/* Related Projects Carousel Dots Navigation */
.ms-related-carousel-dots {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 0;
  margin-top: 10px;
}

.ms-related-carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50% !important;
  border: none;
  background-color: #d9d9d9 !important;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0 !important;
  box-shadow: none !important;
  outline: none;
}

.ms-related-carousel-dot:hover {
  background-color: #2f3b4b !important;
  transform: scale(1.1);
}

.ms-related-carousel-dot.active {
  background-color: #2f3b4b !important;
  transform: scale(1.2);
}

.ms-related-carousel-dot:focus {
  outline: 2px solid #e60002 !important;
  outline-offset: 2px;
}

/* Responsive Related Projects Static */
@media (max-width: 1199px) {
  .ms-related-projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ms-related-projects-container {
    padding: 0 2rem;
  }

  /* Adjust centering for tablet */
  .ms-related-projects-grid:has(
      .ms-related-project-item:nth-child(1):last-child
    ) {
    grid-template-columns: 1fr;
    max-width: 400px;
  }

  .ms-related-projects-grid:has(
      .ms-related-project-item:nth-child(2):last-child
    ) {
    grid-template-columns: repeat(2, 1fr);
    max-width: 800px;
  }
}

@media (max-width: 767px) {
  .ms-related-projects-grid {
    grid-template-columns: 1fr;
  }

  .ms-related-projects-container {
    padding: 0 1rem;
  }

  .ms-related-projects-title {
    font-size: 1.5rem;
  }

  .ms-related-project-item .ms-related-project-content {
    padding: 1rem;
  }

  /* Adjust centering for mobile */
  .ms-related-projects-grid:has(
      .ms-related-project-item:nth-child(1):last-child
    ) {
    grid-template-columns: 1fr;
    max-width: 300px;
  }

  .ms-related-projects-grid:has(
      .ms-related-project-item:nth-child(2):last-child
    ) {
    grid-template-columns: 1fr;
    max-width: 300px;
  }
}

@media (max-width: 480px) {
  .ms-related-projects-container {
    padding: 0 0.5rem;
  }

  .ms-related-projects-title {
    font-size: 1.25rem;
  }
}

/* Responsive Related Projects Carousel */
@media (max-width: 1199px) {
  .ms-related-carousel-slide {
    flex: 0 0 50%; /* 2 slides on tablet */
  }

  .ms-related-projects-carousel {
    gap: 40px;
  }

  .ms-related-projects-carousel-container {
    padding: 0 2rem;
  }
}

@media (max-width: 767px) {
  .ms-related-carousel-slide {
    flex: 0 0 100%; /* 1 slide on mobile */
    padding: 0;
  }

  .ms-related-projects-carousel-container {
    padding: 0 1rem;
  }

  .ms-related-carousel-arrow {
    display: none; /* Hide arrows on mobile */
  }

  .ms-related-carousel-dots {
    display: flex; /* Show dots on mobile */
  }

  .ms-related-projects-title {
    font-size: 1.5rem;
  }

  .ms-related-project-content {
    padding: 1rem;
  }

  .ms-related-project-title {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .ms-related-projects-carousel-container {
    padding: 0 0.5rem;
  }

  .ms-related-carousel-arrow {
    width: 44px;
    height: 44px;
  }

  .ms-related-carousel-arrow svg {
    width: 18px;
    height: 30px;
  }

  .ms-related-projects-title {
    font-size: 1.25rem;
  }
}
