/* Il Regno - operatori B4, pagina autonoma per iframe */
:root {
    color-scheme: dark;
    --regno-fondo: #100e0d;
    --regno-scheda: #1d1917;
    --regno-bordo: #5b4834;
    --regno-oro: #c6a36b;
    --regno-testo: #f1e7d8;
    --regno-secondario: #c3b4a0;
}

* {
    box-sizing: border-box;
}

/* ==========================================
   DIMENSIONAMENTO IFRAME
   ========================================== */

html,
body {
    margin: 0;
    padding: 0;
    min-height: 0;
    height: auto;
    overflow: hidden;
}

body {
    font-family: "Raleway", Arial, Helvetica, sans-serif;
    color: var(--regno-testo);
}

.operatori {
    width: 100%;
    padding: 8px;
}

.operatori__griglia {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 275px), 1fr));
    gap: 12px;
}

/* ==========================================
   SCHEDA OPERATORE
   ========================================== */

.operatore {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    min-height: 128px;
    padding: 13px;
    background: var(--regno-scheda);
    border: 1px solid var(--regno-bordo);
    border-radius: 9px;
}

/* Immagine decorativa illustrativa, stabile per codice operatore. */
.operatore__ritratto {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 104px;
    width: 104px;
    height: 104px;
    overflow: hidden;
    border: 2px solid var(--regno-oro);
    border-radius: 50%;
    background: #28211d;
}

.operatore__immagine {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.operatore__contenuto {
    flex: 1 1 auto;
    min-width: 0;
}

.operatore__nome {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 6px;
    row-gap: 1px;
    font-size: 15px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.operatore__codice {
    color: var(--regno-secondario);
    font-size: 12px;
}

.operatore__nome strong {
    color: var(--regno-testo);
    font-weight: 700;
}

/* Indicatore di stato: stesso sprite 48x192, ridotto a 24x96. */
.operatore__disponibilita {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    margin-top: 7px;
}

.operatore__icona {
    display: block;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    background-image: url("../img/operatori/phones.png");
    background-size: 24px 96px;
    background-repeat: no-repeat;
    background-position: 0 0;
}

.operatore--occupato .operatore__icona {
    background-position: 0 0;
}

.operatore--libero .operatore__icona {
    background-position: 0 -24px;
    animation: regno-luce 1.5s 20 alternate ease-in-out;
}

.operatore--busy .operatore__icona,
.operatore--pausa .operatore__icona {
    background-position: 0 -48px;
}

.operatore--offline .operatore__icona {
    background-position: 0 -72px;
}

.operatore__stato {
    display: block;
    min-width: 0;
    color: var(--regno-secondario);
    font-size: 12px;
    line-height: 1.35;
}

.operatore--occupato .operatore__stato {
    color: #ef817b;
}

.operatore--libero .operatore__stato {
    color: #89c797;
}

.operatore--pausa .operatore__stato,
.operatore--busy .operatore__stato {
    color: #e5b775;
}

/* ==========================================
   PULSANTE PRESENTAZIONE AUDIO
   ========================================== */

.operatore__play {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    max-width: 100%;
    min-height: 32px;
    margin-top: 9px;
    padding: 5px 10px;
    border: 1px solid var(--regno-bordo);
    border-radius: 20px;
    background: #29211b;
    color: var(--regno-oro);
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease;
}

.operatore__play:hover {
    background: #392d22;
    border-color: var(--regno-oro);
}

.operatore__play:focus-visible {
    outline: 2px solid var(--regno-oro);
    outline-offset: 3px;
}

.operatore__play[aria-pressed="true"] {
    background: #392d22;
    border-color: var(--regno-oro);
}

.operatore__play-icona {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 17px;
    width: 17px;
    height: 17px;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 9px;
    line-height: 1;
}

.operatore__play-testo {
    min-width: 0;
}

.operatori__messaggio {
    margin: 12px;
    padding: 14px;
    color: var(--regno-oro);
    font-size: 14px;
    text-align: center;
}

@keyframes regno-luce {
    from { filter: brightness(1); }
    to { filter: brightness(1.3); }
}

@media (max-width: 440px) {
    .operatori__griglia {
        gap: 10px;
    }

    .operatore {
        gap: 12px;
        min-height: 112px;
        padding: 10px;
    }

    .operatore__ritratto {
        flex-basis: 88px;
        width: 88px;
        height: 88px;
    }

    .operatore__nome {
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .operatore__icona {
        animation: none !important;
    }

    .operatore__play {
        transition: none;
    }
}
