/* Variabili colori */
:root {
    /* Bianco */
    --sidebar-bg: rgba(255, 255, 255, 1); /* #fff */
    /* Nero */
    --sidebar-color: rgba(33, 37, 41, 1); /* #212529 */
    /* Grigio */
    --content-bg: rgba(248, 249, 250, 1); /* #f8f9fa */
    /* Hover */
    --hover-bg: rgba(234, 127, 40, 0.10); /* #ea7f28 con alpha 10% */
    /* Arancione */
    --footer-bg: rgba(234, 127, 40, 1); /* #ea7f28 */
    /* Verde Scuro */
    --dark-green: rgba(38, 58, 68, 1); /* #263a44 */
    /* Verde Chiaro */
    --light-green: rgba(66, 111, 125, 1); /* #426f7d */
    --light-green-full: 66, 111, 125;
    /* Verde Scuro 263a44 */
    /* Verde Chiaro 426f7d */
}
/* Variabili font */
:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Reset base */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    background: var(--content-bg);
    font-family: var(--font-sans);
}
body {
    display: flex;
    flex-direction: column;
}
textarea {
    resize: none;
    overflow: auto; /* per gestire lo scroll se serve */
}
.main-wrapper {
    flex: 1;
    display: flex;
}

/* Sidebar e offcanvas */
.sidebar,
.offcanvas-sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    color: var(--sidebar-color);
    font-family: var(--font-sans);
}
.sidebar a,
.offcanvas-body a {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--sidebar-color);
    padding: 0.625rem 1.25rem;
    text-decoration: none;
    font-family: var(--font-sans);
}
.sidebar a i,
.offcanvas-body a i {
    min-width: 20px;
    text-align: center;
    line-height: 1;
    position: relative;
    top: 1px;
}
.sidebar a:hover,
.sidebar a.active,
.offcanvas-body a:hover,
.offcanvas-body a.active {
    background: var(--hover-bg);
    font-weight: 500;
}

/* Contenuto principale */
.content {
    flex-grow: 1;
    min-height: 100vh;
    padding-bottom: 1px;
}


/* Footer */
.footer {
    background: var(--footer-bg);
    border-top: 1px solid #ddd;
    color: #fff;
    padding: 5rem 1rem 2rem;
    text-align: center;
}
.footer h5 {
    font-family: var(--font-sans);
}
.footer .footer-copy {
    margin-top: 3rem;
}
.footer .footer-logo {
    max-height: 80px;
    width: auto;
    display: block;
    margin: 0 auto;
}

/* Logo */
.logo-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 1rem 1.25rem;
}
.logo-title img {
    max-width: 100%;
    object-fit: contain;
}

/* Back to top */
#backToTop {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    width: 3rem;
    height: 3rem;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: background 0.2s;
    font-family: var(--font-sans);
}
#backToTop:hover {
    background: rgba(0, 0, 0, 0.75);
}
#backToTop i {
    font-size: 1.25rem;
}

/* Link bianco e grassetto */
.link-white {
    color: #fff;
    text-decoration: none;
}
.link-white:hover,
.link-white:focus {
    text-decoration: none;
}
.font-bold {
    font-weight: bold;
}

/* Responsive */
/* Mobile fino a 992px */
@media (max-width: 992px) {
    .sidebar { display: none; }
    .navbar-mobile {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1030;
        border-bottom: 1px solid #ddd;
        font-family: var(--font-sans);
    }
    .navbar-mobile .logo-title {
        padding: 0.25rem 0.5rem;
    }
    .navbar-mobile .logo-title img {
        height: 40px;
        width: auto;
    }
    .navbar-mobile .container-fluid {
        padding: 0 0.5rem;
    }
    .offcanvas-sidebar {
        width: 250px;
    }
    .offcanvas-header .logo-title img {
        height: 60px;
        width: auto;
    }
    .content,
    .main-wrapper {
        margin-top: 56px;
    }
}

