/* ==========================================================================
   Latest Posts Cards Pro — Frontend Styles v3.0
   ========================================================================== */

.lpc-section {
    --lpc-highlight:   #8b5cf6;
    --lpc-highlight-2: #ec4899;
    --lpc-button:      #8b5cf6;
    --lpc-title:       #0f172a;
    --lpc-excerpt:     #64748b;
    --lpc-card-bg:     #ffffff;
    --lpc-radius:      16px;
    --lpc-img-height:  200px;

    max-width: 1200px;
    margin: 40px auto;
    padding: 30px 20px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #1a1a2e;
}

.lpc-section * {
    box-sizing: border-box;
}

/* Header (shared)
   ========================================================================== */
.lpc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    gap: 20px;
    flex-wrap: wrap;
}

.lpc-header-text { flex: 1; min-width: 240px; }

.lpc-section h2.lpc-title {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 6px 0;
    color: var(--lpc-title);
    letter-spacing: -0.5px;
    text-transform: none;
    border: none;
    padding: 0;
}

.lpc-title-highlight {
    background: linear-gradient(90deg, var(--lpc-highlight) 0%, var(--lpc-highlight-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--lpc-highlight); /* fallback */
}

.lpc-subtitle {
    font-size: 15px;
    color: #64748b;
    margin: 0;
    font-weight: 400;
}

.lpc-view-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border: 1.5px solid var(--lpc-button);
    border-radius: 8px;
    color: var(--lpc-button);
    background: #fff;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.lpc-view-all:hover {
    background: var(--lpc-button);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}
.lpc-view-all .lpc-arrow { transition: transform 0.2s ease; }
.lpc-view-all:hover .lpc-arrow { transform: translateX(3px); }

/* ==========================================================================
   STYLE: GRID
   ========================================================================== */
.lpc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.lpc-style-grid[data-columns="1"] .lpc-grid { grid-template-columns: 1fr; }
.lpc-style-grid[data-columns="2"] .lpc-grid { grid-template-columns: repeat(2, 1fr); }
.lpc-style-grid[data-columns="3"] .lpc-grid { grid-template-columns: repeat(3, 1fr); }
.lpc-style-grid[data-columns="4"] .lpc-grid { grid-template-columns: repeat(4, 1fr); }
.lpc-style-grid[data-columns="5"] .lpc-grid { grid-template-columns: repeat(5, 1fr); }
.lpc-style-grid[data-columns="6"] .lpc-grid { grid-template-columns: repeat(6, 1fr); }

.lpc-card {
    background: var(--lpc-card-bg);
    border-radius: var(--lpc-radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
    border: 1px solid #f1f5f9;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.lpc-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08), 0 4px 10px rgba(15, 23, 42, 0.04);
}
.lpc-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.lpc-card-image {
    position: relative;
    height: var(--lpc-img-height);
    overflow: hidden;
    display: block;
}
.lpc-card-cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}
.lpc-card:hover .lpc-card-cover { transform: scale(1.05); }

.lpc-card-tag {
    position: absolute;
    top: 14px;
    left: 14px;
    background: #fff;
    color: #475569;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.7px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    z-index: 2;
}
.lpc-card-body {
    padding: 22px 22px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.lpc-section h3.lpc-card-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 10px 0;
    color: var(--lpc-title);
    text-transform: none;
    border: none;
    padding: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.lpc-card-excerpt {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--lpc-excerpt);
    margin: 0 0 18px 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.lpc-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
    font-size: 12.5px;
    color: #94a3b8;
    margin-top: auto;
}
.lpc-meta-author {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #475569;
    font-weight: 500;
}
.lpc-meta-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #94a3b8;
}
.lpc-meta-date { color: #94a3b8; font-weight: 400; }

/* ==========================================================================
   STYLE: FEATURED HERO
   ========================================================================== */
.lpc-featured-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--lpc-card-bg);
    border-radius: calc(var(--lpc-radius) + 4px);
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.06);
    border: 1px solid #f1f5f9;
    min-height: 480px;
}

.lpc-featured-image {
    position: relative;
    overflow: hidden;
    min-height: 480px;
}

.lpc-featured-cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.6s ease;
}

.lpc-featured-card:hover .lpc-featured-cover { transform: scale(1.04); }

