/* --------------

   GENERAL STYLES

   -------------- */

/* PAGE FORMATTING */
html {
    padding: env(safe-area-inset); /* For iOS portrait mode */
    
    background-image: url(./assets/media/background.png);
    
    @supports (background-image: url(./assets/media/background.webp)) {
        background-image: url(./assets/media/background.webp);
    }
    
    background-attachment: fixed;
    background-size: cover;
    background-position: center top;
}

body {
    margin: 0;
    background-color: #a5e026;
    text-align: center;
    
    font-family: "Roboto", sans-serif;
    transition: font-size .3s ease-in-out;
    
    -webkit-image-rendering: initial;
    -ms-image-rendering: initial;
    image-rendering: initial;
}


/* TEXT FORMATTING */
h1, h2, h3, h4 {
    position: relative;
    margin: .5rem 0;
    padding: 0 1rem;
    box-sizing: border-box;
    text-align: left;
    font-weight: bold;
}

header, h1, h2, h3, h4 { font-family: "Rammetto One", Arial Black, sans-serif; }
h2 { font-size: 2.5rem; }
h3 { line-height: 1em; font-size: 2rem; }
h4 { color: orangered; font-size: 1.75rem; }

p { margin: .5em 0; }


/* LINK FORMATTING */
a {
    color: orangered;
    text-decoration: none;
    font-weight: bold;
    transition: color .3s ease-in-out;
}

