/* Basic Setup & Fonts */
/* Note: DM Sans is enqueued in PHP */

/* Scope everything specifically to the plugin container to avoid affecting the global theme */

/* Utilities Scoped */
.featured-projects .text-primary {
  color: #a4393f !important;
}

.featured-projects .maincontainer {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

/* =========================================
   Featured Projects Section
   ========================================= */
.featured-projects {
  color: #000000;
  /* Reset Box Sizing for plugin elements */
  box-sizing: border-box;
  /* Prevent content from being affected by parent elements */
  position: relative;
  display: block;
  clear: both;
  float: none;
}

.featured-projects * {
  box-sizing: border-box;
}

.featured-projects .fp-header {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-direction: column;
}

@media (min-width: 768px) {
  .featured-projects .fp-header {
    flex-direction: row;
    align-items: center;
  }
}

.featured-projects .fp-header-text {
  width: 100%;
  max-width: 550px;
}

.featured-projects .fp-title {
  margin-bottom: 12px;
  font-size: 1.875rem;
  font-weight: 700;
  color: #000;
  line-height: 1.2;
}

.featured-projects .fp-description {
  line-height: 1.6;
  color: #666666;
  font-size: 1rem;
  margin: 0 0 20px 0;
}

.featured-projects .fp-content {
  margin-top: 0;
}

/* Mobile Filter Dropdown Scoped */
.featured-projects .mobile-filter-container {
  position: relative;
  display: block;
  margin-bottom: 24px;
}

@media (min-width: 768px) {
  .featured-projects .mobile-filter-container {
    display: none;
  }
}

.featured-projects .filter-label {
  margin-bottom: 8px;
  font-size: 1.125rem;
  font-weight: 600;
  color: #000;
}

.featured-projects .mobile-filter-trigger {
  display: flex;
  width: 100%;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  border-radius: 2px;
  border: 1px solid #ddd;
  background: #ffffff;
  padding: 12px 16px;
  color: #000000;
  transition: border-color 0.3s;
}
.featured-projects .mobile-filter-trigger:hover {
  border-color: #a4393f;
}

.featured-projects .truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.featured-projects .chevron-icon {
  min-width: 14px;
  transition: transform 0.3s;
}

.featured-projects .rotate-180 {
  transform: rotate(180deg);
}

.featured-projects .mobile-filter-menu {
  position: absolute;
  z-index: 99;
  margin-top: 4px;
  max-height: 224px;
  width: 100%;
  overflow-y: auto;
  border-radius: 2px;
  border: 1px solid #e5e5e5;
  background-color: #ffffff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.featured-projects .hidden {
  display: none !important;
}

.featured-projects .search-wrapper {
  padding: 12px;
  position: sticky;
  top: 0;
  background: #ffffff;
  border-bottom: 1px solid #eee;
}

.featured-projects .filter-search-input {
  width: 100%;
  border-radius: 2px;
  border: 1px solid #ddd;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.3s;
}

.featured-projects .filter-search-input:focus {
  border-color: #a4393f;
}

.featured-projects .mobile-filter-item {
  cursor: pointer;
  padding: 10px 16px;
  transition: all 0.2s;
  font-size: 0.95rem;
}

.featured-projects .mobile-filter-item:hover,
.featured-projects .mobile-filter-item.porfactive {
  background-color: #a4393f;
  color: #ffffff;
}

/* Filter Slider (Desktop) */
.featured-projects .filter-slider-wrapper {
  display: none;
  position: relative;
  align-items: center;
  margin-bottom: 16px;
  padding: 0;
  overflow: hidden;
}

@media (min-width: 768px) {
  .featured-projects .filter-slider-wrapper {
    display: flex;
    /* justify-content: center; Removed to prevent clipping */
    position: relative;
    width: 100%;
  }
}

.featured-projects .filter-slider {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 4px 50px; /* Space for arrows */
  scrollbar-width: none;

  /* Safe Centering Logic */
  width: fit-content;
  max-width: 100%;
  margin: 0 auto; /* Center if smaller than container */
}
.featured-projects .filter-slider::-webkit-scrollbar {
  display: none;
}

.featured-projects .slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 2px;
  cursor: pointer;
  color: #000000;
  transition: all 0.2s;
  z-index: 2;
}
.featured-projects .slider-arrow:hover {
  background: #a4393f;
  color: #ffffff;
  border-color: #a4393f;
}
.featured-projects .slider-arrow.hidden {
  display: none;
}

.featured-projects .slider-left {
  left: 4px;
}
.featured-projects .slider-right {
  right: 4px;
}

