@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@600;700;800&display=swap');

/* 3. High-End Thumbnail & Zoom Animation */
.post-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: var(--plc-image-ratio, 16 / 9);
    background: #eef2f7;
    overflow: hidden;
    display: block;
    line-height: 0;
    border-radius: var(--plc-image-radius, 0);
    isolation: isolate;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: var(--plc-fit, cover) !important;
    display: block;
    transition: opacity 0.28s ease, transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    z-index: 1;
    max-width: 100%;
    border-radius: inherit;
}

.post-thumbnail.plc-orientation-16-9,
.post-thumbnail.plc-orientation-4-5,
.post-thumbnail.plc-orientation-1-1 {
    aspect-ratio: var(--plc-image-ratio, 16/9) !important;
}

.post-thumbnail.has-image .plc-image-skeleton {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 14px;
    background: linear-gradient(110deg, rgba(241, 245, 249, 0.92) 18%, rgba(226, 232, 240, 0.98) 38%, rgba(248, 250, 252, 0.92) 58%);
    background-size: 220% 100%;
    animation: plc-skeleton 1.35s linear infinite;
    opacity: 1;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 0;
}

.plc-image-skeleton__pill {
    width: 78px;
    height: 28px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(203, 213, 225, 0.5);
}

.plc-image-skeleton__pill-secondary {
    width: 104px;
}

.postly-wp-js .post-thumbnail.has-image.is-loaded .plc-image-skeleton,
.postly-wp-js .post-thumbnail.has-image.is-error .plc-image-skeleton {
    opacity: 0;
}

.postly-wp-js .post-thumbnail.has-image img {
    opacity: 1;
}

.postly-wp-js .post-thumbnail.has-image.is-error img {
    opacity: 0;
}

.post-list-item.has-zoom:hover .post-thumbnail img {
    transform: scale(1.1);
}

.post-thumbnail a {
    display: block;
    width: 100%;
    height: 100%;
    line-height: 0;
    z-index: 1;
    position: relative;
}

.post-placeholder {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100%;
    height: 100%;
    background: #f1f5f9;
    color: #cbd5e1;
    border-radius: inherit;
}

.plc-image-error-placeholder {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.post-placeholder i {
    width: 48px;
    height: 48px;
    font-size: 48px;
}

.post-thumbnail::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0) 60%);
    opacity: 0.58;
    transition: var(--plc-transition);
    pointer-events: none;
    z-index: 2;
}

.post-list-item:hover .post-thumbnail::after {
    opacity: 0.8;
}

.postly-wp-js .post-thumbnail.has-image.is-loading::after {
    opacity: 0;
}

:root {
    --plc-primary: #6366f1;
    --plc-primary-hover: #4f46e5;
    --plc-primary-soft: rgba(99, 102, 241, 0.1);
    --plc-secondary: #ec4899;
    --plc-success: #10b981;
    --plc-warning: #f59e0b;
    --plc-danger: #ef4444;
    --plc-bg: #f8fafc;
    --plc-card-bg: #ffffff;
    --plc-text-main: #1e293b;
    --plc-text-muted: #64748b;
    --plc-border: #e2e8f0;
    --plc-radius-sm: 8px;
    --plc-radius: 16px;
    --plc-radius-lg: 24px;
    --plc-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --plc-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --plc-shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    --plc-font-heading: 'Outfit', sans-serif;
    --plc-font-body: 'Inter', sans-serif;
    --plc-transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Postly WP Core Styles */
.postly-wp-container {
    margin: 40px 0;
    font-family: var(--plc-font-body);
    color: var(--plc-text-main);
    background: transparent;
    transition: var(--plc-transition);
}

.post-list-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: var(--plc-grid-gap, 40px);
    align-items: stretch;
}

/* Base Card Logic */
.post-list-item {
    background: var(--plc-card-bg);
    border: 1px solid var(--plc-border);
    border-radius: var(--plc-radius);
    overflow: hidden;
    transition: var(--plc-transition);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--plc-shadow);
    animation: plcFadeInUp 0.6s ease backwards;
}

@keyframes plcFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 5. Refined Badges */
.post-badges {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    z-index: 6;
    pointer-events: none;
}

.post-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 8px 12px;
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(16px);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
    background: rgba(15, 23, 42, 0.76);
}

.post-badge__pulse {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--plc-badge-accent, #fff);
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.1);
}

.post-badge__label {
    line-height: 1;
}

.badge-new {
    --plc-badge-accent: #86efac;
    background: rgba(5, 150, 105, 0.78);
}

.badge-hot {
    --plc-badge-accent: #fda4af;
    background: rgba(190, 24, 93, 0.82);
}

.badge-featured {
    --plc-badge-accent: #fcd34d;
    background: rgba(161, 98, 7, 0.82);
}

.post-cat-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 6;
    pointer-events: none;
}

