/* ==========================================================
   Newspaper Filter Pro – Front-end Styles v3
   ========================================================== */

/* ── Variables ──────────────────────────────────────────── */
.nfp-wrapper {
    --nfp-color:        #1a1a2e;
    --nfp-accent:       #e94560;
    --nfp-radius:       10px;
    --nfp-radius-sm:    6px;
    --nfp-gap:          20px;
    --nfp-transition:   0.25s ease;
    --nfp-shadow:       0 2px 8px rgba(0,0,0,.08);
    --nfp-shadow-hover: 0 8px 24px rgba(0,0,0,.14);
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}
.nfp-wrapper *, .nfp-wrapper *::before, .nfp-wrapper *::after {
    box-sizing: inherit;
}

/* ══════════════════════════════════════════════════════════
   FILTERS
   ══════════════════════════════════════════════════════════ */

/* ── Buttons ─────────────────────────────────────────────── */
.nfp-filters--buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
}
.nfp-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: 2px solid #e2e8f0;
    background: #fff;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--nfp-transition);
    line-height: 1.3;
    letter-spacing: .3px;
    color: #4b5563;
}
.nfp-btn:hover {
    border-color: var(--nfp-np-color, var(--nfp-color));
    color: var(--nfp-np-color, var(--nfp-color));
    background: color-mix(in srgb, var(--nfp-np-color, var(--nfp-color)) 6%, transparent);
}
.nfp-btn.active {
    background: var(--nfp-active-color, var(--nfp-np-color, var(--nfp-color)));
    border-color: var(--nfp-active-color, var(--nfp-np-color, var(--nfp-color)));
    color: #fff;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--nfp-active-color, var(--nfp-color)) 35%, transparent);
}
.nfp-btn-logo {
    width: 16px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
}

/* ── Tabs ───────────────────────────────────────────────── */
.nfp-filters--tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 28px;
}
.nfp-tab {
    padding: 11px 22px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: #6b7280;
    position: relative;
    transition: color var(--nfp-transition);
    letter-spacing: .3px;
}
.nfp-tab::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    border-radius: 3px 3px 0 0;
    transition: background var(--nfp-transition);
}
.nfp-tab:hover { color: #1a1a2e; }
.nfp-tab.active { color: var(--nfp-active-color, var(--nfp-color)); }
.nfp-tab.active::after { background: var(--nfp-active-color, var(--nfp-color)); }

/* ── Dropdown ───────────────────────────────────────────── */
.nfp-filters--dropdown { margin-bottom: 28px; }
.nfp-dropdown-filter {
    padding: 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: var(--nfp-radius-sm);
    font-size: 14px;
    font-weight: 500;
    min-width: 220px;
    background: #fff;
    cursor: pointer;
    transition: border-color var(--nfp-transition);
    color: #1a1a2e;
}
.nfp-dropdown-filter:focus {
    outline: none;
    border-color: var(--nfp-color);
}

/* ══════════════════════════════════════════════════════════
   POST CARD
   ══════════════════════════════════════════════════════════ */

.nfp-item {
    background: #fff;
    border-radius: var(--nfp-radius);
    overflow: hidden;
    box-shadow: var(--nfp-shadow);
    border: 1px solid rgba(0,0,0,.06);
    transition: box-shadow var(--nfp-transition), transform var(--nfp-transition);
    display: flex;
    flex-direction: column;
}
.nfp-item:hover {
    box-shadow: var(--nfp-shadow-hover);
    transform: translateY(-3px);
}

/* Thumbnail */
.nfp-thumb-link {
    display: block;
    overflow: hidden;
    position: relative;
    background: #f1f5f9;
}
.nfp-thumb {
    width: 100%;
    height: 210px; /* fallback – overridden by inline CSS from settings */
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}
.nfp-item:hover .nfp-thumb { transform: scale(1.05); }

/* ── Newspaper Badge – overlaid on image ──────────────── */
.nfp-badge-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px 4px 6px;
    border-radius: 20px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
    z-index: 2;
    line-height: 1;
}
.nfp-badge-logo {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,.4);
}

/* ── Badge for cards without thumbnail ──────────────────── */
.nfp-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px 4px 6px;
    border-radius: 20px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    line-height: 1;
}

/* Card Body */
.nfp-item-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.nfp-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.nfp-date {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 500;
    white-space: nowrap;
}

/* Title */
.nfp-title {
    margin: 0 0 10px;
    font-size: 16px;
    line-height: 1.5;
    font-weight: 700;
}
.nfp-title a {
    color: #1a1a2e;
    text-decoration: none;
    transition: color var(--nfp-transition);
}
.nfp-title a:hover { color: var(--nfp-np-color, var(--nfp-color)); }

/* Excerpt */
.nfp-excerpt {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 14px;
    line-height: 1.65;
    flex: 1;
}

/* Read More */
.nfp-read-more {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--nfp-np-color, var(--nfp-color));
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: .6px;
    transition: gap var(--nfp-transition);
    gap: 4px;
    margin-top: auto;
}
.nfp-read-more:hover { gap: 8px; }

/* ══════════════════════════════════════════════════════════
   LAYOUTS
   ══════════════════════════════════════════════════════════ */

/* Grid */
.nfp-layout-grid .nfp-results {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--nfp-gap);
}

/* List */
.nfp-layout-list .nfp-results {
    display: flex;
    flex-direction: column;
    gap: var(--nfp-gap);
}
.nfp-layout-list .nfp-item {
    flex-direction: row;
    max-height: 180px;
}
.nfp-layout-list .nfp-thumb-link {
    flex-shrink: 0;
    width: 220px;
}
.nfp-layout-list .nfp-thumb { height: 100%; min-height: 160px; }
.nfp-layout-list .nfp-item-body { padding: 18px 22px; }
.nfp-layout-list .nfp-title { font-size: 18px; }

