@import "font-awesome.css";

@font-face {
    font-family: 'Univers';
    src: url('fonts/Univers.eot');
    src: url('fonts/Univers.eot?#iefix') format('embedded-opentype'), url('../fonts/Univers.woff') format('woff'), url('fonts/Univers.ttf') format('truetype'), url('fonts/Univers.svg#Univers') format('svg');
    font-weight: normal;
    font-style: normal;
}

:root {
    --white-shade: white;
    --bma-primary: #009fe3;
    --bma-box-shadow: 0px 2px 11px rgba(0, 0, 0, 0.5);


    touch-action: pan-x pan-y;
    height: 100%

}

html, body {
    font-family: Arial, Verdana, sans-serif;
    background-size: cover;
    background-position: center;
    background-image: linear-gradient(0deg, rgba(0, 159, 227, 0.8), rgba(0, 159, 227, 0.7)), url("/img/background.jpg");
    height: 100%;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Univers', Arial, Verdana, sans-serif;
}

header {
    position: fixed;
    top: 0;
    width: 100%;
    background: white;
    box-shadow: var(--bma-box-shadow);
    height: 100px;
    z-index: 1;
}

.home-button {
    color: var(--bma-primary);
    margin-top: 8px;
}

main {
    display: flex;

    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 100px;

    min-height: calc(100vh - 100px);
    overflow: hidden;
}

.content-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 2vw;
    align-items: center;
    justify-content: center;
    padding: 2vw;
}

.main-link {
    color: inherit;
    text-decoration: none;
}


.box {
    width: 10vw;
    min-width: 250px;
    height: 20vh;
    min-height: 270px;
    box-shadow: var(--bma-box-shadow);
    background-color: var(--white-shade);

    opacity: 0;
    animation: fadeUp 0.2s ease-out forwards;
    animation-delay: calc(var(--i, 0) * 0.05s); /* fallback: 0 */

    display: flex;
    flex-direction: column;
    justify-content: stretch;
    position: relative;

    & .process {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        height: 25px;
        font-size: 1rem;
        overflow: hidden;
        background: var(--bma-primary);
        color: white;

        &::after {
            display: block;
            position: absolute;
            box-shadow: black 0 0 9px -3px;
            border-radius: 20rem;
            height: 32px;
            width: 50px;
        }

        &.extraction::after {
            left: 100%;
            transform: translateX(-50%) translateY(-40%);

            content: "";
            background: url("/img/processes/diff-inv.png") no-repeat;
            background-size: contain;

        }

        &.evaporation::after {

            left: 100%;
            transform: translateX(-50%) translateY(-30%);
            height: 50px;
            width: 32px;
            content: "";
            background: url("/img/processes/ffe-inv.png") no-repeat;
            background-size: contain;

        }

        &.crystallisation::after {

            left: 100%;
            transform: translateX(-50%) translateY(-30%);
            height: 50px;
            width: 32px;
            content: "";
            background: url("/img/processes/ovc-inv.png") no-repeat;
            background-size: contain;

        }

        &.centrifugation::after {

            left: 100%;
            transform: translateX(-50%) translateY(-30%);
            height: 50px;
            width: 32px;
            content: "";
            background: url("/img/processes/centrifugal-inv.png") no-repeat;
            background-size: contain;

        }

        &.sugardrying::after {

            left: 100%;
            transform: translateX(-50%) translateY(-40%);

            content: "";
            background: url("/img/processes/drum-inv.png") no-repeat;
            background-size: contain;

        }

    }

    & .box-image {
        height: 140px;
        background-position: center center;
    }

    & .box-body {
        display:flex;
        flex-direction: column;
        padding: 1rem;
        height: 100%;

        & p {
            flex-grow: 1;
            font-size: .75rem;
        }


        & h2 {
            color: var(--bma-primary);
            font-size: 1.25rem;
        }
    }

    & .arrow {
        margin-left: auto;

        &:after {
            -moz-osx-font-smoothing: grayscale;
            #content: '\2B9E';
            content: "\f105";
            display: inline-block;
            font: 18px / 1 FontAwesome;
            #display: inline-block;
            padding: 3px 13px;
            font-size: 1.5rem;
            color: #fff;
            background: #009fe3;


        }
    }
}

