/* ─── Fonts ─────────────────────────────────────────────── */
@font-face {
    font-family: 'SwissNow';
    src: url('../assets/fonts/SwissNow-Book.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}


/* ─── Reset & base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
}

body {
    font-family: 'SwissNow', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #000;
    background: #fff;
    padding: 20px;
    overflow: hidden;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Layout ─────────────────────────────────────────────── */
.portfolio-grid {
    display: grid;
    grid-template-columns: 1fr 330px;
    gap: 20px;
    align-items: start;
    height: 100%;
}

/* ─── Projects column ────────────────────────────────────── */
.projects-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px 20px;
    align-content: start;
    height: 100%;
    overflow-y: auto;
    scrollbar-width: none;
    max-width: 1500px;
}

.projects-col::-webkit-scrollbar { display: none; }

/* ─── Single project ─────────────────────────────────────── */
.project {
    grid-column: span 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.project.full-width {
    grid-column: span 2;
}

.project.alone {
    grid-column: 1 / -1;
    max-width: calc((100% - 20px) / 2);
}

/* Image viewer */
.project-viewer {
    position: relative;
    width: 100%;
    cursor: pointer;
    user-select: none;
    margin-bottom: 10px;
}

.project-viewer img,
.project-viewer video {
    display: none;
    width: 100%;
    height: auto;
    pointer-events: none;
}

.project-viewer img.active,
.project-viewer video.active {
    display: block;
}

.project-viewer.has-ratio img,
.project-viewer.has-ratio video {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
}

.project-viewer.has-ratio img.active,
.project-viewer.has-ratio video.active {
    opacity: 1;
}

.nav-zone {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    z-index: 10;
}

.nav-zone.prev { left: 0; cursor: pointer; }
.nav-zone.next { right: 0; cursor: pointer; }

/* Project info bar */
.project-bar {
    display: flex;
    align-items: start;
    justify-content: space-between;
    line-height: 16px;
    cursor: pointer;
}


.project-bar-left {
    display: flex;
    gap: 50px;
    white-space: nowrap;
}

.project-year {
    color: #000;
    flex-shrink: 0;
}

.project-title {
    color: #000;
}

.project-counter {
    width: 50px;
    text-align: right;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* Description (accordion) */
.project-details {
    overflow: hidden;
    height: 0;
    transition: height 0.25s ease-out;
}

.project-details-inner {
    margin-top: 14px;
    padding-top: 4px;
    border-top: 1px solid #000;
}

.project-description {
    padding-bottom: 16px;
    line-height: 16px;
    color: #000;
}

.project.full-width .project-description {
    max-width: none;
}

.project-meta {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 0;
    line-height: 16px;
}

.project-meta dt {
    color: #000;
    font-weight: normal;
}

.project-meta dd {
    color: #000;
}

.project-meta dd.no-label {
    grid-column: 2;
}

/* ─── Sidebar ────────────────────────────────────────────── */
.sidebar {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    padding: 0 0 20px 0;
    display: flex;
    flex-direction: column;
    font-size: 14px;
    line-height: 16px;
}

.sidebar::-webkit-scrollbar { display: none; }

.sidebar-name {
    margin-bottom: 23px;
}

.sidebar-logo {
    padding-left: 43px;
    margin-bottom: 98px;
    position: relative;
    overflow: visible;
}

.sidebar-logo img {
    width: 235px;
    height: auto;
    display: block;
}

.logo-label {
    position: absolute;
    white-space: nowrap;
    line-height: 16px;
}

.sidebar-logo .label-letter     { top: 44px;  left: 229px; }
.sidebar-logo .label-photography { top: 241px; left: 230px; }
.sidebar-logo .label-design     { top: 190px; left: 31px;  }

/* Sidebar sections */
.sidebar-section {
    padding: 4px 0 60px;
    border-top: 1px solid #000;
    display: grid;
    grid-template-columns: 80px 1fr;
    align-items: start;
}

.sidebar-label {
    color: #000;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
}

.sidebar-content a {
    display: block;
}


/* Fonts list */
.font-link {
    color: #000;
}

.font-link.dimmed {
    color: #b5b5b5;
}

/* About text */
.about-text p + p {
    margin-top: 16px;
}

/* Photography shop row */
.sidebar-shop {
    padding: 4px 10px;
    height: 24px;
    border-top: 1px solid #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: #000;
    line-height: 16px;
}

.sidebar-shop:hover {
}


/* ─── Responsive ─────────────────────────────────────────── */
/* ─── Mobile logo / close (cachés sur desktop) ───────────── */
.sidebar-logo-mobile { display: none; }
.mobile-close {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0 auto;
}
.mobile-close img { width: 67px; height: auto; display: block; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
    body { padding: 0; overflow: auto; }

    .portfolio-grid {
        display: flex;
        flex-direction: column;
        height: auto;
    }

    .projects-col {
        height: auto;
        overflow-y: visible;
    }

    /* Sidebar mobile */
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        overflow: visible;
        padding: 20px 0;
        order: -1;
        align-items: center;
    }

    .sidebar-header {
        width: 330px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    /* Nom centré, dans le flux normal, sur une ligne */
    .sidebar-name {
        text-align: center;
        white-space: nowrap;
        margin: 0 0 0 0;
    }

    /* Logo desktop caché, logo mobile visible */
    .sidebar-logo { display: none; }
    .sidebar-logo-mobile {
        display: block;
        position: relative;
        height: 190px;
        width: 100%;
    }

    .sidebar-logo-mobile img {
        position: absolute;
        bottom: 40px;
        left: 50%;
        transform: translateX(-50%);
        width: 288px;
        height: 103px;
    }

    .mobile-label {
        position: absolute;
        font-size: 14px;
        line-height: 16px;
        white-space: nowrap;
    }

    .sidebar-logo-mobile .label-photography { top: 63px; left: 211px; }
    .sidebar-logo-mobile .label-letter      { top: 119px; left: 145px; }
    .sidebar-logo-mobile .label-design      { top: 74px; left: 20px; }

    /* Sections cachées par défaut */
    .sidebar-content-area { display: none; width: 330px; }
    .sidebar.open .sidebar-content-area {
        display: block;
        margin-top: 40px;
    }

    /* Bouton fermer */
    .mobile-close { display: block; margin-top: 20px; }
    .sidebar:not(.open) .mobile-close { display: none; }

    /* Projets : colonne unique */
    .projects-col {
        padding: 20px;
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .project,
    .project.full-width,
    .project.alone {
        grid-column: span 1;
        max-width: none;
    }
}
