/* Main site styles*/
*{box-sizing:border-box}


@font-face {
    font-family: "Inter";
    src: url("/assets/fonts/inter/Inter-VariableFont_opsz,wght.ttf") format("truetype");
    font-weight: 100 900;
    font-style: normal;
}

@font-face {
    font-family: "Montserrat";
    src: url("/assets/fonts/montserrat/Montserrat-VariableFont_wght.ttf") format("truetype");
    font-weight: 100 900;
    font-style: normal;
}


body {
    margin: 0;
    font-family: "Montserrat", system-ui, sans-serif;
    /*font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;*/
    line-height: 1.6;
    color: #222;
    background-color: #f7f7f7;
}

header {
    background: #111;
    color: #fff;
    padding: 1.5rem 1rem;
}

header .logo {
    display: flex;
    align-items: center;
    gap: 1.8rem; /* Spazio tra logo e testo */
}

.brand-title {
    /*font-family: "Century Gothic", "Helvetica", "Arial", sans-serif;*/
    font-weight: 400;
    font-size: 32px;
}

header img {
    max-height: 60px;
}
header h1 {
    margin: 0;
    font-size: 1.8rem;
    text-transform: lowercase;
}

header p {
    margin: 0.3rem 0 0;
    font-size: 0.95rem;
    opacity: 0.85;
}

nav {
    background: #222;
    color: #fff;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

nav a {
    color: #f5f5f5;
    text-decoration: none;
    margin-right: 1rem;
    white-space: nowrap;
}

nav a:hover {
    text-decoration: underline;
}


/* Hamburger toggle */
.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

.nav-links { display: flex; gap: 0.75rem; align-items: center }

main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
    background: #fff;
}

section {
    margin-bottom: 2.5rem;
}

h2 {
    margin-top: 0;
    border-bottom: 2px solid #ddd;
    padding-bottom: 0.3rem;
    text-transform: uppercase;
    font-size: 1.3rem; /*1.1rem;*/
    letter-spacing: 0.06em;
}

h3 {
    margin-top: 1.2rem;
    font-size: 1rem;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr);
    gap: 1.5rem;
    align-items: center;
}

.hero img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    object-fit: cover;
}

.tagline {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #444;
}

.label {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: 999px;
    background: #eee;
    margin-right: 0.3rem;
}

.pill {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    border-radius: 999px;
    border: 1px solid #ccc;
    margin: 0.1rem 0.1rem 0.1rem 0;
}

.two-cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.5rem;
}

.highlight {
    background: #f0f0f0;
    padding: 0.8rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.download-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.download-list > a {
    display: block;
    padding: 0.2rem 0;
    text-decoration: none;
    color: #0055aa;
    font-weight: 500;
    margin-left: 2rem;
    margin-top: -0.4rem;
    margin-bottom: -0.4rem;
}
    
.download-list a:hover {
    text-decoration: underline;
}

.download-item {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.download-item h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
}

/* Download links - clean, single definition */
.download-links {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-items: center;
}

.btn-preview,
.btn-download {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    cursor: pointer;
    flex: 1;
    min-width: 140px;
    max-width: 220px;
}

.btn-preview {
    background: #f0f0f0;
    color: #0050aa;
    border: 1px solid #0050aa;
}

.btn-preview:hover { background: #e0e0e0; text-decoration: none; }

.btn-download { background: #0050aa; color: #fff; }
.btn-download:hover { background: #003d7a; }

.btn-preview:active, .btn-download:active { transform: scale(0.98); }

@media (max-width: 800px) {
    .download-links { flex-direction: column; }
    .btn-preview, .btn-download { width: 100%; max-width: none; }
}

.media-placeholder {
    border: 1px dashed #bbb;
    border-radius: 4px;
    padding: 0.8rem;
    font-size: 0.85rem;
    color: #555;
    background: #fafafa;
    margin-bottom: 0.8rem;
}

.contact-card {
    background: #111;
    color: #f5f5f5;
    padding: 1rem;
    border-radius: 4px;
    font-size: 0.95rem;
}

.contact-card a {
    color: #fff;
}

footer {
    background: #111;
    color: #aaa;
    font-size: 0.8rem;
    padding: 1rem;
    text-align: center;
}

/* Bottone flottante "Torna su" */

#backToTop {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 999;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

#backToTop.show {
    opacity: 0.9;
    visibility: visible;
    pointer-events: auto;
}

#backToTop:hover {
    opacity: 1;
    background: #333;
}

/* Responsive tweaks */
@media (max-width: 1000px) {
    main { padding-left: 1rem; padding-right: 1rem }
}

@media (max-width: 800px) {
    .hero, .two-cols {
        grid-template-columns: minmax(0, 1fr);
    }

    nav {
        font-size: 0.9rem;
    }

    header .logo {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }

    header img { max-height: 48px }

    header h1 { font-size: 1.25rem }

    .tagline h3 { font-size: 1rem }
}

@media (max-width: 420px) {
    header { padding: 1rem }
    nav { font-size: 0.85rem; padding: 0.5rem }
    #backToTop { width:44px; height:44px; bottom:1rem; right:1rem }
}

/* Mobile nav show/hide */
@media (max-width: 800px) {
    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        color: #fff;
        font-size: 1.6rem;
        cursor: pointer;
        padding: 0.4rem 0.6rem;
        position: fixed;
        top: 0.8rem;
        right: 1rem;
        z-index: 1002;
        border-radius: 4px;
    }
  
    nav {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 999;
        flex-direction: column;
        background: #222;
        gap: 0;
        padding: 5rem 0 0 0;
        margin: 0;
    }
  
    nav a {
        padding: 1rem;
        margin-right: 0;
        border-bottom: 1px solid #333;
        white-space: normal;
    }
  
    nav a:last-child {
        border-bottom: none;
    }
    body.nav-open nav {
        display: flex;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.modal.open {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;
}

.modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    margin: auto;
    padding: 2rem;
    z-index: 2001;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #333;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.modal-close:hover {
    background: #f0f0f0;
}

.modal-close:focus {
    outline: 2px solid #0050aa;
    outline-offset: 2px;
}

.modal-content h2 {
    margin-top: 0;
    border-bottom: 2px solid #ddd;
    padding-bottom: 0.5rem;
    padding-right: 2.5rem;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.gallery-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.gallery-image-wrapper {
    width: 100%;
    aspect-ratio: 9 / 12;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.8rem;
}

.gallery-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-caption {
    font-weight: 600;
    color: #666;
    margin: 0.4rem 0 0.8rem;
    font-size: 0.95rem;
}

.download-btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: #0050aa;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.download-btn:hover {
    background: #003d7a;
}

.download-btn:active {
    transform: scale(0.98);
}

.modal-note {
    margin-top: 1.5rem;
    padding: 0.8rem;
    background: #f9f9f9;
    border-left: 3px solid #0050aa;
    font-size: 0.85rem;
    color: #666;
}

.modal-note code {
    background: #eee;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        padding: 1.5rem 1rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .modal-content h2 {
        padding-right: 2rem;
        font-size: 1.3rem;
    }
}
