/* ─────────────────────────────────────────────────
   PAGE PROJET — styles communs
───────────────────────────────────────────────── */
.proj-back {
    display: inline-block;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600; font-size: 0.72rem;
    letter-spacing: 0.15em; text-transform: uppercase;
    color: var(--text); text-decoration: none;
    border: 1px solid var(--text); padding: 7px 18px;
    margin-bottom: 36px;
    transition: background 0.3s, color 0.3s;
}
.proj-back:hover { background: var(--text); color: var(--bg-base); }

/* Hero : grande image ou vidéo en 21:9 */
.proj-hero {
    width: 100%; aspect-ratio: 21/9;
    object-fit: cover; display: block;
    border: 1px solid var(--border);
    filter: brightness(0.85);
    margin-bottom: 32px;
}
.proj-hero-video {
    width: 100%; aspect-ratio: 21/9;
    border: 1px solid var(--border);
    display: block; margin-bottom: 32px;
    background: #000;
}
.proj-hero-video iframe {
    width: 100%; height: 100%; border: none; display: block;
}

/* Genre / Keywords */
.proj-genre {
    font-size: 0.62rem; font-weight: 700;
    letter-spacing: 0.22em; text-transform: uppercase;
    color: var(--accent); margin-bottom: 6px;
}

/* Title */
.proj-title {
    font-size: 2.2rem; font-weight: 800;
    letter-spacing: 0.03em; text-transform: uppercase;
    line-height: 1.05; margin-bottom: 10px;
    color: var(--text);
}

/* Roles */
.proj-roles {
    font-size: 0.7rem; letter-spacing: 0.14em;
    color: var(--muted); text-transform: uppercase;
    margin-bottom: 36px;
}

/* 2-col pitch + info */
.proj-overview {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 4px; margin-bottom: 48px;
}
.proj-pitch {
    background: var(--surface); border: 1px solid var(--border);
    padding: 28px; font-size: 0.84rem; line-height: 1.8; color: var(--muted);
}
.proj-pitch p + p { margin-top: 14px; }
.proj-info-block {
    background: var(--surface2); border: 1px solid var(--border);
    padding: 28px;
}
.proj-info-block h3 {
    font-size: 0.62rem; font-weight: 700; letter-spacing: 0.2em;
    text-transform: uppercase; color: var(--accent); margin-top: 14px;
}
.proj-info-block dl { display: grid; grid-template-columns: auto 1fr; gap: 0; }
.proj-info-block dt {
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--muted);
    padding: 7px 16px 7px 0; border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.proj-info-block dd {
    font-size: 0.78rem; color: var(--text);
    padding: 7px 0; border-bottom: 1px solid var(--border);
}

/* Grande image (map / plein largeur) */
.proj-big-img {
    width: 100%; aspect-ratio: 16/7;
    object-fit: cover; display: block;
    border: 1px solid var(--border);
    filter: brightness(0.85);
    margin-bottom: 48px;
}
.proj-img-placeholder {
    width: 100%; background: var(--surface2);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--muted); font-size: 0.7rem;
    letter-spacing: 0.12em; text-transform: uppercase;
    margin-bottom: 48px;
}
.proj-img-placeholder.ratio-wide    { aspect-ratio: 16/7; }
.proj-img-placeholder.ratio-hero    { aspect-ratio: 21/9; }
.proj-img-placeholder.ratio-video   { aspect-ratio: 21/9; }
.proj-img-placeholder.ratio-square  { aspect-ratio: 1/1;  }
.proj-img-placeholder.ratio-std     { aspect-ratio: 16/9; }

/* Section contenu (sensation of speed, etc.) */
.proj-section { margin-bottom: 56px; }
.proj-section-title {
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.2em;
    text-transform: uppercase; color: #fff;
    background: var(--accent); padding: 7px 18px;
    display: inline-block; margin-bottom: 20px;
}
.proj-section-sub {
    font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--text);
    margin: 20px 0 8px;
}
.proj-text {
    font-size: 0.84rem; line-height: 1.8; color: var(--muted);
    background: var(--surface); border: 1px solid var(--border);
    padding: 20px 24px; margin-bottom: 20px;
}
.proj-text p + p { margin-top: 12px; }

/* Grilles d'images */
.proj-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 20px; }
.proj-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; margin-bottom: 20px; }
.proj-grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 4px; margin-bottom: 20px; }
.proj-grid-2 img, .proj-grid-3 img, .proj-grid-4 img {
    width: 100%; aspect-ratio: 16/9; object-fit: cover;
    display: block; border: 1px solid var(--border);
    filter: brightness(0.85); transition: filter 0.3s;
}
.proj-grid-2 img:hover, .proj-grid-3 img:hover, .proj-grid-4 img:hover { filter: brightness(1); }