.lpc-featured-badge {
    position: absolute;
    top: 24px;
    left: 24px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    color: var(--lpc-highlight);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    z-index: 2;
}
.lpc-featured-star { color: #fbbf24; font-size: 13px; }

.lpc-featured-body {
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.lpc-featured-cat {
    display: inline-block;
    background: rgba(139, 92, 246, 0.1);
    color: var(--lpc-highlight);
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 18px;
    align-self: flex-start;
}

.lpc-section h3.lpc-featured-title {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 18px 0;
    color: var(--lpc-title);
    letter-spacing: -0.5px;
    text-transform: none;
    border: none;
    padding: 0;
}

.lpc-featured-excerpt {
    font-size: 15.5px;
    line-height: 1.65;
    color: var(--lpc-excerpt);
    margin: 0 0 24px 0;
}

.lpc-featured-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 28px;
    font-size: 13.5px;
    color: #64748b;
}
.lpc-fm-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.lpc-fm-icon {
    display: inline-flex;
    align-items: center;
    color: var(--lpc-highlight);
}

.lpc-featured-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--lpc-button);
    color: #fff;
    padding: 13px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14.5px;
    transition: all 0.25s ease;
    align-self: flex-start;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.3);
}
.lpc-featured-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(139, 92, 246, 0.4);
    color: #fff;
}
.lpc-featured-btn span { transition: transform 0.2s; }
.lpc-featured-btn:hover span { transform: translateX(4px); }

/* ==========================================================================
   STYLE: LIST / HORIZONTAL
   ========================================================================== */
.lpc-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.lpc-list-card {
    background: var(--lpc-card-bg);
    border-radius: var(--lpc-radius);
    overflow: hidden;
    border: 1px solid #f1f5f9;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.lpc-list-card:hover {
    transform: translateX(4px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}
.lpc-list-link {
    display: grid;
    grid-template-columns: 260px 1fr;
    text-decoration: none;
    color: inherit;
}
.lpc-list-image {
    position: relative;
    min-height: 180px;
    overflow: hidden;
}
.lpc-list-cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.lpc-list-body {
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.lpc-list-tag {
    display: inline-block;
    background: rgba(139, 92, 246, 0.1);
    color: var(--lpc-highlight);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.7px;
    margin-bottom: 10px;
    align-self: flex-start;
}
.lpc-section h3.lpc-list-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 10px 0;
    color: var(--lpc-title);
    text-transform: none;
    border: none;
    padding: 0;
}
.lpc-list-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: var(--lpc-excerpt);
    margin: 0 0 14px 0;
}
.lpc-list-meta {
    display: flex;
    gap: 18px;
    font-size: 12.5px;
    color: #94a3b8;
}

/* ==========================================================================
   STYLE: COMPACT
   ========================================================================== */
.lpc-compact-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.lpc-style-compact[data-columns="1"] .lpc-compact-grid { grid-template-columns: 1fr; }
.lpc-style-compact[data-columns="2"] .lpc-compact-grid { grid-template-columns: repeat(2, 1fr); }
.lpc-style-compact[data-columns="3"] .lpc-compact-grid { grid-template-columns: repeat(3, 1fr); }
.lpc-style-compact[data-columns="4"] .lpc-compact-grid { grid-template-columns: repeat(4, 1fr); }
.lpc-style-compact[data-columns="5"] .lpc-compact-grid { grid-template-columns: repeat(5, 1fr); }
.lpc-style-compact[data-columns="6"] .lpc-compact-grid { grid-template-columns: repeat(6, 1fr); }

.lpc-compact-card {
    background: var(--lpc-card-bg);
    border-radius: 10px;
    border: 1px solid #f1f5f9;
    overflow: hidden;
    transition: all 0.2s ease;
}
.lpc-compact-card:hover {
    border-color: var(--lpc-highlight);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}
.lpc-compact-link {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 12px;
    padding: 10px;
    text-decoration: none;
    color: inherit;
    align-items: center;
}
.lpc-compact-thumb {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}
.lpc-compact-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.lpc-compact-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.lpc-compact-cat {
    font-size: 10px;
    font-weight: 700;
    color: var(--lpc-highlight);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}
.lpc-section h4.lpc-compact-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    margin: 0;
    color: var(--lpc-title);
    border: none;
    padding: 0;
    text-transform: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.lpc-compact-date {
    font-size: 11.5px;
    color: #94a3b8;
}

/* ==========================================================================
   STYLE: CAROUSEL
   ========================================================================== */
