/**
 * Microsoft 365 product pages (Family / Personal) — shared layout & v2 blocks.
 * Loaded after page.css and product.css; cacheable across locales and products.
 */

/* ── V2 PREMIUM OVERRIDES ── */

/* Hero: full dark section with ambient lights */
.v2-hero {
    position: relative;
    background: #0a0a0f;
    color: #fff;
    overflow: hidden;
    padding: 0;
    contain: layout paint;
}

/* Ambient light blobs — elementi reali per GPU layer isolato */
.v2-hero__ambient,
.v2-hero__ambient-2,
.v2-hero__ambient-mid {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    will-change: transform;
}
.v2-hero__ambient {
    top: -120px;
    left: -80px;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle at 50% 50%, rgba(0, 120, 215, 0.28) 0%, transparent 65%);
    filter: blur(60px);
    animation: ambientDrift1 12s ease-in-out infinite alternate;
}
.v2-hero__ambient-2 {
    bottom: -80px;
    right: -100px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle at 50% 50%, rgba(120, 60, 220, 0.22) 0%, transparent 65%);
    filter: blur(70px);
    animation: ambientDrift2 15s ease-in-out infinite alternate;
}
@keyframes ambientDrift1 {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(60px, 40px) scale(1.12); }
}
@keyframes ambientDrift2 {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(-50px, -30px) scale(1.08); }
}

.v2-hero__ambient-mid {
    top: 40%;
    left: 45%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0,188,212,0.12) 0%, transparent 70%);
    filter: blur(80px);
    animation: ambientDrift1 9s ease-in-out infinite alternate-reverse;
}

/* Rispetta prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .v2-hero__ambient,
    .v2-hero__ambient-2,
    .v2-hero__ambient-mid { animation: none; will-change: auto; }
}

.v2-hero__inner {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 24px 160px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}
@media (max-width: 900px) {
    .v2-hero__inner { grid-template-columns: 1fr; padding: 64px 20px 120px; }
}

/* Hero left */
.v2-hero__left { padding-top: 24px; }

.v2-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(0,188,212,0.9);
    margin-bottom: 20px;
}
.v2-hero__eyebrow::before {
    content: '';
    display: block;
    width: 20px;
    height: 2px;
    background: rgba(0,188,212,0.8);
}

.v2-hero__title {
    font-size: clamp(2rem, 4.5vw, 3.4rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin: 0 0 24px;
    color: #fff;
}
.v2-hero__title span {
    background: linear-gradient(135deg, #0078d7 0%, #00bcd4 50%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.v2-hero__desc {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.72);
    line-height: 1.7;
    margin: 0 0 32px;
    max-width: 480px;
}

/* Pill features */
.v2-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 0;
}
.v2-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 10px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    backdrop-filter: blur(8px);
}
.v2-pill img { flex-shrink: 0; }

/* Hero right — product cover */
.v2-hero__right {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}
.v2-hero__cover-wrap {
    position: relative;
    width: 100%;
    max-width: 380px;
}
.v2-hero__cover-wrap::before {
    content: '';
    position: absolute;
    inset: -20px;
    background: radial-gradient(ellipse at 50% 60%, rgba(0,120,215,0.35) 0%, transparent 70%);
    filter: blur(40px);
    z-index: 0;
    border-radius: 50%;
}
.v2-hero__cover {
    position: relative;
    z-index: 1;
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.06);
}

/* ── FLOATING PRICING CARD ── */
.v2-pricing-wrap {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: -80px auto 0;
    padding: 0 24px;
}
@media (max-width: 900px) {
    .v2-pricing-wrap { margin: -60px auto 0; }
}

.v2-pricing-card {
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(24px) saturate(1.8);
    -webkit-backdrop-filter: blur(24px) saturate(1.8);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 24px;
    box-shadow:
        0 32px 80px rgba(0,0,0,0.35),
        0 0 0 1px rgba(255,255,255,0.04) inset,
        0 1px 0 rgba(255,255,255,0.12) inset;
    padding: 36px 40px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 32px 48px;
    align-items: center;
}
@media (max-width: 768px) {
    .v2-pricing-card { grid-template-columns: 1fr; padding: 28px 24px; gap: 24px; }
}

