:root {
    --top-red1: #B9151C;
    --top-red1-darker: #a9131a;
    --top-red2: #E41F1F;

    --padding-base: 15px;
    --margin-base: 15px;

    --margin-small: 5px;
    --padding-small: 5px;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

body {
    background: white;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    overflow-y: scroll;
}

div.content {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    padding: 0 1rem;
    box-sizing: border-box;
}

/* TODO postcss */
.header .header-center img.site-logo {
    max-width: 100%;
    width: 311px;
}

.header {

    display: flex;
    border-bottom: 1px var(--pri10) solid;
    padding-top: var(--padding-base);
    padding-bottom: var(--padding-base);
    margin-bottom: var(--margin-small);

    .header-left {
        flex: 0 0 40px;
    }

    .header-center {
        flex: 1 1 auto;
        display: flex;
        align-items: center;
        justify-content: center;
        padding-right: 1em;

        img.site-logo {
            max-width: 100%;
            width: 311px;
        }
    }

    .header-right {
        flex: 0 0 40px;
        display: flex;
        align-items: center;
        justify-content: end;

        button.menu {
            background: none;
            border: none;
            font-size: 8px;
            cursor: pointer;
            border-radius: 3px;
            padding: 6px 3px;

            img {
                width: 20px;
                height: 20px;
            }

            &:hover {
                background: lightgray;
            }
        }
    }

    .header-sticky {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: var(--top-red1);
        z-index: 20;
        display: none;
        box-shadow: 0 5px 5px rgba(0, 0, 0, 0.5);

        .header-sticky-content {
            box-sizing: border-box;
            margin: 2px auto 7px auto;
            max-width: 600px;
            padding: 0 1rem;
            display: flex;
            justify-content: center;

            .site-logo-sticky {
                width: 200px;
                max-width: 100%;
            }
        }

        &.scroll-scrolled {
            display: block;
        }
    }
}

.top-row {
    background: linear-gradient(180deg, var(var(--top-red1)) 0%, var(--top-red2));
}

.item {
    margin-bottom: var(--margin-base);
}

.item,
.item-first {
    a {
        text-decoration: none;

        &:hover h3,
        &:hover+.item-text-box a {
            text-decoration: underline;
        }
    }
}

.item-inner-layout {
    display: flex;
    flex-direction: row;

    &.first {
        flex-direction: column;
        max-width: 100%;
    }
}

.item .video,
.item-first .video {
    display: inline-block;
    aspect-ratio: 630 / 354;
    background: lightgray;
    background: linear-gradient(130deg, #aeaeae, #ffffff, #aeaeae);
    background-size: 200% 200%;
    animation: VideoLoadingBackgroundAnimation 5s ease infinite;
    max-width: 100%;
}

.video video {
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
}

.item .video {
    width: 188px;
    height: 106px;
}

.item-first {
    margin-bottom: 1em;
    max-width: 100%;
}

.item-first .video {
    max-width: 100%;
    width: 630px;
    display: inline-block;
}

/* TODO postcss */
.item-text-box a h3 {
    color: var(--pri80);
}

.item-text-box {
    padding: var(--padding-base);
    padding-top: 5px;

    h3 {
        margin-top: 0;
        margin-bottom: 10px;
        font-family: "Fira Sans", sans-serif;
        font-size: 17px;
        font-weight: 600;
        color: var(--pri80);
    }

    &.first {
        padding-left: 0;
    }
}

map-element {
    margin: 0.5em 0 1em 0;
    display: block;
    user-select: none;
    position: relative;
    background: linear-gradient(to bottom, transparent 0px, rgba(255, 255, 255, 0.75) 50px, white 100px, white);
}

div#map {
    display: flex;
    justify-content: center;
    position: relative;
    aspect-ratio: 350 / 200;
    transition: aspect-ratio 1s;

    .back {
        position: absolute;
        top: 10;
        left: 10;
        z-index: 10;
        font-size: 20px;
        padding: 5px;
        cursor: pointer;
        display: flex;
        justify-content: center;
        align-items: center;
        line-height: 1;
        background-color: white;
        border: 2px black solid;
        width: 30px;
        height: 30px;
        border-radius: 30px;
        box-shadow: 3px 3px 5px black;

        &:hover {
            background-color: lightgray;
        }

        line-height: 1;
    }

    #RegionLabels {
        pointer-events: none;

        text {
            text-shadow: black 2px 2px 1px,
                black -1px -1px 1px,
                black 1px -1px 1px,
                black -1px 1px 1px;
        }

        text tspan {
            font-weight: bold;
            fill: white !important;
        }
    }


    #ORPLabels {
        pointer-events: none;
    }

    &.zoomed {
        svg g#layer2 {
            display: none;
        }
    }
}

