html {
    box-sizing: border-box;
}

*,
*:before,
*:after {
    box-sizing: inherit;
}

html,
body {
    margin: 0;
    padding: 0;
    font-size: 17px;
    line-height: 1;
    overflow: hidden
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Arial, sans-serif;
}

a {
    text-decoration: none;
}

h4 {
    margin: 0.5rem 0;
}

input,
button {
    display: inline-block;
    max-width: 120px;
    font-size: 0.8rem;
    padding: 6px 4px;
    margin: 0;
}

button {
    cursor: pointer;
}

select {
    max-width: 136px;
    font-size: 0.8rem;
    padding: 6px 4px;
    margin: 0;
}

input[type="checkbox"] {
    height: 1rem;
    width: 1rem;
    vertical-align: middle;
    accent-color: #d3d7b2;
}

/*
    buttons containing SVG
*/

.button_svg {
    padding: 0.2rem 0.4rem 0 0.4rem;
    margin: 0;
    cursor: pointer;
    line-height: 1;
}


.button_svg svg {
    display: inline-block;
    fill: #003d7a;
    width: 1.4rem;
    height: 1.4rem;
    stroke-width: 0;
}

/*
    Links to Home page
*/

.home_links {
    position: fixed;
    left: 8px;
    top: 42px;
    color: #ffffffcc;
}

@media (min-width: 768px) {
    .home_links {
        top: 6px;
    }
}

.home_links a {
    color: #ffffffcc;
    text-decoration: none;
}

.home_links a:hover {
    color: #ffffff;
}

.home_links img {
    height: 32px;
    width: auto;
}

.img_small {
    display: block;
}

.img_big {
    display: none;
}

@media (min-width: 1480px) {
    .img_small {
        display: none;
    }

    .img_big {
        display: block;
    }
}

/*
    Additional functions
*/

.right_fix {
    position: fixed;
    top: 4px;
    right: 8px;
    display:flex;
    flex-wrap: nowrap;
}


/*  
    ===============================================
    Basic structure:
    .map_container: fixed fullscreen position -> flex column
        .map_header_wrapper: height by its content
        .map: flex 1 -> takes the rest of height
    ===============================================
*/

.map_container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    overflow: hidden
}

.map_header_wrapper {
    position: relative;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    background: #003d7a;
    background-image: linear-gradient(rgba(225, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 100%);
    color: #ffffffcc;
    padding: 4px 1%;
    gap: 0.25rem 0.5rem;
    z-index: 999;
}

#map {
    width: 100%;
    flex: 1;
}

/*
    ===============================================
    Leaflet classes, to avoid lines in the map
    ===============================================
*/

.leaflet-container {
    background: #ddd;
}

.leaflet-tile {
    outline: 1px solid transparent;
}

.leaflet-tile {
    will-change: transform;
}

.leaflet-pane {
    transform: translateZ(0);
}

.leaflet-control-attribution [class*="flag"] {
    display: none !important;
}



/*
    ===============================================
    Header content structure
    ===============================================
*/

.flex_buttons {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0 0.25rem;
    margin-right: 0.25rem;
}

.flex_selects {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0;
    font-size: 1rem;
}

.flex_checkboxes {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 0;
    margin: 0;
    flex-basis: 100%;
    font-size: 0.8rem;
}

.flex_checkboxes>div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.1rem 0;
    margin: 0;
    font-size: 0.7rem;
    line-height: 0.5;
}

.flex_checkboxes>div>div {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.4rem;
}

.flex_checkboxes button {
    color: #003d7a;
    padding: 0.1rem 0.5rem;
    margin: 0;
    cursor: pointer;
    line-height: 1;
}

/*
    Search Map Inputs
    To hide/show search inputs in mobile
    by toggling its position using #SearchInputsToggle
*/

#SearchInputs {
    display: none;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.1rem 0;
    font-size: 1rem;
    width: 100%;
}


#SearchInputs>div {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 0;
}


@media (min-width: 768px) {

    .map_header_wrapper {
        padding: 4px 4%;
    }

    .flex_checkboxes {
        flex: 0 0 auto;
        font-size: 1rem;
    }

    #SearchInputs {
        flex-wrap: nowrap;
        gap: 0;
    }
    /*

    #SearchInputsToggle {
        display: none;
    }
        */
}

/* Local file upload is disabled in mobiles*/
#FileSystemButton {
    display: none;
}

@media (min-width: 920px) {

    #FileSystemButton {
        display: block;
    }
}


/*
    Inputs for searchin and filtering of open map layers

*/

#ToggleFilterElements {
    display: none;
}

#FiltersWrapper {
    display: none;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0;
    margin: 0 auto;
    padding: 0;
    margin: 0;
    width: 100%;
    font-size: 0.8rem;
}

#FiltersWrapper span {
    padding-top: 6px;
}

#TextFilterContainer {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 0;
    font-size: 0;
}

#TextFilterContainer input {
    max-width: 120px;
    font-size: 0.8rem;
    padding: 5px;
}

#TextFilterContainer button {
    font-size: 0.8rem;
    padding: 5px;
}

@media (max-width: 768px) {
    #FiltersWrapper {
        gap: 0;
    }

    #FiltersWrapper select {
        max-width: 6rem;
        font-size: 0.75rem;
    }
}