/* Desktop da 992px in su */
@media (min-width: 992px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        overflow-y: auto;
    }
    .content {
        margin-left: 250px;
        margin-top: 0;
    }
    .main-wrapper {
        margin-top: 0;
    }
}
/*
    PAGE
 */
/* Home */
.hero {
    position: relative;
    width: 100%;
    height: 65vh;
    min-height: 200px;
    background: url('img/hero-home.jpg') center center / cover no-repeat;
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
}
.hero-text {
    position: relative;
    z-index: 1;
}
.header-info{
    position:absolute;
    bottom:0;
    background:rgba(255,255,255,0.4);
    padding:1rem 0;
}
.header-breadcrumbs{
    background: rgba(var(--light-green-full), 0.8);

}
/* Card introduttiva progetto DisArch */
.intro-section {
    display: flex;
    justify-content: center;
}
.intro-card {
    border-left: 5px solid var(--light-green);
    max-width: 100%;
}
.intro-title {
    font-family: var(--font-sans);
    font-size: 1.75rem;
    color: var(--dark-green);
    font-weight: 600;
}
.intro-text {
    font-size: 1.125rem;
    line-height: 1.6;
    color: rgba(33, 37, 41, 0.85);
    text-align: justify;
}
/* Card Menu */
/* Stile base della card di servizio */
.menu-card {
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.menu-card .card-img-top {
    transition: transform 0.5s ease;
    /* fissa altezza e oggetto-fit per un look uniforme */
    height: 230px;
    object-fit: cover;
}

/* Effetti hover */
.menu-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}
.menu-card:hover .card-img-top {
    transform: scale(1.08);
}

/* Testo */
.menu-card .card-title {
    font-family: var(--font-sans);
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--dark-green);
    margin-top: 0.5rem;
}

/* Contatti */
/* Sezione full-screen */
.contact-section {
    background:
            linear-gradient(rgba(var(--light-green-full), 0.7), rgba(var(--light-green-full), 0.7)),
            url('img/contacts.jpg') center center / cover no-repeat;
    padding: 3rem 0;
}
.contact-bg {
    background: rgba(var(--light-green-full), 0.15);
}

/* Card centrale */
.contact-card {
    max-width: 600px;
    width: 100%;
    background: #fff;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

/* Solleva la card al passaggio */
.contact-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 32px rgba(0,0,0,0.12);
}

/* Titolo */
.contact-title {
    font-family: var(--font-sans);
    font-size: 2rem;
}

/* Form fields */
.form-control, .form-select, .form-control:focus, .form-select:focus {
    border-radius: 0.5rem;
    box-shadow: none;
    border: 1px solid #bcccdc;
    transition: border-color 0.3s ease;
}
.form-control:focus, .form-select:focus {
    border-color: var(--light-green);
}
.form-response {
    margin-top: 20px;
    font-weight: bold;
    text-align: center;
}


/* Pulsante */
.btn-primary {
    background: var(--light-green);
    border: none;
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--dark-green);
}

/* Honeypot (nascosto) */
.honeypot-field {
    position: absolute;
    left: -9999px;
    visibility: hidden;
    height: 0;
    overflow: hidden;
}

/*
    FORM CONTATTI
 */
.is-invalid {
    border-color: #dc3545;
}
.is-valid {
    border-color: #198754;
}
.invalid-feedback {
    color: #dc3545;
    font-size: 0.875em;
    margin-top: 0.25rem;
}

/* CONTACTS */
.hero-contacts {
    height: 40vh;
    background:
            linear-gradient(rgba(var(--light-green-full), 0.3), rgba(var(--light-green-full), 0.3)),
            url('img/hero-contacts.jpg') center center / cover no-repeat;
}
.modern-card {
    border-radius: 1rem;
    overflow: hidden;
    transition: transform 0.3s ease;
}
.modern-card:hover {
    transform: translateY(-10px);
}
.text-dark-green {
    color: var(--dark-green);
}
.link-modern-card{
    text-decoration: none;
    color: var(--dark-green);
    font-weight: 400;
}

