.smart-magazine-filter-widget {
    font-family: inherit;
}

.smfw-divider {
    height: 1px;
    background-color: rgba(191, 152, 72, 0.35);
    margin-bottom: 2rem;
    width: 100%;
}

.smfw-filters-nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.smfw-filter-btn {
    background: none;
    border: none;
    padding: 0.5rem 0;
    font-family: inherit;
    font-size: 1rem;
    color: #111111;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.smfw-filter-btn:hover {
    color: #BF9848;
}

.smfw-filter-btn.active {
    color: #BF9848;
    border-bottom-color: #BF9848;
}

/* Grid Layouts - Mobile First */
.smfw-posts-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr; /* Default mobile */
}

/* Tablet (usually >= 768px in Elementor, but relies on controls if possible. Fallback here) */
@media (min-width: 768px) {
    .smart-magazine-filter-widget.layout-t-row .smfw-post-card {
        flex-direction: row;
        gap: 1.5rem;
        align-items: flex-start;
    }
    .smart-magazine-filter-widget.layout-t-row .smfw-post-img-wrapper {
        flex: 0 0 40%;
        max-width: 40%;
        margin-bottom: 0;
    }
}

/* Desktop */
@media (min-width: 1025px) {
    .smart-magazine-filter-widget.layout-d-row .smfw-post-card {
        flex-direction: row;
        gap: 1.5rem;
        align-items: flex-start;
    }
    .smart-magazine-filter-widget.layout-d-row .smfw-post-img-wrapper {
        flex: 0 0 40%;
        max-width: 40%;
        margin-bottom: 0;
    }
}

/* Mobile specific safety */
@media (max-width: 767px) {
    .smart-magazine-filter-widget.layout-m-row .smfw-post-card {
        flex-direction: row;
        gap: 1rem;
    }
    .smart-magazine-filter-widget.layout-m-row .smfw-post-img-wrapper {
        flex: 0 0 35%;
        max-width: 35%;
        margin-bottom: 0;
    }
}

.smfw-post-card {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    background-color: transparent;
    transition: transform 0.3s ease;
    width: 100%;
}

.smfw-post-img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background-color: #F7F3EA;
    margin-bottom: 1.5rem;
}

.smfw-post-img, .smfw-post-img-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.smfw-post-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #BF9848;
    font-size: 1.25rem;
    font-weight: 500;
}

.smfw-post-label {
    background-color: #F7F3EA;
    color: #BF9848;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
}

/* Label Positions */
.smart-magazine-filter-widget.label-pos-top-left .smfw-post-label {
    position: absolute;
    top: 1rem;
    left: 1rem;
}
.smart-magazine-filter-widget.label-pos-top-right .smfw-post-label {
    position: absolute;
    top: 1rem;
    right: 1rem;
}
.smart-magazine-filter-widget.label-pos-above-title .smfw-post-label {
    position: relative;
    margin-bottom: 0.75rem;
}

.smfw-post-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.smfw-post-title {
    font-size: 1.25rem;
    margin: 0 0 0.75rem;
    color: #111111;
    transition: color 0.3s ease;
    word-wrap: break-word;
}

.smfw-post-date {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 0.75rem;
}

.smfw-post-excerpt {
    color: #6F6A61;
    font-size: 0.95rem;
    line-height: 1.6;
}

.smfw-loading {
    text-align: center;
    padding: 2rem;
}
.smfw-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 2px solid rgba(191, 152, 72, 0.35);
    border-top-color: #BF9848;
    border-radius: 50%;
    animation: smfw-spin 1s linear infinite;
}
@keyframes smfw-spin { to { transform: rotate(360deg); } }

.smfw-empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: #6F6A61;
    font-size: 1.1rem;
    background-color: #F7F3EA;
}

.smfw-actions {
    text-align: center;
    margin-top: 3rem;
}

.smfw-load-more {
    background-color: transparent;
    border: 1px solid #BF9848;
    color: #BF9848;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}
.smfw-load-more:hover {
    background-color: #BF9848;
    color: #fff;
}


/* AJAX Article View */
.smfw-view-article {
    width: 100%;
}
.smfw-back-btn {
    background: none;
    border: none;
    color: #111;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 2rem;
    padding: 0;
    transition: color 0.3s;
}
.smfw-back-btn:hover {
    color: #BF9848;
}
.smfw-ajax-article {
    background: transparent;
}
.smfw-ajax-img-wrapper {
    width: 100%;
    margin-bottom: 2rem;
}
.smfw-ajax-img {
    width: 100%;
    height: auto;
    object-fit: cover;
    max-height: 500px;
}
.smfw-ajax-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #111;
}
.smfw-ajax-title:focus {
    outline: none;
}
.smfw-ajax-body {
    line-height: 1.8;
    color: #333;
}
.smfw-ajax-body img {
    max-width: 100%;
    height: auto;
}