
:root {                           /* items in 'root' are global, since 'root' targets the top-most, parent element <HTML> */
    --primary-color: #fce138;
    --secondary-color: #024e76;
    --tertiary-color: #39a6b2;
}

/* Remove the default HTML style assumptions. */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;   /* include border and padding in determining the size of elements */
}

/* Define the main body style */
body{
    color: var(--tertiary-color);
    font-family: Helvetica, Arial, sans-serif;
}

/* Define the style for the header  */
header {
    /* 20 pixels top & bottom, 35 pixels left & right */
    padding: 20px  35px;     
    background-color: var(--tertiary-color);
    display: flex;                      /* applies to the whole header */
    justify-content: space-between;     /* puts the extra space between the <h1> and <nav> elements. */
    flex-wrap: wrap;                    /* lets the <nav> elements spill to a 2nd (or more) line(s) if needed. */
    position: -webkit-sticky;           /* for Safari */
    position: sticky;                   /* prevents the header from scrolling off the top of the window */
    top: 0;                             /* tells the browser where to stick the header element */
    /* Copied from ".hero" below so that the "header" looks like it is part of the "hero" area. */
    background-image: url("../images/hero-bg.jpg");
    background-size: cover;             /* avoid clipping the image */
    background-attachment: fixed;
    background-position: 80%;

    z-index: 9999;                      /* so the header is always on top */
}
j
/*  This only applies to the "h1" tag of the "header"  */
header h1 {
    font-weight: bold;
    margin: 0;
    font-size: 36px;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.85);  /* the last value is transparency, 1 is opaque, 0 is fully transparent. */
    /* display: inline;     /* not really needed with the 'display: flex' above */
}

/* Define the style for the "anchors" in the header */
/* If we don't specify "none", links will be underlined blue. */
header a {
    text-decoration: none;
    color: var(--primary-color);
}


/* Move the "nav" elements to the right. */
header nav {
    /* float: right;     /* not really needed with the 'display: flex' above */
    margin: 7px 0;
}


/* Make the "list elements" all use a flexbox */
header nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;                /* vertically center items in the <nav> element. */
    list-style: none;                   /* turn off bullet point icons */
}

/* Define the decoration of the header links. */
header nav ul li a {
    padding: 10px 15px;    /* added to replace 'margin' for better viewing with media-queries */
    font-weight: lighter;
    font-size:  1.55vw;    /* vw = viewport width, here 1.55% of window width */
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.85);

}

header nav ul li a:hover {         /* change the button when the mouse hovers over it */
    background: var(--primary-color);
    color: var(--secondary-color);
    border-radius: 15px;
    text-shadow: none;
}

/* ************************************************************************** */
/* Style the footer area. */
footer {
    background: var(--primary-color);
    padding: 40px 35px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

/* Apply styles to the "h2" element. */
footer h2 {
    color: var(--secondary-color);
    font-size: 30px;
    margin: 0;
    /* display: inline;     /* not really needed with the 'display: flex' above */
}

/* Apply a style to the "div" element which defines the rest of the footer.  */
footer div {
    line-height: 1.5;
    text-align: right;
    /* float: right;  /* not really needed with the 'display: flex' above */
}

footer a {
    color: var(--secondary-color);
}

/* Overall padding for all "section" elements. */
section {
    padding: 60px;

}

/* *********************************************************** */
/* Styling for the "hero" section of the page. */
.hero {
    background-image: url("../images/hero-bg.jpg");
    background-size: cover;  /* avoid clipping the image */
    background-attachment: fixed;
    background-position: 80%;
    display: flex;
    justify-content: center;    /* positions elements as close to the center of the screen as possible */
    flex-wrap: wrap;
    align-items: flex-start;    /* added for media-queries */
}

h3 {
    font-size: 22px;
    margin: 0px;
}

.hero-content {
    width: 35%;
    text-align: right;
    margin: 3.5%;
    color: #fff;
    font-size: 18px;
    line-height: 1.2;          /* added for media-queries */
}

.hero-content h2 {
    font-size: 55px;
    font-style: italic;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.85);
}

.hero-content p {

    color: white;
}

/* End of "hero" styling. */