.top-menu {
    display: flex;
    flex-wrap: wrap;
    overflow: hidden;
    margin-bottom: 0.5em;
    padding-bottom: var(--padding-small);
    border-bottom: 1px var(--pri10) solid;
    box-sizing: content-box;
    align-items: start;
    user-select: none;

    .top-menu-item {
        padding: 0.2em 0.5em;
        background: var(--top-red1);
        color: white;
        margin: 0.1em;
        border-radius: 0.2em;
        flex: 1 1 auto;
        white-space: nowrap;
        text-decoration: none;
        flex: 1 1 14%;

        &.selected {
            box-shadow: 3px 3px 4px inset rgba(0, 0, 0, 0.5);
            background-color: var(--top-red1-darker);
        }
    }

    .top-menu-link {
        &:first-child {
            margin-left: 0;
        }
    }

    .top-menu-others {
        vertical-align: middle;
        display: flex;
        justify-content: right;
        align-items: center;
        position: relative;

        .top-menu-item-arrow {
            background: url('/img/idnes/arrow-down.svg') center center no-repeat;
            background-size: 12px;
            width: 14px;
            height: 10px;
            display: inline-block;
            margin-left: 8px;
        }

    }

    .top-menu-popup {
        position: absolute;
        z-index: 100;
        right: -3px;
        top: 110%;
        padding: var(--padding-small);
        background: white;
        border-radius: 0.5em;
        border: 1px var(--neutral60) solid;
        box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.7);
        width: 200px;
        max-width: 90vw;

        .top-menu-popup-item {
            padding: var(--padding-base);
            color: var(--top-red1);
            display: block;

            &.selected {
                font-weight: bold;
            }
        }
    }
}

.active-header {
    .header-info {
        color: gray;
    }

    .active-places {
        display: flex;
        flex-direction: row;
        margin: 1em 0;

        .active-places-text {
            display: inline-block;
            padding: 3px 6px;
            margin: 3px;
        }

        .active-places-header {
            font-weight: bold;
            display: inline-block;
        }

        .active-places-list {
            .active-places-item {
                background: lightgray;
                border-radius: 5px;
                border: none;
                font: inherit;
                cursor: pointer;

                &.active-places-clear-all {
                    background: #444444;
                    color: white;
                    padding: 3px 10px;
                }

                &:hover {
                    color: white;
                    background: rgb(200, 5, 5);

                    svg line {
                        stroke: white;
                    }
                }
            }
        }
    }
}

.records-and-side-panel {
    display: flex;
    gap: 2em;

    .no-records-placeholder {
        max-width: 100%;

        &.main-placeholder {
            height: 100px;
        }
    }
}

.records {
    max-width: 100%;
}

.side-panel {
    display: none;

    flex: 1 1 auto;
    gap: 1rem;
    padding: 1em;

    &.side-panel-1 {
        border-color: #e1edf5;
    }

    &.side-panel-2 {
        text-align: right;
    }
}

