/* ============================================================
   Villages Food AI — Frontend CSS  v1.5.5
   Struttura identica al single-borgo di villagesitaly v3.9
   ============================================================ */

/* ── Variabili tema (fallback se il tema non è caricato) ───── */
.vfa-product-article {
    --vi-verde:        #7A8569;
    --vi-verde-scuro:  #5C6650;
    --vi-verde-chiaro: #A8B49A;
    --vi-terra:        #C0614A;
    --vi-terra-hover:  #A84F3A;
    --vi-crema:        #F5F2ED;
    --vi-crema-scura:  #EAE5DC;
    --vi-bianco:       #FFFFFF;
    --vi-testo:        #2C2C2C;
    --vi-testo-medio:  #5A5A5A;
    --vi-testo-light:  #8A8A8A;
    --vi-ombra:        rgba(92,102,80,0.15);
    --vi-font-display: 'Playfair Display', Georgia, serif;
    --vi-font-body:    'Lato', system-ui, sans-serif;
    --vi-radius:       10px;
    --vi-radius-lg:    18px;

    font-family: var(--vi-font-body);
    color: var(--vi-testo);
}

.vfa-product-article *,
.vfa-product-article *::before,
.vfa-product-article *::after {
    box-sizing: border-box;
}

/* ══ HERO COVER (full-width, identico al hero-cover dei borghi) ══ */
.vfa-cover {
    position: relative;
    width: 100%;
    height: 460px;
    overflow: hidden;
    background: #3a3a3a;
}

.vfa-cover__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.vfa-cover__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    background: var(--vi-crema-scura);
    opacity: .5;
}

/* Gradiente overlay in basso */
.vfa-cover__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 3rem 2.5rem 2rem;
    background: linear-gradient(to top, rgba(0,0,0,.72) 0%, rgba(0,0,0,.3) 60%, transparent 100%);
}

.vfa-cover__region {
    display: block;
    font-family: var(--vi-font-body);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .12em;
    color: rgba(255,255,255,.8);
    margin-bottom: .4rem;
}

.vfa-cover__title {
    font-family: var(--vi-font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    color: #fff;
    margin: 0 0 .75rem;
    line-height: 1.15;
    text-shadow: 0 2px 8px rgba(0,0,0,.4);
}

.vfa-cover__badges {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.vfa-cover__badge-pat,
.vfa-cover__badge-eu {
    display: inline-block;
    font-family: var(--vi-font-body);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    padding: .25em .7em;
    border-radius: 20px;
    background: var(--vi-terra);
    color: #fff;
}

.vfa-cover__badge-eu {
    background: #003399;
}

/* ══ BREADCRUMB BAR ═════════════════════════════════════════ */
.vfa-breadcrumb-bar {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .75rem 2.5rem;
    background: var(--vi-crema);
    border-bottom: 1px solid var(--vi-crema-scura);
    font-size: .8rem;
    color: var(--vi-testo-light);
    flex-wrap: wrap;
}

.vfa-breadcrumb-bar a {
    color: var(--vi-verde);
    text-decoration: none;
}

.vfa-breadcrumb-bar a:hover {
    color: var(--vi-verde-scuro);
    text-decoration: underline;
}

/* ══ BODY WRAPPER ═══════════════════════════════════════════ */
.vfa-product-wrap {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 3rem;
    max-width: 1280px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
}

/* ══ CONTENUTO PRINCIPALE ═══════════════════════════════════ */
.vfa-product-content {
    min-width: 0;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--vi-testo-medio);
    font-family: var(--vi-font-body);
}

/* Intro callout — bordo sinistro terra, come i borghi */
.vfa-intro-callout {
    border-left: 4px solid var(--vi-terra);
    padding: .75rem 1.25rem;
    margin-bottom: 2rem;
    color: var(--vi-testo-medio);
    font-size: 1.05rem;
    line-height: 1.75;
    background: var(--vi-crema);
    border-radius: 0 var(--vi-radius) var(--vi-radius) 0;
}

.vfa-synonyms-line {
    font-size: .875rem;
    color: var(--vi-testo-light);
    margin: 0 0 1.5rem;
}

/* Titoli nell'articolo */
.vfa-product-content h2 {
    font-family: var(--vi-font-display);
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--vi-testo);
    margin: 2.5rem 0 .5rem;
    padding-bottom: .4rem;
    border-bottom: 2px solid var(--vi-terra);
    display: inline-block;
}

.vfa-product-content h3 {
    font-family: var(--vi-font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--vi-testo);
    margin: 1.75rem 0 .5rem;
}

.vfa-product-content p { margin: 0 0 1rem; }