/* Styling for the hero input form. */
.hero-form {
    color: var(--secondary-color);
    background-color: rgba(252,225,56,0.7);       /* primary color with transparency */
    padding: 20px;
    border-style: solid;
    border-width: 3px;
    border-color: var(--secondary-color);
    width: 40%;  
    margin: 3.5%;
    box-shadow:0 0 10px rgba(0, 0, 0, 0.5);
    border-radius: 20px;
}

.hero-form p {
    margin-top: 5px;
    margin-bottom: 15px;
}

.hero-form label {
    margin: 0 5px;
}

.hero-form button {
    color: var(--primary-color);
    background-color: navy;
    font-size: 16px;
    padding: 10px 20px;
    border-radius: 10px;
}

.hero-form button:hover {         /* style for mouse hover */
    background-color: var(--tertiary-color);
}

.form-input {
    border: 1px solid var(--secondary-color);
    display: block;          /* extend to fill the entire container width. */
    padding: 7px 15px;
    font-size: 16px;
    color: var(--secondary-color);
    width: 100%;
    margin-bottom: 15px;
    border-radius: 10px;
    background-color: rgba(255,255,255, 0.75);  /* make the cell slightly transparent */
}

.form-input:focus {
    background-color: rgba(255,255,255, 1);   /* make the cell opaque */
    outline: none;                              /* remove the browser's default styling border */
}

.checkbox-wrapper input, .radio-wrapper input {
    opacity: 0;                                 /* make the default radio buttons and checkbox items disappear */
}

.checkbox-wrapper label, .radio-wrapper label {
    position: relative;
    left: 10px;
    margin: 10px;
    line-height: 1.6;
}

.checkbox-wrapper label::before, .radio-wrapper label::before {
    content: "";
    height: 20px;
    width: 20px;
    background: rgba(255,255,255, 0.75);
    border:  1px  solid var(--secondary-color);
    position: absolute;
    top: -4px;
    left: -30px;
}

.radio-wrapper label::before {
    border-radius: 50%;              /* make the button a circle */
}

.radio-wrapper label::after{         /* style when checked/activated */
    content: "";
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--secondary-color);
    position: absolute;
    left: -29px;
    top:  -3px;
    background-image: radial-gradient(circle, var(--tertiary-color), var(--secondary-color));
}

.checkbox-wrapper label::after{      /* style when checked/activated */
    content: "";
    height: 6px;
    width: 14px;
    border-left: 2px solid var(--secondary-color);      /* these two lines are two sides of a rectangle */
    border-bottom: 2px solid var(--secondary-color);
    position: absolute;
    left: -26px;
    top: 1px;
    transform: rotate(-58deg);                          /* rotate the rectangle so it looks like a check mark */
}

.checkbox-wrapper input + label::after, 
.radio-wrapper input + label::after {
  content: none;
}

.checkbox-wrapper input:checked + label::after, 
.radio-wrapper input:checked + label::after {
  content: "";
}

/* End of "hero-form" styling. */

/* Define a few general styles for the following four sections. */
/* These are 'utility' classes. */
.section-title {
    font-size: 48px;       /* reduced for media-queries */
    border-bottom: 3px solid;
    color: var(--secondary-color);
    padding-top: 25px;
    padding-bottom: 20px;
    text-align: center;
    margin: 0 auto 35px auto;
    width: 50%;
}

.primary-border {
    border-color: var(--primary-color);
}