/* NETWORKS */
.hero-networks{
    height: 40vh;
    background:
            linear-gradient(rgba(var(--light-green-full), 0.3), rgba(var(--light-green-full), 0.3)),
            url('img/hero-networks.jpg') center center / cover no-repeat;
}

.networks-bg {
    background: rgba(var(--light-green-full), 0.3);
}

.network-section {
    padding: 4rem 1rem;
}

.network-card {
    max-width: 700px;
    background: #ffffff;
    padding: 2.5rem 1.5rem;
    border-radius: 1.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transition: transform .3s ease, box-shadow .3s ease;
}

.network-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.network-logo {
    width: 200px;
    height: auto;
}

.network-title {
    font-size: 1.75rem;
    margin: 1rem 0 0.5rem;
    color: #1a1f36;
}

.network-title2 {
    font-size: 1.1rem;
    margin: 0 0 0.5rem;
    color: #1a1f36;
}

.network-description {
    font-size: 1rem;
    line-height: 1.6;
    color: #4a4f63;
}

@media (max-width: 768px) {
    .network-section {
        padding: 3rem 1rem;
    }
    .network-card {
        padding: 2rem 1rem;
    }
    .network-title {
        font-size: 1.5rem;
    }
    .network-description {
        font-size: 0.95rem;
    }
}

/* EVENTS */
.hero-events{
    height: 40vh;
    background:
            linear-gradient(rgba(var(--light-green-full), 0.3), rgba(var(--light-green-full), 0.3)),
            url('img/hero-events.jpg') center center / cover no-repeat;
}
.events-bg {
    background: var(--content-bg);
}

 .events-section {
     padding: 4rem 0;
 }
.events-section h2.section-title {
    font-size: 2.5rem;
    color: var(--dark-green);
    text-align: center;
    margin-bottom: 1rem;
}
.events-section .section-divider {
    width: 6rem;
    height: 4px;
    background: var(--light-green);
    margin: 0.5rem auto 2rem;
    border-radius: 2px;
}
.event-card {
    border: none;
    border-radius: 0.5rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
    box-shadow: 0 16px 32px rgba(0,0,0,0.12);
}
.event-card:hover {
    transform: translateY(-8px);
}
.event-card .card-img-top {
    height: 180px;
    object-fit: cover;
}
.event-card .card-body {
    padding: 1.25rem;
}
.event-date {
    font-size: 0.9rem;
    color: var(--light-green);
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.event-title {
    font-size: 1.25rem;
    color: var(--dark-green);
    font-weight: 600;
    margin-bottom: 0.75rem;
}
.event-description {
    font-size: 1rem;
    color: rgba(33,37,41,0.8);
    margin-bottom: 1rem;
    line-height: 1.5;
}
.event-link {
    font-weight: 500;
    text-decoration: none;
    color: var(--light-green);
}
.event-link:hover {
    text-decoration: underline;
}

/* Button */
.event-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}
.event-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: transparent;
    color: var(--dark-green);
    border: 2px solid var(--light-green);
    border-radius: 0; /* angoli non arrotondati */
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.3s ease;
}
.event-link:hover {
    background-color: var(--light-green);
    color: #fff;
    transform: translateY(-2px);
}

/* PUBLICATIONS */
.hero-publications{
    height: 40vh;
    background:
            linear-gradient(rgba(var(--light-green-full), 0.3), rgba(var(--light-green-full), 0.3)),
            url('img/hero-publications.jpg') center center / cover no-repeat;
}
.publications-bg {
    background: var(--content-bg);
}