.vfa-product-content a {
    color: var(--vi-verde);
    text-decoration: underline;
    text-decoration-color: rgba(122, 133, 105, 0.4);
    text-underline-offset: 2px;
    font-weight: 700;
    transition: color .2s, text-decoration-color .2s;
}

.vfa-product-content a:hover {
    color: var(--vi-verde-scuro);
    text-decoration-color: var(--vi-verde-scuro);
}

.vfa-product-content ul,
.vfa-product-content ol {
    margin: 0 0 1rem 1.25rem;
}

.vfa-product-content li { margin-bottom: .35rem; }

/* Credito foto copertina */
.vfa-cover-credit {
    font-size: .8rem;
    color: var(--vi-testo-light);
    margin: 2.5rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--vi-crema-scura);
}

.vfa-cover-credit a {
    color: var(--vi-testo-light);
    text-decoration: underline;
}

.vfa-cover-credit a:hover { color: var(--vi-verde-scuro); }

/* ══ SIDEBAR ════════════════════════════════════════════════ */
.vfa-product-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-self: start;
    position: sticky;
    top: 2rem;
}

/* Scheda info — identica a .vi-sidebar-widget dei borghi */
.vfa-info-card {
    background: var(--vi-bianco);
    border-radius: var(--vi-radius-lg);
    padding: 18px 20px;
    box-shadow: 0 4px 20px var(--vi-ombra);
}

.vfa-info-card__title {
    font-family: var(--vi-font-body);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--vi-testo);
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--vi-crema-scura);
}

.vfa-info-card__title small {
    font-size: .68rem;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: var(--vi-testo-light);
}

/* Righe scheda */
.vfa-scheda-riga {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: .75rem;
    padding: 7px 0;
    border-bottom: 1px solid var(--vi-crema-scura);
    font-family: var(--vi-font-body);
    font-size: .875rem;
}

.vfa-scheda-key {
    flex-shrink: 0;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--vi-testo-light);
}

.vfa-scheda-val {
    text-align: right;
    color: var(--vi-testo);
    font-size: .875rem;
}

.vfa-scheda-link {
    color: var(--vi-verde);
    text-decoration: none;
    font-size: .8rem;
}

.vfa-scheda-link:hover {
    color: var(--vi-verde-scuro);
    text-decoration: underline;
}

/* Crediti foto in sidebar */
.vfa-foto-credit-val {
    font-size: .75rem;
    color: var(--vi-testo-light);
}

.vfa-foto-credit-val a {
    color: var(--vi-testo-light);
    text-decoration: underline;
}

.vfa-foto-credit-val a:hover { color: var(--vi-verde-scuro); }

/* Disclaimer foto illustrativa */
.vfa-foto-disclaimer {
    font-size: .72rem;
    color: var(--vi-testo-light);
    font-style: italic;
    margin: 8px 0 0;
    padding-top: 8px;
    border-top: 1px dashed #e0dbd3;
    line-height: 1.4;
}

/* Riga sub-nutriente (es. "di cui saturi") */
.vfa-scheda-riga--sub .vfa-scheda-key {
    font-weight: 400;
    font-style: italic;
    color: var(--vi-testo-light);
    padding-left: .5rem;
}
.vfa-scheda-riga--sub .vfa-scheda-val {
    color: var(--vi-testo-light);
}

/* Blocco vitamine/minerali */
.vfa-nutr-note-block {
    margin-top: 10px;
    padding: 8px 0;
    border-top: 1px solid var(--vi-crema-scura);
    font-size: .8rem;
    line-height: 1.5;
    color: var(--vi-testo-medio);
}

.vfa-nutr-note-label {
    display: block;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--vi-testo-light);
    margin-bottom: 3px;
}

/* Fonte nutrizionale */
.vfa-nutr-fonte {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--vi-crema-scura);
    font-size: .75rem;
    color: var(--vi-testo-light);
    line-height: 1.6;
}

.vfa-nutr-fonte a {
    color: var(--vi-verde);
    text-decoration: none;
    font-weight: 600;
}

.vfa-nutr-fonte a:hover {
    color: var(--vi-verde-scuro);
    text-decoration: underline;
}

.vfa-nutr-fonte small {
    display: block;
    margin-top: 4px;
    font-size: .68rem;
    font-style: italic;
}

/* Badge verifica dati */
.vfa-nutr-badge-ok,
.vfa-nutr-badge-nd {
    display: inline-block;
    font-size: .6rem;
    font-weight: 700;
    padding: .1em .45em;
    border-radius: 4px;
    margin-left: .3rem;
    vertical-align: middle;
}

.vfa-nutr-badge-ok {
    background: #dcfce7;
    color: #16a34a;
}

.vfa-nutr-badge-nd {
    background: #fef9c3;
    color: #a16207;
}

