/**
 * WT Post / Taxonomy Browser – Widget Styles
 *
 * BEM: .wt-ptb (wrapper) > .wt-ptb__grid/.wt-ptb__list > .wt-ptb__item
 *
 * Elementor handles all typography / color overrides via its selectors.
 * This file only provides structural layout and sensible defaults.
 *
 * @package WTElementorWidgets
 * @since   1.0.0
 */

/* ── Shared wrapper ─────────────────────────────────────────────────────── */

.wt-ptb {
    --ptb-gap: 24px;
    --ptb-radius: 8px;
    --ptb-thumb-height: 200px;
    --ptb-btn-bg: #1d4ed8;
    --ptb-btn-color: #fff;
    --ptb-btn-radius: 4px;
    --ptb-lm-bg: #1d4ed8;
    --ptb-lm-color: #fff;
    --ptb-lm-radius: 4px;

    width: 100%;
}

/* ── Grid layout ────────────────────────────────────────────────────────── */

.wt-ptb__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--ptb-gap);
    width: 100%;
}

@media (max-width: 1024px) {
    .wt-ptb__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .wt-ptb__grid {
        grid-template-columns: 1fr;
    }
}

/* ── List layout ────────────────────────────────────────────────────────── */

.wt-ptb__list {
    display: flex;
    flex-direction: column;
    row-gap: var(--ptb-gap);
    width: 100%;
}

.wt-ptb--list .wt-ptb__item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
}

.wt-ptb--list .wt-ptb__item-thumbnail {
    flex: 0 0 180px;
    height: auto;
}

.wt-ptb--list .wt-ptb__item-thumbnail img {
    width: 100%;
    height: 130px;
    object-fit: cover;
}

@media (max-width: 600px) {
    .wt-ptb--list .wt-ptb__item {
        flex-direction: column;
    }

    .wt-ptb--list .wt-ptb__item-thumbnail {
        flex: none;
        width: 100%;
    }
}

/* ── Item / Card ────────────────────────────────────────────────────────── */

.wt-ptb__item {
    background: #fff;
    border-radius: var(--ptb-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

/* Lift-on-hover modifier (toggled by Elementor prefix_class). */
.wt-ptb--lift-yes .wt-ptb__item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

/* ── Thumbnail ──────────────────────────────────────────────────────────── */

.wt-ptb__item-thumbnail {
    width: 100%;
    height: var(--ptb-thumb-height);
    overflow: hidden;
    flex-shrink: 0;
}

.wt-ptb__item-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.wt-ptb__item:hover .wt-ptb__item-thumbnail img {
    transform: scale(1.04);
}

/* ── Body ───────────────────────────────────────────────────────────────── */

.wt-ptb__item-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 10px;
}

/* ── Meta ───────────────────────────────────────────────────────────────── */

.wt-ptb__item-meta {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Title ──────────────────────────────────────────────────────────────── */

.wt-ptb__item-title {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.4;
}

.wt-ptb__item-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.wt-ptb__item-title a:hover {
    text-decoration: underline;
}

/* ── Excerpt ────────────────────────────────────────────────────────────── */

.wt-ptb__item-excerpt {
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.6;
    flex: 1;
}

/* ── Read More button ───────────────────────────────────────────────────── */

.wt-ptb__item-btn {
    display: inline-block;
    align-self: flex-start;
    margin-top: auto;
    padding: 8px 20px;
    background-color: var(--ptb-btn-bg);
    color: var(--ptb-btn-color);
    border-radius: var(--ptb-btn-radius);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.wt-ptb__item-btn:hover {
    opacity: 0.88;
}

/* ── Empty state ────────────────────────────────────────────────────────── */

.wt-ptb__empty {
    color: #6b7280;
    font-style: italic;
}

/* ── Load More ──────────────────────────────────────────────────────────── */

.wt-ptb__load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 36px;
}

.wt-ptb__load-more-btn {
    display: inline-block;
    padding: 12px 36px;
    background-color: var(--ptb-lm-bg);
    color: var(--ptb-lm-color);
    border: none;
    border-radius: var(--ptb-lm-radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.wt-ptb__load-more-btn:hover {
    opacity: 0.88;
}

.wt-ptb__load-more-btn:disabled,
.wt-ptb__load-more-btn.is-loading {
    cursor: not-allowed;
    opacity: 0.65;
}

.wt-ptb__no-more {
    color: #6b7280;
    font-size: 0.9rem;
    font-style: italic;
    margin: 0;
}

@media (max-width: 767px) {
    .wt-ptb__item-body {
        padding: 12px;
    }
}

@media (max-width: 576px) {
    .wt-ptb__item-body {
        padding: 12px;
    }
}