.publications-section {
    background: var(--content-bg);
    padding: 4rem 0;
}
.publications-section h2.section-title {
    font-size: 2.5rem;
    color: var(--dark-green);
    text-align: center;
    margin-bottom: 1rem;
}
.publications-section .section-divider {
    width: 5rem;
    height: 4px;
    background: var(--light-green);
    margin: 0.5rem auto 2rem;
    border-radius: 2px;
}
/* Card styles */
.publication-card {
    background: #fff;
    border-left: 4px solid var(--light-green);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}
.publication-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 32px rgba(0,0,0,0.1);
}
.publication-image {
    width: 100%;
    height: auto;
    object-fit: cover;
}
@media (min-width: 768px) {
    .publication-card .row.g-0 {
        height: 100%;
    }
    .publication-card .col-image {
        flex: 0 0 16.6667%; /* 2/12 width */
        max-width: 16.6667%;
    }
    .publication-image {
        height: 100%;
    }
}
.publication-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.publication-author {
    font-size: 0.9rem;
    color: var(--light-green);
    margin-bottom: 0.5rem;
}
.publication-title {
    font-size: 1.2rem;
    color: var(--dark-green);
    font-weight: 600;
    margin-bottom: 0.75rem;
}
.publication-title-sub {
    font-size: 1rem;
    color: rgba(33,37,41,0.6);
    margin-bottom: 0.75rem;
    font-weight: 400;
}
.publication-description {
    font-size: 1rem;
    color: rgba(33,37,41,0.8);
    line-height: 1.5;
    margin-bottom: 1rem;
    flex: 1;
}
.publication-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--dark-green);
    color: #fff;
    border-radius: 0.25rem;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s, transform 0.3s;
    align-self: flex-start; /* width adjusts to content */
}
.publication-link:hover {
    background-color: var(--light-green);
    transform: translateY(-2px);
}


/* Bookshelves Page */
.hero-bookshelves{
    height: 40vh;
    background:
            linear-gradient(rgba(var(--light-green-full), 0.3), rgba(var(--light-green-full), 0.3)),
            url('img/hero-bookshelves.jpg') center center / cover no-repeat;
}
.bookshelves-bg {
    background: var(--content-bg);
}

.bookshelves-section {
    background: var(--content-bg);
    padding: 4rem 0;
    font-family: var(--font-sans);
    color: var(--text-color);
}
/* Elegante box per l'intro testuale con ombra stile libro e linea centrale */
.bookshelves-section .intro {
    margin: 0 auto 3rem;
    padding: 2rem;
    background: rgba(240, 248, 255, 0.6);
    border-left: 5px solid var(--light-green);
    border-radius: 0.5rem;
    column-count: 2;
    column-gap: 3rem;
    column-rule: 1px solid rgba(0,0,0,0.1);
    font-size: 1rem;
    line-height: 1.75;
    color: rgba(33,37,41,0.85);
    position: relative;
    /* Ombra che richiama l'effetto copertina di un libro */
    box-shadow: 0 8px 16px rgba(0,0,0,0.1), 0 16px 32px rgba(0,0,0,0.05);
}
/* Rimozione colonne su mobile */
@media (max-width: 992px) {
    .bookshelves-section .intro {
        column-count: 1;
        column-rule: none;
    }
}
/* Drop cap sul primo paragrafo */
.bookshelves-section .intro p:first-of-type::first-letter {
    float: left;
    font-size: 3rem;
    line-height: 1;
    padding-right: 0.5rem;
    color: var(--dark-green);
    font-family: var(--font-serif);
}
/* Separator, titolo e lista bibliografia rimangono invariati */
.bookshelves-section .bibliography-title {
    font-size: 2rem;
    color: var(--dark-green);
    text-align: center;
    margin-bottom: 1rem;
}
.bookshelves-section .divider {
    width: 4rem;
    height: 3px;
    background: var(--light-green);
    margin: 0.5rem auto 2rem;
    border-radius: 2px;
}
/* Stile avanzato della bibliografia */
.bibliography-list {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    max-width: 800px;
    counter-reset: bibliography;
}
.bibliography-list li {
    position: relative;
    padding: 1rem 1rem 1rem 3rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    margin-bottom: 0.5rem;
    transition: background 0.3s;
}
.bibliography-list li::before {
    counter-increment: bibliography;
    content: counter(bibliography) ".";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
    color: var(--light-green);
}
.bibliography-list li:nth-child(odd) {
    background: rgba(240,248,255,0.4);
}
.bibliography-list li:hover {
    background: rgba(0,0,0,0.02);
}
.bibliography-list li:last-child {
    border-bottom: none;
}

