/* =============================================
   PORTFOLIO CSS – Advanced Glassmorphism & Bento
   (Listing + Single)
   ============================================= */

/* ---------- SECTION BASE ---------- */
.section-portfolio-listing,
.section-portfolio-single {
  padding: 5rem 0;
  background: var(--bg-offwhite);
  transition: background 0.4s;
}

/* ---------- TYPOGRAPHY (reuse global styles) ---------- */
.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-tag {
  display: inline-block;
  background: rgba(139,0,0,0.1);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 0.4rem 1.2rem;
  border-radius: 30px;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 3rem;
  font-weight: 800;
  color: var(--text-dark);
}

.section-subtitle {
  font-size: 1.15rem;
  max-width: 650px;
  margin: 0 auto;
  color: var(--text-muted);
}

/* ---------- GLASS PANEL & BUTTONS ---------- */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow), inset 0 1px 1px rgba(255,255,255,0.15);
}

.glass-btn {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  color: var(--text-dark);
  border-radius: 50px;
  font-weight: 600;
  padding: 0.65rem 1.8rem;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.glass-btn:hover {
  background: rgba(139,0,0,0.08);
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* ---------- FILTER BUTTONS ---------- */
.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 3rem;
}

.filter-btn.glass-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 8px 25px rgba(139,0,0,0.35);
}

[data-theme="dark"] .filter-btn.glass-btn {
  background: rgba(255,255,255,0.05);
  color: #ddd;
}

[data-theme="dark"] .filter-btn.glass-btn:hover {
  background: rgba(255,255,255,0.1);
}

/* ---------- PORTFOLIO GRID (Bento) ---------- */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.portfolio-item {
  transition: none; /* hidden via JS, reveal with animation */
}

/* ---------- PORTFOLIO CARD ---------- */
.portfolio-card {
  background: var(--bg-light);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0,0,0,0.05);
  transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.35s;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0,0,0,0.04);
}

[data-theme="dark"] .portfolio-card {
  background: #181818;
  border-color: rgba(255,255,255,0.05);
  box-shadow: 0 15px 35px rgba(0,0,0,0.4);
}

.portfolio-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 30px 50px rgba(139,0,0,0.15);
}

/* Image wrapper */
.portfolio-img-wrapper {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: #f0f0f0;
}

.portfolio-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.portfolio-card:hover .portfolio-img-wrapper img {
  transform: scale(1.08);
}

/* Placeholder */
.portfolio-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #ccc;
}

/* Overlay */
.portfolio-overlay {
  position: absolute;
  inset: 0;
  background: rgba(139,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.portfolio-card:hover .portfolio-overlay {
  opacity: 1;
}

.overlay-btn {
  width: 50px;
  height: 50px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.3rem;
  transition: transform 0.3s, background 0.3s;
}

.overlay-btn:hover {
  background: var(--accent);
  transform: scale(1.15);
  color: #000;
}

/* Card body */
.portfolio-card-body {
  padding: 1.8rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.portfolio-category {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.portfolio-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.8rem;
}

.portfolio-description {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}

.portfolio-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.2rem;
  font-weight: 600;
  color: var(--primary);
  transition: gap 0.3s, color 0.3s;
}

.portfolio-link:hover {
  gap: 0.7rem;
  color: var(--primary-dark);
}

/* ---------- EMPTY STATE ---------- */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  max-width: 500px;
  margin: 0 auto;
}

.empty-state i {
  font-size: 3.5rem;
  color: var(--primary);
  opacity: 0.4;
}

.empty-state h3 {
  margin: 1rem 0 0.5rem;
  color: var(--text-dark);
}

/* =============================================
   SINGLE PORTFOLIO PAGE
   ============================================= */
.back-btn {
  margin-bottom: 2.5rem;
  font-size: 0.95rem;
}

.project-title {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0.5rem 0 2rem;
}

.project-featured-img {
  margin-bottom: 3rem;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 25px 45px rgba(0,0,0,0.1);
}

.project-featured-img img {
  width: 100%;
  display: block;
  transition: transform 0.5s;
}

.project-featured-img:hover img {
  transform: scale(1.02);
}

/* Description content (allow TinyMCE / HTML) */
.project-content {
  padding: 2.5rem;
  margin-bottom: 3rem;
}

.project-description {
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.8;
}

.project-description img {
  max-width: 100%;
  border-radius: 16px;
  margin: 1.5rem 0;
}

/* Action buttons */
.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn-primary-glow {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 0.9rem 2.2rem;
  font-weight: 600;
  font-size: 1.1rem;
  box-shadow: 0 8px 25px rgba(139,0,0,0.3);
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary-glow:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(139,0,0,0.4);
}

.btn-glass {
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--text-dark);
  border-radius: 50px;
  padding: 0.9rem 2.2rem;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

[data-theme="dark"] .btn-glass {
  color: white;
}

.btn-glass:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-3px);
}

/* ---------- ANIMATIONS ---------- */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.25,0.8,0.25,1), transform 0.7s cubic-bezier(0.25,0.8,0.25,1);
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-up {
  animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  .scroll-reveal,
  .portfolio-card,
  .portfolio-link,
  .btn-primary-glow,
  .btn-glass,
  .back-btn {
    transition: none !important;
    animation: none !important;
  }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 992px) {
  .section-title {
    font-size: 2.5rem;
  }
  .project-title {
    font-size: 2.2rem;
  }
  .portfolio-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .section-portfolio-listing,
  .section-portfolio-single {
    padding: 3rem 0;
  }
  .portfolio-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
  }
  .project-title {
    font-size: 1.8rem;
  }
  .project-content {
    padding: 1.5rem;
  }
}

@media (max-width: 576px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
  }
  .project-actions {
    flex-direction: column;
  }
  .btn-primary-glow,
  .btn-glass {
    width: 100%;
    justify-content: center;
  }
}