/* ─── BraveWords Feed Widget ─────────────────────────────────────── */

.bwf-feed-wrapper {
    font-family: inherit;
    width: 100%;
}

.bwf-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #aaa;
}

.bwf-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(200,0,0,.2);
    border-top-color: #cc0000;
    border-radius: 50%;
    animation: bwf-spin .8s linear infinite;
    margin-bottom: 12px;
}

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

.bwf-error {
    padding: 20px;
    background: #2a0000;
    border-left: 4px solid #cc0000;
    color: #ffaaaa;
    border-radius: 4px;
}

/* ─── Grid ───────────────────────────────────────────────────────── */
.bwf-grid {
    display: grid;
    gap: 20px;
}
.bwf-grid.bwf-cols-2 { grid-template-columns: repeat(2, 1fr); }
.bwf-grid.bwf-cols-3 { grid-template-columns: repeat(3, 1fr); }
.bwf-grid.bwf-cols-4 { grid-template-columns: repeat(4, 1fr); }

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

/* ─── List ───────────────────────────────────────────────────────── */
.bwf-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.bwf-list .bwf-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}
.bwf-list .bwf-card-image {
    width: 200px;
    min-width: 200px;
    height: auto !important;
    min-height: 140px;
    border-radius: 8px 0 0 8px;
}
.bwf-list .bwf-card-body {
    flex: 1;
    border-radius: 0 8px 8px 0;
}
@media (max-width: 600px) {
    .bwf-list .bwf-card { flex-direction: column; }
    .bwf-list .bwf-card-image { width: 100%; min-width: 0; height: 180px !important; border-radius: 8px 8px 0 0; }
    .bwf-list .bwf-card-body { border-radius: 0 0 8px 8px; }
}

/* ─── Card ───────────────────────────────────────────────────────── */
.bwf-card {
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .2s ease, box-shadow .2s ease;
    text-decoration: none;
}
.bwf-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.5);
}

/* Image */
.bwf-card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    background: #111;
}
.bwf-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}
.bwf-card:hover .bwf-card-image img { transform: scale(1.04); }

.bwf-no-image {
    background: #1a0000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bwf-pending {
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.bwf-img-loading {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%);
    background-size: 200% 100%;
    animation: bwf-shimmer 1.4s infinite;
}
@keyframes bwf-shimmer { to { background-position: -200% 0; } }

.bwf-no-image-icon {
    font-size: 40px;
    opacity: 0.4;
}

/* ─── Card body — centred by default ────────────────────────────── */
.bwf-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    background: inherit;
    text-align: center;
}

/* Categories */
.bwf-card-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    justify-content: center;
    width: 100%;
}
.bwf-category-tag {
    display: inline-block;
    background: #cc0000;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 2px 8px;
    border-radius: 3px;
    white-space: nowrap;
}

/* Title */
.bwf-card-title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    width: 100%;
    text-align: center;
}
.bwf-card-title a {
    color: #ffffff;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bwf-card-title a:hover {
    color: #ff4444;
    text-decoration: underline;
}

/* Date */
.bwf-card-date {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
    width: 100%;
    text-align: center;
}

/* Excerpt */
.bwf-card-excerpt {
    font-size: 13px;
    color: #aaa;
    line-height: 1.55;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    width: 100%;
    text-align: center;
}

/* ─── Pagination ─────────────────────────────────────────────────── */
.bwf-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
    flex-wrap: wrap;
}
.bwf-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background: #1a1a1a;
    color: #ccc;
    border: 1px solid #333;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background .15s, color .15s, border-color .15s;
    user-select: none;
}
.bwf-page-btn:hover:not(:disabled) { background: #cc0000; color: #fff; border-color: #cc0000; }
.bwf-page-btn.bwf-active { background: #cc0000; color: #fff; border-color: #cc0000; cursor: default; }
.bwf-page-btn:disabled { opacity: .4; cursor: not-allowed; }
