/* ===== BullionEngine Homepage Widget ===== */

.be-hw-section {
    background: #0D0D0D;
    padding: 60px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-sizing: border-box;
}

.be-hw-container {
    max-width: 1100px;
    margin: 0 auto;
}

/* ── Header ─────────────────────────────────────────────────── */

.be-hw-header {
    margin-bottom: 30px;
}

.be-hw-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    color: #D4A84F;
    text-align: center;
    margin: 0 0 8px;
}

.be-hw-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #FFFFFF;
    text-align: center;
    margin: 0 0 12px;
}

.be-hw-title-link {
    color: inherit;
    text-decoration: none;
}

.be-hw-title-link:hover {
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.4);
    text-underline-offset: 4px;
}

.be-hw-subtitle {
    font-size: 0.95rem;
    color: #AAAAAA;
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ── Search Bar ──────────────────────────────────────────────── */

.be-hw-search-wrap {
    max-width: 700px;
    margin: 0 auto 10px;
}

.be-hw-search-bar {
    display: flex;
    align-items: center;
    background: #1E1E1E;
    border: 1px solid #D4A84F;
    border-radius: 30px;
    padding: 6px 6px 6px 24px;
    gap: 10px;
}

.be-hw-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #FFFFFF;
    font-size: 0.95rem;
    padding: 10px 0;
    min-width: 0;
    caret-color: #D4A84F;
}

.be-hw-search-input::placeholder {
    color: #888888;
}

.be-hw-search-btn {
    background: #D4A84F;
    border: 1px solid #D4A84F;
    border-radius: 24px;
    color: #0D0D0D;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 24px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.be-hw-search-btn:hover {
    background: #c49640;
    border-color: #c49640;
}

/* ── Clear link ─────────────────────────────────────────────── */

.be-hw-clear {
    text-align: center;
    margin-bottom: 6px;
}

.be-hw-clear a {
    font-size: 0.8rem;
    color: #888888;
    text-decoration: none;
    cursor: pointer;
}

.be-hw-clear a:hover {
    color: #D4A84F;
}

.be-hw-clear.hidden {
    display: none;
}

/* ── Search state indicator ─────────────────────────────────── */

.be-hw-search-state {
    text-align: center;
    font-size: 0.85rem;
    color: #888888;
    margin: 0 0 10px;
    font-style: italic;
}

.be-hw-search-state.hidden {
    display: none;
}

/* ── Card Grid ──────────────────────────────────────────────── */

.be-hw-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 30px;
    transition: opacity 0.2s ease;
}

.be-hw-grid.fading {
    opacity: 0;
}

.be-hw-grid.visible {
    opacity: 1;
}

/* ── Cards ──────────────────────────────────────────────────── */

.be-hw-card {
    display: block;
    background: #1A1A1A;
    border: 1px solid #2A2A2A;
    border-radius: 6px;
    padding: 12px 16px;
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.be-hw-card:hover {
    border-color: #D4A84F;
    box-shadow: 0 4px 16px rgba(212, 168, 79, 0.12);
    transform: translateY(-2px);
}

.be-hw-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.be-hw-card-category {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #D4A84F;
}

.be-hw-badge {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #D4A84F;
    color: #0D0D0D;
    padding: 3px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.be-hw-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #FFFFFF;
    margin: 0;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.be-hw-card:hover .be-hw-card-title {
    color: #D4A84F;
}

/* ── No results ─────────────────────────────────────────────── */

.be-hw-no-results {
    grid-column: 1 / -1;
    text-align: center;
    color: #888888;
    font-size: 0.95rem;
    padding: 40px 20px;
}

/* ── Responsive: tablet ─────────────────────────────────────── */

@media (max-width: 900px) {
    .be-hw-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── Responsive: mobile ─────────────────────────────────────── */

@media (max-width: 600px) {
    .be-hw-section {
        padding: 40px 16px;
    }

    .be-hw-title {
        font-size: 1.8rem;
    }

    .be-hw-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .be-hw-search-bar {
        flex-direction: column;
        align-items: stretch;
        border-radius: 16px;
        padding: 12px 16px;
        gap: 8px;
    }

    .be-hw-search-input {
        /* Reset flex:1 (flex-basis:0%) which collapses input height in column direction */
        flex: 0 0 auto;
        width: 100%;
        padding: 8px 0;
        font-size: 0.88rem;
        min-height: 40px;
        box-sizing: border-box;
    }

    /* Match the 2-class specificity of the offending rule that sets position:absolute */
    .be-hw-search-wrap .be-hw-search-btn {
        position: static !important;
    }

    .be-hw-search-btn {
        width: 100%;
        flex-shrink: 0;
        padding: 12px 16px;
        font-size: 0.85rem;
        border-radius: 10px;
        text-align: center;
    }
}
