/**
 * NEEDLE.CSS - Thème musique avec galerie photo
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Space+Grotesk:wght@400;700&display=swap');

:root {
    --needle-pink: #F5A9B8;
    --needle-blue: #5BCEFA;
    --needle-white: #FFFFFF;
    --needle-bg: #fdf8f9;
    --needle-surface: #ffffff;
    --needle-border: #f0d4db;
    --needle-text: #4a3f42;
    --needle-text-light: #8a7d80;
    --font-display: 'Space Grotesk', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    --max-width: 1400px;
    --spacing: 2rem;
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: auto;
    overflow-y: scroll;
    overflow-x: hidden;
}

body.needle-universe {
    font-family: var(--font-body);
    color: var(--needle-text);
    line-height: 1.6;
    background: var(--needle-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    width: 100%;
}

/* HEADER */
.needle-header {
    padding: 1rem var(--spacing);
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, #F5A9B8 0%, #FFFFFF 50%, #5BCEFA 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

.needle-header nav {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.needle-header .logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--needle-text);
    text-decoration: none;
}

.needle-header nav a:not(.logo) {
    font-size: 0.9rem;
    color: var(--needle-text-light);
    text-decoration: none;
    transition: color 0.2s;
}

.needle-header nav a:hover,
.needle-header nav a.active {
    color: var(--needle-text);
}

/* MAIN */
.needle-main {
    flex: 1 0 auto;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--spacing);
    position: relative;
    z-index: 1;
}

/* HERO */
.needle-main .hero {
    text-align: center;
    padding: 4rem 0;
}

.needle-main .hero h1 {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--needle-pink), var(--needle-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
}

.needle-main .hero .tagline {
    color: var(--needle-text-light);
    margin-top: 0.5rem;
}

/* ===== GALERIE PHOTO (PAGE ACCUEIL) ===== */
.gallery-page {
    max-width: 1600px;
}

.photo-gallery {
    margin-top: 2rem;
}

.gallery-masonry {
    column-count: 4;
    column-gap: 1rem;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 1rem;
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-item:hover figcaption {
    opacity: 1;
}

/* Responsive galerie */
@media (max-width: 1200px) {
    .gallery-masonry { column-count: 3; }
}

@media (max-width: 768px) {
    .gallery-masonry { column-count: 2; }
    .needle-main .hero h1 { font-size: 2.5rem; }
}

@media (max-width: 480px) {
    .gallery-masonry { column-count: 1; }
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem 0;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.pagination a {
    color: var(--needle-pink);
    text-decoration: none;
    font-weight: 500;
}

.pagination a:hover {
    text-decoration: underline;
}

.pagination-info {
    color: var(--needle-text-light);
}

/* ===== LIGHTBOX ===== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox.active {
    display: flex;
}

.lightbox-img {
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-caption {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1.1rem;
    text-align: center;
    max-width: 80%;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: none;
    border: none;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    padding: 1rem;
    line-height: 1;
    transition: opacity 0.2s;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    opacity: 0.7;
}

.lightbox-close {
    top: 1rem;
    right: 1rem;
}

.lightbox-prev {
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

/* ===== DISCOGRAPHIE ===== */
.discography-page {
    max-width: 900px;
}

.discography-page h1 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.discography-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.year-heading {
    font-family: var(--font-display);
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--needle-pink), var(--needle-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--needle-border);
}

.year-heading:first-child {
    margin-top: 0;
}

.disco-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--needle-border);
    position: relative;
    transition: background 0.2s;
}

.disco-item:hover {
    background: rgba(245, 169, 184, 0.05);
}

.disco-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    text-decoration: none;
    color: inherit;
}

.disco-cover {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--needle-pink), var(--needle-blue));
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.disco-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.placeholder-cover {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--needle-pink), var(--needle-blue));
}

.disco-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.disco-info h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--needle-text);
    margin: 0;
}

.disco-info .type {
    font-size: 0.75rem;
    color: var(--needle-pink);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.disco-info time {
    font-size: 0.85rem;
    color: var(--needle-text-light);
}

.bandcamp-badge {
    font-size: 1.25rem;
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.bandcamp-badge:hover {
    background: var(--needle-bg);
}

/* ===== PAGE PROJET UNIQUE ===== */
.project-single {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.project-header {
    text-align: center;
    margin-bottom: 2rem;
}

.type-badge {
    display: inline-block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--needle-pink);
    border: 1px solid var(--needle-pink);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    margin-bottom: 1rem;
}

.project-header h1 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.project-header time {
    color: var(--needle-text-light);
}

.cover-large {
    margin: 2rem 0;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(91, 206, 250, 0.2);
}

.cover-large img {
    width: 100%;
    height: auto;
    display: block;
}

.project-description {
    color: var(--needle-text-light);
    font-size: 1.1rem;
    line-height: 1.8;
    margin: 2rem 0;
}

/* BANDCAMP */
.bandcamp-section {
    margin: 2rem 0;
}

.bandcamp-player-container {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 1rem;
    background: #ffffff;
    border-radius: var(--radius);
    border: 1px solid var(--needle-border);
    overflow: hidden;
    position: relative;
}

.bandcamp-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--needle-text-light);
    font-family: var(--font-display);
    font-size: 0.9rem;
    z-index: 1;
}

