/* ==========================================================
   Shortcode Content - Khalaf (frontend)
   Colors follow Elementor global colors when available.
   ========================================================== */

.kh-post,
.kh-term-posts {
    --kh-accent: var(--e-global-color-accent, var(--e-global-color-primary, #d97706));
    --kh-border: rgba(0, 0, 0, 0.09);
    --kh-radius: 10px;
}

/* ---------- Term grid ---------- */

.kh-term-posts {
    display: grid;
    grid-template-columns: repeat(var(--kh-cols, 3), minmax(0, 1fr));
    gap: 24px;
    align-items: stretch;
}

.kh-term-post {
    display: flex;
    min-width: 0;
}

.kh-term-post > * {
    width: 100%;
}

/* ---------- Card ---------- */

.kh-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--kh-border, rgba(0, 0, 0, 0.09));
    border-radius: var(--kh-radius, 10px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.kh-card:hover {
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.kh-card__image {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f3f3f3;
}

.kh-card__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.kh-card:hover .kh-card__image img {
    transform: scale(1.04);
}

.kh-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
}

.kh-card__meta {
    font-size: 0.8em;
    opacity: 0.65;
}

.kh-card__title {
    margin: 0;
    font-size: 1.05em;
    line-height: 1.35;
}

.kh-card__title a {
    color: inherit;
    text-decoration: none;
}

.kh-card__title a:hover {
    color: var(--kh-accent, #d97706);
}

.kh-card__price {
    font-weight: 700;
    color: var(--kh-accent, #d97706);
}

.kh-card__excerpt {
    margin: 0;
    font-size: 0.92em;
    line-height: 1.6;
    opacity: 0.85;
}

.kh-card__footer {
    margin-top: auto;
    padding-top: 8px;
}

.kh-card__button,
.kh-card__footer .button {
    display: inline-block;
    padding: 9px 18px;
    font-size: 0.9em;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    color: #fff;
    background: var(--kh-accent, #d97706);
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.kh-card__button:hover,
.kh-card__footer .button:hover {
    color: #fff;
    opacity: 0.88;
}

/* ---------- List layout ---------- */

.kh-term-posts--list .kh-card {
    flex-direction: row;
}

.kh-term-posts--list .kh-card__image {
    flex: 0 0 280px;
    aspect-ratio: auto;
}

/* ---------- Full article ---------- */

.kh-post--full {
    margin-block: 0 2em;
}

.kh-post__image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--kh-radius, 10px);
}

.kh-post__title {
    margin: 0.7em 0 0.3em;
}

.kh-post__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35em 1.25em;
    margin-bottom: 1.2em;
    font-size: 0.9em;
    opacity: 0.75;
}

.kh-post__meta a {
    color: inherit;
}

.kh-post__content > :first-child {
    margin-top: 0;
}

.kh-post__content img {
    max-width: 100%;
    height: auto;
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
    .kh-term-posts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kh-term-posts--list {
        grid-template-columns: 1fr;
    }

    .kh-term-posts--list .kh-card {
        flex-direction: column;
    }

    .kh-term-posts--list .kh-card__image {
        flex-basis: auto;
        aspect-ratio: 4 / 3;
    }
}

@media (max-width: 480px) {
    .kh-term-posts {
        grid-template-columns: 1fr;
    }
}

/* ---------- Pagination (blog layout) ---------- */

.kh-pagination ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
}

.kh-pagination a,
.kh-pagination span {
    display: inline-block;
    padding: 6px 13px;
    color: inherit;
    text-decoration: none;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 6px;
}

.kh-pagination a:hover,
.kh-pagination .current {
    color: #fff;
    background: var(--e-global-color-accent, var(--e-global-color-primary, #d97706));
    border-color: var(--e-global-color-accent, var(--e-global-color-primary, #d97706));
}
