/* ===== HOMEPAGE SPECIFIC STYLES ===== */

/* ========================================
   HERO - Split Layout (text left, image right)
   ======================================== */

.hero.hero--split {
  padding: 0;
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
}

.hero.hero--split::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255, 152, 0, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 152, 0, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(255, 152, 0, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.hero.hero--split .container {
  max-width: none;
  padding: 0;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  align-items: center;
  min-height: 25rem;
  position: relative;
  z-index: 1;
}

.hero__text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--spacing-16) var(--spacing-8) var(--spacing-16) var(--spacing-4);
}

.hero.hero--split .hero__title {
  font-size: var(--font-size-5xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-6);
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero.hero--split .hero__subtitle {
  font-size: var(--font-size-xl);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--spacing-8);
}

.hero.hero--split .hero__actions {
  display: flex;
  gap: var(--spacing-4);
  flex-wrap: wrap;
}

.hero__image {
  overflow: hidden;
}

.hero__image-img {
  width: 100%;
  height: auto;
  display: block;
}

/* Desktop - two-column hero text adjustments */
@media (min-width: 1024px) {
  .hero__text {
    padding-left: var(--spacing-8);
  }

  .hero.hero--split .hero__title {
    font-size: var(--font-size-4xl);
  }
}

@media (min-width: 1280px) {
  .hero__text {
    padding-left: max(var(--spacing-8), calc((100vw - var(--container-2xl)) / 2 + var(--spacing-8)));
  }

  .hero.hero--split .hero__title {
    font-size: var(--font-size-5xl);
  }
}

/* Tablet & Mobile - stack vertically */
@media (max-width: 1023px) {
  .hero__grid {
    grid-template-columns: 1fr;
  }

  .hero__text {
    padding: var(--spacing-12) var(--spacing-6);
    text-align: center;
  }

  .hero__image {
    order: -1;
    max-height: 25rem;
  }

  .hero__image-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
  }

  .hero.hero--split .hero__actions {
    justify-content: center;
  }
}

/* Mobile - smaller hero */
@media (max-width: 767px) {
  .hero__text {
    padding: var(--spacing-12) var(--spacing-4);
  }

  .hero.hero--split .hero__title {
    font-size: var(--font-size-3xl);
  }

  .hero__image {
    max-height: 18.75rem;
  }

  .hero.hero--split .hero__actions .btn {
    width: 100%;
  }
}

/* ===== RECENT POSTS SECTION ===== */
.recent-posts {
  padding: var(--spacing-20) 0;
  background: var(--color-bg-primary);
}


/* Homepage posts grid - 3 columns, 2 rows (6 tiles) */
.recent-posts .posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-6);
  max-width: none;
  padding: 0;
}

@media (max-width: 1024px) {
  .recent-posts .posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .recent-posts .posts-grid {
    grid-template-columns: 1fr;
  }
}

/* Enhanced post cards for homepage */
.recent-posts .post-card {
  background: white;
  border: none;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.recent-posts .post-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.recent-posts .post-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.recent-posts .post-card:hover::before {
  transform: scaleX(1);
}

.recent-posts .post-card__image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
}

.recent-posts .post-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.recent-posts .post-card:hover .post-card__img {
  transform: scale(1.08);
}

.recent-posts .post-card__content {
  padding: var(--spacing-6);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.recent-posts .post-card__header {
  margin-bottom: var(--spacing-4);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--spacing-3);
}

.recent-posts .post-card__title {
  flex-grow: 1;
  margin: 0;
}

.recent-posts .post-card__title a {
  color: var(--color-text-primary);
  text-decoration: none;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-snug);
  transition: color var(--transition-fast);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recent-posts .post-card__title a:hover {
  color: var(--color-primary-600);
}

.recent-posts .post-card__premium {
  display: inline-flex;
  align-items: center;
  padding: var(--spacing-1) var(--spacing-3);
  background: var(--gradient-warm);
  color: var(--color-text-inverse);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

\

.recent-posts .post-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-4);
  margin-top: auto;
  padding-top: var(--spacing-4);
  border-top: 1px solid var(--color-border-light);
}

