@import url("./helpers/general.css");

@keyframes bulge { 20% { transform: scale(2) }}
@keyframes flash { 20% { background-color: red; color: white; }}

:root {
    --arrow: url('data:image/svg+xml;charset=utf8,<svg viewBox="0 0 437.5 437.5" xmlns="http://www.w3.org/2000/svg"><path fill="blue" d="M198.75,290.75a12,12,0,0,0,8.49-3.52l60-60a12,12,0,0,0,0-17l-60-60a12,12,0,1,0-17,17l51.51,51.51-51.51,51.52a12,12,0,0,0,8.48,20.48"></path></svg>');
    --radius: 10px;
    --shadow: 0 0 10px rgba(0,0,0,.1);
}
body { 
    font-family: Stag;
}
* {
    box-sizing: border-box;
    font-weight: normal;
    font-family: Stag;
    font-style: normal;
}
main {
    width: 100%;
    height: 100%;
    display: flex;
    transition: opacity .5s;
    min-height: 600px;
}
#map {
    width: 100%;
    height: 100%;
}
aside {
    height: 100%;
    overflow: auto;
    position: relative;
    z-index: 12;
    flex: 1 0 250px;
    position: absolute;
    left: 0;
    top: 0;
    width: 25%;
    min-width: 200px;
    max-width: 250px;
    display: grid;
    grid-template: "form" auto "list" 1fr / 100%;
}
aside ul {
    flex: 1 0 auto;
    grid-area: list;
    overflow: auto;
    display: flex;
    flex-direction: column;
}
aside form {
    flex: 1 0 100%;
    grid-area: form;
}
.flash {
    animation: flash 1s;
}
.bulge {
    animation: bulge 1s;
}
dl, dt, dd, p {
    padding: 0;
    margin: 0;
}
dl {
    padding: 20px;
    line-height: 1.4em;
    background: white;
    margin: 10px;
    border-radius: var(--radius);
    order: 1;
    transition: border-color .5s, color .5s;
    border: 2px solid white;
    box-sizing: border-box;
    transform: none !important;
}
dl.central {
}
dl.active {
    border: 2px solid red;
}
dt {
    font-weight: bold;
}
dd {
    display: flex;
    flex-direction: column;
}
dd a {
    color: var(--link);
    display: flex;
    align-items: center;
    margin-left: auto;
    margin-top: auto;
}
dd a:after {
    content: '';
    width: 1em;
    height: 2em;
    display: block;
    color: transparent;
    background: var(--arrow) no-repeat 50% 50% / auto 100%;
}
dd a[href="#"]{
    display: none;
}
.active dd a {
    color: white;
}
.active dd a:after {
    color: white;
    filter: grayscale(100%) brightness(200);
}

form {
    position: sticky;
    bottom: 10px;
    border-bottom: 0;
    z-index: 1;
    background: white;
    display: flex;
    order: 2;
    margin: 10px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
form > * {
    opacity: .25;
    transition: opacity .4s;
}
form:focus-within > *,
form:hover > * {
    opacity: 1;
}
form input {
    padding: 1em;
    width: 100%;
    padding-left: 40px;
    background: var(--svg-search-glass) no-repeat 10px 50% / 20px auto white;
    border: none;

}
form button {
    border: none;
    width: 4em;
    background: url(./icons/reload.svg) no-repeat 50% 50% / 50% auto; color: transparent;
    overflow: hidden;
    border-left: 1px solid gray;
}

h1 {
    position: absolute;
    right: 20px;
    top: 20px;
    width: 12%;
    max-width: 250px;
    min-width: 100px;
    z-index: 10;
    pointer-events: none;
}
h1 img { 
    width: 100%;
    height: auto;
}

aside > button {
    -webkit-appearance: none;
    appearance: none;
    border: none;
    color: transparent;
    grid-area: list;
    width: 100%;
    height: 50px;
    align-self: start;
    opacity: 0;
    position: relative;
    z-index: 30;
    background: url('data:image/svg+xml;charset=utf8,<svg viewBox="-.25 -.25 1.5 1.5" xmlns="http://www.w3.org/2000/svg"><circle cx=".5" cy=".5" r=".75" fill="red" /><path d="M.25 .4 L .5 .65L .75 .4" stroke="white" stroke-linecap="round" stroke-width=".1" fill="none" /></svg>') no-repeat 50% 50% / auto 80%;
    transition: opacity .5s;
    pointer-events: none;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}
aside > button.previous {
    transform: rotateZ(180deg);
}
aside > button.next {
    align-self: end;
}
aside.scroll-up > button.previous,
aside.scroll-down > button.next,
aside.scroll-left > button.previous,
aside.scroll-right > button.next {
    opacity: .5;
    pointer-events: all;
}
aside.scroll-up > button.previous:hover,
aside.scroll-down > button.next:hover,
aside.scroll-left > button.previous:hover,
aside.scroll-right > button.next:hover {
    opacity: 1;
}

.map-marker { z-index: 1; }
.map-marker.active { z-index: 2; }
.map-marker img { transition: opacity .4s, transform .4s; transform-origin: 50% 100%; }
.map-marker .active-marker { position: absolute; top: 0; left: 0;  }
.map-marker.active .active-marker { transform: scale(2); }
.hidden { display: none !important; }
.waiting main { opacity: 0; }
.loading:after { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); background: red; color: white; font-size: 2.5em; padding: 10px 20px; border: none; cursor: pointer; }
.loading main,
.loading #start { opacity: 0; }
@keyframes rotate { to { transform: translate(-50%,-50%) rotateZ(360deg); }}
.loading:after { content: ''; width: 20px; height: 20px; border-radius: 50%; border: 4px solid red; background: transparent; animation: rotate 1s infinite linear; padding: 0; border-right-color: transparent; }
body:not(.waiting) #start { pointer-events: none; opacity: 0; }
#extract { display: none; }

