/* Nordpaa Filtered Grid — Frontend */

/* ---------- Layout: left filter ---------- */
.nfg-wrap {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    font-family: inherit;
}

.nfg-wrap.nfg-filter-left {
    flex-direction: row;
}

.nfg-wrap.nfg-filter-left .nfg-filter-nav {
    flex: 0 0 200px;
    position: sticky;
    top: var(--nfg-sticky-top, 80px);
}

.nfg-wrap.nfg-filter-left .nfg-content-wrap {
    flex: 1;
    min-width: 0;
}

/* ---------- Layout: top filter ---------- */
/* Moved after base styles so cascade + specificity both work */

/* ---------- Filter nav (left) ---------- */
.nfg-filter-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    border-right: 2px solid #eee;
}

.nfg-filter-nav li {
    margin: 0;
    padding: 0;
}

.nfg-filter-btn {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 12px 20px 12px 0;
    font-size: 15px;
    color: #444;
    cursor: pointer;
    line-height: 1.3;
    position: relative;
    transition: color 0.15s;
}

.nfg-filter-btn::after {
    content: '';
    position: absolute;
    right: -2px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--nfg-accent, #e63329);
    opacity: 0;
    transition: opacity 0.15s;
}

.nfg-filter-btn:hover {
    color: var(--nfg-accent, #e63329);
}

.nfg-filter-btn.active {
    font-weight: 700;
    color: #111;
}

.nfg-filter-btn.active::after {
    opacity: 1;
}

/* ---------- Grid ---------- */
.nfg-grid {
    display: grid;
    column-gap: var(--nfg-col-gap, 24px);
    row-gap: var(--nfg-row-gap, 24px);
    transition: opacity 0.2s;
}

.nfg-grid.nfg-loading {
    opacity: 0.4;
    pointer-events: none;
}

/* Equal height tiles — cards stretch to fill row height */
.nfg-equal-height .nfg-grid {
    align-items: stretch;
}

/* Natural height — cards only as tall as their content */
.nfg-wrap:not(.nfg-equal-height) .nfg-grid {
    align-items: start;
}

.nfg-cols-2 { grid-template-columns: repeat(2, 1fr); }
.nfg-cols-3 { grid-template-columns: repeat(3, 1fr); }
.nfg-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
    .nfg-cols-3,
    .nfg-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .nfg-wrap { flex-direction: column; }
    .nfg-filter-nav { width: 100%; position: static; }
    .nfg-wrap.nfg-filter-left .nfg-filter-nav { flex: unset; }
    .nfg-filter-nav ul { border-right: none; flex-direction: row; display: flex; flex-wrap: wrap; gap: 8px; }
    .nfg-filter-btn { width: auto; padding: 6px 14px; border: 1px solid #ddd; border-radius: 4px; }
    .nfg-filter-btn::after { display: none; }
    .nfg-cols-2,
    .nfg-cols-3,
    .nfg-cols-4 { grid-template-columns: 1fr; }
}

/* ---------- Card ---------- */
.nfg-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.nfg-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.1), 0 8px 28px rgba(0,0,0,.08);
}

.nfg-card-image {
    display: block;
    overflow: hidden;
    aspect-ratio: 16/10;
}

.nfg-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
    display: block;
}

.nfg-card:hover .nfg-card-image img {
    transform: scale(1.03);
}

.nfg-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.nfg-card-cats {
    font-size: var(--nfg-fs-cat, 13px);
    font-weight: 600;
    color: var(--nfg-accent, #e63329);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.nfg-card-title {
    font-size: var(--nfg-fs-title, 18px);
    font-weight: 700;
    margin: 0 0 10px;
    line-height: 1.3;
}

.nfg-card-title a {
    color: inherit;
    text-decoration: none;
}

.nfg-card-title a:hover {
    color: var(--nfg-accent, #e63329);
}

.nfg-card-excerpt {
    font-size: var(--nfg-fs-excerpt, 14px);
    color: #555;
    line-height: 1.6;
    margin: 0 0 16px;
    flex: 1;
}

.nfg-card-meta {
    font-size: 12px;
    color: #999;
    margin-bottom: 12px;
    display: flex;
    gap: 12px;
}

.nfg-read-more {
    display: inline-block;
    margin-top: auto;
    font-size: var(--nfg-fs-read-more, 14px);
    font-weight: 600;
    color: var(--nfg-accent, #e63329);
    text-decoration: none;
}

.nfg-read-more:hover {
    text-decoration: underline;
}

/* ---------- No results ---------- */
.nfg-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 15px;
}

/* ---------- Load more ---------- */
.nfg-pagination {
    text-align: center;
    margin-top: 32px;
}

.nfg-load-more {
    display: inline-block;
    padding: 12px 32px;
    border: 2px solid var(--nfg-accent, #e63329);
    border-radius: 6px;
    background: none;
    color: var(--nfg-accent, #e63329);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.nfg-load-more:hover {
    background: var(--nfg-accent, #e63329);
    color: #fff;
}

.nfg-load-more:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}


/* ---- Top filter overrides (placed after base to guarantee cascade) ---- */
.nfg-wrap.nfg-filter-top {
    flex-direction: column;
}

.nfg-wrap.nfg-filter-top .nfg-filter-nav {
    width: 100%;
}

.nfg-wrap.nfg-filter-top .nfg-filter-nav ul {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0 0 24px;
    border-right: none;
    border-bottom: none;
}

.nfg-wrap.nfg-filter-top .nfg-filter-nav li {
    flex: 0 0 auto;
    width: auto !important;
}

.nfg-wrap.nfg-filter-top .nfg-filter-btn {
    display: inline-block !important;
    width: auto !important;
    padding: 8px 20px;
    border-radius: 999px;
    border: 2px solid #e0e0e0;
    background: #fff;
    color: #444;
    text-align: center;
    white-space: nowrap;
    position: static;
    font-size: 14px;
}

.nfg-wrap.nfg-filter-top .nfg-filter-btn::after {
    display: none !important;
}

.nfg-wrap.nfg-filter-top .nfg-filter-btn.active {
    border-color: var(--nfg-accent, #e63329);
    background: var(--nfg-accent, #e63329);
    color: #fff;
    font-weight: 600;
}

.nfg-wrap.nfg-filter-top .nfg-filter-btn:hover:not(.active) {
    border-color: var(--nfg-accent, #e63329);
    color: var(--nfg-accent, #e63329);
    background: #fff;
}

/* ---------- Disabled links ---------- */
.nfg-card.nfg-no-link {
    cursor: default;
}

.nfg-card.nfg-no-link .nfg-card-image {
    cursor: default;
}

.nfg-card.nfg-no-link .nfg-card-title {
    cursor: default;
}

/* ---------- Icons ---------- */
.nfg-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nfg-icon svg,
.nfg-icon img {
    display: block;
}

/* Filter button with icon */
.nfg-filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nfg-filter-label {
    line-height: 1;
}

/* Card category with icon */
.nfg-cat-item-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.nfg-cat-sep {
    display: inline;
}
