/* STILI GENERALI */
body {
    margin: 0;
    padding: 0;
    background-color: #fdf0d5;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.section-button {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.8rem 1.5rem;
    background-color: transparent;
    color: #c1121f;
    font-size: 1rem;
    border: 2px solid #c1121f;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.section-button:hover {
    background-color: #780000;
    border: 2px solid #780000;
    color: #fff;
}

.section-divider {
    width: 100%;
    height: 3px;
    background-color: #003049;
}

/* SEZIONE PRINCIPALE */
.hero-section {
    height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: 1;
}

.hero-overlay {
    position: relative;
    z-index: 2;
    background-color: rgba(0, 0, 0, 0.6);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    opacity: 0;
    animation: fade-in 1s ease forwards;
}

.hero-title {
    color: white;
    font-size: 5rem;
    text-align: center;
    z-index: 1;
    opacity: 0;
    transform: translateY(-50px);
    animation: slide-down 1.5s ease forwards 0.5s;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.hero-divider {
    width: 50%;
    border: 2px solid white;
    margin: 1rem auto;
    opacity: 0;
    animation: fade-in 1s ease forwards 1s;
}

.hero-subtitle {
    color: #f0f0f0;
    font-size: 1.7rem;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    min-height: 3rem; /* Altezza fissa per evitare salti durante la scrittura */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fade-in 1s ease forwards 1.5s;
    font-style: italic;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Effetto macchina da scrivere */
.typewriter {
    border-right: 3px solid #f0f0f0;
    padding-right: 5px;
    animation: blink 1.2s infinite;
}

@keyframes blink {
    0%,
    50% {
        border-color: #f0f0f0;
    }
    51%,
    100% {
        border-color: transparent;
    }
}

.hero-button {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.8rem 1.5rem;
    background-color: transparent;
    color: white;
    font-size: 1rem;
    border: 1px solid white;
    border-radius: 5px;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: scale(0.8);
    animation: scale-in 1s ease forwards 2s, pulse 1.5s infinite 3s; /* Crescita e pulsazione */
    font-family: "Arial", sans-serif;
    font-weight: 500;
}

.hero-button:hover {
    background-color: white;
    color: #003049;
    transform: scale(1.1); /* Effetto hover */
}

/* Animazioni */
@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slide-down {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* @media per dispositivi più piccoli */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 4rem; /* Riduce il titolo per tablet */
    }

    .hero-subtitle {
        font-size: 1.5rem; /* Riduce il sottotitolo */
        max-width: 500px;
    }

    .hero-divider {
        width: 60%; /* Adatta la larghezza del divisore */
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 3rem; /* Riduce ulteriormente il titolo per dispositivi mobili */
    }

    .hero-subtitle {
        font-size: 1.3rem; /* Riduce il sottotitolo */
        max-width: 90%;
        min-height: 2.5rem;
    }

    .hero-divider {
        width: 70%; /* Adatta la larghezza del divisore */
    }

    .hero-button {
        font-size: 0.9rem; /* Riduce il testo del pulsante */
        padding: 0.7rem 1.2rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.5rem; /* Riduce il titolo per schermi molto piccoli */
    }

    .hero-subtitle {
        font-size: 1.1rem; /* Riduce ulteriormente il sottotitolo */
        min-height: 2rem;
    }

    .hero-button {
        font-size: 0.8rem; /* Riduce il testo del pulsante */
        padding: 0.6rem 1rem;
    }

    .typewriter {
        border-right-width: 2px;
    }
}

/* SEZIONE DI BENVENUTO */
.welcome-section {
    width: 100vw;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    background-color: #fdf0d5;
    color: #003049;
}

.welcome-container {
    text-align: center;
    margin: 0 auto;
}

.welcome-logo {
    width: 240px;
    margin-bottom: 3rem;
}

.welcome-heading {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: #003049;
}

.welcome-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #003049;
}

