/* ===================================================
   STUDIO SEBASTIANO CIBIEN - Main Stylesheet
   ================================================== */

/* Google Fonts - Montserrat */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

/* CSS Variables - Light Theme (Default) */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f8f8;
    --text-primary: #000000;
    --text-secondary: #333333;
    --text-muted: #666666;
    --accent: #C41E3A;
    --accent-hover: #A01828;
    --border: #e0e0e0;
    --shadow: rgba(0, 0, 0, 0.1);
    --overlay: rgba(255, 255, 255, 0.95);
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #2a2a2a;
    --bg-secondary: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-muted: #999999;
    --accent: #C41E3A;
    --accent-hover: #E02844;
    --border: #404040;
    --shadow: rgba(0, 0, 0, 0.3);
    --overlay: rgba(42, 42, 42, 0.95);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-hover);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background-color 0.3s ease;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo img {
    height: 120px;
    width: auto;
}

/* Navigation */
nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-primary);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    padding: 0.5rem 0;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Language Selector */
.lang-selector {
    display: flex;
    gap: 0.5rem;
    border-left: 1px solid var(--border);
    padding-left: 1rem;
}

.lang-selector a {
    padding: 0.25rem 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
}

.lang-selector a.active {
    color: var(--accent);
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--text-primary);
    transition: all 0.3s ease;
}

/* Hero / Carousel */
.hero {
    position: relative;
    height: 70vh;
    min-height: 400px;
    max-height: 800px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-primary);
    padding-bottom: 4rem;
}

.carousel {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.carousel-item.active {
    opacity: 1;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: var(--bg-primary);
}

.carousel-caption {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--overlay);
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    max-width: 80%;
    text-align: center;
}

.carousel-caption h3 {
    color: var(--text-primary);
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
}

.carousel-indicators {
    position: absolute;
    bottom: -3rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.75rem;
}

.carousel-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #d0d0d0;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.carousel-indicator.active {
    background-color: var(--accent);
    opacity: 1;
    transform: scale(1.4);
    box-shadow: 0 2px 8px rgba(196, 30, 58, 0.3);
}

/* Sections */
section {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    color: var(--text-primary);
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    max-width: 700px;
    margin: -2rem auto 3rem;
}

/* Offset per scroll ancore - compensa header fisso */
section[id] {
    scroll-margin-top: 180px; /* Altezza header (circa 120px) + margine extra */
}

/* Applica anche agli elementi h2 con id */
h2[id] {
    scroll-margin-top: 180px;
}

/* Applica a tutti gli elementi con id per sicurezza */
*[id] {
    scroll-margin-top: 180px;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.service-card {
    padding: 2rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow);
    border-color: var(--accent);
}

.service-card h3 {
    color: var(--accent);
    margin-bottom: 1rem;
}

.service-card p {
    font-size: 0.95rem;
}

/* Offices */
.offices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 3rem;
    margin-top: 2rem;
}

.office-card {
    padding: 2rem;
    background-color: var(--bg-secondary);
    border-left: 4px solid var(--accent);
    border-radius: 4px;
}

.office-card h3 {
    color: var(--accent);
    margin-bottom: 1rem;
}

.office-card address {
    font-style: normal;
    line-height: 1.8;
    color: var(--text-secondary);
}

.office-map {
    width: 100%;
    height: 300px;
    margin-top: 1rem;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.office-map {
    width: 100%;
    height: 300px;
    margin-top: 1rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    z-index: 1;
}

/* Stili personalizzati per Leaflet */
.leaflet-container {
    border-radius: 4px;
    font-family: 'Montserrat', sans-serif;
}

.leaflet-popup-content-wrapper {
    border-radius: 4px;
    font-family: 'Montserrat', sans-serif;
}

.leaflet-popup-content strong {
    color: var(--accent);
}

/* Marker personalizzato */
.custom-marker {
    background: transparent;
    border: none;
}

/* Controlli zoom stile minimale */
.leaflet-control-zoom a {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
}

.leaflet-control-zoom a:hover {
    background-color: var(--accent) !important;
    color: white !important;
}

/* Attribution piccola */
.leaflet-control-attribution {
    font-size: 10px !important;
    opacity: 0.7;
}

[data-theme="dark"] .leaflet-tile {
    filter: brightness(0.8) contrast(1.2) saturate(0.8);
}

/* Projects */
.projects-list {
    max-width: 800px;
    margin: 0 auto;
}

.project-year {
    margin: 3rem 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
    font-size: 1.75rem;
    color: var(--text-primary);
}

.project-item {
    padding: 1.5rem;
    margin-bottom: 1rem;
    background-color: var(--bg-secondary);
    border-left: 3px solid var(--border);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.project-item:hover {
    border-left-color: var(--accent);
    transform: translateX(5px);
}

.project-item h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.project-item p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.download-cv {
    display: inline-block;
    margin: 2rem auto;
    padding: 1rem 2rem;
    background-color: var(--accent);
    color: white;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.download-cv:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow);
}

/* News */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.news-card {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow);
}

