/*
Theme Name: PhotoFlo
Theme URI: https://photoflo.ch
Author: Florian Bloesch
Author URI: https://photoflo.ch
Description: Thème WordPress portfolio sur mesure pour Florian Bloesch (PhotoFlo) avec effet Ken Burns continu sur l'arrière-plan principal, animation fluide des tuiles par catégorie, visionneuse plein écran et personnalisation complète.
Version: 2.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: photoflo
*/

:root {
    --bg-dark: #0a0a0c;
    --surface-dark: #141417;
    --text-light: #f5f5f5;
    --text-muted: #9e9e9e;
    --accent: #d4af37;
    --border-color: rgba(255, 255, 255, 0.08);
    --kb-duration: 16s;
    --hero-bg-opacity: 0.48;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ==========================================================================
   NAVIGATION & LOGO
   ========================================================================== */
header.site-header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: rgba(10, 10, 12, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    transition: padding 0.3s ease, background 0.3s ease;
}

body.admin-bar header.site-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar header.site-header {
        top: 46px;
    }
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img,
.logo-link .custom-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

nav.main-nav ul {
    list-style: none;
    display: flex;
    gap: 35px;
    align-items: center;
}

nav.main-nav a {
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
}

nav.main-nav a:not(.btn-contact)::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0%;
    height: 1px;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

nav.main-nav a:not(.btn-contact):hover::after {
    width: 100%;
}

.btn-contact {
    border: 1px solid var(--border-color);
    padding: 10px 24px;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.btn-contact:hover {
    background: var(--text-light);
    color: var(--bg-dark);
    border-color: var(--text-light);
}

/* ==========================================================================
   ANIMATIONS KEN BURNS CINÉMATIQUES
   ========================================================================== */
@keyframes kenBurns1 {
    0%   { transform: scale(1.0) translate3d(0%, 0%, 0); }
    100% { transform: scale(1.13) translate3d(-1.8%, -1.2%, 0); }
}

@keyframes kenBurns2 {
    0%   { transform: scale(1.12) translate3d(1.5%, -1%, 0); }
    100% { transform: scale(1.0) translate3d(-1%, 1.2%, 0); }
}

@keyframes kenBurns3 {
    0%   { transform: scale(1.0) translate3d(-1.2%, 1%, 0); }
    100% { transform: scale(1.13) translate3d(1.6%, -1.2%, 0); }
}

@keyframes kenBurns4 {
    0%   { transform: scale(1.12) translate3d(-1.5%, -1%, 0); }
    100% { transform: scale(1.0) translate3d(1.4%, 1.4%, 0); }
}

/* ==========================================================================
   HERO ARRIÈRE-PLAN (MOSAÏQUE KEN BURNS OU DIAPORAMA KEN BURNS)
   ========================================================================== */
.hero {
    height: 100vh;
    min-height: 680px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Mode 1 : Mosaïque 4 tuiles avec effet Ken Burns continu */
.hero-mosaic {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    grid-template-rows: 1fr 1.5fr;
    gap: 5px;
    opacity: var(--hero-bg-opacity);
    z-index: 0;
    padding: 5px;
}

.mosaic-slot {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background-color: var(--surface-dark);
}

.mosaic-bg {
    position: absolute;
    inset: -2%;
    background-size: cover;
    background-position: center;
    will-change: transform;
}

.m1 { grid-column: 1; grid-row: 1 / span 2; }
.m2 { grid-column: 2; grid-row: 1; }
.m3 { grid-column: 2; grid-row: 2; }
.m4 { grid-column: 3; grid-row: 1 / span 2; }

.m1 .mosaic-bg { animation: kenBurns1 var(--kb-duration) ease-in-out infinite alternate; }
.m2 .mosaic-bg { animation: kenBurns2 calc(var(--kb-duration) * 1.1) ease-in-out infinite alternate; }
.m3 .mosaic-bg { animation: kenBurns3 calc(var(--kb-duration) * 1.15) ease-in-out infinite alternate; }
.m4 .mosaic-bg { animation: kenBurns4 calc(var(--kb-duration) * 1.05) ease-in-out infinite alternate; }

/* Mode 2 : Diaporama plein écran Ken Burns */
.hero-slideshow {
    position: absolute;
    inset: 0;
    opacity: var(--hero-bg-opacity);
    z-index: 0;
    overflow: hidden;
}

.kb-slide {
    position: absolute;
    inset: -3%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 2.2s ease-in-out;
    will-change: transform, opacity;
}

.kb-slide.is-active {
    opacity: 1;
    z-index: 1;
}

.kb-slide.kb-dir-0 { animation: kenBurns1 var(--kb-duration) ease-in-out infinite alternate; }
.kb-slide.kb-dir-1 { animation: kenBurns2 var(--kb-duration) ease-in-out infinite alternate; }
.kb-slide.kb-dir-2 { animation: kenBurns3 var(--kb-duration) ease-in-out infinite alternate; }
.kb-slide.kb-dir-3 { animation: kenBurns4 var(--kb-duration) ease-in-out infinite alternate; }

/* Indicateurs discrets en mode Diaporama */
.kb-dots {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 3;
}

.kb-dot {
    width: 24px;
    height: 2px;
    background: rgba(255, 255, 255, 0.25);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.3s ease, width 0.3s ease;
}

.kb-dot.active {
    background: var(--accent);
    width: 38px;
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(10,10,12,0.18) 0%, rgba(10,10,12,0.75) 72%, rgba(10,10,12,1) 100%);
    z-index: 1;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateY(16px);
}

.hero-logo-box {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hero-logo-img {
    width: min(440px, 78vw);
    height: auto;
    max-height: 180px;
    object-fit: contain;
    filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.65));
    transition: transform 0.5s ease;
}

.hero-logo-img:hover {
    transform: scale(1.02);
}

.hero-logo-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.hero-logo-mark {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    padding: 16px 32px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 6px;
    background: rgba(10, 10, 12, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}

.hero-logo-wordmark {
    font-size: clamp(2.4rem, 6.2vw, 4.8rem);
    font-weight: 200;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--text-light);
    line-height: 1;
    margin-right: -0.28em;
}

.hero-logo-wordmark strong {
    font-weight: 700;
    color: #ffffff;
}

.hero-logo-accent-line {
    width: 72px;
    height: 2px;
    background: var(--accent);
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 300;
    margin-bottom: 36px;
}

.hero-scroll-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--text-light);
    opacity: 0.78;
    padding: 10px 22px;
    border-bottom: 1px solid var(--accent);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.hero-scroll-cta:hover {
    opacity: 1;
    transform: translateY(3px);
}

