/*
 * Deal Grid (ROUTING experiment, 2026-06-16)
 * A /deals-grade affiliate rail for /best/* + blog listicle landers. Each card
 * is a distinct OPAQUE white surface (OPAQUE-BACKGROUND RULE, CLAUDE.md) with a
 * single prominent /out CTA so the surfaces route to the affiliate URL the way
 * /deals does, instead of leaking to the firm-research page.
 */

.deal-grid {
    margin: 22px 0 26px;
}

.deal-grid__head {
    margin-bottom: 14px;
}

.deal-grid__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: #1a1a2e;
}

.deal-grid__title i {
    color: #f59e0b;
    font-size: 1.2rem;
}

.deal-grid__subhead {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: #6b7280;
}

.deal-grid__cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 14px;
}

.deal-grid__card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px 16px 14px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.deal-grid__card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 26px rgba(245, 158, 11, 0.16);
    border-color: #fcd34d;
}

.deal-grid__badge {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
    padding: 6px 10px;
    border-radius: 10px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1a1a2e;
    font-size: 1.05rem;
    font-weight: 800;
}

.deal-grid__badge span {
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-top: 1px;
}

.deal-grid__firm {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 56px; /* clear the absolute badge */
}

.deal-grid__logo {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #eef0f4;
    flex: none;
}

.deal-grid__firm-text {
    min-width: 0;
}

.deal-grid__firm-name {
    display: block;
    font-weight: 700;
    color: #1a1a2e;
    font-size: 0.98rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.deal-grid__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 5px;
}

.deal-grid__chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-decoration: none;
}

.deal-grid__chip--grade {
    background: #eef2ff; /* bleed-ok: sits inside opaque card */
    color: #4338ca;
}

.deal-grid__chip--tp {
    background: #ecfdf5; /* bleed-ok: sits inside opaque card */
    color: #047857;
}

.deal-grid__chip--tp i {
    color: #00b67a;
}

.deal-grid__chip--tp:hover,
.deal-grid__chip--tp:focus-visible {
    background: #d1fae5;
    color: #065f46;
}

.deal-grid__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: auto;
}

.deal-grid__code {
    display: inline-flex;
    align-items: stretch;
    border-radius: 7px;
    overflow: hidden;
    border: 1px dashed #cbd5e1;
    font-size: 0.72rem;
    font-weight: 700;
}

.deal-grid__code-label {
    background: #f1f5f9; /* bleed-ok: sits inside opaque card */
    color: #64748b;
    padding: 3px 7px;
    letter-spacing: 0.05em;
}

.deal-grid__code-value {
    background: #fff7ed; /* bleed-ok: sits inside opaque card */
    color: #b45309;
    padding: 3px 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.deal-grid__from {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    color: #6b7280;
}

.deal-grid__from strong {
    color: #1a1a2e;
}

.deal-grid__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 11px 14px;
    border-radius: 11px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1a1a2e;
    font-weight: 800;
    font-size: 0.92rem;
    text-decoration: none;
    transition: filter 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.deal-grid__cta:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.32);
    color: #1a1a2e;
}

.deal-grid__cta:focus-visible {
    outline: 2px solid #b45309;
    outline-offset: 2px;
}

.deal-grid__cta i {
    font-size: 1.2rem;
}

@media (max-width: 575px) {
    .deal-grid__cards {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .deal-grid__card,
    .deal-grid__cta {
        transition: none;
    }
    .deal-grid__card:hover,
    .deal-grid__cta:hover {
        transform: none;
    }
}
