/**
 * Post / Taxonomy List Widget Styles
 *
 * Provides the structural (non-design) CSS. All colours, typography, spacing,
 * and sizing are controlled via Elementor panel controls.
 *
 * @package WTElementorWidgets\Widgets\PostTaxonomyList
 */

/* ============================================================
   Wrapper
   ============================================================ */

.wt-ptl-wrap {
    box-sizing: border-box;
    width: 100%;
}

/* ============================================================
   List Layout
   ============================================================ */

.wt-ptl-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   Grid Layout
   ============================================================ */

.wt-ptl-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* overridden by Elementor controls */
    gap: 24px;
}

/* ============================================================
   Item Card
   ============================================================ */

.wt-ptl-item {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.25s ease;
}

/* Inline variants (list + thumbnail left/right) */
.wt-ptl-item--inline {
    flex-direction: row;
    align-items: flex-start;
}

.wt-ptl-item--inline-right {
    flex-direction: row-reverse;
}

/* Clickable card overlay */
.wt-ptl-card-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    text-decoration: none;
}

/* Keep interactive elements above the card overlay */
.wt-ptl-item--linked .wt-ptl-title a,
.wt-ptl-item--linked .wt-ptl-btn {
    position: relative;
    z-index: 2;
}

/* ============================================================
   Thumbnail
   ============================================================ */

.wt-ptl-thumb {
    overflow: hidden;
    display: block;
    flex-shrink: 0;
    width: 100%;
    height: 200px;
    /* overridden by Elementor control */
}

.wt-ptl-thumb img.wt-ptl-thumb-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

/* Placeholder */
.wt-ptl-thumb-placeholder {
    background-color: #e8e8e8;
    opacity: 0.4;
}

/* Zoom on hover */
.wt-ptl-item--thumb-zoom:hover .wt-ptl-thumb img {
    transform: scale(1.05);
}

/* ============================================================
   Body
   ============================================================ */

.wt-ptl-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   Meta / Badge
   ============================================================ */

.wt-ptl-meta {
    margin-bottom: 6px;
    font-size: 0.8em;
}

.wt-ptl-count-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75em;
    font-weight: 600;
    background-color: #f0f0f0;
    color: #555;
}

/* ============================================================
   Title
   ============================================================ */

.wt-ptl-title {
    margin: 0 0 8px;
    line-height: 1.3;
}

.wt-ptl-title a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

.wt-ptl-title a:hover {
    text-decoration: underline;
}

/* ============================================================
   Excerpt / Description
   ============================================================ */

.wt-ptl-excerpt {
    margin: 0 0 12px;
    line-height: 1.6;
}

/* ============================================================
   Button
   ============================================================ */

.wt-ptl-btn {
    display: inline-block;
    margin-top: auto;
    padding: 8px 16px;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    line-height: 1.4;
    align-self: flex-start;
}

/* ============================================================
   No Results
   ============================================================ */

.wt-ptl-no-results {
    padding: 16px;
    text-align: center;
    color: #888;
}

/* ============================================================
   Menu Layout
   ============================================================ */

.wt-ptl-menu {
    display: flex;
    flex-direction: row;
    gap: 16px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.wt-ptl-menu .wt-ptl-menu-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    padding: 4px 0px !important;
    transition: all 0.2s ease !important;
    cursor: pointer;
}

/* Menu link styles */
.wt-ptl-menu-item--text {
    background: transparent;
    border: none;
    padding: 4px 0;
}

.wt-ptl-menu-item--text:hover {
    text-decoration: underline;
}

.wt-ptl-menu-item--button {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 16px;
}

.wt-ptl-menu-item--button:hover {
    background-color: #e0e0e0;
}

.wt-ptl-menu-item--badge {
    background-color: #f0f0f0;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.9em;
}

.wt-ptl-menu-item--badge:hover {
    background-color: #e0e0e0;
}

.wt-ptl-menu-item--underline {
    border-bottom: 2px solid transparent;
    padding-bottom: 4px;
    transition: border-color 0.2s ease;
}

.wt-ptl-menu-item--underline:hover {
    border-bottom-color: currentColor;
}

.wt-ptl-menu-item-label {
    white-space: nowrap;
}

.wt-ptl-menu-item-count {
    display: inline-block;
    padding: 2px 6px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: 600;
    line-height: 1;
}

/* ============================================================
   Responsive defaults (override via Elementor responsive controls)
   ============================================================ */

@media (max-width: 1024px) {
    .wt-ptl-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .wt-ptl-grid {
        grid-template-columns: 1fr;
    }

    .wt-ptl-item--inline,
    .wt-ptl-item--inline-right {
        flex-direction: column;
    }

    .wt-ptl-item--inline .wt-ptl-thumb,
    .wt-ptl-item--inline-right .wt-ptl-thumb {
        width: 100%;
    }

    .wt-ptl-menu {
        flex-wrap: wrap;
    }
}