/* Pathways — carte des 121 couvertures intégrée à la page */

/* Page en négatif : fond noir, texte blanc (surcharge de Data/Css/page.css) */
body
{
    background-color:       black;
    color:                  white;
}

a,
h1 a
{
    color:                  white;
    border-bottom-color:    rgba(255, 255, 255, 0.35);
}

a:hover,
h1 a:hover
{
    border-bottom-color:    white;
}

/* Titres de section : même filet léger que les liens (1px, blanc à 35 %),
   avec le même écart que le lien du titre h1 (padding-bottom 4px) */
h2
{
    width:                      fit-content;
    max-width:                  100%;
    padding-bottom:             4px;
    border-bottom:              1px solid rgba(255, 255, 255, 0.35);
}

p
{
    width:                  75%;
}

/* Légende sous un carrousel : petite, alignée à droite */
p.caption
{
    width:                  100%;
    margin:                 0.5em 0 2em 0;
    font-size:              0.5em;
    text-align:             right;
    opacity:                0.4;
}

/* Le carrousel a une marge basse de 2.5em (en em du <body>) : la légende la rattrape
   pour rester collée au carrousel (reste 0.8em d'espace, en em de la légende) */
.carousel + p.caption
{
    margin-top:             -4.2em;
}

/* Menu en haut de page : liens vers les sections */
.menu-pathways
{
    display:                flex;
    flex-wrap:              wrap;
    gap:                    0.3em 1.4em;
    margin:                 0 0 1.5em 0;
    font-size:0.7em;
}

/* Notes de bas de page */
.notes p
{
    font-size:              0.7em;
}

sup
{
    font-size:              0.6em;
    line-height:            0;
}

@media screen and (max-width : 1100px)
{
    p
    {
        width:              auto;
    }
}

/* Pleine largeur / hauteur du viewport : on annule le padding du <body> (1em) */
.map-pathways
{
    position:               relative;
    width:                  calc(100% + 2em);
    height:                 100vh;
    height:                 100svh;
    margin:                 1.5em -1em 2em -1em;
    background-color:       black;
    overflow:               hidden;
    touch-action:           pan-y;
}

.map-pathways:fullscreen
{
    margin:                 0;
    width:                  100%;
    height:                 100%;
}

/* Grille 11 x 11, couvertures 4:5 ; largeur = carte, le cadrage initial est fait en JS (resetView) */
.map-pathways-grid
{
    display:                grid;
    grid-template-columns:  repeat(11, 1fr);
    width:                  100%;
    visibility:             hidden;
    cursor:                 grab;
}

.map-pathways-grid:active
{
    cursor:                 grabbing;
}

.map-pathways-cell
{
    position:               relative;
    aspect-ratio:           4 / 5;
    container-type:         inline-size;
}

.map-pathways-cell img
{
    display:                block;
    width:                  100%;
    height:                 100%;
    user-select:            none;
    -webkit-user-drag:      none;
}

/* Légende (coordonnées + collectionneur), visible seulement une fois zoomé */
.map-pathways-cell a,
.map-pathways-cell span
{
    position:               absolute;
    right:                  4%;
    bottom:                 3%;
    padding:                1px 3px;
    font-size:              4cqw;   /* proportional to the cover */
    line-height:            1.3;
    color:                  white;
    background-color:       black;
    border:                 none;
    opacity:                0;
    transition:             opacity 250ms;
    pointer-events:         none;
}

.map-pathways-grid.show-labels .map-pathways-cell a,
.map-pathways-grid.show-labels .map-pathways-cell span
{
    opacity:                1;
    pointer-events:         auto;
}

.map-pathways-cell a:hover
{
    border:                 none;
    text-decoration:        underline;
}

.map-pathways-loading,
.map-pathways-hint
{
    position:               absolute;
    left:                   50%;
    transform:              translateX(-50%);
    color:                  white;
    font-size:              max(14px, 0.9vw);
    pointer-events:         none;
}

.map-pathways-loading
{
    top:                    50%;
}

.map-pathways-hint
{
    bottom:                 1em;
    padding:                0.4em 0.8em;
    background-color:       rgba(0, 0, 0, 0.75);
    opacity:                0;
    transition:             opacity 300ms;
    white-space:            nowrap;
}

.map-pathways-hint.visible
{
    opacity:                1;
}

.map-pathways-buttons
{
    position:               absolute;
    left:                   1em;
    bottom:                 1em;
    display:                none;
    gap:                    4px;
}

.map-pathways-buttons button
{
    width:                  36px;
    height:                 36px;
    padding:                0;
    font-family:            inherit;
    font-size:              22px;
    line-height:            36px;
    text-align:             center;
    color:                  black;
    background:             #F9F7F2;
    border:                 none;
    cursor:                 pointer;
}

.map-pathways-buttons button:hover
{
    background:             white;
}


/* ----------------------------------------------------
   Carousel (pathways-carousel.js) — full-bleed band, like the map
   ---------------------------------------------------- */

/* Registered so that the mask follows the width of the current image smoothly */
@property --carousel-half
{
    syntax:                 '<length>';
    inherits:               true;
    initial-value:          0px;
}