.secondary-border {
    border-color: var(--tertiary-color);
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.flex-row {
    display: flex;
}
/* End of general styles. */

/* Styling for What we/you do section. */
.intro p {
    line-height: 1.7;
    color: var(--tertiary-color);
    width: 80%;
    font-size: 20px;
    /* This next line will center the block. The top and bottom margins will be zero and the left & right will be auto. */
    margin: 0 auto;    
    text-align: center;
}
/* End of styles for "What we do Section". */

/* Style the "what you do" section. */
.steps {
    background: var(--primary-color);
}

.step {
    margin: 50px auto;
    padding-bottom: 50px;
    width: 80%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.step-info {
    display: flex;
    flex-wrap: wrap;
    flex: 2 70%;    /* flex-grow, flex-basis */
    align-items: center;
}

.step-img {
    flex: 1 12%;
    margin-right: 20px;
}

.step-img img {
    max-width: 100%;
}

.step-text{
    flex: 12;
}

.step h3 {
    color: var(--secondary-color);
    font-size: 46px;
    flex: 1 30%;    /* flex-grow, flex-basis */
}

.step-text p {
    color: var(--tertiary-color);
    font-size: 18px;
}

.step-text h4 {
    font-size: 26px;
    line-height: 1.5;
    color: var(--secondary-color);
}

.step:not(:last-child) {     /* put a bottom border below every child, except the last one */
    border-bottom: 1px solid var(--tertiary-color);
}

/* End of styles for the "what you do" section. */

/* Style the "trainer" section. */

.trainers {
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    overflow: auto;    /* tells the parent element there is content inside and handle any floating elements. */
}
.trainer {
    margin: 20px;
    background: var(--secondary-color);
    color: var(--primary-color);
    flex: 1;      /* any extra space will be shared evenly */
}

/* .trainer:hover span {
    opacity: 1;
    transition-duration: 2s;
}  */

.trainer-img {
    width: 100%;
    min-height: 300px;
    background-size: cover;  /* avoid clipping the image */
    display: flex;
    padding: 15px;
    align-items: flex-end;
    position: relative;
    overflow: hidden;        /* to hide the h3 and h4 text, the trainer names */
}

.trainer-img h3 {
    position: relative;
    z-index: 900;
    font-size: 28px;
    margin-bottom: 5px;
    top: 200px;              /* move the text to the outside, which hides it due to the above 'overflow' */
}

.trainer-img h4 {
    position: relative;
    z-index: 900;
    font-size: 22px;
    top: 200px;              /* move the text to the outside, which hides it due to the above 'overflow' */
}

/* Use a pseudo-element to inject a background on top of the image that we can then manipulate with the 'transition' animation control. */
.trainer-img::after {
    content: "";
    height: 100%;
    width: 100%;
    background: linear-gradient( rgba(252, 225, 56, 0.3), var(--secondary-color));
    opacity: 0;                    /* the starting state for animation */
    position: absolute; 
    top: 0;
    left: 0;
}


.trainer:hover .trainer-img h3, .trainer:hover .trainer-img h4 {
    top: 0px;                      /* move the h3/h4 text back into position with the animation */
    opacity: 1;                    /* the ending state for animation of the text*/
    transition-duration: .6s;
}

.trainer:hover .trainer-img::after {
    opacity: 1;                    /* the ending state for animation of the background*/
}

.trainer-1 {
    background-image: url("../images/trainer-1.jpg");
}

.trainer-2 {
    background-image: url("../images/trainer-2.jpg");
}

.trainer-3 {
    background-image: url("../images/trainer-3.jpg");
}

.trainer-bio {
    padding: 25px;
    line-height: 1.3;
}

.trainer-bio h3 {
    font-size: 28px;
    display: none;        /* removed from the display, needed for animation and media-query conflict */
}

.trainer-bio h4 {
    font-weight: lighter;
    font-size: 22px;
    margin-bottom: 15px;
    display: none;        /* removed from the display, needed for animation and media-query conflict */
}

.trainer-bio p {
    font-size: 17px;
}

/* End of styles for "trainer" section. */

/* Styles for "about us / Reach Out" section. */
.contact{
    background: var(--secondary-color);
}

.contact h2 {
    color: var(--primary-color);
}

.contact-info {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

/* "*" Select all children of "contact-info" */
/* ">" Select direct children first */
.contact-info > * {  
    flex: 1;
    margin: 15px;
}

.contact-info iframe {
    height: 450px;
    /* width:  600px; */

}

.contact-info div {
    color: white;
}

.contact-info h3 {
    color: var(--primary-color);
    font-size: 32px;
}

.contact-info p, .contact-info address {
    margin: 20px 0;
    line-height: 1.5;
    font-size: 16px;
    font-style: normal;
}

.contact-info a {
    color: var(--primary-color);
}


.contact-form button {
    width: 100%;
    border: none;
    color: var(--secondary-color);
    background-color: #fce135;
    text-align: center;
    font-size: 16px;
    padding: 15px 0;
    font-weight: bold;
    border-radius: 10px;
}

.contact-form button:hover {
    color: var(--primary-color);
    background: var(--tertiary-color);
}

.contact-form input, .contact-form textarea {
    border: 1px solid var(--secondary-color);
    display: block;
    padding: 7px 15px;
    font-size: 16px;
    color: var(--secondary-color);
    width: 100%;
    margin-bottom: 15px;
    margin-top: 5px;
    border-radius: 10px;
    background-color: rgba(255,255,255, 0.75);
}

.contact-form input:focus, .contact-form textarea:focus {
    background-color: rgba(255,255,255, 1);
    outline: none;
}


/* End of styles for "about us" section. */

/* Define the styles for the Service Plans Grid. */

.services {
    background: var(--primary-color);
}

.service-grid-wrapper {
    display: flex;
    width: 100%;
    justify-content: center;
}

.service-grid-container {
    background: lightyellow;
    width: 80%;
    display: grid;                      /* this sets up a CSS grid */   /* 'fr' is a fractional unit */
    grid-template-columns: 1fr repeat(2, 4fr);  /* 1 column, then 2 the same because of repeat (iterator, size) */
    grid-template-rows: repeat(5, 1fr) 2fr;     /* 6 rows, 5 the same, 1 double the size of the first 5 */
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
    font-size: 1.2rem;
}

.service-grid-item {
    padding: 15px 0;
    border: 2px solid var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* specific match */
.service-grid-item.basic {
    grid-column: 2 / span 1;
}

.service-grid-item.both {
    grid-column: 2 / span 2;
}

.service-grid-item.cancel {
    writing-mode: vertical-lr;
    grid-column: 1;
    grid-row: 1 / -1;
    transform: rotate(180deg);
}

.grid-head, .grid-price, .service-grid-item.cancel {
    font-size: 1.5 rem;
    font-weight: bold;
}
/* End of the styles for the Service Plans Grid. */


/* Define the 'media query' styles.  */
/* Media queries should always be last in the style sheet. */
/* Media query style for smaller desktop screens and smaller than 980. */
@media screen and (max-width: 980px) {
    header {
        padding-bottom: 0;   
        justify-content: center; 
        position: relative;            /* this will undo the 'sticky' business for the header */
    }

    header h1 {
        width: 100%;
        text-align: center;
    }

    header nav ul {
        margin-top: 20px;
        width: 100%;
        justify-content: center;
    }
    
    header nav ul li a {
        font-size: 20px;
    }
    
    header h2, footer div {
        text-align: center;
        width: 100%;
    }

    .hero-content, .hero-form {
        width: 100%;
    }

    .hero-content {
        text-align:  center;
    }

    .section-title {
        width: 80%;
    }

    .trainer {
        flex: 0 70%;
    }

    .contact-info iframe {
        flex: 1 100%
    }

    footer h2, footer div {
        text-align: center;
        width: 100%;
    }
}  /* End of Media query style for smaller desktop screens and smaller than 980. */

/* Media query style for tablets and smaller than 768. */
@media screen and (max-width: 768px) {
    section {
        padding: 30px 15px;    /* vertical padding is 30px, horizontal padding is 15px */
    }

    .step h3 {
        flex: 1 100%;
        text-align: center;
    }

    .step-info {
        flex: 2 100%;
        text-align: center;
        justify-content: center;
    }

    .step-img {
        flex: 0 32%;
        margin-right: 0;
        margin-top: 15px;
        margin-bottom: 15px;
    }

    .step-text {
        flex: 100%;
    } 

    .service-grid-container {
        grid-template-columns: 1fr 1fr;  /* create 2 equal columns */
    }

    .service-grid-item.basic {
        grid-column: 1;
    }

    .service-grid-item.both {
        grid-column: 1 / -1;           /* to make the spaning row start in column 1 */
    }

    .service-grid-item.cancel {
        transform: none;               /* turn off font manipulation & change to a row */
        writing-mode: unset;
        grid-column: 1 / -1;
        grid-row: -1;
    }

    .trainer-img h3, .trainer-img h4, .trainer-img::after {
        display: none;                 /* turn off the animation on the trainer cards for smaller displays */
    }

    .trainer-bio h3, .trainer-bio h4 {
        display: block;
    }
}  /* End of Media query style for tablets and smaller than 768. */

/* Media query style for mobile phones and smaller than 575. */
@media screen and (max-width: 575px) {
  
    .hero-form button {
        width: 100%;
    }

    .section-title {
        width: 95%;
    }

    .intro p {
        width: 100%;
    }

    .trainer {
        flex: 0 100%;
    }

    .contact-info {
        text-align: center;
    }

    .contact-info > * {
        flex: 0 100%;
    }

    .contact-form {
        order: 3;          /* switch the HTML order so this form is last */
    }
}  /* End of Media query style for mobile phones and smaller. */

