/* Site public : sections de l'accueil, grille de photos, filigrane, formulaire de contact. */

/* ---------- Sections ---------- */
.section {
    padding-block: var(--space-9);
}
.section--surface {
    background: var(--surface);
}
.section--gallery {
    padding-top: 160px;
}
.section__head {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}
.eyebrow--accent {
    color: var(--accent-text);
}
.eyebrow a:hover {
    color: var(--text);
}
.section__empty {
    padding-block: var(--space-7);
    color: var(--text-muted);
}
.section__cta {
    display: flex;
    justify-content: center;
    margin-top: var(--space-7);
}
.filters {
    margin-bottom: var(--space-6);
}
.title-lg--big {
    font-size: clamp(48px, 6.4vw, 92px);
    line-height: 0.98;
}

/* ---------- Une photo ---------- */
.photo {
    position: relative;
    overflow: hidden;
    border-radius: var(--photo-radius);
    background-color: var(--surface);
    background-position: center;
    background-size: cover;
    container-type: inline-size; /* le filigrane se dimensionne par rapport à la largeur de la photo (unité cqw) */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.photo picture,
.photo img {
    display: block;
    width: 100%;
    height: 100%;
}
.photo img {
    object-fit: cover;
    -webkit-user-drag: none;
    transition: opacity 600ms var(--ease), transform 600ms var(--ease);
}
.js .photo img:not(.is-loaded) {
    opacity: 0;
}
@media (hover: hover) {
    .photo-item:hover .photo img {
        transform: scale(1.04);
    }
}
/* Calque transparent par-dessus l'image : un clic droit ou un glisser tombe dessus, pas sur le fichier */
.photo__shield {
    position: absolute;
    inset: 0;
    z-index: 2;
}

/* ---------- Projets web ---------- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}
.project-card__media {
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, var(--bg)), var(--bg));
}
.project-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}
.project-card__placeholder {
    font-family: var(--font-display);
    font-size: 96px;
    line-height: 1;
    color: color-mix(in srgb, var(--text) 18%, transparent);
}
.section--surface .project-card {
    background: var(--bg);
}
@media (max-width: 1000px) {
    .project-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 640px) {
    .project-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- À propos ---------- */
.about {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
        "media head"
        "media body";
    column-gap: var(--space-8);
    row-gap: var(--space-5);
    align-content: center;
}
.about__media {
    grid-area: media;
    align-self: center;
}
.about__head {
    grid-area: head;
    align-self: end;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-5);
}
.about__body {
    grid-area: body;
    align-self: start;
}
.about__portrait {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius-card);
}
.about__placeholder {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    border-radius: var(--radius-card);
    background: linear-gradient(180deg, var(--surface), var(--bg));
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}
@media (max-width: 800px) {
    /* Téléphone : le titre, puis la photo, puis le texte */
    .about {
        grid-template-columns: 1fr;
        grid-template-areas:
            "head"
            "media"
            "body";
        row-gap: var(--space-6);
    }
    .about__head {
        align-self: start;
    }
}

/* ---------- Contact ---------- */
.contact {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-8);
    align-items: start;
}
.contact__intro {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}
.contact__form {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    align-items: flex-start;
}
.contact__form .field {
    width: 100%;
}
.section--surface .field__input {
    background: var(--bg);
}
.contact__status {
    width: 100%;
    margin: 0;
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-field);
    background: var(--bg);
}
.contact__status[data-kind="error"] {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 14%, var(--bg));
}
.contact__status[hidden] {
    display: none;
}
.contact__trap {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
@media (max-width: 800px) {
    .contact {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
}

/* ---------- Pagination de la galerie ---------- */
.pager--public {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    margin-top: var(--space-7);
}

/* ---------- Détail d'une photo (page /photo/<id> et lightbox) ---------- */
.photo-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: var(--space-7);
    align-items: start;
}
.photo-detail__stage .photo {
    max-width: 100%;
    margin-inline: auto;
}
.photo-detail__eyebrow,
.photo-detail__counter {
    margin: 0 0 var(--space-3);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-text);
}
.photo-detail__counter {
    color: var(--text-muted);
}
.photo-detail__title {
    margin: 0 0 var(--space-3);
    font-family: var(--font-display);
    font-size: clamp(28px, 3vw, 40px);
    line-height: 1.05;
}
.photo-detail__place {
    margin: 0 0 var(--space-4);
    color: var(--text-muted);
}
.photo-detail__tags {
    margin: var(--space-4) 0 var(--space-5);
    padding: 0;
    list-style: none;
}
.photo-detail .tag {
    font-family: var(--font-mono);
    font-size: 12px;
}
.exif-list {
    margin: 0 0 var(--space-6);
    border-top: 1px solid var(--border);
}
.exif-list div {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    padding-block: 9px;
}
.exif-list dt,
.exif-list dd {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.exif-list dt {
    color: var(--text-muted);
}
.exif-list dd {
    text-align: right;
}
.photo-detail__nav {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}
/* Indication du balayage : seulement sur un écran tactile (pas de survol) */
.photo-detail__hint {
    display: none;
}
@media (hover: none) {
    .photo-detail__hint {
        display: block;
        flex: 1;
        text-align: center;
        font-family: var(--font-mono);
        font-size: 11px;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--text-muted);
    }
}
.icon-btn--big {
    width: 50px;
    height: 50px;
    color: var(--text);
    font-size: 18px;
}
.icon-btn:disabled {
    opacity: 0.35;
    cursor: default;
}
/* Écran tactile : « Voir en pleine résolution » (le fichier d'origine, plusieurs dizaines de Mo, et un zoom pensé pour la souris)
   fonctionne mal au doigt : on ne le propose pas sur téléphone ni tablette. Il reste sur ordinateur. */