.recent-posts .post-card__date {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
}

.recent-posts .post-card__tags {
  display: flex;
  gap: var(--spacing-2);
  flex-wrap: wrap;
}

.recent-posts .post-tag {
  display: inline-flex;
  align-items: center;
  padding: var(--spacing-1) var(--spacing-2);
  background: var(--color-primary-100);
  color: var(--color-primary-800);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.recent-posts .post-tag:hover {
  background: var(--color-primary-200);
  color: var(--color-primary-900);
  transform: translateY(-1px);
}

.recent-posts .post-card__premium-lock {
  background: linear-gradient(135deg, var(--color-primary-50) 0%, var(--color-primary-100) 100%);
  border: 1px solid var(--color-primary-200);
  color: var(--color-primary-800);
  padding: var(--spacing-3);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-align: center;
  margin-top: var(--spacing-4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-2);
}

@media (max-width: 768px) {
  .recent-posts {
    padding: var(--spacing-16) 0;
  }
  
  .recent-posts .post-card__content {
    padding: var(--spacing-5);
  }
  
  .recent-posts .post-card__header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-2);
  }
  
  .recent-posts .post-card__title a {
    font-size: var(--font-size-lg);
  }
}


/* ===== LOADING STATES FOR HOMEPAGE ===== */
.loading-spinner {
  display: inline-block;
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid var(--color-gray-200);
  border-top: 3px solid var(--color-primary-500);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-posts {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-4);
  padding: var(--spacing-16);
  text-align: center;
  color: var(--color-text-muted);
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-2xl);
  min-height: 300px;
}

.loading-posts p {
  margin: 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
}

/* ===== CALL TO ACTION BUTTONS ===== */
.recent-posts .section-footer {
  text-align: center;
  margin-top: var(--spacing-12);
}

.recent-posts .btn--outline {
  padding: var(--spacing-4) var(--spacing-10);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  border-width: 2px;
  transition: all var(--transition-normal);
}

.recent-posts .btn--outline:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-warm);
}

/* ===== HOMEPAGE RESPONSIVE OPTIMIZATIONS ===== */
@media (max-width: 480px) {
  .recent-posts {
    padding: var(--spacing-12) 0;
  }
  
  .recent-posts .post-card__content {
    padding: var(--spacing-4);
  }
  
  .recent-posts .post-card__title a {
    font-size: var(--font-size-base);
  }
  
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
  .recent-posts .post-card {
    transition: none;
  }

  .recent-posts .post-card:hover {
    transform: none;
  }
}

.recent-posts .post-card__title a:focus-visible,
.recent-posts .post-tag:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
  .recent-posts .post-card {
    border-width: 2px;
  }

  .recent-posts .post-card::before {
    height: 4px;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  
  .recent-posts {
    padding: var(--spacing-8) 0;
  }
  
  .recent-posts .posts-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-4);
  }
  
  .recent-posts .post-card {
    border: 1px solid #000;
    box-shadow: none;
    break-inside: avoid;
    margin-bottom: var(--spacing-4);
  }
  
  .recent-posts .post-card:hover {
    transform: none;
  }
  
  .recent-posts .post-card__image {
    max-height: 150px;
  }
  
  .loading-spinner {
    display: none;
  }
}

/* ===== ANIMATION DELAYS FOR STAGGERED ENTRANCE ===== */
.recent-posts .post-card:nth-child(1) {
  animation-delay: 0.1s;
}

.recent-posts .post-card:nth-child(2) {
  animation-delay: 0.2s;
}

/* Apply fade-in animation when elements come into view */
.animate-fade-in {
  animation: fadeIn 0.6s ease-out both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== CONTENT-VISIBILITY OPTIMIZATION ===== */
@supports (content-visibility: auto) {
  .recent-posts {
    content-visibility: auto;
    contain-intrinsic-size: auto 800px;
  }

  .recent-posts .post-card {
    content-visibility: auto;
    contain-intrinsic-size: auto 380px;
  }
}

