/* ==========================================================================
   Sindesi Vendors — v0.44.20 (E2b, 17/07/2026)
   ==========================================================================
   Shortcode `[sindesi_vendors]` — griglia responsive di vendor showcase.
   Design isolato con prefisso `.sv-*` per non collidere con altri moduli.

   ## Grid responsive
     - desktop  ≥1200px : 4 col
     - laptop   ≥ 900px : 3 col
     - tablet   ≥ 600px : 2 col
     - mobile   < 600px : 1 col

   ## Card cliccabile intera
   Il link `<a class="sv-card__link">` è un overlay assoluto sopra tutta la
   card (via position:absolute + inset:0 + z-index basso). Il resto del
   contenuto è "sotto" ma il click bubble è catturato dal link. Vantaggi:
     - Hit area piena carta (mobile-friendly)
     - Un solo `<a>` accessibile per card (screen reader legge aria-label)
     - Nessun nested interactive: rating stelle + badge lingue sono elementi
       non interattivi (span/svg), quindi zero conflitti WCAG.

   ## Prefisso classi
   `.sindesi-vendors` = container root del shortcode
   `.sv-grid`         = griglia
   `.sv-card`         = singola card provider
   `.sv-card__*`      = subelementi BEM.

   ## Fallback avatar
   Se il vendor non ha avatar, l'elemento `<span class="sv-card__avatar
   sv-card__avatar--fallback">` mostra un'icona SVG user inline con
   background grigio chiaro.
   ========================================================================== */

.sindesi-vendors {
    --sv-blue:        #0280DE;
    --sv-teal:        #08B4BB;
    --sv-text:        #1a202c;
    --sv-muted:       #718096;
    --sv-border:      #e2e8f0;
    --sv-panel:       #ffffff;
    --sv-bg-fallback: #edf2f7;
    --sv-radius:      14px;
    --sv-shadow:      0 4px 16px rgba(15, 23, 42, 0.06);
    --sv-shadow-hover:0 8px 24px rgba(15, 23, 42, 0.10);

    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--sv-text);
    line-height: 1.5;
}

.sindesi-vendors *,
.sindesi-vendors *::before,
.sindesi-vendors *::after {
    box-sizing: border-box;
}

/* Empty state — invisible placeholder. */
.sindesi-vendors--empty {
    display: none;
}

/* --- Grid ------------------------------------------------------------------ */

.sv-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

@media (min-width: 600px) {
    .sv-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}
@media (min-width: 900px) {
    .sv-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (min-width: 1200px) {
    .sv-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* --- Card ------------------------------------------------------------------ */

.sv-card {
    position: relative;
    background: var(--sv-panel);
    border: 1px solid var(--sv-border);
    border-radius: var(--sv-radius);
    box-shadow: var(--sv-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sv-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--sv-shadow-hover);
    border-color: rgba(2, 128, 222, 0.25);
}

/* Overlay link — click area piena carta.
   z-index basso (1) per stare sopra `.sv-card__body` (che è static, z 0) ma
   sotto qualsiasi elemento a z superiore (nessuno oggi, ma protezione futura). */
.sv-card__link {
    position: absolute;
    inset: 0;
    z-index: 1;
    text-indent: -9999px;
    overflow: hidden;
    /* Focus visible per keyboard nav — outline sul link non sulla card
       (semanticamente corretto: è il link che riceve focus, non il container). */
    border-radius: var(--sv-radius);
}
.sv-card__link:focus-visible {
    outline: 2px solid var(--sv-blue);
    outline-offset: 2px;
}

.sv-card__body {
    position: relative;
    z-index: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

/* --- Header (avatar + name + city) ---------------------------------------- */

.sv-card__header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sv-card__avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--sv-bg-fallback);
}

.sv-card__avatar--fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--sv-muted);
}
.sv-card__avatar--fallback svg {
    width: 28px;
    height: 28px;
}

.sv-card__meta {
    flex: 1;
    min-width: 0;
}

.sv-card__name {
    font-size: 16px;
    font-weight: 700;
    color: var(--sv-text);
    margin: 0 0 4px;
    /* Ellipsis su nomi lunghi per non spezzare il layout. */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    /* Reset stili h3 tema. */
    line-height: 1.3;
}

.sv-card__city {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--sv-muted);
    /* Ellipsis anche qui per città lunghe. */
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sv-card__city svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* --- Rating (Sindesi Provider Rating renderer) ---------------------------- */

.sv-card__rating {
    /* Il renderer emette il proprio markup — qui solo il wrapper con spacing.
       Cap su font-size per prevenire override del tema che stia scalando
       stelle troppo grandi. */
    font-size: 14px;
    line-height: 1;
}

/* --- Badge Sprachen -------------------------------------------------------- */

.sv-card__languages {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--sv-muted);
    padding: 6px 10px;
    background: var(--sv-bg-fallback);
    border-radius: 999px;
    align-self: flex-start;
    /* Non spezzare tra separatori · ma consentire wrap tra pillole se
       si aggiungeranno più badge in futuro. */
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sv-card__languages svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--sv-blue);
}

/* --- Touch device: disabilita hover transform per evitare "salti" al tap --- */
@media (hover: none) {
    .sv-card:hover {
        transform: none;
    }
}
