/* FATTOR-IA RANGE EXPLORER V1
   Candidate only.
   Non modificare style.css finché il componente non supera il QA.
*/

.fattoria-range-explorer {
    --range-marker: 33.333%;
    overflow: hidden;
}

.range-explorer-value {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 22px 0 6px;
    color: var(--fia-green-950);
}

.range-explorer-value strong {
    font-size: clamp(32px, 5vw, 46px);
    line-height: 1;
    letter-spacing: -.04em;
}

.range-explorer-value span {
    color: var(--fia-text-soft);
    font-size: 15px;
}

.range-explorer-control {
    position: relative;
    margin-top: 8px;
    padding: 4px 0 30px;
}

.range-explorer-control input[type="range"] {
    width: 100%;
    height: 44px;
    margin: 0;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    cursor: pointer;
    touch-action: pan-y;
}

.range-explorer-control input[type="range"]::-webkit-slider-runnable-track {
    height: 5px;
    border-radius: 999px;
    background: rgba(16,63,53,.16);
}

.range-explorer-control input[type="range"]::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
    margin-top: -10px;
    appearance: none;
    -webkit-appearance: none;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--fia-green-950);
    box-shadow: 0 0 0 1px rgba(16,63,53,.18);
}

.range-explorer-control input[type="range"]::-moz-range-track {
    height: 5px;
    border: 0;
    border-radius: 999px;
    background: rgba(16,63,53,.16);
}

.range-explorer-control input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--fia-green-950);
    box-shadow: 0 0 0 1px rgba(16,63,53,.18);
}

.range-explorer-control input[type="range"]:focus-visible {
    outline: 2px solid var(--fia-gold);
    outline-offset: 4px;
    border-radius: 8px;
}

.range-explorer-ticks {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 22px;
    color: var(--fia-text-soft);
    font-size: 12px;
}

.range-explorer-ticks span {
    position: absolute;
    top: 0;
    min-width: 28px;
    padding: 3px 4px;
    border-radius: 6px;
    text-align: center;
    transform: translateX(-50%);
    cursor: pointer;
    user-select: none;
}

.range-explorer-ticks span:nth-child(1) {
    left: 0%;
    transform: translateX(0);
}

.range-explorer-ticks span:nth-child(2) {
    left: 23.333%;
}

.range-explorer-ticks span:nth-child(3) {
    left: 46.667%;
}

.range-explorer-ticks span:nth-child(4) {
    left: 70%;
}

.range-explorer-ticks span:nth-child(5) {
    left: 100%;
    transform: translateX(-100%);
}

.range-explorer-ticks span:hover,
.range-explorer-ticks span:focus-visible {
    background: rgba(255,255,255,.55);
    outline: none;
}

.range-explorer-tracks {
    margin-top: 24px;
    border-top: 1px solid rgba(16,63,53,.10);
}

.range-track {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    gap: 7px 14px;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(16,63,53,.09);
    transition: opacity .18s ease;
}

.range-track strong {
    color: var(--fia-green-950);
    font-size: 15px;
    line-height: 1.3;
}

.range-track small {
    max-width: 190px;
    color: var(--fia-text-soft);
    font-size: 12px;
    line-height: 1.35;
    text-align: right;
}

.range-track-line {
    grid-column: 1 / -1;
    position: relative;
    display: block;
    height: 8px;
    overflow: visible;
    border-radius: 999px;
    background:
        linear-gradient(
            to right,
            rgba(16,63,53,.06) 0%,
            rgba(16,63,53,.06) var(--start-pct),
            rgba(107,143,115,.30) var(--start-pct),
            rgba(107,143,115,.30) var(--peak-start-pct),
            rgba(22,61,46,.62) var(--peak-start-pct),
            rgba(22,61,46,.62) var(--peak-end-pct),
            rgba(107,143,115,.30) var(--peak-end-pct),
            rgba(107,143,115,.30) var(--end-pct),
            rgba(16,63,53,.06) var(--end-pct),
            rgba(16,63,53,.06) 100%
        );
}

.range-track-line::after {
    content: "";
    position: absolute;
    top: 50%;
    left: var(--range-marker);
    width: 12px;
    height: 12px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--fia-gold);
    box-shadow: 0 0 0 1px rgba(16,63,53,.14);
    transform: translate(-50%,-50%);
    transition: left .08s linear;
}

.range-track.is-peak strong {
    font-weight: 800;
}

.range-track.is-peak small {
    color: var(--fia-green-950);
    font-weight: 700;
}

.range-track.is-compatible {
    opacity: .88;
}

.range-track.is-outside {
    opacity: .50;
}