.post-cat-badge__label {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.9);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 16px 36px rgba(79, 70, 229, 0.2);
}

/* 6. Premium Filter Bar */
.postly-wp-filter-bar {
    margin-bottom: 64px;
}

.filter-search-combined {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    background: #fff;
    padding: 10px;
    border-radius: var(--plc-radius);
    box-shadow: var(--plc-shadow);
    border: 1px solid var(--plc-border);
}

.post-list-search-input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    padding: 12px 20px !important;
    font-size: 16px !important;
    font-family: var(--plc-font-body);
    box-shadow: none !important;
}

.post-list-search-input:focus {
    outline: none;
}

/* Category Popup Styling */
.filter-category-trigger {
    position: relative;
    z-index: 100;
}

.postly-wp-cat-btn {
    background: var(--plc-primary);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: var(--plc-radius-sm);
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--plc-transition);
}

.postly-wp-cat-btn:hover {
    background: var(--plc-primary-hover);
    transform: translateY(-2px);
}

.plc-cat-popup-btn i {
    font-size: 22px;
}

.plc-cat-popup-content {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    width: 250px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--plc-border);
    padding: 10px;
    visibility: hidden;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
}

.plc-cat-popup-content.active {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.plc-cat-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 300px;
    overflow-y: auto;
}

.plc-cat-option {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.plc-cat-option:hover {
    background: #f1f5f9;
}

.plc-cat-option.selected {
    background: rgba(99, 102, 241, 0.1);
    color: var(--plc-primary);
}

.plc-cat-option input {
    display: none;
}

/* Scrollbar for Category List */
.plc-cat-list::-webkit-scrollbar {
    width: 6px;
}

.plc-cat-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* 7. Typography & Content */
.post-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: var(--plc-card-gap, 15px);
}

.post-category {
    font-size: 11px;
    color: var(--plc-primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.post-meta-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.post-reading-time {
    font-size: 11px;
    font-weight: 600;
    color: var(--plc-text-muted);
}

.post-title {
    margin: 0;
    font-size: 20px;
    line-height: 1.4;
    font-family: var(--plc-font-heading);
    font-weight: 700;
}

.post-title a {
    color: var(--plc-text-main);
    text-decoration: none;
    transition: var(--plc-transition);
}

.post-title a:hover {
    color: var(--plc-primary);
}

.post-excerpt {
    font-size: 14px;
    color: var(--plc-text-muted);
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta-bottom {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--plc-border);
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--plc-text-muted);
}

/* 8. Modern Button */
.post-button-wrapper {
    margin-top: 0;
}

.post-list-btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--plc-primary);
    color: #fff !important;
    border-radius: var(--plc-radius-sm);
    font-weight: 600;
    text-decoration: none !important;
    transition: var(--plc-transition);
    text-align: center;
}

.post-list-btn:hover {
    background: var(--plc-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--plc-primary-soft);
}

/* 9. Pagination */
.plc-pagination-list {
    display: flex;
    justify-content: center;
    gap: 8px;
    list-style: none;
    padding: 20px 0;
    margin: 40px 0 0;
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    .plc-pagination-list {
        gap: 8px;
        justify-content: flex-start;
        overflow-x: auto;
        padding: 10px 15px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap;
    }

    .plc-pagination-list::-webkit-scrollbar {
        display: none;
    }
}

.plc-page-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--plc-radius-sm);
    border: 1px solid var(--plc-border);
    background: #fff;
    color: var(--plc-text-main);
    cursor: pointer;
    font-weight: 600;
    transition: var(--plc-transition);
}

.plc-page-btn:hover:not(.active) {
    border-color: var(--plc-primary);
    color: var(--plc-primary);
}

.plc-page-btn.active {
    background: var(--plc-primary);
    color: #fff;
    border-color: var(--plc-primary);
}

@media (max-width: 600px) {
    .plc-page-btn {
        min-width: 38px;
        height: 38px;
        font-size: 13px;
        border-radius: 8px;
    }

    .plc-dots {
        min-width: 20px;
        font-size: 12px;
    }
}

/* Responsive Overrides */
.postly-wp-layout-grid .post-list-item {
    width: calc((100% - (var(--plc-grid-gap, 40px) * (var(--plc-cols-desktop, 3) - 1))) / var(--plc-cols-desktop, 3));
}

.postly-wp-layout-card .post-list-item {
    width: calc((100% - var(--plc-grid-gap, 40px)) / 2);
}

.postly-wp-layout-list .post-list-item {
    width: 100%;
    flex-direction: row;
}

.postly-wp-layout-list .post-thumbnail,
.postly-wp-layout-list .plc-skeleton-media {
    flex: 0 0 min(40%, 360px);
}

.postly-wp-layout-list .post-content {
    flex: 1;
}

