/* ==========================================================================
   PROJECTS CARDS SECTION - FIGMA EXACT DESIGN
   ========================================================================== */

/* CSS Variables matching Figma design */
:root {
  --color-neutral-200: rgba(239, 234, 231, 1);
  --color-neutral-300: rgba(226, 217, 212, 1);
  --color-primary-50: rgba(224, 242, 254, 1);
  --color-primary-600: rgba(9, 56, 85, 1);
  --color-neutral-50: rgba(250, 247, 245, 1);
  --font-size-0875-rem: 14px;
  --font-size-15-rem: 24px;
  --font-size-075-rem: 12px;
  --font-size-1rem: 16px;
  --font-size-125-rem: 20px;
}

/* Projects Section Container */
.projects-section {
  background-color: #efeae7;
  padding: 80px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  box-sizing: border-box;
}

.projects-section .container {
  display: flex;
  flex-direction: column;
  gap: 48px;
  align-items: center;
  justify-content: flex-start;
  padding: 0px;
  width: 100%;
  max-width: 1440px;
}

/* Projects Header - Default horizontal layout (homepage) */
.projects-header-container {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  text-align: left;
  background-color: #efeae7;
  gap: 24px;
  padding: 3.5rem;
}

/* Projects Header - Vertical layout for servicio pages */
.horizontal-layout .projects-header-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  background-color: #efeae7;
  gap: 24px;
  padding: 3.5rem 0 3.5rem 3.5rem;
  flex: 0 0 400px;
  max-width: 400px;
}

.container-projects-servicios {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 48px;
  padding: 0px;
  width: 100%;
  max-width: 1440px;
}

/* Default vertical layout (homepage) */
.container-projects-servicios {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 48px;
  width: 100%;
  max-width: 1440px;
  padding: 0 24px;
  margin: 0 auto;
}

/* Horizontal layout for servicio pages */
.container-projects-servicios.horizontal-layout {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10rem;
  padding: 0 24px;
  margin: 0 auto;
}

.projects-title {
  font-family: var(--font-display);
  font-size: 3rem;
  font-style: normal;
  font-weight: 600;
  line-height: 123.5%; /* 3.705rem */
  letter-spacing: 0.01563rem;
  color: var(--color-primary-600, #093855);
  margin: 0;
}

/* Highlighted part inside title */
.projects-section .projects-title .highlight-bg {
  background: #3e6781;
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 2px;
}

.projects-highlight {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(
    135deg,
    var(--color-primary-50, #e0f2fe) 0%,
    rgba(187, 222, 251, 0.8) 100%
  );
  color: #00539b;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.projects-description {
  font-size: 2.125rem;
  font-style: normal;
  font-weight: 600;
  line-height: 100%; /* 2.125rem */
  letter-spacing: 0.01563rem;
  color: #093855;
  margin: 0;
  padding-left: 24px;
  border-left: 2px solid rgba(9, 56, 85, 0.35);
}
.projects-description-services {
  font-size: 1.5rem;
  font-style: normal;
  font-weight: 400;
  line-height: 133.4%;
  padding-left: 0px;
  border-left: none;
}

/* Projects Grid - Default vertical layout (homepage) */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 32px;
  width: 100%;
}

/* Projects Grid - Horizontal layout for servicio pages */
.horizontal-layout .projects-grid {
  display: flex;
  flex-direction: row;
  gap: 32px;
  flex: 1;
  justify-content: flex-start;
  align-items: flex-start;
}

/* Project Card - Default vertical layout (homepage) */
.project-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  border: 2px solid var(--color-neutral-300);
}

/* Project Card - Horizontal layout for servicio pages */
.horizontal-layout .project-card {
  max-width: 400px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  border-color: rgba(0, 102, 204, 0.2);
  z-index: 1;
}

/* Project Image Container */
.project-image-container {
  position: relative;
  width: 100%;
  height: 240px;
  overflow: hidden;
  background: var(--project-image, none) lightgray 50% / cover no-repeat;
  transition: background-size 0.3s ease;
  flex-shrink: 0;
}

.project-image-container::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 83, 155, 0.5) 0%,
    rgba(9, 56, 85, 0.6) 100%
  );
  z-index: 1;
  transition: opacity 0.3s ease;
}

.project-image-container::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.25) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.project-card:hover .project-image-container::after {
  opacity: 1;
}

.project-card:hover .project-image-container {
  background-size: 105%;
  transform: scale(1.02);
}

/* Project Image */
.project-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
}

.project-card:hover .project-image {
  transform: scale(1.05);
}

/* Year Badge */
.project-year-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #093855;
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  z-index: 3;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Project Content */
.project-content {
  padding: 24px;
  background: #ffffff;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Ensure project content fills available space in horizontal layout */
.horizontal-layout .project-content {
  flex: 1;
  justify-content: space-between;
}

.project-content-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 13px;
  align-self: stretch;
  position: relative;
}

.project-content-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  align-self: stretch;
  position: relative;
}

/* Project Pills/Tags */
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.project-tag {
  font-size: var(--font-size-0875-rem, 0.875rem);
  font-style: normal;
  font-weight: 700;
  line-height: 143%;
  letter-spacing: 0.01063rem;
  background-color: #e0f2fe;
  color: #093855;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  border-radius: 999px;
}

