html {
    --primary: #005f49;
    --secondary: #018365;
    --accent: #ffd226;
    --gray: #aeb3b3;
    overflow-x: hidden;
    font-size: 16px;
    font-family: 'Rubik', sans-serif;
    color: #5a5a5a;
}

body {
    color: inherit;
    overflow: inherit;
}

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;
}

p:not(:last-child) {
    margin-bottom: .75em;
    color: inherit;
}


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

h1,
h2,
h3,
h4,
h5,
h6 {
    /* font-family: 'Raleway', sans-serif; */
    margin: 0 0 .3em;
    padding: 0;
    font-weight: bold;
    color: var(--primary);
    text-transform: capitalize;
    line-height: 1.2;
}

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: 1em;
}

h1 {
    font-size: 32px;
}

h2 {
    font-size: 30px;
}

#homepage-main h2 {
    font-size: 27px;
}

h3 {
    font-size: 27px;
}

#homepage-main h3 {
    font-size: 24px;
}

h4 {
    font-size: 24px;
}

h5 {
    font-size: 21px;
}

h6 {
    font-size: 18px;
}


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

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

a:hover,
a:focus {
    color: var(--primary);
    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
--------------------------------------------------------*/

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


/*  Wrappers
    *.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 
 */

.wrapper {
    margin-right: auto;
    margin-left: auto;
    max-width: 100%;
    position: relative;
    height: inherit;
    padding-left: 15px;
    padding-right: 15px;
}

.full-width {
    /* Make an element span the width of the viewport */
    --side-margin: calc((100vw - var(--page-width) + 13px) / -2);
    /* 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;
}

@media (min-width:768px) {
     :root {
        --page-width: 100%;
    }
}

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

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

@media (min-width:1351px) {
     :root {
        --page-width: 1350px;
    }
    .wrapper,
    .container {
        width: 1350px;
    }
}

.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;
    }
}


/* Events/News items */

.news-item,
.feed-item {
    display: flex;
    gap: 1em 1ch;
    line-height: 1.2;
}

.news-item {
    display: block;
}

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

.feed-item time {
    background: var(--primary);
    border-radius: 5px;
    color: white;
    text-align: center;
    min-width: 50px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

#homepage-main .news-item h3,
#homepage-main .feed-item h3 {
    font-family: 'Rubik', sans-serif;
    font-weight: normal;
    font-size: 1rem;
    margin: 0 0 5px;
}


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

header {
    padding-top: .5rem;
    padding-bottom: .5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem 30px;
    /* background: var(--primary); */
}

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

header>section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2rem;
}

.social-list {
    /* color: white; */
    display: flex;
    align-items: center;
    /* justify-content: flex-end; */
    position: relative;
    list-style: none;
    gap: 10px;
    padding-top: 5px;
    margin-top: 0;
    margin-bottom: 0;
    line-height: 1;
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.social-list svg {
    padding: 3px;
    border: 1px solid var(--primary);
    background: transparent;
    transition: .125s color ease-in-out;
    color: var(--primary);
}

.social-list svg:hover,
.social-list svg:focus {
    color: var(--primary) !important;
    background: var(--accent);
    border-color: var(--accent);
}

.social-list svg:is(:hover, :focus) .facebook-icon .facebook-icon path {
    fill: var(--primary) !important;
}
.social-list path {
    fill: var(--primary);
}

.social-list rect {
    display: none;
}


/* Search */

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

.searchbox:hover,
.searchbox:focus,
.searchbox:focus-within {
    outline: 1px solid var(--primary);
}

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

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

.search-button {
    color: transparent;
    background-color: transparent;
    border: none;
    background-image: url(../images/search-new.svg.php?fc=666666);
    position: absolute;
    right: 0;
    top: 0;
    width: 2em;
    background-repeat: no-repeat;
    background-position: center;
    transition: .125s background ease-in-out;
    transform: scale(.65);
    bottom: 0;
    padding: 3px 23px;
}

.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 {
    padding: .5em 0;
    background: var(--primary);
    position: relative;
    z-index: 1;
}

#nav_menu>ul {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    justify-content: space-around;
}

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

.dropdown-submenu,
#nav_menu li {
    position: relative;
}

#nav_menu>ul>li>a {
    transition:  .125s background ease-in-out,  .125s color ease-in-out;
    position: relative;
    padding: .5em 1.75ch;
    text-transform: capitalize;
    color: white;
    border-radius: 1em;
}

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

#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 {
    background: var(--accent);
    color: var(--primary);
}

#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;
}

.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;
    }
    #nav_menu>ul>li>a,
    #nav_menu .dropdown-menu a {
        padding: .5em 1ch;
    }
}

@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 {
    min-height: calc(100vh - 54px - 126px - 4rem);
}

#subpage-main,
#mms-main {
    padding-top: 3rem;
}

main:not(#mms-main)>.row {
    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 {
        padding-top: 1rem;
        padding-bottom: 2rem;
    }
}

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


/* Slideshows defaults */

.carousel {
    font-size: 20px;
}

.carousel-indicators {
    display: none; /* allows for a lot of slides */
    bottom: 0;
    text-align: left;
    left: 15px;
    right: unset;
    margin: 0;
}

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

.carousel-indicators .active {
    border: 1px solid var(--secondary);
    background: var(--secondary);
    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 .carousel-caption {
    top: unset;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 15px 25px;
}

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

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

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

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

#slideshow-row .carousel-indicators {
    display: block;
}


/* 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 */

@media (max-width: 990px) {
    #news-column {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(287px, 1fr));
        gap: 1em 30px;
        margin-top: 1rem;
    }
    #news-column h2,
    #news-column .button-link {
        grid-column: 1 / -1;
    }
}


/* Categories row */

#categories-row ul {
    padding: 0;
}

#categories-row .column>*:not(:last-child) {
    margin-bottom: 10px;
}

#categories-row .button-link {
    margin-top: 0;
}

@media (max-width: 990px) {
    #categories-row:not(#mycanvas .row-background) {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
    }
}


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

footer {
    padding-top: 2rem;
    padding-bottom: 1rem;
    color: white;
    /* display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1em 30px; */
}

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

footer section {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem 30px;
}

footer div {
    display: flex;
    gap: 5px 15px;
    align-items: center;
    flex-wrap: wrap;
}

footer * {
    color: white;
}


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

footer p {
    margin: 0;
}

footer a {
    text-decoration: underline;
}

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

footer .social-list {
    padding: 0;
    position: relative;
    top: -4px;
}


/* footer .social-list svg {
    border: 1px solid white;
} */

@media (max-width: 900px) {
    footer {
        grid-template-columns: repeat(3, 1fr);
    }
    footer .social-list {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 700px) {
    footer,
    footer section {
        display: block;
    }
    footer ul {
        margin-bottom: 1rem;
    }
}


/*--------------------------------------------------------
    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;
    }
}