/* Force dark text on light theme for the card */
[data-theme="light"] .v2-pricing-card {
    background: rgba(255,255,255,0.85);
    border-color: rgba(0,0,0,0.08);
    box-shadow: 0 32px 80px rgba(0,0,0,0.12), 0 1px 0 rgba(255,255,255,0.9) inset;
}
[data-theme="light"] .v2-pricing-card .v2-price-label { color: #666; }
[data-theme="light"] .v2-pricing-card .v2-price-msrp { color: #999; }
[data-theme="light"] .v2-pricing-card .v2-price-sale { color: #0a0a0f; }
[data-theme="light"] .v2-pricing-card .v2-price-tax { color: #888; }
.v2-price-label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
    margin-bottom: 8px;
}
.v2-price-row {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 6px;
}
.v2-price-msrp {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.38);
    text-decoration: line-through;
}
.v2-price-sale {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: #fff;
    line-height: 1;
}
.v2-price-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 100px;
    background: linear-gradient(135deg, #0078d7, #00bcd4);
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.05em;
}
.v2-price-tax {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.42);
    margin-top: 4px;
}
.v2-price-compare {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.55);
}
.v2-price-compare strong { color: rgba(255,255,255,0.8); }

.v2-pricing-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 220px;
}

.v2-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 28px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0078d7 0%, #106ebe 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0,120,215,0.4);
    transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
    white-space: nowrap;
}
.v2-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0,120,215,0.5); filter: brightness(1.08); }
.v2-btn-primary:active { transform: translateY(0); }
.v2-btn-primary svg { width: 20px; height: 20px; flex-shrink: 0; }

/* Payment logos (solo icone, sotto CTA) */
.v2-payment-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: clamp(8px, 1.6vw, 16px);
    flex-wrap: wrap;
}
.v2-payment-logo {
    opacity: 0.82;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: clamp(44px, 10.5vw, 54px);
    height: 20px;
    box-sizing: border-box;
}
.v2-payment-logo:hover { opacity: 1; }
.v2-payment-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

/* ── SECTION WRAPPER ── */
.v2-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 24px;
    content-visibility: auto;
    contain-intrinsic-size: 0 600px;
}
.v2-section--tight { padding-top: 56px; padding-bottom: 56px; }

.v2-eyebrow {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #0078d7;
    margin-bottom: 12px;
}
.v2-section-title {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    margin: 0 0 48px;
    line-height: 1.2;
}

/* ── BENTO GRID ── */
.v2-bento {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: auto;
    gap: 16px;
}

.v2-bento__cell {
    border-radius: 20px;
    padding: 32px;
    position: relative;
    overflow: hidden;
    background: var(--card-bg, rgba(255,255,255,0.04));
    border: 1px solid var(--card-border, rgba(255,255,255,0.08));
    transition: transform 0.2s, box-shadow 0.2s;
}
[data-theme="light"] .v2-bento__cell {
    background: var(--card-bg, #f5f7fa);
    border-color: var(--card-border, rgba(0,0,0,0.07));
}
.v2-bento__cell:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(0,0,0,0.15); }

/* Cell spans */
.v2-bento__cell--c6  { grid-column: span 6; }
.v2-bento__cell--c4  { grid-column: span 4; }
.v2-bento__cell--c8  { grid-column: span 8; }
.v2-bento__cell--c12 { grid-column: span 12; }
.v2-bento__cell--c3  { grid-column: span 3; }

@media (max-width: 900px) {
    .v2-bento__cell--c6,
    .v2-bento__cell--c4,
    .v2-bento__cell--c8 { grid-column: span 12; }
    .v2-bento__cell--c3 { grid-column: span 6; }
}
@media (max-width: 480px) {
    .v2-bento__cell--c3 { grid-column: span 12; }
}