.news-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-content {
    padding: 1.5rem;
}

.news-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.news-card h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.news-excerpt {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.read-more {
    color: var(--accent);
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Contact Form */
.contact-intro {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3rem;
    color: var(--text-secondary);
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.form-checkbox input[type="checkbox"] {
    width: auto;
    margin-top: 0.25rem;
    cursor: pointer;
}

.form-checkbox label {
    margin: 0;
    font-weight: normal;
}

.honeypot {
    position: absolute;
    left: -9999px;
    top: -9999px;
}

.btn-submit {
    width: 100%;
    padding: 1rem;
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow);
}

.alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Footer */
footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-content {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
    list-style: none;
}

.footer-links a {
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.social-links a:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-3px);
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--overlay);
    border-top: 2px solid var(--accent);
    padding: 1.5rem;
    z-index: 9999;
    box-shadow: 0 -5px 20px var(--shadow);
    backdrop-filter: blur(10px);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.cookie-text {
    flex: 1;
}

.cookie-text h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.cookie-text p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.cookie-buttons {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

.btn-cookie {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-cookie-settings {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-cookie-settings:hover {
    border-color: var(--accent);
}

.btn-cookie-accept {
    background-color: var(--accent);
    color: white;
}

.btn-cookie-accept:hover {
    background-color: var(--accent-hover);
}

.btn-cookie-reject {
    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* Cookie Modal */
.cookie-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cookie-modal.active {
    display: flex;
}

.cookie-modal-content {
    background-color: var(--bg-primary);
    border-radius: 8px;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.cookie-option {
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.cookie-option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.cookie-option h4 {
    margin: 0;
    color: var(--text-primary);
}

.cookie-option p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--accent);
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}


/* ===================================================
   MAPPE - OVERLAY MOBILE MULTILINGUA
   =================================================== */
.office-map {
    position: relative;
    height: 300px;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        padding: 1rem;
    }
    
    .logo img {
        height: 80px;
    }
    
    /*MAPPE RESPONSIVE*/
    /* Overlay in basso al centro */
    .office-map::after {
        content: '👆 Tieni premuto per interagire';
        position: absolute;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(196, 30, 58, 0.95);
        color: white;
        padding: 0.75rem 1.5rem;
        border-radius: 25px;
        font-size: 0.85rem;
        pointer-events: none;
        z-index: 1000;
        transition: opacity 0.3s, transform 0.3s;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
        font-family: 'Montserrat', sans-serif;
        font-weight: 500;
        white-space: nowrap;
        backdrop-filter: blur(5px);
    }
    
    /* Versione inglese */
    html[lang="en"] .office-map::after {
        content: '👆 Press and hold to interact';
    }
    
    /* Versione tedesca */
    html[lang="de"] .office-map::after {
        content: '👆 Gedrückt halten zum Interagieren';
    }
    
    /* Quando la mappa è attiva */
    .office-map.map-active::after {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    
    /* Bordo rosso quando attiva */
    .office-map.map-active {
        border: 2px solid var(--accent);
    }
    
    /* Animazione pulsante al caricamento */
    @keyframes pulse-overlay {
        0%, 100% {
            transform: translateX(-50%) scale(1);
        }
        50% {
            transform: translateX(-50%) scale(1.05);
        }
    }
    
    .office-map::after {
        animation: pulse-overlay 2s ease-in-out infinite;
    }
    
    .office-map.map-active::after {
        animation: none;
    }


    /* AGGIUNGI QUI SUBITO DOPO .logo img */
    section[id],
    h2[id],
    *[id] {
        scroll-margin-top: 100px;
    }
    /* FINE AGGIUNTA */

    nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: var(--bg-primary);
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem;
        transition: left 0.3s ease;
        box-shadow: 5px 0 20px var(--shadow);
        z-index: 1001;
    }
    
    nav.active {
        left: 0;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }
    
    .nav-links li {
        width: 100%;
    }
    
    .nav-links a {
        display: block;
        padding: 0.75rem 0;
        width: 100%;
    }
    
    .lang-selector {
        border-left: none;
        border-top: 1px solid var(--border);
        padding-left: 0;
        padding-top: 1rem;
        margin-top: 1rem;
    }
    
    .menu-toggle {
        display: flex;
        z-index: 1002;
    }
    
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
    
    .hero {
        height: 50vh;
        min-height: 400px;
        padding-bottom: 4rem;
    }
    
    .carousel-caption {
        left: 50%;
        transform: translateX(-50%);
        bottom: 1rem;
        max-width: 90%;
        padding: 0.75rem 1rem;
    }
    
    .carousel-indicators {
        bottom: -3rem;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .offices-grid {
        grid-template-columns: 1fr;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .cookie-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cookie-buttons {
        flex-direction: column;
    }
    
    .btn-cookie {
        width: 100%;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    .container {
        padding: 0 15px;
    }
    
    section {
        padding: 3rem 0;
    }
    
    .contact-form {
        padding: 1.5rem;
    }
}

/* Print Styles */
@media print {
    header, footer, .cookie-banner, .theme-toggle, .menu-toggle {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}
/* ===================================================
   STILI PER CONTENUTI FORMATTATI (HTML da TinyMCE)
   ================================================== */

.formatted-content {
    max-width: 800px;
    margin: 0 auto 2rem;
    color: var(--text-secondary);
    line-height: 1.8;
    text-align: center;
}

.formatted-content p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.formatted-content p:last-child {
    margin-bottom: 0;
}

/* Grassetto */
.formatted-content strong,
.formatted-content b {
    font-weight: 700;
    color: var(--text-primary);
}

/* Corsivo */
.formatted-content em,
.formatted-content i {
    font-style: italic;
}

/* Sottolineato */
.formatted-content u {
    text-decoration: underline;
}

/* Titoli dentro il contenuto formattato */
.formatted-content h2 {
    font-size: 1.75rem;
    margin: 2rem 0 1rem;
    color: var(--accent);
    font-weight: 600;
}

.formatted-content h3 {
    font-size: 1.5rem;
    margin: 1.5rem 0 0.75rem;
    color: var(--text-primary);
    font-weight: 600;
}

.formatted-content h4 {
    font-size: 1.25rem;
    margin: 1rem 0 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* Elenchi puntati */
.formatted-content ul {
    list-style: disc;
    margin: 1.5rem 0;
    padding-left: 2rem;
    text-align: left;
}

.formatted-content ul li {
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

/* Elenchi numerati */
.formatted-content ol {
    list-style: decimal;
    margin: 1.5rem 0;
    padding-left: 2rem;
    text-align: left;
}

.formatted-content ol li {
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

/* Link */
.formatted-content a {
    color: var(--accent);
    text-decoration: underline;
    transition: color 0.3s ease;
}

.formatted-content a:hover {
    color: var(--accent-hover);
}

/* Citazioni */
.formatted-content blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-muted);
}

/* Tabelle (se abilitate) */
.formatted-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.formatted-content table th,
.formatted-content table td {
    padding: 0.75rem;
    border: 1px solid var(--border);
    text-align: left;
}

.formatted-content table th {
    background-color: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .formatted-content {
        max-width: 100%;
    }
    
    .formatted-content ul,
    .formatted-content ol {
        padding-left: 1.5rem;
    }
    
    .formatted-content h2 {
        font-size: 1.5rem;
    }
    
    .formatted-content h3 {
        font-size: 1.25rem;
    }
    
    .formatted-content h4 {
        font-size: 1.1rem;
    }
}



/* Dark mode */
@media (max-width: 768px) {
    [data-theme="dark"] .office-map::after {
        background: rgba(220, 38, 38, 0.95);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    }
    }

/* ===================================================
PAGE TRANSITION EFFECT
================================================== */
/*body {
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}*/
body{
    opacity:1;/* default visibile */
    transition: opacity 0.4s ease-in-out;
 
}

/*body.page-loaded {
    opacity: 1;
}*/

body.page-transition {
    opacity: 0;
}

/* Colore di sfondo di sicurezza per evitare flash bianchi in Dark Mode */
html {
    background-color: var(--bg-primary);
}