@media (max-width: 768px) {
    .welcome-section {
        padding: 2rem 1rem;
        flex-direction: column;
        text-align: center;
    }

    .welcome-container {
        padding: 0;
    }

    .welcome-logo {
        width: 180px;
        margin-bottom: 2rem;
    }

    .welcome-heading {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .welcome-text {
        font-size: 1rem;
    }
}

/* SEZIONE PROGETTI */
.progetti {
    background-color: #fdf0d5;
    padding: 4rem 2rem;
    font-family: "Courier New", monospace;
    color: #003049;
}

.titolo-sezione {
    padding: 1rem;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.griglia-progetti {
    display: grid;
    /* Griglia fissa a 3 colonne con dimensioni uguali */
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 0 1rem;

    margin-left: auto;
    margin-right: auto;
}

/* Centramento per 1 evento */
.griglia-progetti[data-count="1"] {
    grid-template-columns: 1fr 1fr 1fr;
}

.griglia-progetti[data-count="1"] .progetto:first-child {
    grid-column: 2; /* Posiziona nella colonna centrale */
}

/* Layout per 2 eventi */
.griglia-progetti[data-count="2"] {
    grid-template-columns: 0.5fr 1fr 1fr 0.5fr;
}

.griglia-progetti[data-count="2"] .progetto:first-child {
    grid-column: 2;
}

.griglia-progetti[data-count="2"] .progetto:nth-child(2) {
    grid-column: 3;
}

/* Card stile progetti/eventi */
.progetto {
    border-radius: 0;
    border: none;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    width: 100%;
    justify-self: center;
}

.progetto.show-project {
    opacity: 1;
    transform: translateY(0);
}

.progetto:hover {
    transform: translateY(-5px);
    box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.2);
}

.img-progetto {
    border-radius: 0;
    height: 600px;
    object-fit: cover;
    background-color: #f4f4f9;
    width: 100%;
}

.titolo-progetto {
    padding: 20px 20px;
}

.titolo-progetto-link {
    font-size: 1.5rem;
    font-weight: bold;
    color: #003049;
    text-decoration: none;
    transition: color 0.2s;
}

.titolo-progetto-link:hover {
    text-decoration: underline;
    color: #c1121f;
}

.descrizione-progetto {
    padding: 0 20px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 10px;
}

.descrizione-progetto .text-muted {
    color: #669bbc;
}

.contenitore-bottone {
    text-align: center;
    margin-top: 3rem;
    margin-bottom: 2rem;
    grid-column: 1 / -1; /* Occupa tutte le colonne */
}

.bottone-trasparente {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: 2px solid #c1121f;
    color: #c1121f;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s, color 0.3s;
}

.bottone-trasparente:hover {
    background-color: #780000;
    border: 2px solid #780000;
    color: #fff;
}

/* Responsive per tablet */
@media (max-width: 1024px) {
    .griglia-progetti,
    .griglia-progetti[data-count="1"],
    .griglia-progetti[data-count="2"] {
        grid-template-columns: repeat(2, 1fr);
        max-width: 800px;
    }

    .griglia-progetti[data-count="1"] .progetto:first-child {
        grid-column: 1 / -1;
        justify-self: center;
    }

    .griglia-progetti[data-count="2"] .progetto:first-child,
    .griglia-progetti[data-count="2"] .progetto:nth-child(2) {
        grid-column: auto;
    }
}

/* Responsive per mobile */
@media (max-width: 768px) {
    .griglia-progetti,
    .griglia-progetti[data-count="1"],
    .griglia-progetti[data-count="2"] {
        grid-template-columns: 1fr;
        gap: 1.2rem;
        max-width: 400px;
    }

    .griglia-progetti[data-count="1"] .progetto:first-child,
    .griglia-progetti[data-count="2"] .progetto:first-child,
    .griglia-progetti[data-count="2"] .progetto:nth-child(2) {
        grid-column: auto;
    }

    .progetto {
        min-width: auto;
        max-width: none;
    }

    .img-progetto {
        height: 200px;
    }
}

/* Stato vuoto */
.empty-state {
    padding: 100px 0;
    grid-column: 1 / -1; /* Occupa tutte le colonne */
}

.empty-content {
    text-align: center;
}

.empty-icon {
    margin-bottom: 30px;
}

.empty-icon i {
    font-size: 4rem;
    color: #669bbc;
}

.empty-content h3 {
    color: #003049;
    margin-bottom: 15px;
}

.empty-content p {
    color: #669bbc;
}

/* SEZIONE INFO */
.info-section {
    width: 100vw;
    background-color: #fdf0d5;
    color: #003049;
    padding: 4rem 1.5rem;
    text-align: left;
}

.info-container {
    max-width: 1000px;
    margin: 0 auto;
}

.info-text-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.info-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.info-text {
    font-size: 1.2rem;
    line-height: 1.6;
    color: #003049;
    max-width: 700px;
}

.info-button {
    padding: 0.75rem 1.5rem;
    border: 2px solid #c1121f;
    background: transparent;
    font-weight: bold;
    text-decoration: none;
    color: #c1121f;
    white-space: nowrap;
    transition: all 0.3s ease;
    height: fit-content;
}

.info-button:hover {
    background-color: #780000;
    border-color: #780000;
    color: #ffffff;
}

@media (max-width: 768px) {
    .info-text-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }

    .info-button {
        align-self: flex-start;
    }
}

