/**
 * CASUS Custom Theme for Reveal.js
 */

@import url('./reveal.js/dist/theme/simple.css');

@font-face {
    font-family: 'Open Sans';
    src: url('fonts/OpenSans_Light.ttf') format('truetype');
    font-weight: 300;
}
@font-face {
    font-family: 'Open Sans';
    src: url('fonts/OpenSans_Regular.ttf') format('truetype');
    font-weight: 400;
}
@font-face {
    font-family: 'Open Sans';
    src: url('fonts/OpenSans_SemiBold.ttf') format('truetype');
    font-weight: 600;
}
@font-face {
    font-family: 'Open Sans';
    src: url('fonts/OpenSans_Bold.ttf') format('truetype');
    font-weight: 700;
}
@font-face {
    font-family: 'Open Sans';
    src: url('fonts/OpenSans_ExtraBold.ttf') format('truetype');
    font-weight: 800;
}

:root {
    --r-main-font: 'Open Sans', sans-serif;
    --r-heading-font: 'Open Sans', sans-serif;
}

/* Logo container - clickable link to CASUS website */
.logo-link {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 5000;
    width: 20%;
    max-width: 250px;
    height: 80px;
    background-image: url('logos/Logo_CASUS_RGB.png');
    background-size: contain;
    background-repeat: no-repeat;
    transition: width 0.3s ease-in-out;
    opacity: 0.9;
    background-position: top right;
}

body:has(.title-slide.present) .logo-link {
    width: 30% !important;
    max-width: 500px !important;
    height: 180px !important;
}

.title-logo-hzdr,
.title-logo-partners {
    display: none;
    position: fixed;
    bottom: 32px;
    height: 90px;
    z-index: 100;
    pointer-events: none;
    background-size: contain;
    background-repeat: no-repeat;
}

.title-logo-bar {
    margin-left: 0;
}

body:has(.title-slide.present) .title-logo-hzdr,
body:has(.title-slide.present) .title-logo-partners {
    display: block;
}

.title-logo-hzdr {
    left: 20px;
    height: 90px;
    width: 400px;
    background-image: url('logos/casus_hzdr_horizontal_colour_eng.jpg');
    background-size: auto 90px;
    z-index: 101;
}

.title-logo-partners {
    right: 20px;
    height: 90px;
    width: 880px;
    background-image: url('logos/partners.png');
    background-size: auto 90px;
    margin-right: 0;
}

.title-logo-bar {
    display: none;
    position: fixed;
    bottom: 32px;
    height: 90px;
    left: 100px;
    right: 240px;
    background: white;
    z-index: 50;
    pointer-events: none;
}

.title-logo-partners {
    right: 20px;
}

body:has(.title-slide.present) .title-logo-bar {
    display: block;
}

/* Color bar at bottom of each slide - 12 distinct rectangles */
:root {
    --cb-1-color: #a0e300; --cb-1-width: 3.7%;
    --cb-2-color: #005096; --cb-2-width: 9.8%;
    --cb-3-color: #a0e300; --cb-3-width: 12.8%;
    --cb-4-color: #005096; --cb-4-width: 15.8%;
    --cb-5-color: #00c3ff; --cb-5-width: 22.4%;
    --cb-6-color: #a0e300; --cb-6-width: 23.3%;
    --cb-7-color: #005096; --cb-7-width: 31.8%;
    --cb-8-color: #00c3ff; --cb-8-width: 34.8%;
    --cb-9-color: #005096; --cb-9-width: 100%;
}

.reveal::after {
    content: "";
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background-image:
        linear-gradient(to right, var(--cb-1-color) var(--cb-1-width), transparent var(--cb-1-width)),
        linear-gradient(to right, var(--cb-2-color) var(--cb-2-width), transparent var(--cb-2-width)),
        linear-gradient(to right, var(--cb-3-color) var(--cb-3-width), transparent var(--cb-3-width)),
        linear-gradient(to right, var(--cb-4-color) var(--cb-4-width), transparent var(--cb-4-width)),
        linear-gradient(to right, var(--cb-5-color) var(--cb-5-width), transparent var(--cb-5-width)),
        linear-gradient(to right, var(--cb-6-color) var(--cb-6-width), transparent var(--cb-6-width)),
        linear-gradient(to right, var(--cb-7-color) var(--cb-7-width), transparent var(--cb-7-width)),
        linear-gradient(to right, var(--cb-8-color) var(--cb-8-width), transparent var(--cb-8-width)),
        linear-gradient(to right, var(--cb-9-color) var(--cb-9-width), transparent var(--cb-9-width));
    z-index: 10;
    pointer-events: none;
}

