/**
 * portfolio-detail.css
 * Modern, High-Performance Stylesheet for Portfolio Detail Case Study Pages
 */

:root {
  --pf-primary: #0284c7;
  --pf-primary-hover: #0369a1;
  --pf-primary-rgb: 2, 132, 199;
  --pf-accent: #06b6d4;
  --pf-dark: #0f172a;
  --pf-card-bg: #ffffff;
  --pf-border: #e2e8f0;
  --pf-text-main: #1e293b;
  --pf-text-muted: #64748b;
  --pf-badge-bg: rgba(2, 132, 199, 0.08);
  --pf-shadow-sm: 0 2px 8px -2px rgba(15, 23, 42, 0.06), 0 1px 4px -1px rgba(15, 23, 42, 0.04);
  --pf-shadow-md: 0 12px 24px -6px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  --pf-shadow-lg: 0 20px 32px -8px rgba(15, 23, 42, 0.12), 0 8px 16px -4px rgba(15, 23, 42, 0.06);
  --pf-radius: 16px;
  --pf-radius-sm: 10px;
}

/* ==========================================================================
   0. AOS & VISIBILITY GUARANTEE
   Ensure all cards, sections, and headers are fully visible without 0-opacity stalls
   ========================================================================== */

.project-page [data-aos],
.portfolio-detail-page [data-aos],
.pf-card,
.portfolio-section,
.portfolio-gallery-section,
.portfolio-meta-section,
.page-title.project-hero {
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
}

/* ==========================================================================
   1. METADATA STRIP SECTION
   ========================================================================== */

.portfolio-meta-section {
  background: #ffffff;
  border-bottom: 1px solid var(--pf-border);
}

/* Quick Specs Strip */
.portfolio-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  background: #ffffff;
  padding: 20px 24px;
  border-radius: var(--pf-radius);
  border: 1px solid var(--pf-border);
  box-shadow: var(--pf-shadow-sm);
}

.meta-item {
  display: flex;
  flex-direction: column;
}

.meta-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pf-text-muted);
  margin-bottom: 4px;
}

.meta-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--pf-dark);
}

.meta-status-active {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #16a34a;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

/* ==========================================================================
   2. MULTIPLE IMAGES SHOWCASE & GALLERY
   ========================================================================== */

.portfolio-gallery-section {
  padding: 50px 0 40px;
  background: #ffffff;
}

.gallery-main-frame {
  position: relative;
  background: #0f172a;
  border-radius: var(--pf-radius);
  overflow: hidden;
  box-shadow: var(--pf-shadow-lg);
  border: 1px solid var(--pf-border);
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.gallery-main-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease, transform 0.4s ease;
}

.gallery-zoom-badge {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  pointer-events: none;
}

/* Thumbnails Strip */
.gallery-thumbs-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}

.gallery-thumb-btn {
  flex: 0 0 120px;
  height: 75px;
  border-radius: var(--pf-radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  background: #f1f5f9;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.gallery-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumb-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(2, 132, 199, 0.5);
}

.gallery-thumb-btn.is-active {
  border-color: var(--pf-primary);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.25);
}

/* ==========================================================================
   3. CARD STRUCTURES: CHALLENGES, WHAT WE BUILT, TECH UTILIZED
   ========================================================================== */

.portfolio-section {
  padding: 60px 0;
  position: relative;
}

.portfolio-section--alt {
  background: #f8fafc;
  border-top: 1px solid var(--pf-border);
  border-bottom: 1px solid var(--pf-border);
}

.section-kicker {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 10px;
}

.kicker-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.kicker-success {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.kicker-primary {
  background: rgba(2, 132, 199, 0.1);
  color: var(--pf-primary);
  border: 1px solid rgba(2, 132, 199, 0.2);
}

.portfolio-section-title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  color: var(--pf-dark);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.portfolio-section-desc {
  font-size: 1.0625rem;
  color: var(--pf-text-muted);
  max-width: 720px;
  line-height: 1.65;
  margin-bottom: 36px;
}

/* Base Card Style */
.pf-card {
  background: var(--pf-card-bg);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
  padding: 32px 28px;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  box-shadow: var(--pf-shadow-sm);
  position: relative;
}

.pf-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--pf-shadow-md);
  border-color: rgba(2, 132, 199, 0.3);
}

/* Icon Wrap Container */
.pf-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 20px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.pf-card:hover .pf-icon-wrap {
  transform: scale(1.06);
}

/* Challenge Cards */
.pf-card--challenge {
  border-left: 4px solid #ef4444;
}

.pf-icon-wrap--challenge {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Solution / What We Built Cards */
.pf-card--solution {
  border-left: 4px solid #0284c7;
}

.pf-icon-wrap--solution {
  background: #f0f9ff;
  color: #0284c7;
  border: 1px solid rgba(2, 132, 199, 0.2);
}

/* Technology Cards */
.pf-card--tech {
  border-top: 3px solid #06b6d4;
  padding: 24px 22px;
}

.pf-icon-wrap--tech {
  background: #f8fafc;
  color: var(--pf-dark);
  border: 1px solid var(--pf-border);
  padding: 8px;
}

.tech-category-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pf-text-muted);
  background: #f1f5f9;
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 8px;
  display: inline-block;
}

.pf-card-title {
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--pf-dark);
  margin-bottom: 12px;
  line-height: 1.35;
}

.pf-card-text {
  font-size: 0.9375rem;
  color: var(--pf-text-muted);
  line-height: 1.6;
  margin-bottom: 0;
  flex-grow: 1;
}

/* ==========================================================================
   4. IMPACT & RESULTS METRICS
   ========================================================================== */

.results-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 10px;
}

.result-metric-card {
  background: #ffffff;
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
  padding: 24px;
  text-align: center;
  box-shadow: var(--pf-shadow-sm);
  transition: transform 0.2s ease;
}

.result-metric-card:hover {
  transform: translateY(-3px);
  border-color: rgba(2, 132, 199, 0.3);
}

.metric-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--pf-primary);
  line-height: 1.1;
  margin-bottom: 6px;
}

.metric-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--pf-dark);
  margin-bottom: 4px;
}

.metric-change {
  font-size: 0.75rem;
  font-weight: 700;
  color: #16a34a;
}

/* ==========================================================================
   5. CTA & CONSULTATION SECTION
   ========================================================================== */

.portfolio-cta-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-radius: var(--pf-radius);
  padding: 50px 40px;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--pf-shadow-lg);
  margin: 40px 0;
}

.portfolio-cta-banner::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(2, 132, 199, 0.3) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}

.portfolio-cta-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  margin-bottom: 12px;
  color: #ffffff;
}

.portfolio-cta-text {
  font-size: 1rem;
  color: #cbd5e1;
  max-width: 600px;
  margin-bottom: 24px;
}

.btn-pf-primary {
  background: var(--pf-primary);
  color: #ffffff;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 10px;
  border: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn-pf-primary:hover {
  background: var(--pf-primary-hover);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -4px rgba(2, 132, 199, 0.4);
}

.btn-pf-outline {
  background: transparent;
  color: #ffffff;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn-pf-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* ==========================================================================
   6. RESPONSIVE BREAKPOINTS
   ========================================================================== */

@media (max-width: 991.98px) {
  .portfolio-meta-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 575.98px) {
  .portfolio-meta-grid {
    grid-template-columns: 1fr;
  }
  .portfolio-cta-banner {
    padding: 36px 24px;
  }
  .gallery-thumb-btn {
    flex: 0 0 90px;
    height: 60px;
  }
}
