/* ==========================================================================
   Nantes Ortho - SEO Categories - Frontend CSS
   Toutes les classes scopees .nsc-* pour zero collision Elementor / themes.
   ========================================================================== */

/* ===== Conteneur global ===== */
.nsc-haut,
.nsc-blocs {
    box-sizing: border-box;
    max-width: var(--nsc-max-w, 1200px);
    margin: 0 auto;
    padding: var(--nsc-pad-v, 32px) var(--nsc-pad-h, 0);
    background: var(--nsc-cont-bg, transparent);
}
.nsc-haut *,
.nsc-blocs * {
    box-sizing: border-box;
}

/* ===== Texte haut ===== */
.nsc-haut__inner {
    max-width: var(--nsc-haut-maxw, 980px);
    background: var(--nsc-haut-bg, transparent);
    padding: var(--nsc-haut-pv, 24px) var(--nsc-haut-ph, 24px);
    border-radius: var(--nsc-haut-r, 0);
    color: var(--nsc-haut-c, #1A1A1A);
    font-size: var(--nsc-haut-s, 16px);
    line-height: var(--nsc-haut-lh, 1.7);
}
.nsc-haut--align-left .nsc-haut__inner  { margin-left: 0; margin-right: auto; text-align: left; }
.nsc-haut--align-center .nsc-haut__inner{ margin-left: auto; margin-right: auto; text-align: center; }

.nsc-haut__inner h1,
.nsc-haut__inner h2,
.nsc-haut__inner h3,
.nsc-haut__inner h4 {
    color: var(--nsc-haut-hc, #0F1419);
    margin: 1.2em 0 0.5em;
    line-height: 1.3;
}
.nsc-haut__inner h1:first-child,
.nsc-haut__inner h2:first-child,
.nsc-haut__inner h3:first-child { margin-top: 0; }
.nsc-haut__inner p { margin: 0 0 1em; }
.nsc-haut__inner p:last-child { margin-bottom: 0; }
.nsc-haut__inner a { color: var(--nsc-haut-lc, #B10000); text-decoration: underline; }
.nsc-haut__inner a:hover { text-decoration: none; }
.nsc-haut__inner ul, .nsc-haut__inner ol { margin: 0 0 1em 1.4em; padding: 0; }
.nsc-haut__inner img { max-width: 100%; height: auto; }

/* ===== Blocs bas (conteneur des blocs) ===== */
.nsc-blocs__inner {
    display: flex;
    flex-direction: column;
    gap: var(--nsc-spacing, 24px);
}

/* ===== Bloc individuel ===== */
.nsc-bloc {
    background: var(--nsc-bloc-bg, #FFFFFF);
    border: var(--nsc-bloc-bdw, 1px) solid var(--nsc-bloc-bdc, #ECECEF);
    border-radius: var(--nsc-bloc-r, 8px);
    padding: var(--nsc-bloc-pv, 24px) var(--nsc-bloc-ph, 24px);
    box-shadow: var(--nsc-bloc-sh, none);
    overflow: hidden;
}

/* Mode "stack" : image en haut, texte en bas */
.nsc-blocs--layout-stack .nsc-bloc {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.nsc-blocs--layout-stack .nsc-bloc__media {
    margin: calc(var(--nsc-bloc-pv, 24px) * -1) calc(var(--nsc-bloc-ph, 24px) * -1) 0;
}
.nsc-blocs--layout-stack .nsc-bloc__media img {
    width: 100%;
    height: auto;
    aspect-ratio: var(--nsc-bloc-ratio, 1 / 1);
    object-fit: cover;
    display: block;
    border-radius: 0;
}

/* Mode "side" : image a cote du texte */
.nsc-blocs--layout-side .nsc-bloc {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 24px;
}
.nsc-blocs--layout-side.nsc-blocs--imgpos-right .nsc-bloc { flex-direction: row-reverse; }
.nsc-blocs--layout-side .nsc-bloc__media {
    flex: 0 0 var(--nsc-bloc-imgw, 40%);
    max-width: var(--nsc-bloc-imgw, 40%);
}
.nsc-blocs--layout-side .nsc-bloc__media img {
    width: 100%;
    height: 100%;
    aspect-ratio: var(--nsc-bloc-ratio, 1 / 1);
    object-fit: cover;
    display: block;
    border-radius: var(--nsc-bloc-imgr, 8px);
}
.nsc-blocs--layout-side .nsc-bloc__body {
    flex: 1 1 auto;
    min-width: 0;
}

/* Sans image (juste titre + texte) */
.nsc-bloc:not(.nsc-bloc--has-image) .nsc-bloc__body { width: 100%; }

/* ===== Titre + texte bloc ===== */
.nsc-bloc__title {
    margin: 0 0 var(--nsc-titre-mb, 12px);
    color: var(--nsc-titre-c, #0F1419);
    font-size: var(--nsc-titre-s, 22px);
    font-weight: var(--nsc-titre-w, 700);
    line-height: 1.25;
    text-align: var(--nsc-titre-align, left);
}
.nsc-bloc__text {
    color: var(--nsc-texte-c, #3C4858);
    font-size: var(--nsc-texte-s, 15px);
    line-height: var(--nsc-texte-lh, 1.7);
    text-align: var(--nsc-texte-align, left);
}
.nsc-bloc__text > *:first-child { margin-top: 0; }
.nsc-bloc__text > *:last-child  { margin-bottom: 0; }
.nsc-bloc__text p { margin: 0 0 1em; }
.nsc-bloc__text p:last-child { margin-bottom: 0; }
.nsc-bloc__text a { color: var(--nsc-texte-lc, #B10000); text-decoration: underline; }
.nsc-bloc__text a:hover { text-decoration: none; }
.nsc-bloc__text ul,
.nsc-bloc__text ol { margin: 0 0 1em 1.4em; padding: 0; }
.nsc-bloc__text img { max-width: 100%; height: auto; }
.nsc-bloc__text h2,
.nsc-bloc__text h3,
.nsc-bloc__text h4 {
    color: var(--nsc-titre-c, #0F1419);
    margin: 1em 0 0.5em;
    line-height: 1.3;
}

/* ===== Responsive ===== */
@media (max-width: 760px) {
    .nsc-blocs--layout-side .nsc-bloc,
    .nsc-blocs--layout-side.nsc-blocs--imgpos-right .nsc-bloc {
        flex-direction: column;
        gap: 16px;
    }
    .nsc-blocs--layout-side .nsc-bloc__media {
        flex: 0 0 auto;
        max-width: 100%;
    }
    .nsc-bloc__title { font-size: calc(var(--nsc-titre-s, 22px) * 0.9); }
}
