#testModal {

}

/* ====================================================
    DEVELOPMENT X-Button (CLOSE-Button)

    Scrollbar bei großen Popup-Inhalten
==================================================== */

#testModal .modal-close
{
    position: absolute;

    top: -6px;
    right: 12px;

    z-index: 10;
}

.debug-modal-content {

    width: min(92vw,780px);

    margin: 40px auto;

    padding: 50px 12px 12px 12px;

    background: white;

    text-align: left;

    position: relative;

    border-radius: 8px;

/* ====================================================
    DEVELOPMENT

    Scrollbar bei großen Popup-Inhalten
==================================================== */
    
    max-height: 90vh;
    overflow-y: auto;    
    box-sizing: border-box;

}

.div_testJSON {             /* TEST div */

  /* Zwingt den Browser, \n im Text als echten Umbruch anzuzeigen */
  white-space: normal; 
  
  /* Falls Sie Flexbox nutzen, M�SSEN sich Elemente untereinander anordnen */
  display: flex;
  flex-direction: column; 
  align-items: flex-start;
  
  gap: 4px;
}

/* Verhindert, dass Bilder den Umbruch blockieren */
.div_testJSON img
{
    display: block;
    margin: 4px 0;
}

.debug-test-entry
{
    width: 720px;               /* img 255px */

    border: 2px solid var(--color-border);
    padding: var(--space-md);

    justify-content: flex-start;  /* linksbuendig! */
    text-align: center;
}

.debug-test-entry p
{
    margin: 4px 0;
    text-align: left;
}

.debug-test-entry img
{
    display: block;
    width: 255px;
    height: auto;

    margin-left: auto;
    margin-right: auto;
}

.debug-test-entry p,
.debug-test-entry .debug-static-test
{
    margin: 4px 0;
    text-align: left;
}

/* tests 260806 */
.debug-test-block
{
  display: block;
  resize: horizontal;
  max-width: 1000px;
  text-align: left;
  /* justify-content: flex-start;  linksbuendig! */
  line-height: 98%;  
  font-size: 12pt;
  
}

/* ====================================================
    DEBUG GALERIE GRID

    Aufgabe:
        Testbereich für spätere Galerie-Layouts.

    Grundprinzip:
        maximal 2 Hauptboxen nebeneinander
        Bild + Text bleiben innerhalb ihrer Box
        Mobile immer Bild oben / Text unten

    Formatklassen:
        landscape
        portrait

    Anordnung:
        image-left
        image-right
        stacked
==================================================== */

.debug-gallery-grid
{
    /* -----------------------------------------------
        TESTPARAMETER
    ----------------------------------------------- */

    --debug-landscape-min-width: 320px;
    --debug-landscape-max-width: 480px;

    --debug-portrait-min-width: 220px;
    --debug-portrait-max-width: 300px;
    --debug-portrait-max-height: 480px;

    --debug-text-min: 300px;
    --debug-text-portrait-min: 340px;

    --debug-box-gap: 12px;
    --debug-content-gap: 12px;

    --debug-box-padding: 24px;
    --debug-mobile-box-padding: 12px;

    /* -----------------------------------------------
        Mindestbreite einer Hauptbox

        Maßgebend ist die breitere Variante.
    ----------------------------------------------- */

    --debug-box-min-landscape:
        calc(
            var(--debug-landscape-min-width)
            + var(--debug-text-min)
            + var(--debug-content-gap)
            + (2 * var(--debug-box-padding))
        );

    --debug-box-min-portrait:
        calc(
            var(--debug-portrait-min-width)
            + var(--debug-text-portrait-min)
            + var(--debug-content-gap)
            + (2 * var(--debug-box-padding))
        );

    --debug-box-min-width:
        max(
            var(--debug-box-min-landscape),
            var(--debug-box-min-portrait)
        );


    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(
                min(
                    100%,
                    var(--debug-box-min-width)
                ),
                1fr
            )
        );

    gap:
        var(--debug-box-gap);

    width:
        calc(100% - 40px);

    max-width:
        1650px;

    margin:
        12px auto;
}