/* Special cell backgrounds */
.v2-bento__cell--blue {
    background: linear-gradient(135deg, rgba(0,120,215,0.2) 0%, rgba(0,188,212,0.12) 100%);
    border-color: rgba(0,120,215,0.25);
}
.v2-bento__cell--purple {
    background: linear-gradient(135deg, rgba(124,58,237,0.2) 0%, rgba(0,120,215,0.12) 100%);
    border-color: rgba(124,58,237,0.25);
}
.v2-bento__cell--teal {
    background: linear-gradient(135deg, rgba(0,188,212,0.18) 0%, rgba(0,120,215,0.08) 100%);
    border-color: rgba(0,188,212,0.25);
}
.v2-bento__cell--dark {
    background: rgba(10,10,20,0.6);
    border-color: rgba(255,255,255,0.06);
}
[data-theme="light"] .v2-bento__cell--dark {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.08);
}

.v2-bento__icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    background: rgba(255,255,255,0.08);
}
[data-theme="light"] .v2-bento__icon { background: rgba(0,0,0,0.06); }
.v2-bento__icon svg { width: 24px; height: 24px; }

.v2-bento__label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(0,188,212,0.9);
    margin-bottom: 8px;
}
.v2-bento__title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 10px;
    line-height: 1.3;
}
.v2-bento__body {
    font-size: 0.88rem;
    line-height: 1.65;
    color: rgba(255,255,255,0.62);
}
[data-theme="light"] .v2-bento__body { color: #555; }

/* Big number */
.v2-bento__stat {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #0078d7, #00bcd4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── APPS GRID ── */
.v2-apps-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 80px;
}
.v2-apps-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}
.v2-apps-grid::-webkit-scrollbar { display: none; }
.v2-app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 14px 10px;
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    transition: background 0.15s, transform 0.15s;
    text-align: center;
    flex: 1 0 0;
    min-width: 72px;
    white-space: nowrap;
}
[data-theme="light"] .v2-app-item {
    background: #f5f7fa;
    border-color: rgba(0,0,0,0.07);
    color: #333;
}
.v2-app-item:hover {
    background: rgba(0,120,215,0.12);
    transform: translateY(-2px);
}
.v2-app-item img { width: 36px; height: 36px; }

/* Ponte visivo tra griglia app e passi (solo Family) */
.v2-family-bridge {
    max-width: 1200px;
    margin: -32px auto 48px;
    padding: 0 24px;
}
.v2-family-bridge__media {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.35);
}
[data-theme="light"] .v2-family-bridge__media {
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1);
}
.v2-family-bridge__media::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 48%;
    border-radius: 0 0 20px 20px;
    background: linear-gradient(
        to bottom,
        rgba(13, 13, 20, 0) 0%,
        rgba(13, 13, 20, 0.35) 45%,
        #0d0d14 100%
    );
    pointer-events: none;
    z-index: 1;
}
[data-theme="light"] .v2-family-bridge__media::after {
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.5) 48%,
        #ffffff 100%
    );
}
/* Scheda “glass” + gerarchia tipografica (testo dentro l’immagine) */
.v2-family-bridge__caption {
    position: absolute;
    left: 20px;
    right: auto;
    bottom: 20px;
    z-index: 2;
    max-width: min(26rem, calc(100% - 40px));
    margin: 0;
    padding: 13px 18px 15px 16px;
    display: flex;
    flex-direction: column;
    gap: 0.4em;
    font-size: clamp(0.88rem, 2.35vw, 1.06rem);
    font-weight: 600;
    line-height: 1.38;
    color: #f4f8fc;
    letter-spacing: 0.01em;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-left: 3px solid #0078d4;
    background: rgba(14, 16, 28, 0.52);
    backdrop-filter: blur(18px) saturate(1.25);
    -webkit-backdrop-filter: blur(18px) saturate(1.25);
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    pointer-events: none;
}
.v2-family-bridge__caption-kicker {
    display: block;
    font-size: 0.68em;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    line-height: 1.2;
    color: #8fc9ff;
}
.v2-family-bridge__caption-text {
    display: block;
    font-size: 1em;
    font-weight: 600;
    line-height: 1.38;
}
[data-theme="light"] .v2-family-bridge__caption {
    color: #101418;
    border-color: rgba(0, 0, 0, 0.1);
    border-left-color: #0078d4;
    background: rgba(255, 255, 255, 0.88);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.98);
}
[data-theme="light"] .v2-family-bridge__caption-kicker {
    color: #0078d4;
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .v2-family-bridge__caption {
        background: rgba(18, 20, 32, 0.88);
    }
    [data-theme="light"] .v2-family-bridge__caption {
        background: rgba(255, 255, 255, 0.96);
    }
}
.v2-family-bridge__img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
@media (max-width: 640px) {
    .v2-family-bridge {
        margin-top: -16px;
        margin-bottom: 36px;
    }
    .v2-family-bridge__media {
        border-radius: 14px;
    }
    .v2-family-bridge__media::after {
        border-radius: 0 0 14px 14px;
    }
    .v2-family-bridge__caption {
        left: 12px;
        bottom: 12px;
        max-width: calc(100% - 24px);
        padding: 11px 14px 13px 13px;
        font-size: 0.84rem;
        border-radius: 12px;
        gap: 0.32em;
    }
    .v2-family-bridge__caption-kicker {
        letter-spacing: 0.12em;
    }
}

