/* Blog posts module for Pido Game Page Builder. */
.pido-builder-posts {
    --pido-builder-posts-gap: 20px;
}

.pido-builder-posts__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--pido-builder-posts-gap);
    width: 100%;
    min-width: 0;
    direction: rtl;
}

.pido-builder-post-item {
    width: 100%;
    min-width: 0;
    padding: 0;
    direction: rtl;
}

body.pido-theme .pido-builder-posts .pido-builder-blog-card {
    display: flex !important;
    height: 100%;
    min-width: 0;
    flex-direction: column;
    grid-template-columns: none !important;
    margin: 0;
    overflow: hidden;
    border-color: var(--pido-border) !important;
    background: var(--pido-surface) !important;
}

body.pido-theme .pido-builder-posts .pido-builder-blog-card:hover {
    border-color: color-mix(in srgb, var(--pido-border) 94%, var(--pido-primary) 6%) !important;
    background: color-mix(in srgb, var(--pido-surface) 98.8%, var(--pido-primary) 1.2%) !important;
}

html[data-pido-theme="dark"] body.pido-theme .pido-builder-posts .pido-builder-blog-card:hover {
    border-color: color-mix(in srgb, var(--pido-border) 90%, var(--pido-primary) 10%) !important;
    background: color-mix(in srgb, var(--pido-surface) 97%, var(--pido-primary) 3%) !important;
}

body.pido-theme .pido-builder-posts .pido-blog-card__media,
body.pido-theme .pido-builder-posts .pido-blog-card__media img,
body.pido-theme .pido-builder-posts .pido-blog-card__placeholder {
    width: 100%;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: 16 / 9;
}

body.pido-theme .pido-builder-posts .pido-blog-card__media {
    flex: 0 0 auto;
}

body.pido-theme .pido-builder-posts .pido-blog-card__media img {
    display: block;
    height: 100%;
    object-fit: cover;
}

body.pido-theme .pido-builder-posts .pido-blog-card__content {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: flex-start;
    gap: 10px;
    padding: 16px 17px;
}

body.pido-theme .pido-builder-posts .pido-blog-card__title,
body.pido-theme .pido-builder-posts .pido-blog-card__title a {
    display: -webkit-box !important;
    overflow: hidden !important;
    margin: 0 !important;
    color: color-mix(in srgb, var(--pido-text) 88%, var(--pido-text-muted) 12%) !important;
    font-size: .98rem;
    font-weight: var(--pido-font-weight-bold, 700);
    line-height: 1.8;
    white-space: normal !important;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
}

body.pido-theme .pido-builder-posts .pido-blog-card__excerpt {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: var(--pido-text-muted);
    font-size: .88rem;
    line-height: 1.9;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3 !important;
}

body.pido-theme .pido-builder-posts .pido-blog-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    order: initial;
    gap: 7px 10px;
    margin: auto 0 0;
    color: var(--pido-text-muted);
    font-size: .8rem;
}

.pido-builder-posts__empty {
    margin: 0;
    padding: 16px 18px;
    border: 1px solid var(--pido-border);
    border-radius: var(--pido-radius-card);
    background: var(--pido-surface-soft);
    color: var(--pido-text-muted);
    line-height: 1.9;
    text-align: center;
}

.pido-builder-posts__carousel {
    --pido-builder-cols-current: 4;
    position: relative;
    width: 100%;
    min-width: 0;
    direction: rtl;
}

.pido-builder-posts .pido-builder-products__viewport {
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    direction: rtl;
    scroll-behavior: smooth;
    scroll-snap-type: inline mandatory;
    scrollbar-width: none;
    overscroll-behavior-inline: contain;
    touch-action: pan-x pan-y;
}

.pido-builder-posts .pido-builder-products__viewport::-webkit-scrollbar {
    display: none;
}

.pido-builder-posts .pido-builder-products__viewport:focus-visible {
    outline: 2px solid var(--pido-primary);
    outline-offset: 5px;
    border-radius: var(--pido-radius-card);
}

.pido-builder-posts .pido-builder-products__track {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: 1fr;
    grid-auto-columns: calc(
        (100% - (var(--pido-builder-posts-gap) * (var(--pido-builder-cols-current) - 1)))
        / var(--pido-builder-cols-current)
    );
    gap: var(--pido-builder-posts-gap);
    width: 100%;
    min-width: 100%;
    align-items: stretch;
    direction: rtl;
}

.pido-builder-posts .pido-builder-products__track > .pido-builder-post-item {
    scroll-snap-align: none;
    scroll-snap-stop: normal;
}