/* SEZIONE ARCHIVIO */
.archive-section {
    display: flex;
    width: 100vw;
    height: 60vh;
}

.archive-half {
    width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
    box-sizing: border-box;
}

.archive-half.text {
    background-color: #fdf0d5;
}

.archive-half.image {
    padding: 0;
}

.archive-half.image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.archive-half.text h2 {
    font-weight: 700;
}

.archive-button {
    margin-top: 2rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid #c1121f;
    background: transparent;
    font-weight: bold;
    text-decoration: none;
    color: #c1121f;
    transition: all 0.3s ease;
}

.archive-button:hover {
    background: #780000;
    border: 2px solid #780000;
    color: #ffffff;
}

@media (max-width: 768px) {
    .archive-section.fixed-order {
        flex-direction: column;
    }

    .archive-section.fixed-order .archive-half.text {
        order: 2; /* Il testo va sotto */
    }

    .archive-section.fixed-order .archive-half.image {
        order: 1; /* L'immagine va sopra */
    }

    .archive-section {
        flex-direction: column;
        height: auto;
    }

    .archive-half {
        width: 100%;
        padding: 2rem 1.5rem;
    }

    .archive-half.image img {
        height: auto;
        max-height: 300px;
        object-fit: cover;
    }

    .archive-half.text h2 {
        font-size: 1.8rem;
    }

    .archive-button {
        width: 100%;
        max-width: 300px;
        text-align: center;
    }
}

/* SEZIONE CONTATTI */
.contact-section {
    width: 100vw;
    background-color: #fdf0d5;
    color: #003049;
    padding: 4rem 1.5rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.contact-header {
    text-align: center;
    margin-bottom: 2rem;
}

.contact-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.contact-header h5 {
    font-size: 1.2rem;
    color: #003049;
}

.contact-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

.contact-info p {
    font-size: 1rem;
    margin: 0;
}

.contact-social {
    display: flex;
    gap: 1rem;
    font-size: 1.5rem;
}

.contact-social a {
    color: #003049;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-social a:hover {
    color: #c1121f;
}

/* Bottone Scrivici */
.contact-button {
    margin-top: 2rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid #c1121f;
    background: transparent;
    font-size: 1.1rem;
    font-weight: bold;
    text-decoration: none;
    color: #c1121f;
    transition: all 0.3s ease;
}

.contact-button i {
    margin-right: 8px;
    font-size: 1.1rem;
}
.contact-button:hover,
.contact-button:focus {
    background: #780000;
    border: 2px solid #780000;
    color: #ffffff;
}

@media (max-width: 768px) {
    .contact-section {
        padding: 3rem 1rem;
    }

    .contact-header h2 {
        font-size: 1.6rem;
    }

    .contact-header h5 {
        font-size: 1rem;
    }

    .contact-info p {
        font-size: 0.95rem;
    }

    .contact-social {
        flex-wrap: wrap;
        justify-content: center;
    }

    .contact-button {
        width: 100%;
        max-width: 280px;
        text-align: center;
        padding: 0.75rem 0;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .contact-header h2 {
        font-size: 1.1rem;
    }
    .contact-header h5 {
        font-size: 0.92rem;
    }
    .contact-info {
        gap: 1rem;
    }
    .contact-social {
        font-size: 1.2rem;
    }
    .contact-button {
        padding: 0.65rem 0;
        font-size: 0.97rem;
    }
}
