.palion-post-grid {
    --ppg-gap: 24px;
    --ppg-column-gap: var(--ppg-gap);
    --ppg-row-gap: var(--ppg-gap);
    --ppg-radius: 18px;
    --ppg-border: rgba(20, 24, 32, 0.12);
    --ppg-text: #111827;
    --ppg-title-color: var(--ppg-text);
    --ppg-muted: #5b6472;
    --ppg-bg: #ffffff;
    --ppg-soft: #f4f6f8;
    --ppg-accent: #111827;
    --ppg-button-bg: var(--ppg-accent);
    --ppg-button-text: #ffffff;
    --ppg-button-py: 10px;
    --ppg-button-px: 18px;
    --ppg-button-radius: 999px;
    --ppg-control-radius: 999px;
    --ppg-card-padding: 22px;
    --ppg-title-spacing: 10px;
    --ppg-excerpt-spacing: 18px;
    --ppg-meta-color: var(--ppg-muted);
    --ppg-meta-bg: var(--ppg-soft);
    --ppg-meta-spacing: 12px;
    --ppg-title-size: 22px;
    --ppg-excerpt-size: 15px;
    --ppg-image-ratio: 16 / 10;
    --ppg-image-height: auto;
    --ppg-image-radius: 0px;
    --ppg-card-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
    color: var(--ppg-text);
}

.palion-post-grid * {
    box-sizing: border-box;
}

.palion-post-grid__controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: var(--ppg-excerpt-spacing);
}

.palion-post-grid__search {
    flex: 1 1 260px;
}

.palion-post-grid__search input,
.palion-post-grid__order select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--ppg-border);
    border-radius: var(--ppg-control-radius);
    padding: 10px 16px;
    background: #fff;
    color: var(--ppg-text);
    font-size: 15px;
}

.palion-post-grid__order {
    flex: 0 1 190px;
}

.palion-post-grid__submit,
.palion-post-grid__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 1px solid var(--ppg-button-bg);
    border-radius: var(--ppg-button-radius);
    padding: var(--ppg-button-py) var(--ppg-button-px);
    background: var(--ppg-button-bg);
    color: var(--ppg-button-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.palion-post-grid__submit:hover,
.palion-post-grid__button:hover {
    color: var(--ppg-button-text);
    opacity: 0.86;
    transform: translateY(-1px);
}

.palion-post-grid__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 26px;
}

.palion-post-grid__filter {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 8px 14px;
    border: 1px solid var(--ppg-border);
    border-radius: var(--ppg-control-radius);
    background: var(--ppg-soft);
    color: var(--ppg-text);
    text-decoration: none;
    font-size: 14px;
    line-height: 1;
}

.palion-post-grid__filter:hover,
.palion-post-grid__filter.is-active {
    background: var(--ppg-accent);
    border-color: var(--ppg-accent);
    color: #fff;
}

.palion-post-grid__items {
    display: grid;
    grid-template-columns: repeat(var(--ppg-columns), minmax(0, 1fr));
    column-gap: var(--ppg-column-gap);
    row-gap: var(--ppg-row-gap);
}

.palion-post-grid__card {
    overflow: hidden;
    border: 1px solid var(--ppg-border);
    border-radius: var(--ppg-radius);
    background: var(--ppg-bg);
    box-shadow: var(--ppg-card-shadow);
}

.palion-post-grid__image {
    display: block;
    aspect-ratio: var(--ppg-image-ratio);
    height: var(--ppg-image-height);
    overflow: hidden;
    background: var(--ppg-soft);
    border-radius: var(--ppg-image-radius);
}

.palion-post-grid__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.palion-post-grid__card:hover .palion-post-grid__image img {
    transform: scale(1.035);
}

.palion-post-grid__content {
    padding: var(--ppg-card-padding);
}

.palion-post-grid__terms {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: var(--ppg-meta-spacing);
}

.palion-post-grid__terms span {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--ppg-meta-bg);
    color: var(--ppg-meta-color);
    font-size: 12px;
    line-height: 1;
}

.palion-post-grid__title {
    margin: 0 0 var(--ppg-title-spacing);
    font-size: var(--ppg-title-size);
    line-height: 1.2;
}

.palion-post-grid__title a {
    color: var(--ppg-title-color);
    text-decoration: none;
}

.palion-post-grid__title a:hover {
    text-decoration: underline;
}

.palion-post-grid__excerpt {
    margin-bottom: var(--ppg-excerpt-spacing);
    color: var(--ppg-muted);
    font-size: var(--ppg-excerpt-size);
    line-height: 1.55;
}

.palion-post-grid__pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 30px;
}

.palion-post-grid__pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--ppg-border);
    border-radius: var(--ppg-control-radius);
    color: var(--ppg-text);
    text-decoration: none;
}

.palion-post-grid__pagination a.is-active,
.palion-post-grid__pagination a:hover {
    background: var(--ppg-accent);
    border-color: var(--ppg-accent);
    color: #fff;
}

.palion-post-grid__empty {
    padding: 22px;
    border: 1px solid var(--ppg-border);
    border-radius: var(--ppg-radius);
    background: var(--ppg-meta-bg);
    color: var(--ppg-meta-color);
}

@media (max-width: 900px) {
    .palion-post-grid__items {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .palion-post-grid__items {
        grid-template-columns: 1fr;
    }

    .palion-post-grid__controls {
        display: grid;
        grid-template-columns: 1fr;
    }

    .palion-post-grid__order {
        flex-basis: auto;
    }
}
