/* Les portées : la section « Nos portées » de l'accueil et le pop-up d'arrivée (inc/pages-portees.php). */

/* ── La section ── */
/* Le lien du pop-up y mène : le titre ne doit pas finir sous l'en-tête collant. */
.portees-accueil { scroll-margin-top: 2.5rem; }
.portees-accueil .bloc__titre span { white-space: nowrap; }
.portees-accueil__liste {
    list-style: none; margin: 0; padding: 0;
    display: grid; gap: 1.5rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.portees-accueil__liste--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.portees-accueil__liste--1 { grid-template-columns: minmax(0, 1fr); }

/* La section suit la bannière verte, sur fond blanc : ce sont les cartes qui sont vert pâle. */
.portee-carte {
    display: flex; flex-direction: column;
    background: var(--vert-pale); border-radius: var(--rayon); overflow: hidden;
    scroll-margin-top: calc(var(--entete-h) + 1.5rem);
}
.portee-carte__photos { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--vert-brume); overflow: hidden; }
.portees-accueil__liste--2 .portee-carte__photos { aspect-ratio: 3 / 2; }
.portee-carte__photos img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }

/* Les deux parents, séparés par une fente en biais : le motif du site (voir .diptyque). */
.portee-carte__photos--deux img { width: 58%; }
.portee-carte__photos--deux img:first-child { clip-path: polygon(0 0, 92.2% 0, 78.4% 100%, 0 100%); }
.portee-carte__photos--deux img:last-child { left: auto; right: 0; clip-path: polygon(21.6% 0, 100% 0, 100% 100%, 7.8% 100%); }

.portee-carte__corps { display: flex; flex-direction: column; align-items: flex-start; padding: 1.25rem 1.4rem 1.5rem; flex: 1; }
.portee-carte__date {
    margin: 0 0 .85rem; padding: .42rem .75rem; border-radius: 999px;
    background: #fff; color: var(--vert-fonce);
    font: 700 .8rem/1.25 var(--corps);
}
/* Nés : la pastille pleine. À venir : la pastille blanche. */
.portee-carte--nee .portee-carte__date { background: var(--vert); color: var(--brun-nuit); }
.portee-carte__nom { margin: 0; font: 400 1.6rem/1.15 var(--titre); color: var(--brun); }
.portee-carte__nom a { color: inherit; text-decoration: none; }
.portee-carte__nom a:hover { color: var(--vert-texte); }
.portee-carte__nom span { color: var(--vert-texte); }
.portee-carte__infos { margin: .35rem 0 0; color: var(--texte-doux); font-size: .95rem; }
.portee-carte__pere { margin: .2rem 0 0; color: var(--texte-doux); font-size: .95rem; }
.portee-carte__mot { margin: .85rem 0 0; padding-top: .85rem; border-top: 1px solid var(--vert-brume); align-self: stretch; }

