:root {
    --primary: #085b7c;
    --secondary: #503043;
    --accent: #9a1924;
    --radius: 3px;
    font-size: 17px;
    font-family: 'Inter', sans-serif;
    color: var(--gray);
    --side-margin: calc((100vw - var(--page-width) + 13px) / -2);
}

@media (min-width:991px) {
     :root {
        --page-width: 970px;
    }
}

@media (min-width:1201px) {
     :root {
        --page-width: 1170px;
    }
}

@media (max-width:990px) {
     :root {
        --side-margin: 0px;
    }
}

body {
    color: inherit;
    overflow-x: hidden;
}

header,
#mobile-menu {
    --gray: #999;
}

body,
header,
footer,
main,
header nav {
    font-family: inherit !important;
    font-size: inherit !important;
    /* Prevent MMS pages with hard-coded fonts from overwriting this  */
}

p {
    margin: 0;
    color: inherit;
}

p:not(:last-child) {
    margin-bottom: 1em;
}


/*--------------------------------------------------------
    Headings
--------------------------------------------------------*/

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0 0 .5em;
    padding: 0;
    font-weight: bold;
    color: var(--gray);
    text-transform: capitalize;
    line-height: 1.2;
    font-family: 'Libre Baskerville', serif;
}

h1:not(:first-child),
h2:not(:first-child),
h3:not(:first-child),
h4:not(:first-child),
h5:not(:first-child),
h6:not(:first-child) {
    margin-top: 1.5em;
}

h1 {
    font-size: 28px;
    font-weight: 600;
}

h2 {
    font-size: 25px;
}

h3 {
    font-size: 22px;
}

h4 {
    font-size: 20px;
}

h5 {
    font-size: 18px;
}

h6 {
    font-size: 17px;
}


/*--------------------------------------------------------
    Links
--------------------------------------------------------*/

a {
    text-decoration: none;
    color: var(--secondary);
    transition: .125s color ease-in-out;
}

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

.button-link {
    text-transform: capitalize;
    display: block;
    width: fit-content;
    color: var(--secondary);
    background-color: white;
    text-align: center;
    padding: 0.6em 2ch;
    text-decoration: none;
    line-height: 1;
    transition: color .125s ease-in-out, border .125s ease-in-out, background .125s ease-in-out;
    text-shadow: none;
    border-radius: 1.6em;
    border: 1px solid currentColor;
}

.join-link {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.button-link:hover,
.button-link:focus {
    color: white;
    background-color: var(--secondary);
    text-decoration: none;
    border-color: currentColor;
    outline: none;
}

.button-link:not(:first-child) {
    margin-top: 1.5em;
}

.button-link:not(:last-child) {
    margin-bottom: 2em;
}

#mms-main a {
    text-decoration: none;
}


/*--------------------------------------------------------
    Objects
--------------------------------------------------------*/

.wrapper {
    /* .wrapper acts as a more symantic stand-in for <container><row><col-md-12></col-md-12></row></container> in sections of this build that don't require stacking columns  */
    margin-right: auto;
    margin-left: auto;
    max-width: 100%;
    position: relative;
    height: inherit;
    /* padding-left: 15px;
    padding-right: 15px; */
    width: calc(var(--page-width) - 30px);
}

@media (max-width: 990px) {
    .wrapper {
        padding-left: 15px;
        padding-right: 15px;
    }
}

.full-width {
    /* Make an element span the width of the viewport */
    /* 13px to compensate for width of scrollbar */
    position: relative;
    left: var(--side-margin);
    right: var(--side-margin);
    width: calc(100vw + 13px);
}

#gm-canvas .full-width {
    left: unset;
    right: unset;
    width: unset;
}

.row-background:not(#mycanvas .row-background) {
    position: relative;
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
    padding-left: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 30px;
}

.row-background:not(#mycanvas .row-background):last-child {
    padding-top: 3.5rem;
    padding-bottom: 4.5rem;
}

.row-background:not(#mycanvas .row-background)::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -666vw;
    right: -666vw;
    display: block;
    background-color: var(--gray);
    opacity: .25;
}

.row-background:not(#mycanvas .row-background)>.column {
    background: white;
    padding: 1.5rem 30px;
    border-radius: 5px;
}

@media (min-width: 992px) {
    .row-background:not(#mycanvas .row-background)>.col-md-9 {
        width: calc(75% - 15px);
    }
    .row-background:not(#mycanvas .row-background)>.col-md-8 {
        width: calc(66.7% - 15px);
    }
    .row-background:not(#mycanvas .row-background)>.col-md-7 {
        width: calc(58.3% - 15px);
    }
    .row-background:not(#mycanvas .row-background)>.col-md-6 {
        width: calc(50% - 15px);
    }
    .row-background:not(#mycanvas .row-background)>.col-md-5 {
        width: calc(41.7% - 15px);
    }
    .row-background:not(#mycanvas .row-background)>.col-md-4 {
        width: calc(33.3% - 20px);
    }
    .row-background:not(#mycanvas .row-background)>.col-md-3 {
        width: calc(25% - 20px);
    }
    .row-background:not(#mycanvas .row-background)>.col-md-2 {
        width: calc(20% - 20px);
    }
}