.lpc-carousel-wrap {
    position: relative;
    border-radius: var(--lpc-radius);
    overflow: hidden;
}
.lpc-carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.lpc-carousel-slide {
    flex: 0 0 100%;
    min-width: 100%;
}
.lpc-carousel-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.lpc-carousel-image {
    position: relative;
    height: 460px;
    overflow: hidden;
}
.lpc-carousel-cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.lpc-carousel-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.1) 40%, rgba(0, 0, 0, 0.85) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 36px 44px;
    color: #fff;
}
.lpc-section h3.lpc-carousel-title {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 12px 0;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    border: none;
    padding: 0;
    text-transform: none;
    max-width: 70%;
}
.lpc-carousel-excerpt {
    font-size: 15px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.92);
    margin: 0 0 14px 0;
    max-width: 70%;
}
.lpc-carousel-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
}

.lpc-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    color: #0f172a;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}
.lpc-carousel-arrow:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.08);
}
.lpc-carousel-arrow.lpc-prev { left: 18px; }
.lpc-carousel-arrow.lpc-next { right: 18px; }

.lpc-carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 5;
}
.lpc-carousel-dots button {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
}
.lpc-carousel-dots button.is-active {
    background: #fff;
    width: 24px;
    border-radius: 4px;
}

/* ==========================================================================
   PAGINATION (shared)
   ========================================================================== */
.lpc-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 40px;
    flex-wrap: wrap;
}
.lpc-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #475569;
    background: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 13.5px;
    transition: all 0.2s ease;
}
.lpc-pagination .page-numbers:hover {
    border-color: var(--lpc-button);
    color: var(--lpc-button);
}
.lpc-pagination .page-numbers.current {
    background: var(--lpc-button);
    border-color: var(--lpc-button);
    color: #fff;
}
.lpc-pagination .page-numbers.dots {
    border: none;
    background: transparent;
}

/* Load more / infinite scroll */
.lpc-infinite-trigger {
    text-align: center;
    margin-top: 36px;
}
.lpc-load-more {
    background: var(--lpc-button);
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.lpc-load-more:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.3);
    opacity: 0.95;
}
.lpc-load-more:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.lpc-loader {
    display: none;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
}
.lpc-loader.active { display: flex; }
.lpc-loader span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--lpc-button);
    animation: lpc-bounce 1.2s infinite ease-in-out;
}
.lpc-loader span:nth-child(2) { animation-delay: 0.15s; }
.lpc-loader span:nth-child(3) { animation-delay: 0.30s; }
@keyframes lpc-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40%           { transform: scale(1);   opacity: 1; }
}

.lpc-card.lpc-just-loaded,
.lpc-list-card.lpc-just-loaded,
.lpc-compact-card.lpc-just-loaded {
    animation: lpc-fade-up 0.4s ease both;
}
@keyframes lpc-fade-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.lpc-no-posts {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
    font-size: 15px;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1100px) {
    .lpc-style-grid[data-columns="5"] .lpc-grid,
    .lpc-style-grid[data-columns="6"] .lpc-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 960px) {
    .lpc-style-grid[data-columns="3"] .lpc-grid,
    .lpc-style-grid[data-columns="4"] .lpc-grid,
    .lpc-style-grid[data-columns="5"] .lpc-grid,
    .lpc-style-grid[data-columns="6"] .lpc-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .lpc-featured-card {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .lpc-featured-image { min-height: 320px; }
    .lpc-featured-body { padding: 36px 28px; }
    .lpc-section h3.lpc-featured-title { font-size: 24px; }

    .lpc-list-link { grid-template-columns: 200px 1fr; }
    .lpc-list-image { min-height: 160px; }
}

@media (max-width: 600px) {
    .lpc-section {
        padding: 20px 16px;
        margin: 20px auto;
    }
    .lpc-section h2.lpc-title { font-size: 26px; }

    .lpc-grid,
    .lpc-style-grid[data-columns] .lpc-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    .lpc-style-compact[data-columns] .lpc-compact-grid {
        grid-template-columns: 1fr;
    }

    .lpc-card-image { height: calc(var(--lpc-img-height) - 40px); }

    .lpc-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .lpc-list-link {
        grid-template-columns: 1fr;
    }
    .lpc-list-image { min-height: 200px; }
    .lpc-list-body { padding: 20px; }

    .lpc-featured-image { min-height: 240px; }
    .lpc-featured-body { padding: 28px 20px; }
    .lpc-section h3.lpc-featured-title { font-size: 22px; }

    .lpc-carousel-image { height: 360px; }
    .lpc-carousel-overlay { padding: 24px 20px; }
    .lpc-section h3.lpc-carousel-title { font-size: 20px; max-width: 100%; }
    .lpc-carousel-excerpt { max-width: 100%; }
    .lpc-carousel-arrow { width: 36px; height: 36px; }
}