/* ====================================================
    HAUPTBOX

    Aufgabe:
        Gemeinsamer Rahmen für alle
        Galerie-Testvarianten.
==================================================== */

.debug-gallery-layout
{
    display: grid;

    width: 100%;
    min-width: 0;

    margin: 0;
    padding: var(--debug-box-padding);

    gap: var(--debug-content-gap);

    align-items: center;

    border: 1px solid var(--color-border);

    box-sizing: border-box;
}


/* ====================================================
    IMAGE LEFT

    HTML bleibt immer:
        Bild
        Text

    Desktop:
        Bild links
        Text rechts
==================================================== */

.debug-gallery-layout.image-left
{
    grid-template-columns:
        minmax(
            var(--debug-landscape-min-width),
            var(--debug-landscape-max-width)
        )
        minmax(
            var(--debug-text-min),
            1fr
        );
}

.debug-gallery-layout.image-left
.debug-gallery-image
{
    grid-column: 1;
    grid-row: 1;
}

.debug-gallery-layout.image-left
.debug-gallery-text
{
    grid-column: 2;
    grid-row: 1;
}


/* ====================================================
    IMAGE RIGHT

    HTML bleibt immer:
        Bild
        Text

    Desktop:
        Text links
        Bild rechts
==================================================== */

.debug-gallery-layout.image-right
{
    grid-template-columns:
        minmax(
            var(--debug-text-min),
            1fr
        )
        minmax(
            var(--debug-landscape-min-width),
            var(--debug-landscape-max-width)
        );
}

.debug-gallery-layout.image-right
.debug-gallery-image
{
    grid-column: 2;
    grid-row: 1;
}

.debug-gallery-layout.image-right
.debug-gallery-text
{
    grid-column: 1;
    grid-row: 1;
}


/* ====================================================
    PORTRAIT LEFT / RIGHT

    Aufgabe:
        Portrait benötigt weniger Bildbreite.
        Der Text erhält entsprechend mehr Raum.

    Verhältnis:
        Bild 38%
        Text 62%

    Mindestbreiten verhindern zu schmale Spalten.
==================================================== */

.debug-gallery-layout.image-left:has(.debug-gallery-image.portrait)
{
    grid-template-columns:
        minmax(
            var(--debug-portrait-min-width),
            38fr
        )
        minmax(
            var(--debug-text-portrait-min),
            62fr
        );
}

.debug-gallery-layout.image-right:has(.debug-gallery-image.portrait)
{
    grid-template-columns:
        minmax(
            var(--debug-text-portrait-min),
            62fr
        )
        minmax(
            var(--debug-portrait-min-width),
            38fr
        );
}


/* ====================================================
    STACKED

    HTML:
        Bild
        Text

    Desktop + Mobil:
        Bild oben
        Text unten
==================================================== */

.debug-gallery-layout.stacked
{
    grid-template-columns:
        minmax(0, 1fr);
}

.debug-gallery-layout.stacked
.debug-gallery-image
{
    grid-column: 1;
    grid-row: 1;
}

.debug-gallery-layout.stacked
.debug-gallery-text
{
    grid-column: 1;
    grid-row: 2;
}


/* ====================================================
    BILDBEREICH

    Allgemeine Eigenschaften
==================================================== */

.debug-gallery-image
{
    min-width: 0;

    justify-self: center;
    align-self: center;

    padding: 8px;

    border: 1px solid var(--color-border);

    box-sizing: border-box;
}


/* ====================================================
    LANDSCAPE

    Steuerung:
        Breite MIN / MAX
        Höhe automatisch
==================================================== */

.debug-gallery-image.landscape
{
    width: 100%;

    min-width:
        var(--debug-landscape-min-width);

    max-width:
        var(--debug-landscape-max-width);
}

.debug-gallery-image.landscape img
{
    display: block;

    width: 100%;
    height: auto;

    margin: 0;
}


/* ====================================================
    PORTRAIT

    Steuerung:
        Breite MIN / MAX
        Höhe nur als Obergrenze
==================================================== */