/* Progress bar above color bar */
.reveal .progress {
    z-index: 20;
    color: #a0e300;
}

/* Custom font sizes for smaller headings and larger body text */
.reveal {
    font-size: 24px;
}

.reveal h1 {
    font-size: 2.2em;
    color: #003360;
}

.reveal h2 {
    font-size: 1.6em;
    color: #003360;
}

.reveal h3 {
    font-size: 1.3em;
    color: #003360;
}

.reveal h4 {
    font-size: 1.1em;
    color: #003360;
}

.reveal ul ul,
.reveal ol ol,
.reveal ul ol,
.reveal ol ul {
    font-size: 1em;
}

.reveal p {
    font-size: 1em;
}

.reveal pre {
    font-size: 1em;
    color: #808080;  /* Medium gray */
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
}

.reveal code {
    font-size: 1em;
    color: #808080;  /* Medium gray */
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
}

.font-smaller {
    font-size: 22px !important;
}

.font-small {
    font-size: 20px !important;
}

.font-tiny {
    font-size: 0.4em !important;
}

/* Make all slides use full width */
.reveal .slides section {
    width: 100%;
    max-width: none;
    left: 0;
    margin: 0;
    padding: 0;
}

/* Left-align all text */
.reveal .slides {
    text-align: left;
}

.reveal .slides section:not(.title-slide) h1 {
    margin: 0 0 20px 0;
}

/* Consistent list indentation for both screen and print */
.reveal ul,
.reveal ol {
    margin-top: 0.1em;
    margin-bottom: 0.1em;
    margin-left: 0.8em;
    padding-left: 1.2em; /* Increased padding for better bullet visibility */
    line-height: 1.4;
}

.reveal li {
    margin-top: 0.1em;
    margin-bottom: 0.1em;
    padding-left: 0.2em;
}

/* Nested lists */
.reveal ul ul,
.reveal ol ol,
.reveal ul ol,
.reveal ol ul {
    margin-left: 1.5em;
    padding-left: 0.5em;
}

/* Title slide styling */
.title-slide {
    text-align: center !important;
}

.title-slide h1,
.title-slide h2,
.title-slide h3,
.title-slide h4,
.title-slide p {
    text-align: center !important;
    color: #0a2945;
}

.title-slide h1 {
    font-size: 2.6em;
    margin-bottom: 0.3em;
    font-weight: bold;
}

.title-slide h2 {
    font-size: 2.1em;
    margin-bottom: 0.3em;
    font-weight: bold;
}

.title-slide h3 {
    font-size: 1.5em;
    margin-bottom: 0.5em;
    font-weight: bold;
}

.title-slide h4 {
    font-size: 1.4em;
    margin-bottom: 0.5em;
    font-weight: bold;
}

.title-slide p {
    font-size: 1.2em;
    font-weight: bold;
}

/* useful things for slides */

.vspace {
  height: 30px;
}

.vspace2 {
  height: 60px;
}

.vspace4 {
  height: 120px;
}

/* Print-specific styles */

@page {
    size: A4 landscape;
    margin: 1cm;
}

