/* =================================================================
   Variabili (se presenti altrove, altrimenti da aggiungere)
   ================================================================= */
/*
:root {
    --main-font: ...;
    --title-font: ...;
    --color-text: ...;
    --color-background-main: ...;
    --color-primary: ...;
    --color-secondary: ...;
    --color-header-bg: ...;
    --color-menu-links: ...;
    --color-background-content: ...;
    --color-footer-bg: ...;
    --color-footer-txt: ...;
    --color-footer-link: ...;
}
*/

/* =================================================================
   Stili Globali
   ================================================================= */
body {
    font-family: var(--main-font);
    margin: 0;
    color: var(--color-text);
    background-color: var(--color-background-main);
    transition: background-color 0.3s;
}

h1, h2, h3, h4, h5, h6, 
.archive-title, 
.content-card h2 a {
    font-family: var(--title-font);
    color: var(--color-primary);
}

h3 {
    display: block;
    font-size: 1.17em;
    margin-block-start: 1em;
    margin-block-end: 1em;
    margin-inline-start: 0px;
    margin-inline-end: 0px;
    font-weight: bold;
    unicode-bidi: isolate;
}

/* =================================================================
   Header & Navigation
   ================================================================= */
.main-header {
    background-color: var(--color-header-bg);
    padding: 0.5rem 2rem;
}

.main-header.is-sticky {
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 900px;
    margin: 0 auto;
}

