/*=====================================================================

    BATEAUX
    Photographies et fiches documentaires

    Livraison n°1.1
    Édition 1.3

=====================================================================*/

@import url("variables.css");

/*--------------------------------------------------------------------
    POLICES
--------------------------------------------------------------------*/

@font-face {
    font-family: "Source Serif Pro";
    src: url("../fonts/SourceSerifPro-Regular.otf") format("opentype");
    font-weight: 400;
}

@font-face {
    font-family: "Source Serif Pro";
    src: url("../fonts/SourceSerifPro-Semibold.otf") format("opentype");
    font-weight: 600;
}

@font-face {
    font-family: "Montserrat";
    src: url("../fonts/Montserrat-Regular.woff2") format("woff2");
    font-weight: 400;
}

@font-face {
    font-family: "Montserrat";
    src: url("../fonts/Montserrat-Medium.woff2") format("woff2");
    font-weight: 450;
    font-style: normal;
}

@font-face {
    font-family: "Montserrat";
    src: url("../fonts/Montserrat-ExtraBold.woff2") format("woff2");
    font-weight: 800;
    font-style: normal;
}

/*--------------------------------------------------------------------
    BASE
--------------------------------------------------------------------*/

*,
*::before,
*::after { box-sizing: border-box; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--color-background);
    color: var(--color-text);
    /*font-family: "Source Serif Pro", Georgia, serif;*/
    /*font-family: var(--font-family);*/
    font-family: "Montserrat", sans-serif;
    font-size: var(--font-text);
    text-rendering: optimizeLegibility;
    line-height: 1.2;
}

.page {
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 2rem var(--page-margin) 2rem;
}

/* ==========================================================
   ACCUEIL
   ========================================================== */

.accueil
{
    max-width: 760px;

    margin: 5rem auto;

    padding: 0 2rem;

    text-align: center;
}

/* le titre et le sous-titre */
.accueil h1
{
    margin-bottom: .5rem;

    font-size: clamp(2.4rem,5vw,3.5rem);

    letter-spacing: .08em;
}

.sous-titre
{
    margin-bottom: .5rem;

    color: #666;

    font-size: 1.2rem;
}

/* la signature */
.signature
{
    margin-bottom: 3rem;

    color: #777;

    font-style: italic;
}

/* les paragraphes */
.intro
{
    margin: 2rem auto;

    max-width: 42em;

    line-height: 1.7;

    text-align: justify;
}

/* le bouton */
.bouton
{
    display:inline-block;

    padding:.8rem 1.8rem;

    border:1px solid var(--accent);

    border-radius:4px;

    text-decoration:none;

    color:var(--accent);

    transition:.2s;
}

.bouton:hover
{
    background:var(--accent);

    color:var(--color-text);
}

/* ==========================================================
   LA BARRE DE RECHERCHE
   ========================================================== */

.search-bar {
    margin-bottom: 1.5rem;
}

.search-bar input {
    width: 100%;
    max-width: 500px;
    padding: 0.6rem 0.8rem;
    font-size: 1rem;
    border: 1px solid var(--color-line);
    border-radius: 4px;
    outline: none;
}

.search-bar input:focus {
    border-color: var(--color-title);
}

/* ==========================================================
   PARCOURIR
   ========================================================== */

.parcourir
{
    max-width: 980px;
    margin: 0 auto;
    padding: 2rem;
}

.parcourir h1
{
    margin-bottom: .25rem;
}

.nombre
{
    margin: 0 0 2rem 0;
    color: #000;
    font-style: italic;
}

/* la liste */
.liste-bateaux
{
    list-style: none;
    margin: 0;
    padding: 0;
}

/* chaque ligne */
.liste-bateaux li
{
    border-bottom: 1px solid #d8d8d8;
}

/* le lien */
.liste-bateaux a
{
    display: flex;

    justify-content: space-between;

    align-items: baseline;

    padding: .60rem 0;

    text-decoration: none;

    color: inherit;
}

/* les deux colonnes */
.nom
{
    font-weight: 600;

    color: var(--accent);
}

.fonction
{
    color: #666;

    font-size: .95rem;

    margin-left: 2rem;

    text-align: right;
}

/* et le survol */
.liste-bateaux a:hover
{
    background: #f8f8f8;
}


/*--------------------------------------------------------------------
    NAVIGATION
--------------------------------------------------------------------*/

.breadcrumb{
    font-size:.9rem;
    color:var(--color-subtitle);
    margin-bottom:.6rem;
}

.top-nav,
.bottom-nav {
    display: flex;
    justify-content: space-between;
}

.top-nav{
    margin-bottom:1.5rem;
}

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

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

.breadcrumb a,
.top-nav a,
.bottom-nav a {
    text-decoration: none;
}

.breadcrumb a:hover,
.top-nav a:hover,
.bottom-nav a:hover {
    text-decoration: underline;
}

/*--------------------------------------------------------------------
    EN-TÊTE
--------------------------------------------------------------------*/

.fiche-header h1{
    margin:0;
    color:var(--color-title);
    font-size:var(--font-title);
    font-weight:800;
    font-family: "Montserrat", sans-serif;
}

.subtitle{
    margin:.35rem 0 2rem;
    min-height:1.2em;
    color:var(--color-subtitle);
    font-size:var(--font-subtitle);
    font-style:italic;
}

