/* RESET */
:root {
    --color-primary: #00264d;
    --color-primary-dark: #062b58;
    --color-primary-light: #094082;
    --color-secondary: #e66a49;
    --color-text: #333;
    --color-black: #000;
    --color-white: #fff;
    --color-grey: #f8f4ed;
    --color-yellow: #fcda02;
    --color-border: #ced4da;
}

body {
    margin: 0;
    font-family: "Ubuntu", sans-serif;
    color: var(--color-text);
    font-size: .96em;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

h2 {
    font-size: 1.5rem;
}

.h1-lg {
    font-size: clamp(2rem, 10vw, 4rem);
    line-height: 1.15;
    margin: 0;
}

.h2-lg {
    font-size: clamp(2rem, 8vw, 3rem);
    line-height: 1.15;
    margin: 0;
    text-align:center;
}

.h3-lg {
    font-size: clamp(2rem, 8vw, 2rem);
    line-height: 1.15;
    margin: 0;
    text-align:center;
}

.body-lg-text {
    font-size: clamp(2rem, 8vw, 2rem);
    line-height: 1;
    margin: auto;
}

a, a:hover {
    text-decoration: underline;
    color: var(--color-white);
}

summary {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 1em 0 ;
}

.no-decoration, .no-decoration:hover, .no-decoration:focus {
    text-decoration: none;
}

.dark-link, .dark-link:hover, .dark-link:focus {
    text-decoration: underline;
    color: var(--color-black);
}

.padding {
    padding: 2em;
}

.greyscale {
    filter: grayscale(100%) opacity(80%);
}

.text-grey {
    color: var(--color-yellow);
}

.text-orange {
    color: var(--color-secondary);
}

.bg-grey {
    background-color: var(--color-grey);
}

.sticky-grey {
    position: sticky;
    top: 60px;
    padding-bottom: 0;
}

.sticky-grey .move-away {
    display: inline-block;
    width: 100% ;
}

.bg-orange {
    background: var(--color-secondary);
    padding: 20px 0;
}

.center-text {
    text-align: center;
}

.center-content {
    align-content: center;
}

input {
  padding: .375rem .75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  appearance: none;
  border-radius: .25rem;
  margin-left: .5em;
  box-sizing: border-box;
}

.move-away * {
    float: left;
}

.move-away *:nth-child(even) {
    float: right;
}

.m0 {
    margin: 0;
}

.landing-page-image {
    max-width: 100%;
    object-fit: contain;
}

/* SECTIONS FOR CONTENT */

section {
    line-height: 1.55;
    color: var(--color-black);
    padding: 50px 0;
}

/* MAIN HEADER */

.splash {
    box-sizing: border-box;
    padding: 100px 0;
    display: flex;
    justify-content: center;
    flex-direction: column;
    width: 100%;
    background: url('header.webp');
    background-size: cover;
}

.splash p {
    line-height: 1.55;
    font-size: clamp(1.5rem, 4vw, 3rem);
    margin: 0;
    color: var(--color-white);
}

@keyframes gradientBG {
  0% {
    background-position: 0 0
  }

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

  100% {
    background-position: 0 0
  }
}

/* NAV */

nav {
    background-color: var(--color-primary);
    position: sticky;
    top: 0;
    height: 70px;
    /* higher than leaflet's controls */
    z-index: 4000;
}

nav ul {
    display: flex;
    justify-content: space-around;
    height: 100%;
}

nav li {
    display: block;
    height: 100%;
}

nav a {
    line-height: 70px;
    text-align: center;
    color: var(--color-white);
    text-decoration: none;
    font-size: 1.1rem;
    padding: 0 20px;
    display: inline-block;
}

nav img {
    margin-right: 4px;
}

nav a:hover {
    background-color: var(--color-secondary);
    color: var(--color-white);
}

/* LARGE CALL-OUT-BOX */

.call-out {
    background: var(--color-secondary);
    font-size: 1.5rem;
    padding: 1em;
    color: var(--color-white);
    border-radius: 5px;
}

/* FOOTER */

footer {
    background-color: var(--color-primary-dark);
    color: var(--color-white);
    padding: 1em;
    height: 100%;
    margin-top: auto;
}

.footer-table {
    display: grid;
    grid-template-columns: auto;
}

.footer-header {
    font-size: 1.5rem;
    font-weight: 100;
}

.footer-end {
    padding: 1em;
    display: flex;
    justify-content: space-between;
    margin-top: 1em !important; /* important needed as long as the target element got the container class */
}

footer li {
    padding: 4px 0;
}

.white-bg {
    background-color: var(--color-white);
}

/* TABLE */

table {
    border-collapse: collapse;
    width: 100%;
    text-align: left;
}

table thead {
		position: sticky;
		top: 164px;
		background: var(--color-white);
}

table a {
    color: var(--color-black);
}

table a:focus, table a:hover {
    color: var(--color-black);
}

table td, table th {
    padding: 8px;
}

table th {
    font-size: 1.2rem;
    font-weight: 100;
    vertical-align: top;
}

table tr:nth-child(even) {
    background-color: var(--color-grey);
}

table ul li {
    display: inline;
    margin-right: 3px;
}

table th:not(.js-sort-none)::after {
    content: "◆";
    padding-left: 3px;
    font-size: .7em;
    font-stretch: ultra-condensed;
    line-height: .7em;
}

table th:not(.js-sort-none):hover {
    cursor: pointer;
}

/* BUTTONS */

.btn {
    background: var(--color-primary-dark);
    color: var(--color-white);
    text-decoration: none;
    text-align: center;
    padding: 7px 21px;
    line-height: 18px;
    border-radius: 3px;
    display: inline-block;
    margin-bottom: .5em;
    margin-top: .5em;
    box-sizing: border-box;
}

.btn:hover, .btn:focus {
    background: var(--color-primary-light);
    text-decoration: none;
}

.btn.rounded {
    border-radius: 20px;
}

.btn.right {
    float: right;
    margin: 0;
}


/* LAYOUT */

.container {
    width: 100%;
    padding: 0 1em;
    box-sizing: border-box;
}

.grid {
    display: grid;
    grid-gap: 1em;
    grid-template-columns: auto;
}

.half {
    display: grid;
    grid-template-columns: 1fr;
    align-content: center;
}

.box-list {
    display: grid;
    grid-gap: 1em;
    grid-template-columns: auto;
    margin: 1em 0;
}

.box-list li {
    height: 100px;
    line-height: 100px;
    background: var(--color-secondary);
    border-radius: 3px;
}

.box-list a {
    display: block;
    text-align: center;
    text-decoration: none;
    color: var(--color-white);
    font-size: 1.15rem;
}

.topic-list {
    display: grid;
    grid-gap: 1em;
    grid-template-columns: 1fr 1fr;
    margin: 1em 0;
    text-align: center;
}

.topic-list div {
    background: var(--color-secondary);
    border-radius: 100%;
    height: 100px;
    text-align: center;
    width: 100px;
    margin: auto;
    margin-bottom: 1em;
}

.topic-list img {
    height: 50px;
    margin-top: 25px;
}

.topic-list a {
    color: var(--color-black);
}

/* HEADER */

header.item {
    background: var(--color-secondary);
    margin-top: 2em;
    padding: 2em;
    color: var(--color-white);
    border-radius: 5px 5px 0 0;
}

header.topic {
    background: #062b5899;
    margin-top: 2em;
    margin-left: 20%;
    margin-right: 20%;
    padding: 2em;
    color: var(--color-white);
    border-radius: 5px 5px 0 0;
}

.header-lower {
    display: grid;
    grid-gap: 1em;
    grid-template-columns: auto;
}

.action-boxes {
    display: grid;
    grid-gap: 1em;
    grid-template-columns: auto;
}

.infobox {
    background: var(--color-primary);
    border-radius: 5px;
    padding: 2em;
}

.btn-list .btn {
    margin-right: .5em;
}

.btn-list .wikidata-btn {
    background-color: var(--color-white);
    float: right;
    width: 18px;
    height: 18px;
    padding: 8px;
    box-sizing: content-box;
}

/* STATISTICS */

.number-container {
    grid-template-columns: auto;
}

.number {
    text-align: center;
    text-transform: uppercase;
  }

.number div:first-child {
    font-size: 4rem;
}

.timestamp {
    text-align: right;
    margin-top: .5em;
    margin-bottom: 0;
  }

/* TOPICS */

.topic-background {
    box-sizing: border-box;
    padding: 100px 0;
    display: flex;
    justify-content: center;
    flex-direction: column;
    width: 100%;
    background-size: cover;
    background-position: center;
}

.topic-background.recreation-culture-religion {
    background-image: url('recreation-culture-religion.webp');
}

.topic-background.health {
    background-image: url('health.webp');
}

.topic-background.defense {
    background-image: url('defense.webp');
}

.topic-background.education {
    background-image: url('education.webp');
}

.topic-background.environmental-protection {
    background-image: url('environmental-protection.webp');
}

.topic-background.general-public-services {
    background-image: url('general-public-services.webp');
}

.topic-background.economic-affairs {
    background-image: url('economic-affairs.webp');
}

.topic-background.housing-community-amenities {
    background-image: url('housing-community-amenities.webp');
}

.topic-background.public-order-safety {
    background-image: url('public-order-safety.webp');
}

.topic-background.social-protection {
    background-image: url('social-protection.webp');
}


/* SPINNER */

.spinner {
    margin: auto;
    width: 70px;
    text-align: center;
}

.spinner > div {
    width: 18px;
    height: 18px;
    background-color: var(--color-secondary);
    border-radius: 100%;
    display: inline-block;
    animation: dots 1.4s infinite ease-in-out both;
}

.spinner .dot1 { animation-delay: -.32s; }
.spinner .dot2 { animation-delay: -.16s; }

@keyframes dots {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1.0); }
}