/* Lista borghi collegati */
.vfa-related-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vfa-related-list li a {
    display: flex;
    gap: 10px;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.vfa-borgo-thumb {
    width: 48px;
    height: 48px;
    border-radius: var(--vi-radius);
    flex-shrink: 0;
    background: var(--vi-crema-scura) center/cover no-repeat;
}

.vfa-borgo-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.vfa-borgo-nome {
    font-size: .875rem;
    font-weight: 600;
    color: var(--vi-testo);
}

.vfa-borgo-reg {
    font-size: .75rem;
    color: var(--vi-testo-light);
}

/* ══ ALTRI PRODOTTI IN REGIONE (full-width, stile "altri borghi") ══ */
.vfa-altri-prodotti {
    background: var(--vi-crema);
    padding: 3rem 0 4rem;
    margin-top: 1rem;
}

.vfa-altri-prodotti__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

.vfa-altri-prodotti__label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .1em;
    color: var(--vi-terra);
    margin: 0 0 .4rem;
}

.vfa-altri-prodotti__title {
    font-family: var(--vi-font-display);
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--vi-testo);
    margin: 0 0 2rem;
}

.vfa-altri-prodotti__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Card prodotto correlato */
.vfa-altri-card {
    display: block;
    background: var(--vi-bianco);
    border-radius: var(--vi-radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 20px var(--vi-ombra);
    text-decoration: none;
    color: inherit;
    transition: transform .25s ease, box-shadow .25s ease;
}

.vfa-altri-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(92,102,80,.22);
}

.vfa-altri-card__img {
    position: relative;
    aspect-ratio: 4/3;
    background: var(--vi-crema-scura) center/cover no-repeat;
    overflow: hidden;
}

.vfa-altri-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .06em;
    padding: .2em .6em;
    border-radius: 20px;
    background: var(--vi-terra);
    color: #fff;
}

.vfa-altri-card__nome {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem .75rem .6rem;
    font-family: var(--vi-font-body);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .06em;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,.5);
    background: linear-gradient(to top, rgba(0,0,0,.65) 0%, transparent 100%);
}

.vfa-altri-card__body {
    padding: 14px 16px 18px;
}

.vfa-altri-card__cat {
    display: block;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--vi-terra);
    margin-bottom: .4rem;
}

.vfa-altri-card__title {
    font-family: var(--vi-font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--vi-testo);
    margin: 0 0 .3rem;
    line-height: 1.3;
}

.vfa-altri-card__zona {
    font-size: .78rem;
    color: var(--vi-testo-light);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Bottone "vedi tutti" */
.vfa-btn-all {
    display: inline-block;
    padding: .65rem 1.5rem;
    border: 2px solid var(--vi-verde);
    border-radius: 30px;
    font-family: var(--vi-font-body);
    font-size: .875rem;
    font-weight: 700;
    color: var(--vi-verde);
    text-decoration: none;
    transition: background .2s, color .2s;
}

.vfa-btn-all:hover {
    background: var(--vi-verde);
    color: #fff;
}

/* ══ TABLE OF CONTENTS ══════════════════════════════════════ */
.vfa-toc-box {
    background: var(--vi-crema);
    border-left: 4px solid var(--vi-terra);
    border-radius: 0 var(--vi-radius) var(--vi-radius) 0;
    padding: 1rem 1.25rem 1rem 1.5rem;
    margin: 0 0 2rem;
}

.vfa-toc-box__title {
    font-family: var(--vi-font-body);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--vi-testo-light);
    margin: 0 0 .6rem;
    padding: 0;
}

.vfa-toc-box__list {
    margin: 0;
    padding-left: 1.25rem;
    list-style: decimal;
}

.vfa-toc-box__list li {
    margin: .25rem 0;
    font-size: .875rem;
    line-height: 1.5;
}

.vfa-toc-box__list a {
    color: var(--vi-verde);
    text-decoration: none;
    font-weight: 500;
}

.vfa-toc-box__list a:hover {
    color: var(--vi-verde-scuro);
    text-decoration: underline;
}

/* ══ RESPONSIVE ═════════════════════════════════════════════ */
@media (max-width: 1100px) {
    .vfa-product-wrap {
        grid-template-columns: 1fr;
    }
    .vfa-product-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .vfa-cover { height: 300px; }

    .vfa-cover__title { font-size: 1.8rem; }

    .vfa-cover__overlay {
        padding: 2rem 1.25rem 1.25rem;
    }

    .vfa-product-wrap {
        padding: 1.5rem 1rem;
        gap: 2rem;
    }

    .vfa-breadcrumb-bar {
        padding: .6rem 1rem;
    }

    .vfa-altri-prodotti__grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .vfa-altri-prodotti__grid {
        grid-template-columns: 1fr;
    }
}