.featured-projects .filter-btn {
  white-space: nowrap;
  border-radius: 2px;
  border: 1px solid #e0e0e0;
  padding: 10px 20px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.9rem;
  font-weight: 500;
  color: #666666;
  font-family: inherit;
  min-width: auto;
  height: auto;
  line-height: normal;
}

.featured-projects .filter-btn:hover {
  border-color: #a4393f;
  color: #a4393f;
  background: #fff5f6;
}

.featured-projects .filter-btn.porfactive {
  background-color: #a4393f; /* Primary Maroon */
  color: #ffffff;
  border-color: #a4393f;
}

/* All Projects Button Container */
.featured-projects .all-projects-container {
  display: flex;
  justify-content: center;
  margin-top: 12px;
  margin-bottom: 24px;
}

.featured-projects .all-projects-btn {
  padding: 12px 28px;
  border: 1px solid #e0e0e0;
  background: #ffffff;
  color: #000000;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.3s;
  font-size: 0.9rem;
  height: auto;
  line-height: normal;
}
.featured-projects .all-projects-btn:hover,
.featured-projects .all-projects-btn.active {
  background: #a4393f;
  color: #ffffff;
  border-color: #a4393f;
}

/* Loader */
.featured-projects .loader-container {
  margin-top: 80px;
  display: flex;
  justify-content: center;
}

.featured-projects .loader {
  border: 4px solid #eaeaea;
  border-top: 4px solid #a4393f;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Portfolio Grid */
.featured-projects .portfolio-grid {
  margin-top: 24px;
  display: grid;
  gap: 30px;
}

@media (min-width: 576px) {
  .featured-projects .portfolio-grid {
    margin-top: 32px;
  }
}

@media (min-width: 992px) {
  .featured-projects .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
  }
}

.featured-projects .portfolio-card {
  width: 100%;
  background: #ffffff;
  border-bottom: 2px solid transparent;
  transition: all 0.3s;
  overflow: hidden; /* Ensure rounded corners clip if needed, though they are sharp now */
}

@media (min-width: 992px) {
  .featured-projects .portfolio-card {
    max-width: 685px;
  }
}

.featured-projects .portfolio-card:hover {
  border-bottom-color: #a4393f;
  transform: translateY(-5px);
}

.featured-projects .card-image-wrap {
  height: 380px;
  width: 100%;
  overflow: hidden;
}

.featured-projects .card-image {
  height: 100%;
  width: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.5s ease;
}

.featured-projects .portfolio-card:hover .card-image {
  transform: scale(1.03);
}

.featured-projects .card-details {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid #eee;
  border-top: none;
}

.featured-projects .card-title {
  font-weight: 700;
  font-size: 1.125rem;
  color: #000000;
  margin: 0;
}

@media (min-width: 576px) {
  .featured-projects .card-title {
    font-size: 1.25rem;
  }
}

@media (min-width: 768px) {
  .featured-projects .card-title {
    white-space: nowrap;
  }
}

.featured-projects .details-divider {
  height: 1px;
  width: 100%;
  background-color: #ddd;
}

.featured-projects .card-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

@media (min-width: 576px) {
  .featured-projects .card-tags {
    gap: 20px;
  }
}

@media (max-width: 575.5px) {
  .featured-projects .card-tags {
    flex-wrap: wrap;
  }
}

.featured-projects .tag-text {
  font-size: 0.875rem;
  color: #666666;
}

@media (min-width: 425px) {
  .featured-projects .tag-text {
    font-size: 1rem;
  }
}

.featured-projects .view-project-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.875rem;
  border: 1px solid #a4393f;
  background-color: transparent;
  color: #a4393f;
  text-decoration: none;
  transition:
    background-color 0.2s,
    color 0.2s;
  margin-top: 0;
  border-radius: 2px;
}

.featured-projects .view-project-btn:hover {
  background-color: #a4393f;
  color: #ffffff;
}

/* Category Tabs */
.featured-projects .category-tabs-wrapper {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.featured-projects .category-tab-btn {
  padding: 12px 24px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 2px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  transition: all 0.3s;
  line-height: normal !important;
  height: auto !important;
}

.featured-projects .category-tab-btn:hover {
  background: #e0e0e0;
}

.featured-projects .category-tab-btn.active {
  background: #a4393f;
  color: #ffffff;
  border-color: #a4393f;
}

@media (max-width: 768px) {
  .featured-projects .category-tabs-wrapper {
    gap: 8px;
  }
  .featured-projects .category-tab-btn {
    padding: 10px 16px;
    font-size: 0.9rem;
    flex: 1 1 auto; /* Grow to fill space on mobile */
    text-align: center;
  }
}
