/* ==========================================================================
   EMILE VISUALS — Pages intérieures : Galerie, Vidéos, Blog
   (complément de style.css)
   ========================================================================== */

/* --- En-tête de page ------------------------------------------------------- */
.page-hero {
    padding: calc(var(--header-h) + clamp(3rem, 7vw, 5.5rem)) 0 clamp(2.5rem, 5vw, 4rem);
}

.page-hero .section-title { margin-top: 1rem; }

.page-hero-lede {
    max-width: 38rem;
    color: var(--muted);
    font-style: italic;
    margin-top: 1.2rem;
}

.main-nav a.active {
    border-color: var(--ink);
    background: var(--paper-2);
}

/* --- Filtres galerie -------------------------------------------------------- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.filter-bar.filter-bar-last { margin-bottom: clamp(2rem, 4vw, 3rem); }

.filter-label {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--faint);
    margin-right: 0.4rem;
    min-width: 3.4rem;
}

.filter-btn {
    font-family: var(--font-display);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink);
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: 99px;
    padding: 0.42rem 1.1rem;
    cursor: pointer;
    box-shadow: 3px 3px 0 var(--ink);
    transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), background 0.2s ease, color 0.2s ease;
}

.filter-btn:hover { transform: translate(-1px, -2px); box-shadow: 5px 5px 0 var(--ink); }

.filter-btn.active {
    background: var(--ink);
    color: var(--paper);
    box-shadow: 3px 3px 0 var(--accent);
}

.filter-count {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--faint);
    margin-left: auto;
}

/* --- Grille galerie (maçonnerie) ---------------------------------------------- */
.gallery {
    columns: 3;
    column-gap: clamp(1.2rem, 2.5vw, 2rem);
}

.gallery-item {
    display: block;
    width: 100%;
    text-align: left;
    break-inside: avoid;
    margin-bottom: clamp(1.2rem, 2.5vw, 2rem);
    background: #fdf8ee;
    border: 2px solid var(--ink);
    border-radius: 4px;
    padding: 8px 8px 0;
    box-shadow: 4px 4px 0 var(--ink);
    cursor: zoom-in;
    font: inherit;
    color: inherit;
    transition: rotate 0.35s var(--ease-out), translate 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
    animation: gallery-in 0.6s var(--ease-out) backwards;
}

.gallery-item:nth-child(odd) { rotate: -0.7deg; }
.gallery-item:nth-child(even) { rotate: 0.6deg; }

.gallery-item:hover {
    rotate: 0deg;
    translate: 0 -6px;
    box-shadow: 8px 8px 0 var(--accent);
}

@keyframes gallery-in {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

.gallery-item img {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--paper-2);
    min-height: 120px;
}

.gallery-caption {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.7rem 0.3rem 0.8rem;
}

.gallery-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.gallery-cat {
    font-family: var(--font-mono);
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--paper);
    background: var(--ink);
    padding: 0.22rem 0.55rem;
    border-radius: 99px;
    white-space: nowrap;
}

.gallery-cat.is-affiche { background: var(--accent); }

.gallery-empty {
    font-style: italic;
    color: var(--muted);
    padding: 3rem 0;
    text-align: center;
}

/* --- Lightbox --------------------------------------------------------------------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(0.8rem, 3vw, 2.5rem);
    background: rgba(33, 29, 22, 0.93);
}

.lightbox.open { display: flex; }

.lightbox-inner {
    position: relative;
    max-width: min(1080px, 100%);
    max-height: 100%;
    display: flex;
    flex-direction: column;
    background: #fdf8ee;
    border: 2px solid var(--ink);
    border-radius: 4px;
    padding: 10px;
    box-shadow: 10px 10px 0 var(--accent);
}

.lightbox-img-wrap {
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-inner img {
    max-width: 100%;
    max-height: calc(100vh - 210px);
    object-fit: contain;
    border: 1px solid var(--line);
}

.lightbox-caption {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem 1rem;
    padding: 0.8rem 0.4rem 0.4rem;
}

.lightbox-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
}

.lightbox-counter {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--faint);
    margin-left: auto;
}

.lightbox-desc {
    font-size: 0.92rem;
    font-style: italic;
    color: var(--muted);
    flex: 1 1 100%;
}

.lightbox-btn {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: 50%;
    color: var(--ink);
    cursor: pointer;
    box-shadow: 3px 3px 0 var(--ink);
    transition: transform 0.2s var(--ease-out), background 0.2s ease, color 0.2s ease;
    z-index: 2;
}

.lightbox-btn:hover { background: var(--accent); color: var(--paper); transform: scale(1.06); }

.lightbox-btn svg { width: 22px; height: 22px; }

.lightbox-close { top: -18px; right: -14px; }
.lightbox-prev { left: -16px; top: 50%; translate: 0 -50%; }
.lightbox-next { right: -16px; top: 50%; translate: 0 -50%; }

@media (max-width: 700px) {
    .lightbox-close { top: -14px; right: -8px; }
    .lightbox-prev { left: -8px; }
    .lightbox-next { right: -8px; }
}

/* --- Vidéos --------------------------------------------------------------------------- */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(1.4rem, 3vw, 2.4rem);
    align-items: start;
}

