:root {
    /* light theme */
    /*
    color-scheme: light;
    --invert: 7%;
    */
    /* dark theme  */
    color-scheme: dark;
    --invert: 80%;


    --hue-accent: 200;

    --primary-color: light-dark(oklch(0% 0% var(--hue-accent)),
            oklch(95% 0% var(--hue-accent)));

    --primary-color-mute: light-dark(oklch(45% 0% var(--hue-accent)),
            oklch(70% 0% var(--hue-accent)));


    --primary-background: light-dark(oklch(92% 0% var(--hue-accent)),
            oklch(25% 0% var(--hue-accent)));


    --bg-face: light-dark(oklch(95% 0% var(--hue-accent)),
            oklch(32% 0% var(--hue-accent)));

    --bg-zebra: light-dark(oklch(98% 0% var(--hue-accent)),
            oklch(27% 0% var(--hue-accent)));


    --border: 1px solid light-dark(oklch(85% 0% var(--hue-accent)),
            oklch(37% 0% var(--hue-accent)));


    --accent: light-dark(oklch(60% 90% var(--hue-accent)),
            oklch(55% 90% var(--hue-accent)));

    --accent-semi: light-dark(oklch(from var(--accent) 85% 20% h),
            oklch(from var(--accent) 45% 20% h));

    --gap: 10px;
}

* {
    box-sizing: border-box;
    transition: color 0.5s, background-color 0.5s, filter 0.5s;
}


.HEADSCREENSHOT img {
    filter: invert(var(--invert));
}

body {
    max-width: 1400px;
    margin: auto;
    font-size: 16px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 1rem;
    color: var(--primary-color-mute);
    background-color: var(--primary-background);
}

a {
    color: var(--accent);
}

.COMMENT,
.HEADINFOTEXT tr,
.HEADSCREENSHOT,
.CONTENT {
    background-color: var(--bg-face);
    border-radius: 10px;
    border: var(--border);
}

.COMMENT {
    border-color: var(--accent);
}

.HEADER {
    display: grid;
    grid-template-columns: .4fr 1fr;
    grid-template-areas:
        "a a"
        "b c"
        "d c";
    gap: var(--gap);
}

.LOGO {
    grid-area: a;
}

.HEADINFOTEXT {
    grid-area: c;
}

.HEADSCREENSHOT {
    grid-area: b;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    place-items: center;
}

.HEADSCREENSHOT:not(:has(img)) {
    display: none;
}

.HEADSCREENSHOT:has(div)>img {
    display: none;
}

.HEADSCREENSHOT:not(:has(img))~.HEADINFOTEXT {
    grid-area: 2 / span 2;
}

.COMMENT {
    grid-area: d;
    border-radius: 8px;
}

.LOGO {
    justify-self: end;
}

.LOGO img {
    max-height: 40px;
}

.HEADINFOTEXT {
    font-size: 14px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--gap);
}

.HEADINFOTEXT_TABLE,
.HEADINFOTEXT_TABLE tbody {
    display: contents;
}

.HEADINFOTEXT_TABLE tr {
    border-radius: 8px;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    overflow: hidden;
}


.HEADINFOTEXT_TABLE tr td {
    padding: 5px;

}


/* Hide completely empty rows (modern browsers supporting :has()) */
.HEADINFOTEXT_TABLE tbody tr:not(:has(td:not(:empty))) {
    display: none;
}

.HEADSCREENSHOT img {
    max-width: 100%;
}

.COMMENT {
    padding: .5rem .5rem;
}

.COMMENT_NAME {
    display: none;
}

.COMMENT p {
    margin: 0;
}

.CONTENT {
    margin-block: 16px;
    font-family: monospace;
    font-size: 16px;
    border-radius: 8px;
    overflow: hidden;
}

caption {
    font-size: 16px;
    font-weight: bold;
    color: var(--primary-color);
    line-height: 2;
    border-bottom: var(--border);
}

:nth-child(1 of .CONTENT) caption:after {
    content: "OPERATIONS";
}

:nth-last-child(1 of .CONTENT) caption:after {
    content: "TOOLS";
}

.CONTENT_TABLE {
    width: 100%;
    border-collapse: collapse;
}

.td_100 img {
    max-width: 32px;
}

.HEADER td:not(:last-child),
.CONTENT th:not(:last-child),
.CONTENT td:not(:last-child) {
    border-right: var(--border);
}

.CONTENT tbody tr:nth-child(odd) {
    background-color: var(--bg-zebra);
}

.HEADER tr:hover,
.CONTENT_TABLE tbody tr:hover {
    background-color: var(--accent-semi);
    color: var(--primary-color);
}