/*--------------------------------------------------------------------
    COMPOSITION
--------------------------------------------------------------------*/

.fiche-layout{
    display:grid;
    grid-template-columns: var(--photo-width) var(--documentation-width);
    gap:var(--column-gap);
    align-items:end;
}

.fiche-layout > div{
    margin:0;
}

.photo
{
    margin: 0;
    width: var(--photo-width);
    display: flex;
    justify-content: flex-start;
}

.photo-principale
{
    display: block;
    max-width: 100%;
    max-height: 690px;
    width: auto;
    height: auto;
    transition: opacity 900ms ease-in-out;
    will-change: opacity;
}

.documentation {
    transform: translateY(-129px);
}

.documentation .bloc-doc:last-child {
    margin-bottom:0;
}

.documentation section{
    margin-bottom:2.5rem;
}

.documentation h2{
    margin:0 0 .75rem 0;    /* le C est au niveau du haut de la photo */
    color:var(--color-title);
    line-height: 1.1rem;
    font-size:0.9rem;
    font-weight: 400;
    border-bottom:1px solid var(--color-line);
}

.documentation dl{
    display:grid;
    grid-template-columns:1fr auto;
    gap:.35rem 1rem;
    margin:0;
}

.documentation dt,
.documentation dd{
    margin:0;
}

.documentation dd{
    text-align:right;
    white-space:nowrap;
}

/*--------------------------------------------------------------------
    MINIATURES
--------------------------------------------------------------------*/

.thumbnails{
    display:flex;
    gap:var(--thumbnail-gap);
    padding:0.5rem 0.25rem;

    overflow-x: scroll;
    overflow-y: hidden;

    scroll-snap-type: x mandatory;

    scroll-behavior: smooth;
    cursor: grab;

    flex-wrap: nowrap;

    max-width: 515px;   /* largeur correspondant à 4 miniatures */
}

/* Les boutons miniatures */
.thumbnails button {
    /*flex: 0 0 auto;*/
    flex: 0 0 var(--thumbnail-width);

    width: var(--thumbnail-width);
    aspect-ratio: 1 / 1;
    overflow: hidden;
    scroll-snap-align: start;
    scroll-margin: 4px;

    border: none;
    background: none;

    cursor: pointer;

    transition: transform 0.15s ease;
}

/* Bordure de la miniature active */
.thumbnails button.active {
    outline: 2px solid var(--color-title);
    outline-offset: 2px;
}

/* Images des miniatures */
.thumbnails img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Zoom au survol */
.thumbnails button img {
    transition: transform 0.25s ease;
}

.thumbnails button:hover img {
    transform: scale(1.05);
}


/*--------------------------------------------------------------------
    DESCRIPTION et SKIPPER
--------------------------------------------------------------------*/

.description{
    max-width:var(--photo-width);
}

.more{
    margin-top:1.2rem;
    font-size:.95rem;
}

.skipper {
    margin-top: 0.8rem;
    font-style: italic;
}

/*--------------------------------------------------------------------
    BAS DE PAGE
--------------------------------------------------------------------*/

.bottom-nav{
    margin-top:2rem;
    padding-top:.7rem;
    border-top:1px solid var(--color-line);
}

.site-footer{
    margin-top:.8rem;
    padding-top:.6rem;
    border-top:1px solid var(--color-line);
    text-align:center;
    font-size:var(--font-footer);
    color:var(--color-subtitle);
}

/*--------------------------------------------------------------------
    RESPONSIVE
--------------------------------------------------------------------*/

@media (max-width:1100px){

    .fiche-layout{
        grid-template-columns:1fr;
    }

    .documentation{
        margin-top:2rem;
    }
}

/*--------------------------------------------------------------------
    RESPONSIVE — FICHE SUR PETITS ÉCRANS
--------------------------------------------------------------------*/

@media (max-width: 600px) {

    /* La mise en page devient une seule colonne */
    .fiche-layout {
        display: block;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    /* Zone photo */
    .zone-photo {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .photo {
        width: 100%;
        max-width: 100%;
    }

    .photo-principale {
        display: block;
        width: 100%;
        max-width: 100%;
        height: auto;
    }

    /* Miniatures */
    .thumbnails {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Documentation sous la photo :
       on annule le décalage utilisé sur desktop */
    .documentation {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin-top: 2rem;
        transform: none;
    }

    /* Caractéristiques techniques */
    .documentation dl {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .documentation dt,
    .documentation dd {
        min-width: 0;
    }

    .documentation dd {
        white-space: normal;
    }

    /* Description */
    .description {
        width: 100%;
        max-width: 100%;
    }

    /* Liens */
    .more {
        max-width: 100%;
    }

    /* Navigation précédent / liste / suivant */
    .bottom-nav {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        column-gap: 1rem;
        align-items: center;
        font-size: 0.9rem;
    }

    .bottom-nav a {
        min-width: 0;
    }

    #precedent {
        text-align: left;
    }

    #retour_liste {
        text-align: center;
        /*white-space: nowrap;*/
    }

    #suivant {
        text-align: right;
    }
}

/*--------------------------------------------------------------------
    RESPONSIVE
--------------------------------------------------------------------*/

@media (max-width:1400px){

    .fiche-layout{
        grid-template-columns:1fr;
    }

    /* Documentation sous la photo :
       on annule le décalage utilisé sur desktop */
    .documentation {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin-top: 1rem;
        transform: none;
    }

}