:root {
    --photo-height: 60px;
    --user-club-color: lightgreen;
    --other-club-color: lightgray;
    --roster-border: black;
}

html.dark {
    --user-club-color: #58744c;
    --other-club-color: #393939;
    --roster-border: #444;
}

.club-card button.dark {
    background-color: #222;
}

.button-group {
    border-radius: var(--border-radius);
    overflow-x: auto;
    display: inline-flex;
    max-width: 100%;
}

.button-group button {
    border-radius: 0;
    color: var(--text-color);
}

.buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
}

.tabs > .button-group button {
    background-color: var(--tab-group-color);
}

.tabs > .button-group button.active {
    background-color: var(--tab-group-active);
}

/* MAIN DISCOVERY PAGE */

.club-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5em;
    margin: 1em 0;
}

.club-card {
    background-color: var(--other-club-color);
    border-radius: var(--border-radius);
    padding: 1.5em;
    display: flex;
    flex-direction: column;
    gap: 1em;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.club-card.user-club {
    background-color: var(--user-club-color);
}

.club-name {
    font-size: 1.5em;
}

.club-description {
    flex-grow: 1;
}

.club-description a {
    color: inherit;
}

.modal .club-description {
    margin: 1em 0;
}

.tabs .search-bar {
    width: 100%;
    box-sizing: border-box;
    margin-top: 1em;
}

.not-logged-in {
    background-color: rgb(252 165 165);
    padding: 1rem;
    border-radius: var(--border-radius);
}

html.dark .not-logged-in {
    background-color: rgb(153 27 27);
}

.not-logged-in a {
    color: var(--text-color);
}

/* CLUB INFO PAGE */

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

.manage-buttons {
    display: flex;
    align-items: center;
    gap: 0.5em;
    justify-content: center;
    margin-bottom: 1.5em;
}

.short-description {
    margin: -0.5em 0 0.5em 0;
    font-style: italic;
    text-align: center;
}

.long-description {
    margin: 1em auto;
    text-align: justify;
    max-width: 800px;
    font-family: inherit;
    font-size: inherit;
    white-space: pre-wrap;
}

.charter-doc-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    border-style: solid;
    margin: 2em auto 1em auto;
    width: 100%;
    aspect-ratio: 8.5 / 11;
    max-height: 750px;
    max-width: 800px;
}

.charter-doc-container div {
    margin-top: 1em;
}

.charter-doc {
    position: absolute;
    border: 0;
    width: 100%;
    height: 100%;
}

/* CLUB ADMIN MANAGE PAGE */

.club-details {
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.club-details > * {
    margin: 0.5em 0;
}

.club-details > div:not(:nth-child(2)) {
    display: flex;
    align-items: center;
    gap: 0.25em;
}

.club-details > div input {
    flex-grow: 1;
}

.club-details > div textarea {
    margin-top: 0.25em;
    display: block;
    width: 100%;
    height: 5lh;
    resize: vertical;
    box-sizing: border-box;
}

.club-details .buttons {
    display: flex;
    justify-content: center;
    gap: 0.5em;
}

.club-details .buttons a {
    text-decoration: none;
}

.rosters {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
}

.admins, .members {
    width: 100%;
}

.search-row {
    display: flex;
    margin-bottom: 1em;
    gap: 0.5em;
}

.search-row .search-bar {
    width: 100%;
    box-sizing: border-box;
}

.search-row button {
    display: flex;
    align-items: center;
    padding: 0.5em;
}

.user-list {
    overflow-y: auto;
    border: 0.5px solid var(--roster-border);
    max-height: calc(5 * var(--photo-height));
}

.user-item {
    width: 100%;
    border: 0.5px solid var(--roster-border);
    display: flex;
    align-items: center;
    gap: 0.5em;
    height: var(--photo-height);
    box-sizing: border-box;
}

.user-item :nth-child(2) {
    flex-grow: 1;
    overflow: hidden;
}

.user-item .name, .user-item .email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-item .email {
    font-size: 0.75em;
    color: #888;
}

.user-item img {
    height: 100%;
    aspect-ratio: 172 / 228;
    overflow: initial;
}

.button-container {
    align-self: stretch;
    display: flex;
    align-items: stretch;
}

.button-container button {
    border-radius: 0;
    width: min-content;
    height: 100%;
    padding: 0.5em;
    display: flex;
    align-items: center;
}

#verify-modal > div,
#add-modal form > div,
dialog.modal.red > div {
    margin: 1em 0;
}

#copy-emails-modal textarea {
    box-sizing: border-box;
    width: 100%;
    height: 8lh;
    resize: none;
    text-align: left;
}

#copy-emails-modal form {
    margin-top: 0.5em;
    display: inline-block;
}

/* MEDIA QUERIES */

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

    .rosters {
        flex-wrap: nowrap;
    }

    .admins, .members {
        width: 50%;
    }

    .user-list {
        max-height: calc(10 * var(--photo-height));
    }
}

@media screen and (min-width: 960px) {
    .club-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media screen and (min-width: 1270px) {
    .club-cards {
        grid-template-columns: repeat(4, 1fr);
    }
}