@media (hover: none) and (pointer: coarse) {
    .photo-detail__actions {
        display: none;
    }
}
.photo-detail__actions .btn {
    display: flex;
    justify-content: center;
}
.photo-page__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-5);
}
.photo-page__pager {
    display: flex;
    gap: var(--space-2);
}
.link-back {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.link-back:hover {
    color: var(--text);
}
@media (max-width: 900px) {
    .photo-detail {
        grid-template-columns: 1fr;
        gap: var(--space-5);
    }
}

/* ---------- Lightbox ---------- */
.is-lightbox {
    overflow: hidden;
}
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    background: var(--bg);
    opacity: 0;
    transition: opacity 250ms var(--ease);
}
.lightbox.is-open {
    opacity: 1;
}
.lightbox__close {
    position: absolute;
    top: 24px;
    right: 28px;
    z-index: 5;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}
.lightbox__close:hover {
    color: var(--accent-text);
}
.lightbox__body {
    flex: 1;
    display: flex;
    min-width: 0;
    transition: opacity 200ms var(--ease);
}
.lightbox.is-loading .lightbox__body {
    opacity: 0.35;
}
.lightbox .photo-detail {
    flex: 1;
    height: 100%;
    min-height: 0;
    padding: 48px 56px;
    gap: var(--space-6);
    align-items: stretch;
}
.lightbox .photo-detail__stage {
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}
/* La photo s'ajuste à la zone sans être recadrée : la plus grande taille qui tient en largeur ET en hauteur */
.lightbox .photo-detail__stage .photo {
    width: min(100%, calc((100vh - 96px) * var(--ratio, 1.5)));
    max-height: 100%;
}
.lightbox .photo-detail__info {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    padding-top: 40px;
}
.lightbox .photo-detail__nav {
    margin-top: auto;
}
.lightbox.is-full .photo-detail__stage {
    display: block;
    overflow: auto;
}
.lightbox.is-full .photo-detail__stage .photo {
    width: auto;
    max-width: none;
    max-height: none;
    border-radius: 0;
}
.lightbox.is-full .photo img {
    width: 100%;
    height: auto;
}
@media (max-width: 900px) {
    .lightbox {
        overflow-y: auto;
    }
    .lightbox__close {
        top: 12px;
        right: 12px;
        background: rgba(13, 13, 13, 0.7);
    }
    .lightbox__body {
        display: block;
    }
    .lightbox .photo-detail {
        display: block;
        height: auto;
        padding: 64px var(--gutter) 32px;
    }
    /* La photo ne prend pas tout l'écran : une photo verticale cachait la légende, les tags et les flèches sous le pli,
       sans qu'on devine qu'il fallait défiler. Elle fait au plus 56 % de la hauteur visible (la largeur suit son ratio). */
    .lightbox .photo-detail__stage .photo {
        width: min(100%, calc(56vh * var(--ratio, 1.5)));
        width: min(100%, calc(56svh * var(--ratio, 1.5)));
        margin-inline: auto;
    }
    .lightbox .photo-detail__info {
        padding-top: var(--space-5);
        overflow: visible;
    }
    /* Numéro et flèches juste sous la photo, avant la légende */
    .lightbox .photo-detail__counter {
        order: -2;
    }
    .lightbox .photo-detail__nav {
        order: -1;
        margin: 0 0 var(--space-4);
    }
}
@media (prefers-reduced-motion: reduce) {
    .lightbox,
    .lightbox__body {
        transition: none;
    }
}