.carousel
{
    --carousel-sigma:       12vw;   /* gaussian falloff of the side images */
    --carousel-height:      75vh;

    position:               relative;
    width:                  calc(100% + 2em);
    margin:                 1em -1em 2.5em -1em;
    transition:             --carousel-half 400ms ease;
}

.carousel-track
{
    position:               relative;
    display:                flex;
    align-items:            center;
    gap:                    2vw;
    height:                 var(--carousel-height);
    overflow-x:             auto;
    overflow-y:             hidden;
    scroll-snap-type:       x mandatory;
    scrollbar-width:        none;
    outline:                none;
    -webkit-mask-image:     linear-gradient(to right,
        rgba(0,0,0,0) calc(50% - var(--carousel-half) - 3.5 * var(--carousel-sigma)),
        rgba(0,0,0,0.0111) calc(50% - var(--carousel-half) - 3 * var(--carousel-sigma)),
        rgba(0,0,0,0.0439) calc(50% - var(--carousel-half) - 2.5 * var(--carousel-sigma)),
        rgba(0,0,0,0.1353) calc(50% - var(--carousel-half) - 2 * var(--carousel-sigma)),
        rgba(0,0,0,0.3247) calc(50% - var(--carousel-half) - 1.5 * var(--carousel-sigma)),
        rgba(0,0,0,0.6065) calc(50% - var(--carousel-half) - 1 * var(--carousel-sigma)),
        rgba(0,0,0,0.8825) calc(50% - var(--carousel-half) - 0.5 * var(--carousel-sigma)),
        rgba(0,0,0,1) calc(50% - var(--carousel-half) - 0 * var(--carousel-sigma)),
        rgba(0,0,0,1) calc(50% + var(--carousel-half) + 0 * var(--carousel-sigma)),
        rgba(0,0,0,0.8825) calc(50% + var(--carousel-half) + 0.5 * var(--carousel-sigma)),
        rgba(0,0,0,0.6065) calc(50% + var(--carousel-half) + 1 * var(--carousel-sigma)),
        rgba(0,0,0,0.3247) calc(50% + var(--carousel-half) + 1.5 * var(--carousel-sigma)),
        rgba(0,0,0,0.1353) calc(50% + var(--carousel-half) + 2 * var(--carousel-sigma)),
        rgba(0,0,0,0.0439) calc(50% + var(--carousel-half) + 2.5 * var(--carousel-sigma)),
        rgba(0,0,0,0.0111) calc(50% + var(--carousel-half) + 3 * var(--carousel-sigma)),
        rgba(0,0,0,0) calc(50% + var(--carousel-half) + 3.5 * var(--carousel-sigma)));
    mask-image:             linear-gradient(to right,
        rgba(0,0,0,0) calc(50% - var(--carousel-half) - 3.5 * var(--carousel-sigma)),
        rgba(0,0,0,0.0111) calc(50% - var(--carousel-half) - 3 * var(--carousel-sigma)),
        rgba(0,0,0,0.0439) calc(50% - var(--carousel-half) - 2.5 * var(--carousel-sigma)),
        rgba(0,0,0,0.1353) calc(50% - var(--carousel-half) - 2 * var(--carousel-sigma)),
        rgba(0,0,0,0.3247) calc(50% - var(--carousel-half) - 1.5 * var(--carousel-sigma)),
        rgba(0,0,0,0.6065) calc(50% - var(--carousel-half) - 1 * var(--carousel-sigma)),
        rgba(0,0,0,0.8825) calc(50% - var(--carousel-half) - 0.5 * var(--carousel-sigma)),
        rgba(0,0,0,1) calc(50% - var(--carousel-half) - 0 * var(--carousel-sigma)),
        rgba(0,0,0,1) calc(50% + var(--carousel-half) + 0 * var(--carousel-sigma)),
        rgba(0,0,0,0.8825) calc(50% + var(--carousel-half) + 0.5 * var(--carousel-sigma)),
        rgba(0,0,0,0.6065) calc(50% + var(--carousel-half) + 1 * var(--carousel-sigma)),
        rgba(0,0,0,0.3247) calc(50% + var(--carousel-half) + 1.5 * var(--carousel-sigma)),
        rgba(0,0,0,0.1353) calc(50% + var(--carousel-half) + 2 * var(--carousel-sigma)),
        rgba(0,0,0,0.0439) calc(50% + var(--carousel-half) + 2.5 * var(--carousel-sigma)),
        rgba(0,0,0,0.0111) calc(50% + var(--carousel-half) + 3 * var(--carousel-sigma)),
        rgba(0,0,0,0) calc(50% + var(--carousel-half) + 3.5 * var(--carousel-sigma)));
}

.carousel-track::-webkit-scrollbar
{
    display:                none;
}

.carousel-item
{
    flex:                   0 0 auto;
    height:                 100%;
    scroll-snap-align:      center;
    cursor:                 pointer;
}

.carousel-item.current
{
    cursor:                 default;
}

.carousel-item video
{
    display:                block;
    height:                 100%;
    width:                  auto;
    background-color:       black;
}