body[style*="--load-progress"]:before{
    content: '';
    position: fixed;
    top: calc(50% + 30px);
    left: 50%;
    width: 200px;
    height: 4px;
    border: 1px solid red;
    border-radius: 4px;
    transform: translateX(-50%);
    background: url('data:image/svg+xml;charset=utf8,<svg viewBox="0 0 1 1" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none"><rect x="0" y="0" width="1" height="1" fill="red" /></svg>') no-repeat 0 0 / calc(var(--load-progress) * 100%) 100% white;
}

address {
    text-transform: capitalize;
    font-style: inherit;
}
.articles {
    width: 100%;
    margin-top: 20px;
}
.articles li {
    width: 100%;
    padding: 5px 10px;
    border: 1px solid gray;
    border-top: none;
}
.articles li:first-child {
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    border-top: 1px solid gray;
}
.articles li:last-child {
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
}
.articles li a {
    width: 100%;
    justify-content: space-between;
}

@media all and (orientation:portrait){
    main {
        flex-direction: column;
    }
    aside {
        grid-template: "list" 1fr "form" auto / 100%;
        height: auto;
        top: auto;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }
    aside ul {
        flex-direction: row;
    }
    aside dl {
        flex: 0 0 80vw;
        transform-origin: 50% 100%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    aside dd {
        height: 100%;
    }
    aside > button {
        align-self: center;
        height: 100%;
        width: 50px;
        background-size:  80% auto;
    }
    aside > button.next {
        justify-self: end;
        transform: rotateZ(-90deg);
    }
    aside > button.previous {
        justify-self: start;
        transform: rotateZ(90deg);
    }
}

body #start {
    content: '';
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, #b4b6be, #e7e8ed, #bfc2d1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 30px;
    z-index: 9999999;
}
body #start:after {
    position: absolute;
    left: 5%;
    top: 5%;
    width: 90%;
    height: 90%;
    content: '';
    pointer-events: none;
    background: url(./icons/kaart.svg) no-repeat 50% 50% / contain;
}
@keyframes pulsate {
    from { transform: scale(1); }
    10% { transform: scale(1.3); }
    20% { transform: scale(1); }
    30% { transform: scale(1.1); }
    40% { transform: scale(1); }
    50% { transform: scale(1.1); }
    60% { transform: scale(1); }
}
@keyframes button {
    50% { transform: translate(-50%,-50%) scale(1.2); }
}
body #start button {
    -webkit-appearance: none;
    appearance: none;
    width: 5em;
    height: 5em;
    color: transparent;
    border: none;
    margin: 1em;
    border-radius: 50%;
    box-sizing: content-box;
    padding: 0;
    cursor: pointer;
    position: relative;
    transform: translateY(-25%);
    z-index: 4;
}
body #start button:after,
body #start button:before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    z-index: 2;
    background: url(./icons/pointer.svg) no-repeat 50% 50% / 75% auto red;
}
body #start button:before {
    transform: translate(-50%,-50%) scale(1.1);
    background: white;
    z-index: 1;
    opacity: .5;
    animation: button 2s infinite;
}
body #start h2 {
    max-width: 400px;
    text-align: center;
    font-size: 2em;
    line-height: 1.2em;
    background: red;
    color: white;
    padding: 20px;
    position: relative;
    z-index: 3;
}
body #start img {
    position: absolute;
    left: 30px;
    bottom: 0;
    max-width: 800px;
    width: 60%;
    z-index: 5;
    pointer-events: none;
}
body:not(.waiting) #start {
    display: none;
}

dt, h2, h3 {
    font-size: 20px;
}
.stars {
    margin: 15px 0;
    max-height: 50px;
}
.foto {
    width: 100%;
    height: 100px;
    display: block;
    background-size: contain;
    background-position: 50% 50%;
    background-repeat: no-repeat;
}
.images {
    display: flex;
    width: 100%;
    flex-direction: column;
}
@media all and (orientation:portrait) {
    .images {
        display: flex;
        width: 100%;
        flex-direction: row;
    }
    .stars { 
        flex: 0 0 auto;
        width: auto;
        justify-self: start;
        margin: auto auto auto 0;
    }
    .foto {
        flex: 0 0 40%;
        width: 40%;
    }
}

nav {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10;
    display: flex;
    flex-direction: column;
}
nav button {
    width: 30px;
    height: 30px;
    overflow: hidden;
    -webkit-appearance: none;
    appearance: none;
    background: white;
    border: 1px solid gray;
    border-bottom: none;
    color: transparent;
    position: relative;
}
nav button:first-of-type {
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}
nav button:last-of-type {
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
    border-bottom: 1px solid gray;
}
nav button:after {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: gray;
}
nav button#zoom-in:after {
    content: '+';
}
nav button#zoom-out:after {
    content: '-';
}
nav button#zoom-reset:after {
    content: '';
    background: url(./icons/reload.svg) no-repeat 50% 50% / auto 1em;
    opacity: .5;
}

.hide-ui nav,
.hide-ui aside {
    display: none !important;
}

.its-a-chef {
    border-radius: 50%;
    border: 2px solid red;
    object-fit: cover;
    object-position: 50% 50%;
    width: 100px;
    height: 100px;
}