/* --- STILE SISTEMA OPERATIVO RETRO --- */
:root {
    --bg-pattern: #555;
    --window-bg: #ffffff;
    --text-color: #000000;
    --border-black: #000000;
}

* { box-sizing: border-box; }

body {
    /* Sfondo Desktop */
    background-color: #ddd;
    background-image:
        linear-gradient(45deg, #aaa 25%, transparent 25%, transparent 75%, #aaa 75%, #aaa),
        linear-gradient(45deg, #aaa 25%, transparent 25%, transparent 75%, #aaa 75%, #aaa);
    background-size: 4px 4px;
    background-position: 0 0, 2px 2px;

    font-family: 'Geneva', 'Verdana', sans-serif;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* --- FINESTRA DOCUMENTO --- */
.mac-window {
    background: var(--window-bg);
    border: 2px solid var(--border-black);
    box-shadow: 10px 10px 0px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 800px;
    margin-top: 20px;
    margin-bottom: 40px;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* --- BARRA TITOLO --- */
.title-bar {
    border-bottom: 2px solid var(--border-black);
    height: 50px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: repeating-linear-gradient(to bottom, #fff, #fff 2px, #000 2px, #000 4px);
}

.title-text {
    background: #fff;
    padding: 0 15px;
    font-weight: bold;
    font-size: 1.1rem;
    z-index: 2;
    border-left: 5px solid white;
    border-right: 5px solid white;
}

/* --- TASTO INDIETRO (FRECCIA) --- */
.back-btn {
    position: absolute;
    left: 8px;
    width: 44px;
    height: 44px;
    background: white;
    border: 2px solid black;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
}

/* Triangolo CSS per la freccia (nitido e retro) */
.arrow-shape {
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 8px solid black;
    margin-right: 2px;
}

/* Effetto Click: Inversione colori */
.back-btn:focus-visible {
    outline: 2px solid black;
    outline-offset: 3px;
}

.back-btn:active {
    background: black;
}
.back-btn:active .arrow-shape {
    border-right-color: white;
}

/* --- CONTENUTO DOCUMENTO --- */
.document-content {
    min-width: 0;
    overflow-wrap: anywhere;
    padding: 40px 50px;
    line-height: 1.6;
    font-size: 1.05rem;
    min-height: 400px;
    padding-bottom: 60px;
}

@media (max-width: 600px) {
    .document-content { padding: 20px; padding-bottom: 40px; }
    body { padding: 10px; }
}

h1 {
    font-family: 'Chicago', 'Impact', sans-serif;
    font-size: clamp(1.6rem, 6vw, 2.5rem);
    line-height: 1.15;
    overflow-wrap: anywhere;
    margin-top: 0;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.meta-info {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    border-bottom: 2px dashed black;
    padding-bottom: 20px;
    margin-bottom: 30px;
    color: #444;
}

p { margin-bottom: 1.5rem; }

img {
    max-width: 100%;
    height: auto;
    border: 2px solid black;
    margin: 20px 0;
    filter: grayscale(100%) contrast(120%);
    display: block;
}

blockquote {
    border-left: 4px solid black;
    margin: 20px 0;
    padding: 10px 20px;
    font-style: italic;
    background: #f0f0f0;
}

::selection { background: black; color: white; }

/* Scrollbar personalizzata */
::-webkit-scrollbar { width: 18px; border-left: 2px solid black; }
::-webkit-scrollbar-thumb { background: white; border: 2px solid black; box-shadow: inset 2px 2px 0 #999; }
::-webkit-scrollbar-track { background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAIklEQVQIW2NkQAKrVq36zwjjgzjwqgABXA6YAeKAcxnYwAAAdyIbkG3s5cEAAAAASUVORK5CYII='); }