#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f4ece1;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

#loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-container {
    position: relative;
    width: 280px;
    height: 280px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-logo {
    position: absolute;
    width: 160px;
    height: auto;
    z-index: 2;
}

.loading-wheel {
    position: absolute;
    width: 220px;
    filter: sepia(0.8) brightness(0.95) contrast(0.95);
    animation: rotate 3s linear infinite;
    opacity: 0.85;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

:root {
    --bg: #f7f8fb;
    --sidebar-bg: #f4ece1;
    --text: #111827;
    --muted: #9ca3af;
}

html,body {
    height: 100%;
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    color: var(--text);
    background: var(--bg);
}

.layout {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

/* Sidebar */
.sidebar {
    width: 100%;
    background: var(--sidebar-bg);
    color: #4a4a4a;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0.75rem 1.25rem;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    z-index: 100;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(44, 24, 16, 0.08);
    backdrop-filter: blur(5px);
}

.logo {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: .25rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.logo img {
    max-width: 70px;
    height: auto;
    display: block;
    border-radius: 6px;
    transition: transform 0.3s ease;
}

.logo img:hover {
    transform: scale(1.05);
}

.vintage-text {
    margin: 0;
    font-family: 'Playfair Display', 'Times New Roman', serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: #2c1810;
    letter-spacing: 0.03em;
    text-shadow: 1px 1px 0 #f4ece1;
}

nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

nav a {
    display: block;
    padding: .4rem .6rem;
    color: #2c1810;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

nav a:hover {
    color: #8b4513;
    transform: translateY(-1px);
}

.main {
    flex: 1;
    padding: 2rem;
    box-sizing: border-box;
}

header{
    margin: auto;
    width: 100%;
    background-image: url('../foto/optimized/724-bastia.webp');
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    min-height: 500px;
    animation: carosello-main 120s infinite ease-in-out;
}

@keyframes carosello-main {
    0% {background-image: url('../foto/optimized/724-bastia.webp');}
    12.5% {background-image: url('../foto/optimized/aln-bastia.webp');}
    25% {background-image: url('../foto/optimized/aln-carru.webp');}
    37.5% {background-image: url('../foto/optimized/casaralta-per-b-c.webp');}
    50% {background-image: url('../foto/optimized/cherasco-vapore.webp');}
    62.5% {background-image: url('../foto/optimized/clavesana-ale.webp');}
    75% {background-image: url('../foto/optimized/farigliano-esercizio.webp');}
    87.5% {background-image: url('../foto/optimized/narzole-vapore.webp');}
    99% {background-image: url('../foto/optimized/ultmo-treno.webp');}

    100% {background-image: url('../foto/optimized/724-bastia.webp');}
}

p.lead { color: var(--muted); margin-top: 0.25rem; }

/* Metro Map Styles */
.metro-map {
    margin: 3rem auto;
    padding: 2rem;
    max-width: 400px;
    min-height: 1000px;
    display: flex;
    justify-content: center;
}

.line {
    position: relative;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    min-height: 1100px;
}

.line::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 30px;
    bottom: 13px;
    width: 6px;
    background: #8B7355;
    transform: translateX(-50%);
}

.station {
    position: relative;
    margin: 3.5rem 0;
    width: 100%;
}

.station:first-child {
    margin-top: 2rem;
}

.station:last-child {
    margin-bottom: 2rem;
}

.station .dot {
    width: 12px;
    height: 12px;
    background: #8B7355;
    border: 3px solid #f4ece1;
    border-radius: 50%;
    position: absolute;
    margin-top: -9px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    box-shadow: 0 0 0 3px #8B7355;
}

.station.major .dot {
    width: 20px;
    height: 20px;
    background: #2c1810;
    border: 4px solid #f4ece1;
    margin-top: -13px;
    box-shadow: 0 0 0 4px #8B7355,
                0 0 0 8px rgba(139, 115, 85, 0.2);
}

.station .label {
    font-family: 'Playfair Display', serif;
    color: #2c1810;
    font-size: 1.1rem;
    white-space: nowrap;
    position: absolute;
    left: calc(50% + 2.6rem) !important;
    top: 50%;
    transform: translateY(-50%);
}


.station::after {
    content: '';
    position: absolute;
    left: 50%;
    width: 40px;
    height: 2px;
    background: #8B7355;
    transform: translateY(-50%);
}

/* Responsive styles for the metro map */
@media (max-width: 640px) {
    .metro-map {
        padding: 1rem;
        margin: 2rem auto;
        max-width: 100%;
    }
    
    .station {
        margin: 3.5rem 0;
    }
    
    .station .label {
        font-size: 1rem;
        left: calc(50% + 2.6rem) !important;
    }

    .direction {
        font-size: 0.8rem;
    }

    .direction.left {
        right: calc(50% + 1rem);
        top: -1rem;
    }

    .direction.right {
        top: -2.5rem;
    }
}

/* Footer styles */
.site-footer {
    background-color: #f4ece1;
    padding: 2rem 0;
    margin-top: 4rem;
    border-top: 1px solid rgba(139, 115, 85, 0.2);
}

.footer-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.footer-text {
    font-family: 'Playfair Display', serif;
    color: #2c1810;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
    opacity: 0.9;
}

.footer-logo {
    flex-shrink: 0;
}

.sepia-image {
    max-width: 100px;
    height: auto;
    filter: sepia(0.6) brightness(0.95) contrast(0.95);
}

/* Responsive styles */
@media (max-width: 640px) {
    .sidebar {
        padding: .5rem;
        gap: 0.5rem;
    }
    .logo img { max-width: 40px; }
    .vintage-text {
        font-size: 1.2rem;
    }
    nav { 
        display: none;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
        padding: 0 1.5rem;
    }
    
    .footer-text {
        font-size: 0.9rem;
    }
    
    .sepia-image {
        max-width: 90px;
    }
}
