/* ================================================================
   TAHIR & CO. — TACO ENGINEERING
   projects.css — Styles exclusive to projects.html
   Requires: style.css loaded first
================================================================ */


/* ================================================================
   PROJECTS STATS BAR
================================================================ */
#projects-stats {
  background: var(--dark-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
/* inherits .stats-container and .stat-item from style.css */


/* ================================================================
   FEATURED PROJECTS — large alternating layout
================================================================ */
#featured-projects-full {
  padding: var(--section-pad) 5%;
  background: var(--white);
}

.featured-projects-list {
  display: flex;
  flex-direction: column;
  gap: 70px;
  max-width: var(--container);
  margin: 0 auto;
}

/* Each featured project card — image + text side by side */
.featured-project-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  padding: 44px;
  background: var(--off-white);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.featured-project-card:hover {
  box-shadow: 0 24px 60px rgba(45, 130, 197, 0.10);
  border-color: var(--border-mid);
}

/* Reverse layout — image on right for alternating rows */
.featured-project-card.fp-reverse {
  direction: rtl; /* flip grid order */
}
.featured-project-card.fp-reverse > * {
  direction: ltr; /* reset text direction inside */
}

/* Image column */
.fp-image {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  /* Fixed aspect ratio — all photos same shape regardless of source size */
  aspect-ratio: 4 / 3;
}
.fp-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.5s var(--transition);
}
.featured-project-card:hover .fp-image img {
  transform: scale(1.04);
}
.fp-image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(10, 14, 20, 0.55) 0%,
    transparent 50%
  );
}

/* Category tag on image */
.fp-category-tag {
  position: absolute;
  top: 16px;
  left: 16px;
  background: var(--blue);
  color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 30px;
  z-index: 2;
}

/* Text column */
.fp-details {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Client badge */
.fp-client {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.fp-client-icon {
  width: 34px;
  height: 34px;
  background: rgba(45, 130, 197, 0.1);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  flex-shrink: 0;
}
.fp-client-icon svg {
  width: 100%;
  height: 100%;
  stroke: var(--blue);
}
.fp-client span {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
}

.fp-details h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  letter-spacing: 0.03em;
  line-height: 1.05;
  color: var(--text-dark);
  margin-bottom: 16px;
}

.fp-details > p {
  font-size: 0.95rem;
  color: var(--text-mid);
  line-height: 1.8;
  margin-bottom: 22px;
}

/* Tags */
.fp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.fp-tag {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  background: rgba(45, 130, 197, 0.08);
  border: 1px solid rgba(45, 130, 197, 0.22);
  border-radius: 30px;
  padding: 4px 14px;
}

/* Meta info row */
.fp-meta {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.fp-meta-item {
  display: flex;
  align-items: center;
  gap: 7px;
}
.fp-meta-item svg {
  stroke: var(--blue);
  flex-shrink: 0;
}
.fp-meta-item span {
  font-size: 0.85rem;
  color: var(--text-muted);
}


/* ================================================================
   PROJECT GALLERY — filter + grid
================================================================ */
#project-gallery {
  padding: var(--section-pad) 5%;
  background: var(--off-white);
  border-top: 1px solid var(--border);
}

/* Filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 48px;
}
.filter-btn {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 9px 22px;
  border-radius: 30px;
  border: 2px solid var(--border-mid);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.filter-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
}
.filter-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

/* Gallery grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  max-width: var(--container);
  margin: 0 auto;
}

/* Individual gallery card */
.gallery-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  /* Fixed aspect ratio — all cards same height regardless of photo size */
  aspect-ratio: 4 / 3;
  background: var(--dark-3);
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
}
.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 44px rgba(45, 130, 197, 0.18);
}

/* Card image — fills the fixed container regardless of source dimensions */
.gc-image {
  width: 100%;
  height: 100%;
  position: relative;
}
.gc-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.5s var(--transition);
}
.gallery-card:hover .gc-image img {
  transform: scale(1.07);
}

/* SVG icon fallback — shown as decorative background when no photo exists
   This is a centred faint SVG inside the dark card background */
.gc-icon-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Hide when a real image loads successfully */
}
.gc-icon-fallback svg {
  width: 56px;
  height: 56px;
  stroke: rgba(45, 130, 197, 0.35);
}
/* Once the img loads, hide the fallback behind it */
.gc-image img:not([src=""]) ~ .gc-icon-fallback {
  display: none;
}

