:root {
    --bg: #f9f9f9;
    --text: #222;
    --subtext: #777;
    --heading: #333;
    --menubar: #d0d0d0;
    --hovermenu: #c0c0c0;
    --border: #d2d2d2;
    --hover-bg: #d6d6d6;
    --active-bg: #c6c6c6;
    --links: #327dcd;
    --error: #D00;
    --input-border: #aaa;
    --input-focus-border: #333;
    --input-focus-bg: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    --bg: #1e1e1e;
    --text: #e0e0e0;
    --subtext: #666;
    --heading: #ffffff;
    --menubar: #2c2c2c;
    --hovermenu: #3c3c3c;
    --border: #444746;
    --hover-bg: #2e2e2e;
    --active-bg: #3a3a3a;
    --links: #539bf5;
    --error: #C11;
    /* even darker than bg: */
    --shadow: #050505;
    --input-border: #555;
    --input-focus-border: #3a3a3a;
    --input-focus-bg: rgba(255, 255, 255, 0.05);
}

* {
    transition:
        color 0.05s ease-out,
        background-color 0.3s ease-in-out,
        border-color 0.3s ease-in-out;
    scroll-behavior: smooth;
}

::-webkit-scrollbar {
    width: 0.75rem;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 0.5rem;
    border: 2px solid var(--bg);
}

body {
    margin: 0;
    padding: 0;
    font-family: sans-serif;
    background-color: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

.main {
    position: relative;
    width: clamp(0px, 60%, 800px);
    margin: 0.5rem auto;
    padding: 1rem 2rem;
}

.nav-space {
    margin-top: 3rem;
}

p {
    margin: 0;
}

p a:hover {
    text-decoration: underline;
}

h1 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--heading);
}

a {
    color: var(--links);
    text-decoration: none;
}


.org_and_ico {
    display: flex;
    align-items: center;
    overflow: hidden;
}

.favicon {
    margin: 0 0.3rem 0 0;
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
}

.org-name {
    margin: 0 0.5rem 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1 1 auto;
}

.status {
    flex: 0 0 auto;
    margin-left: auto;
    color: var(--subtext);
}


.name {
    margin-top: 0;
    margin-bottom: 0.7rem;
}

.hours {
    margin-bottom: 0.7rem;
}

.details {
    position: relative;
    max-height: 4.5rem;
    overflow: hidden;
}

.details::after {
    content: "";
    position: absolute;
    inset: 3rem 0 0 0;
    height: 1.75rem;
    background: linear-gradient(to bottom, transparent, var(--bg));
}

.contact {
    position: relative;
    display: inline-flex;
    flex-wrap: wrap;
    margin-top: 0.9rem
}

.location {
    display: inline-flex;
    margin-left: 3rem;
    margin-right: 1rem;
}

.location p {
    padding-right: 0.5rem;
}

.pill {
    margin: 0 0.3rem 0.2rem 0;
    padding: 0.4rem 0.6rem;
    display: flex;
    z-index: 0;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 2rem;
}

.pill svg {
    fill: var(--links);
    padding-right: 0.3rem;
    width: 1.15rem;
    height: 1.15rem;
}

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

.modal {
    position: fixed;
    z-index: 10;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.modal:target {
    opacity: 1;
    pointer-events: auto;
}

.modal:target~.content {
    height: 100vh;
    overflow: hidden;
}

.modal-content {
    background: var(--bg);
    padding: 2rem;
    border-radius: 1rem;
    width: clamp(0px, 70%, 1000px);
    max-height: 70%;
    overflow: auto;
    position: relative;
    box-shadow: 0 1rem 4rem var(--shadow);
}


.close {
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    text-decoration: none;
    font-size: 2.25rem;
    color: var(--text);
}

.topnav {
    display: flex;
    z-index: 10;
    position: fixed;
    top: 0rem;
    width: 100%;
    overflow: hidden;
    background-color: var(--menubar);
    align-items: center;
}

.topnav a {
    float: left;
    display: block;
    text-align: center;
    padding: 0.7rem;
    padding-left: 1rem;
    padding-right: 1rem;
    text-decoration: none;
    font-size: 1rem;

    svg {
        width: 1rem;
        height: 1rem;
        display: inline;
    }

}

.topnav a:hover {
    background-color: var(--hovermenu);
    text-decoration: underline;
}

.topnav a.active {
    background-color: var(--links);
    color: white;
}

.subtext {
    font-size: 0.8rem;
    color: var(--subtext);
}

.search-container {
    position: relative;
    max-width: 100%;
    margin: 0 auto 1rem auto;
}

input {
    color: var(--text);
}

.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-top: none;
    z-index: 1000;
    display: none;
}

#dropdown,
#group-dropdown {
    max-height: calc(6 * 2em);
    overflow-y: auto;
}

.inline-container {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    width: 100%;
}

.inline-container span {
    white-space: nowrap;
    flex-shrink: 0;
}

.search-container {
    position: relative;
    flex: 1;
    margin-bottom: 1rem;
}

.formLine {
    border: none;
    border-bottom: 1px solid var(--input-border);
    margin-bottom: 1px;
    padding: 0.25rem;
    font-size: 1rem;
    width: 100%;
    background: transparent;
    outline: none;
}

.formLine:focus {
    background: var(--input-focus-bg);
    border-bottom: 2px solid var(--input-focus-border);
    margin-bottom: 0px;
}

.dropdown-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
}

.dropdown-item:hover {
    background-color: var(--hover-bg);
}

.dropdown-item.active {
    background-color: var(--active-bg);
}

@media (max-width: 600px) {
    h1 {
        font-size: 1.5rem;
    }

    .nav-space {
        position: fixed;
        padding-top: 2rem;
        margin-top: 0;
        top: 0;
        background-color: var(--bg);
        z-index: 10;
    }

    .main {
        padding: 0.75rem;
        margin: 0;
        width: calc(100% - 2.25rem);
    }

    .location {
        margin: 1rem 0 0 0;
    }

    #dynamic-content {
        margin-top: 14rem;
    }

    .topnav {
        display: flex;
        justify-content: space-evenly;
        z-index: 10;
        position: fixed;
        bottom: 0;
        top: auto;
        height: 4.2rem;
        width: 100%;
        overflow: hidden;
        background-color: var(--menubar);

        theme-toggle {
            display: none;
        }
    }


    .topnav a {
        flex: 1 1 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0.7rem 1rem;
        text-decoration: none;
        font-size: 0.7rem;

        span {
            height: 0.7rem;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .extern {
            display: none;
        }
    }


    .topnav a svg {
        width: 2rem;
        /* bigger icon */
        height: 2rem;
        margin-bottom: 0.2rem;
    }
}
