/* Definizione delle variabili globali */
:root {
    --colore-testi: #0F0F0F;
    --colore-sfondo: #FFFDED;
    --colore-footer: #19171a;
    --font-serif: "PT", Georgia, Times, "Times New Roman", serif;
    --font-sans: "Ubuntu", Arial, Helvetica, sans-serif;
    --larghezza-massima: 800px;
}

/* Reset base */
* {
    box-sizing: border-box;
    transition: all 0.3s ease-out;
}

*:focus {
    outline: none;
}

/* Stili generali */
html,
body {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-serif);
    background-color: var(--colore-sfondo, #f9edcc);
    color: var(--colore-testi);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    transition: all 0.35s;
}


/* TOP BAR */

.top-bar {
    height: 50px !important;
}

.faN {
    width: 30px !important;
    height: 30px !important;
}

/* HEADER */

/* Intestazione */
header {
    width: 100%;
    height: 70vh;
    position: relative;
    background: var(--colore-sfondo) url(../img/copertina3.png) center / cover no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

h1 {
    max-width: var(--larghezza-massima);
    font-size: 5rem;
    color: white;
    text-align: center;
    font-family: sans-serif;
}

.sommario {
    max-width: var(--larghezza-massima);
    color: white;
    font-size: 1.5rem;
    font-weight: 400;
    font-style: italic;
    line-height: 2rem;
    text-align: center
}

.firma {
    margin-top: 70px;
    font-size: 1.1rem;
    font-weight: 400;
    font-style: italic;
}

.data {
    font-size: 1.1rem;
    font-weight: 700;
    padding-top: 10px;
}


/* Elementi */

article,
section,
div,
p,
h2,
h3 {
    width: 100%;
}

h2,
h3 {
    font-family: sans-serif;
}

article {
    max-width: var(--larghezza-massima);
    margin: auto;
}

section {
    margin: 50px auto 20px;
}

section:first-of-type {
    margin-top: 20px;
}

h2 {
    font-size: 2.2rem;
}

h3 {
    font-family: var(--font-sans);
    font-size: 1.6rem;
    margin: 1rem 0 0.2rem;
}

p {
    font-size: 1.3rem;
    line-height: 1.8rem;
}

a {
    color: #000000;
}

.grafico_sommario {
    font-family: var(--font-sans);
    font-size: 1.2rem;
    margin: 0.6rem 0;
}

.grafico_fonte {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    margin: 0.6rem 0 1.2rem;
    opacity: 0.8;
}

/* Figure */
figure {
    margin: 2.5rem 0;
}

img.full-width {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto;
}


/* STILI PER LA TABELLA DEI CONTENUTI */
/* Stile base della tabella dei contenuti - sarà al 100% su mobile */
.table-of-contents {
    border: 1px solid #B0504B;
    background-color: transparent;
    padding: 20px;
    margin: 30px auto;
    /* Centrato orizzontalmente */
    border-radius: 5px;
    font-family: Arial, Helvetica, sans-serif;
    width: 100%;
    /* Larghezza 100% per dispositivi mobili */
    box-sizing: border-box;
}

/* Per desktop (schermi più grandi di 768px) */
@media screen and (min-width: 768px) {
    .table-of-contents {
        width: 50%;
        /* Larghezza 50% per desktop */
        margin-left: 0;
        /* Per centrare */
        margin-right: auto;
        /* Per centrare */
    }
}

/* Stili per il titolo */
.table-of-contents .toc-title {
    margin-top: 0;
    margin-bottom: 15px;
    color: #B0504B;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    border-bottom: 1px solid #B0504B;
    padding-bottom: 8px;
    text-transform: uppercase;
    font-weight: bold;
}

/* Stili per la lista e gli elementi */
.table-of-contents ul {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
}

.table-of-contents li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 24px;
}

.table-of-contents li:before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background-color: #B0504B;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6'%3E%3C/path%3E%3Cpolyline points='15 3 21 3 21 9'%3E%3C/polyline%3E%3Cline x1='10' y1='14' x2='21' y2='3'%3E%3C/line%3E%3C/svg%3E");
    mask-size: contain;
    mask-repeat: no-repeat;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6'%3E%3C/path%3E%3Cpolyline points='15 3 21 3 21 9'%3E%3C/polyline%3E%3Cline x1='10' y1='14' x2='21' y2='3'%3E%3C/line%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
}

.table-of-contents a {
    text-decoration: none;
    color: #333;
    font-size: 16px;
    display: inline-block;
    transition: color 0.3s ease;
}

.table-of-contents a:hover {
    color: #B0504B;
    text-decoration: underline;
}


/*Stile per le citazioni*/
cite {
    display: block;
    margin-left: 2em;
    /* rientro a sinistra */
    font-size: 1.5em;
    /* dimensione aumentata */
    line-height: 1.5;
    /* interlinea più spaziosa */
    font-style: italic;
    /* corsivo */
    margin-top: 1.2em;
    /* spazio prima del box */
    margin-bottom: 1.2em;
    /* spazio dopo il box */
    position: relative;
}

cite .quoted-text::before {
    content: open-quote;
}

cite .quoted-text::after {
    content: close-quote;
}

cite .author {
    display: block;
    text-align: right;
    font-style: normal;
    font-size: 0.8em;
    margin-top: 0.8em;
}

cite .source {
    display: block;
    text-align: right;
    font-style: italic;
    font-size: 0.7em;
}

/* Video una sola esecuzione */
.video-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.video-container video {
    width: 100%;
    display: block;
}

.reload-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: none;
    /* Inizialmente nascosto */
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
    z-index: 20;
    /* Assicurati che sia sopra altri elementi */
    pointer-events: auto;
    /* Assicura che il pulsante riceva eventi click */
}

.reload-button:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.temp-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.3s;
}

.temp-play-button:hover {
    background-color: rgba(0, 0, 0, 0.7);
}


/* Animazione del pulsante */
@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Responsive design */
@media only screen and (max-width: 480px) {
    header {
        height: 70vh;
        padding: 0 20px;
    }

    h1 {
        font-size: 3.2rem;
        max-width: 100%;
    }

    article {
        max-width: 100%;
        padding: 0 15px;
    }

    section {
        margin-top: 20px;
    }

    cite {
        margin-left: 0;
    }

    .sommario {
        max-width: 100%;
    }
}