/*
 * NC Moments — responsive rules.
 *
 * All @media queries, grouped by breakpoint (mobile-first: base styles are in
 * style.css).
 * Load AFTER style.css.
 */

/* ---------- Body text size + centred introductions and CTA bands ---------- */
@media (min-width: 768px) {
    :root {
        --text-size: 1.0625rem;
    }

    .nc-head--center,
    .nc-cta__inner {
        --intro-h: 94%;
        --intro-p: 94%;
    }

    /* Quote form « Ce numéro est joignable par »: three equal cards in one row */
    .nc-choice.nc-choice--compact {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    :root {
        --text-size: 1.2rem;
    }

    .nc-head--center,
    .nc-cta__inner {
        --intro-h: 1150px;
        --intro-p: 1100px;
    }
}

/* ---------- ≥ 640px ---------- */
@media (min-width: 640px) {
    .nc-contact-choice {
        grid-template-columns: 1fr 1fr;
    }

    .nc-logos {
        grid-template-columns: repeat(3, 1fr);
    }

    .nc-insta__grid {
        gap: 0.25rem;
    }

    .nc-team {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---------- ≥ 720px ---------- */
@media (min-width: 720px) {
    .nc-form__grid {
        grid-template-columns: 1fr 1fr;
    }

    .nc-field--full {
        grid-column: 1 / -1;
    }

    /* Form buttons side by side: « Effacer le formulaire », then the submit button. */
    .nc-form__actions {
        flex-direction: row;
        align-items: center;
    }

    .nc-form__actions .nc-btn {
        width: auto;
    }

    /* Quote form, « Autre célébration » selected: its « Précisez » field takes the right half
       of row 1, so the budget pairs with the place (row 3) instead of a full-width row. */
    .nc-form__grid:has(> [data-show-when="categorie:autre"]:not([hidden])) > .nc-field:has(> #f-budget) {
        grid-column: auto;
    }

    .nc-dl--grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        column-gap: 2.5rem;
        border-top: 0;
    }

    .nc-dl--grid div {
        border-top: 1px solid var(--line);
        border-bottom: 0;
    }

    .nc-dl--grid {
        border-bottom: 1px solid var(--line);
    }

    .nc-choice {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ---------- ≥ 760px ---------- */
@media (min-width: 760px) {
    .nc-footer__grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ---------- Homepage events mosaic, tablet (768–899px): Mariages and Dîners across both
   columns, Anniversaires | Événements corporate side by side (≥ 900px: desktop mosaic below) ---------- */
@media (min-width: 768px) {
    .nc-mosaic {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nc-mosaic__item:nth-child(1),
    .nc-mosaic__item:nth-child(4) {
        grid-column: 1 / -1;
    }
}

/* ---------- ≥ 900px ---------- */
@media (min-width: 900px) {
    .nc-services {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }

    /* Home service cards: images, titles, texts and buttons on the same lines. */
    @supports (grid-template-rows: subgrid) {
        .nc-services--aligned {
            row-gap: 0;
        }

        .nc-services--aligned .nc-service {
            display: grid;
            grid-template-rows: subgrid;
            grid-row: span 6;
        }
    }

    .nc-mosaic {
        grid-template-columns: repeat(12, 1fr);
        grid-auto-rows: 260px;
    }

    .nc-mosaic__item:nth-child(1) {
        grid-column: 1 / 8;
        grid-row: span 2;
    }

    .nc-mosaic__item:nth-child(2) {
        grid-column: 8 / 13;
    }

    .nc-mosaic__item:nth-child(3) {
        grid-column: 8 / 13;
    }

    .nc-mosaic__item:nth-child(4) {
        grid-column: 1 / 13;
    }

    .nc-mosaic__cap {
        padding: 2rem;
    }

    .nc-gallery {
        columns: 3;
    }

    .nc-row {
        grid-template-columns: 80px 1fr 1.3fr;
        gap: 2.5rem;
        align-items: baseline;
    }
}

/* ---------- ≥ 960px ---------- */
@media (min-width: 960px) {
    .nc-logos {
        grid-template-columns: repeat(5, 1fr);
    }

    .nc-logos li {
        min-height: 130px;
    }
}

/* ---------- ≥ 1000px ---------- */
@media (min-width: 1000px) {
    .nc-team {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---------- Header: desktop navigation from 1080px ---------- */
@media (min-width: 1080px) {
    .nc-insta__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .nc-insta__grid--odd > li:first-child {
        grid-column: auto;
    }

    .nc-nav,
    .nc-header__cta {
        display: inline-flex;
    }

    .nc-burger {
        display: none;
    }

    .nc-footer__grid {
        grid-template-columns: 1.6fr 1fr 1fr 1fr;
    }

    .nc-events .nc-head h2 br {
        display: inline;
    }
}

/* Narrow desktops: tighter spacing so the menu never wraps or collides. */
@media (min-width: 1080px) and (max-width: 1279px) {
    .nc-header__inner {
        gap: 1.25rem;
    }

    .nc-header__logo img {
        height: 50px;
    }

    .nc-nav {
        gap: 1.3rem;
    }

    .nc-nav__link,
    .nc-nav__menu a {
        letter-spacing: -0.02em;
        font-size: 14px;
    }

    .nc-header__cta {
        padding: 0 1.25rem;
        letter-spacing: -0.02em;
    }
}

@media (max-width: 1079px) {
    :root {
        --header-h: 76px;
    }

    .nc-header__logo img {
        height: 48px;
    }
}

@media (max-width: 479px) {
    .nc-filters {
        --filter-img: 44px;
    }

    .nc-filter {
        gap: .75rem;
        padding: .85rem 1rem;
        font-size: .9rem;
    }

    :root {
        --header-h: 68px;
    }

    .nc-header__logo img {
        height: 42px;
    }

    .nc-hero__actions .nc-btn {
        width: 100%;
    }

    /* Form submission dialogs (SweetAlert2): full-width button on small phones */
    .swal2-popup.nc-swal {
        padding: 1.6rem 1.25rem 1.25rem;
    }

    .swal2-popup.nc-swal .nc-swal__button {
        width: 100%;
    }
}

@media (max-width: 359px) {
    .nc-hero__actions .nc-btn {
        padding: 0 1rem;
        letter-spacing: -0.02em;
        white-space: nowrap;
    }
}

/* ---------- Home hero: sizes and photo framing ---------- */
@media (min-width: 640px) {
    .nc-hero__bg {
        background-image: var(--hero-md);
    }
}

@media (min-width: 768px) {
    .nc-hero {
        min-height: 640px;
    }

    .nc-hero::before {
        background: linear-gradient(90deg, oklch(0 0 0 / 76%) 0%, oklch(0 0 0 / 55%) 38%, oklch(0 0 0 / 18%) 72%, oklch(0 0 0 / 8%) 100%);
    }

    .nc-hero__bg--1 {
        background-position: 58% 32%;
    }

    .nc-hero__bg--2 {
        background-position: 14% 50%;
    }

    .nc-banner {
        min-height: 220px;
    }
}

/* Desktop: the photo is slightly enlarged and anchored left so the couple
   sits to the right of the text column. */
@media (min-width: 1080px) {
    .nc-hero {
        min-height: clamp(640px, calc(100svh - var(--header-h)), 750px);
    }

    .nc-hero__bg--1 {
        background-size: 122% auto;
        background-position: 0% 30%;
    }

    .nc-hero__bg--2 {
        background-position: 50% 58%;
    }

    .nc-banner {
        min-height: 400px;
    }

    .nc-hero__text {
        max-width: 38rem;
    }

    /* Exactly two lines on desktop: "Nous créons vos" / "meilleurs souvenirs." */
    .nc-hero h1 {
        white-space: nowrap;
        width: max-content;
        max-width: calc(100vw - 2 * var(--gutter));
    }
}

@media (min-width: 1280px), (min-width: 768px) and (min-resolution: 2dppx) {
    .nc-hero__bg {
        background-image: var(--hero-lg);
    }
}

/* ---------- Realization detail page: photo mosaic, videos, external links ---------- */
@media (min-width: 360px) {
    .nc-album {
        --album-cols: 2;
    }
}

@media (min-width: 600px) {
    /* 2–3 photos side by side, 1–2 videos side by side (equal height, exact proportions) */
    .nc-album--row {
        --row-h: min(80vh, 760px);
        flex-direction: row;
        justify-content: center;
        max-width: min(100%, calc(var(--row-h) * var(--sum-r) + var(--album-gap) * (var(--n) - 1)));
    }

    .nc-album--n1 {
        --row-h: min(85vh, 860px);
    }

    .nc-album--n3 {
        --row-h: min(72vh, 640px);
    }

    /* ×100: flex-grow factors summing to less than 1 would leave part of the row empty
       (a single portrait item, ratio 0.56, would get only 56 % of its width). */
    .nc-album--row .nc-album__item {
        flex: calc(var(--r) * 100) 1 0;
    }
}

@media (min-width: 768px) {
    .nc-album {
        --album-gap: 5px;
    }

    .nc-container--media {
        padding-inline: 22px;
    }

    /* Video cards: 2 columns; a single video takes half the width, centred. */
    .nc-vgrid {
        --vgrid-gap: 14px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nc-vgrid--n1 {
        grid-template-columns: minmax(0, 1fr);
        width: calc((100% - var(--vgrid-gap)) / 2);
        margin-inline: auto;
    }

    .nc-extlinks {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .nc-album {
        --album-cols: 3;
        --album-gap: 5px;
    }

    .nc-container--media {
        padding-inline: 36px;
    }

    .nc-extlinks {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Very wide screens: a fourth mosaic column keeps the photos at a comfortable size. */
@media (min-width: 1800px) {
    .nc-album {
        --album-cols: 4;
    }
}

/* Video cards: 3 columns on desktop (2 videos: two halves; 1: half, centred). */
@media (min-width: 1200px) {
    .nc-vgrid {
        --vgrid-gap: 16px;
    }

    .nc-vgrid--n3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ---------- Quote page process timeline (style.css) ---------- */
/* Tablet: two centred columns; each row joined by a horizontal line (no line between rows). */
@media (min-width: 640px) {
    .nc-process {
        --badge: 120px;
        --icon: 38px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: var(--gap);
        row-gap: 3.5rem;
    }

    .nc-process__step {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .nc-process__num {
        font-size: 1.35rem;
    }

    .nc-process__body {
        padding-top: 0;
        margin-top: 1.5rem;
    }

    .nc-process__text {
        max-width: 32ch;
        margin-inline: auto;
    }

    .nc-process__step:not(:last-child)::before {
        left: 50%;
        top: calc(var(--badge) / 2);
        width: calc(100% + var(--gap));
        height: 1px;
    }

    .nc-process__step:not(:last-child)::after {
        left: calc(100% + var(--gap) / 2 - 3px);
        top: calc(var(--badge) / 2 - 3px);
    }

    .nc-process__step:nth-child(2n)::before,
    .nc-process__step:nth-child(2n)::after {
        display: none;
    }

    /* Odd number of steps (Décoration: 5): the last one alone, centred on its row. */
    .nc-process__step:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }
}

/* Desktop: every step on one row, one continuous line through the circles. */
@media (min-width: 1024px) {
    .nc-process {
        --badge: 120px;
        --icon: 46px;
        --gap: 2.5rem;
        grid-template-columns: repeat(var(--n), minmax(0, 1fr));
    }

    .nc-process__num {
        font-size: 1.6rem;
    }

    .nc-process__step:nth-child(2n):not(:last-child)::before,
    .nc-process__step:nth-child(2n):not(:last-child)::after {
        display: block;
    }

    .nc-process__step:last-child:nth-child(odd) {
        grid-column: auto;
    }
}

/* Five steps need more room: they keep the two-column layout (last one centred) up to
   1199px and go on one row from 1200px. */
@media (min-width: 1024px) and (max-width: 1199.98px) {
    .nc-process--n5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: 3.5rem;
    }

    .nc-process--n5 .nc-process__step:nth-child(2n):not(:last-child)::before,
    .nc-process--n5 .nc-process__step:nth-child(2n):not(:last-child)::after {
        display: none;
    }

    .nc-process--n5 .nc-process__step:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }
}

/* ---------- Image | text sections (.nc-split, every page): one column — image, then text,
   both full width — up to 998px; two columns from 999px, each section in its own order ---------- */
@media (min-width: 999px) {
    .nc-split {
        grid-template-columns: 1fr 1fr;
    }

    .nc-split__media {
        order: 0;
    }

    .nc-split--reverse .nc-split__media {
        order: 2;
    }

    .nc-split--60 {
        grid-template-columns: 1.2fr 1fr;
    }

    /* Notre histoire introduction: portrait photo 42% | text 58% */
    .nc-split--portrait {
        grid-template-columns: minmax(0, 42fr) minmax(0, 58fr);
        gap: clamp(2.5rem, 4.5vw, 3.75rem);
    }

    .nc-split--portrait .nc-split__media img {
        max-height: none;
    }
}

/* ---------- Notre histoire values: 2 cards per row on tablet, one row on large screens ---------- */
@media (min-width: 640px) {
    .nc-values {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1100px) {
    .nc-values {
        grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
    }
}

/* ---------- Photo grid (Conciergerie): 2 photos per row on tablet, 3 from 1024px ---------- */
@media (min-width: 640px) {
    .nc-photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .nc-photo-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ---------- Planning formulas: 2 cards per row from 640px, 3 from 1024px ---------- */
@media (min-width: 640px) {
    .nc-formulas {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .nc-formulas {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
