/* =============================================================================
 * Architettura della rete (home page): schema SVG + schede FTTH / FTTC / FWA
 * ========================================================================== */
/* spazi della vecchia sezione (fibermap.css: 200px sopra, 170px sotto) */
.network_area { padding-top: 90px; padding-bottom: 40px; }
@media (max-width: 767px) { .network_area { padding-top: 50px; padding-bottom: 30px; } }

.rete {
    --rete-ftth: #00b85a;
    --rete-fttc: #e8961a;
    --rete-fwa:  #ff5b00;
    --rete-blue: #0b3d91;
    --rete-text: #1f2a44;
    --rete-muted: #5b6478;
    --rete-line: #e3e7ef;
    color: var(--rete-text);
}

/* --- schema ---------------------------------------------------------------- */
.rete__map {
    margin: 0 0 20px;
    padding: 28px 28px 18px;
    background: #fff;
    border: 1px solid #dfe7f2;
    border-radius: 32px;
}
.rete__svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}
.rete__label {
    font: 700 22px/1 "Roboto", sans-serif;
    fill: var(--rete-text);
}
.rete__label--dc { fill: var(--rete-blue); font-size: 20px; }
.rete__speed {
    font-weight: 400;
    font-size: 16px;
    fill: var(--rete-muted);
}
.rete__minor {
    font: 400 14px/1 "Roboto", sans-serif;
    fill: var(--rete-muted);
}

.rete__line {
    fill: none;
    stroke-width: 7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.rete__line--fibra { stroke: var(--rete-ftth); }
.rete__line--rame  { stroke: var(--rete-fttc); }
.rete__line--radio { stroke: var(--rete-fwa); stroke-width: 4; stroke-dasharray: 10 9; }

/* impulsi luminosi che scorrono sulle linee */
.rete__flow {
    fill: none;
    stroke: #fff;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 2 26;
    opacity: .9;
    animation: rete-flow 1.2s linear infinite;
}
.rete__flow--lento { animation-duration: 2.4s; }
.rete__line--radio { animation: rete-flow 1.6s linear infinite; }
.rete__waves { animation: rete-waves 1.6s ease-in-out infinite; }
@keyframes rete-flow { to { stroke-dashoffset: -56; } }
@keyframes rete-waves { 50% { opacity: .35; } }

/* evidenzia un percorso passando sullo schema o sulla scheda corrispondente */
.rete__route { transition: opacity .25s; }
.rete__map:has(.rete__route:hover) .rete__route:not(:hover),
.rete:has(.rete-card--ftth:hover) .rete__route:not(.rete__route--ftth),
.rete:has(.rete-card--fttc:hover) .rete__route:not(.rete__route--fttc),
.rete:has(.rete-card--fwa:hover)  .rete__route:not(.rete__route--fwa) {
    opacity: .2;
}

.rete__legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 24px;
    margin-top: 14px;
    font-size: 14px;
    color: var(--rete-muted);
}
.rete__legend-item { display: inline-flex; align-items: center; gap: 8px; }
.rete__swatch {
    display: inline-block;
    width: 28px;
    height: 0;
    border-top: 5px solid var(--rete-ftth);
    border-radius: 3px;
}
.rete__swatch--rame  { border-top-color: var(--rete-fttc); }
.rete__swatch--radio { border-top: 4px dashed var(--rete-fwa); border-radius: 0; }

/* --- schede ---------------------------------------------------------------- */
.rete__cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}
/* schede "a tessera": FTTH blu notte, FTTC verde, FWA bianca */
.rete-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #dfe7f2;
    border-radius: 32px;
    padding: 30px 28px;
    transition: transform .2s, box-shadow .2s;
}
.rete-card--ftth {
    background: #071b3d;
    border-color: #071b3d;
    color: #fff;
    --rete-muted: rgba(255, 255, 255, .78);
    --rete-text: #fff;
    --rete-line: rgba(255, 255, 255, .14);
}
.rete-card--fttc {
    background: #00d363;
    border-color: #00d363;
    --rete-muted: #0b3324;
    --rete-text: #071b3d;
    --rete-line: rgba(7, 27, 61, .15);
}
.rete-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(7, 27, 61, .14);
}
/* colori del testo con contrasto >= 4.5:1 sullo sfondo della scheda */
.rete-card--ftth { --rete-color: var(--rete-ftth); --rete-color-text: #00d363; }
.rete-card--fttc { --rete-color: #071b3d; --rete-color-text: #071b3d; }
.rete-card--fwa  { --rete-color: var(--rete-fwa);  --rete-color-text: #b13a00; }

.rete-card__head { display: flex; align-items: center; gap: 14px; }
.rete-card__icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 20px;
    color: var(--rete-color-text);
    background: #f1f5f3;
    background: color-mix(in srgb, var(--rete-color) 14%, #fff);
}
.rete-card--ftth .rete-card__icon { background: rgba(0, 211, 99, .16); }
.rete-card--fttc .rete-card__icon { background: #071b3d; color: #00d363; }
.rete-card__name {
    margin: 0;
    font-family: "Archivo", "Roboto", sans-serif;
    font-stretch: 125%;
    letter-spacing: -.03em;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--rete-text);
}
.rete-card__acronym {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--rete-muted);
}
.rete-card__speed {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 20px 0 6px;
    color: var(--rete-color-text);
}
.rete-card__speed-label { font-size: 14px; color: var(--rete-muted); }
.rete-card__speed-value {
    font-family: "Archivo", "Roboto", sans-serif;
    font-stretch: 125%;
    letter-spacing: -.05em;
    font-size: 64px;
    font-weight: 800;
    line-height: .9;
    font-variant-numeric: tabular-nums;
}
.rete-card__speed-unit { font-size: 20px; font-weight: 800; font-family: "Archivo", "Roboto", sans-serif; font-stretch: 125%; }
.rete-card__route {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 0 0 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--rete-line);
    font-size: 14px;
    font-weight: 500;
    color: var(--rete-text);
}
.rete-card__route i { color: var(--rete-color-text); }
.rete-card__text {
    margin: 0;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--rete-muted);
}

@media (prefers-reduced-motion: reduce) {
    .rete__flow, .rete__line--radio, .rete__waves { animation: none; }
    .rete__flow { display: none; }
    .rete-card, .rete__route { transition: none; }
    .rete-card:hover { transform: none; }
}

/* --- responsive ------------------------------------------------------------ */
@media (max-width: 991px) {
    .rete__cards { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
@media (max-width: 575px) {
    .rete__map { padding: 14px 10px 12px; border-radius: 16px; }
    /* lo schema si rimpicciolisce: testi piu' grandi e solo le etichette principali */
    .rete__label { font-size: 44px; }
    .rete__label--dc { font-size: 38px; }
    .rete__speed, .rete__minor { display: none; }
    .rete-card { padding: 18px; }
    .rete-card__speed-value { font-size: 52px; }
    .rete-card { border-radius: 24px; }
}