/* ── STEPS ── */
.v2-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
@media (max-width: 768px) { .v2-steps { grid-template-columns: 1fr; } }

.v2-step {
    padding: 28px;
    border-radius: 18px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    position: relative;
}
[data-theme="light"] .v2-step { background: #f5f7fa; border-color: rgba(0,0,0,0.07); }

.v2-step__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0078d7, #106ebe);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 800;
    margin-bottom: 16px;
}
.v2-step__title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 8px;
}
.v2-step__body {
    font-size: 0.85rem;
    line-height: 1.65;
    color: rgba(255,255,255,0.58);
}
[data-theme="light"] .v2-step__body { color: #555; }
.v2-step__body a { color: #0078d7; }

/* ── FAQ ── */
.v2-faq { max-width: 800px; }
.v2-faq details {
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 20px 0;
}
[data-theme="light"] .v2-faq details { border-bottom-color: rgba(0,0,0,0.08); }
.v2-faq details:first-of-type { border-top: 1px solid rgba(255,255,255,0.08); }
[data-theme="light"] .v2-faq details:first-of-type { border-top-color: rgba(0,0,0,0.08); }
.v2-faq summary {
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.v2-faq summary::-webkit-details-marker { display: none; }
.v2-faq summary::after {
    content: '+';
    font-size: 1.3rem;
    font-weight: 300;
    color: rgba(255,255,255,0.4);
    flex-shrink: 0;
    transition: transform 0.2s;
}
[data-theme="light"] .v2-faq summary::after { color: #aaa; }
.v2-faq details[open] summary::after { content: '−'; }
.v2-faq details p {
    margin: 16px 0 0;
    font-size: 0.9rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.6);
}
[data-theme="light"] .v2-faq details p { color: #555; }

@media (max-width: 640px) {
    .v2-faq details { padding: 14px 0; }
    .v2-faq summary {
        min-height: 44px;
        align-items: flex-start;
        padding: 4px 0;
        gap: 12px;
        line-height: 1.35;
        touch-action: manipulation;
    }
    .v2-faq summary::after {
        margin-top: 0.08em;
        line-height: 1;
    }
    .v2-faq details p {
        margin-top: 12px;
        font-size: 0.88rem;
        line-height: 1.65;
    }
}
@media (max-width: 480px) {
    .v2-faq details { padding: 12px 0; }
    .v2-faq summary { font-size: 0.94rem; gap: 10px; }
}

/* ── SPECS TABLE ── */
.v2-specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.v2-specs-item {
    padding: 24px;
    border-radius: 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
}
[data-theme="light"] .v2-specs-item { background: #f5f7fa; border-color: rgba(0,0,0,0.07); }
.v2-specs-item h3 {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #0078d7;
    margin: 0 0 8px;
}
.v2-specs-item p { font-size: 0.85rem; line-height: 1.6; color: rgba(255,255,255,0.6); margin: 0; }
[data-theme="light"] .v2-specs-item p { color: #555; }

/* Divider */
.v2-divider {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    border: none;
    border-top: 1px solid rgba(255,255,255,0.07);
}
[data-theme="light"] .v2-divider { border-top-color: rgba(0,0,0,0.07); }

/* Breadcrumb override for dark section */
.v2-breadcrumb {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px 0;
}
.v2-breadcrumb nav {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.45);
}
.v2-breadcrumb nav a { color: rgba(255,255,255,0.5); text-decoration: none; }
.v2-breadcrumb nav a:hover { color: rgba(255,255,255,0.8); }
.v2-breadcrumb nav .sep { color: rgba(255,255,255,0.25); }

/* Keep base page background correct */
body { background: var(--bg, #fff); }
[data-theme="dark"] body { background: #0d0d14; }

/* ── BENTO FIGURE / INFORMATIVA — Full-width breakout ── */

/* Annulla tutto il padding della sezione per l'immagine galleria */
.v2-section--gallery {
    padding: 0;
    /* Override per CLS: altezza stimata precisa per content-visibility: auto */
    contain-intrinsic-size: 0 62.5vw;
}

.bento-figure {
    position: relative;
    margin: 0;
    padding: 0;
    width: 100%;
    overflow: hidden;
    border-radius: 0;
    border: none;
    background: #0a0a0f;
}

/* Gradiente superiore: sfuma dal colore pagina verso trasparente */
.bento-figure::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, var(--page-bg, #0d0d14) 0%, transparent 100%);
    z-index: 3;
    pointer-events: none;
}

/* Gradiente inferiore: sfuma da trasparente al colore pagina */
.bento-figure::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top, var(--page-bg, #0d0d14) 0%, transparent 100%);
    z-index: 3;
    pointer-events: none;
}

[data-theme="light"] .bento-figure::before {
    background: linear-gradient(to bottom, var(--page-bg, #ffffff) 0%, transparent 100%);
}

[data-theme="light"] .bento-figure::after {
    background: linear-gradient(to top, var(--page-bg, #ffffff) 0%, transparent 100%);
}

[data-theme="light"] .bento-figure {
    background: #f5f7fa;
}

/* Zoom dell'immagine sull'hover */
.bento-img {
    width: 100%;
    height: auto;
    aspect-ratio: 8 / 5; /* 1024×640 — allineato agli attributi width/height dell'img */
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.bento-figure:hover .bento-img {
    transform: scale(1.03);
}

@media (prefers-reduced-motion: reduce) {
    .bento-figure:hover .bento-img { transform: none; }
}

/* Glass card caption ancorata in basso a sinistra */
.bento-caption {
    position: absolute;
    bottom: 28px;
    left: 28px;
    right: auto;
    width: auto;
    max-width: min(26rem, calc(100% - 56px));
    padding: 14px 20px 16px 18px;
    box-sizing: border-box;
    color: #f4f8fc;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.3em;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-left: 3px solid #0078d4;
    background: rgba(14, 16, 28, 0.52);
    backdrop-filter: blur(18px) saturate(1.25);
    -webkit-backdrop-filter: blur(18px) saturate(1.25);
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    z-index: 2;
    pointer-events: none;
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .bento-caption { background: rgba(18, 20, 32, 0.88); }
}

[data-theme="light"] .bento-caption {
    color: #101418;
    border-color: rgba(0, 0, 0, 0.1);
    border-left-color: #0078d4;
    background: rgba(255, 255, 255, 0.88);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

.bento-kicker {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #8fc9ff;
    line-height: 1.2;
}

[data-theme="light"] .bento-kicker { color: #0078d4; }

.bento-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.bento-text {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.5;
    opacity: 0.82;
}

@media (max-width: 640px) {
    .bento-caption {
        bottom: 14px;
        left: 14px;
        max-width: calc(100% - 28px);
        padding: 11px 14px 13px 13px;
        font-size: 0.84rem;
        border-radius: 12px;
        gap: 0.28em;
    }
    .bento-kicker { letter-spacing: 0.12em; }
    .bento-title { font-size: 0.95rem; }
    .bento-text { font-size: 0.82rem; }
}