@media print {
    /* Reduce logo sizes to 3/4 for print */
    .title-logo-hzdr,
    .title-logo-partners {
        height: 67px !important;
    }
    
    .title-logo-hzdr {
        width: 300px !important;
        background-size: auto 67px !important;
    }
    
    .title-logo-partners {
        width: 660px !important;
        background-size: auto 67px !important;
    }
    .title-logo-bar {
        height: 67px !important;
        left: 220px;
        right: 240px;
    }

    .reveal pre {
        font-size: 0.9em;
    }

    .reveal code {
        font-size: 0.85em;
    }

    /* Title slide centering for print */
    .reveal .slides section.title-slide {
        width: 100vw !important;
        min-height: 100vh !important;
        height: auto !important;
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        box-sizing: border-box;
        background: url('logos/code_globe.png') no-repeat center center !important;
        background-size: 100% auto !important;
        position: relative;
    }
    
    /* Lighten background image in print */
    .reveal .slides section.title-slide::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(255, 255, 255, 0.5) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        pointer-events: none;
    }
    
    .reveal .slides section.title-slide > * {
        position: relative;
        z-index: 1;
    }
    
    .reveal .slides section.title-slide > * {
        vertical-align: middle;
        text-align: center;
    }

    /* Title slide text styling for print */
    .reveal .slides section.title-slide h1,
    .reveal .slides section.title-slide h2,
    .reveal .slides section.title-slide h3,
    .reveal .slides section.title-slide h4,
    .reveal .slides section.title-slide p {
        vertical-align: middle;
        text-align: center !important;
        color: #fff !important;
        text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8), 
                    -3px -3px 6px rgba(0, 0, 0, 0.8), 
                    3px -3px 6px rgba(0, 0, 0, 0.8), 
                    -3px 3px 6px rgba(0, 0, 0, 0.8) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    /* Increased title font sizes for print only */
    .reveal .slides section.title-slide h1 {
        font-size: 3.2em !important;
        font-weight: 800 !important;
        margin-bottom: 0.2em !important;
    }
    
    .reveal .slides section.title-slide h3 {
        font-size: 1.8em !important;
        font-weight: 700 !important;
        margin-bottom: 0.3em !important;
    }
    
    .reveal .slides section.title-slide p {
        font-size: 1.4em !important;
        font-weight: 600 !important;
    }

    /* Page breaks */
    .reveal .slides section {
        page-break-after: always;
    }

    /* Hide elements not needed in print */
    .reveal::after {
        display: none !important;
    }
    
    /* Show top-right logo in print - smaller on regular slides */
    .logo-link {
        display: block !important;
        position: fixed !important;
        top: 10px !important;
        right: 10px !important;
        width: 60px !important; /* Reduced from 80px */
        height: 24px !important; /* Reduced from 32px */
        max-width: none !important;
        max-height: none !important;
    }

    /* Force logos to show in print - position fixed */
    .title-logo-hzdr,
    .title-logo-partners,
    .title-logo-bar {
        display: block !important;
        position: fixed !important;
        z-index: 9999 !important;
        top: auto !important;
        bottom: 3px !important;
    }
    
    /* Remove black boxes around images in print */
    .reveal img {
        border: none !important;
        outline: none !important;
        box-shadow: none !important;
    }
    
    .reveal section img {
        border: none !important;
        outline: none !important;
        box-shadow: none !important;
    }
    
    /* Fix flexbox layout for print - side-by-side columns */
    .reveal .flex-container,
    .reveal [style*="display: flex"] {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 1em !important;
        page-break-inside: avoid !important;
    }
    
    .reveal .flex-container > *,
    .reveal [style*="display: flex"] > * {
        flex: 1 1 50% !important;
        min-width: 0 !important;
        max-width: 50% !important;
        width: 50% !important;
        margin-bottom: 0 !important;
        page-break-inside: avoid !important;
    }
    
    /* Remove conflicting block rules that break columns */
    .reveal section[style*="display: flex"],
    .reveal section > [style*="display: flex"] {
        display: flex !important;
        width: 100% !important;
    }

    /* Ensure list indentation matches screen layout */
    .reveal ul,
    .reveal ol {
        line-height: 1.1 !important;
        margin-left: 0.8em !important;
        padding-left: 0.5em !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Style list items for consistent print output */
    .reveal li {
        line-height: 1.1 !important;
        margin-bottom: 0.3em !important;
        padding-left: 0.2em !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Fix nested lists in print */
    .reveal ul ul,
    .reveal ol ol,
    .reveal ul ol,
    .reveal ol ul {
        margin-left: 0.5em !important;
        padding-left: 0.5em !important;
    }

    /* Print adjustments for flexible layouts - removed conflicting block rules */
}