/* ======================================================== */
/* --- PAGE RÉALISATIONS (Grid 2 Colonnes & Clean Glass) --- */
/* ======================================================== */

/* Grille adaptative : 2 colonnes par ligne (s'adapte s'il y en a 3, 4, 5...) */
.portfolio-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    max-width: 1100px;
    margin: 0 auto;
}

/* La Carte Horizontale */
.portfolio-card {
    position: relative;
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.15);
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.05);
    aspect-ratio: 16/11; /* Rectangle horizontal, parfait pour les interfaces web */
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Texte en bas */
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUpCase 0.8s ease forwards;
}

@keyframes fadeUpCase { to { opacity: 1; transform: translateY(0); } }

/* L'image de fond */
.portfolio-card-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center; /* Aligne l'image en haut */
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 1;
}

.portfolio-card:hover .portfolio-card-img {
    transform: scale(1.04);
}

/* La zone de texte (Fond sombre uni avec léger flou) */
.portfolio-glass-panel {
    position: relative;
    z-index: 10;
    background: rgba(15, 23, 42, 0.92); /* Bleu nuit très opaque et propre */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 25px 30px 20px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Ligne Titre (à gauche) + Tag (à droite) */
.glass-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 8px;
}

.portfolio-glass-panel h3 {
    font-size: 1.4rem;
    color: white;
    margin: 0;
}

/* Tags de projets (Couleurs unies, pro, pas de dégradé) */
.portfolio-tags {
    display: flex;
    gap: 8px;
}

.case-tag {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 5px 12px;
    border-radius: 6px; /* Bords légèrement arrondis (plus pro que les pilules) */
    white-space: nowrap;
}

/* Tag Projet Agence (Bleu) */
.case-tag.waas {
    background: var(--primary-color);
    color: white;
}

/* Tag Projet Perso (Gris anthracite) */
.case-tag.perso {
    background: #334155;
    color: #f8fafc;
}

.client-name {
    display: block;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.portfolio-glass-panel p {
    color: #cbd5e1;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limite à 2 lignes pour ne pas écraser l'image */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Le Footer de la carte (Liens) */
.portfolio-card-footer {
    position: relative;
    z-index: 10;
    background: #0b1120; /* Plus sombre que le panneau pour marquer la séparation */
    padding: 12px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.link-status {
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.link-status.active { color: #60a5fa; }
.link-status.inactive { color: #64748b; }

.link-status a { color: white; text-decoration: none; transition: color 0.2s; }
.link-status a:hover { color: #60a5fa; text-decoration: underline; }

/* ======================================================== */
/* --- CARTE "VOTRE PROJET" (Appel à l'action réparé) --- */
/* ======================================================== */
.portfolio-card.cta-card {
    background: transparent;
    border: 2px dashed #cbd5e1; /* Bordure grise visible sur fond blanc */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    box-shadow: none;
}

.portfolio-card.cta-card:hover {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 15px 35px -10px rgba(37, 99, 235, 0.15);
    transform: translateY(-5px);
}

.cta-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.cta-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    transition: all 0.3s ease;
}

.portfolio-card.cta-card:hover .cta-icon {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

/* Couleurs corrigées pour être lisibles sur le fond de la page (.section-light) */
.cta-content h3 { color: var(--dark); font-size: 1.5rem; margin: 0; }
.cta-content p { color: var(--gray); font-size: 0.95rem; line-height: 1.6; }

/* Responsive : 1 colonne sur mobile */
@media (max-width: 768px) {
    .portfolio-list { grid-template-columns: 1fr; gap: 30px; }
    .portfolio-card { aspect-ratio: auto; min-height: 400px; }
    .portfolio-glass-panel { padding: 20px; }
    .portfolio-card-footer { padding: 12px 20px; }
}

/* Rend les cartes cliquables visuellement */
.portfolio-card {
    cursor: pointer;
}

/* ======================================================== */
/* --- SYSTEME D'OUVERTURE (MODAL / LIGHTBOX) --- */
/* ======================================================== */

/* Le fond sombre par-dessus tout le site */
.portfolio-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.portfolio-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* La grande carte qui s'ouvre */
.portfolio-modal-content {
    background: #1e293b;
    width: 100%;
    max-width: 850px;
    max-height: 90vh; /* Ne dépasse jamais l'écran */
    border-radius: var(--radius-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(30px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
}

.portfolio-modal-overlay.active .portfolio-modal-content {
    transform: translateY(0) scale(1);
}

/* Le bouton Fermer "X" */
.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    border-radius: 50%;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

/* L'image en grand */
.modal-img-wrapper {
    width: 100%;
    height: 350px;
    flex-shrink: 0; /* Empêche l'image de s'écraser */
}

.modal-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

/* Le texte en grand (avec un scroll s'il est très long) */
.modal-body-wrapper {
    padding: 40px;
    overflow-y: auto; /* Permet de scroller juste le texte si besoin */
}

.modal-body-wrapper h3 {
    font-size: 1.8rem;
    color: white;
    margin-bottom: 5px;
}

/* On force le texte à s'afficher en entier (suppression du line-clamp) */
.modal-body-wrapper p {
    color: #cbd5e1;
    font-size: 1.05rem;
    line-height: 1.7;
    margin-top: 20px;
    display: block; /* Écrase le display: -webkit-box */
    overflow: visible;
}

.modal-body-wrapper .portfolio-card-footer {
    background: transparent;
    padding: 0;
    border: none;
    margin-top: 30px;
}

/* Responsive pour téléphone */
@media (max-width: 768px) {
    .modal-img-wrapper { height: 220px; }
    .modal-body-wrapper { padding: 25px; }
    .modal-body-wrapper h3 { font-size: 1.5rem; }
}