/* ════════════════════════════════════════
   CHI SIAMO — Hero Handwritten/Storytelling
   ════════════════════════════════════════ */
.chi-hero {
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 130px 24px 80px;
    overflow: hidden;
    background: var(--bg);
}

/* ─── Linee SVG decorative che si disegnano ─── */
.chi-hero-deco {
    position: absolute;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}
.chi-deco-swirl {
    width: 240px;
    top: 15%; right: 5%;
}
.chi-deco-star {
    width: 44px;
    top: 25%; left: 12%;
    animation: chi-deco-pulse 4s ease-in-out infinite;
}
.chi-deco-heart {
    width: 36px;
    bottom: 20%; right: 14%;
    animation: chi-deco-pulse 5s ease-in-out 1s infinite;
}
.chi-deco-confetti {
    width: 80px;
    bottom: 25%; left: 8%;
}
@keyframes chi-deco-pulse {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.4; }
    50%      { transform: scale(1.15) rotate(8deg); opacity: 0.7; }
}

/* Animazione stroke-draw */
.chi-draw-line {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    animation: chi-line-draw 3s ease forwards;
}
.chi-deco-star .chi-draw-line { animation-delay: 0.6s; stroke-dasharray: 200; stroke-dashoffset: 200; }
.chi-deco-heart .chi-draw-line { animation-delay: 1s; stroke-dasharray: 200; stroke-dashoffset: 200; }
.chi-deco-confetti .chi-draw-line { animation-delay: 1.4s; stroke-dasharray: 300; stroke-dashoffset: 300; }
@keyframes chi-line-draw {
    to { stroke-dashoffset: 0; }
}

/* ─── Contenuto hero ─── */
.chi-hero-content {
    position: relative;
    z-index: 1;
    max-width: 720px;
}
.chi-hero-hand {
    font-family: 'Caveat', cursive;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--arancione);
    display: block;
    margin-bottom: 8px;
    opacity: 0;
    animation: chi-hand-in 0.8s 0.3s ease forwards;
}
@keyframes chi-hand-in {
    from { opacity: 0; transform: translateY(10px) rotate(-2deg); }
    to   { opacity: 1; transform: translateY(0) rotate(0deg); }
}
.chi-hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.2rem, 6vw, 3.6rem);
    font-weight: 800;
    color: var(--text);
    line-height: 1.15;
    margin: 0 0 18px;
}
.chi-hero-anno {
    color: var(--arancione);
    position: relative;
}
/* Sottolineatura animata handwritten */
.chi-underline-wrap {
    position: relative;
    display: inline;
}
.chi-underline {
    position: absolute;
    left: 0; right: 0; bottom: -4px;
    height: 8px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 8'%3E%3Cpath d='M0,5 Q40,0 80,5 T160,4 T200,5' fill='none' stroke='%23F28C28' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x;
    background-size: 200px 8px;
    transform: scaleX(0);
    transform-origin: left;
    animation: chi-underline-draw 0.8s 1.2s ease forwards;
}
@keyframes chi-underline-draw {
    to { transform: scaleX(1); }
}
.chi-hero-sub {
    font-family: 'Nunito', sans-serif;
    font-size: 1.08rem;
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.7;
}
/* Badge numeri */
.chi-hero-badges {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    margin-top: 36px;
    opacity: 0;
    animation: chi-badges-in 0.6s 1.6s ease forwards;
}
@keyframes chi-badges-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.chi-hero-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.chi-hero-badge strong {
    font-family: 'Caveat', cursive;
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--arancione);
    line-height: 1;
}
.chi-hero-badge span {
    font-family: 'Nunito', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 4px;
}
.chi-hero-badge-divider {
    width: 1px;
    height: 36px;
    background: rgba(0,0,0,0.08);
}

/* ════════════════════════════════════════
   STORIA EDITORIALE
   ════════════════════════════════════════ */
.chi-storia {
    background: var(--bg);
    padding: 60px 24px 80px;
}
.chi-storia-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
}
.chi-storia-img {
    border-radius: var(--raggio-lg);
    overflow: hidden;
    aspect-ratio: 4/3;
}
.chi-storia-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.chi-editorial-h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    line-height: 1.15;
    color: var(--text);
    margin-bottom: 24px;
}
.chi-storia-testo p {
    font-family: 'Nunito', sans-serif;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.chi-storia-testo strong { color: var(--text); }

/* ════════════════════════════════════════
   I NOSTRI VALORI
   ════════════════════════════════════════ */
.chi-valori {
    background: linear-gradient(180deg, #FFF3E8 0%, var(--bg) 100%);
    padding: 72px 24px 80px;
}
.chi-valori-header {
    text-align: center;
    margin-bottom: 48px;
}
.chi-valori-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    max-width: 900px;
    margin: 0 auto;
}
.chi-valore {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--raggio-lg);
    padding: 32px 28px;
    text-align: center;
    box-shadow: var(--ombra);
    transition: all var(--transizione);
}
.chi-valore:hover {
    transform: translateY(-5px);
    box-shadow: var(--ombra-lg);
    border-color: var(--border-hover);
}
.chi-valore-icon {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: rgba(242,140,40,0.07);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 18px;
}
.chi-valore-titolo {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}
.chi-valore-desc {
    font-family: 'Nunito', sans-serif;
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--text-muted);
}

/* ════════════════════════════════════════
   TIMELINE TEAM
   ════════════════════════════════════════ */