/* Project Title */
.project-card-title {
  font-family: var(--font-body);
  font-size: 24px;
  font-weight: 400;
  color: #093855;
  line-height: 1.334;
  margin: 0 0 12px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Project Details */
.project-details {
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  margin-right: 0px;
}

.project-detail {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 400;
  color: #475569;
  margin-bottom: 0px;
}

.project-detail-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #093855;
}

/* Ensure png icons fill the 16px slot and inherit color when possible */
.project-detail-icon img {
  width: 16px;
  height: 16px;
  display: block;
}

/* Project Button */
/* Figma-like full-width pill outlined button */
.project-link {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 16px;
  background: #ffffff;
  color: #093855;
  border: 2px solid var(--color-neutral-300);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  transition: all 0.2s ease;
  text-decoration: none;
  margin-top: auto;
  flex-shrink: 0;
  width: 100%;
}

/* Ensure 3 columns on large screens to match Figma */
@media (min-width: 1024px) {
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.project-link:hover {
  border-color: #093855;
  box-shadow: 0 2px 8px rgba(9, 56, 85, 0.15);
}

/* View All Projects Button - Default centered (homepage) */
.projects-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: 24px;
}

/* View All Projects Button - Left aligned for servicio pages */
.horizontal-layout .projects-footer {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  margin-top: 24px;
}

.btn-secondary {
  display: inline-flex;
  height: 48px;
  padding: 12px 24px;
  justify-content: center;
  align-items: center;
  gap: 8px;
  background: #093855;
  color: #ffffff;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(9, 56, 85, 0.15);
  transition: all 0.2s ease;
  text-decoration: none;
  border: 1px solid #093855;
  cursor: pointer;
  text-transform: none;
}

.btn-secondary:hover {
  background: linear-gradient(90deg, #e5602f 0%, #e0851b 100%);
  transform: translateY(-2px);
  box-shadow: 0px 6px 16px rgba(255, 107, 53, 0.4);
}

/* Responsive Design */

/* Tablet responsive (max-width: 1024px) */
@media (max-width: 1024px) {
  /* Projects container - switch to column layout */
  .container-projects-servicios {
    flex-direction: column !important;
    gap: 3rem !important;
    padding: 0px !important;
  }

  /* Projects header container - reset padding and flex */
  .projects-header-container {
    padding: 0px !important;
    flex: 1 !important;
  }

  /* Projects grid - switch to column layout */
  .projects-grid {
    flex-direction: column !important;
  }

  /* Projects footer - center alignment */
  .projects-footer {
    justify-content: center !important;
  }
}

/* Tablet and up (>= 768px) */
@media (min-width: 768px) {
  .projects-title {
    min-width: 400px;
  }
}

/* Tablet (768px to 1024px) */
@media (max-width: 1024px) {
  .container-projects-servicios {
    flex-direction: column;
    gap: 32px;
  }

  .projects-header-container {
    flex: none;
    max-width: 100%;
    padding: 2rem;
  }

  .projects-title {
    font-size: 36px;
  }

  .projects-description {
    font-size: 16px;
    padding-left: 16px;
  }

  .projects-grid {
    flex-direction: row;
    gap: 20px;
    justify-content: center;
  }

  .project-card {
    flex: 0 0 350px;
    max-width: 350px;
  }

  .project-content {
    padding: 18px;
  }
  .project-image-container {
    height: 220px;
  }
}

/* Mobile landscape (576px to 767px) */
@media (max-width: 767px) {
  .projects-section {
    padding: 32px 20px;
  }

  .container-projects-servicios {
    flex-direction: column;
    gap: 24px;
    padding: 0 16px;
  }

  .projects-header-container {
    flex: none;
    max-width: 100%;
    padding: 1.5rem;
  }

  .projects-header {
    gap: 6px;
    flex-direction: column;
    align-items: flex-start;
  }

  .projects-title {
    font-size: 30px;
  }

  .projects-description {
    font-size: 15px;
    padding-left: 0;
    border-left: none;
  }

  .projects-grid {
    flex-direction: column;
    gap: 20px;
    align-items: center;
  }

  .project-card {
    flex: none;
    max-width: 100%;
    width: 100%;
  }

  .project-content {
    padding: 16px;
  }
  .project-image-container {
    height: 180px;
  }

  .project-card-title {
    font-size: 16px;
  }
}

/* Mobile portrait (320px to 575px) */
@media (max-width: 575px) {
  .projects-section {
    padding: 32px 20px;
  }

  .container-projects-servicios {
    flex-direction: column;
    gap: 24px;
    padding: 0 16px;
  }

  .projects-header-container {
    flex: none;
    max-width: 100%;
    padding: 1rem;
  }

  .projects-grid {
    flex-direction: column;
    gap: 24px;
    align-items: center;
  }

  .project-card {
    flex: none;
    max-width: 100%;
    width: 100%;
  }

  .projects-title {
    font-size: 28px;
  }

  .projects-description {
    font-size: 15px;
    padding-left: 0;
    border-left: none;
  }

  .project-content {
    padding: 16px;
  }
  .project-image-container {
    height: 200px;
  }

  .project-card-title {
    font-size: 18px;
  }
}
