/* article.css - Layout e componenti condivisi pagina articolo */

/* =============================================
   PAGE GRID LAYOUT
============================================= */
.page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
}

.main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 88px;
    height: fit-content;
}

.sidebar-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.sidebar-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 20px;
}

/* =============================================
   HERO
============================================= */
.hero {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.hero-visual {
    height: 380px;
    background: var(--hero-light);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 100% 60% at 50% -10%, rgba(255,255,255,0.9) 0%, transparent 60%);
    pointer-events: none;
}

.hero-visual::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top, var(--white), transparent);
    pointer-events: none;
}

.hero-product-img {
    position: absolute;
    top: 10px;
    left: 10px;
    width: calc(100% - 20px);   /* bezel sottile UNIFORME su tutti e 4 i lati */
    height: calc(100% - 20px);
    object-fit: cover;          /* la copertina riempie il riquadro incastonato */
    border-radius: 16px;
    box-shadow: none;           /* niente ombra: l'ombra in basso creava una "linea" verso il titolo (deciso 14 giu) */
    z-index: 1;
}

/* Con copertina: la cornice (fondo banner) diventa bianca; senza foto resta il colore del tipo */
.hero-visual.has-hero-img {
    background: var(--white);
}

.article-type-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    z-index: 2;
}

.hero-content {
    padding: 32px 40px 40px;
}

.hero-category {
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-400);
    margin-bottom: 8px;
}

.hero-title {
    font-family: 'Inter', sans-serif;
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.035em;
    color: var(--gray-900);
    margin-bottom: 16px;
    max-width: 600px;
}

.hero-excerpt {
    font-size: 1.0625rem;
    color: var(--gray-500);
    line-height: 1.6;
    margin-bottom: 16px;
    max-width: 560px;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    font-size: 0.875rem;
    color: var(--gray-500);
}

.hero-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-icon {
    width: 16px;
    height: 16px;
    fill: var(--gray-400);
    flex-shrink: 0;
}

/* Credito copertina (techzone_image_credit / inc/image-credit.php) — ultimo elemento della riga meta dell'hero (M1, 16 giu): eredita lo stile di .hero-meta span */
.hero-image-credit a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s ease;
}

.hero-image-credit a:hover {
    color: var(--gray-600);
}

/* =============================================
   AFFILIATE DISCLAIMER
============================================= */
.affiliate-disclaimer {
    font-size: 0.6875rem;
    color: var(--gray-400);
    text-align: center;
    line-height: 1.5;
    padding: 0 16px;
}

.affiliate-disclaimer a {
    color: var(--gray-500);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.affiliate-disclaimer a:hover {
    color: var(--gray-700);
}

/* =============================================
   CARD & PROSE (sezioni articolo)
============================================= */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.card-header-icon {
    width: 36px;
    height: 36px;
    background: var(--gray-50);
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.card-header-icon svg {
    width: 20px;
    height: 20px;
}

.card-header-icon,
.nl-icon {
    color: var(--page-accent);
}

.card-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--gray-900);
}

.prose {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--gray-600);
}

.prose p {
    margin-bottom: 16px;
}

.prose p:last-child {
    margin-bottom: 0;
}

.prose .data {
    font-weight: 700;
    color: var(--gray-900);
    font-variant-numeric: tabular-nums;
}

.prose strong {
    color: var(--gray-800);
    font-weight: 600;
}

.prose h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 28px 0 12px;
}

.prose h3:first-child {
    margin-top: 0;
}

.prose-img-placeholder {
    width: 100%;
    height: 220px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
    border: 1px dashed var(--gray-200);
}

.prose-img-placeholder span {
    font-size: 0.8125rem;
    color: var(--gray-400);
}

/* =============================================
   ARTICLE CONTENT (fallback from the_content)
============================================= */
.article-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.article-content h2 {
    font-family: 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--gray-900);
    margin-bottom: 16px;
    padding-top: 8px;
}

.article-content h2:first-child {
    padding-top: 0;
}

.article-content p {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--gray-600);
    margin-bottom: 16px;
}

.article-content p:last-child {
    margin-bottom: 0;
}

.article-content strong {
    color: var(--gray-800);
    font-weight: 600;
}

/* =============================================
   RELATED ITEMS (sidebar)
============================================= */
.related-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 12px;
    margin: 0 -12px;
    text-decoration: none;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.15s ease;
    border-radius: var(--radius-sm);
}

.related-item:first-child {
    padding-top: 0;
}

.related-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.related-item:hover {
    background: var(--gray-50);
}

.related-item:hover .related-title {
    color: var(--page-accent);
}

.related-thumb {
    width: 96px;
    height: 68px;
    background: var(--gray-50);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    overflow: hidden;   /* clip la copertina agli angoli arrotondati + cornice. Altezza 68px (non 16:9): bilancia col blocco titolo+meta, ritaglio minimo */
}

/* Copertina reale dentro la thumb: riempie il box 52px, ritagliata. Piatta (niente cornice a questa misura). Vale su tutti i single-* (article.css caricato ovunque). Se manca la copertina -> box grigio (fallback). */
.related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.related-info {
    flex: 1;
    min-width: 0;
}

.related-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.35;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.15s ease;
}

.related-meta {
    font-size: 0.75rem;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    gap: 6px;
}

.related-meta .score-ring-svg {
    width: 20px;
    height: 20px;
    display: inline-block;
    flex-shrink: 0;
}

.related-meta .score-value {
    font-size: 0.5rem;
    font-weight: 700;
}

/* =============================================
   MOBILE RELATED
============================================= */
.mobile-related {
    display: none;
}

.mobile-related h3 {
    margin-bottom: 16px;
}

.mobile-related .article-card + .article-card {
    margin-top: 12px;
}

.mobile-related .card-score {
    background: none;
    box-shadow: none;
    backdrop-filter: none;
}

/* =============================================
   NEWSLETTER SECTION (outside .page grid)
============================================= */
.newsletter-section {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px 0;
}

/* =============================================
   RESPONSIVE — 1100px
============================================= */
@media (max-width: 1100px) {
    .page {
        grid-template-columns: 1fr;
        max-width: 720px;
    }

    .sidebar {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .sidebar-card:only-child {
        grid-column: span 2;
    }

    .sidebar-card {
        grid-column: span 2;
    }
}

/* =============================================
   RESPONSIVE — 768px
============================================= */
@media (max-width: 768px) {
    .page {
        padding: 20px;
        gap: 16px;
    }

    .sidebar {
        display: none;
    }

    .hero-visual {
        height: 240px;
    }

    .hero-content {
        padding: 24px;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .card {
        padding: 24px;
    }

    .mobile-related {
        display: block;
    }

    .newsletter-section {
        padding: 0 20px;
    }
}