.debug-gallery-image.portrait
{
    width: 100%;

    min-width:
        var(--debug-portrait-min-width);

    max-width:
        var(--debug-portrait-max-width);

    justify-self: center;
    align-self: center;
}

.debug-gallery-image.portrait img
{
    display: block;

    width: 100%;
    height: auto;

    max-height:
        var(--debug-portrait-max-height);

    object-fit: contain;

    margin: 0 auto;
}


/* ====================================================
    TEXTBEREICH

    Aufgabe:
        Text bleibt lesbar und darf den
        verfügbaren Restplatz nutzen.
==================================================== */

.debug-gallery-text
{
    min-width: 0;
    width: 100%;

    display: flex;
    flex-direction: column;

    justify-content: center;

    padding: 16px;

    border: 1px solid var(--color-border);

    box-sizing: border-box;
}


/* ====================================================
    MOBILE

    Aufgabe:
        Alle Desktop-Sonderregeln werden
        vollständig aufgehoben.

    Reihenfolge:
        Bild
        Text

    Breite:
        Hauptbox = 100%
        Bildbox   = 100%
        Textbox   = 100%

    Ergebnis:
        Landscape und Portrait besitzen
        identische Containerbreiten.
==================================================== */

@media (max-width: 700px)
{
    .debug-gallery-grid
    {
        grid-template-columns:
            minmax(0, 1fr);

        width:
            calc(100% - 24px);

        margin-left: auto;
        margin-right: auto;
    }


    .debug-gallery-layout.image-left,
    .debug-gallery-layout.image-right,
    .debug-gallery-layout.stacked,
    .debug-gallery-layout.image-left:has(.debug-gallery-image.portrait),
    .debug-gallery-layout.image-right:has(.debug-gallery-image.portrait)
    {
        grid-template-columns:
            minmax(0, 1fr);

        width: 100%;
        min-width: 0;

        padding:
            var(--debug-mobile-box-padding);
    }


    /* -----------------------------------------------
        Bild immer zuerst
    ----------------------------------------------- */

    .debug-gallery-layout.image-left
    .debug-gallery-image,

    .debug-gallery-layout.image-right
    .debug-gallery-image,

    .debug-gallery-layout.stacked
    .debug-gallery-image
    {
        grid-column: 1;
        grid-row: 1;
    }


    /* -----------------------------------------------
        Text immer danach
    ----------------------------------------------- */

    .debug-gallery-layout.image-left
    .debug-gallery-text,

    .debug-gallery-layout.image-right
    .debug-gallery-text,

    .debug-gallery-layout.stacked
    .debug-gallery-text
    {
        grid-column: 1;
        grid-row: 2;
    }


    /* -----------------------------------------------
        Bildcontainer

        Landscape und Portrait bekommen
        exakt dieselbe Außenbreite.
    ----------------------------------------------- */

    .debug-gallery-image,
    .debug-gallery-image.landscape,
    .debug-gallery-image.portrait
    {
        width: 100%;
        min-width: 0;
        max-width: none;

        height: auto;
        max-height: none;

        justify-self: stretch;

        box-sizing: border-box;
    }


    /* -----------------------------------------------
        Landscape-Bild
    ----------------------------------------------- */

    .debug-gallery-image.landscape img
    {
        display: block;

        width: 100%;
        max-width: 100%;
        height: auto;

        margin: 0;
    }


    /* -----------------------------------------------
        Portrait-Bild

        Der Container ist 100% breit.
        Das Portrait selbst bleibt proportional
        und wird darin zentriert.
    ----------------------------------------------- */

    .debug-gallery-image.portrait img
    {
        display: block;

        width: auto;
        max-width: 100%;
        height: auto;
        max-height: 70vh;

        margin-left: auto;
        margin-right: auto;
    }


    /* -----------------------------------------------
        Textcontainer
    ----------------------------------------------- */

    .debug-gallery-text
    {
        width: 100%;
        min-width: 0;
        max-width: none;
    }
}
