/* Page d'accueil — direction « Cinéma » : le haut de page en plein écran, puis des sections sobres sur fond nuit. */

/* ------------------------------------------------------------------ haut de page */

.home-hero {
    position: relative;
    min-height: max(640px, 100svh);
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    isolation: isolate;
}

.home-hero-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 40%;
}

.home-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(0deg, var(--cine-bg) 0%, rgba(5, 6, 8, .78) 30%, rgba(5, 6, 8, .12) 68%, rgba(5, 6, 8, .6) 100%);
}

.home-hero-inner {
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 3rem;
    padding: 7rem var(--cine-gutter) clamp(3rem, 8vh, 5rem);
}

.home-hero-text { display: flex; flex-direction: column; gap: 1.5rem; max-width: 820px; }

.home-hero-logo { width: 72px; height: auto; }

.home-hero-title {
    margin: 0;
    max-width: 9ch;
    font-family: "Caslon Antique", serif;
    font-weight: 400;
    font-size: clamp(3.5rem, 9vw, 8rem);
    line-height: .95;
    letter-spacing: .04em;
    color: var(--cine-ink);
}

.home-hero-lead {
    margin: 0;
    max-width: 620px;
    font-family: "IM Fell English", serif;
    font-size: clamp(1.125rem, 1.7vw, 1.45rem);
    line-height: 1.5;
    color: var(--cine-text);
}

.home-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: .5rem; }


.home-trailer-cta { display: flex; align-items: center; gap: 1.1rem; flex-shrink: 0; }
.home-trailer-cta-text { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; }
.home-trailer-cta-title { font-family: "Caslon Antique", serif; font-size: 1.5rem; color: var(--cine-ink); }
.home-trailer-cta-link { font-size: .8125rem; color: var(--cine-muted); }
.home-trailer-cta-link:hover { color: var(--cine-ink); }

.home-play {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    border-radius: 999px;
    border: 1px solid rgba(241, 236, 226, .5);
    background: rgba(5, 6, 8, .35);
    color: var(--cine-ink);
    backdrop-filter: blur(4px);
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.home-play svg { width: 30px; height: 30px; fill: currentColor; margin-left: 3px; }
.home-play:hover { background: var(--cine-gold); border-color: var(--cine-gold); color: #140f05; transform: scale(1.05); }

/* ------------------------------------------------------------------ sections */

.home-section { padding: clamp(4rem, 8vw, 6rem) var(--cine-gutter); max-width: 1600px; margin: 0 auto; }

.home-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 2.5rem; }

.home-h2 {
    margin: 0;
    font-family: "Caslon Antique", serif;
    font-weight: 400;
    font-size: clamp(2.25rem, 4vw, 3.25rem);
    letter-spacing: .04em;
    color: var(--cine-ink);
}

.home-section-lead {
    margin: 0;
    max-width: 460px;
    font-family: "IM Fell English", serif;
    font-size: 1.2rem;
    line-height: 1.55;
    color: var(--cine-muted);
}

.home-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }

.home-card {
    position: relative;
    display: flex;
    align-items: flex-end;
    height: clamp(420px, 40vw, 560px);
    border-radius: 20px;
    overflow: hidden;
    isolation: isolate;
}

.home-card-img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform .7s ease; }
.home-card:hover .home-card-img { transform: scale(1.04); }
.home-card::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(5, 6, 8, .95) 0%, rgba(5, 6, 8, 0) 60%); }