@media (max-width: 760px) {

    .fattoria-range-explorer {
        padding: 18px;
    }

    .range-explorer-value {
        margin-top: 18px;
    }

    .range-explorer-value strong {
        font-size: 38px;
    }

    .range-explorer-control {
        margin-top: 4px;
    }

    .range-track {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 14px 0;
    }

    .range-track small {
        max-width: none;
        text-align: left;
    }

    .range-track-line {
        grid-column: 1;
        height: 9px;
    }

    .range-explorer-ticks span {
        font-size: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .range-track,
    .range-track-line::after {
        transition: none;
    }
}
/* ==================================================
   RANGE EXPLORER V2 — COMPACT + CATEGORY COLORS
   ================================================== */

.fattoria-range-explorer {
    padding-top: 18px;
    padding-bottom: 16px;
}

.fattoria-range-explorer .editorial-card-head {
    padding-bottom: 11px;
}

.range-explorer-value {
    margin: 14px 0 2px;
}

.range-explorer-value strong {
    font-size: clamp(28px, 4vw, 38px);
}

.range-explorer-value span {
    font-size: 14px;
}

.range-explorer-control {
    margin-top: 2px;
    padding-bottom: 25px;
}

.range-explorer-tracks {
    margin-top: 14px;
}

.range-track {
    padding: 10px 0;
    gap: 4px 12px;
}

.range-track strong {
    font-size: 14px;
}

.range-track small {
    font-size: 11px;
}

.range-track-line {
    height: 6px;
}

/* colore base per categoria */

.range-track[data-range-category="virus"] {
    --range-color-soft: rgba(22,61,46,.22);
    --range-color-strong: rgba(22,61,46,.78);
}

.range-track[data-range-category="batteri"] {
    --range-color-soft: rgba(201,169,97,.24);
    --range-color-strong: rgba(180,140,55,.82);
}

.range-track[data-range-category="protozoi"] {
    --range-color-soft: rgba(107,143,115,.24);
    --range-color-strong: rgba(107,143,115,.82);
}

.range-track-line {
    background:
        linear-gradient(
            to right,
            rgba(16,63,53,.05) 0%,
            rgba(16,63,53,.05) var(--start-pct),

            var(--range-color-soft) var(--start-pct),
            var(--range-color-soft) var(--peak-start-pct),

            var(--range-color-strong) var(--peak-start-pct),
            var(--range-color-strong) var(--peak-end-pct),

            var(--range-color-soft) var(--peak-end-pct),
            var(--range-color-soft) var(--end-pct),

            rgba(16,63,53,.05) var(--end-pct),
            rgba(16,63,53,.05) 100%
        );
}

.range-track-line::after {
    width: 10px;
    height: 10px;
}

@media (max-width: 760px) {

    .fattoria-range-explorer {
        padding: 16px;
    }

    .range-explorer-value {
        margin-top: 12px;
    }

    .range-explorer-value strong {
        font-size: 32px;
    }

    .range-track {
        padding: 9px 0;
    }

    .range-track-line {
        height: 7px;
    }
}

/* ==================================================
   VITELLAIA MICRO UI — ARTICLE CANDIDATE
   ================================================== */

.diarrhea-vitellaia-card {
    margin: 22px 0 28px;
    overflow: hidden;
    border: 1px solid var(--fia-border);
    border-radius: 15px;
    background: #fff;
}

.diarrhea-vitellaia-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(16,63,53,.10);
    background: rgba(233,241,234,.58);
}

.diarrhea-vitellaia-head img {
    width: 50px;
    height: auto;
    object-fit: contain;
}

.diarrhea-vitellaia-head strong,
.diarrhea-vitellaia-head span {
    display: block;
}

.diarrhea-vitellaia-head strong {
    color: var(--fia-green-950);
    font-size: 15px;
}

.diarrhea-vitellaia-head span {
    margin-top: 2px;
    color: var(--fia-text-soft);
    font-size: 12px;
}

.diarrhea-check-row,
.diarrhea-detail-row,
.diarrhea-context-row {
    padding: 13px 15px;
}

.diarrhea-check-row,
.diarrhea-detail-row {
    border-bottom: 1px solid rgba(16,63,53,.08);
}

.diarrhea-check-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.diarrhea-check-label {
    color: var(--fia-green-950);
    font-weight: 700;
}

.diarrhea-check-actions {
    display: flex;
    gap: 7px;
}

.diarrhea-choice {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    min-height: 36px;
    padding: 6px 12px;
    border: 1px solid rgba(16,63,53,.15);
    border-radius: 10px;
    background: #fff;
    font-size: 13px;
    font-weight: 700;
}

.diarrhea-choice-yes {
    color: var(--fia-green-950);
    background: rgba(233,241,234,.66);
}

.diarrhea-choice-no {
    color: #8b433b;
}

.diarrhea-detail-row > span,
.diarrhea-context-row > span {
    display: block;
    margin-bottom: 8px;
    color: var(--fia-text-soft);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.diarrhea-detail-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.diarrhea-detail-chips span {
    padding: 6px 10px;
    border: 1px solid rgba(16,63,53,.13);
    border-radius: 999px;
    background: rgba(233,241,234,.44);
    color: var(--fia-green-950);
    font-size: 12px;
}

.diarrhea-context-row strong {
    color: var(--fia-green-950);
    font-size: 13px;
    line-height: 1.45;
}

@media (max-width: 600px) {

    .diarrhea-check-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .diarrhea-check-actions {
        width: 100%;
    }

    .diarrhea-choice {
        flex: 1;
        min-height: 40px;
    }
}