/* cards.css - Article card component (used in mobile-related, listings) */

/* ── Article Card (article-card.php) ── */
.article-card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.article-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.card-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.card-thumb {
    aspect-ratio: 16 / 9;   /* = sorgente card-thumb 400x225: niente ri-taglio, rapporto costante (come /articoli) */
    background: var(--white);
    overflow: hidden;
    position: relative;
}

/* Copertina incastonata: immagine inset 6px, angoli 12px (stessa ricetta di /articoli; qui il badge sta nel corpo, niente tuck) */
.card-thumb img {
    position: absolute;
    top: 6px;
    left: 6px;
    width: calc(100% - 12px);
    height: calc(100% - 12px);
    object-fit: cover;
    border-radius: 12px;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* zoom hover rimosso 15 giu: l'immagine cresceva oltre i 6px inset e rompeva la cornice incastonata. Hover resta vivo via lift + shadow */

/* Placeholder copertina mancante (sistema A) — self-contained in cards.css: .ft-img-placeholder vive in categorie.css e NON e' caricato su tutti i single dove article-card rende (related mobile). Match visivo col placeholder del sistema B. */
.card-thumb--empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--gray-300);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: linear-gradient(145deg, var(--gray-100) 0%, var(--gray-200) 100%);
}

.card-thumb--empty svg {
    width: 40px;
    height: 40px;
    opacity: 0.4;
}

.card-body {
    padding: 14px 18px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.type-badge {
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.type-badge.t-rev { background: #dbeafe; color: #1e40af; }
.type-badge.t-gui { background: #dcfce7; color: #16a34a; }
.type-badge.t-conf { background: #e0e7ff; color: #4f46e5; }
.type-badge.t-con  { background: #e0e7ff; color: #4f46e5; }
.type-badge.t-news { background: #e0f2fe; color: #0369a1; }
.type-badge.t-new  { background: #e0f2fe; color: #0369a1; }
.type-badge.t-rum  { background: #fef3c7; color: #b45309; }
.type-badge.t-spec { background: #ccfbf1; color: #0f766e; }
.type-badge.t-pres { background: #ccfbf1; color: #0f766e; }
.type-badge.t-ras  { background: #f3e8ff; color: #6b21a8; }

.category-badge {
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--gray-400);
    background: var(--gray-50);
}

.card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: -0.01em;
    margin-bottom: 10px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.15s;
}

.article-card:hover .card-title {
    color: var(--blue-500);
}

.card-meta {
    display: flex;
    gap: 12px;
    color: var(--gray-400);
    font-size: 0.6875rem;
}

.card-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ── Card Score Ring ── */
.card-score {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    background: var(--white);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.card-score .score-ring-svg {
    width: 32px;
    height: 32px;
    display: block;
}

.card-score .score-value {
    font-size: 0.625rem;
    font-weight: 800;
    fill: var(--gray-900);
}

/* ── Badge (article-card-type) — homepage/listing variant ── */
.article-card-type {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    z-index: 2;
}

.article-card-type.t-rev { background: #dbeafe; color: #1e40af; }
.article-card-type.t-gui { background: #dcfce7; color: #16a34a; }
.article-card-type.t-conf { background: #e0e7ff; color: #4f46e5; }
.article-card-type.t-news { background: #e0f2fe; color: #0369a1; }
.article-card-type.t-spec { background: #ccfbf1; color: #0f766e; }
.article-card-type.t-ras { background: #f3e8ff; color: #6b21a8; }
