/* =====================================================
   CONEIX ELS AMICS — CSS
   ===================================================== */

.fam-section {
    padding: 0 0 1.5rem;
}

.fam-section-top {
    padding-top: calc(var(--header-h) + .5rem);
}

/* SR. MOEBIUS — GUIA */
.fam-guia {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
}

.fam-guia-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: .75rem;
    animation: mini-bounce 4s ease-in-out infinite;
}

.fam-guia-salut {
    font-size: clamp(2.2rem, 5vw, 3rem);
    color: var(--verde);
    margin-bottom: .5rem;
}

.fam-guia-logo {
    height: 60px;
    width: auto;
    margin: .5rem auto;
}

.fam-guia-text {
    font-size: 1.4rem;
    color: var(--text);
    line-height: 1.7;
    margin-bottom: .25rem;
}

.fam-frase {
    font-style: italic;
    font-weight: 700;
    color: var(--verde);
}

/* Tooltip hover personatge */
.fam-char-hover-wrap {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.fam-char-tooltip {
    position: absolute;
    bottom: 105%;
    left: 50%;
    transform: translateX(-50%) scale(.9);
    background: var(--white);
    color: var(--negro);
    font-size: 1rem;
    font-weight: 700;
    padding: .65rem 1.1rem;
    border-radius: var(--r);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,.13);
}

.fam-char-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--white);
}

.fam-char-hover-wrap:hover .fam-char-tooltip {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* Variant de tooltip per frases llargues (amics especials) */
.fam-char-tooltip.fam-tooltip-wrap {
    white-space: normal;
    max-width: 240px;
    text-align: center;
    line-height: 1.4;
}

@keyframes mini-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ===== GRAELLA DE PERSONATGES (flexbox, 5 cards centrades) ===== */
.fam-vcard-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    max-width: 980px;
    margin: 0 auto;
}

.fam-vcard-grid > .ll-vcard {
    flex: 0 0 calc(33.333% - 1rem);
    max-width: calc(33.333% - 1rem);
    /* Necessita position:relative per a l'overlay */
    position: relative;
}

/* Badge contenidor */
.fam-badge {
    display: inline-block;
    font-size: .72rem;
    font-weight: 800;
    padding: .2rem .7rem;
    border-radius: 20px;
    margin-bottom: .5rem;
    letter-spacing: .01em;
}

/* ===== OVERLAY SLIDE-UP (clip-path, igual que objects.html) ===== */
.fam-overlay {
    position: absolute;
    inset: 0;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    padding: 1.5rem 1.25rem;
    text-align: center;
    clip-path: inset(100% 0 0 0 round 24px);
    transition: clip-path .35s cubic-bezier(.4, 0, .2, 1);
}

@media(hover:hover){
    .ll-vcard:hover .fam-overlay{
        clip-path: inset(0% 0 0 0 round 24px);
    }
}
.ll-vcard.fam-revealed .fam-overlay {
    clip-path: inset(0% 0 0 0 round 24px);
}

.fam-ov-name {
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1.1;
}

.fam-ov-text {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.55;
}

/* Frase del personatge (estat normal, al cos de la card) */
.fam-char-frase {
    font-size: .82rem;
    font-style: italic;
    font-weight: 700;
    color: var(--muted);
    margin: .35rem 0 .4rem;
    line-height: 1.35;
}

/* Files accepta / no accepta (estat normal) */
.fam-ov-row {
    display: block;
    width: 100%;
    font-size: .75rem;
    font-weight: 700;
    line-height: 1.45;
    padding: .28rem .6rem;
    border-radius: 7px;
    text-align: left;
    margin-top: .3rem;
}

.fam-ov-yes { background: #e8f5e9; color: #2e7d32; }
.fam-ov-no  { background: #ffebee; color: #c62828; }

/* Note a l'overlay (Crunchy) */
.fam-ov-note {
    font-size: .82rem;
    opacity: .88;
    line-height: 1.4;
    font-style: italic;
}

/* ===== AMICS ESPECIALS ===== */
.fam-amics-v2 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.fam-amic-v2 {
    background: var(--bg);
    border-radius: 18px;
    padding: 1.25rem 1rem;
    text-align: center;
    transition: transform .2s ease;
}

.fam-amic-v2:hover { transform: translateY(-3px); }

.fam-amic-v2 img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin: 0 auto .5rem;
    display: block;
}

.fam-amic-v2 h4 {
    font-size: 1rem;
    font-weight: 900;
    color: var(--text);
    margin-bottom: .2rem;
}

.fam-amic-v2 span {
    display: block;
    font-size: .75rem;
    color: var(--muted);
    margin-bottom: .4rem;
}

.fam-amic-v2 p {
    font-size: .78rem;
    color: var(--muted);
    line-height: 1.45;
}

/* RESPONSIVE — TABLET */
@media (max-width: 900px) {
    .fam-vcard-grid > .ll-vcard {
        flex: 0 0 calc(50% - .75rem);
        max-width: calc(50% - .75rem);
    }
    .fam-amics-v2 { grid-template-columns: repeat(3, 1fr); }
}

/* RESPONSIVE — MÒBIL */
@media (max-width: 560px) {
    .fam-vcard-grid > .ll-vcard {
        flex: 0 0 min(100%, 360px);
        max-width: min(100%, 360px);
    }
    .fam-amics-v2 { grid-template-columns: repeat(2, 1fr); }
}
