/* style.css - Portfolio Alice Giordani (Accueil + Détail Projet) */

/* --- 1. Import des Polices --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500&family=Major+Mono+Display&display=swap');

/* --- 2. Variables & Reset --- */
:root {
    --bg-color: #ffffff;
    --text-main: #1a1a1a;
    --text-secondary: #555555;
    --border-color: #e0e0e0;
    --accent-gray: #f4f4f4;
    
    --font-display: 'Major Mono Display', monospace;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    --spacing-unit: 24px;
    --container-width: 1000px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.7;
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--text-main);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

a:hover {
    border-bottom: 1px solid var(--text-main);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    filter: grayscale(100%);
    transition: filter 0.4s ease;
}

img:hover {
    filter: grayscale(0%);
}

/* --- 3. Typographie --- */
h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 400;
    color: var(--text-main);
    margin-top: 0;
    line-height: 1.2;
    letter-spacing: -0.03em;
    text-transform: uppercase;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 1.5rem;
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    margin-bottom: 2rem;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--text-main);
    display: inline-block;
    width: 100%;
}

h3 {
    font-family: var(--font-body);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 65ch;
}

/* --- 4. Layout --- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-unit);
}

/* --- 5. Header --- */
header {
    padding: 2rem 0;
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    z-index: 100;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: flex-end;
    gap: 2rem;
}

nav a {
    font-family: var(--font-display);
    font-size: 0.9rem;
    text-transform: lowercase;
    color: var(--text-secondary);
}

nav a:hover {
    color: var(--text-main);
    border-bottom: none;
    position: relative;
}

nav a:hover::after {
    content: '_';
    position: absolute;
    right: -10px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* --- 6. Hero Section (Accueil) --- */
.hero {
    padding: 6rem 0 4rem;
}

.hero p {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 50ch;
}

/* --- 7. Grille de Projets (Accueil) --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 4rem 2rem;
    margin-top: 3rem;
    margin-bottom: 4rem;
}

.project-card {
    display: flex;
    flex-direction: column;
}

.project-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 4/3;
    object-fit: cover;
    margin-bottom: 1rem;
    background-color: var(--accent-gray);
    filter: grayscale(100%);
}

.project-card:hover img {
    filter: grayscale(0%);
}

.project-card h3 {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.project-card p {
    font-size: 0.9rem;
    margin-bottom: 0;
    line-height: 1.5;
}

.project-card a {
    display: inline-block;
    margin-top: 0.8rem;
    font-family: var(--font-display);
    font-size: 0.8rem;
    text-transform: lowercase;
    border-bottom: 1px solid var(--text-main);
    padding-bottom: 2px;
}

.project-card a:hover {
    background-color: var(--text-main);
    color: var(--bg-color);
    border-bottom: none;
}

/* --- 8. Sections Contenu (Accueil) --- */
#apropos, #contact {
    padding: 4rem 0;
    border-top: 1px solid var(--border-color);
}

#apropos p, #contact p {
    margin-bottom: 2rem;
}

.contact-link {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--text-main);
    padding-bottom: 5px;
}

.contact-link:hover {
    background-color: var(--text-main);
    color: var(--bg-color);
    border-bottom: none;
}

/* =========================================
   STYLES SPÉCIFIQUES PAGE DÉTAIL PROJET (MODE GALERIE)
   ========================================= */

/* Lien retour */
.back-link {
    display: inline-block;
    margin-bottom: 3rem;
    font-family: var(--font-display);
    font-size: 0.9rem;
    text-transform: lowercase;
    color: var(--text-secondary);
    margin-top: 2rem;
    border-bottom: 1px solid transparent;
}

.back-link:hover {
    color: var(--text-main);
    border-bottom: 1px solid var(--text-main);
    text-decoration: none;
}