/* Placeholder dans les grilles */
.proj-grid-2 .proj-img-placeholder,
.proj-grid-3 .proj-img-placeholder,
.proj-grid-4 .proj-img-placeholder { margin-bottom: 0; }

/* Vidéo large (gameplay) */
.proj-video-wide {
    width: 100%; aspect-ratio: 16/9; margin-bottom: 12px;
    border: 1px solid var(--border); background: #000;
}
.proj-video-wide iframe { width: 100%; height: 100%; border: none; display: block; }
.proj-video-caption {
    font-size: 0.72rem; color: var(--muted);
    letter-spacing: 0.08em; text-align: center; margin-bottom: 36px;
}

/* Numérotés challenges */
.proj-challenge-num {
    font-size: 0.62rem; font-weight: 800; letter-spacing: 0.2em;
    text-transform: uppercase; color: var(--accent);
    margin-bottom: 4px; margin-top: 24px;
}

/* Synopsis / retrospective block */
.proj-block {
    background: var(--surface); border: 1px solid var(--border);
    padding: 28px; margin-bottom: 48px;
    font-size: 0.84rem; line-height: 1.8; color: var(--muted);
}

@media (max-width: 700px) {
    .proj-overview    { grid-template-columns: 1fr; }
    .proj-grid-2, .proj-grid-3, .proj-grid-4 { grid-template-columns: 1fr 1fr; }
    .proj-title       { font-size: 1.5rem; }
    .proj-hero, .proj-hero-video { aspect-ratio: 16/9; }
    .proj-big-img, .proj-img-placeholder.ratio-wide { aspect-ratio: 16/9; }
}
@media (max-width: 480px) {
    .proj-grid-3, .proj-grid-4 { grid-template-columns: 1fr 1fr; }
}

    
/* ── Composants communs supplémentaires ────────────────────────────────────── */

/* Grande vidéo (même ratio que .proj-img-placeholder.ratio-wide = 16/7) */
.proj-video-map {
    width: 100%; aspect-ratio: 16/7;
    border: 1px solid var(--border); background: #000;
    margin-bottom: 48px;
}
.proj-video-map iframe { width: 100%; height: 100%; border: none; display: block; }

/* Grille 2×2 (4 images en carré) */
.proj-grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 4px;
    margin-bottom: 20px;
}
.proj-grid-2x2 .proj-img-placeholder { margin-bottom: 0; }
.proj-grid-2x2 img.proj-page-img { aspect-ratio: 16/9; }

/* Grosse zone de texte structurée avec sous-titres internes */
.proj-textblock {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 28px 32px;
    margin-bottom: 20px;
}
.proj-textblock-sub {
    font-size: 0.65rem; font-weight: 800;
    letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--accent);
    margin-top: 24px; margin-bottom: 8px;
}
.proj-textblock-sub:first-child { margin-top: 0; }
.proj-textblock p {
    font-size: 0.84rem; line-height: 1.8;
    color: var(--muted); margin-bottom: 0;
}
.proj-textblock p + p { margin-top: 10px; }

/* Rétrospective (bloc partagé, fond légèrement distinct) */
.proj-retro {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    padding: 28px 32px;
    margin-bottom: 48px;
    font-size: 0.84rem; line-height: 1.8; color: var(--muted);
}
.proj-retro p + p { margin-top: 12px; }

@media (max-width: 700px) {
    .proj-grid-2x2 { grid-template-columns: 1fr 1fr; }
    .proj-video-map { aspect-ratio: 16/9; }
}

/* ─── Real images (replace placeholders) ──────────────────────────────────── */
img.proj-page-img {
    width: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    border: 1px solid var(--border);
    filter: brightness(0.9);
    transition: filter 0.3s;
    cursor: zoom-in;
}
img.proj-page-img:hover { filter: brightness(1); }

/* All big/hero images and videos → 16/9 (no cropping distortion) */
img.proj-page-img.ratio-hero { aspect-ratio: 16/9; }
img.proj-page-img.ratio-wide { aspect-ratio: 16/9; }
img.proj-page-img.ratio-std  { aspect-ratio: 16/9; }

/* Hero video wrapper */
.proj-hero-video {
    width: 100%; aspect-ratio: 16/9;
    border: 1px solid var(--border);
    display: block; margin-bottom: 32px;
    background: #000;
}
.proj-hero-video iframe { width: 100%; height: 100%; border: none; display: block; }

/* Large map / gameplay video → 16/9 */
.proj-video-map {
    width: 100%; aspect-ratio: 16/9;
    border: 1px solid var(--border); background: #000;
    margin-bottom: 8px;               /* reduced gap to caption */
}
.proj-video-map iframe { width: 100%; height: 100%; border: none; display: block; }

/* Caption sits close under video */
.proj-video-caption { margin-top: 4px; margin-bottom: 36px; }

