/* ==========================================================
   BUYING GUIDES
========================================================== */

.guide-card-link:focus-visible {
    outline: 3px solid var(--color-brand-primary);
    outline-offset: -3px;
}

@media (prefers-reduced-motion: reduce) {
    .guide-card,
    .guide-image img,
    .guide-arrow {
        transition: none;
    }

    .guide-card:hover,
    .guide-card:hover img {
        transform: none;
    }
}

.buying-guides {
    background: #fff;
}

.buying-guides-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 0;
    align-items: stretch;
}

/* Editorial treatment: the first published guide reads as the primary
   feature, spanning two columns on wide layouts. Falls back to a plain
   grid item automatically when only one guide exists. */
.buying-guides-grid .guide-card:first-child {
    grid-column: span 2;
}

.buying-guides-grid .guide-card:first-child .guide-image {
    aspect-ratio: 21 / 9;
}

.buying-guides-grid .guide-card:first-child .guide-title {
    font-size: 26px;
}

.guide-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.guide-card:hover {
    transform: translateY(-6px);
    border-color: var(--color-brand-primary);
    box-shadow: var(--shadow-md);
}

.guide-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.guide-image {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #eef2ec;
}

.guide-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

.guide-card:hover .guide-image img {
    transform: scale(1.05);
}

.guide-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: var(--color-brand-primary);
    color: #fff;
    padding: 7px 13px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 700;
}

.guide-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 22px;
}

.guide-title {
    font-size: 18px;
    line-height: 1.35;
    margin-bottom: 10px;
}

.guide-excerpt {
    color: var(--color-text-light);
    line-height: 1.65;
    font-size: 14px;
}

.guide-footer {
    margin-top: auto;
    padding-top: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--color-border);
}

.guide-reading-time {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-light);
    font-size: 13px;
}

.guide-reading-time svg {
    width: 16px;
    height: 16px;
}

.guide-arrow {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #edf7e8;
    color: var(--color-brand-primary);
    transition: background .25s ease, color .25s ease;
}

.guide-arrow svg {
    width: 16px;
    height: 16px;
}

.guide-card:hover .guide-arrow {
    background: var(--color-brand-primary);
    color: #fff;
}

.buying-guides-footer {
    text-align: center;
}

.no-guides {
    grid-column: 1 / -1;
    padding: 40px 20px;
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    text-align: center;
    background: var(--color-background);
}

@media (max-width: 1024px) {
    .buying-guides-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .buying-guides-grid .guide-card:first-child {
        grid-column: span 2;
    }
}

@media (max-width: 767px) {
    .buying-guides-grid {
        grid-template-columns: 1fr;
    }

    .buying-guides-grid .guide-card:first-child {
        grid-column: auto;
    }

    .buying-guides-grid .guide-card:first-child .guide-image {
        aspect-ratio: 16 / 9;
    }

    .buying-guides-grid .guide-card:first-child .guide-title {
        font-size: 18px;
    }
}
