﻿/* ==========================================
   ARTE CONTEMPORANEA - STYLES
   Organizzazione: Variables → Reset → Protezione → Navigation → Layout → Typography → Content → Media Queries
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:ital,wght@0,400;0,600;0,700;1,400&family=Inter:wght@300;400;500;600&display=swap');

/* ========== VARIABLES ========== */
:root {
    --color-bg: #fafaf8;
    --color-text: #2a2a2a;
    --color-accent: #1a1a1a;
    --color-muted: #6a6a6a;
    --color-border: #e0e0e0;
    --spacing-unit: 1.5rem;
    --max-width: 1200px;
    --max-width-text: 1200px;
}

/* ========== RESET ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

    /* ========== PROTEZIONE CONTENUTI - Impedisce selezione, copia e drag ========== */

    /* Impedisce selezione del testo su tutti gli elementi */
    *,
    *::before,
    *::after {
        -webkit-user-select: none !important;
        -moz-user-select: none !important;
        -ms-user-select: none !important;
        user-select: none !important;
        -webkit-touch-callout: none !important;
    }

/* Impedisce il drag delle immagini */
img {
    -webkit-user-drag: none !important;
    -khtml-user-drag: none !important;
    -moz-user-drag: none !important;
    -o-user-drag: none !important;
    user-drag: none !important;
    pointer-events: none;
}

/* Mantiene i link delle immagini cliccabili */
a img {
    pointer-events: auto;
}

/* Impedisce il menu contestuale del tasto destro */
body {
    -webkit-touch-callout: none !important;
}

/* Opzionale: permetti la selezione solo per elementi specifici se necessario */
.selectable {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* ========== BASE ========== */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Crimson Text', 'Georgia', serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.8;
    font-size: 18px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    padding-top: 120px;
}

/* ========== NAVIGATION ========== */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(250, 250, 248, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    z-index: 1000;
    padding: 1.5rem 0;
}

    nav ul {
        list-style: none;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 4rem; /* Più spazio tra i pochi elementi */
        max-width: var(--max-width);
        margin: 0 auto;
        padding: 0 2rem;
    }

    nav li {
        display: flex;
        align-items: center;
    }

    nav a {
        font-family: 'Inter', sans-serif;
        font-size: 0.95rem;
        font-weight: 400;
        letter-spacing: 0.5px;
        text-decoration: none;
        color: var(--color-muted);
        transition: color 0.3s ease;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

        nav a:hover,
        nav a.active {
            color: var(--color-accent);
        }

/* Icone nella navigazione */
.nav-icon {
    font-size: 1.2rem;
    display: inline-block;
}

.nav-text {
    font-size: 0.9rem;
    text-transform: uppercase;
    display: inline-block;
}

/* ========== LAYOUT - CONTAINERS ========== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.container-text {
    max-width: var(--max-width-text);
    margin: 0 auto;
    padding: 0 2rem;
}

/* ========== HERO SECTION ========== */
.hero {
    min-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 4rem 2rem;
}

.hero-title {
    font-family: 'Crimson Text', serif;
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 600;
    line-height: 1.1;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: clamp(1rem, 2vw, 1.3rem);
    font-weight: 300;
    color: var(--color-muted);
    letter-spacing: 0.5px;
    margin-bottom: 3rem;
    max-width: 700px;
}

.hero-divider {
    width: 60px;
    height: 1px;
    background-color: var(--color-accent);
    margin: 3rem auto;
}

.hero-notation {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-style: italic;
    color: var(--color-muted);
    letter-spacing: 0.3px;
}

/* ========== TYPOGRAPHY ========== */
h1, h2, h3, h4 {
    font-family: 'Crimson Text', serif;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

h4 {
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

p {
    margin-bottom: 1.5rem;
}

em {
    font-style: italic;
    font-weight: inherit;
}

strong {
    font-weight: 600;
}

.lead {
    font-size: 1.25rem;
    line-height: 1.8;
    color: var(--color-muted);
    font-weight: 400;
}

.bracket {
    font-weight: 400;
    opacity: 0.6;
}

/* ========== PARAGRAFI - Indentazione ========== */
.container-text p {
    font-size: 24px;
    line-height: 1.22;
    margin-bottom: 1.5rem;
    text-indent: 2rem;
}

    .container-text p:first-of-type,
    .container-text h3 + p,
    .container-text h4 + p,
    .container-text .lead {
        text-indent: 0;
    }

    .container-text p[style*="text-align"] {
        text-indent: 2rem !important;
    }

    .container-text p > strong:first-child {
        display: block;
        text-indent: 0;
        margin-left: -2rem;
        margin-bottom: 0.5rem;
    }

    .container-text p.has-heading {
        text-indent: 0;
    }

        .container-text p.has-heading > strong:first-child {
            display: block;
            margin-bottom: 0.5rem;
            margin-left: 0;
        }

    .container-text p > strong:first-child + br {
        display: block;
        content: "";
        margin-bottom: 0.5rem;
    }

.container-text h4 + p {
    text-indent: 0;
    margin-top: -0.3rem;
}

.container-text h4:has(+ p) {
    margin-bottom: 0.5rem;
}

/* ========== LISTE ========== */
.container-text ul,
.container-text ol {
    font-size: 24px;
    line-height: 1.22;
    margin-bottom: 1.5rem;
    margin-left: 2rem;
}

.container-text li {
    font-size: 24px;
    line-height: 1.22;
    margin-bottom: 0.5rem;
}

    .container-text li:last-child {
        margin-bottom: 0;
    }

/* ========== SECTIONS ========== */
section {
    padding: 6rem 0;
}

    section:last-child {
        border-bottom: none;
    }

.section-title {
    text-align: center;
    margin-bottom: 4rem;
}

    .section-title h1 {
        margin-bottom: 0.25rem;
    }

    .section-title h2 {
        font-size: 2rem;
        font-weight: 400;
        color: var(--color-muted);
        margin-top: 0.25rem;
        margin-bottom: 0;
    }

/* ========== SECTION PREVIEWS (Home) ========== */
.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    padding: 6rem 0;
}

.section-card {
    border: 1px solid var(--color-border);
    padding: 3rem 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: white;
    cursor: pointer;
}

    .section-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    }

    .section-card h3 {
        font-family: 'Crimson Text', serif;
        font-size: 1.8rem;
        font-weight: 600;
        margin-bottom: 1rem;
        line-height: 1.3;
    }

    .section-card p {
        font-size: 1rem;
        line-height: 1.7;
        color: var(--color-muted);
    }

.section-number {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 1px;
    color: var(--color-muted);
    margin-bottom: 1rem;
    text-transform: uppercase;
}

/* ========== TITOLI SEZIONI H3 ========== */
.container-text h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

    .container-text h3:first-of-type {
        margin-top: 0;
    }

/* ========== QUOTES ========== */
blockquote {
    font-style: italic;
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    border-left: 3px solid var(--color-border);
    color: var(--color-muted);
}

    blockquote cite {
        display: block;
        margin-top: 1rem;
        font-size: 0.9rem;
        font-style: normal;
        font-weight: 600;
        color: var(--color-accent);
    }

/* Hero quotes - stile speciale per la home */
.hero-quote {
    max-width: 750px;
    margin: 1rem auto;
    padding: 0;
    border-left: none;
    text-align: right;
}

    .hero-quote p {
        font-size: 1.2rem;
        line-height: 1.6;
        margin-bottom: 0.5rem;
        color: var(--color-muted);
        font-style: italic;
    }

    .hero-quote cite {
        font-size: 1.05rem;
        font-weight: 600;
        color: var(--color-accent);
        font-style: normal;
        display: block;
        margin-top: 0.4rem;
    }

/* ========== CODE ========== */
code {
    font-family: 'Courier New', Consolas, monospace;
    background-color: #f5f5f5;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
    color: var(--color-accent);
}

/* ========== IMAGES & FIGURES ========== */
.image-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    margin: 2rem 0;
}

