/* ============================================
   LA SOCIÉTÉ - CSS PROPRE
   ============================================ */

/* Font Founders Grotesk */
@font-face {
    font-family: 'FoundersGroteskTextWeb-Regular';
    src: url('/webfonts/FoundersGroteskTextWeb-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Font IBM Plex Serif */
@font-face {
    font-family: 'IBM Plex Serif';
    src: url('/webfonts/IBMPlexSerif-Text.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ============================================
   VARIABLES
   ============================================ */

:root {
    --nav-leading: 23px;
    --nav-padding: calc(3 * var(--nav-leading));
    --nav-height: calc(1.7 * var(--nav-padding));
    --content-top: calc(var(--nav-height) + var(--nav-leading));
    --bg: #f9f6f3;
    --text: #000;
    --text-hover: #333;
}

html.dark-mode {
    --bg: #1a1a1a;
    --text: #f9f6f3;
    --text-hover: #ccc;
}

/* ============================================
   TYPOGRAPHIE GÉNÉRALE (pour markdown)
   ============================================ */

body {
    background: var(--bg);
    color: var(--text);
    font: 13px/23px 'IBM Plex Serif', serif;
    text-align: left;
    margin: 0;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.3s, color 0.3s;
}

h1 {
    font: 20px/23px FoundersGroteskTextWeb-Regular, Courier, monospace;
    margin-top: 0;
    margin-bottom: 23px;
    padding: 0;
}

h2 {
    font: 17px/23px FoundersGroteskTextWeb-Regular, Courier, monospace;
    margin: 0;
    padding: 0;
}

h3 {
    font: 15px/20px FoundersGroteskTextWeb-Regular, Courier, monospace;
    margin: 0;
    padding: 0;
}

p {
    font: 15px/24px 'IBM Plex Serif', serif;
    margin: 0;
}

a {
    color: var(--text);
    text-decoration: none;
}

a:hover {
    color: var(--text-hover);
}

a:focus-visible {
    outline: 1px solid var(--text);
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

/* ============================================
   NAVIGATION
   ============================================ */

.site-nav {
    padding: var(--nav-padding);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg);
    z-index: 100;
    font-family: FoundersGroteskTextWeb-Regular, Courier, monospace;
    font-size: 20px;
    line-height: var(--nav-leading);
}

.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.site-nav li {
    margin-right: 20px;
}

.site-nav a {
    font-family: FoundersGroteskTextWeb-Regular, Courier, monospace;
    font-size: 20px;
    line-height: var(--nav-leading);
}

.first-item, .second-item, .third-item, .fourth-item {
    position: absolute;
    top: 15px;
}

.first-item { left: 20px; }
.second-item { left: calc(45% + 20px); }
.third-item { left: calc(70% + 20px); }
.fourth-item { right: 20px; }

/* ============================================
   CONTENU DES PAGES
   ============================================ */

.page-content {
    position: absolute;
    top: var(--content-top);
    left: calc(45% + 20px);
    width: calc(45vw - 40px);
    max-width: 550px;
    padding-bottom: 120px;
}

.page-content a.special {
    color: orangered;
}

/* ============================================
   GALERIE
   ============================================ */

.gallery {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    padding-top: calc(var(--content-top) - 20px);
    padding-bottom: 120px;
    text-align: center;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

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

.projet {
    margin-bottom: 60px;
    text-align: center;
    cursor: pointer;
}

.projet img {
    width: auto;
    height: 75vh;
    max-width: 90vw;
    max-height: 80vh;
    display: block;
    margin: 0 auto;
    object-fit: contain;
    transition: opacity 0.2s ease;
}

/* Curseur personnalisé desktop */
@media (min-width: 601px) {
    .projet:hover {
        cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="1"><path d="M5 12h14M12 5l7 7-7 7"/></svg>'), auto;
    }

    html.dark-mode .projet:hover {
        cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23f9f6f3" stroke-width="1"><path d="M5 12h14M12 5l7 7-7 7"/></svg>'), auto;
    }
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
    font: 20px/23px FoundersGroteskTextWeb-Regular, Courier, monospace;
}

.site-footer a {
    font: 20px/23px FoundersGroteskTextWeb-Regular, Courier, monospace;
}

.footer {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 10;
}

.footer2 {
    position: fixed;
    bottom: 20px;
    left: calc(45% + 20px);
    z-index: 10;
    display: none;
}

/* ============================================
   TOGGLE JOUR/NUIT
   ============================================ */

.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10;
    cursor: pointer;
    width: 20px;
    height: 20px;
    border: none;
    background: none;
    padding: 0;
    outline: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    color: var(--text);
}

.theme-toggle svg {
    display: block;
    width: 20px;
    height: 20px;
}

/* ============================================
   TOGGLE PANORAMIQUE
   ============================================ */

.pano-toggle {
    position: fixed;
    bottom: 13px;
    right: 50px;
    z-index: 10;
    cursor: pointer;
    width: 41px;
    height: 34px;
    border: none;
    background: none;
    padding: 10px;
    box-sizing: border-box;
    outline: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    color: var(--text);
}

.pano-toggle svg {
    display: block;
    width: 21px;
    height: 14px;
}

/* ============================================
   MODE PANORAMIQUE
   ============================================ */

html.panoramic-mode .site-nav {
    background: transparent;
}

html.panoramic-mode .footer,
html.panoramic-mode .pano-toggle,
html.panoramic-mode .theme-toggle {
    z-index: 200;
}

html.panoramic-mode .gallery {
    max-width: none;
    padding: 0;
    scroll-snap-type: y mandatory;
}

html.panoramic-mode .projet {
    height: 100vh;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: start;
}

html.panoramic-mode .projet img {
    height: 95vh;
    max-width: 96vw;
    max-height: 95vh;
}

/* ============================================
   MOBILE
   ============================================ */

@media screen and (max-width: 600px) {
    :root {
        --nav-leading: 20px;
        --nav-padding: calc(4 * var(--nav-leading));
    }

    /* Typographie mobile */
    body {
        font: 13px/17px 'IBM Plex Serif', serif;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    h1 {
        font: 19px/21px FoundersGroteskTextWeb-Regular, Courier, monospace;
    }

    h2 {
        font: 15px/17px FoundersGroteskTextWeb-Regular, Courier, monospace;
    }

    h3 {
        font: 13px/15px FoundersGroteskTextWeb-Regular, Courier, monospace;
    }

    p {
        font: 13px/17px 'IBM Plex Serif', serif;
    }

    /* Navigation mobile */
    .site-nav {
        position: static;
        padding: var(--nav-padding);
        font-family: FoundersGroteskTextWeb-Regular, Courier, monospace;
        font-size: 19px;
        line-height: var(--nav-leading);
        flex-shrink: 0;
    }

    .site-nav a {
        font-family: FoundersGroteskTextWeb-Regular, Courier, monospace;
        font-size: 19px;
        line-height: var(--nav-leading);
    }

    .second-item, .third-item, .fourth-item {
        top: auto;
        left: 20px;
    }

    .second-item { top: calc(4 * var(--nav-leading)); }
    .third-item { top: calc(5 * var(--nav-leading)); }
    .fourth-item { top: calc(6 * var(--nav-leading)); }

    /* Contenu pages mobile */
    .page-content {
        position: static;
        top: auto;
        margin-top: 0;
        width: 100%;
        max-width: none;
        padding: 0;
        flex: 1;
    }

    /* Galerie mobile */
    .gallery {
        margin-top: 0;
        padding: 0;
        padding-top: 0;
        flex: 1;
    }

    .projet {
        margin-bottom: 40px;
    }

    .projet img {
        width: auto;
        height: auto;
        max-width: 100%;
        margin: 0 auto;
    }

    /* Footer mobile */
    .site-footer {
        font: 19px/21px FoundersGroteskTextWeb-Regular, Courier, monospace;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-shrink: 0;
    }

    .site-footer a {
        font: 19px/21px FoundersGroteskTextWeb-Regular, Courier, monospace;
    }

    .footer {
        position: static;
        padding: 0;
        margin-top: 0;
    }

    .footer2 {
        position: static;
        padding: 0;
        margin-top: 0;
        display: none;
    }

    .pano-toggle {
        display: none;
    }

    .theme-toggle {
        position: static;
    }
}