* {
    box-sizing: border-box;
}

html, body {
    min-height: 100%;
    margin: 0;
}

body {
    background-color: white;
    font-size: 18px;
    line-height: 1.5;
}

.header {
    background: linear-gradient(
        to bottom,
        rgb(244, 212, 253),
        rgb(255, 255, 255)
    );
    padding: 24px 16px 12px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.header h1 {
    margin: 0;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: clamp(2.4rem, 8vw, 4.2rem);
    line-height: 1.1;
}

.page {
    width: 100%;
    margin: 0 auto;
    background-color: rgb(255, 255, 255);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.section {
    display: none;
    flex: 1 0 auto;
    width: min(1100px, 92%);
    margin: 0 auto;
    padding: 28px 0 56px;
    background-color: rgb(255, 255, 255);
}

#home {
    display: block;
}

.navbar {
    width: min(900px, 100%);
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px clamp(18px, 7vw, 90px);
    padding: 12px 16px;
    font-size: clamp(1.1rem, 4vw, 1.7rem);
    text-align: center;
}

.navbar a {
    text-decoration: none;
    color: black;
    padding: 4px 6px;
    background: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.navbar a:hover,
.navbar a.active {
    text-decoration: underline;
}

.profile-img {
    width: clamp(180px, 32vw, 330px);
    max-width: 100%;
    height: auto;
    flex: 0 0 auto;
}

.home-top {
    display: flex;
    align-items: flex-start;
    gap: clamp(24px, 5vw, 56px);
}

.home-text {
    flex: 1 1 0;
    min-width: 0;
}

.home-text p:first-child {
    margin-top: 0;
}

.home-text a {
    color: #6a0dad;
    text-decoration: none;
}

.home-text a:hover {
    text-decoration: underline;
}

.publications-list {
    width: 100%;
    margin: 2% auto;
    padding-left: 20px;
    margin-left: 0;
}

.publications-list li {
    margin-bottom: 20px;
}

.publications-list em {
    font-size: 1.3em;
    font-style: italic;
}

.pub-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    width: 100%;
}

.pub-title a {
    text-decoration: none;
    color: #6a0dad;
    flex: 0 0 auto;
}

.pub-title a:hover {
    text-decoration: underline;
}

.footer {
    margin-top: auto;
    width: 100%;
    background: linear-gradient(
        to bottom,
        rgb(255, 255, 255),
        rgb(244, 212, 253)
    );
    text-align: center;
    padding: 20px 16px;
}

.footer p {
    margin: 5px 0;
}

.footer a {
    color: black;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Schermi verticali / tablet stretti */
@media (max-width: 800px) {
    .section {
        width: 94%;
        padding-top: 18px;
    }

    .home-top {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .home-text {
        width: 100%;
        max-width: 100%;
        flex-basis: auto;
    }

    .profile-img {
        width: min(70vw, 280px);
    }
}

/* Telefoni molto stretti */
@media (max-width: 480px) {
    body {
        font-size: 16px;
    }

    .header {
        padding-top: 18px;
    }

    .navbar {
        justify-content: space-evenly;
        gap: 8px 10px;
        padding: 10px 8px;
        font-size: clamp(1rem, 5vw, 1.25rem);
    }

    .navbar a {
        padding: 3px 4px;
    }

    .section {
        width: 95%;
    }

    .pub-title {
        flex-direction: column;
        gap: 2px;
    }

    .publications-list em {
        font-size: 1.12em;
    }
}