.bandcamp-player-container.album {
    width: 700px;
    max-width: 100%;
    min-height: 472px;
}

.bandcamp-player-container.album iframe {
    width: 100%;
    height: 472px;
    border: none;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bandcamp-player-container.track {
    width: 700px;
    max-width: 100%;
    min-height: 120px;
}

.bandcamp-player-container.track iframe {
    width: 100%;
    height: 120px;
    border: none;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bandcamp-external {
    text-align: center;
    margin-top: 1rem;
}

.bandcamp-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--needle-pink), var(--needle-blue));
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-family: var(--font-display);
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.bandcamp-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 169, 184, 0.4);
}

.streaming-links {
    margin: 2rem 0;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* GALERIE PROJET */
.media-gallery {
    margin-top: 3rem;
}

.media-gallery h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.media-gallery .gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.media-gallery .gallery-item {
    border-radius: 8px;
    overflow: hidden;
}

.media-gallery .gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

/* ===== COMMENTAIRES ===== */

.comments-section {
    max-width: 900px;
    margin: 3rem auto 2rem;
    background: var(--needle-surface);
    border: 1px solid var(--needle-border);
    border-radius: var(--radius);
    padding: 2.5rem 3rem;
}

.comments-section h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--needle-text);
}

.comments-empty {
    color: var(--needle-text-light);
    font-style: italic;
    margin-bottom: 2rem;
}

.comment-alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.comment-alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.comment-alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.comments-list {
    margin-bottom: 2rem;
}

.comment {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--needle-border);
}

.comment:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--needle-pink);
}

.comment-date {
    font-size: 0.8rem;
    color: var(--needle-text-light);
}

.comment-body {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--needle-text);
}

/* Formulaire */
.comment-form {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--needle-border);
}

.comment-form .form-group {
    margin-bottom: 1.25rem;
}

.comment-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--needle-text);
    margin-bottom: 0.4rem;
}

.comment-form input[type="text"],
.comment-form textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid var(--needle-border);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--needle-text);
    background: var(--needle-bg);
    transition: border-color 0.2s;
}

.comment-form input[type="text"]:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--needle-pink);
    box-shadow: 0 0 0 3px rgba(245, 169, 184, 0.15);
}

.comment-form textarea {
    resize: vertical;
    min-height: 100px;
}

.comment-submit {
    display: inline-block;
    padding: 0.7rem 2rem;
    background: linear-gradient(135deg, var(--needle-pink), var(--needle-blue));
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.comment-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 169, 184, 0.4);
}

/* TOGGLE UNIVERS - LAPIN */
.universe-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4169E1, #7C3AED);
    color: white;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    cursor: pointer;
    border: none;
    transition: transform 0.2s;
}

.universe-toggle:hover {
    transform: scale(1.1);
}

/* FOOTER */
.needle-footer {
    flex-shrink: 0;
    width: 100%;
    text-align: center;
    padding: 2rem var(--spacing);
    color: var(--needle-text-light);
    font-size: 0.85rem;
    border-top: 2px solid var(--needle-border);
    background: var(--needle-bg);
    margin-top: auto;
}

/* UTILITAIRES */
.back-link {
    display: inline-block;
    margin-top: 2rem;
    color: var(--needle-pink);
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

.empty {
    text-align: center;
    color: var(--needle-text-light);
    padding: 4rem;
}

/* LIENS PROJETS */
.project-link {
    position: relative;
    padding-left: 2rem;
}

.project-link::before {
    position: absolute;
    left: 0;
    top: 0;
}

.alice-link::before {
    content: "🐇";
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .discography-page h1 {
        font-size: 1.75rem;
    }
    
    .disco-cover {
        width: 60px;
        height: 60px;
    }
    
    .disco-info h3 {
        font-size: 1rem;
    }
    
    .bandcamp-player-container.album {
        min-height: 340px;
    }
    
    .bandcamp-player-container.album iframe {
        height: 340px;
    }
    
    .bandcamp-player-container.track {
        min-height: 100px;
    }
    
    .bandcamp-player-container.track iframe {
        height: 100px;
    }
    
    .universe-toggle {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
        bottom: 1rem;
        right: 1rem;
    }
    
    .lightbox-prev,
    .lightbox-next {
        font-size: 2rem;
    }
}