/* Hover overlay */
.gc-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(10, 14, 20, 0.94) 0%,
    rgba(10, 14, 20, 0.55) 55%,
    rgba(10, 14, 20, 0.15) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 22px 20px;
  opacity: 0;
  transition: opacity var(--transition);
}
.gallery-card:hover .gc-overlay {
  opacity: 1;
}

/* Category label inside overlay */
.gc-cat {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue-light);
  margin-bottom: 5px;
  display: block;
}

.gc-overlay h4 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 3px;
  line-height: 1.2;
}
.gc-overlay p {
  font-size: 0.82rem;
  color: var(--steel);
  margin-bottom: 12px;
}

.gc-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(45, 130, 197, 0.85);
  border: none;
  border-radius: var(--radius);
  padding: 7px 16px;
  cursor: pointer;
  transition: background var(--transition);
  align-self: flex-start;
}
.gc-view-btn:hover {
  background: var(--blue);
}

/* Hide filtered-out cards */
.gallery-card.hidden {
  display: none;
}


/* ================================================================
   LIGHTBOX MODAL
================================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--transition);
}
.lightbox.open {
  opacity: 1;
  pointer-events: all;
}

/* Semi-transparent backdrop */
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 14, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Panel */
.lightbox-panel {
  position: relative;
  z-index: 1;
  background: var(--dark-2);
  border: 1px solid rgba(45, 130, 197, 0.25);
  border-radius: 16px;
  width: 100%;
  max-width: 680px;
  max-height: 92vh;
  overflow-y: auto;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.3s var(--transition);
}
.lightbox.open .lightbox-panel {
  transform: translateY(0) scale(1);
}

/* Close button */
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.lightbox-close:hover {
  background: rgba(255,255,255,0.18);
}
.lightbox-close svg {
  stroke: #fff;
}

/* Lightbox image */
.lightbox-image-wrap {
  width: 100%;
  /* Fixed aspect ratio container — photo fills it regardless of source size */
  aspect-ratio: 16 / 9;
  background: var(--dark-3);
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
#lbImage {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
/* Fallback icon shown in lightbox when no photo */
.lightbox-icon-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-icon-fallback svg {
  width: 64px;
  height: 64px;
  stroke: rgba(45, 130, 197, 0.3);
}

/* Body content */
.lightbox-body {
  padding: 28px 32px 32px;
}

.lightbox-cat {
  display: inline-block;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-light);
  background: rgba(45, 130, 197, 0.12);
  border: 1px solid rgba(45, 130, 197, 0.25);
  border-radius: 30px;
  padding: 4px 14px;
  margin-bottom: 14px;
}

.lightbox-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: 0.03em;
  line-height: 1.05;
  color: #fff;
  margin-bottom: 8px;
}

.lightbox-client {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 16px;
}

.lightbox-desc {
  font-size: 0.95rem;
  color: var(--steel);
  line-height: 1.8;
  margin-bottom: 20px;
}

.lightbox-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.lightbox-tags .fp-tag {
  /* reuses .fp-tag styles */
}


/* ================================================================
   RESPONSIVE — TABLET
================================================================ */
@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .featured-project-card {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 30px;
  }
  .featured-project-card.fp-reverse {
    direction: ltr; /* cancel reversal on small screens */
  }
}


/* ================================================================
   RESPONSIVE — MOBILE
================================================================ */
@media (max-width: 768px) {
  .featured-projects-list {
    gap: 40px;
  }
  .featured-project-card {
    padding: 22px;
    gap: 22px;
  }
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .filter-bar {
    gap: 8px;
  }
  .filter-btn {
    font-size: 0.78rem;
    padding: 7px 16px;
  }
  .lightbox-body {
    padding: 20px 20px 24px;
  }
  /* Always show overlay on mobile since no hover */
  .gc-overlay {
    opacity: 1;
    background: linear-gradient(
      to top,
      rgba(10, 14, 20, 0.95) 0%,
      rgba(10, 14, 20, 0.4) 60%,
      transparent 100%
    );
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  .fp-meta {
    flex-direction: column;
    gap: 10px;
  }
}