.video-card {
    background: #fdf8ee;
    border: 2px solid var(--ink);
    border-radius: 4px;
    padding: 8px;
    box-shadow: var(--shadow-hard);
}

.video-frame {
    position: relative;
    border: 1px solid var(--line);
    background: var(--ink);
    overflow: hidden;
}

.video-frame.is-youtube { aspect-ratio: 16 / 9; }
.video-frame.is-tiktok { aspect-ratio: 9 / 15; }

.video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-caption { padding: 0.8rem 0.3rem 0.6rem; }

.video-caption .gallery-title { display: block; margin-bottom: 0.35rem; }

.video-caption p {
    font-size: 0.9rem;
    font-style: italic;
    color: var(--muted);
    line-height: 1.5;
}

.video-platform {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--paper);
    background: var(--ink);
    padding: 0.22rem 0.55rem;
    border-radius: 99px;
    margin-bottom: 0.5rem;
}

.video-platform.is-tiktok { background: var(--accent); }

.videos-note {
    margin-top: clamp(2rem, 4vw, 3rem);
    border: 2px dashed var(--ink);
    border-radius: 8px;
    padding: 1.2rem 1.5rem;
    font-style: italic;
    color: var(--muted);
    background: rgba(247, 179, 43, 0.14);
}

/* --- Blog ------------------------------------------------------------------------------- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(1.4rem, 3vw, 2.4rem);
}

.post-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    background: #fdf8ee;
    border: 2px solid var(--ink);
    border-radius: 4px;
    padding: 8px;
    box-shadow: var(--shadow-hard);
    transition: rotate 0.35s var(--ease-out), translate 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}

.post-card:hover {
    translate: 0 -6px;
    rotate: -0.5deg;
    box-shadow: 9px 9px 0 var(--accent);
}

.post-card figure {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border: 1px solid var(--line);
}

.post-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out);
}

.post-card:hover img { transform: scale(1.05); }

.post-body { padding: 1rem 0.5rem 0.8rem; display: flex; flex-direction: column; flex: 1; }

.post-meta {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 0.6rem;
}

.post-meta .post-tag { color: var(--accent); }

.post-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.25;
    margin-bottom: 0.5rem;
    transition: color 0.25s ease;
}

.post-card:hover .post-title { color: var(--accent); }

.post-excerpt {
    font-size: 0.93rem;
    color: var(--muted);
    line-height: 1.55;
    margin-bottom: 0.9rem;
}

.post-more {
    margin-top: auto;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink);
}

.post-more::after { content: ' →'; color: var(--accent); }

/* --- Article de blog ------------------------------------------------------------------------ */
.article {
    max-width: 720px;
    margin-inline: auto;
}

.article-cover {
    border: 2px solid var(--ink);
    border-radius: 4px;
    padding: 8px;
    background: #fdf8ee;
    box-shadow: var(--shadow-hard);
    rotate: -0.6deg;
    margin: clamp(1.5rem, 3vw, 2.5rem) 0;
}

.article-cover img {
    width: 100%;
    max-height: 440px;
    object-fit: cover;
    border: 1px solid var(--line);
}

.article h1 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-top: 0.8rem;
    text-wrap: balance;
}

.article h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    letter-spacing: -0.02em;
    margin: 2.2rem 0 0.8rem;
}

.article p { margin-bottom: 1.1rem; }
.article p em { color: var(--accent); }
.article ul, .article ol { margin: 0 0 1.1rem 1.4rem; }
.article li { margin-bottom: 0.4rem; }

.article blockquote {
    border-left: 4px solid var(--accent);
    background: rgba(247, 179, 43, 0.14);
    font-style: italic;
    padding: 0.9rem 1.2rem;
    margin: 1.4rem 0;
}

.article-footer {
    margin-top: 2.5rem;
    padding-top: 1.4rem;
    border-top: 2px solid var(--ink);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
}

/* --- Responsive pages ------------------------------------------------------------------------- */
@media (max-width: 960px) {
    .gallery { columns: 2; }
    .videos-grid, .blog-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .gallery { columns: 1; }
    .videos-grid, .blog-grid { grid-template-columns: 1fr; }
    .filter-count { flex-basis: 100%; margin-left: 0; }
}
