/* =============================================
   Post Filter — post-filter.css
   ============================================= */

.aws-pf-wrap {
    position: relative;
    width: 100%;
    --aws-pf-accent: #000000;
    --aws-pf-accent-text: #ffffff;
    --aws-pf-panel-bg: #ffffff;
    --aws-pf-text: #333333;
}

/* ---------- FAB (mobile only) ---------- */
.aws-pf-fab {
    display: none;
    position: fixed;
    bottom: 75px;
    right: 28px;
    z-index: 9990;
    background: var(--aws-pf-accent, #000000);
    color: var(--aws-pf-accent-text, #ffffff);
    border: none;
    border-radius: 100px;
    padding: 14px 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0,0,0,0.35);
    white-space: nowrap;
    line-height: 1.2;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.aws-pf-fab:hover  { transform: scale(1.05); box-shadow: 0 6px 24px rgba(0,0,0,0.45); }
.aws-pf-fab:active { transform: scale(0.97); }

/* ---------- Overlay ---------- */
.aws-pf-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,0.45);
    opacity: 0;
    transition: opacity 0.25s ease;
}
.aws-pf-overlay.aws-pf-overlay--visible { opacity: 1; }

/* ---------- Panel ---------- */
.aws-pf-panel {
    background: var(--aws-pf-panel-bg, #ffffff);
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.aws-pf-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #e5e5e5;
    position: sticky;
    top: 0;
    background: var(--aws-pf-panel-bg, #ffffff);
    z-index: 1;
}

.aws-pf-panel__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--aws-pf-text, #333333);
}

.aws-pf-panel__close {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #555;
    padding: 0 4px;
    transition: color 0.15s;
}
.aws-pf-panel__close:hover { color: var(--aws-pf-accent, #000000); }

/* ---------- Form ---------- */
.aws-pf-form {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    flex: 1;
}

.aws-pf-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.aws-pf-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--aws-pf-text, #333333);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ---------- Checkboxes ---------- */
.aws-pf-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
}

.aws-pf-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #444;
    user-select: none;
}

.aws-pf-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--aws-pf-accent, #000000);
    cursor: pointer;
    flex-shrink: 0;
}

.aws-pf-checkbox span { line-height: 1.4; }

/* ---------- Select ---------- */
.aws-pf-select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background: #fff;
    cursor: pointer;
}
.aws-pf-select:focus { outline: 2px solid var(--aws-pf-accent, #000000); outline-offset: 1px; }

/* ---------- Actions ---------- */
.aws-pf-actions {
    display: flex;
    gap: 10px;
    padding-top: 4px;
}

.aws-pf-btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid var(--aws-pf-accent, #000000);
    transition: background 0.15s, color 0.15s;
}

.aws-pf-btn--reset          { background: #fff; color: var(--aws-pf-accent, #000000); }
.aws-pf-btn--reset:hover    { background: #f0f0f0; }
.aws-pf-btn--apply          { background: var(--aws-pf-accent, #000000); color: var(--aws-pf-accent-text, #ffffff); }
.aws-pf-btn--apply:hover    { opacity: 0.85; }

/* ---------- Bar ---------- */
.aws-pf-bar { display: flex; align-items: center; margin-bottom: 20px; }
.aws-pf-bar__count { font-size: 14px; color: #666; }

/* ---------- Loading ---------- */
.aws-pf-loading[hidden] { display: none !important; }

.aws-pf-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.aws-pf-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--aws-pf-accent, #000000);
    border-radius: 50%;
    animation: aws-pf-spin 0.7s linear infinite;
}

@keyframes aws-pf-spin { to { transform: rotate(360deg); } }

/* ---------- Grid ---------- */
.aws-pf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
}

/* ---------- Card ---------- */
.aws-pf-card {
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.aws-pf-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.1); transform: translateY(-2px); }

.aws-pf-card__thumb {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #f5f5f5;
}

.aws-pf-card__image {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.aws-pf-card:hover .aws-pf-card__image { transform: scale(1.04); }

.aws-pf-card__body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.aws-pf-card__cats {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #888;
}

.aws-pf-card__title { font-size: 17px; font-weight: 700; line-height: 1.35; margin: 0; }
.aws-pf-card__title a { color: #111; text-decoration: none; }
.aws-pf-card__title a:hover { text-decoration: underline; }
.aws-pf-card__date { font-size: 12px; color: #aaa; }
.aws-pf-card__excerpt { font-size: 14px; color: #555; line-height: 1.55; margin: 0; flex: 1; }
.aws-pf-card__link { font-size: 13px; font-weight: 600; color: var(--aws-pf-accent, #000000); text-decoration: none; margin-top: 4px; align-self: flex-start; }
.aws-pf-card__link:hover { text-decoration: underline; }

/* ---------- Empty ---------- */
.aws-pf-empty { text-align: center; padding: 60px 20px; color: #777; }
.aws-pf-empty p { margin-bottom: 16px; font-size: 16px; }

/* ---------- Pagination ---------- */
.aws-pf-pag { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 36px; }

.aws-pf-pag__btn {
    min-width: 38px; height: 38px; padding: 0 10px;
    border: 1px solid #ddd; border-radius: 6px;
    background: #fff; font-size: 14px; cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.aws-pf-pag__btn:hover         { background: #f0f0f0; border-color: #bbb; }
.aws-pf-pag__btn--active       { background: var(--aws-pf-accent, #000000); color: var(--aws-pf-accent-text, #ffffff); border-color: var(--aws-pf-accent, #000000); }

/* =============================================
   DESKTOP ≥ 768px — pannello sempre visibile
   ============================================= */
@media (min-width: 768px) {
    .aws-pf-wrap {
        display: grid;
        grid-template-columns: 280px 1fr;
        gap: 32px;
        align-items: start;
    }

    .aws-pf-fab,
    .aws-pf-overlay { display: none !important; }

    .aws-pf-panel {
        position: sticky;
        top: 24px;
        max-height: calc(100vh - 48px);
    }

    .aws-pf-results-wrap { min-width: 0; }
}

/* =============================================
   MOBILE < 768px — FAB + slide panel
   ============================================= */
@media (max-width: 767px) {
    .aws-pf-wrap { display: block; }

    .aws-pf-fab {
        display: flex;
        align-items: center;
        justify-content: center;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }

    .aws-pf-fab:hover  { transform: translateX(-50%) scale(1.05); }
    .aws-pf-fab:active { transform: translateX(-50%) scale(0.97); }

    .aws-pf-panel {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: min(340px, 92vw);
        border-radius: 0;
        border: none;
        border-right: 1px solid #e5e5e5;
        box-shadow: 4px 0 30px rgba(0,0,0,0.18);
        transform: translateX(-110%);
        transition: transform 0.3s ease;
        z-index: 100000;
    }

    .aws-pf-panel.aws-pf-panel--open { transform: translateX(0); }
    .aws-pf-panel__close             { display: block; }

    .aws-pf-grid { grid-template-columns: 1fr; }
}