/* ==========================================================================
   PORTFOLIO GALERIE & ANIMATION DES TUILES PAR CATÉGORIE
   ========================================================================== */
.portfolio-section {
    padding: 80px 20px 120px;
    max-width: 1600px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-eyebrow {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--accent);
    margin-bottom: 10px;
}

.section-header h2 {
    font-size: 2.2rem;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 48px;
}

.filter-btn {
    appearance: none;
    padding: 9px 24px;
    background: transparent;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 2px;
    border: 1px solid var(--border-color);
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.filter-btn:hover {
    border-color: var(--text-light);
    color: var(--text-light);
    transform: translateY(-1px);
}

.filter-btn.active {
    background: var(--text-light);
    color: var(--bg-dark);
    border-color: var(--text-light);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.12);
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    min-height: 360px;
}

@keyframes tileEnter {
    0% {
        opacity: 0;
        transform: scale(0.91) translateY(22px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.photo-card {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: var(--surface-dark);
    aspect-ratio: 4 / 3;
    cursor: zoom-in;
    will-change: transform, opacity;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.photo-card.card-entering {
    opacity: 0;
    animation: tileEnter 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: var(--stagger-delay, 0ms);
}

.photo-card.card-leaving {
    opacity: 0 !important;
    transform: scale(0.93) translateY(10px) !important;
    pointer-events: none;
}

.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.2, 1, 0.3, 1), filter 0.3s ease;
    filter: brightness(0.92);
}

.photo-card:hover img {
    transform: scale(1.05);
    filter: brightness(1.08);
}

.photo-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0) 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;
    color: #fff;
    pointer-events: none;
}

.photo-card:hover .photo-overlay {
    opacity: 1;
}

.photo-overlay .cat-tag {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--accent);
    margin-bottom: 8px;
}