.load-more-button {
    font-size: 130%;
    margin: 2em 0;
    cursor: pointer;
    background: linear-gradient(to bottom, #dddddd, #eeeeee);
    border: 1px #a3a3a3 solid;
    padding: 1ex;
    border-radius: 1ex;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
    color: black;

    &:hover {
        background: linear-gradient(to bottom, #eeeeee, white);
    }
}

.partners {

    padding-bottom: 2em;

    h2 {
        margin-top: 3em;
        margin-bottom: 1.5em;
        font-size: 120%;
    }
}

.logos {
    display: flex;
    gap: 10px;
    margin: 0 0 20px 0;
    justify-content: center;
    flex-wrap: wrap;

    .tv-item {
        display: inline-flex;
        flex-direction: column;
        width: 70px;
        flex: 1 1 13%;
    }

    .tv-name {
        display: flex;
        height: 4em;
        justify-content: center;
        align-items: end;
        font-size: 10pt;
        text-align: center;
    }

    .tv-logo-wrapper {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .tv-logo {
        width: 50px;
        height: 50px;
        object-fit: contain;
    }
}

.footer {
    padding: 4em 0;

    .site-logo-footer {
        width: 250px;
        max-width: 100%;
    }
}

@media (max-width: 450px) {
    .item .video {
        width: 135px;
        height: 76;
    }

    .item-text-box h3 {
        font-size: 14px;
    }

    .logos {

        .tv-name {
            font-size: 8pt;
        }

        .tv-logo {
            width: 40px;
            height: 40px;
            object-fit: contain;
        }
    }
}

@media screen and (orientation:portrait) {
    div#map.zoomed {
        aspect-ratio: 1 / 1;
    }
}

@media (min-width: 1024px) {
    body.sample1 {
        background-image: url("img/sample/advert-sample.jpg");
        background-position: top center;
        background-attachment: fixed;
        background-repeat: repeat-y;
    }

    body.sample2 {
        background-color: #27292b;
        background-image: url("img/sample/advert-sample-poho.png");
        background-position: top center;
        background-attachment: fixed;
        background-repeat: repeat-y;
    }

    body.sample3 {
        background-color: #27292b;
        background-image: url("img/sample/advert-sample-barbora.png");
        background-position: top center;
        background-attachment: fixed;
        background-repeat: repeat-y;
    }

    body.sample4 {
        background-color: white;
        background-image: url("img/sample/advert-sample-mhd.jpg");
        background-position: top center;
        background-attachment: fixed;
        background-repeat: repeat-y;
    }

    body.sample5 {
        background-color: white;
        background-image: url("img/sample/advert-sample-odiska.png");
        background-position: top center;
        background-attachment: fixed;
        background-repeat: repeat-y;
    }

    div.content {
        margin-top: 230px;
        max-width: 1024px;
        padding: 0 2rem;
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    }

    .records-and-side-panel {

        .no-records-placeholder {
            width: 452px;

            &.main-placeholder {
                width: 630px;
                height: 300px;
            }
        }
    }

    .records .item {
        max-width: 452px;
    }

    .records .item-first {
        max-width: 630px;
    }

    .side-panel {
        display: block;
    }

    div#map svg g#layer2 {
        transform: scale(0.65) translate(-51px, 12px);
        transform-origin: top right;
    }

    .header .header-sticky.scroll-scrolled {
        display: none;
    }

    .partners {

        padding-bottom: 1em;

        h2 {
            margin-top: 2em;
            margin-bottom: 0.25em;
            font-size: 120%;
        }
    }

    .logos {

        .tv-item {
            display: inline-flex;
            flex-direction: column;
            width: 70px;
            flex: 1 1 auto;
        }

        .tv-name {
            font-size: 10pt;
        }

        .tv-logo {
            width: 60px;
            height: 60px;
        }
    }
}

@keyframes VideoLoadingBackgroundAnimation {
    0% {
        background-position: 10% 0%
    }

    50% {
        background-position: 90% 100%
    }

    100% {
        background-position: 10% 0%
    }
}