a:hover, a:focus, a:active { color: #d73200; }


/* ALIGNMENT FORMATTING */
.left   { text-align: left; }
.right  { text-align: right; }
.center { text-align: center; }

img        { padding: .5rem; }
img.left   { float: left; }
img.right  { float: right; }
img.center { float: middle; }


/* IMAGE FORMATTING */
.pixelate {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: -webkit-crisp-edges;
    image-rendering: -webkit-pixelated;
    image-rendering: -moz-crisp-edges;
    -webkit-image-rendering: pixelated;
    -ms-image-rendering: pixelated;
    image-rendering: pixelated;
}

.page-image {
    max-width: 45%;
}


/* MISCELLANEOUS FORMATTING */
ul {
    margin: 0;
    text-align: left;
}


/* GRADIENT STYLES */
.button,
.card-label,
.button forg,
.header-button,
.panel .panel-title,
.panel .panel-title *,
#menu-button span:before,
.panel .panel-description {
    background-size: 100% 200%;
    background-position: 100% 0%;
}

/* Text clip */
.card-label,
.button forg,
.header-button,
.panel .panel-title * {
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* White gradient */
.card-label,
.button forg,
.header-button,
.panel .panel-title *,
#menu-button span:before,
.panel .panel-description {
    background-image: linear-gradient(white 0%, #eaefff 50%, #c4cbe5 100%);
}

/* Green gradient */
.button,
.panel .panel-title {
    background-image: linear-gradient(#c8f938 0%, #a5e026 50%, #75be0c 100%);
}

/* Interacts */
.button:hover,                   .button:focus,                   .button:active,
.button:hover forg,              .button:focus forg,              .button:active forg,
.header-button:hover,            .header-button:focus,            .header-button:active,
.card:hover .card-label,         .card:focus .card-label,         .card:active .card-label,
.panel:hover .panel-title,       .panel:focus .panel-title,       .panel:active .panel-title,
.panel:hover .panel-title *,     .panel:focus .panel-title *,     .panel:active .panel-title *,
#menu-button:hover span:before,  #menu-button:focus span:before,  #menu-button:active span:before,
.panel:hover .panel-description, .panel:focus .panel-description, .panel:active .panel-description {
    background-position: 100% 98%;
}


/* DROP SHADOW STYLES */
/* Primary drop-shadow */
#logo,
#menu-button,
.header-button,
.panel .panel-title * {
    filter: drop-shadow(0px 0px 2px #51a400) drop-shadow(0px 0px 1px black);
}

#logo:hover,                 #logo:focus,                 #logo:active,
#menu-button:hover,          #menu-button:focus,          #menu-button:active,
.header-button:hover,        .header-button:focus,        .header-button:active,
.panel:hover .panel-title *, .panel:focus .panel-title *, .panel:active .panel-title * {
    filter: drop-shadow(0px 0px 3px #51a400) drop-shadow(0px 0px 2px black);
}

/* Card label drop-shadow */
.card-label {
    filter: drop-shadow(0px 0px 3px rgba(0, 0, 0, .8)) drop-shadow(0px 0px 1px rgba(0, 0, 0, .8));
}

.card:hover .card-label, .card:focus .card-label, .card:active .card-label {
    filter: drop-shadow(0px 0px 4px black) drop-shadow(0px 0px 2px black);
}

/* Button label drop-shadow */
.button forg {
    filter: drop-shadow(0px 0px 2px #51a400) drop-shadow(0px 0px 1px rgba(0, 0, 0, .25));
}

.button:hover forg, .button:focus forg, .button:active forg {
    filter: drop-shadow(0px 0px 3px #51a400) drop-shadow(0px 0px 1px rgba(0, 0, 0, .5));
}


/* BOX SHADOW STYLES */
.card, .panel, .button {
    box-shadow: 0 0 .25rem 0 black, 0 0 .25rem 0 #a9b7d8;
}

.panel:hover,  .panel:focus,  .panel:active,
.button:hover, .button:focus, .button:active {
    box-shadow: 0 0 .5rem 0 black, 0 0 .5rem 0 #a9b7d8;
}

/* Inset box shadow */
.card::after,
.panel-image::after {
    box-shadow: inset 0 0 .5rem 0 black;
    content: "";
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
}



/* ---------------

   CUSTOM ELEMENTS

   --------------- */

/* BUTTONS */
.button-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.button {
    margin: .5rem;
    font-size: 4rem;
    color: white;
    width: 80px;
    height: 80px;
    border-radius: 1rem;
    transition: background .15s, box-shadow .15s;
}

.button forg {
    line-height: 80px;
    transition: background .15s, filter .15s;
}


/* PANELS */
.panel-container {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
}

.panel {
    overflow: hidden;
    margin: 1rem;
    border-radius: 1rem;
    color: white;
    transition: box-shadow .15s;
    flex: .5;
}

.panel-title {
    display: block;
    margin: 0;
    padding: .5rem 0;
    transition: background .15s;
    font-size: 1.25em;
    font-weight: normal;
}

.panel-title h4 {
    font-size: .8em;
}

.panel-title * {
    transition: background .15s, filter .15s;
    margin: 0;
    font-weight: normal;
    line-height: 1.25em;
}

.panel-image {
    position: relative;
    display: flex;
    overflow: hidden;
}

.panel img {
    width: 100%;
    padding: 0;
    margin: 0;
    display: block;
    transition: transform .15s, filter .15s;
    backface-visibility: hidden;
}

.panel:hover img,
.panel:focus img,
.panel:active img {
    filter: brightness(60%);
    transform: scale(1.015);
}

.panel .panel-description {
    padding: 1rem;
    margin: 0;
    transition: background .15s;
    color: black;
    font-weight: normal;
}


/* CARDS */
.card-container {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
}

.card-wrapper {
    flex: .5;
    width: 100%;
}

.card {
    margin: 1rem;
    overflow: hidden;
    transition: filter .15s;
    display: flex;
    position: relative;
    justify-content: center;
    align-items: center;
    border-radius: 1rem;
}

.card::after {
    border-radius: 1rem;
}

.card-label {
    line-height: 2.5rem;
    position: absolute;
    z-index: 1;
    padding: 0;
    font-weight: normal;
    transition: background .15s, filter .15s, font-size .15s;
    text-align: center;
}

.card img,
.card video {
    display: block;
    padding: 0;
    margin: 0;
    filter: brightness(60%);
    transition: filter .15s, transform .15s;
    transform: scale(1.01);
    width: 100%;
}

.card:hover img, .card:hover video,
.card:focus img, .card:focus video,
.card:active img, .card:active video {
    filter: brightness(40%);
    transform: scale(1.025);
}


/* TABLES */
.table-container {
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
}



/* -----------

   PAGE STYLES

   ----------- */

/* HEADER BAR */
/* Header buttons */
#header-wrapper {
    position: fixed;
    width: 100%;
    transition: top .3s ease-in-out;
    z-index: 2;
}

#header-wrapper::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 170px;
    background-image: url(./assets/media/header-leaves.gif);
    background-image: url(./assets/media/header-leaves.webp);
    background-repeat: repeat-x;
    background-position: bottom;
    filter: drop-shadow(0 0 .8rem black);
    transition: height .5s ease-in-out;
}

#header-container {
    margin: 0 auto;
    padding: 0;
    width: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: padding .3s ease-in-out;
}

/* Header drop-down menu */
#menu-button {
    display: none;
    position: absolute;
    width: 40px;
    height: 40px;
    top: 1rem;
    left: 1rem;
    z-index: 5;
    cursor: pointer;
}

#menu-button-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: filter .15s;
}

#menu-button span {
    width: 100%;
    height: 20%;
    display: inline-block;
    transition: background .15s, transform .15s, opacity .15s;
    overflow: hidden;
}

#menu-button span:before {
    content: "";
    display: block;
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: background .15s, transform .15s, height .15s;
}

#menu-button.open .bar-1 {
    transform: translate(0, 16px) rotate(45deg);
}