.photo-overlay .photo-title {
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   SECTION "DERRIÈRE L'OBJECTIF"
   ========================================================================== */
.about-wrapper {
    border-top: 1px solid var(--border-color);
    background: linear-gradient(to bottom, var(--bg-dark), var(--surface-dark));
}

.about-section {
    padding: 120px 20px;
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}

.about-image-wrapper {
    position: relative;
}

.about-image {
    width: 100%;
    aspect-ratio: 4/5;
    object-fit: cover;
    border-radius: 12px;
    background-color: var(--surface-dark);
    display: block;
    position: relative;
    z-index: 1;
}

.about-image-wrapper::after {
    content: '';
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 100%;
    height: 100%;
    border: 1px solid var(--accent);
    border-radius: 12px;
    z-index: 0;
    pointer-events: none;
}

.about-author-tag {
    display: inline-block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--accent);
    margin-bottom: 12px;
}

.about-text h2 {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 30px;
    position: relative;
    padding-bottom: 20px;
}

.about-text h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 2px;
    background-color: var(--accent);
}

.about-text p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* ==========================================================================
   CONTACT & FOOTER
   ========================================================================== */
.contact-section {
    background-color: var(--surface-dark);
    padding: 100px 20px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.contact-title {
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 40px;
    letter-spacing: 1px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
    font-size: 1.2rem;
    margin-bottom: 40px;
}

.contact-info a {
    color: var(--text-light);
    font-weight: 300;
}

.contact-info a:hover {
    color: var(--accent);
}

.location {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.8;
}

footer.site-footer {
    background-color: var(--bg-dark);
    color: var(--text-muted);
    text-align: center;
    padding: 30px 20px;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   LIGHTBOX (VISIONNEUSE)
   ========================================================================== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(5, 5, 5, 0.98);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    user-select: none;
}
.lightbox.open {
    display: flex;
    opacity: 1;
}
.lightbox-stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 80px;
}
.lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 10px 50px rgba(0,0,0,0.8);
    transition: opacity 0.2s ease, transform 0.3s ease;
}
.lightbox-img.switching {
    opacity: 0;
    transform: scale(0.98);
}
.lb-btn {
    position: absolute;
    background: transparent;
    color: #fff;
    border: none;
    width: 60px;
    height: 60px;
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
    z-index: 10;
    opacity: 0.55;
}
.lb-btn:hover {
    transform: scale(1.1);
    opacity: 1;
}
.lb-close { top: 15px; right: 20px; font-size: 35px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-prev:hover { transform: translateY(-50%) scale(1.1); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }
.lb-next:hover { transform: translateY(-50%) scale(1.1); }

.lightbox-caption {
    position: absolute;
    bottom: 25px;
    left: 40px;
    right: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    pointer-events: none;
}

/* ==========================================================================
   RESPONSIVE MOBILE
   ========================================================================== */
@media (max-width: 900px) {
    .about-section {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 80px 20px;
    }
    .about-image-wrapper::after {
        bottom: -10px;
        right: -10px;
    }
}

@media (max-width: 768px) {
    header.site-header {
        padding: 15px 20px;
    }
    .logo-text {
        font-size: 16px;
    }
    nav.main-nav ul {
        gap: 15px;
    }
    nav.main-nav a {
        font-size: 11px;
        display: none;
    }
    nav.main-nav a.btn-contact {
        display: block;
        padding: 6px 16px;
    }
    .hero-logo-mark {
        padding: 12px 20px;
    }
    .hero-subtitle {
        font-size: 0.95rem;
        letter-spacing: 1.5px;
    }
    .hero-mosaic {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr;
    }
    .m1 { grid-column: 1; grid-row: 1; }
    .m2 { grid-column: 2; grid-row: 1; }
    .m3 { grid-column: 1; grid-row: 2; }
    .m4 { grid-column: 2; grid-row: 2; }

    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 12px;
    }
    .filter-btn {
        padding: 6px 16px;
        font-size: 10px;
    }
    .lightbox-stage {
        padding: 40px 10px 80px;
    }
    .lb-btn {
        width: 40px;
        height: 40px;
        font-size: 30px;
    }
    .lightbox-caption {
        bottom: 15px;
        left: 15px;
        right: 15px;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}