@media (max-width: 1000px) {
    .portees-accueil__liste { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .portees-accueil__liste--1 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 680px) {
    .portees-accueil__liste, .portees-accueil__liste--2 { grid-template-columns: minmax(0, 1fr); }
    .portees-accueil__liste--2 .portee-carte__photos { aspect-ratio: 4 / 3; }
}

/* Une seule portée : la carte se couche, la photo à gauche, en grand. */
@media (min-width: 761px) {
    .portees-accueil__liste--1 .portee-carte { flex-direction: row; min-height: clamp(340px, 31vw, 440px); }
    .portees-accueil__liste--1 .portee-carte__photos { flex: 0 0 46%; aspect-ratio: auto; }
    .portees-accueil__liste--1 .portee-carte__corps { justify-content: center; padding: clamp(2rem, 4.2vw, 3.75rem); }
    .portees-accueil__liste--1 .portee-carte__date { font-size: .9rem; padding: .5rem .9rem; margin-bottom: 1.1rem; }
    .portees-accueil__liste--1 .portee-carte__nom { font-size: clamp(2rem, 3.3vw, 2.85rem); }
    .portees-accueil__liste--1 .portee-carte__infos { margin-top: .7rem; font-size: 1.08rem; }
    .portees-accueil__liste--1 .portee-carte__pere { font-size: 1.08rem; }
    .portees-accueil__liste--1 .portee-carte__mot { margin-top: 1.25rem; padding-top: 1.25rem; font-size: 1.08rem; }
}

/* ── Le pop-up ── */
/* Il grandit avec l'écran : à 720 px fixes, il paraissait minuscule sur un écran de 2560 px
   (Valentin, 10/11/2026). Largeur, photo, textes et bouton suivent la largeur de la fenêtre. */
.portee-pop {
    position: fixed; padding: 0; border: 0; overflow: hidden auto; /* un texte long se fait défiler, le bouton reste atteignable */
    width: min(calc(100vw - 2.5rem), clamp(760px, 50vw, 1120px)); max-height: calc(100vh - 2.5rem);
    background: #fff; color: var(--texte);
    border-radius: var(--rayon); box-shadow: var(--ombre);
    z-index: 120;
}
.portee-pop:focus { outline: none; }
.portee-pop[open] { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.portee-pop::backdrop { background: rgba(61, 37, 8, .55); }
/* Une portée sans aucune photo : une fenêtre étroite. (Pas le pop-up de plusieurs portées, qui a sa largeur plus bas.) */
.portee-pop:not(.portee-pop--plusieurs):not(:has(.portee-pop__photo))[open] { grid-template-columns: minmax(0, 1fr); width: min(calc(100vw - 2.5rem), clamp(460px, 32vw, 660px)); }

.portee-pop__photo { position: relative; min-height: min(clamp(380px, 27vw, 580px), calc(100vh - 2.5rem)); background: var(--vert-pale); }
.portee-pop__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.portee-pop__corps { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: clamp(2.5rem, 3.6vw, 4.5rem) clamp(2.25rem, 3.2vw, 4rem); }
.portee-pop__corps .surtitre { margin: 0 0 .75rem; font-size: clamp(.8rem, .7vw, .95rem); }
.portee-pop__titre { margin: 0; font: 400 clamp(1.9rem, 2.5vw, 3.1rem)/1.08 var(--titre); letter-spacing: -.015em; color: var(--brun); text-wrap: balance; }
.portee-pop__texte { margin: clamp(.9rem, 1vw, 1.25rem) 0 clamp(1.5rem, 1.8vw, 2.25rem); color: var(--texte-doux); font-size: clamp(1rem, 1vw, 1.25rem); }
.portee-pop .btn { font-size: clamp(1rem, .9vw, 1.15rem); padding: clamp(.95rem, 1vw, 1.2rem) clamp(1.5rem, 1.7vw, 2rem); }
.portee-pop__fermer {
    position: absolute; right: .75rem; top: .75rem; z-index: 1;
    display: grid; place-items: center; width: clamp(44px, 2.6vw, 54px); height: clamp(44px, 2.6vw, 54px); padding: 0;
    border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--brun);
    font: 400 clamp(1.7rem, 1.6vw, 2.1rem)/1 var(--corps); cursor: pointer;
}
.portee-pop__fermer:hover { background: var(--vert-pale); }

/* Plusieurs portées : un seul pop-up, une vignette par portée, un seul bouton. */
.portee-pop--plusieurs { width: min(calc(100vw - 2.5rem), clamp(820px, 58vw, 1280px)); overflow-y: auto; }
.portee-pop--plusieurs.portee-pop--2 { width: min(calc(100vw - 2.5rem), clamp(700px, 44vw, 980px)); }
.portee-pop--plusieurs[open] { grid-template-columns: minmax(0, 1fr); }
.portee-pop--plusieurs .portee-pop__titre { padding-right: 3.5rem; }
.portee-pop__liste {
    list-style: none; align-self: stretch; padding: 0;
    margin: clamp(1.4rem, 1.8vw, 2.25rem) 0;
    display: grid; gap: clamp(1rem, 1.3vw, 1.6rem);
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.portee-pop--2 .portee-pop__liste { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.portee-pop__item { display: flex; flex-direction: column; gap: .8rem; color: inherit; text-decoration: none; }
.portee-pop__vignette { display: block; aspect-ratio: 4 / 3; border-radius: var(--rayon-s); overflow: hidden; background: var(--vert-pale); }
.portee-pop__vignette img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.portee-pop__item:hover .portee-pop__vignette img { transform: scale(1.04); }
.portee-pop__item-texte { display: flex; flex-direction: column; gap: .25rem; }
.portee-pop__item-texte strong { font: 400 clamp(1.15rem, 1.25vw, 1.55rem)/1.2 var(--titre); color: var(--brun); }
.portee-pop__item:hover strong { color: var(--vert-texte); }
.portee-pop__item-texte span { color: var(--texte-doux); font-size: clamp(.9rem, .85vw, 1.05rem); line-height: 1.35; }

/* Sur téléphone : une carte en bas d'écran, sans voile. Le site reste lisible et utilisable
   derrière (Google pénalise les pop-ups qui couvrent la page à l'arrivée sur mobile). */
@media (max-width: 640px) {
    .portee-pop, .portee-pop--plusieurs, .portee-pop--plusieurs.portee-pop--2 {
        inset: auto .75rem .75rem .75rem; margin: 0;
        width: auto; max-width: none; max-height: 45vh;
        border-radius: var(--rayon-s);
        box-shadow: 0 -8px 40px -12px rgba(61, 37, 8, .5);
    }
    .portee-pop[open] { grid-template-columns: 92px minmax(0, 1fr); }
    .portee-pop:not(.portee-pop--plusieurs):not(:has(.portee-pop__photo))[open], .portee-pop--plusieurs[open] { grid-template-columns: minmax(0, 1fr); width: auto; }
    .portee-pop__photo { min-height: 0; }
    .portee-pop__corps { padding: .95rem 1rem; }
    .portee-pop__corps .surtitre { display: none; }
    .portee-pop__titre { font-size: 1.25rem; padding-right: 1.9rem; }
    .portee-pop__texte { margin: .3rem 0 .7rem; font-size: .85rem; line-height: 1.35; }
    .portee-pop .btn { padding: .6rem .95rem; font-size: .88rem; }
    .portee-pop__fermer { right: .1rem; top: .1rem; width: 44px; height: 44px; font-size: 1.7rem; background: transparent; }

    /* Plusieurs portées : deux lignes au plus, la vignette à gauche ; le bouton mène aux autres. */
    .portee-pop--plusieurs .portee-pop__titre { padding-right: 1.9rem; }
    .portee-pop__liste, .portee-pop--2 .portee-pop__liste { grid-template-columns: minmax(0, 1fr); gap: .45rem; margin: .6rem 0 .75rem; }
    .portee-pop__liste li:nth-child(n+3) { display: none; }
    .portee-pop__item { flex-direction: row; align-items: center; gap: .7rem; }
    .portee-pop__vignette { flex: 0 0 46px; aspect-ratio: 1; border-radius: 10px; }
    .portee-pop__item-texte { gap: .05rem; }
    .portee-pop__item-texte strong { font-size: 1rem; }
    .portee-pop__item-texte span { font-size: .8rem; }
}