.HEADER td:first-child,
.CONTENT tfoot {
    color: var(--primary-color);
}

.CONTENT thead,
.CONTENT tfoot {
    color: var(--accent);
}

.CONTENT_TABLE tfoot td,
.CONTENT_TABLE thead th {
    text-transform: uppercase;
    padding-block: 12px;
    font-size: 14px;
}

tfoot {
    border-top: var(--border);
}

.CONTENT_TABLE th,
.CONTENT_TABLE td {
    font-size: smaller;
    text-align: center;
    padding-inline: 5px;
    padding-block: 8px;
}


.th_30,
.td_30,
.th_21,
.td_21,
.th_118,
.td_118 {
    text-align: left !important;
}

:nth-child(1 of .CONTENT) {

    /* hide columns  */
    .th_106,
    .td_106,
    .th_100,
    .td_100,
    .th_118,
    .td_118,
    .th_102,
    .td_102,
    .th_114,
    .td_114,
    .th_108,
    .td_108,
    .th_101,
    .td_101 {
        display: none;
    }
}

:nth-last-child(1 of .CONTENT) {


    .th_112 {
        cursor: pointer;
    }

    .asc:after {
        content: " ▲";
    }

    .desc:after {
        content: "  ▼";
    }


    /* hide columns */

    .th_30,
    .td_30,
    .th_20,
    .td_20,
    .th_21,
    .td_21,
    .th_37,
    .td_37,
    .th_38,
    .td_38 {
        display: none;
    }


    /* rename column headers */

    /* hide original header labels */
    .th_106,
    .th_100,
    .th_112,
    .th_118,
    .th_102,
    .th_114,
    .th_108,
    .th_101,
    .th_120,
    .th_24 {
        font-size: 0 !important;
    }

    /* set new fontsize for after & before elements */
    th:after,
    th:before {
        font-size: 14px;
    }

    .th_106:before{
        content:"HOLDER";
    }

    /* set new labels */
    .th_112:before {
        content: "#";
    }

    .th_100:after {
        content: "IMG";
    }

    .th_118:after {
        content: "TYP";
    }

    .th_102:after {
        content: "DIA";
    }

    .th_114::after {
        content: "RAD";
    }

    .th_108::after {
        content: "LEN";
    }

    .th_101::after {
        content: "CUT";
    }

    .th_120::after {
        content: "DEPTH";
    }

    .th_24::after {
        content: "DUR";
    }

    /* ------- header renaming END --------- */
}


/* popover images */

.td_100 img,
.HEADSCREENSHOT img {
    cursor: pointer;
}

:popover-open {
    max-width: 100%;
    max-height: 100%;

    border: none;
    padding: 0px;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, .95);
    backdrop-filter: blur(5px);

    transition: all .5s ease-in-out;

    @starting-style {
        max-width: 1px;
        max-height: 1px;
    }
}



.carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    /* Versteckt die Slides außerhalb des Bereichs */
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    /* Der flüssige Effekt */
}

.carousel-slide {
    min-width: 100%;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-family: sans-serif;
}

.carousel-slide img {
    max-width: 100%;
    object-fit: contain;
}

/* Buttons */
button.prev-btn,
button.next-btn {
    position: absolute;
    width: 32px;
    height: 32px;
    line-height: 1;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.3s;
}

button:hover {
    background: rgba(0, 0, 0, 0.8);
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

.carousel-nav {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 10px;
    padding: 15px 0;
    position: absolute;
    bottom: 10px;
    width: 100%;
}

button.indicator {
    position: relative;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-semi);
    border: var(--border);
    cursor: pointer;
    padding: 0;
    /* Reset für Button-Padding */
    transition: background 0.3s;
}

button.indicator.active {
    background: var(--accent);
    transform: scale(1.2);
}

/* --------------------------------------- */

.print-only {
    display: none;
}

tr {
    break-inside: avoid;
}

@media print {
    :root {
        color-scheme: light !important;
        --invert: 0% !important;
    }

    * {
        color: rgb(73, 73, 73) !important;
        background-color: white !important;
    }

    .CONTENT {
        margin-bottom: 0;
    }

    .CONTENT th,
    .CONTENT tbody td {
        border-bottom: 1px solid oklch(85% 0% var(--hue-accent)) !important;
    }

    .HEADSCREENSHOT div {
        display: none;
    }

    .HEADSCREENSHOT>img {
        display: block !important;
    }

    .print-only {
        display: grid;
        margin-top: 1rem;
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
        gap:var(--gap);
        div{border:var(--border);border-radius: 8px;overflow: hidden;}
        img{max-width:100%;}
    }
}