/* Magazine */
.nfp-layout-magazine .nfp-results {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: auto;
    gap: var(--nfp-gap);
}
.nfp-layout-magazine .nfp-item:first-child {
    grid-column: 1 / 3;
}
.nfp-layout-magazine .nfp-item:first-child .nfp-thumb { height: 340px; }
.nfp-layout-magazine .nfp-item:first-child .nfp-title { font-size: 22px; }

/* ══════════════════════════════════════════════════════════
   LOADING STATE
   ══════════════════════════════════════════════════════════ */
.nfp-wrapper.nfp-loading .nfp-results {
    opacity: 0.45;
    pointer-events: none;
    position: relative;
}
.nfp-wrapper.nfp-loading .nfp-results::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.5) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'%3E%3Ccircle cx='25' cy='25' r='20' fill='none' stroke='%231a1a2e' stroke-width='4' stroke-linecap='round' stroke-dasharray='31.4 62.8'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 25 25' to='360 25 25' dur='.7s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") center / 44px no-repeat;
    border-radius: var(--nfp-radius);
}

/* ══════════════════════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════════════════════ */
@keyframes nfpFadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.nfp-fade-in { animation: nfpFadeUp 0.35s ease; }
.nfp-item-new { animation: nfpFadeUp 0.4s ease backwards; }

/* ══════════════════════════════════════════════════════════
   PAGINATION – LOAD MORE
   ══════════════════════════════════════════════════════════ */
.nfp-loadmore-wrap {
    text-align: center;
    margin-top: 32px;
}
.nfp-loadmore-btn {
    padding: 13px 40px;
    background: var(--nfp-color);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .5px;
    cursor: pointer;
    transition: background var(--nfp-transition), transform var(--nfp-transition), box-shadow var(--nfp-transition);
}
.nfp-loadmore-btn:hover:not(:disabled) {
    background: #16213e;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(26,26,46,.3);
}
.nfp-loadmore-btn:disabled { opacity: .5; cursor: default; }
.nfp-loadmore-done {
    background: #e5e7eb;
    color: #9ca3af;
}

/* ══════════════════════════════════════════════════════════
   PAGINATION – CLASSIC
   ══════════════════════════════════════════════════════════ */
.nfp-pagination-wrap {
    margin-top: 32px;
    display: flex;
    justify-content: center;
}
.nfp-pagination {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}
.nfp-page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 8px;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: var(--nfp-radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
    cursor: pointer;
    transition: all var(--nfp-transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.nfp-page-btn:hover {
    border-color: var(--nfp-color);
    color: var(--nfp-color);
    background: #f8faff;
}
.nfp-page-btn.nfp-page-current {
    background: var(--nfp-color);
    border-color: var(--nfp-color);
    color: #fff;
    cursor: default;
    box-shadow: 0 4px 10px rgba(26,26,46,.25);
}
.nfp-page-dots {
    font-size: 16px;
    color: #9ca3af;
    padding: 0 4px;
}
.nfp-page-prev, .nfp-page-next {
    font-size: 16px;
    font-weight: 700;
    min-width: 42px;
}

/* ══════════════════════════════════════════════════════════
   PAGINATION – INFINITE SCROLL
   ══════════════════════════════════════════════════════════ */
.nfp-infinite-sentinel { height: 1px; }
.nfp-infinite-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 28px;
    margin-top: 16px;
}
.nfp-infinite-loader span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--nfp-color);
    animation: nfpBounce 1.2s infinite ease-in-out both;
}
.nfp-infinite-loader span:nth-child(1) { animation-delay: -0.32s; }
.nfp-infinite-loader span:nth-child(2) { animation-delay: -0.16s; }
@keyframes nfpBounce {
    0%, 80%, 100% { transform: scale(0); opacity: .4; }
    40%           { transform: scale(1); opacity: 1; }
}

/* ══════════════════════════════════════════════════════════
   NO RESULTS
   ══════════════════════════════════════════════════════════ */
.nfp-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
    font-size: 16px;
}
.nfp-no-results::before {
    content: '🔍';
    display: block;
    font-size: 36px;
    margin-bottom: 12px;
}

/* ══════════════════════════════════════════════════════════
   RTL
   ══════════════════════════════════════════════════════════ */
[dir="rtl"] .nfp-filters--buttons,
[dir="rtl"] .nfp-filters--tabs,
body.rtl .nfp-filters--buttons,
body.rtl .nfp-filters--tabs { direction: rtl; }

[dir="rtl"] .nfp-layout-list .nfp-item,
body.rtl .nfp-layout-list .nfp-item { flex-direction: row-reverse; }

[dir="rtl"] .nfp-badge-overlay,
body.rtl .nfp-badge-overlay { left: auto; right: 12px; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .nfp-layout-grid .nfp-results,
    .nfp-layout-magazine .nfp-results { grid-template-columns: repeat(2, 1fr); }
    .nfp-layout-magazine .nfp-item:first-child { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
    .nfp-layout-grid .nfp-results,
    .nfp-layout-magazine .nfp-results { grid-template-columns: 1fr; }
    .nfp-layout-list .nfp-item { flex-direction: column; max-height: none; }
    .nfp-layout-list .nfp-thumb-link { width: 100%; }
    .nfp-layout-list .nfp-thumb { height: 210px; }
    .nfp-btn { padding: 7px 14px; font-size: 12px; }
    .nfp-tab { padding: 9px 14px; font-size: 13px; }
    .nfp-dropdown-filter { width: 100%; min-width: unset; }
    .nfp-pagination { gap: 4px; }
    .nfp-page-btn { min-width: 34px; height: 34px; font-size: 13px; }
}