@media (max-width: 1024px) {
    .postly-wp-layout-grid .post-list-item {
        width: calc((100% - (var(--plc-grid-gap, 40px) * (var(--plc-cols-tablet, 2) - 1))) / var(--plc-cols-tablet, 2));
    }
}

@media (max-width: 640px) {

    .postly-wp-layout-grid .post-list-item,
    .postly-wp-layout-card .post-list-item {
        width: calc((100% - (var(--plc-grid-gap-mobile, 24px) * (var(--plc-cols-mobile, 1) - 1))) / var(--plc-cols-mobile, 1));
    }

    .postly-wp-layout-list .post-list-item {
        flex-direction: column;
    }

    .postly-wp-layout-list .post-thumbnail,
    .postly-wp-layout-list .plc-skeleton-media {
        flex-basis: auto;
    }

    .post-list-wrapper {
        gap: var(--plc-grid-gap-mobile, 24px);
    }
}

/* 10. Motion Skeleton Loading */
.plc-skeleton-template {
    display: none !important;
}

.plc-skeleton-card {
    pointer-events: none;
    overflow: hidden;
    animation: none;
}

.plc-skeleton-card .post-content {
    gap: 12px;
}

.plc-skeleton-media,
.plc-skeleton-line,
.plc-skeleton-chip,
.plc-skeleton-button {
    background: linear-gradient(110deg, rgba(241, 245, 249, 0.92) 18%, rgba(226, 232, 240, 0.98) 38%, rgba(248, 250, 252, 0.92) 58%);
    background-size: 220% 100%;
    animation: plc-skeleton 1.35s linear infinite;
}

.plc-skeleton-media {
    aspect-ratio: var(--plc-skeleton-ratio, 16 / 9);
    border-radius: var(--plc-image-radius, 0);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 14px;
}

.plc-skeleton-badge-row,
.plc-skeleton-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.plc-skeleton-pill,
.plc-skeleton-chip,
.plc-skeleton-line,
.plc-skeleton-button {
    display: block;
    border-radius: 999px;
}

.plc-skeleton-pill {
    width: 76px;
    height: 28px;
}

.plc-skeleton-pill-secondary {
    width: 102px;
}

.plc-skeleton-line {
    width: 100%;
    height: 12px;
}

.plc-skeleton-line-title {
    height: 18px;
    width: 92%;
}

.plc-skeleton-line-short {
    width: 68%;
}

.plc-skeleton-chip {
    width: 92px;
    height: 12px;
}

.plc-skeleton-chip-short {
    width: 62px;
}

.plc-skeleton-button {
    width: 136px;
    height: 40px;
}

.post-list-wrapper.is-skeleton-loading,
.post-list-wrapper.is-appending {
    align-items: stretch;
}

@keyframes plc-skeleton {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .plc-skeleton-media,
    .plc-skeleton-line,
    .plc-skeleton-chip,
    .plc-skeleton-button,
    .post-thumbnail.has-image .plc-image-skeleton {
        animation: none;
    }
}

/* Scoped Isolation Overrides */
.postly-wp-container .post-thumbnail {
    background-color: #eef2f7 !important;
}

.postly-wp-container .post-thumbnail img {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

.postly-wp-container .post-thumbnail.has-image .plc-image-skeleton {
    z-index: 0 !important;
}

.postly-wp-container .post-thumbnail::after {
    z-index: 2 !important;
}

.postly-wp-container .post-list-item {
    margin: 0 !important;
}

@media (max-width: 640px) {
    .postly-wp-container {
        margin: 16px 0 !important;
        padding: 0 14px !important;
        box-sizing: border-box;
    }

    .postly-wp-container .post-list-wrapper {
        gap: 16px !important;
    }

    .postly-wp-container .post-content {
        padding: 16px !important;
    }

    .postly-wp-container .postly-wp-layout-grid .post-list-item,
    .postly-wp-container .postly-wp-layout-card .post-list-item,
    .postly-wp-container .postly-wp-layout-list .post-list-item {
        width: 100% !important;
    }

    .postly-wp-container .postly-wp-layout-list .post-thumbnail,
    .postly-wp-container .postly-wp-layout-list .plc-skeleton-media {
        flex-basis: auto !important;
    }
}

/* Load More Button */
.pwp-load-more-wrapper {
    text-align: center;
    margin: 40px 0;
}

.pwp-load-more-btn {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer !important;
    transition: all 0.3s ease;
    border-radius: 50px;
    background: var(--plc-primary, #007cba);
    color: #fff !important;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: inline-block;
    text-decoration: none !important;
}

.pwp-load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    background: var(--plc-primary-hover, #006799);
}

.pwp-load-more-spinner {
    display: inline-block;
    vertical-align: middle;
}

.pwp-load-more-spinner .spinner {
    float: none;
    visibility: visible;
    margin: 0;
}