@media (max-width: 990px) {
    .container,
    .wrapper {
        /* Extra wiggle room at a breakpoint that needs it  */
        width: 100%;
    }
    .full-width {
        --side-margin: -15px;
        left: var(--side-margin);
        right: var(--side-margin);
        width: calc(100vw + 30px);
    }
    .row-background:not(#mycanvas .row-background) {
        padding-right: 15px;
    }
    .row-background::before {
        left: 0;
        right: 0;
    }
}

@media (max-width: 767px) {
    .row-background {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
}

.offscreen {
    /* This class allows an element to be read by a screenreader without appearing in the viewport  */
    position: absolute;
    left: -666vw;
}


/* Events/News items */

.feed-item {
    display: flex;
    gap: 1em 1.25ch;
}

.feed-item:not(:last-child) {
    margin-bottom: 1.5rem;
}

.feed-item time {
    background: transparent;
    border-radius: var(--radius);
    color: var(--primary);
    text-align: center;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--primary);
    padding: 1.6ch;
    font-weight: bold;
    line-height: 1.2;
    font-size: 16px;
}

@media (min-width: 501px) {
    .feed-item time {
        font-size: 14px;
    }
}

.feed-item time span {
    display: block;
}

.feed-item .day {
    font-size: 1.2em;
    line-height: 1;
}

#homepage-main .news-item h3,
#homepage-main .feed-item h3 {
    font-size: 1rem;
    font-family: inherit;
    margin-bottom: 5px;
}


/* #homepage-main .news-item h3 {
    font-size: 20px;
} */


/*--------------------------------------------------------
    Header
--------------------------------------------------------*/

header.wrapper {
    padding-top: 1rem;
    padding-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem 30px;
    position: sticky;
    top: 0;
    z-index: 10;
}

header::before {
    content: '';
    position: absolute;
    left: calc(var(--side-margin));
    right: calc(var(--side-margin));
    top: 0;
    bottom: 0;
    background: white;
    z-index: -1;
}

header>a {
    display: contents;
}

.logo-link img,
.logo-link svg {
    max-width: 100%;
}

header>section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
}

.social-list {
    display: flex;
    /* align-items: center; */
    position: relative;
    list-style: none;
    gap: 10px;
    padding: 0;
    margin: 0;
    line-height: 1;
    margin-left: auto;
}

.social-list svg {
    padding: 3px;
    background: var(--gray);
    transition: .125s color ease-in-out;
    color: white;
    border-radius: var(--radius);
}

.social-list svg:hover,
.social-list svg:focus {
    color: white;
    background: var(--secondary);
    border-color: var(--secondary);
}

.social-list path {
    fill: var(--primary);
}

.social-list rect {
    display: none;
}

@media (min-width: 601px) {
    #mobileMenuWrapper .social-list {
        display: none;
    }
}

@media (max-width: 600px) {
    header .social-list>li:not(:nth-child(5)) {
        display: none;
    }
}


/* Search */

.searchbox {
    width: 240px;
    max-width: 45vw;
    position: relative;
    padding: 5px 0.75ch;
    height: 31px;
    border: 2px solid var(--gray);
    transition: .125s border ease-in-out;
    border-radius: var(--radius);
    top: -1px;
}

.searchbox:hover,
.searchbox:focus,
.searchbox:focus-within {
    border-color: var(--primary);
}

.search-input {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    border: none;
    width: 100%;
    padding: inherit;
    background: white;
}

.search-input:focus {
    outline: none;
}

.search-button {
    color: transparent;
    background-color: var(--gray);
    border: none;
    background-image: url(../images/search-new.svg.php?fc=ffffff);
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 31px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 15px;
    transition: .125s background ease-in-out;
    border-left: 2px solid var(--gray);
}

.search-button:hover,
.search-button:focus {
    outline: none;
}

@media (max-width: 767px) {
    header .searchbox {
        display: none;
    }
}


/* Desktop menu  */

header+nav .triggerClose,
header+nav .menu-search {
    display: none;
}

#nav_menu {
    position: relative;
    z-index: 1;
    padding: 0;
}

#nav_menu>ul {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-end;
    gap: .5rem 2.25ch;
}

#nav_menu::before,
#nav_menu::after,
#nav_menu>ul::before,
#nav_menu>ul::after {
    content: none;
}

#nav_menu li {
    position: relative;
}

