/**
 * Projects Section Styles
 * Modern BEM structure with React-inspired design
 * Based on reference HTML design
 *
 * @package Flavor_Starter
 * @version 1.0.0
 */

/* ========================================
   Projects Section - Base
   ======================================== */
.ta_projects-section {
  position: relative;
  padding: 80px 0;
  background: linear-gradient(
    135deg,
    var(--projects-bg-color, var(--primary-color, #3b82f6)) 0%,
    var(--projects-bg-color, var(--primary-color, #2563eb)) 100%
  );
  overflow: hidden;
}

/* ========================================
   Section Header
   ======================================== */
.ta_projects-section__header {
  text-align: center;
  margin-bottom: var(--space-10, 60px);
}

.ta_projects-section__title {
  margin: 0 0 var(--space-3, 12px);
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: var(--font-bold, 700);
  line-height: var(--leading-tight, 1.25);
  color: var(--projects-text-color, #ffffff);
  letter-spacing: -0.02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ta_projects-section__subtitle {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.125rem);
  line-height: var(--leading-relaxed, 1.75);
  color: var(--projects-text-color, rgba(255, 255, 255, 0.9));
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ========================================
   Projects Grid
   ======================================== */
.ta_projects-section__grid {
  display: grid;
  gap: var(--space-6, 30px);
}

/* Grid Columns */
.ta_projects-section__grid--col-2 {
  grid-template-columns: repeat(2, 1fr);
}

.ta_projects-section__grid--col-3 {
  grid-template-columns: repeat(3, 1fr);
}

.ta_projects-section__grid--col-4 {
  grid-template-columns: repeat(4, 1fr);
}

.ta_projects-section__grid--col-5 {
  grid-template-columns: repeat(5, 1fr);
}

.ta_projects-section__grid--col-6 {
  grid-template-columns: repeat(6, 1fr);
}

/* ========================================
   Project Item - Card
   ======================================== */
.ta_project-item {
  position: relative;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
  transition: all var(--transition-normal, 200ms) var(--ease-in-out, cubic-bezier(0.4, 0, 0.2, 1));
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ta_project-item:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.08);
}

/* ========================================
   Project Item - Media
   ======================================== */
.ta_project-item__media {
  position: relative;
  width: 100%;
  padding-top: 75%; /* 4:3 Aspect Ratio */
  overflow: hidden;
  background: var(--gray-50, #f9fafb);
}

.ta_project-item__image-wrapper {
  position: absolute;
  inset: 0;
}

.ta_project-item__image-link {
  display: block;
  width: 100%;
  height: 100%;
}

.ta_project-item__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease-in-out, cubic-bezier(0.4, 0, 0.2, 1));
}

.ta_project-item:hover .ta_project-item__image {
  transform: scale(1.08);
}

/* Icon Overlay */
.ta_project-item__icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  color: var(--primary-color, var(--primary, #3b82f6));
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transition: opacity var(--transition-normal, 200ms) var(--ease-in-out, cubic-bezier(0.4, 0, 0.2, 1));
}

.ta_project-item:hover .ta_project-item__icon {
  opacity: 1;
}

/* ========================================
   Project Item - Content
   ======================================== */
.ta_project-item__content {
  padding: var(--space-5, 24px);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.ta_project-item__title {
  margin: 0 0 var(--space-3, 12px);
  font-size: var(--text-lg, 1.125rem);
  font-weight: var(--font-semibold, 600);
  line-height: var(--leading-snug, 1.375);
  color: var(--text-primary, #111827);
}

.ta_project-item__title-link {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast, 150ms) var(--ease-in-out, cubic-bezier(0.4, 0, 0.2, 1));
}

.ta_project-item__title-link:hover {
  color: var(--primary-color, var(--primary, #3b82f6));
}

.ta_project-item__description {
  margin: 0 0 var(--space-4, 16px);
  font-size: var(--text-sm, 0.875rem);
  line-height: var(--leading-relaxed, 1.75);
  color: var(--text-secondary, #6b7280);
  flex: 1;
}

.ta_project-item__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2, 8px);
  font-size: var(--text-sm, 0.875rem);
  font-weight: var(--font-semibold, 600);
  color: var(--primary-color, var(--primary, #3b82f6));
  text-decoration: none;
  transition: all var(--transition-fast, 150ms) var(--ease-in-out, cubic-bezier(0.4, 0, 0.2, 1));
  margin-top: auto;
}

.ta_project-item__link:hover {
  color: var(--primary-color, var(--primary-dark, #2563eb));
  gap: var(--space-3, 12px);
}

.ta_project-item__link-icon {
  flex-shrink: 0;
  transition: transform var(--transition-fast, 150ms) var(--ease-in-out, cubic-bezier(0.4, 0, 0.2, 1));
}

.ta_project-item__link:hover .ta_project-item__link-icon {
  transform: translateX(2px);
}

/* ========================================
   Animations
   ======================================== */
@keyframes ta-projects-fade-in-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ta_projects-section__header {
  animation: ta-projects-fade-in-up 0.6s var(--ease-out, cubic-bezier(0.0, 0, 0.2, 1)) 0.1s backwards;
}

.ta_projects-section__grid {
  animation: ta-projects-fade-in-up 0.6s var(--ease-out, cubic-bezier(0.0, 0, 0.2, 1)) 0.2s backwards;
}

/* Stagger animation for project items */
.ta_project-item:nth-child(1) {
  animation: ta-projects-fade-in-up 0.6s var(--ease-out, cubic-bezier(0.0, 0, 0.2, 1)) 0.3s backwards;
}
.ta_project-item:nth-child(2) {
  animation: ta-projects-fade-in-up 0.6s var(--ease-out, cubic-bezier(0.0, 0, 0.2, 1)) 0.35s backwards;
}
.ta_project-item:nth-child(3) {
  animation: ta-projects-fade-in-up 0.6s var(--ease-out, cubic-bezier(0.0, 0, 0.2, 1)) 0.4s backwards;
}
.ta_project-item:nth-child(4) {
  animation: ta-projects-fade-in-up 0.6s var(--ease-out, cubic-bezier(0.0, 0, 0.2, 1)) 0.45s backwards;
}
.ta_project-item:nth-child(5) {
  animation: ta-projects-fade-in-up 0.6s var(--ease-out, cubic-bezier(0.0, 0, 0.2, 1)) 0.5s backwards;
}
.ta_project-item:nth-child(6) {
  animation: ta-projects-fade-in-up 0.6s var(--ease-out, cubic-bezier(0.0, 0, 0.2, 1)) 0.55s backwards;
}

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

/* Tablet */
@media (max-width: 991px) {
  .ta_projects-section {
    padding: 60px 0;
  }

  .ta_projects-section__header {
    margin-bottom: var(--space-8, 48px);
  }

  .ta_projects-section__grid {
    gap: var(--space-5, 24px);
  }

  /* Adjust grid columns for tablet */
  .ta_projects-section__grid--col-4,
  .ta_projects-section__grid--col-5,
  .ta_projects-section__grid--col-6 {
    grid-template-columns: repeat(3, 1fr);
  }

  .ta_project-item__content {
    padding: var(--space-4, 20px);
  }
}

/* Mobile Large */
@media (max-width: 767px) {
  .ta_projects-section {
    padding: 50px 0;
  }

  .ta_projects-section__header {
    margin-bottom: var(--space-6, 32px);
  }

  .ta_projects-section__grid {
    gap: var(--space-4, 20px);
  }

  /* Adjust grid columns for mobile */
  .ta_projects-section__grid--col-3,
  .ta_projects-section__grid--col-4,
  .ta_projects-section__grid--col-5,
  .ta_projects-section__grid--col-6 {
    grid-template-columns: repeat(2, 1fr);
  }

  .ta_project-item__title {
    font-size: var(--text-base, 1rem);
  }
}

/* Mobile Small */
@media (max-width: 549px) {
  .ta_projects-section__grid {
    gap: var(--space-3, 16px);
  }

  /* Single column on very small screens */
  .ta_projects-section__grid--col-4,
  .ta_projects-section__grid--col-5,
  .ta_projects-section__grid--col-6 {
    grid-template-columns: 1fr;
  }

  .ta_project-item__content {
    padding: var(--space-3, 16px);
  }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
  .ta_projects-section {
    background: #f8f9fa !important;
    padding: 20px 0;
  }

  .ta_projects-section__title {
    color: #000000 !important;
  }

  .ta_project-item {
    box-shadow: none;
    border: 1px solid #e5e7eb;
  }

  .ta_project-item__link {
    display: none;
  }

  .ta_projects-section__grid {
    gap: 15px;
  }
}

/* ========================================
   Skeleton Loading Styles
   ======================================== */
.ta_projects-section__skeleton {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(1, 1fr);
}

@media (min-width: 768px) {
  .ta_projects-section__skeleton {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .ta_projects-section__skeleton[data-desktop="1"] {
    grid-template-columns: repeat(1, 1fr);
  }
  .ta_projects-section__skeleton[data-desktop="2"] {
    grid-template-columns: repeat(2, 1fr);
  }
  .ta_projects-section__skeleton[data-desktop="3"] {
    grid-template-columns: repeat(3, 1fr);
  }
  .ta_projects-section__skeleton[data-desktop="4"] {
    grid-template-columns: repeat(4, 1fr);
  }
  .ta_projects-section__skeleton[data-desktop="5"] {
    grid-template-columns: repeat(5, 1fr);
  }
  .ta_projects-section__skeleton[data-desktop="6"] {
    grid-template-columns: repeat(6, 1fr);
  }
}

.ta_project-item--skeleton {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.ta_project-item__media-skeleton {
  width: 100%;
  height: 200px;
  background: linear-gradient(
    90deg,
    rgba(240, 240, 240, 0.8) 0%,
    rgba(250, 250, 250, 0.9) 50%,
    rgba(240, 240, 240, 0.8) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

.ta_project-item__content-skeleton {
  padding: 24px;
}

.ta_project-item__title-skeleton {
  height: 20px;
  background: linear-gradient(
    90deg,
    rgba(240, 240, 240, 0.8) 0%,
    rgba(250, 250, 250, 0.9) 50%,
    rgba(240, 240, 240, 0.8) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 4px;
  margin-bottom: 12px;
  width: 70%;
}

.ta_project-item__description-skeleton {
  height: 14px;
  background: linear-gradient(
    90deg,
    rgba(240, 240, 240, 0.8) 0%,
    rgba(250, 250, 250, 0.9) 50%,
    rgba(240, 240, 240, 0.8) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 4px;
  margin-bottom: 8px;
}

.ta_project-item__description-skeleton:last-child {
  width: 90%;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ========================================
   Swiper Slider Customization
   ======================================== */
.ta_projects-section__slider {
  position: relative;
  padding: 0 50px 60px;
}

.ta_projects-section__slider .swiper-slide {
  height: auto;
  display: flex;
}

.ta_projects-section__slider .ta_project-item {
  width: 100%;
  height: 100%;
}

/* Navigation Buttons */
.ta_projects-section__slider .swiper-button-next,
.ta_projects-section__slider .swiper-button-prev {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.ta_projects-section__slider .swiper-button-next:after,
.ta_projects-section__slider .swiper-button-prev:after {
  font-size: 20px;
  font-weight: bold;
}

.ta_projects-section__slider .swiper-button-next:hover,
.ta_projects-section__slider .swiper-button-prev:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* Pagination */
.ta_projects-section__slider .swiper-pagination {
  bottom: 0;
  position: relative;
  margin-top: 30px;
}

.ta_projects-section__slider .swiper-pagination-bullet {
  background: #ffffff;
  opacity: 0.5;
  width: 10px;
  height: 10px;
  transition: all 0.3s ease;
  margin: 0 6px;
}

.ta_projects-section__slider .swiper-pagination-bullet-active {
  opacity: 1;
  width: 30px;
  border-radius: 5px;
  background: var(--secondary, #ECB71C);
}

/* Mobile Adjustments */
@media (max-width: 767px) {
  .ta_projects-section__slider {
    padding: 0 40px 50px;
  }

  .ta_projects-section__slider .swiper-pagination {
    margin-top: 24px;
  }

  .ta_projects-section__slider .swiper-button-next,
  .ta_projects-section__slider .swiper-button-prev {
    width: 36px;
    height: 36px;
  }

  .ta_projects-section__slider .swiper-button-next:after,
  .ta_projects-section__slider .swiper-button-prev:after {
    font-size: 16px;
  }
}