/* En-tête du projet */
.project-header {
    margin-bottom: 4rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.project-header p {
    font-size: 1.2rem;
    line-height: 1.6;
    max-width: 70ch;
    margin-bottom: 1.5rem;
}

/* Métadonnées */
.project-meta {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.5rem;
    text-transform: lowercase;
    width: 100%;
    max-width: none;
    border-top: 1px solid var(--accent-gray);
    padding-top: 1.5rem;
}

.project-meta div {
    display: flex;
    flex-direction: column;
}

.project-meta strong {
    color: var(--text-main);
    font-weight: 500;
    font-family: var(--font-body);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    margin-bottom: 0.3rem;
    display: block;
}

/* Conteneur principal du contenu */
.project-content {
    display: flex;
    flex-direction: column;
    gap: 4rem; /* Grand espace entre les blocs */
    margin-bottom: 4rem;
    max-width: 800px; /* Largeur de lecture optimale pour le texte */
    margin-left: auto;
    margin-right: auto;
}

/* Blocs de texte */
.content-text h3 {
    font-family: var(--font-body);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.content-text p, .content-text ul {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.content-text ul {
    padding-left: 1.2rem;
}

/* --- GALERIE D'IMAGES --- */
.gallery-grid {
    display: grid;
    grid-template-columns: 1fr; /* Par défaut 1 colonne (pleine largeur) */
    gap: 2rem;
    width: 100%;
    margin: 3rem 0;
}

/* Classe utilitaire pour forcer une image en pleine largeur */
.gallery-item-full {
    grid-column: 1 / -1;
}

/* Classe utilitaire pour créer une grille de 2 images côte à côte sur grand écran */
@media (min-width: 768px) {
    .gallery-grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}

.gallery-item {
    display: flex;
    flex-direction: column;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    background-color: var(--accent-gray);
    filter: grayscale(100%);
    transition: filter 0.4s ease, transform 0.4s ease;
    margin-bottom: 0.8rem;
}

.gallery-item:hover img {
    filter: grayscale(0%);
    /* Optionnel : très léger zoom au survol */
    /* transform: scale(1.02); */ 
}

.gallery-item p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: var(--font-display);
    margin: 0;
    line-height: 1.4;
    text-align: left;
}

/* --- Gestion des vidéos (Vimeo/YouTube) en pleine largeur --- */

.gallery-item iframe {
    width: 100%;
    aspect-ratio: 16 / 9; /* Force le format 16:9 moderne */
    border: none;
    display: block;
    background-color: #000; /* Fond noir pendant le chargement */
    margin-bottom: 0.8rem; /* Même marge que les images */
}

/* Fallback pour les très vieux navigateurs ne supportant pas aspect-ratio */
@supports not (aspect-ratio: 16 / 9) {
    .gallery-item iframe {
        position: relative;
        padding-bottom: 56.25%; /* 16:9 ratio */
        height: 0;
        overflow: hidden;
    }
    .gallery-item iframe iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}

/* =========================================
   SECTION CRÉDITS & COLLABORATEURS
   ========================================= */

.project-credits {
    margin-top: 5rem;
    padding: 3rem 0;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-color);
}

.project-credits h4 {
    font-family: var(--font-body);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-main);
    margin-bottom: 2rem;
    font-weight: 600;
}

.credits-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.credit-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.credit-label {
    font-family: var(--font-body); /* Label en police standard pour contraster */
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-main);
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    width: fit-content;
}

.credit-list {
    margin: 0;
    padding: 0;
    list-style: none;
    line-height: 1.8; /* Plus d'espace pour la lisibilité */
}

.credit-list li {
    margin-bottom: 0.4rem;
}

/* --- STYLE DES LIENS DANS LES CRÉDITS --- */
.credit-list a {
    color: var(--text-secondary);
    text-decoration: none; /* Pas de soulignement par défaut */
    border-bottom: 1px solid transparent; /* Réserve l'espace pour éviter le saut */
    transition: all 0.3s ease;
    padding: 2px 4px;
    margin: -2px -4px; /* Compense le padding pour l'alignement */
    display: inline;
    text-decoration: underline;
}

/* Effet Hover : Fond noir, texte blanc (comme les boutons "Voir l'étude de cas") */
.credit-list a:hover {
    background-color: var(--text-main);
    color: var(--bg-color);
    border-bottom: 1px solid var(--text-main);
    text-decoration: none;
}

/* Style pour les noms en gras (non-liens) */
.credit-list strong {
    color: var(--text-main);
    font-weight: 500;
    margin-right: 4px;
}

/* Mise en page Desktop pour les crédits */
@media (min-width: 768px) {
    .credits-grid {
        grid-template-columns: 1fr 1fr; /* Deux colonnes sur écran large */
        column-gap: 4rem;
    }
}

/* Footer spécifique (hérité mais vérifié) */
footer {
    padding: 3rem 0;
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: var(--font-display);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

footer p {
    margin: 0;
    max-width: none;
}

/* Responsive Mobile */
@media (max-width: 768px) {
    .project-header {
        margin-bottom: 2.5rem;
    }
    
    .project-content {
        gap: 2.5rem;
        padding: 0 var(--spacing-unit); /* Petit padding sur mobile si besoin */
    }
    
    .gallery-grid-2 {
        grid-template-columns: 1fr; /* Retour à 1 colonne sur mobile */
    }
    
    footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* =========================================
   BOUTON RETOUR EN HAUT (BACK TO TOP)
   ========================================= */

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background-color: var(--bg-color);
    border: 2px solid var(--text-main);
    border-radius: 50%; /* Cercle parfait */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 999;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Classe ajoutée via JS pour afficher le bouton */
.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Flèche CSS pure (pas besoin d'image) */
.back-to-top::after {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    border-top: 2px solid var(--text-main);
    border-left: 2px solid var(--text-main);
    transform: rotate(45deg) translateY(-2px); /* Pointe vers le haut */
    transition: border-color 0.3s ease;
}

/* Hover : Inversion des couleurs (comme le reste du site) */
.back-to-top:hover {
    background-color: var(--text-main);
    border-color: var(--text-main);
}

.back-to-top:hover::after {
    border-color: var(--bg-color); /* Flèche blanche au survol */
}

/* Responsive : ajustement sur mobile */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 44px;
        height: 44px;
    }
}