/* ─── Title block + store buttons ─────────────────────────────────────────── */
/* 2-column CSS grid: left = text (genre/title/roles), right = store buttons.
   The right cell auto-matches the height of the left cell via grid row stretch.
   Buttons sit in a horizontal ROW, new ones added to the LEFT of existing ones
   (flex-direction: row-reverse), all square at the full height of the text block. */
.proj-title-area {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    align-items: center; /* vertically center the store group with the text block */
    margin-bottom: 36px;
}

/* Left column: genre / title / roles untouched */
.proj-title-text {}
.proj-title-text .proj-genre { margin-bottom: 6px; }
.proj-title-text .proj-title { margin-bottom: 10px; }

/* Right column: wraps the buttons in a row */
.proj-store-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
}

/* Each button: fixed square ~72px — roughly the height of genre+title+roles */
.proj-store-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border: 1px solid var(--border);
    text-decoration: none;
    background: var(--surface);
    transition: border-color 0.25s, background 0.25s, transform 0.2s;
    overflow: hidden;
    flex-shrink: 0;
}
.proj-store-btn:hover {
    border-color: var(--accent);
    background: var(--accent-dim);
    transform: scale(1.03);
}
.proj-store-btn img {
    width: 55%;
    height: 55%;
    object-fit: contain;
    transition: filter 0.35s;
}
[data-theme="dark"]  .proj-store-btn img { filter: invert(1) brightness(2); }
[data-theme="light"] .proj-store-btn img { filter: invert(0) brightness(0.1); }

/* ─── Genre inside title-area (flex variant) ───────────────────────────────── */
/* When .proj-genre is placed inside .proj-title-text, no extra margin needed */
.proj-title-text .proj-genre { margin-bottom: 4px; }

/* ─── Store group fix for row layout ────────────────────────────────────────── */
@media (max-width: 700px) {
    .proj-store-group { flex-direction: row; align-self: auto; }
    .proj-store-btn { flex: none; width: 56px; min-height: 56px; }
    .proj-store-btn img { width: 34px; height: 34px; }
}

/* Suppress any stray ::after on proj-back (can appear as small cross) */
.proj-back::after { display: none !important; }

/* Remove bottom gap before footer in project pages */
.section-inner > .proj-section:last-of-type { margin-bottom: 0; }
.section-wrap > .section-inner { padding-bottom: calc(var(--section-gap) * 0.5); }

/* ─── Image Lightbox ─────────────────────────────────────────────────────────── */
.img-lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.img-lightbox-overlay.active { display: flex; }
.img-lightbox-inner {
    position: relative;
    max-width: 92vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.img-lightbox-inner img {
    max-width: 92vw;
    max-height: 88vh;
    object-fit: contain;
    display: block;
    border: 1px solid var(--border);
}
.img-lightbox-close {
    position: absolute;
    top: -36px;
    right: 0;
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.1rem;
    width: 32px; height: 32px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: border-color 0.2s, background 0.2s;
}
.img-lightbox-close:hover { border-color: var(--accent); background: var(--accent-dim); }

/* ─── Footer project pages: same height as header ───────────────────────────── */
footer .footer-inner {
    padding: 18px 48px;
}

/* ─── Share-ok feedback on project pages ─────────────────────────────────────── */
/* Reuse share-ok from index.css if loaded; define fallback here */
.share-btn { position: relative; }
.share-ok {
    position: absolute;
    bottom: -26px; left: 50%;
    transform: translateX(-50%);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.58rem; font-weight: 700;
    letter-spacing: 0.1em; white-space: nowrap;
    color: var(--accent);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 2px 7px;
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
    z-index: 200;
}
.share-ok.visible { opacity: 1; }

/* ─── Confetti button (project pages) ───────────────────────────────────────── */
.confetti-btn {
    background: none;
    border: 1px solid var(--border);
    width: 42px; height: 42px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    padding: 0; font-size: 1.1rem;
    transition: border-color 0.3s, background 0.3s, transform 0.15s;
    flex-shrink: 0;
}
.confetti-btn:hover { border-color: var(--accent); background: var(--accent-dim); }
.confetti-btn:active { transform: scale(0.92); }

/* ─── Share button (project pages) ──────────────────────────────────────────── */
.share-btn {
    display: flex; align-items: center; justify-content: center;
    background: none;
    border: 1px solid var(--border);
    width: 42px; height: 42px;
    cursor: pointer; padding: 0;
    transition: border-color 0.3s, background 0.3s;
    position: relative; flex-shrink: 0;
}
.share-btn img { width: 18px; height: 18px; object-fit: contain; transition: filter 0.35s; }
[data-theme="dark"]  .share-btn img { filter: invert(1) brightness(2); }
[data-theme="light"] .share-btn img { filter: invert(0) brightness(0.1); }
.share-btn:hover { border-color: var(--accent); background: var(--accent-dim); }

/* ─── Confetti canvas ────────────────────────────────────────────────────────── */
#confetti-canvas {
    position: fixed; inset: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 99999;
}