#menu-button.open .bar-1:before {
    transform: translate(0, -16px) rotate(-45deg);
    height: 40px;
}

#menu-button.open .bar-2 {
    opacity: 0;
}

#menu-button.open .bar-3 {
    transform: translate(0, -16px) rotate(-45deg);
}

#menu-button.open .bar-3:before {
    transform: translate(0, -16px) rotate(45deg);
    height: 40px;
}

#header-menu {
    position: absolute;
    width: 100vw;
    top: 0;
    left: 0;
    z-index: 1;
    opacity: 0;
    transition: opacity .15s;
}

#header-menu.expanded { opacity: 1; }
#header-menu.contracted { transition-delay: .15s; }

#menu-list::before {
    position: relative;
    content: "";
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: linear-gradient(#a5e026, #75be0c);
    transition: height 0;
}

#header-menu.expanded #menu-list::before {
    height: 70px; transition-delay: 0;
}

#header-menu.contracted #menu-list::before {
    transition-delay: .3s;
}

#menu-list {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    top: 100%;
    left: 0;
    width: 100vw;
    box-shadow: 0 -10px 10px 10px black;
    background: #75be0c;
}

#logo {
    position: relative;
    margin: .6em 0 .8em;
    background-image: url(./assets/media/logo.gif);
    background-image: url(./assets/media/logo.webp);
    background-image: url(./assets/media/logo.heic);
    background-repeat: no-repeat;
    background-position: center;
    width: 244px;
    height: 51px;
    z-index: 5;
    transition: margin .5s ease-in-out, filter .15s, background .15s;
    outline: none;
}

#header-links {
    width: 100vw;
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    z-index: 2;
    font-size: 1.25em;
    letter-spacing: 1px;
    line-height: 1em;
    transition: all .3s;
    -webkit-transition: all .3s;
}

.header-button {
    position: relative;
    padding: 0 .6em;
    text-decoration: none;
    color: white;
    font-size: 1em;
    transition: color .15s, filter .15s, background .15s, height .15s, margin .15s;
    box-sizing: border-box;
}

#header-menu .header-button {
    width: 100%;
    height: 0;
    font-size: 2rem;
    line-height: 2rem;
    overflow: hidden;
}

#header-menu.expanded .header-button {
    height: 2rem;
    margin: .25rem;
}


/* PAGE */
#page-wrapper {
    position: absolute;
    margin: 0 auto;
    top: 0;
    left: 25%;
    width: 50%;
    min-height: 100%;
    font-size: 1.2em;
    background: white;
    box-shadow: 0 0 3em 6em white;
    box-sizing: content-box;
    transition: left .3s ease-in-out, width .3s ease-in-out;
    -webkit-transition: left .3s ease-in-out, width .3s ease-in-out;
}

#page-container {
    overflow-y: auto;
    margin: 9rem 0 1rem;
    padding-top: 3rem;
    transition: margin-top .3s ease-in-out;
    -webkit-transition: margin-top .3s ease-in-out;
}


/* FOOTER */
#footer-wrapper {
    position: -webkit-sticky;
    position: sticky;
    bottom: 0;
    width: 100%;
    padding: 0.2em 0;
    background: white;
    color: darkgrey;
    font-size: .9rem;
    transition: left .3s ease-in-out, width .3s ease-in-out, font-size .3s ease-in-out;
    z-index: 10;
}

#footer-wrapper::after {
    position: absolute;
    content: "";
    width: 100%;
    height: 50%;
    left: 0;
    top: -50%;
    background: linear-gradient(rgba(255, 255, 255, 0), white);
}



/* -------------

   MEDIA QUERIES

   ------------- */
   
@media only screen and (min-width: 2000px) {
    body { font-size: 1.25em; }
    #header-wrapper::after { height: 180px; }
    #header-links { line-height: 1.25em; }
    #page-container { margin-top: 10rem; }
}

@media only screen and (max-width: 1500px) {
    h3 { margin-top: 1rem; }
    h3, h4 { padding: 0; }
    #header-wrapper::after { height: 120px; }
    #menu-button { display: initial; }
    #logo { margin-top: .5em; }
    #header-links { font-size: 1em; display: none; }
    #page-wrapper { left: 0; width: 100%; }
    #page-container { padding: 0 3em; }
    #footer-wrapper { font-size: .8rem; }
    .panel, .card-wrapper { flex: 1; }
}

@media only screen and (max-width: 750px) {
    h2 { font-size: 2rem; }
    h3 { margin-top: .5rem; }
    body { font-size: .8rem; }
    #header-wrapper::after { height: 120px; }
    #page-container { margin-top: 120px; padding: 0 1rem 1rem 1rem;}
    .panel-container, .card-container { flex-direction: column; }
    .panel, .card { margin: .5rem 0; }
}