/* ---------- Pages d'erreur (404) : photo sombre en fond, comme la maquette ---------- */
.error-page {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 100svh;
    padding-block: 160px 72px;
    overflow: hidden;
}
.error-page__bg,
.error-page__bg picture,
.error-page__bg img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.error-page__bg img {
    object-fit: cover;
}
.error-page__bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(13, 13, 13, 0.78), rgba(13, 13, 13, 0.9));
}
.error-page__content {
    position: relative;
    z-index: 1;
}
.error-page__code {
    margin: var(--space-3) 0 var(--space-5);
    font-family: var(--font-display);
    font-size: clamp(120px, 24vw, 320px);
    line-height: 0.85;
    letter-spacing: -0.03em;
    color: var(--accent);
}
.error-page__title {
    margin: 0 0 var(--space-3);
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: clamp(26px, 3.4vw, 44px);
    line-height: 1.1;
    color: #f2f2f2;
}
.error-page__text {
    max-width: 640px;
    margin: 0 0 var(--space-6);
    color: #c4c4c4;
}
.error-page__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

/* ---------- Fiche projet ---------- */
.project-card__title-link:hover {
    color: var(--accent-text);
}
.project-card__links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
}
.link-arrow--muted {
    color: var(--text-muted);
}
a.project-card__media {
    display: block;
}
.project-page .link-back {
    display: inline-block;
    margin-bottom: var(--space-6);
}
.title-xl--project {
    margin: var(--space-4) 0 var(--space-4);
    font-size: clamp(44px, 7vw, 110px);
    line-height: 1;
    text-transform: none;
}
.project-top {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: var(--space-8);
    align-items: center;
}
.project-hero__subtitle {
    margin: 0 0 var(--space-4);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(20px, 2.2vw, 28px);
    line-height: 1.25;
}
.project-hero__summary {
    max-width: 560px;
    margin: 0 0 var(--space-5);
    font-size: 18px;
    color: var(--text-muted);
}
.project-hero__tags {
    margin: 0 0 var(--space-6);
    padding: 0;
    list-style: none;
}
.project-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}
.project-showcase {
    position: relative;
    isolation: isolate;
}
.project-showcase::before {
    content: "";
    position: absolute;
    inset: 8% -6% -8% 6%;
    z-index: -1;
    border-radius: var(--radius-card);
    background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--accent) 38%, transparent), transparent 70%);
    filter: blur(40px);
}
.project-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-5);
    margin: var(--space-9) 0 0;
    padding-block: var(--space-5);
    border-block: 1px solid var(--border);
}
.project-fact {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.project-fact__label,
.project-story__title {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-text);
}
.project-fact__value {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(18px, 1.8vw, 22px);
}
.project-shots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 300px));
    justify-content: start;
    gap: var(--space-5);
    margin-top: var(--space-9);
}
.project-shot {
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--surface);
    box-shadow: 0 30px 60px -30px rgb(0 0 0 / 55%);
}
.project-shot__bar {
    display: flex;
    gap: 6px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 80%, var(--bg));
}
.project-shot__bar i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--text) 25%, transparent);
}
.project-shot img {
    display: block;
    width: 100%;
    height: auto;
}
.project-shot--main img {
    max-height: 560px;
    object-fit: cover;
    object-position: top;
}
.project-story {
    margin-top: var(--space-9);
    border-top: 1px solid var(--border);
}
.project-story__block {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: var(--space-7);
    padding-block: var(--space-7);
    border-bottom: 1px solid var(--border);
}
.project-story__block > .project-story__title {
    align-self: start;
    font-size: 13px;
}
.project-story__title span {
    margin-right: var(--space-2);
    color: var(--text-muted);
}
.project-block {
    margin-top: var(--space-8);
}
.project-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0 var(--space-7);
    margin: var(--space-4) 0 0;
    padding: 0;
    list-style: none;
}
.project-features li {
    display: flex;
    gap: var(--space-4);
    align-items: baseline;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    font-size: 17px;
}
.project-features li span {
    flex: none;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-text);
}
.project-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
}
.project-result {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-5);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--surface);
}
.project-result__value {
    font-family: var(--font-display);
    font-size: clamp(36px, 4vw, 56px);
    line-height: 1;
    color: var(--accent-text);
}
.project-result__label {
    color: var(--text-muted);
}
.project-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    margin-top: var(--space-9);
}
.project-pager__link {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-5);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    transition: border-color var(--duration) var(--ease);
}
.project-pager__link:hover {
    border-color: var(--accent);
}
.project-pager__link--next {
    text-align: right;
}
.project-pager__link span {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.project-pager__link strong {
    font-family: var(--font-heading);
    font-size: 22px;
}
@media (max-width: 1000px) {
    .project-top {
        grid-template-columns: 1fr;
        gap: var(--space-7);
    }
}
@media (max-width: 800px) {
    .project-shots {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .project-pager {
        grid-template-columns: 1fr;
    }
    .project-story__block {
        grid-template-columns: 1fr;
        gap: var(--space-3);
        padding-block: var(--space-6);
    }
    .project-pager__link--next {
        text-align: left;
    }
}

/* ---------- Fiche projet : textes mis en forme (gras, italique, liens, listes, titres) ---------- */
.project-story__text > :first-child {
    margin-top: 0;
}
.project-story__text p,
.project-story__text ul {
    margin: 0 0 var(--space-4);
    font-size: 17px;
    line-height: 1.6;
    color: #d6d6d6;
}
[data-theme="light"] .project-story__text p,
[data-theme="light"] .project-story__text ul {
    color: var(--text);
}
.project-story__text ul {
    padding-left: 1.2em;
}
.project-story__text li + li {
    margin-top: 6px;
}
.project-story__text h3 {
    margin: var(--space-5) 0 var(--space-2);
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 20px;
}
.project-story__text a {
    color: var(--accent-text);
    text-decoration: underline;
}
.preview-banner {
    margin: 0 0 var(--space-5);
    padding: 12px 18px;
    border: 1px solid var(--accent);
    border-radius: 12px;
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    font-size: 14px;
}

/* Zoom à la souris (pleine résolution) : la photo prend toute la place, le panneau d'infos s'efface */
.lightbox.is-zoom .photo-detail {
    grid-template-columns: minmax(0, 1fr);
}
.lightbox.is-zoom .photo-detail__info {
    display: none;
}
.lightbox .photo-detail__stage {
    position: relative;
}
.lightbox .photo-detail__stage .photo {
    transition: transform 380ms var(--ease), transform-origin 140ms linear;
}
.lightbox.is-zoom .photo-detail__stage {
    overflow: hidden;
}
.lightbox__hud {
    position: absolute;
    left: 50%;
    bottom: 24px;
    z-index: 6;
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: 8px 8px 8px 20px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(13, 13, 13, 0.84);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.04em;
    transform: translateX(-50%);
    white-space: nowrap;
}
.lightbox__hud button {
    padding: 8px 16px;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
@media (prefers-reduced-motion: reduce) {
    .lightbox .photo-detail__stage .photo {
        transition: none;
    }
}

/* Le texte du site n'est pas sélectionnable (ni le menu « copier » au toucher long sur mobile) ; les champs du formulaire de contact le restent */
body {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
input,
textarea,
[contenteditable="true"] {
    -webkit-touch-callout: default;
    -webkit-user-select: text;
    user-select: text;
}

/* Page des mentions légales et de la confidentialité */
.legal { line-height: 1.7; color: var(--text-muted); }
.legal p, .legal li { max-width: 68ch; }
.legal b, .legal h1 { color: var(--text); }
.legal b { font-weight: 600; }
.legal a { color: var(--accent-text); text-underline-offset: 3px; }
.legal__toc { margin-bottom: var(--space-8); font-size: 14px; }
.legal__h { margin: var(--space-8) 0 var(--space-3); color: var(--text); font-family: var(--font-display); font-size: clamp(22px, 2.4vw, 28px); line-height: 1.15; scroll-margin-top: 110px; }
.legal__h3 { margin: var(--space-5) 0 var(--space-2); color: var(--text); font-size: 16px; font-weight: 600; }
.legal__list { margin: 0 0 var(--space-4); padding-left: 1.2em; }
.legal__list li { margin-bottom: var(--space-2); }
.legal__updated { margin-top: var(--space-8); font-size: 13px; }

/* Avis sous le formulaire de contact */
.contact__privacy { margin: 0 0 var(--space-4); color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.contact__privacy a { color: var(--accent-text); text-underline-offset: 3px; }
