/**
 * Post Cards System - Main CSS (Pre-compiled from SCSS)
 * Comprehensive styling for post card components
 */

:root {
  --pc-bg-primary: #ffffff;
  --pc-bg-secondary: #f5f5f5;
  --pc-text-primary: #222222;
  --pc-text-secondary: #666666;
  --pc-text-tertiary: #999999;
  --pc-accent: #0066ff;
  --pc-accent-hover: #0052cc;
  --pc-accent-light: #e6f0ff;
  --pc-border: #e0e0e0;
  --pc-border-light: #f0f0f0;
  --pc-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  --pc-shadow-hover: 0 8px 16px rgba(0, 0, 0, 0.15);
  --pc-padding: 24px;
  --pc-gap: 20px;
  --pc-border-radius: 12px;
  --pc-font-size-title: 20px;
}

/* ===== BASE CARD STYLES ===== */

.post-card {
  background-color: var(--pc-bg-primary, #ffffff);
  border-radius: var(--pc-border-radius, 12px);
  overflow: hidden;
  box-shadow: var(--pc-shadow, 0 4px 8px rgba(0, 0, 0, 0.1));
  transition: box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-card:hover {
  box-shadow: var(--pc-shadow-hover, 0 8px 16px rgba(0, 0, 0, 0.15));
}

/* ===== CARD IMAGE ===== */

.post-card__image {
  position: relative;
  overflow: hidden;
  background-color: var(--pc-bg-secondary, #f5f5f5);
  display: block;
  width: 100%;
}

.post-card__image--16-9 {
  aspect-ratio: 16 / 9;
}

.post-card__image--4-3 {
  aspect-ratio: 4 / 3;
}

.post-card__image--1-1 {
  aspect-ratio: 1 / 1;
}

.post-card__image--portrait {
  aspect-ratio: 2 / 3;
}

.post-card__img-tag {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-card:hover .post-card__img-tag {
  transform: scale(1.05);
}

/* ===== CARD CONTENT ===== */

.post-card__content {
  padding: var(--pc-padding, 24px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ===== CATEGORIES ===== */

.post-card__categories {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.post-card__category {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  background-color: var(--pc-accent-light, #e6f0ff);
  color: var(--pc-accent, #0066ff);
  font-size: 12px;
  font-weight: 600;
  border-radius: 9999px;
  text-decoration: none;
  transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-card__category:hover {
  background-color: var(--pc-accent, #0066ff);
  color: white;
}

/* ===== TITLE ===== */

.post-card__title {
  margin: 0;
  font-size: var(--pc-font-size-title, 20px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--pc-text-primary, #222222);
}

.post-card__title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-card__title a:hover {
  color: var(--pc-accent, #0066ff);
}

/* ===== META ===== */

.post-card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--pc-text-secondary, #666666);
}

.post-card__author {
  font-weight: 500;
}

.post-card__date {
  font-size: 12px;
}

/* ===== EXCERPT ===== */

.post-card__excerpt {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--pc-text-secondary, #666666);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

/* ===== BUTTON ===== */

.post-card__button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background-color: var(--pc-accent, #0066ff);
  color: white;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-card__button:hover {
  background-color: var(--pc-accent-hover, #0052cc);
  transform: translateX(2px);
}

.post-card__button:active {
  transform: translateX(0);
}

.post-card__button:focus-visible {
  outline: 2px solid var(--pc-accent, #0066ff);
  outline-offset: 2px;
}

.post-card__button-arrow {
  display: inline-block;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-card:hover .post-card__button-arrow {
  transform: translateX(4px);
}

/* ===== GRID LAYOUTS ===== */

.post-cards-grid {
  display: grid;
  gap: var(--pc-gap, 20px);
  width: 100%;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.post-cards-grid.post-cards-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.post-cards-grid.post-cards-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.post-cards-grid.post-cards-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1023px) {
  .post-cards-grid.post-cards-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .post-cards-grid {
    grid-template-columns: 1fr;
  }

  .post-cards-grid.post-cards-grid-2,
  .post-cards-grid.post-cards-grid-3,
  .post-cards-grid.post-cards-grid-4 {
    grid-template-columns: 1fr;
  }

  .post-card__content {
    padding: 16px;
  }

  .post-card__title {
    font-size: 18px;
  }
}

/* ===== MASONRY LAYOUT ===== */

.post-cards-masonry {
  column-count: 1;
}

.post-cards-masonry .post-card {
  margin-bottom: var(--pc-gap, 20px);
  break-inside: avoid;
}

@media (min-width: 768px) {
  .post-cards-masonry {
    column-count: 2;
  }
}

@media (min-width: 1024px) {
  .post-cards-masonry {
    column-count: 3;
  }
}

/* ===== HORIZONTAL LAYOUT ===== */

.post-cards-horizontal {
  display: flex;
  flex-direction: column;
  gap: var(--pc-gap, 20px);
}

.post-cards-horizontal .post-card {
  display: flex;
  flex-direction: row;
}

.post-cards-horizontal .post-card__image {
  width: 40%;
  min-width: 200px;
  max-width: 300px;
}

.post-cards-horizontal .post-card__content {
  flex: 1;
  justify-content: space-between;
}

@media (max-width: 767px) {
  .post-cards-horizontal .post-card {
    flex-direction: column;
  }

  .post-cards-horizontal .post-card__image {
    width: 100%;
    max-width: 100%;
  }
}

/* ===== STACKED LAYOUT ===== */

.post-cards-stacked {
  display: flex;
  flex-direction: column;
  gap: var(--pc-gap, 20px);
  max-width: 100%;
}

@media (min-width: 768px) {
  .post-cards-stacked {
    max-width: 600px;
    margin: 0 auto;
  }
}

/* ===== PRESET: MODERN MINIMAL ===== */

.post-card--modern-minimal {
  border: 1px solid var(--pc-border-light, #f0f0f0);
  box-shadow: none;
}

.post-card--modern-minimal:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ===== PRESET: GLASSMORPHISM ===== */

.post-card--glassmorphism {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* ===== PRESET: NEUMORPHISM ===== */

.post-card--neumorphism {
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
  box-shadow: 8px 8px 16px rgba(0, 0, 0, 0.08), -8px -8px 16px rgba(255, 255, 255, 0.8);
}

.post-card--neumorphism:hover {
  box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.1), -4px -4px 8px rgba(255, 255, 255, 0.8);
}

/* ===== PRESET: CYBERPUNK ===== */

.post-card--cyberpunk {
  border: 2px solid var(--pc-accent, #0066ff);
  box-shadow: 0 0 10px var(--pc-accent, #0066ff), 0 0 20px var(--pc-accent, #0066ff);
  background: #0a0a0a;
  color: var(--pc-accent, #0066ff);
}

.post-card--cyberpunk .post-card__title a,
.post-card--cyberpunk .post-card__meta {
  color: var(--pc-accent, #0066ff);
}

/* ===== PRESET: BRUTALIST ===== */

.post-card--brutalist {
  border: 3px solid var(--pc-text-primary, #222222);
  box-shadow: none;
  border-radius: 0;
}

.post-card--brutalist .post-card__image {
  filter: grayscale(100%);
}

/* ===== PRESET: ROUNDED SOFT UI ===== */

.post-card--rounded-soft-ui {
  border-radius: 24px;
  background: linear-gradient(135deg, #ffffff 0%, #f9f9f9 100%);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.post-card--rounded-soft-ui:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* ===== PRESET: CLEAN CORPORATE ===== */

.post-card--clean-corporate {
  border: 1px solid var(--pc-border, #e0e0e0);
  border-radius: 12px;
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.post-card--clean-corporate:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* ===== PRESET: DARK PREMIUM ===== */

.post-card--dark-premium {
  background: #1a1a1a;
  color: white;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.post-card--dark-premium .post-card__title a,
.post-card--dark-premium .post-card__meta {
  color: white;
}

.post-card--dark-premium .post-card__category {
  background-color: rgba(0, 102, 255, 0.1);
}

/* ===== PRESET: MAGAZINE STYLE ===== */

.post-card--magazine-style {
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.post-card--magazine-style .post-card__image {
  height: 200px;
}

.post-card--magazine-style .post-card__content {
  padding: 24px;
}

/* ===== PRESET: MASONRY CARDS ===== */

.post-card--masonry {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.post-card--masonry .post-card__content {
  flex-grow: 1;
}

/* ===== HOVER EFFECTS ===== */

.post-card--hover-lift:hover {
  transform: translateY(-8px);
}

.post-card--hover-scale:hover {
  transform: scale(1.05);
}

.post-card--hover-tilt:hover {
  transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

.post-card--hover-glow:hover {
  box-shadow: 0 0 30px rgba(0, 102, 255, 0.5);
}

.post-card--hover-slide:hover {
  transform: translateX(8px);
}

/* ===== ANIMATIONS ===== */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.post-card--skeleton {
  background: linear-gradient(90deg, var(--pc-bg-secondary, #f5f5f5) 25%, rgba(255, 255, 255, 0.2) 50%, var(--pc-bg-secondary, #f5f5f5) 75%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

.post-card--skeleton * {
  background-color: transparent;
}

/* ===== DARK MODE ===== */

@media (prefers-color-scheme: dark) {
  :root {
    --pc-bg-primary: #1a1a1a;
    --pc-bg-secondary: #2a2a2a;
    --pc-text-primary: #e0e0e0;
    --pc-text-secondary: #a0a0a0;
    --pc-border: #333333;
  }

  .post-card {
    background-color: #1a1a1a;
    color: #e0e0e0;
  }

  .post-card__category {
    background-color: rgba(0, 102, 255, 0.15);
    color: #66bbff;
  }

  .post-card--modern-minimal {
    border-color: #333333;
  }

  .post-card--glassmorphism {
    background: rgba(26, 26, 26, 0.7);
    border-color: rgba(255, 255, 255, 0.1);
  }

  .post-card--neumorphism {
    background: linear-gradient(135deg, #222222 0%, #1a1a1a 100%);
  }

  .post-card--clean-corporate {
    background: #1a1a1a;
    border-color: #333333;
  }
}

/* ===== ACCESSIBILITY ===== */

@media (prefers-reduced-motion: reduce) {
  .post-card,
  .post-card__button,
  .post-card__img-tag,
  .post-card__category,
  .post-card__button-arrow {
    transition: none;
  }

  .post-card:hover,
  .post-card--hover-lift:hover,
  .post-card--hover-scale:hover,
  .post-card--hover-tilt:hover,
  .post-card--hover-glow:hover,
  .post-card--hover-slide:hover {
    transform: none;
  }
}

.post-card:focus-within {
  outline: 2px solid var(--pc-accent, #0066ff);
  outline-offset: 2px;
}

/* ===== UTILITIES ===== */

.post-cards-container {
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--pc-gap, 20px);
}

.post-card--disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.post-card--featured::before {
  content: 'Featured';
  display: inline-block;
  padding: 4px 12px;
  background-color: var(--pc-accent, #0066ff);
  color: white;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  margin-bottom: 12px;
}