/* NEWS */
.hero-news{
    height: 40vh;
    background:
            linear-gradient(rgba(var(--light-green-full), 0.3), rgba(var(--light-green-full), 0.3)),
            url('img/hero-news.jpg') center center / cover no-repeat;
}
.news-bg {
    background: var(--content-bg);
}

.news-section {
    background: var(--content-bg);
    padding: 4rem 0;
    font-family: var(--font-sans);
    color: var(--text-color);
}
.news-section .section-header h2 {
    font-size: 2.5rem;
    color: var(--dark-green);
    margin-bottom: 0.5rem;
}
.news-section .section-header .divider {
    width: 6rem;
    height: 4px;
    background: var(--light-green);
    margin: 0 auto;
    border-radius: 2px;
}
.news-date {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--light-green);
    color: white;
    border-radius: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}
.news-title {
    font-size: 1.5rem;
    color: var(--dark-green);
    margin-bottom: 1rem;
}
.news-text {
    font-size: 1rem;
    color: rgba(33,37,41,0.8);
    line-height: 1.6;
}

/* News Item Card */
.news-item {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1),
    0 2px 6px rgba(0,0,0,0.05);
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.news-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15),
    0 4px 12px rgba(0,0,0,0.1);
}
.news-item .news-image {
    border-radius: 0.5rem;
}
/* Variante senza immagine (usare classe no-photo) */
.news-item.no-photo .col-image {
    display: none;
}
.news-item.no-photo .col-content {
    flex: 0 0 100%;
    max-width: 100%;
}
.offset-md-item {
        margin-left: 2.083333%;
}

/* TEAM */
.hero-team{
    height: 40vh;
    background:
            linear-gradient(rgba(var(--light-green-full), 0.3), rgba(var(--light-green-full), 0.3)),
            url('img/hero-team.jpg') center center / cover no-repeat;
}
.team-bg {
    background: var(--content-bg);
}

.team-section {
    background: var(--content-bg);
    padding: 4rem 1rem;
}
.team-section .section-header h2 {
    font-size: 2.5rem;
    color: var(--dark-green);
    text-align: center;
    margin-bottom: 0.5rem;
}
.team-section .divider {
    width: 6rem;
    height: 4px;
    background: var(--light-green);
    margin: 0 auto 2rem;
    border-radius: 2px;
}
.team-card {
    background: #fff;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}
.team-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 32px rgba(0,0,0,0.15);
}
.team-card .card-img-top {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.team-card .card-body {
    padding: 1.5rem;
}
.team-name {
    font-size: 1.25rem;
    color: var(--dark-green);
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.team-institute {
    font-size: 1rem;
    color: var(--dark-green);
    margin-bottom: 0.15rem;
}
.team-email {
    font-size: 0.95rem;
    color: var(--light-green);
    margin-bottom: 0.5rem;
    display: block;
    text-decoration: none;
    font-weight: 400;
}
.team-role {
    font-size: 1rem;
    margin-bottom: 1rem;
    font-weight: 500;
    color: var(--dark-green);
}
.team-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: transparent;
    color: var(--dark-green);
    border: 2px solid var(--light-green);
    border-radius: 0; /* angoli non arrotondati */
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.3s ease;
}
.team-link:hover {
    background-color: var(--light-green);
    color: #fff;
    transform: translateY(-2px);
}