.pido-builder-posts .pido-builder-products__track > .pido-builder-post-item.is-page-start {
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.pido-builder-posts .pido-builder-products__navigation {
    pointer-events: none;
}

.pido-builder-posts .pido-builder-products__nav {
    position: absolute;
    z-index: 3;
    top: var(--pido-builder-nav-y, 76%);
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(var(--pido-primary-rgb), .12);
    background: color-mix(in srgb, var(--pido-primary) 12%, var(--pido-surface) 88%);
    color: var(--pido-primary);
    box-shadow: none;
    -webkit-backdrop-filter: blur(10px) saturate(135%);
    backdrop-filter: blur(10px) saturate(135%);
    pointer-events: auto;
    transform: translateY(-50%);
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 28px;
    line-height: 1;
    transition: background-color .16s ease, color .16s ease, opacity .16s ease;
}

.pido-builder-posts .pido-builder-products__nav--prev {
    right: -12px;
}

.pido-builder-posts .pido-builder-products__nav--next {
    left: -12px;
}

.pido-builder-posts .pido-builder-products__nav:hover,
.pido-builder-posts .pido-builder-products__nav:focus-visible {
    background: rgba(var(--pido-primary-rgb), .18);
    background: color-mix(in srgb, var(--pido-primary) 18%, var(--pido-surface) 82%);
    color: var(--pido-primary);
}

.pido-builder-posts .pido-builder-products__nav:focus-visible {
    outline: 2px solid var(--pido-primary);
    outline-offset: 2px;
}

.pido-builder-posts .pido-builder-products__nav:disabled {
    opacity: .35;
    cursor: default;
}

.pido-builder-posts .pido-builder-products__pagination {
    display: flex;
    gap: 7px;
    align-items: center;
    justify-content: center;
    min-height: 16px;
    margin-block-start: 16px;
}

.pido-builder-posts .pido-builder-products__pagination:empty {
    display: none;
}

.pido-builder-posts .pido-builder-products__dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: color-mix(in srgb, var(--pido-text-muted) 32%, transparent);
    cursor: pointer;
    transition: width .16s ease, background-color .16s ease;
}

.pido-builder-posts .pido-builder-products__dot.is-active {
    width: 24px;
    background: var(--pido-primary);
}

.pido-builder-posts .pido-builder-products__dot:focus-visible {
    outline: 2px solid var(--pido-primary);
    outline-offset: 3px;
}

html[data-pido-theme="dark"] .pido-builder-posts .pido-builder-products__nav {
    background: rgba(var(--pido-primary-rgb), .16);
    background: color-mix(in srgb, var(--pido-primary) 16%, var(--pido-surface) 84%);
}

html[data-pido-theme="dark"] .pido-builder-posts .pido-builder-products__nav:hover,
html[data-pido-theme="dark"] .pido-builder-posts .pido-builder-products__nav:focus-visible {
    background: rgba(var(--pido-primary-rgb), .22);
    background: color-mix(in srgb, var(--pido-primary) 22%, var(--pido-surface) 78%);
}

@media (max-width: 1199.98px) {
    .pido-builder-posts__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .pido-builder-posts__carousel {
        --pido-builder-cols-current: 3;
    }
}

@media (max-width: 991.98px) {
    .pido-builder-posts__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pido-builder-posts__carousel {
        --pido-builder-cols-current: 2;
    }
}

@media (max-width: 575.98px) {
    .pido-builder-posts {
        --pido-builder-posts-gap: 16px;
    }

    .pido-builder-posts__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .pido-builder-posts__carousel {
        --pido-builder-cols-current: 1;
    }

    .pido-builder-posts .pido-builder-products__nav {
        width: 38px;
        height: 38px;
        font-size: 25px;
    }

    .pido-builder-posts .pido-builder-products__nav--prev {
        right: 4px;
    }

    .pido-builder-posts .pido-builder-products__nav--next {
        left: 4px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pido-builder-posts .pido-builder-products__viewport {
        scroll-behavior: auto;
    }

    .pido-builder-posts .pido-builder-products__dot {
        transition: none;
    }
}

/* PidoGame 1.8.53 — category chip and restored subtle blue hover. */
body.pido-theme .pido-builder-posts .pido-blog-card__category {
    background: rgba(var(--pido-primary-rgb), .1) !important;
    color: color-mix(in srgb, var(--pido-primary) 88%, #00658a 12%) !important;
}

html[data-pido-theme="dark"] body.pido-theme .pido-builder-posts .pido-blog-card__category {
    background: rgba(var(--pido-primary-rgb), .15) !important;
    color: #79d0ff !important;
}

body.pido-theme .pido-builder-posts .pido-builder-blog-card:hover {
    border-color: color-mix(in srgb, var(--pido-border) 94%, var(--pido-primary) 6%) !important;
    background: color-mix(in srgb, var(--pido-surface) 98.8%, var(--pido-primary) 1.2%) !important;
}

html[data-pido-theme="dark"] body.pido-theme .pido-builder-posts .pido-builder-blog-card:hover {
    border-color: color-mix(in srgb, var(--pido-border) 90%, var(--pido-primary) 10%) !important;
    background: color-mix(in srgb, var(--pido-surface) 97%, var(--pido-primary) 3%) !important;
}