/* #TODO review break points */

.hide-mobile {
    display: none;
}

@media screen and (max-width: 600px) {
    .expand-mobile {
        width: 100%;
    }

    .move-away *.expand-mobile {
        float: unset;
        margin-left: 0;
    }

    table thead {
        top: 232px;
    }

    table {
        table-layout: fixed;
    }

    table td:not(.statistics-table),
    table th:not(.statistics-table) {
        text-wrap: balance;
    }
}

@media screen and (min-width: 600px) {
    .container {
        width: 600px;
        margin: 0 auto;
    }

    .box-list {
        grid-template-columns: auto auto;
    }

    .topic-list {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .hide-mobile {
        display: initial;
    }

    .action-boxes {
        grid-template-columns: auto auto;
    }

    .number-container {
        grid-template-columns: auto auto auto;
    }
}

@media screen and (min-width: 650px) {
    .half {
        grid-template-columns: 1fr 1fr;
    }
}

@media screen and (min-width: 800px) {
    .container {
        width: 800px;
        margin: 0 auto;
    }

    .box-list {
        grid-template-columns: auto auto auto;
    }

    .topic-list {
        grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    }

    .footer-table {
        grid-template-columns: auto auto auto;
    }

    .action-boxes {
        grid-template-columns: auto;
    }

    .header-lower {
        grid-template-columns: auto auto;
    }

    .hide-mobile {
        display: initial;
    }
}

@media screen and (min-width: 1000px) {
    .container {
        width: 1000px;
        margin: 0 auto;
    }
}


/* A11Y */

@media (prefers-reduced-motion) {
    * {
        animation: none;
    }
}
