/* RESET ol, ul, li,  */
html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6,
p, blockquote, pre, a, abbr, address, cite, code, del, dfn, em,
img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, hr,
dl, dt, dd, fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, figure, figcaption, hgroup,
menu, nav, summary, time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
}
article, aside, canvas, figure, figcaption, hgroup,
footer, header, nav, section, audio, video { display: block; }
a img { border: 0; }



/* =========================================
   WICHTIG: Box-Sizing Fix
   Ohne das hier bricht jedes Grid layout!
   ========================================= */
*, *::before, *::after {
    box-sizing: border-box;
}

/* =========================================
   GRID BASIS
   ========================================= */
.row {
    display: flex;
    flex-wrap: var(--wrap, wrap);
    margin-right: 0; /* Standard Gutter Ausgleich */
    margin-left: 0;
}

.col {
    position: relative;
    width: 100%; /* Standard: Volle Breite */
    padding-right: 0; /* Standard Gutter */
    padding-left: 0;
}

/* =========================================
   BASIS KLASSEN (Immer aktiv / Mobile)
   ========================================= */
.col-1  { flex: 0 0 8.333333%; max-width: 8.333333%; }
.col-2  { flex: 0 0 16.666667%; max-width: 16.666667%; }
.col-3  { flex: 0 0 25%; max-width: 25%; }
.col-4  { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-5  { flex: 0 0 41.666667%; max-width: 41.666667%; }
.col-6  { flex: 0 0 50%; max-width: 50%; }
.col-7  { flex: 0 0 58.333333%; max-width: 58.333333%; }
.col-8  { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-9  { flex: 0 0 75%; max-width: 75%; }
.col-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
.col-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

/* Basis (Immer aktiv / Mobile) */
.col-auto {
    flex: 0 0 auto;
    width: auto;
    max-width: 100%;
}

/* Mobile: Jedes Element steht sauber untereinander */
.col-flex {
    flex: 0 0 100%;
    max-width: 100%;
}

/* Ab Desktop: Perfekte Aufteilung (1 = 100%, 2 = 50%, 3 = 33%) */
@media (min-width: 992px) {
    .col-flex {
        flex: 1 1 calc(33.333333% - var(--sp-3, 1rem));
        max-width: 100%;
    }
}

.ml-auto { margin-left: auto !important; }
.mr-auto { margin-right: auto !important; }

/* =========================================
   BREAKPOINTS (Harte Prozentwerte)
   ========================================= */

/* SM: >= 576px */
@media (min-width: 576px) {
    .col-sm-1  { flex: 0 0 8.333333%; max-width: 8.333333%; }
    .col-sm-2  { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-sm-3  { flex: 0 0 25%; max-width: 25%; }
    .col-sm-4  { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-sm-5  { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-sm-6  { flex: 0 0 50%; max-width: 50%; }
    .col-sm-12 { flex: 0 0 100%; max-width: 100%; }
    .col-sm-auto { flex: 0 0 auto; width: auto; max-width: 100%; }
}

/* MD: >= 768px */
@media (min-width: 768px) {
    .col-md-1  { flex: 0 0 8.333333%; max-width: 8.333333%; }
    .col-md-2  { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-md-3  { flex: 0 0 25%; max-width: 25%; }
    .col-md-4  { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-md-5  { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-md-6  { flex: 0 0 50%; max-width: 50%; }
    .col-md-8  { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-md-12 { flex: 0 0 100%; max-width: 100%; }
    .col-md-auto { flex: 0 0 auto; width: auto; max-width: 100%; }
}

/* LG: >= 992px */
@media (min-width: 992px) {
    .col-lg-1  { flex: 0 0 8.333333%; max-width: 8.333333%; }
    .col-lg-2  { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-lg-3  { flex: 0 0 25%; max-width: 25%; }
    .col-lg-4  { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-lg-5  { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-lg-6  { flex: 0 0 50%; max-width: 50%; }
    .col-lg-7  { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .col-lg-12 { flex: 0 0 100%; max-width: 100%; }
    .col-lg-auto { flex: 0 0 auto; width: auto; max-width: 100%; }
}

/* XL: >= 1200px */
@media (min-width: 1200px) {
    .col-xl-1  { flex: 0 0 8.333333%; max-width: 8.333333%; }
    .col-xl-3  { flex: 0 0 25%; max-width: 25%; }
    .col-xl-4  { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-xl-6  { flex: 0 0 50%; max-width: 50%; }
    .col-xl-12 { flex: 0 0 100%; max-width: 100%; }
    .col-xl-auto { flex: 0 0 auto; width: auto; max-width: 100%; }
}

/* XXL: >= 1600px */
@media (min-width: 1600px) {
    .col-xxl-1  { flex: 0 0 8.333333%; max-width: 8.333333%; }
    .col-xxl-3  { flex: 0 0 25%; max-width: 25%; }
    .col-xxl-4  { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-xxl-12 { flex: 0 0 100%; max-width: 100%; }
    .col-xxl-auto { flex: 0 0 auto; width: auto; max-width: 100%; }
}


/* ============================================================
    BOOTSTRAP-COMPATIBLE UTILITIES FOR NINA-GRID
   ============================================================ */

:root {
    --sp-0: 0;
    --sp-1: .25rem;
    --sp-2: .5rem;
    --sp-3: 1rem;
    --sp-4: 1.5rem;
    --sp-5: 3rem;
}

/* ============================================================
    GAPS UNTERSTÜTZUNG (Bleibt für Standard-Flex-Reihen aktiv)
   ============================================================ */
.g-0 { gap: var(--sp-0) !important; }
.g-1 { gap: var(--sp-1) !important; }
.g-2 { gap: var(--sp-2) !important; }
.g-3 { gap: var(--sp-3) !important; }
.g-4 { gap: var(--sp-4) !important; }
.g-5 { gap: var(--sp-5) !important; }

.gx-0 { column-gap: var(--sp-0) !important; }
.gx-1 { column-gap: var(--sp-1) !important; }
.gx-2 { column-gap: var(--sp-2) !important; }
.gx-3 { column-gap: var(--sp-3) !important; }
.gx-4 { column-gap: var(--sp-4) !important; }
.gx-5 { column-gap: var(--sp-5) !important; }

.gy-0 { row-gap: var(--sp-0) !important; }
.gy-1 { row-gap: var(--sp-1) !important; }
.gy-2 { row-gap: var(--sp-2) !important; }
.gy-3 { row-gap: var(--sp-3) !important; }
.gy-4 { row-gap: var(--sp-4) !important; }
.gy-5 { row-gap: var(--sp-5) !important; }

/* ============================================================
    TEXT ALIGN, DISPLAY & FLEX ALIGNMENT
   ============================================================ */
.text-start  { text-align: left !important; }
.text-center { text-align: center !important; }
.text-end    { text-align: right !important; }

.d-block        { display: block !important; }
.d-inline       { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex         { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-none         { display: none !important; }

.justify-start   { justify-content: flex-start !important; }
.justify-center  { justify-content: center !important; }
.justify-end     { justify-content: flex-end !important; }
.justify-between { justify-content: space-between !important; }

.align-start   { align-items: flex-start !important; }
.align-center  { align-items: center !important; }
.align-end     { align-items: flex-end !important; }

.align-self-start  { align-self: flex-start !important; }
.align-self-center { align-self: center !important; }
.align-self-end    { align-self: flex-end !important; }

.float-start { float: left !important; }
.float-end   { float: right !important; }
.float-none  { float: none !important; }

.clearfix::after {
    content: "";
    display: block;
    clear: both;
}

/* ============================================================
    ANZEIGEN / VERBERGEN Breakpoints
   ============================================================ */
.showmob  { display: block; }
.showtab  { display: none; }
.showport { display: none; }
.showdesk { display: none; }

#refgallerie {
  line-height: 0;   
  column-count: 1;
  column-gap: 0px;  
}
#refgallerie img { border: 4px solid transparent; }

@media (min-width: 576px) {
    .showmob  { display: block; }
    .showtab  { display: none; }
    .showport { display: none; }
    .showdesk { display: none; }
    .showanymob { display: block; }
}

@media (min-width: 768px) {
    .showmob  { display: block; }
    .showtab  { display: block; }
    .showport { display: none; }
    .showdesk { display: none; }
    #refgallerie { column-count: 2; }
}

@media (min-width: 992px) {
    .showmob  { display: none; }
    .showtab  { display: block; }
    .showport { display: block; }
    .showdesk { display: none; }
}

@media (min-width: 1200px) {
    .showmob  { display: none; }
    .showtab  { display: none; }
    .showport { display: block; }
    .showdesk { display: block; }
    .showanymob { display: none; }
    #refgallerie { column-count: 3; }
}

@media (min-width: 1600px) {
    .showmob  { display: none; }
    .showtab  { display: none; }
    .showport { display: block; }
    .showdesk { display: block; }
}


/* ============================================================
    DIE ZUKUNFTSSICHERE GEHEIMWAFFE: INNER PAD-LOGIK (OHNE CALC)
   ============================================================ */

/* Das schützende innere Box-Element umschließt den Inhalt sauber */
.grid-inner {
    width: 100% !important;
    height: 100% !important;
    box-sizing: border-box !important;
}

/* 
   Falls Reihen explizit auf dieses unzerstörbare 
   Padding-System setzen sollen (wie deine nina-main-row)
*/
.row.use-inner-padding {
    gap: 0 !important; /* Deaktiviert Flex-Gaps vollständig */
}

/* Automatische Lückensteuerung über Padding ab Desktop-Breakpoint */
@media (min-width: 992px) {
    /* Beispiel: Zwei Spalten in einer use-inner-padding Reihe */
    .row.use-inner-padding > .col-lg-5 .grid-inner {
        padding-right: 32px !important;
    }
    .row.use-inner-padding > .col-lg-7 .grid-inner {
        padding-left: 32px !important;
    }
}

/* Ein echtes CSS-Grid bei dem alle Spalten automatisch gleich groß sind */
.grid-auto {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(var(--miw, 250px), 1fr));
    gap: var(--grid-gap, var(--sp-3, 1rem));
}