/**
 * Posts Carousel Styles
 * Apteki Theme — Design 2026
 *
 * @package Apteki
 * @since 1.0.0
 */

/* =============================================================================
   SECTION CONTAINER
   ============================================================================= */

.posts-carousel {
    padding: var(--space-12, 48px) 0;
    overflow: hidden;
}

.posts-carousel__header {
    max-width: 1280px;
    margin: 0 auto var(--space-8, 32px);
    padding: 0 var(--space-5, 20px);
}

.posts-carousel__subtitle {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted, #6b7280);
    margin-bottom: var(--space-2, 8px);
}

.posts-carousel__title {
    font-size: clamp(24px, 5vw, 36px);
    font-weight: 700;
    color: var(--color-text-primary, #111827);
    margin: 0;
    line-height: 1.2;
}

/* =============================================================================
   WRAPPER & SWIPER
   ============================================================================= */

.posts-carousel__wrapper {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-5, 20px);
}

.posts-carousel__swiper {
    overflow: visible;
}

/* =============================================================================
   POST CARD
   ============================================================================= */

.post-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    height: 100%;
}

.post-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

/* Image */
.post-card__image-link {
    display: block;
    text-decoration: none;
}

.post-card__image {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--color-bg-secondary, #f3f4f6);
}

.post-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

.post-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e5e7eb 0%, #f3f4f6 100%);
    color: #9ca3af;
}

/* Content */
.post-card__content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: var(--space-5, 20px);
}

/* Category badge */
.post-card__category {
    display: inline-block;
    align-self: flex-start;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--color-primary, #059669);
    background: rgba(5, 150, 105, 0.1);
    border-radius: 4px;
    text-decoration: none;
    margin-bottom: var(--space-3, 12px);
    transition: background 0.2s ease;
}

.post-card__category:hover {
    background: rgba(5, 150, 105, 0.2);
    color: var(--color-primary, #059669);
}

/* Title */
.post-card__title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 var(--space-2, 8px);
    color: var(--color-text-primary, #111827);
}

.post-card__title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-card__title a:hover {
    color: var(--color-primary, #059669);
}

/* Excerpt */
.post-card__excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text-secondary, #6b7280);
    margin: 0 0 var(--space-4, 16px);
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Read more link */
.post-card__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-primary, #059669);
    text-decoration: none;
    margin-top: auto;
    transition: gap 0.2s ease;
}

.post-card__link:hover {
    gap: 10px;
}

.post-card__link svg {
    flex-shrink: 0;
}

/* =============================================================================
   NAVIGATION
   ============================================================================= */

.posts-carousel__nav {
    display: flex;
    justify-content: center;
    gap: var(--space-3, 12px);
    margin-top: var(--space-8, 32px);
}

.posts-carousel__btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 50%;
    cursor: pointer;
    color: var(--color-text-primary, #111827);
    transition: all 0.2s ease;
}

.posts-carousel__btn:hover:not(.is-disabled) {
    background: var(--color-primary, #059669);
    border-color: var(--color-primary, #059669);
    color: #fff;
}

.posts-carousel__btn.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* =============================================================================
   EDITOR STYLES
   ============================================================================= */

.wp-block-apteki-posts-carousel {
    margin: 20px 0;
}

.posts-carousel-editor {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
}

.posts-carousel-editor__header {
    margin-bottom: 20px;
}

.posts-carousel-editor__subtitle {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9ca3af;
    margin-bottom: 4px;
}

.posts-carousel-editor__title {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.posts-carousel-editor__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.posts-carousel-editor__card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.posts-carousel-editor__image {
    aspect-ratio: 4 / 3;
    background: #e5e7eb;
    overflow: hidden;
}

.posts-carousel-editor__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.posts-carousel-editor__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: linear-gradient(135deg, #e5e7eb 0%, #f3f4f6 100%);
}

.posts-carousel-editor__content {
    padding: 12px;
}

.posts-carousel-editor__cat {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #059669;
    background: rgba(5, 150, 105, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    margin-bottom: 6px;
}

.posts-carousel-editor__card-title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.posts-carousel-editor__loading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: #6b7280;
    font-size: 14px;
}

.posts-carousel-editor__more {
    text-align: center;
    font-size: 13px;
    color: #9ca3af;
    margin: 16px 0 0;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 1023px) {
    .posts-carousel {
        padding: var(--space-8, 32px) 0;
    }
    
    .posts-carousel__header {
        margin-bottom: var(--space-6, 24px);
    }
    
    .posts-carousel-editor__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 639px) {
    .posts-carousel__wrapper {
        padding: 0 var(--space-4, 16px);
    }
    
    .post-card__content {
        padding: var(--space-4, 16px);
    }
    
    .post-card__title {
        font-size: 15px;
    }
    
    .post-card__excerpt {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }
    
    .posts-carousel__btn {
        width: 40px;
        height: 40px;
    }
    
    .posts-carousel__btn svg {
        width: 16px;
        height: 16px;
    }
    
    .posts-carousel-editor__grid {
        grid-template-columns: 1fr;
    }
}

/* =============================================================================
   EMPTY STATE
   ============================================================================= */

.posts-carousel-empty {
    text-align: center;
    padding: var(--space-8, 32px);
    color: var(--color-text-muted, #6b7280);
    font-size: 14px;
}
