/* =========================================
   BASE, VARIABILI E PRELOADER
   ========================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #8c6f4d;
    --secondary-color: #b67b0d;
    --background-color: rgb(253, 247, 238);
    --text-color: #333333;
    --border-color: #005080;
}

html {
    background-color: var(--primary-color); /* Colora l'overscroll di marrone */
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: 'Playfair Display', Georgia, serif;
    width: 100%;
    background-color: var(--primary-color);
    animation: fadeIn 0.4s ease-in-out;
}

body.no-scroll {
    overflow: hidden !important;
    height: 100vh !important;
    position: fixed;
    width: 100%;
}

main {
    color: var(--primary-color);
    text-shadow: 1px 1px 2px #d9cbbf;
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    padding: 20px;
    font-size: x-large;
    z-index: 1;
    overflow-x: hidden;
    background-color: var(--background-color);
}

/* Titoli condivisi nelle pagine interne */
h1.otherTitle {
    font-size: 3rem;
    border-bottom: 2px solid #c4b494;
    padding-bottom: 0.3em;
    max-width: fit-content;
}

h2.otherSubtitle {
    font-size: 1.8rem;
    color: #696969;
    font-style: italic;
    margin-top: -1rem;
    margin-bottom: 2rem;
    text-shadow: 0.5px 0.5px 1px #c4b494;
    padding-left: 0.5rem;
    border-left: 4px solid var(--primary-color);
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#preloader.loaded {
    opacity: 0;
    visibility: hidden;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #e0d0c0;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}