figure {
    margin: 3rem 0;
    text-align: center;
}

    /* Immagini ridotte (80%) - default */
    figure img {
        width: 80%;
        height: auto;
        display: block;
        margin: 0 auto;
    }

    /* Immagini a larghezza piena del testo */
    figure.figure-full-width img {
        width: 100%;
    }

figcaption {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--color-muted);
    margin-top: 1rem;
    text-align: center;
    font-style: italic;
}

/* Cover image con blend mode */
.cover-image {
    mix-blend-mode: multiply;
    opacity: 0.95;
}

/* ========== GALLERY GRID ========== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin: 4rem 0;
}

.gallery-item {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 3/2;
    background-color: var(--color-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

    .gallery-item:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    }

    .gallery-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform 0.3s ease;
    }

    .gallery-item:hover img {
        transform: scale(1.05);
    }

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-number {
    font-family: 'Inter', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    letter-spacing: 2px;
}

/* Gallery quadrate */
.gallery-grid-square {
    grid-template-columns: repeat(4, 1fr);
}

.gallery-item-square {
    aspect-ratio: 1/1;
}

/* Gallery panoramiche (L.O.W.) */
.gallery-grid-panoramic {
    grid-template-columns: 1fr;
    gap: 3rem;
}

.gallery-item-panoramic {
    aspect-ratio: 2.857/1;
}

/* ========== PAGE NAVIGATION ========== */
.page-navigation {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    max-width: var(--max-width-text);
    margin: 2rem auto 0 auto;
    padding: 1rem 2rem 0.5rem 2rem;
    gap: 2rem;
    position: static;
    width: 100%;
}

    .page-navigation .prev-page {
        justify-self: start;
    }

    .page-navigation .gallery-link,
    .page-navigation a:only-of-type {
        justify-self: center;
        grid-column: 2;
    }

    .page-navigation .next-page {
        justify-self: end;
        grid-column: 3;
    }

    .page-navigation .spacer {
        display: none;
    }

    .page-navigation a:first-child:nth-last-child(2) {
        grid-column: 1;
    }

    .page-navigation a:last-child:nth-child(2) {
        grid-column: 2;
    }

    .page-navigation a:first-child:nth-last-child(3) {
        grid-column: 1;
    }

    .page-navigation a:nth-child(2):nth-last-child(2) {
        grid-column: 2;
    }

    .page-navigation a:last-child:nth-child(3) {
        grid-column: 3;
    }

