/* Portfolio Grid & Slider Styles */

.phearum-portfolio-grid,
.phearum-portfolio-slider {
  margin: 2rem 0;
}

/* Grid Layout */

.phearum-portfolio-grid .phearum-portfolio-container {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

@media (max-width: 640px) {
  .phearum-portfolio-grid .phearum-portfolio-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Slider Layout */

.phearum-portfolio-slider {
  position: relative;
  overflow: hidden;
}

.phearum-portfolio-slider .phearum-portfolio-container {
  overflow: hidden;
}

.phearum-block-slider-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.phearum-portfolio-slider .phearum-portfolio-item {
  flex: 0 0 33.333%;
  padding: 0 1rem;
  box-sizing: border-box;
}

@media (max-width: 1024px) {
  .phearum-portfolio-slider .phearum-portfolio-item {
    flex: 0 0 50%;
  }
}

@media (max-width: 640px) {
  .phearum-portfolio-slider .phearum-portfolio-item {
    flex: 0 0 100%;
  }
}

/* Portfolio Item Card */

.phearum-portfolio-item {
  background: hsl(var(--color-surface));
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid hsl(var(--color-border));
}

/* Card Hover Effects - Match Featured/Staff blocks */

.portfolio-card-hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

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

.portfolio-card-hover-glow:hover {
  box-shadow: 0 25px 50px -12px rgba(59, 130, 246, 0.25) !important;
}

.portfolio-card-hover-shadow-light:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

.portfolio-card-hover-shadow-medium:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}

.portfolio-card-hover-shadow-heavy:hover {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

/* Portfolio Image */

.phearum-portfolio-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: #f3f4f6;
}

.phearum-portfolio-image img {
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
     object-fit: cover;
  transition: transform 0.5s ease;
}

.phearum-portfolio-item:hover .phearum-portfolio-image img {
  transform: scale(1.05);
}

/* Portfolio Content */

.phearum-portfolio-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.phearum-portfolio-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: hsl(var(--color-text));
  margin: 0 0 0.5rem 0;
  line-height: 1.4;
}

.phearum-portfolio-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.phearum-portfolio-title a:hover {
  color: hsl(var(--color-primary));
}

.phearum-portfolio-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: hsl(var(--color-text-muted));
}

.phearum-portfolio-client,
.phearum-portfolio-date {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.phearum-portfolio-client strong,
.phearum-portfolio-date strong {
  color: hsl(var(--color-text));
}

.phearum-portfolio-excerpt {
  color: hsl(var(--color-text-muted));
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  flex: 1;
}

.phearum-portfolio-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

.phearum-portfolio-category {
  background: hsl(var(--color-primary) / 0.1);
  color: hsl(var(--color-primary));
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.phearum-portfolio-category:hover {
  background: hsl(var(--color-primary) / 0.2);
  color: hsl(var(--color-primary));
}

/* Navigation Arrows - Aligned with Featured/Staff blocks */

.phearum-block-slider-prev,
.phearum-block-slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid hsl(var(--color-border));
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
  box-shadow: var(--shadow-md);
  color: hsl(var(--color-text));
}

.phearum-block-slider-prev:hover,
.phearum-block-slider-next:hover {
  background: hsl(var(--color-surface));
  transform: translateY(-50%) scale(1.1);
  box-shadow: var(--shadow-lg);
}

.phearum-block-slider-prev:disabled,
.phearum-block-slider-next:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.phearum-block-slider-prev {
  left: 1rem;
}

.phearum-block-slider-next {
  right: 1rem;
}

.phearum-block-slider-prev svg,
.phearum-block-slider-next svg {
  width: 20px;
  height: 20px;
}

.phearum-block-slider-prev:focus,
.phearum-block-slider-next:focus {
  outline: 2px solid hsl(var(--color-primary));
  outline-offset: 2px;
}

.phearum-block-slider-dot:hover {
  background: hsl(var(--color-primary) / 0.8);
}

.phearum-block-slider-dot.active {
  background: hsl(var(--color-primary));
  transform: scale(1.2);
}

.phearum-block-slider-dot:focus {
  outline: 2px solid hsl(var(--color-primary));
  outline-offset: 2px;
}

/* Responsive Adjustments */

@media (max-width: 768px) {
  .phearum-block-slider-prev,
    .phearum-block-slider-next {
    padding: 8px;
    width: 40px;
    height: 40px;
  }

  .phearum-block-slider-prev svg,
    .phearum-block-slider-next svg {
    width: 16px;
    height: 16px;
  }
}

/* Dark Mode Adjustments */

@media (prefers-color-scheme: dark) {
  .portfolio-card-hover-glow:hover {
    box-shadow: 0 25px 50px -12px rgba(59, 130, 246, 0.4) !important;
  }

  .phearum-block-slider-prev,
    .phearum-block-slider-next {
    background: rgba(0, 0, 0, 0.7);
    border-color: hsl(var(--color-border));
  }
}

/* Reduced Motion Support */

@media (prefers-reduced-motion: reduce) {
  .phearum-portfolio-item,
    .phearum-block-slider-prev,
    .phearum-block-slider-next,
    .phearum-block-slider-dot,
    .phearum-portfolio-image img {
    transition: none !important;
    animation: none !important;
  }
}

/* Animations */

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fade-in 0.6s ease-out forwards;
}

/* Block Editor Preview Styles */

.phearum-block-preview {
  border: 2px solid hsl(var(--color-border));
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: hsl(var(--color-surface));
}

.phearum-block-preview-header {
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.8), rgba(219, 234, 254, 0.6));
  padding: 1.5rem;
  border-bottom: 2px solid hsl(var(--color-border));
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.phearum-block-preview-header h3 {
  margin: 0;
  color: hsl(var(--color-text));
  font-size: 1.25rem;
  font-weight: 600;
}

.phearum-block-settings {
  display: flex;
  gap: 1.5rem;
  font-size: 0.875rem;
  color: hsl(var(--color-text-muted));
  flex-wrap: wrap;
}

.phearum-block-settings strong {
  color: hsl(var(--color-primary));
  font-weight: 600;
}

/* No Results Message */

.phearum-no-results {
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.6), rgba(219, 234, 254, 0.4));
  border-radius: var(--radius-lg);
  border: 2px dashed hsl(var(--color-border));
}

.phearum-no-results h3 {
  font-size: 1.25rem;
  margin: 0 0 0.5rem 0;
  color: hsl(var(--color-text));
  font-weight: 600;
}

.phearum-no-results p {
  margin: 0;
  font-size: 0.95rem;
  color: hsl(var(--color-text-muted));
}