:root {
    --turval-green-light: rgba(174, 222, 193);
    --turval-green-bkg: rgba(174, 222, 193, 0.15);
    --turval-green-dark: #7eb199;
    --turval-green-text: #76BC93;
    --turval-blue: #4A8AC2;
    --turval-footer: #05111D;
    --turval-gray: #f2f2f2;
    --turval-text-color: #333;
    --gray-text: #4b5563;
    --light-gray-border: #e5e7eb;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box; /* Padding doesn't break width */
    margin: 0;
    padding: 0;
}
body { margin: 0; font-family: 'Montserrat', sans-serif; color: var(--turval-text-color); background: #fff; line-height: 1.5; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; padding: 0; margin: 0; }
img { max-width: 100%; display: block; }
img.circle { border-radius: 50%; width: 90%;}
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* Utilities */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.items-center { align-items: center; }
.hidden { display: none; }
.green {color: var(--turval-green-text);}
.bold {font-weight: 700;}

/* Header */
header { }
.header-inner {  display: grid; grid-template-columns: 1fr 4fr; position: relative;     }

.payoff {align-self: end;}
/*.payoff div { font-size: 1rem; margin-left: 5px; font-weight: 700; font-family: "Besley", serif; }
.payoff > div > span > span { font-size:120%; }*/
.payoff div { font-size: 1rem; margin-left: 5px; font-weight: 700; font-family: "Besley", serif; text-align:left; }
.payoff > div > span > span { font-size:120%; }
.flags {  display: flex;   gap: 0.8rem; justify-content: center; }
.flag-selected { border-bottom: 3px solid var(--turval-green-dark); border-radius: 10%;}
.flags img { height: 1.5rem; cursor: pointer; opacity: 0.8; transition: opacity 0.2s;margin-bottom: 3px;  }
.flags img:hover { opacity: 1; }

.flags-area { position: absolute; right: 10px; top: 10px;}


@media (min-width: 768px) {
    /*.payoff div {  font-size: 1.25rem;  }*/
    .payoff div {  font-size: 1.5rem;  }
    .flags-area {position: absolute; right: 50px; top: 10px;}
    /*.header-inner { grid-template-columns: 1fr 4fr 1fr;}
    .flags-area {align-self: end; padding-bottom: 5px; position: relative; }*/
}


/* Logo Section */
div.logos-area {align-items: center;  width: 150px; padding: 5px;}


/* Footer */
footer { background-color: var(--turval-footer); color: #9ca3af; padding: 2.5rem 0; font-size: 0.75rem; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.footer-grid-2 { display: grid; grid-template-columns: 1fr ; gap: 2rem; }
.footer-col p { color: white; font-weight: 700; margin-bottom: 1rem; margin-top: 1.5rem; text-transform: uppercase; }
.footer-col-2 p { color: white; font-weight: 400; margin-bottom: 1rem; margin-top: 1.5rem; text-align: left;  }
.footer-col-2:nth-child(2) { text-align: right;  }
.footer-col p:first-child { margin-top: 0; }
.footer-col-2 p:first-child { margin-top: 0; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col ul li a:hover { color: white; }

@media (min-width: 768px) {
    .footer-grid { grid-template-columns: repeat(4, 1fr); }
    .footer-grid-2 { grid-template-columns: repeat(2, 1fr); }
    .footer-col-2 p { text-align: left;}

}

/* Hero */
.hero { width: 100%; height: 9rem; position: relative; overflow: hidden; }
.hero img { width: 100%; height: 100%; object-fit: cover; object-position: center;  }

/* Main Content Layout */
.main-container { padding: 2rem 1rem; max-width: 1200px; margin: 0 auto;  }
.main-container-sidebar { display: grid; grid-template-columns: 1fr ; gap: 2rem; }


/* Sidebar */
.sidebar {grid-row: 2;}  /* change in media min 760 */
.sidebar p { font-size: 1.25rem;
    font-weight: 400;
    color: #1f2937;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    margin-top: 0;
}
.sidebar-list li {
    border-bottom: 1px dotted #d1d5db; padding: 0.5rem 0;
    justify-content: space-between; align-items: center;
    font-size: 0.875rem; cursor: pointer; transition: color 0.2s;
}
.sidebar-list li:hover { color: #16a34a; }
.sidebar-list li.active { color: var(--turval-green-text); font-weight: 500; }


h1 { font-size: 1.5rem; font-weight: 700; color: var(--turval-green-text); margin-bottom: 1rem; margin-top: 0; }

.fullpage a {text-decoration: underline;}

div.stdpage { margin-bottom: 2.5rem; border-bottom: 1px solid var(--turval-gray); padding-bottom: 1rem; }
div.stdpage h2 { font-size: 1.3rem; font-weight: 500; color: var(--turval-green-dark); margin: 0 0 0.5rem 0; margin-top: 1rem;}
div.stdpage h3 { font-size: 1.2rem; font-weight: 500; color: var(--turval-text-color); margin: 0 0 0.5rem 0; }
div.stdpage p { font-size: 1rem; margin-bottom: 1rem; line-height: 1.5; }
div.stdpage ul { list-style-type: disc; margin-left: 1rem; margin-bottom: 1rem;}
div.stdpage a { text-decoration: underline;}

div.listpage { margin-bottom: 2.5rem; border-bottom: 1px solid var(--turval-green-light); padding-bottom: 1rem; }
div.listpage h2 { font-size: 1.1rem; font-weight: 500;  margin: 1.5rem 0 0.5rem 0; }
div.listpage p { font-size: 1rem; margin-bottom: 1rem; line-height: 1.5; }
div.listpage a { text-decoration: underline;}

article.research p { font-size: 0.9rem; margin-bottom: 1rem; line-height: 1.5; }
article.research h2 { font-size: 1.2rem; font-weight: 700;  margin: 1.5rem 0 0.5rem 0; }
article.research a { text-decoration: underline;}
article.research ul { list-style-type: disc; margin-left: 1rem; margin-bottom: 1rem;}

div.fullpage h1 { text-align: center; font-size: 2rem;}
div.fullpage h2.card {font-family: "Besley", serif;
    text-align: center;
    font-weight: 500 ;font-size: 1.3rem;
    padding: 0 2rem; margin-bottom: 2rem;
    /*border: 1px dotted var(--turval-green-dark);*/
}
div.fullpage h2.norm { text-align: center; font-weight: bold ; color: #111; font-size: 1.7rem;  margin: 3rem 0 1rem 0;}
div.fullpage p {font-size: 1.2rem; text-align: justify;}
div.fullpage ul.why { display:grid; gap: 1rem; grid-template-columns: 1fr ;}
div.fullpage ul.application { display:grid; gap: 1rem; grid-template-columns: 1fr;}
div.fullpage ul.why li {
    border-radius: 10px;
    padding: 0.8rem 1rem;
    border: 1px dotted var(--turval-green-dark);
    font-size: 1.1rem;
    transition: all 0.5s;
    min-height: 180px;
}
div.fullpage ul.why li:hover {
    background-color: var(--turval-green-bkg);
    transition: all 0.5s;
}
div.fullpage ul.why li img {
    width: 80%;
    max-width: 160px;
    margin: auto;
    padding-bottom: 20px;
}


div.fullpage ul.application li {
    border-radius: 12px;
    padding: 1rem;
    background-position: bottom;
    background-size: cover;
    aspect-ratio: 1.1; position: relative;
}
div.fullpage ul.application li:hover > div {
    border: 2px solid white;
    background-color: rgba(50,50,50,0.8);
    transition: all 0.8s;
}
div.fullpage h4 {color: #111; font-size: 1.2rem; text-align: center; margin-bottom: 0.3rem;}
div.fullpage li div {
    border-radius: 8px ;
    width: 90%;
    padding: 0.3rem;
    position: absolute;
    bottom: 0.5rem;
    background-color: rgba(100,100,100,0.5);
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.8s;
}

a.cardlink {color: white; font-size: 1.2rem; font-weight: 500;}

@media (min-width: 600px) {
    a.cardlink {font-size: 1.5rem; }
}
div.mini-cards {display: flex; flex-flow: row; flex-wrap: wrap; gap: 10px;}
div.mini-cards > div {width: 200px; }

div.meta {display: grid; grid-template-columns: 1fr ; }
div.meta > div {padding: 1rem; margin: 1rem;}
div.meta > div.card { border-radius: 10px; text-align: center; font-weight: 700 ; border: 1px dotted var(--turval-green-dark); }
div.imgleft {display: grid; grid-template-columns: 1fr; margin-top: 1rem;}

@media (min-width: 450px) {
    div.imgleft {display: grid; grid-template-columns: 1fr 2fr;}
    div.meta {display: grid; grid-template-columns: 1fr 1fr;}

}

.btn-more {
    border: 1px solid #ccc; border-radius: 9999px;
    padding: 4px 24px; font-size: 1rem;
    background: var(--turval-green-light); display: inline-block;
    margin-top:15px;
}
.btn-more:hover { background-color: var(--turval-gray); border-color: var(--turval-green-light); }

@media (min-width: 450px) {
    div.fullpage ul.application {grid-template-columns:  1fr 1fr;}
}


/* Media Queries */
@media (min-width: 768px) {
    .mobile-toggle { display: none; }

    .hero { height: 12rem; }
    .main-container-sidebar { grid-template-columns: 3fr 9fr; }
    .sidebar {grid-row: 1;}
    .sidebar h2 { border: none; padding: 0; }
    div.fullpage ul.application {grid-template-columns: 1fr 1fr 1fr;}
    div.fullpage ul.why { grid-template-columns: 1fr 1fr 1fr;}

}


/* * * * * M E N U * * * * */

/* --- 3. NAVBAR CONTAINER --- */
.navbar {
    background-color: var(--turval-green-light); /* Primary Nav Color */
    color: black;
    position: relative;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    /* Flex ensures alignment of burger icon on mobile */
    display: flex;
    align-items: center;
    /* On desktop, min-height handles vertical size, on mobile it holds the bar */
    min-height: 50px;
    padding: 0 20px;
}

/* --- 4. MENU STYLES (DESKTOP DEFAULT) --- */
.menu {
    display: flex;
    width: 100%;
    justify-content: center;
    font-size: 1rem;
}

.menu-item {
    position: relative;
    text-wrap: nowrap;
}

.menu-item > a {
    display: block;
    padding: 15px 20px;
    color: black;
    font-weight: 500;
    transition: background 0.3s ease;
}

.menu-item > a:hover {
    background-color: var(--turval-green-dark);
}

.pdf > a {text-decoration: underline;}

/* --- 5. SUBMENU (LEVEL 2) - DESKTOP --- */
.submenu {
    display: block; /* We use opacity/visibility for animation usually, or display:none */
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background-color: var(--turval-green-light);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}

/* Submenu Links */
.submenu li a {
    display: block;
    padding: 12px 20px;
    color: black;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: padding-left 0.2s;
}

.submenu li a:hover {
    background-color: var(--turval-green-dark);
    padding-left: 25px; /* Subtle slide effect */
}

/* Desktop Hover Logic */
@media (min-width: 769px) {
    .submenu.open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

}

/* --- 6. HAMBURGER ICON (HIDDEN ON DESKTOP) --- */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px 0;
    margin-right: auto; /* Push it to left or use flex logic */
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px 0;
    background-color: white;
    transition: all 0.3s ease-in-out;
    border-radius: 2px;
}

/* --- 7. MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    .navbar-container {
        justify-content: flex-start; /* Align burger to left */
    }

    .menu-toggle {
        display: block; /* Show burger */
    }

    /* Transform Main Menu to Vertical Dropdown */
    .menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--turval-green-light);
        flex-direction: column;

        /* Animation Logic: Closed State */
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-out;

        z-index: 100;
    }

    .menu.active {
        /* Animation Logic: Open State */
        max-height: 100vh; /* Arbitrary large number */
        overflow-y: auto; /* Scroll if menu is taller than screen */
        box-shadow: 0 5px 10px rgba(0,0,0,0.2);
    }

    .menu-item {
        width: 100%;
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    .menu-item > a {
        padding: 15px 20px;
    }

    /* Transform Submenu to Accordion */
    .submenu {
        position: static; /* Flow naturally in document */
        width: 100%;
        opacity: 1; /* Always visible to layout, hidden by display or max-height */
        visibility: visible;
        transform: none;
        box-shadow: none;
        background-color: var(--turval-green-light); /* Slightly darker */

        /* Submenu Closed State on Mobile */
        display: none;
    }

    .submenu.open {
        display: block;
        animation: slideDown 0.3s ease forwards;
    }

    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .submenu li a {
        padding-left: 40px; /* Indentation */
    }

    /* Burger Animation */
    .menu-toggle.is-active .bar:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.is-active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .menu-toggle.is-active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

}

@media (max-width: 950px) {
    /*.menu {
        font-size: 1.1rem;
    }*/

    .menu-item > a {
        padding: 15px 12px;
    }
}


ul .secondo-livello {
    margin-top:5px;
}

.secondo-livello li{
    list-style-type: circle;
}