/* ========== BIOGRAFIA LAYOUT ========== */
.bio-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 4rem;
    align-items: start;
    margin-bottom: 4rem;
}

.bio-image {
    position: sticky;
    top: 140px;
}

    .bio-image img {
        width: 100%;
        height: auto;
        display: block;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    }

/* ========== CONTACTS SECTION ========== */
.contacts-section {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--color-border);
}

    .contacts-section h3 {
        font-size: 1.8rem;
        font-weight: 600;
        margin-bottom: 2rem;
        text-align: center;
    }

.contacts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 700px;
    margin: 0 auto;
}

.contact-item {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 1rem;
    background-color: #f9f9f9;
    border-left: 3px solid var(--color-accent);
}

.contact-label {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-accent);
    min-width: 120px;
    flex-shrink: 0;
}

.contact-item a {
    font-family: 'Inter', sans-serif;
    color: var(--color-muted);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.95rem;
    word-break: break-all;
}

    .contact-item a:hover {
        color: var(--color-accent);
        text-decoration: underline;
    }

/* ========== FOOTER ========== */
footer {
    padding: 4rem 2rem;
    text-align: center;
    margin-top: 6rem;
}

    footer p {
        font-family: 'Inter', sans-serif;
        font-size: 0.9rem;
        color: var(--color-muted);
    }

/* ==========================================
   RESPONSIVE MEDIA QUERIES
   ========================================== */

/* ========== TABLET (1024px) ========== */
@media (max-width: 1024px) {
    nav ul {
        gap: 3rem;
    }

    /* Gallery quadrate */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-grid-square {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Biografia */
    .bio-layout {
        grid-template-columns: 1fr 300px;
        gap: 3rem;
    }
}

/* ========== MOBILE LARGE (768px) ========== */
@media (max-width: 768px) {
    /* Navigation */
    nav {
        padding: 1rem 0;
    }

        nav ul {
            gap: 2rem;
        }

    /* Su mobile mostra solo le icone */
    .nav-text {
        display: none;
    }

    .nav-icon {
        font-size: 1.4rem;
    }

    /* Layout */
    main {
        padding-top: 140px;
    }

    .hero {
        min-height: calc(100vh - 140px);
    }

    /* Typography */
    h4 {
        margin-top: 2rem;
    }

    .container-text p {
        font-size: 20px;
        line-height: 1.3;
    }

    .container-text ul,
    .container-text ol {
        font-size: 20px;
        line-height: 1.3;
    }

    .container-text li {
        font-size: 20px;
        line-height: 1.3;
    }

    .section-title h2 {
        font-size: 1.5rem;
    }

    /* Sections */
    section {
        padding: 4rem 0;
    }

    .section-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* Images - 100% su mobile */
    figure img,
    figure.figure-full-width img {
        width: 100%;
    }

    /* Gallery */
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .gallery-item-overlay {
        opacity: 1;
        background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
    }

    .gallery-grid-square {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-grid-panoramic {
        gap: 2rem;
    }

    /* Page Navigation */
    .page-navigation {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

        .page-navigation a {
            justify-self: center !important;
            grid-column: 1 !important;
            width: 100%;
            justify-content: center;
        }

    /* Biografia */
    .bio-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .bio-image {
        position: static;
        max-width: 400px;
        margin: 0 auto;
    }

    /* Contacts */
    .contacts-section {
        margin-top: 3rem;
        padding-top: 2rem;
    }

    .contact-item {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .contact-label {
        min-width: auto;
    }
}

/* ========== MOBILE SMALL (480px) ========== */
@media (max-width: 480px) {
    body {
        font-size: 16px;
    }

    main {
        padding-top: 160px;
    }

    nav ul {
        gap: 1.5rem;
    }

    .nav-icon {
        font-size: 1.3rem;
    }

    .hero {
        min-height: calc(100vh - 160px);
    }

    .container-text p {
        font-size: 19px;
        line-height: 1.25;
    }

    .container-text ul,
    .container-text ol {
        font-size: 19px;
        line-height: 1.25;
    }

    .container-text li {
        font-size: 19px;
        line-height: 1.25;
    }

    .section-title h2 {
        font-size: 1.3rem;
    }

    .gallery-grid-square {
        grid-template-columns: 1fr;
    }

    .bio-image {
        max-width: 100%;
    }

    .contacts-grid {
        gap: 1rem;
    }

    .contact-item {
        padding: 0.75rem;
    }
}