#nav_menu>ul>li>a {
    position: relative;
    padding: 0;
    text-transform: capitalize;
    color: #777;
    border-radius: 1em;
    font-family: 'Libre Baskerville', serif;
    font-size: 16px;
}

#nav_menu a {
    text-decoration: none;
    background: transparent;
}

#nav_menu a:hover,
#nav_menu a:focus,
#nav_menu .nav .open>a,
#nav_menu .nav .open>a:focus,
#nav_menu .nav .open>a:hover {
    transition: .125s color ease-in-out;
    color: var(--accent);
}

#nav_menu .caret {
    margin-left: .5ch;
}

#nav_menu .dropdown-menu {
    /* Dropdown menu  */
    font-size: inherit;
    padding: 0.5em 0;
    border: none;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
    top: calc(100% + .5rem);
}

#nav_menu .dropdown-menu a {
    text-decoration: none;
    background: transparent;
    transition: .125s background ease-in-out, .125s color ease-in-out;
}

#nav_menu .dropdown-menu a:hover,
#nav_menu .dropdown-menu a:focus {
    background: var(--primary);
    color: white;
}

#nav_menu .dropdown-menu:not(.men-level-):not(.men-level-0) {
    top: 0;
}

#nav_menu .dropdown-menu a {
    padding: .5em 20px;
}

@media (max-width: 1200px) {
    /* #nav_menu {
        padding: .5em 1ch;
    } */
    #nav_menu>ul {
        display: flex;
        justify-content: space-between;
        /* gap: .5rem 1.5ch; */
    }
    #nav_menu .dropdown-menu a {
        padding: .5em 1ch;
    }
}

@media (min-width: 991px) {
    li.mobileMenuTrigger:not(.triggerClose) {
        display: none;
    }
}

@media (max-width: 990px) {
    header nav {
        display: none;
    }
}


/* Mobile menu trigger  */

.mobileMenuTrigger:not(.triggerClose) {
    border: 2px solid currentColor;
    padding: 10px 5px;
    color: var(--primary);
    transition: color .125s ease-in-out;
    display: inline-flex;
    border-radius: 5px;
    background: transparent;
    border: none;
    padding: 0;
}

.mobileMenuTrigger:not(.triggerClose):hover,
.mobileMenuTrigger:not(.triggerClose):focus {
    color: var(--secondary);
    outline: none;
}

.menu-trigger {
    padding: 5px;
    height: 30px;
}


/* @media (min-width: 991px) {
    .mobileMenuTrigger:not(.triggerClose) {
        display: none;
    }
}

@media (max-width: 990px) {
    #nav_menu,
    header .social-list li:not(:last-child) {
        display: none !important;
    }
} */


/* Login modal */

.modal-open #login-modal {
    display: flex;
}

.modal-dialog {
    max-width: 100%;
    font-size: 16px;
    margin: auto;
    width: 300px;
}

.modal-content {
    margin-top: 20px;
    border-radius: 0;
}

.modal-header,
.modal-body {
    padding: .5rem 1rem;
}

.modal-header .close {
    opacity: 1;
    z-index: 1;
    position: relative;
}

.modal h2 {
    font-size: 24px;
}

.modal-header,
.modal-body {
    padding: 1em 2ch;
}

.modal input[name="Username"],
.modal input[name="Password"] {
    width: 100%;
    padding-left: .25em;
    padding-right: .25em;
    margin-bottom: 0.5em;
    height: 2em;
    border: 1px solid rgba(68, 68, 68, .5);
}

.modal a {
    display: block;
    margin-bottom: .5em;
}

@media (max-width: 990px) {
    .header-links li:not(:last-child) {
        display: none;
    }
}


/*--------------------------------------------------------
    Mobile navigation
--------------------------------------------------------*/

#mobileMenuWrapper {
    position: fixed;
    background: white;
    top: 0;
    bottom: 0;
    z-index: 50;
    overflow-y: auto;
    overflow-x: hidden;
    left: -120%;
    width: 300px;
    box-shadow: 0 3px 14px -2px rgba(0, 0, 0, 0.4);
    transition: left .125s ease-in-out;
}

#mobileMenuWrapper.open {
    left: 0;
}

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

#mobileMenuWrapper li {
    display: block;
    margin-bottom: .7rem;
}

#mobileMenuWrapper a {
    background-color: transparent;
    text-decoration: none;
}

#mobileMenuWrapper .mDropdown {
    display: none;
    padding-top: .7rem;
}

#mobileMenuWrapper .mDropdown.open {
    display: block;
}

.triggerClose {
    text-align: right;
}

.triggerClose button {
    background: none;
    border: none;
    font-size: 2rem;
    padding: 0;
    line-height: 1;
}

#mobileMenuWrapper #mobile-menu {
    overflow: auto;
    padding: 1rem;
}


/*--------------------------------------------------------
    Main
--------------------------------------------------------*/