@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}



.box.video {



    & .arrow:after {
        content: '\f144';
        font-size: 2rem;
        padding: 10px 23px;
    }
}

#lightbox {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;

    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 9998;
}

#lightbox.open {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    width: 90%;
    height: 80%;
    max-width: 90vw;
    max-height: 90vh;
    background: #fff;
    overflow: hidden;
}

.lightbox-content iframe,
.lightbox-content video {
    width: 100%;
    height: 100%;
    background: black;
    display: block;
}

/* ── Inline HTML lightbox content (e.g. centrifugal references) ── */
.lightbox-content.html-content {
    background: #f4f6f8;
    overflow: auto;
    padding: 0;
}

.ref-panel {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    font-family: 'Univers', Arial, Verdana, sans-serif;
    color: #1a1a1a;
}

.ref-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.75rem 2rem;
    background: var(--bma-primary);
    color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.ref-logo {
    font-family: 'Univers', Arial, Verdana, sans-serif;
    font-weight: bold;
    font-size: 1.5rem;
    letter-spacing: 0.05em;
    background: #fff;
    color: var(--bma-primary);
    padding: 0.5rem 0.85rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.ref-titles {
    flex: 1;
    min-width: 0;
}

.ref-titles h2 {
    margin: 0;
    font-size: 1.6rem;
    color: #fff;
    line-height: 1.2;
}

.ref-titles p {
    margin: 0.25rem 0 0;
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: normal;
}

.ref-count {
    text-align: center;
    flex-shrink: 0;
    padding-left: 1rem;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
}

.ref-count-num {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    line-height: 1;
}

.ref-count-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.85;
    margin-top: 0.25rem;
}

.ref-table-scroll {
    flex: 1;
    overflow: auto;
    padding: 1.5rem 2rem 0.5rem;
}

.ref-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    overflow: hidden;
    font-size: 0.95rem;
}

.ref-table thead th {
    background: #1a1a1a;
    color: #fff;
    text-align: left;
    padding: 0.9rem 1rem;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    z-index: 1;
}

.ref-table tbody tr {
    border-bottom: 1px solid #e6eaee;
    transition: background 0.15s ease;
}

.ref-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.ref-table tbody tr:hover {
    background: #e6f5fc;
}

.ref-table tbody td {
    padding: 0.85rem 1rem;
    vertical-align: top;
}

.ref-index {
    color: #8a949c;
    font-weight: 600;
    width: 2.5rem;
    text-align: right;
}

.ref-factory {
    font-weight: 600;
    color: var(--bma-primary);
}

.ref-scope {
    font-weight: 600;
    white-space: nowrap;
}

.ref-year {
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.ref-muted {
    color: #aab2b8;
}

.ref-footer {
    padding: 0.9rem 2rem 1.25rem;
    text-align: center;
}

.ref-source {
    font-size: 0.78rem;
    color: #6b7480;
    font-style: italic;
}

.ref-empty {
    padding: 3rem;
    text-align: center;
    font-size: 1.1rem;
    color: #6b7480;
}

/* Touch-screen: slightly larger tap targets inside the table */
@media (pointer: coarse) {
    .ref-table tbody td,
    .ref-table thead th {
        padding: 1rem 1rem;
    }
    .ref-titles h2 { font-size: 1.4rem; }
}

.close-lightbox {
    position: fixed;
    top: 20px;
    right: 20px;
    font-size: 3rem;
    line-height: 3rem;
    background: black;
    color: white;
    border: none;
    cursor: pointer;
    user-select: none;
    width: 65px;
    height: 65px;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}


#flowchart-zoom::-webkit-slider-thumb {
    background: var(--bma-primary);
}

.flowchart-wrapper {
    height: calc(100vh - 100px);
    width: 100%;
    position: relative;

    background-color: white;
    text-align: center;

    & svg {

        height: 100%;

        & circle {
            transform: scale(0);
        }
    }

    & #popup {
        position: absolute;
        display: none;
        background: var(--bma-primary);
        color: white;
        padding: 6px 10px;
        box-shadow: var(--bma-box-shadow);
        font-size: 14px;
        z-index: 10;

        & .popup-link {
            color: white;
            text-decoration: none;
            display: block;
            margin: 1rem;

        }

    }


}