@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --sk-staff-id-card--one-mm-in-pixels: calc( 11.8px * .47 );
    --sk-staff-id-card--one-pt-in-mm: calc( .3528 * .47 );
    --sk-staff-id-card--one-pt-in-px: calc( 4.163px * .47);
    --sk-staff-id-card--card-width:  calc( 54.19 * var(--sk-staff-id-card--one-mm-in-pixels) );
    --sk-staff-id-card--card-height: calc( 85.2 * var(--sk-staff-id-card--one-mm-in-pixels) ); /* 85 mm in px*/

    --sk-staff-id-card--brand-yellow:#FFCA05;
    --sk-staff-id-card--brand-red:#D1232A;
    --sk-staff-id-card--brand-dark-orange:#F05A22;
    --sk-staff-id-card--brand-light-orange:#F6921E;
    --sk-staff-id-card--brand-lt-gray:hsl(0, 0%, 75%);
    --sk-staff-id-card--brand-gray:hsl(0, 0%, 50%);
    --sk-staff-id-card--brand-dk-gray:hsl(0, 0%, 25%);
    --sk-staff-id-card--brand-black:#000;
    --sk-staff-id-card--brand-white:#fff;
    --sk-staff-id-card--brand-gradient: linear-gradient(to right, var(--sk-staff-id-card--brand-red), var(--sk-staff-id-card--brand-yellow));

}

html {
    background-color: transparent;
    margin:0;
    font-family: 'Open Sans', sans-serif;

}

body {
    position: relative;
    margin:0;
}

article {
  page-break-after: always;
  break-after: page;
}


@media print {
    article {
        page-break-after: always;
        break-after: page;
    }
}

@page {
    size: 53.98mm 85.6mm;
    margin-top: 0mm;
  }

.card {
    position: relative;
    width: 53.98mm;
    width: calc( 55.98 * var(--sk-staff-id-card--one-mm-in-pixels) );
    height: 85.60mm;
    height: calc( 85.6 * var(--sk-staff-id-card--one-mm-in-pixels) );
    background: white;
    border-radius: 3mm;
    border-radius: calc( 3 * var(--sk-staff-id-card--one-mm-in-pixels) );
    overflow: hidden;
}

.image {
    position: relative;
    border-top-left-radius:  3mm;
    border-top-left-radius:  calc( 3 * var(--sk-staff-id-card--one-mm-in-pixels) );
    border-top-right-radius:  3mm;
    border-top-right-radius:  calc( 3 * var(--sk-staff-id-card--one-mm-in-pixels) );
    width: 53.98mm; /* 56 mm */
    width: calc( 56 * var(--sk-staff-id-card--one-mm-in-pixels) );
    aspect-ratio: 1 / 1;
    overflow: hidden;
}