.carousel-item img
{
    display:                block;
    height:                 100%;
    width:                  auto;
    user-select:            none;
    -webkit-user-drag:      none;
}

.carousel-prev,
.carousel-next
{
    position:               absolute;
    top:                    50%;
    transform:              translateY(-50%);
    width:                  36px;
    height:                 36px;
    padding:                0;
    font-family:            inherit;
    font-size:              20px;
    line-height:            36px;
    text-align:             center;
    color:                  black;
    background:             #F9F7F2;
    border:                 none;
    cursor:                 pointer;
}

.carousel-prev { left:  1em; }
.carousel-next { right: 1em; }

.carousel-prev:hover,
.carousel-next:hover
{
    background:             white;
}

/* Mobile: one image across the full width, swipe, no shading */
@media screen and (max-width : 1100px)
{
    .carousel-track
    {
        height:             auto;
        gap:                0;
        background-color:   rgba(255, 255, 255, 0.06);
        -webkit-mask-image: none;
        mask-image:         none;
    }

    .carousel-item
    {
        flex:               0 0 100%;
        height:             auto;
        scroll-snap-stop:   always;
    }

    .carousel-item img
    {
        width:              100%;
        height:             auto;
    }

    .carousel-prev,
    .carousel-next
    {
        display:            none;
    }

    /* Video: same width as the images, never wider than the screen */
    .carousel-item video
    {
        width:              100%;
        height:             auto;
        max-width:          100%;
    }

    .carousel .carousel-dots
    {
        display:            flex;
        padding:            0 1em;
        justify-content:    center;
        gap:                2px;
        margin-top:         0.4em;
    }
}

/* Dots: mobile only (hint that the carousel can be swiped) */
.carousel-dots
{
    display:                none;
}

.carousel-dots button
{
    position:               relative;
    flex:                   0 1 34px;   /* shrinks so that all the dots fit on one line */
    min-width:              0;
    height:                 24px;
    padding:                0;
    border:                 none;
    background:             none;
    cursor:                 pointer;
}

.carousel-dots button::after
{
    content:                '';
    position:               absolute;
    left:                   50%;
    top:                    50%;
    width:                  7px;
    height:                 7px;
    margin:                 -3.5px 0 0 -3.5px;
    border-radius:          50%;
    background:             white;
    opacity:                0.3;
    transition:             opacity 250ms;
}

.carousel-dots button.active::after
{
    opacity:                1;
}

/* Image de clôture, pleine largeur */
.closing-pathways
{
    width:                  calc(100% + 2em);
    margin:                 3em -1em -1em -1em;
    background:             black;
}
.closing-pathways img
{
    display:                block;
    width:                  100%;
    height:                 auto;
}

/* Map: "full screen" explore mode (phones / tablets) — one finger pans, two fingers zoom */
.map-pathways.is-explore
{
    position:               fixed;
    top:                    0;
    left:                   0;
    width:                  100%;
    height:                 100%;
    margin:                 0;
    z-index:                1500;
    touch-action:           none;
}

/* Credits list: no left indent, square bullets */
.credits
{
    margin:                 0;
    padding:                0;
    list-style:             square inside;
}

.credits li
{
    margin:                 0 0 0.5em 0;
    padding:                0;
}

/* Mobile: h3 readable (the site default, 1.5vw, is far too small) */
@media screen and (max-width : 1100px)
{
    h3
    {
        font-size:          5vw;
        margin-bottom:      0.4em;
    }
}

/* Mobile: the hint sits above the buttons, not next to them */
@media screen and (max-width : 1100px)
{
    .map-pathways-hint
    {
        bottom:             calc(1em + 36px + 0.6em);
    }
}

/* Mobile: shorter heading (avoids a two-line title) */
@media screen and (max-width : 1100px)
{
    .hide-mobile
    {
        display:            none;
    }
}

/* Links to the book (Vetro Editions): floating box, bottom right — white background, black type */
.buy-pathways
{
    position:               fixed;
    right:                  1em;
    bottom:                 1em;
    z-index:                100;
    display:                flex;
    flex-direction:         column;
    gap:                    0.4em;
    padding:                0.6em 0.8em;
    max-width:              calc(100vw - 2em);
    box-sizing:             border-box;
    color:                  black;
    background-color:       white;
    font-size:              max(11px, 0.7vw);
    line-height:            1.3;
    opacity:                0;
    transform:              translateY(8px);
    pointer-events:         none;
    transition:             opacity 400ms, transform 400ms;
}

.buy-pathways.visible
{
    opacity:                1;
    transform:              none;
    pointer-events:         auto;
}

.buy-pathways p
{
    margin:                 0;
    padding:                0;
    font-size:              1em;
    white-space:            nowrap;
}

.buy-pathways a
{
    color:                  black;
    border-bottom:          1px solid rgba(0, 0, 0, 0.35);
    width:                  fit-content;
}

.buy-pathways a:hover
{
    border-bottom-color:    black;
}

@media screen and (max-width : 1100px)
{
    .buy-pathways
    {
        font-size:          11px;
        padding:            0.5em 0.7em;
    }
}