.home-card-body { display: flex; flex-direction: column; gap: .6rem; padding: 2rem; }
.home-card-tag { font-size: .8125rem; font-weight: 700; letter-spacing: .3em; color: var(--cine-gold); }
.home-card-title { margin: 0; font-family: "IM Fell English", serif; font-weight: 400; font-size: clamp(1.6rem, 2.2vw, 2rem); line-height: 1.1; color: var(--cine-ink); }
.home-card-text { margin: 0; font-size: 1rem; line-height: 1.5; color: #c9c2b4; }

/* ------------------------------------------------------------------ carte */

.home-section-map { padding-top: 0; }

.home-map-explorer { overflow: hidden; border: 1px solid var(--cine-line); border-radius: 24px; background: #101115; }
.home-map-explorer.is-fullscreen { position: fixed; inset: 0; z-index: 300; display: flex; flex-direction: column; border: 0; border-radius: 0; }
body.map-fullscreen-open { overflow: hidden; }

.home-map {
    position: relative;
    height: clamp(500px, 52vw, 720px);
    min-width: 0;
    overflow: hidden;
    background: radial-gradient(circle at center, #25313b, #11191f 72%);
    touch-action: pan-y;
}
.home-map.is-zoomed, .home-map-explorer.is-fullscreen .home-map { touch-action: none; }
.home-map-explorer.is-fullscreen .home-map { height: auto; min-height: 0; }

.home-map-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; transform-origin: 0 0; will-change: transform; }
.home-map-layer > img { display: block; width: 100%; height: 100%; max-width: none; object-fit: contain; user-select: none; pointer-events: none; }
.home-map-layer .map-pin { position: absolute; z-index: 2; transform: translate(-50%, -100%); }
.home-map-explorer:not(.is-ready) .map-pin { display: none; }
.home-map-layer .map-pin[hidden] { display: none; }
.map-pin-button { display: block; width: var(--marker-size, 70px); height: var(--marker-size, 70px); padding: 0; border: 0; background: transparent; cursor: pointer; }
.map-pin-button .map-pin-dot { display: block; width: 100%; height: 100%; border: 2px solid #fff; border-radius: 50% 50% 50% 0; background: var(--pin-color, #d97706); box-shadow: 0 2px 8px rgba(0, 0, 0, .6); transform: rotate(-45deg); }
.map-pin-button:focus-visible { outline: 3px solid #fff; outline-offset: 5px; border-radius: 50%; }
.map-pin.is-selected .map-pin-dot { box-shadow: 0 0 0 5px rgba(245, 183, 75, .5), 0 2px 8px #000; }

.home-map-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.3rem;
    border-bottom: 1px solid var(--cine-line);
}
.home-map-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, 320px); min-height: 0; }
.home-map-explorer.is-fullscreen .home-map-body { flex: 1; }

.home-map-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: .25rem 1.25rem; }
.home-map-title { margin: 0; font-family: "Caslon Antique", serif; font-weight: 400; font-size: 2.1rem; color: var(--cine-ink); }
.home-map-sub { margin: 0; font-size: .95rem; color: #c9c2b4; }

.home-map-tools { display: flex; gap: .5rem; flex: none; }
.home-map-tools button {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(241, 236, 226, .3);
    background: transparent;
    color: var(--cine-ink);
    font-size: 1.2rem;
    line-height: 1;
    transition: background .2s ease, border-color .2s ease;
}
.home-map-tools button:hover { background: rgba(241, 236, 226, .12); border-color: rgba(241, 236, 226, .6); }
.home-map-tools button:focus-visible, .home-map-filters button:focus-visible, .home-map-results button:focus-visible { outline: 2px solid var(--cine-gold); outline-offset: 3px; }

.home-map-sidebar { display: flex; flex-direction: column; gap: .75rem; min-height: 0; padding: 1.1rem; border-left: 1px solid var(--cine-line); }
.home-map-mobile-tip { display: none; margin: 0; color: var(--cine-muted); font-size: .8125rem; }
.home-map-search-label { color: var(--cine-ink); font-size: .82rem; font-weight: 700; }
.home-map-sidebar input[type="search"] { width: 100%; min-height: 42px; padding: .6rem .75rem; }
.home-map-filters { display: flex; flex-wrap: wrap; gap: .35rem; }
.home-map-filters button { min-height: 36px; padding: .4rem .8rem; border: 1px solid var(--cine-line); border-radius: 999px; background: transparent; color: var(--cine-text); font-size: .8125rem; cursor: pointer; }
.home-map-filters button.is-active { border-color: var(--cine-gold); background: rgba(232, 176, 75, .16); color: var(--cine-ink); }
.home-map-result-count { margin: .2rem 0 0; color: var(--cine-muted); font-size: .8125rem; }
.home-map-results { display: grid; align-content: start; gap: .4rem; min-height: 0; max-height: 280px; overflow: auto; }
.home-map-results button { display: flex; align-items: center; gap: .65rem; width: 100%; padding: .6rem .7rem; border: 1px solid transparent; border-radius: 9px; background: rgba(241, 236, 226, .04); color: var(--cine-ink); text-align: left; cursor: pointer; }
.home-map-results button:hover, .home-map-results button.is-selected { border-color: rgba(232, 176, 75, .5); background: rgba(232, 176, 75, .1); }
.home-map-result-dot { flex: none; width: .65rem; height: .65rem; border-radius: 50%; background: var(--pin-color, var(--cine-gold)); }
.home-map-result-name { display: block; font-size: .86rem; font-weight: 700; }
.home-map-result-type { display: block; color: var(--cine-muted); font-size: .78rem; }
.home-map-details { margin-top: auto; padding-top: .85rem; border-top: 1px solid var(--cine-line); color: var(--cine-muted); font-size: .85rem; line-height: 1.45; }
.home-map-details p { margin: .4rem 0; }
.home-map-details strong { color: var(--cine-ink); font-size: 1rem; }
.home-map-details a { display: inline-block; margin-top: .3rem; color: var(--cine-gold); text-decoration: underline; }

.home-map-hint {
    position: absolute;
    left: 50%;
    bottom: 1rem;
    z-index: 20;
    transform: translateX(-50%);
    margin: 0;
    padding: .4rem .8rem;
    border-radius: 999px;
    background: rgba(5, 6, 8, .6);
    font-size: .8rem;
    color: var(--cine-muted);
    white-space: nowrap;
    pointer-events: none;
}

@media (max-width: 820px) {
    .home-map-body { grid-template-columns: minmax(0, 1fr); }
    .home-map-sidebar { border-left: 0; border-top: 1px solid var(--cine-line); }
    .home-map-mobile-tip { display: block; }
    .home-map-explorer.is-fullscreen .home-map-mobile-tip { display: none; }
    .home-map-results { max-height: 180px; }
    .home-map-explorer.is-fullscreen .home-map-body { display: flex; flex-direction: column; }
    .home-map-explorer.is-fullscreen .home-map { flex: 1; min-height: 40%; }
    .home-map-explorer.is-fullscreen .home-map-sidebar { max-height: 37dvh; overflow: auto; }
}

/* ------------------------------------------------------------------ candidature */

.home-join {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.75rem;
    padding: clamp(4.5rem, 9vw, 6.5rem) var(--cine-gutter);
    border-top: 1px solid var(--cine-line);
    text-align: center;
}

.home-join-title {
    margin: 0;
    font-family: "Caslon Antique", serif;
    font-weight: 400;
    font-size: clamp(2.5rem, 5.5vw, 4.5rem);
    line-height: 1;
    color: var(--cine-ink);
}

.home-join-lead {
    margin: 0;
    max-width: 640px;
    font-family: "IM Fell English", serif;
    font-size: clamp(1.1rem, 1.6vw, 1.3rem);
    line-height: 1.55;
    color: var(--cine-muted);
}

.home-steps { display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 1rem 1.5rem; margin: 0; padding: 0; list-style: none; color: var(--cine-text); }
.home-steps li { display: flex; align-items: center; gap: .6rem; }
.home-steps li + li::before { content: ""; width: 64px; height: 1px; margin-right: .9rem; background: rgba(241, 236, 226, .25); }
.home-steps strong { font-family: "Caslon Antique", serif; font-weight: 400; font-size: 1.5rem; color: var(--cine-gold); }

.home-join-note { margin: -.75rem 0 0; font-size: .8125rem; color: var(--cine-faint); }

/* ------------------------------------------------------------------ trailer (fenêtre) */

.home-trailer { position: fixed; inset: 0; z-index: 150; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.home-trailer[hidden] { display: none; }
.home-trailer-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(0, 0, 0, .85); backdrop-filter: blur(6px); }
.home-trailer-box { position: relative; width: min(1200px, 100%); aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #000; box-shadow: 0 30px 90px rgba(0, 0, 0, .6); }
.home-trailer-box video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.home-trailer-close {
    position: absolute;
    top: .75rem;
    right: .75rem;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: rgba(5, 6, 8, .75);
    color: var(--cine-ink);
    font-size: 1.1rem;
}
.home-trailer-close:hover { background: var(--cine-gold); color: #140f05; }

/* ------------------------------------------------------------------ petits écrans */

@media (max-width: 1023px) {
    .home-cards { grid-template-columns: 1fr; }
    .home-card { height: 380px; }
    .home-section-head { flex-direction: column; align-items: flex-start; gap: 1rem; }
}

@media (max-width: 767px) {
    .home-hero-inner { flex-direction: column; align-items: flex-start; gap: 2rem; padding-top: 6rem; }
    .home-hero-logo { width: 56px; }
    .cine-eyebrow { font-size: .75rem; letter-spacing: .3em; }
    .home-actions { width: 100%; }
    .home-actions .cine-btn { flex: 1 1 100%; }
    .home-trailer-cta { flex-direction: row-reverse; }
    .home-trailer-cta-text { align-items: flex-start; }
    .home-play { width: 64px; height: 64px; }
    .home-play svg { width: 24px; height: 24px; }

    /* La carte est à peu près carrée : sur téléphone, un cadre carré évite les grandes bandes vides. */
    .home-map { height: min(440px, calc(100vw - 2 * var(--cine-gutter))); }
    .home-map-bar { padding: .9rem 1rem; }
    .home-map-title { font-size: 1.6rem; }
    .home-map-sub { display: none; }
    .home-map-tools button { width: 40px; height: 40px; }
    .home-map-hint { display: none; }

    .home-steps { flex-direction: column; gap: .75rem; }
    .home-steps li + li::before { display: none; }
    .cine-btn-large { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .home-card-img, .cine-btn, .home-play { transition: none; }
}
