/* ============================== */
/* PROJECTS PAGE STYLES           */
/* ============================== */

/* Hero Section */
.projects-hero-section {
  position: relative;
  height: 50vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: var(--text-light);
}

.projects-hero-section .hero-background-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 1;
}

.projects-hero-section .hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  background-color: rgba(0, 0, 0, 0.7);
}

@media (min-width: 992px) {
  .projects-hero-section .hero-overlay {
    background: linear-gradient(to right, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.6) 50%, rgba(0, 0, 0, 0.2) 100%);
  }
}

.projects-hero-section .container {
  z-index: 3;
}

.hero-eyebrow {
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.9rem;
  animation: fadeInUp 0.4s ease-out forwards;
  animation-delay: 0.2s;
}

.hero-title {
  font-weight: 700;
  font-size: 1.8rem;
  letter-spacing: -0.4px;
  margin-bottom: 1.6rem;
  color: var(--text-light);
  animation: fadeInUp 0.6s ease-out forwards;
  animation-delay: 0.3s;
}

.hero-subtitle {
  font-size: 1rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1.8rem;
  max-width: 600px;
  animation: fadeInUp 0.6s ease-out forwards;
  animation-delay: 0.4s;
}

@media (min-width: 992px) {
  .projects-hero-section {
    height: 35vh;
    min-height: 400px;
    padding-top: 3rem;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }
}

@media (max-width: 991.98px) {
  .projects-hero-section {
    height: 60vh;
    min-height: 400px;
    margin-top: 0;
  }

  .hero-title {
    font-size: 1.6rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }
}

@media (max-width: 767.98px) {
  .projects-hero-section {
    height: 50vh;
    min-height: 350px;
    padding-top: 80px;
    margin-top: 0;
  }

  .projects-hero-section .container {
    text-align: center;
  }

  .hero-eyebrow {
    font-size: 1.6rem;
  }

  .hero-title {
    font-size: 1.6rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }
}

/* Projects Section */
.projects-section {
  background-color: #f8f9fa;
}

/* Project Category Card */
.project-category-card {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  height: 100%;
  animation: fadeInUp 0.6s ease-out;
}

.project-category-card:hover {
  box-shadow: 0 4px 16px rgba(236, 179, 96, 0.15);
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

/* Project Card Header */
.project-card-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  position: relative;
  min-height: 250px;
  padding: 1.75rem;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
  text-decoration: none;
  transition: all 0.3s ease;
}

.project-card-header:focus {
  outline: none;
}

.project-card-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 0.4s ease;
  z-index: 1;
}

.project-card-header:hover .project-card-bg {
  transform: scale(1.05);
}

.project-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.85) 100%);
  z-index: 2;
}

.project-card-title {
  position: relative;
  z-index: 3;
  font-family: var(--font-headings);
  font-size: 1.75rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  margin: 0 0 0.5rem 0;
}

.project-card-toggle-wrapper {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.project-card-toggle-text {
  color: var(--primary-color);
  font-weight: 600;
  font-size: 0.9rem;
}

.project-toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background-color: var(--border-color);
  border-radius: 50%;
  color: var(--primary-color);
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.project-category-card.active .project-toggle-icon {
  background-color: var(--primary-color);
  color: white;
  transform: rotate(180deg);
}

/* Project Card Details */
.project-card-details {
  max-height: 0;
  overflow: hidden;
  background-color: rgba(236, 179, 96, 0.05);
  padding: 0 1.75rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-category-card.active .project-card-details {
  max-height: 2000px;
  padding: 1.75rem;
}

.project-list {
  list-style: none;
  padding: 0;
  margin: 0;
  column-count: 2;
  column-gap: 1.5rem;
}

.project-list-item {
  font-size: 0.95rem;
  color: var(--text-dark);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: flex-start;
  break-inside: avoid-column;
  line-height: 1.6;
}

.project-list-item::before {
  content: '\f0da';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  color: var(--primary-color);
  margin-inline-end: 0.75rem;
  margin-top: 3px;
  flex-shrink: 0;
}

/* Responsive Design */
@media (max-width: 1199.98px) {
  .project-list {
    column-count: 2;
  }
}

@media (max-width: 991.98px) {
  .project-list {
    column-count: 1;
  }

  .project-card-title {
    font-size: 1.5rem;
  }
}

@media (max-width: 767.98px) {
  .project-card-header {
    min-height: 220px;
    padding: 1.5rem;
  }

  .project-card-title {
    font-size: 1.3rem;
  }

  .project-card-toggle-text {
    font-size: 0.85rem;
  }

  .project-toggle-icon {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }

  .project-list-item {
    font-size: 0.9rem;
  }

  /* Mobile: disable hover effects */
  .project-category-card:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  }

  .project-card-header:hover .project-card-bg {
    transform: scale(1);
  }

  /* Mobile: animate icon only when card is active */
  .project-category-card.active .project-toggle-icon {
    animation: iconPulse 0.4s ease-out;
  }
}

@media (max-width: 576px) {
  .project-card-header {
    min-height: 200px;
  }

  .project-card-title {
    font-size: 1.2rem;
  }

  .project-card-details {
    padding: 0 1.25rem;
  }

  .project-category-card.active .project-card-details {
    padding: 1.25rem;
  }
}

/* Icon pulse animation */
@keyframes iconPulse {
  0% {
    transform: scale(1) rotate(180deg);
  }
  50% {
    transform: scale(1.15) rotate(180deg);
  }
  100% {
    transform: scale(1) rotate(180deg);
  }
}

/* RTL Support */
/* ============================== */
/* RTL Support */
/* ============================== */
html[dir='rtl'] .project-list-item::before {
  content: '\f0d9'; /* Flip list icon */
  /* margin-inline-end is already set, so we just
     need to remove the start margin if any */
  margin-inline-start: 0;
}

/* Flip the toggle wrapper (text and icon) */
html[dir='rtl'] .project-card-toggle-wrapper {
  flex-direction: row-reverse;
}

/* Hero text alignment */
html[dir='rtl'] .projects-hero-section .container .col-lg-8,
html[dir='rtl'] .projects-hero-section .container .col-md-10 {
  text-align: right;
}

html[dir='rtl'] .hero-eyebrow,
html[dir='rtl'] .hero-title,
html[dir='rtl'] .hero-subtitle {
  direction: rtl;
}

@media (max-width: 767.98px) {
  html[dir='rtl'] .projects-hero-section .container {
    text-align: center;
  }
}

/* Flip the toggle icon rotation in RTL */
html[dir='rtl'] .project-category-card.active .project-toggle-icon {
  transform: rotate(-180deg);
}