.chi-timeline-section {
    background: var(--bg);
    padding: 80px 24px;
}
.chi-timeline-header {
    text-align: center;
    margin-bottom: 56px;
}
.chi-section-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    margin-top: 8px;
}

.chi-timeline {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    padding-left: 48px;
}
/* Linea verticale */
.chi-timeline::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--arancione), var(--ambra), rgba(245,166,35,0.1));
    border-radius: 2px;
}

.chi-tl-item {
    position: relative;
    margin-bottom: 48px;
}
.chi-tl-item:last-child { margin-bottom: 0; }

/* Marker (anno + pallino) */
.chi-tl-marker {
    position: absolute;
    left: -48px;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 36px;
}
.chi-tl-year {
    font-family: 'Playfair Display', serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--arancione-text);
    margin-bottom: 8px;
    white-space: nowrap;
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    position: relative;
    z-index: 2;
}
.chi-tl-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--bg);
    border: 3px solid var(--arancione);
    position: relative;
    z-index: 2;
}
.chi-tl-dot--now {
    background: var(--arancione);
    box-shadow: 0 0 0 4px rgba(242,140,40,0.2);
}

/* Card */
.chi-tl-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--raggio-lg);
    padding: 28px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    box-shadow: var(--ombra);
    transition: all var(--transizione);
}
.chi-tl-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ombra-lg);
    border-color: var(--border-hover);
}

/* Avatar */
.chi-tl-avatar {
    flex-shrink: 0;
    width: 56px; height: 56px;
    border-radius: 50%;
    overflow: hidden;
}
.chi-tl-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%; height: 100%;
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    background: var(--avatar-color, var(--arancione));
}
.chi-tl-avatar img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

/* Event card (no avatar) */
.chi-tl-card--event {
    background: linear-gradient(135deg, #FFF8F0, #FFF3E8);
    border-color: rgba(242,140,40,0.1);
}
.chi-tl-event-icon {
    flex-shrink: 0;
    width: 56px; height: 56px;
    border-radius: 16px;
    background: rgba(242,140,40,0.08);
    display: flex; align-items: center; justify-content: center;
}

/* Content */
.chi-tl-content { flex: 1; min-width: 0; }
.chi-tl-nome {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}
.chi-tl-ruolo {
    display: block;
    font-family: 'Nunito', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--arancione-text);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
}
.chi-tl-bio {
    font-family: 'Nunito', sans-serif;
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 12px;
}
.chi-tl-tag {
    display: inline-block;
    background: rgba(242,140,40,0.08);
    color: var(--arancione-text);
    font-family: 'Nunito', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ════════════════════════════════════════
   AVATAR CLICCABILE
   ════════════════════════════════════════ */
.chi-tl-avatar--clickable {
    border: none;
    padding: 0;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 50%;
    background: none;
}
.chi-tl-avatar--clickable:hover {
    transform: scale(1.12);
    box-shadow: 0 4px 16px rgba(242,140,40,0.2);
}
.chi-tl-avatar--clickable::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px dashed rgba(242,140,40,0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.chi-tl-avatar--clickable:hover::after { opacity: 1; }

/* ════════════════════════════════════════
   LIGHTBOX FOTO PROFILO
   ════════════════════════════════════════ */
.chi-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.chi-lightbox.open {
    opacity: 1;
    pointer-events: all;
}
.chi-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.chi-lightbox-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.chi-lightbox-close {
    position: absolute;
    top: -48px; right: -8px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}
.chi-lightbox-close:hover { background: rgba(255,255,255,0.25); }
.chi-lightbox-img-wrap {
    width: 280px; height: 280px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid rgba(255,255,255,0.15);
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    background: #1a1a1a;
    display: flex; align-items: center; justify-content: center;
}
.chi-lightbox-img-wrap img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.chi-lightbox-img-wrap .chi-lb-letter {
    font-family: 'Playfair Display', serif;
    font-size: 6rem;
    font-weight: 700;
    color: rgba(255,255,255,0.3);
}
.chi-lightbox-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
}

/* ════════ Responsive ════════ */
@media (min-width: 768px) {
    .chi-storia-inner { grid-template-columns: 1fr 1.2fr; }
    .chi-valori-grid { grid-template-columns: repeat(4, 1fr); }
    .chi-timeline { padding-left: 64px; }
    .chi-timeline::before { left: 26px; }
    .chi-tl-marker { left: -64px; width: 52px; }
    .chi-tl-year { font-size: 0.85rem; }
}
@media (max-width: 600px) {
    .chi-hero { padding: 100px 20px 48px; min-height: 400px; }
    .chi-hero-hand { font-size: 1.3rem; }
    .chi-hero-badges { gap: 16px; }
    .chi-hero-badge strong { font-size: 1.8rem; }
    .chi-deco-swirl { width: 140px; top: 10%; right: 2%; }
    .chi-deco-star { width: 30px; left: 6%; }
    .chi-deco-heart { width: 26px; right: 6%; }
    .chi-deco-confetti { width: 50px; left: 4%; }
    .chi-storia { padding: 48px 20px 52px; }
    .chi-timeline-section { padding: 52px 20px; }
    .chi-tl-card { flex-direction: column; gap: 12px; }
    .chi-tl-card { padding: 20px; }
    .chi-valori { padding: 48px 20px 52px; }
    .chi-valori-grid { grid-template-columns: 1fr; gap: 16px; }
    .chi-valore { padding: 24px 20px; }
    .chi-lightbox-img-wrap {
        width: min(220px, 72vw);
        height: min(220px, 72vw);
    }
}