#BookFilterContainer,
#TypeFilterContainer,
#RegionFilterContainer,
#TextFilterContainer {
    display: none;
}

/*
    Information, Tool and Download Panels

*/

#PanelInformation,
#PanelTools,
#PanelDownloads {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100vw;
    height: 0;
    padding: 0;
    background-color: transparent;
    overflow: visible;
    z-index: 9999;
}

/* Fix the position of the above panels, making their content visible */
.visible_panels {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.panel_content {
    background-color: #fffffff6;
    border: 1px solid #00000033;
    width: 100%;
    max-width: 924px;
    margin: 7vh auto 0 auto;
    max-height: 70vh;
    padding: 1rem;
    line-height: 1.75;
    text-align: center;
    opacity: 1;
    overflow: auto;
    transition: all 0.3s ease-out, opacity 0.3s ease-out;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.4);
    border-radius: 0 0 6px 6px;
}

.panel_content button {
    display: block;
    margin: 1rem 1rem 1rem auto;
}

.panel_content div {
    display: inline-block;
    margin: 0 auto;
    text-align: left;
}

.info_text .button_svg {
    display: inline-block;
    margin: 0;
}

.info_text svg {
    height: 1rem;
    width: 1rem;
}


code {
    border: 1px solid #66666666;
    background-color: #b6bc7f;
    background-image: linear-gradient(rgba(225, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.2) 100%);
    color: #000;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
}


pre {
    background-color: #eeeeee;
    border: ipx solid #dddddd;
    padding: 0 0.2rem;
    font-size: 0.8rem;
}


/*
    UI Legends on the map
*/

.info_legend {
    background: white;
    padding: 8px;
    border-radius: 5px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    font-size: 14px;
    line-height: 1.4;
}

.layer_legends {
    background: white;
    padding: 8px;
    border-radius: 5px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    font-size: 14px;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px 0;
}

.layer_loaded {
    display: flex;
    width: 100%;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.25rem 0.5rem;
}

.layer_loaded input[type="checkbox"] {
    height: 1.5rem;
    width: 1.5rem;
    margin: 0 0.5rem 0 0;
}

.layer_loaded button {
    color: #000000cc;
    line-height: 1;
    padding: 0 0.1rem;
}

.layer_delete svg {
    fill: #da0;
    width: 1.1rem;
    height: 1.1rem;
}

.layer_zoom {
    margin-left: auto;
}

.layer_zoom svg {
    fill: #003d7a;
    width: 1.1rem;
    height: 1.1rem;
}


.toggle_legends {
    background: white;
    padding: 6px 7px;
    line-height: 1;
    border-radius: 5px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.toggle_legends svg {
    display: block;
    height: 1rem;
    width: 1rem;
    fill: var(--basic-color);
}

.toggle_legends:hover {
    background: #eee;
}

/* Added by JS to mark the loaded map file that is currently used for filtering */
.search_object {
    font-weight: bold;
}

.max-popup-height {
    max-height: 240px;
    width: 100%;
    overflow-y: auto;
    overflow-x: heden;
    margin: 0.25rem 0;
    padding: 0.5rem 0.25rem 0 0.5rem;
    border: 1px solid #999;
    background: #f6f6f6;
    border-radius: 3px;
}


/*
	======================
    Adaptation to Digital Periegesis
    To Open Pausanias Books in Modal window
	======================
*/
#js_Load_Hidden_HTML {
    display: none;
}

#js_Modal_Window {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    padding: 2% 0;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    transition: all 0.3s ease-out;
    display: none;
}

#js_Modal_Content {
    position: relative;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem;
    background-color: #fff;
    border: 1px solid var(--grey);
    border-radius: 10px;
}

#js_Modal_Content h3 {
    padding: 0;
    margin: 0;
}

#js_Modal_Close {
    color: var(--grey-tint-60);
    text-align: right;
    font-size: 36px;
    padding: 0 5px 5px;
    font-weight: bold;
    cursor: pointer;
}

#js_Modal_Close:hover {
    color: #000000;
    text-decoration: none;
}

.modal_click {
    color: brown;
    cursor: pointer;
}


@media (min-width: 1280px) {
    .leaflet-popup-content {
        width: 320px !important;
    }
}

/*
    Adaptation to Pausanias Books
    Navigation between sections and the section content
*/
.section_nav_wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.section_html_content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0;
    font-size: 0.9rem;
}

.section_html_content p {
    flex: 0 1 50%;
}

#SectionDefaultFont {
    font-size: 1.1rem;
    line-height: 1.5;
}

#SectionPolytonicFont {
    font-family: Tinos, 'Segoe UI', Geneva, sans-serif;
    font-size: 1.3rem;
    line-height: 1.4;
}

@media (min-width: 768px) {

    .section_html_content {
        flex-direction: row;
        gap: 2rem;
        font-size: 1rem;
    }

    #SectionPolytonicFont {
        font-size: 1.2rem;
        line-height: 1.4;
    }
}

.place-link {
    color: blue;
}

.place-link:hover {
    color: brown;
}

pl,
pl a {
    color: blue;
    cursor: pointer;
}

prn,
prn a {
    color: brown;
    cursor: pointer;
}