main {
    --gray: #555;
}

#subpage-main,
#mms-main {
    padding-top: 3rem;
    min-height: calc(100vh - 54px - 167px - 4rem);
}

main:not(#mms-main)>.row:not(main>:first-child) {
    position: relative;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

main:not(#homepage-main)+footer {
    margin-top: 3rem;
}

@media (max-width: 990px) {
    main:not(#mms-main)>.row:not(#slideshow-row) {
        padding-top: 1rem;
        padding-bottom: 2rem;
    }
    main:not(#mms-main) .row>.column:not(:first-child) {
        padding-top: 2rem;
    }
}

@media (max-width: 767px) {
    #homepage-main {
        overflow-x: hidden;
    }
}


/* Slideshows defaults */

.carousel {
    font-size: 20px;
}

.carousel-indicators {
    bottom: unset;
    text-align: left;
    left: 15px;
    right: unset;
    margin: 0;
    z-index: 1;
}

.carousel-indicators li {
    width: 12px;
    height: 12px;
    border: 1px solid white;
    background: white;
    margin: 0;
}

.carousel-indicators .active {
    border: 1px solid var(--primary);
    background: var(--primary);
    width: 12px;
    height: 12px;
}

.carousel-indicators li:not(:first-child) {
    margin-left: 5px;
}

.carousel-control.left,
.carousel-control.right {
    display: none;
}


/* Slideshow row  */

#slideshow-row {
    margin-bottom: 1rem;
}

#slideshow-row img {
    width: 100%;
}

#slideshow-row .caption-wrapper {
    margin-left: calc(var(--side-margin) * -1);
    margin-right: calc(var(--side-margin) * -1);
}

#slideshow-row .carousel-caption {
    top: unset;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 2rem 0;
}

#slideshow-row .carousel-caption::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary);
    opacity: .85;
    z-index: -1;
}

#slideshow-row .caption-text,
#slideshow-row .alt-text {
    font-size: 1.2rem;
    margin: 0;
    text-align: left;
    line-height: 1.2;
    text-shadow: none;
}

#slideshow-row .caption-text {
    font-weight: bold;
    text-transform: capitalize;
    font-size: 1.5rem;
}

#slideshow-row p+.alt-text {
    margin-top: 5px;
}

@media (max-width: 990px) {
    #slideshow-row .carousel-caption {
        padding-right: 15px;
    }
    #slideshow-row .caption-text {
        font-size: 20px;
    }
    #slideshow-row .alt-text {
        font-size: 1rem;
    }
}

@media (max-width: 767px) {
    #slideshow-row .carousel-caption {
        position: relative;
    }
    #slideshow-row .carousel-caption::before {
        opacity: 1;
    }
}


/* Events column */

#homepage-main>.row-background>#events-column {
    padding: 1rem;
}

#events-column h2,
#news-column h2 {
    font-size: 20px;
}

#events-column .button-link,
#news-column .button-link {
    margin-top: 10px;
}

@media (max-width: 1200px) {
    #slideshow-row {
        flex-direction: column;
    }
    #slideshow-row:not(#mycanvas .row-background)>.column {
        width: 100%;
    }
    #events-column {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(287px, 1fr));
        gap: 1em 30px;
    }
    #events-column h2,
    #events-column .button-link {
        grid-column: 1 / -1;
    }
}


/* Welcome column */

.welcome-img-wrapper {
    display: flex;
    gap: 1em 30px;
    margin-bottom: 1em;
    flex-wrap: wrap;
}


/* News column */

#homepage-main #news-row {
    font-size: 16px;
}

#homepage-main #news-row>.column {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(277px, 1fr));
    gap: 1em 30px;
}

#news-row h2,
#news-row .button-link {
    grid-column: 1 / -1;
}

.news-item {
    /* background: #eee; */
    padding: 1em 2ch;
    border-radius: var(--radius);
    border: 1px solid var(--primary);
}


/* .news-item a {
    color: var(--primary);
} */


/*--------------------------------------------------------
    Footer
--------------------------------------------------------*/

footer {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    position: relative;
    margin-top: 1rem;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--side-margin);
    right: var(--side-margin);
    z-index: -1;
    background: var(--primary);
}

footer * {
    color: white;
}

footer a {
    text-decoration: underline;
}

footer a:hover,
footer a:focus {
    color: inherit;
}


/*--------------------------------------------------------
    MMS Styles
--------------------------------------------------------*/


/* MMS Member Menu icons */

@media (min-width: 1200px) {
    .nav-tabs li.dropdown {
        width: 190px;
    }
}

@media (min-width: 990px) and (max-width: 1200px) {
    .nav-tabs li.dropdown {
        width: 155px;
    }
}

@media (min-width: 767px) and (max-width: 990px) {
    .nav-tabs li.dropdown {
        width: 120px;
    }
}