.graphicalelement {
    position: absolute;
    background: url('element.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    top:-5mm;
    top: calc( -10 * var(--sk-staff-id-card--one-mm-in-pixels) );
    right:3mm;
    right:calc( 3 * var(--sk-staff-id-card--one-mm-in-pixels) );
    width:70mm;
    width:calc( 70 * var(--sk-staff-id-card--one-mm-in-pixels) );
    aspect-ratio: 1 / .89;
    z-index: 0;
}
.photo {
    position: absolute;
    top:5mm;
    top:calc( 5 * var(--sk-staff-id-card--one-mm-in-pixels) );
    left:5mm;
    left:calc( 5 * var(--sk-staff-id-card--one-mm-in-pixels) );
    right:5mm;
    right:calc( 5 * var(--sk-staff-id-card--one-mm-in-pixels) );
    aspect-ratio: 1 / 1;
    background: transparent;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;        z-index: 5;
}
.gradient {
    position: absolute;
    top:48mm;
    top:calc( 48 * var(--sk-staff-id-card--one-mm-in-pixels) );
    left:0;
    right:0;
    height: 6mm;
    height: calc( 6 * var(--sk-staff-id-card--one-mm-in-pixels) );
    z-index: 10;
    background: linear-gradient( to right, #D1232A 5%, #FFCA05 95% );
}

.name {
    position: relative;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-transform: uppercase;
    padding-top: 4mm;
    padding-top: calc( 2 * var(--sk-staff-id-card--one-mm-in-pixels) );
    padding-bottom: calc( 4 * var(--sk-staff-id-card--one-mm-in-pixels) );
    padding-inline: 3mm;
    padding-inline: calc( 3 * var(--sk-staff-id-card--one-mm-in-pixels) );
    background: white;
    height:auto;
    text-align: center;
    font-weight: 700;
    z-index: 8;
}

.first {
    font-size: 16pt;
    font-size: calc( 16 * var(--sk-staff-id-card--one-pt-in-px) );
    margin-bottom: 1mm;
    margin-bottom: calc( 0 * var(--sk-staff-id-card--one-mm-in-pixels) );
}
.last {
    font-size: 10pt;
    font-size: calc( 10 * var(--sk-staff-id-card--one-pt-in-px) );
}

.logo-bar {
    position: absolute;
    right:3mm;
    right: calc( 3 * var(--sk-staff-id-card--one-mm-in-pixels) );
    bottom:3mm;
    bottom:calc( 3 * var(--sk-staff-id-card--one-mm-in-pixels) );
    height: 8mm;
    height: calc( 8 * var(--sk-staff-id-card--one-mm-in-pixels) );
    width: calc( 100% - 6mm );
    width: calc( 100% - calc( 6 * var(--sk-staff-id-card--one-mm-in-pixels) ) );
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    background: url('logo.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    height: 8mm;
    height: calc( 8 * var(--sk-staff-id-card--one-mm-in-pixels) );
    width: 24mm;
    width: calc( 24 * var(--sk-staff-id-card--one-mm-in-pixels) );
    z-index: 20;
}

.qr {
    aspect-ratio: 1 / 1;
    z-index: 5;
    /* transform: scale(15%);
    transform-origin: 0 0; */
    display: flex;
    justify-content: center;
    align-items: center;
}
.qr img {
    height:64px;
}

section {
    margin: 1em;
}

section.staff-query {
    font-weight: 800;
}

section.staff-query label {
    font-weight: 800;
    text-transform: uppercase;
    font-size: small;
}

section.staff-query input[type="text"],
input[type="text"].staff-card-no {
    font-weight: 400;
    transition: background-color 250ms ease-in-out, color 250ms ease-in-out;
    outline: none;
    border:none;
    border-radius:2em;
    background-color: var(--sk-staff-id-card--brand-lt-gray);
    padding: .5em 1em;
}
section.staff-query input[type="text"] {
    width:36em;
}

input[type="text"].staff-card-no {
    width:18em;
}

section.staff-query input[type="text"]::placeholder,
input[type="text"].staff-card-no::placeholder {
    color:var(--sk-staff-id-card--brand-dk-gray);
    font-weight: 100;
}

form.data-missing input[type="text"] {
    background-color: var(--sk-staff-id-card--brand-red);
    color:var(--sk-staff-id-card--brand-white);
}

section.staff-query button,
.staff-card-item button {
    background: var(--sk-staff-id-card--brand-gradient);
    color: var(--sk-staff-id-card--brand-white);
    font-weight: 800;
    font-size: small;
    text-transform: uppercase;
    padding: .5em 1em;
    border: none;
    border-radius: .25em;
    margin: .25em;
}

button:disabled {
    background: var(--sk-staff-id-card--brand-gray);
}


section.staff-query button:focus,
section.staff-query button:hover,
.staff-card-item button:not(':disabled'):focus,
.staff-card-item button:not(':disabled'):hover {
    box-shadow: .15em .15em 3px 0 var(--sk-staff-id-card--brand-gray);
    text-shadow: 0 0 3px var(--sk-staff-id-card--brand-dk-gray);
}

section.staff-data {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap:2em;
}
section.staff-query[data-found="true"] {
    display: none;
}

section.staff-data[data-staff-member=""],
section.staff-data[data-staff-member=""] + section.actions {
    display: none;
}

.staff-data-label {
    font-size: small;
    font-weight: 800;
    text-transform: uppercase;
}

.staff-data-label + div {
    font-weight: 200;
    text-transform: uppercase;
}

.staff-data-item {
    display: flex;
    justify-content: flex-start;
    gap: 1em;
    align-items: baseline;
}

div.staff-photo {
    background: var(--sk-staff-id-card--brand-gradient);
    border-radius: 1em;
    overflow: hidden;
    border: 1px solid var(--sk-staff-id-card--brand-lt-gray);
    transition: border-color 250ms ease-in-out, box-shadow 250ms ease-in-out;
}
.staff-data canvas {
    width: 300px;
    height: 300px;
    border-radius: 1em;
}
.staff-data div.staff-photo:focus {
    box-shadow: .15em .15em 3px 0 var(--sk-staff-id-card--brand-black);
}

.staff-data div.staff-photo:hover {
    border: 1px solid var(--sk-staff-id-card--brand-black);
}

section.staff-data .data {
    width: minmax(300px, auto);

}

section.actions[data-has-changes="true"] .print-card {
    display: none;
}
section.actions[data-has-changes="false"] .save-photo,
section.actions[data-has-changes="false"] .reload-data {
    display: none;
}

section.actions button {
    color: var(--sk-staff-id-card--brand-white);
    font-weight: 800;
    font-size: small;
    text-transform: uppercase;
    padding: .5em 1em;
    border: none;
    border-radius: .25em;
    margin: .25em;
    background-color: var(--sk-staff-id-card--brand-gray);
    text-shadow: 0 0 4px var(--sk-staff-id-card--brand-black);
    transition: background-image 250ms ease-in-out, color 250ms ease-in-out, box-shadow 250ms ease-in-out, text-shadow 250ms ease-in-out;
}
section.actions .print-card,
section.actions .save-photo {
    background: var(--sk-staff-id-card--brand-gradient);
}

section.actions button:focus,
section.actions button:hover {
    box-shadow: .15em .15em 3px 0 var(--sk-staff-id-card--brand-black);
    text-shadow: 0 0 2px var(--sk-staff-id-card--brand-black);
}

section.id-card {
    display: none;
}

body[data-print="true"] section {
        display: none;
}
body[data-print="true"] section.id-card {
        display: block;
}

form.staff-card-form {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: baseline;
    gap: 1em;
}