.header-left {
    display: flex;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.header-logo {
    max-height: 50px;
    width: auto;
    margin-right: 0.75rem;
}

.header-title {
    font-size: 2rem;
    font-weight: bold;
    color: var(--color-primary);
    font-family: var(--title-font);
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1rem;
}

.main-nav a {
    font-family: var(--main-font);
    text-decoration: none;
    color: var(--color-menu-links);
    font-weight: 500;
    font-size: 1rem;
}

.main-nav a:hover {
    color: var(--color-secondary);
}

/* Pulsante Hamburger (nascosto di default) */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 2rem;
    height: 2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.hamburger-btn span {
    width: 2rem;
    height: 0.25rem;
    background: var(--color-text);
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

/* =================================================================
   Hero Section
   ================================================================= */
.hero {
    position: relative;
    width: 100%;
    height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    background-color: #333;
}

.hero-picture, 
.hero-picture img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    padding: 2rem;
}

.hero-content h1 {
    font-size: 3rem;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    color: #ffffff;
}

.hero-content h2 {
    font-size: 1.5rem;
    font-weight: 300;
    margin: 0.5rem 0 1.5rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    color: #ffffff;
}

.hero-content h1, 
.hero-content h2 {
    font-family: var(--title-font);
}

.hero-cta-container {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.cta-button {
    background-color: var(--color-primary);
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.cta-button:hover {
    background-color: var(--color-secondary);
}

/* =================================================================
   Main Content
   ================================================================= */
.content-wrapper {
    max-width: 900px;
    margin: 4rem auto;
    padding: 3rem 4rem;
    background-color: var(--color-background-content);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
    display: flow-root;
    line-height: 1.7;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.content-wrapper a {
    text-decoration: none;
    color: var(--color-primary);
}

.content-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    margin-top: 0px;
    margin-right: 0px;
    width: 450px;
    height: 450px;
    background-image: url('../img/decorations/wavy-top-right.svg');
    background-repeat: no-repeat;
    background-size: cover;
    z-index: -1;
    opacity: 0.4;
}

.content-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    margin-bottom: 0px;
    margin-left: 0px;
    width: 500px;
    height: 450px;
    background-image: url('../img/decorations/wavy-bottom-left.svg');
    background-repeat: no-repeat;
    background-size: cover;
    z-index: -1;
    opacity: 0.3;
}

.content-wrapper .content-button {
    display: inline-block;
    background-color: var(--color-primary);
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.2s;
    margin: 0.5rem 0;
}

/* Aggiunge uno spazio verticale a tutte le immagini nel testo */
.content-wrapper picture {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Stili specifici per le immagini allineate (float) */
.content-wrapper picture img[style*="float: left"] {
    margin-right: 1.5rem; /* Aggiunge spazio a destra dell'immagine */
}

.content-wrapper picture img[style*="float: right"] {
    margin-left: 1.5rem; /* Aggiunge spazio a sinistra dell'immagine */
}

.content-button:hover {
    background-color: var(--color-secondary);
    color: white;
    transform: translateY(-2px);
}

#background-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

/* =================================================================
   Archive Pages
   ================================================================= */
.archive-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 2rem;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.content-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.content-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.content-card .card-image-link img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.content-card .image-placeholder {
    width: 100%;
    height: 200px;
    background-color: #f0f0f0;
}

.content-card .card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.content-card h2 {
    font-size: 1.25rem;
    margin: 0 0 0.5rem;
}

.content-card h2 a {
    text-decoration: none;
    color: inherit;
}

.content-card p {
    margin: 0 0 1rem;
    flex-grow: 1;
    color: #666;
}

.content-card .read-more {
    text-decoration: none;
    color: var(--colore-principale);
    font-weight: bold;
    margin-top: auto;
}

/* ==========================================================================
   6. Contact Form Styles
   ========================================================================== */

.contact-form {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: var(--color-background-content);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.contact-form .form-group {
    margin-bottom: 1.5rem;
}

.contact-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--color-primary);
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: 5px;
    font-family: var(--main-font);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box; /* Per includere padding e border nella larghezza */
}

.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form textarea:focus {
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(var(--color-secondary-rgb), 0.2);
    outline: none;
}

.contact-form textarea {
    resize: vertical; /* Permette solo il ridimensionamento verticale */
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.submit-button {
    display: inline-block;
    background-color: var(--color-primary);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    width: auto; /* Rende il bottone grande quanto il testo */
}

.submit-button:hover {
    background-color: var(--color-secondary);
    transform: translateY(-2px);
}

/* Stili per i Pulsanti di Condivisione */
.share-buttons-container {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}
.share-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.share-buttons a {
    display: inline-block;
    color: var(--color-text);
}
.share-buttons a:hover {
    color: var(--color-primary);
    transform: scale(1.1);
}
.share-buttons svg {
    width: 28px;
    height: 28px;
}

/* Stili per i messaggi di stato */
.form-message {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1.5rem;
    font-weight: bold;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive adjustments for the form */
@media (max-width: 768px) {
    .contact-form {
        padding: 1.5rem;
        margin: 1rem auto;
    }
}

/* =================================================================
   Footer
   ================================================================= */
.main-footer {
    background-color: var(--color-footer-bg);
    color: var(--color-footer-txt);
    padding: 2rem;
    text-align: center;
}

.main-footer a {
    color: var(--color-footer-link);
}
/* Stili per le Icone Social nel Footer */
.social-links-container {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.social-links-container a {
    color: var(--color-footer-link);
}

.social-links-container a:hover {
    color: var(--color-secondary); /* O un altro colore a scelta */
    transform: scale(1.1);
}

.social-links-container svg {
    width: 24px;
    height: 24px;
    stroke: currentColor; /* Il colore dell'icona è ereditato dal link <a> */
}
/* =================================================================
   Responsive Styles
   ================================================================= */
@media (max-width: 768px) {
    /* Header */
    .main-header {
        flex-direction: column;
        padding: 0.5rem 1rem;
    }

    .header-left {
        margin-bottom: 0.5rem;
    }

    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem 1rem;
    }

    .main-nav a {
        padding: 0.5rem;
    }

    /* Hamburger Menu */
    .hamburger-btn {
        display: flex;
    }

    .main-nav {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        background: white;
        z-index: 100;
        padding-top: 60px;
    }

    .main-nav.is-open {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .main-nav ul {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .main-nav a {
        font-size: 1.5rem;
        font-family: var(--title-font);
    }

    .hamburger-btn.is-open {
        position: fixed;
        top: 1.2rem;
        right: 2rem;
        z-index: 110;
    }

    .hamburger-btn.is-open span {
        background: var(--color-text);
    }

    .hamburger-btn.is-open span:nth-child(1) {
        transform: rotate(45deg);
    }

    .hamburger-btn.is-open span:nth-child(2) {
        opacity: 0;
    }

    .hamburger-btn.is-open span:nth-child(3) {
        transform: rotate(-45deg);
    }
}