/* Homepage Redesign Styles */
/* Ensure lazy images also fill properly */
.swiper-lazy,
.hero-slide-image.loaded,
.hero-slide-image-container img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    min-width: 100% !important;
    min-height: 100% !important;
    max-width: none !important;
    max-height: none !important;
}

/* Line clamp utilities */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Hero Section */
.hero-section {
    margin-top: 2rem;
    margin-bottom: 3rem;
}

/* Hero Swiper base sizing - 16:9 aspect ratio */
.hero-section .hero-swiper {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: #f0f0f0; /* debug background to see container */
}

/* CRITICAL: ensure the wrapper and each slide inherit that height */
.hero-swiper,
.hero-swiper .swiper-wrapper,
.hero-swiper .swiper-slide {
    height: 100%;
}

.hero-slide-link {
    position: relative; /* add this */
    display: block;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.hero-slide-image-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000;
    /* Ensure the container properly constrains the image */
    overflow: hidden;
}

.hero-slide-image,
.hero-slide-placeholder {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* crop to fill container perfectly */
    object-position: center !important; /* center the crop */
    display: block !important;
    /* Force images to fill the container regardless of their natural size */
    min-width: 100% !important;
    min-height: 100% !important;
    max-width: none !important;
    max-height: none !important;
}

.hero-slide-placeholder {
  background: #f2f2f2;
  color: #9aa0a6;
  display: grid;
  place-items: center;
  font-size: 48px;
}

.hero-slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.0) 40%, rgba(0,0,0,0.55) 100%);
  display: flex;
  align-items: end;
  padding: 20px;
}

.hero-slide-content {
  color: #fff;
  max-width: 90%;
}

.hero-slide-title {
  margin: 0 0 6px;
  font-size: clamp(1.1rem, 2.2vw, 1.6rem);
  line-height: 1.25;
  font-weight: 700;
}

.hero-slide-overview {
  margin: 0 0 10px;
  font-size: clamp(0.9rem, 1.5vw, 1rem);
  opacity: 0.95;
}

.hero-slide-meta {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  opacity: 0.9;
  font-size: 0.9rem;
}

/* Swiper controls inside rounded container */

.hero-swiper .swiper-pagination-bullet {
  background: rgba(255,255,255,0.6);
}

.hero-swiper .swiper-pagination-bullet-active {
  background: #fff;
}

/* Hero List */
.hero-list {
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.hero-list-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #374151;
}

.hero-list-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hero-list-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.25rem;
    border-radius: 0.375rem;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
}

.hero-list-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.hero-list-thumbnail {
    flex-shrink: 0;
    width: 120px;
    height: 67.5px; /* 16:9 aspect ratio (120 * 9/16 = 67.5) */
}

.hero-list-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.25rem;
}

.hero-list-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border-radius: 0.25rem;
}

.hero-list-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-list-item-title {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.3;
    margin: 0 0 0.5rem;
    color: #374151;
}

.hero-list-meta {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    color: #9ca3af;
    font-weight: 400;
}

.hero-list-meta i {
    font-size: 0.65rem;
    opacity: 0.8;
}

/* Category Sections */
.category-section {
    margin-bottom: 0rem;
}

.category-section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: #1f2937;
    text-align: left;
}

/* Category Post Cards */
.category-post-card {
    height: 100%;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.category-post-link {
    display: block;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.category-post-image-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.category-post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-post-card:hover .category-post-image {
    transform: scale(1.05);
}

.category-post-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
}

.category-post-content {
    padding: 1.25rem;
}

.category-post-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    color: #1f2937;
}

.category-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.category-post-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.category-post-meta i {
    font-size: 0.7rem;
}

/* Paginated Posts (for backward compatibility) */
.paginated-posts {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: #1f2937;
    text-align: center;
}

.post-card {
    height: 100%;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.post-link {
    display: block;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.post-image-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.post-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
}

.post-content {
    padding: 1.25rem;
}

.post-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    color: #1f2937;
}

.post-overview {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.post-meta i {
    font-size: 0.7rem;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .hero-section .col-lg-8,
    .hero-section .col-lg-4 {
        margin-bottom: 2rem;
    }
    
    .hero-swiper {
        aspect-ratio: 16/9;
    }
    
    .hero-list {
        /* Natural height - no constraints */
        height: auto;
    }
}

@media (max-width: 767.98px) {
    .hero-section {
        margin-top: 1.5rem;
    }
    
    .hero-section .col-lg-8,
    .hero-section .col-lg-4 {
        margin-bottom: 1.5rem;
    }
    
    .hero-swiper {
        aspect-ratio: 16/9;
    }
    
    .hero-slide-overlay {
        padding: 1rem;
    }
    
    .hero-slide-title {
        font-size: 1.25rem;
    }
    
    .hero-slide-overview {
        font-size: 0.8rem;
    }
    
    .hero-list {
        /* Natural height - no constraints */
        height: auto;
    }
    
    .hero-list-thumbnail {
        width: 100px;
        height: 56.25px; /* 16:9 aspect ratio (100 * 9/16 = 56.25) */
    }
    
    .hero-list-item-title {
        font-size: 0.85rem;
    }
    
    .hero-list-meta {
        font-size: 0.65rem;
    }
    
    .hero-list-meta i {
        font-size: 0.6rem;
    }
    
    .category-section-title,
    .section-title {
        font-size: 1.5rem;
    }
    
    .category-post-image-container,
    .post-image-container {
        height: 150px;
    }
    
    .category-post-content,
    .post-content {
        padding: 1rem;
    }
    
    .category-post-title,
    .post-title {
        font-size: 1rem;
    }
}

@media (max-width: 575.98px) {
    .hero-section {
        margin-top: 1rem;
        margin-bottom: 2rem;
    }
    
    .hero-swiper {
        aspect-ratio: 16/9;
    }
    
    .hero-slide-overlay {
        padding: 0.75rem;
    }
    
    .hero-slide-title {
        font-size: 1.1rem;
    }
    
    .hero-slide-overview {
        font-size: 0.75rem;
    }
    
    .hero-list {
        padding: 1rem;
    }
    
    .hero-list-title {
        font-size: 1.1rem;
    }
    
    .hero-list-thumbnail {
        width: 80px;
        height: 45px; /* 16:9 aspect ratio (80 * 9/16 = 45) */
    }
    
    .hero-list-item {
        gap: 0.5rem;
        padding: 0.25rem;
    }
    
    .hero-list-item-title {
        font-size: 0.8rem;
    }
    
    .hero-list-meta {
        font-size: 0.6rem;
    }
    
    .hero-list-meta i {
        font-size: 0.55rem;
    }
    
    .category-section-title,
    .section-title {
        font-size: 1.25rem;
    }
    
    .category-post-image-container,
    .post-image-container {
        height: 120px;
    }
    
    .category-post-content,
    .post-content {
        padding: 0.75rem;
    }
    
    .category-post-title,
    .post-title {
        font-size: 0.9rem;
    }
    
    .category-post-meta,
    .post-meta {
        gap: 0.5rem;
        font-size: 0.75rem;
    }
}
