/*css reset rule*/
* {
    margin: 0; padding: 0; border: 0; box-sizing: border-box;
}

/* html ruleset */
/* html could also be used instead of :root*/
:root {
    font-size: 62.5%; /*10/16, 16 is typically the default font size on a browser. Using the root unit of measurement */
    min-height: 100vh; /* to ensure that the page fills up the height of the device */
    --color-accent1: rgb(102,178,178);/* css variable to easily change the color on all over the page, just change the color in one place*/
    --page-background: rgb(235, 235, 235);/*color for background pages*/
    --text-content-color: rgb(70, 70, 70);/*for pages' text content*/
    --dark-background-headlines: rgb(210, 210, 210);/* for h1, h2, h3...*/
    --header-min-height: 35vh;
    --footer-anchor-height: 40px; /* min-height of anchors in the footer */
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--page-background);
    /* border-top: 15px solid var(--color-accent1); var is referencing the color accent variable */
    border-bottom: 15px solid var(--color-accent1);
    min-height: 100vh; /* viewport height, visible space on the screen */
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 1.4rem;
    color: var(--text-content-color);
    position: relative;
}

header {
    background-image: url(../images/heroimage.jpg);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    padding: 10px;
    min-height: var(--header-min-height);
    overflow: hidden;
    color: var(--page-background);
    position: relative;
}

/*============  pseudo element on the header ====================*/
header::after {
    content: "";
    position: absolute;
    display: none;
    border-radius: 50%;
    top: -50%; 
    right: -50%;
    bottom: -50%;
    left: -50%;
    background: linear-gradient(to right, var(--text-content-color), rgba(255,255,255,0.2) 50%, rgba(210, 210, 210, 0.2));
    transform: rotateZ(60deg) translate(-100%); /* translate uses the x, y coordinates. If only one value is used the other one is set to 0*/
}

header:hover::after {
    animation-name: heroeffect;
    animation-duration:  3s;
    display: block;
}

/* add the @keyframes keyword so that the animation can work */
@keyframes heroeffect {
   100% {
        transform: rotateX(-90deg) translate(1em, -9em);
    }
}

/* reference font-family to a Google font */
h1 {
    font-family: 'Pacifico', 'cursive';
    color: var(--dark-background-headlines);
    font-size: 4rem; 
    text-align: center;
    letter-spacing: 2px;
    text-shadow: 2px 2px 2px var(--text-content-color), -3px 2px 15px var(--dark-background-headlines);
    margin: .5em;
}

/* the plus (+) sign points to the paragraph that is next to/adjancent to the h1.
If another html element is entered between the styles won't be applied */
h1 + p {
    font-size: 3rem;
    text-align: center;
    font-family: Georgia, 'Times New Roman', Times, serif;
    letter-spacing: 3px;
    margin-top: -5px;
    margin-bottom: 15px;
    font-size: 2.5rem;
    color: var(--dark-background-headlines);
    filter: blur(0.8px);
}

/* to style text between the span tag */
h1 + p > span {
    font-size: 2.5rem;
    color: var(--dark-background-headlines);
    text-transform: uppercase;
    filter: blur(0.8px);
}

.tagline {
    font-size: 20px;
}

/* header nav menu */
nav#header-nav {
    display: block;
    margin-top: 8px;
}

/* unordered list/ ul */
#header-nav-menu {
    display: flex;
    justify-content: flex-end;
}

#header-nav-menu > li {
    display: inline-block;
    margin-right: 12px;
    padding: 6px;
}

#header-nav-menu > li:hover {
    box-shadow: 2px 2px 8px var(--color-accent1);
}

#header-nav-menu > li > a {
    color: var(--dark-background-headlines);
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    text-transform: uppercase;
}

#header-nav-menu > li > a:hover {
    color: var(--color-accent1);
}

main {
    padding: 0px 8px 12px 8px;
    position: relative;
    margin: 80px;
}

/* =============================== main pseudo elements =====================================*/
main::before{
    content: "";
    display: block;
    position: absolute;  top: -60px; left: 4px;
    border-top: 30px solid rgb(100, 100, 100);
    border-radius: 50px;
    width: 100%; height: 180px;
    background-color: transparent;
    z-index: -3;
}

main::after {
    content: "";
    display: block;
    position: absolute; bottom: -60px; right: -4px;
    border-bottom: 30px solid rgb(100, 100, 100);
    border-radius: 50px;
    width: 100%; height: 180px;
    z-index: -4;
}
/*============================================ end of main pseudo elements ========================= */

/* child selector ( > ). In my index page the0 nav tag in the main section is a direct child of the main tag */
#open-mobile-menu-icon  {
    display: none;
}

main > nav > ul {
    list-style-type: none;
    display: flex;
    flex-flow: row wrap;
}

main > nav > ul > li  {
    width: 50%;
}

main > nav > ul > li > a {
    --box-shadow-color: rgb(100, 100, 100);/*local variable to be used only within this selector */
    display: block;
    text-align: center;
    padding: 12px 8px;
    margin: 12px;
    text-decoration: none;
    background-color: var(--color-accent1);
    color: var(--text-content-color);
    box-shadow: 3px 3px 3px var(--box-shadow-color);
    font-size: 2rem;
    border-left: 5px solid var(--text-content-color);  
    position: relative;
}

#about-me-on-mobile{
    display: none;
}

#contact-me-on-mobile{
    display: none;
}

#submenu-list1-parent > a {
    margin-bottom: 0px;
    margin-top: 12px;
    margin-right: 9px;
}

.submenu-list1-arrow {
    position: absolute; top: 14px; right: 10px;
    transform: rotate(180deg);
    transition: transform 150ms ease-out;
    font-size: 2.5rem;
}

#submenu-list1 {
    border-left: 5px solid var(--text-content-color);
    background: var(--color-accent1);
    position: absolute; right: 16px;  
    width: 48%;
    display: none;
    list-style-type: none;
}

#submenu-list1  > li > a {
    display: block;
    text-align: center;
    text-decoration: none;
    width: 100%;
    padding: 18px;
    font-size: 1.8rem;
    color: var(--text-content-color);
    position: relative;
    border-top: 2px solid var(--text-content-color);
}

#submenu-list1 > li > a:hover {
    color: var(--color-accent1);
}

#submenu-list1-parent:hover #submenu-list1{
    display: block;
}

#submenu-list1-parent:hover .submenu-list1-arrow {
    transform: rotate(0deg);
}

/* add a tool tip to the anchor tag that has the data-tool-tip attribute*/
a[data-tool-tip] {
    position: relative;
}

/** this creates the pseudo element that contains the tool tip */
a[data-tool-tip]::after {
    content: attr(data-tool-tip);
    display: block;
    position: absolute;
    background-color: rgba(70, 70, 70, 0.9);
    padding: 1em 1em;
    color: var(--dark-background-headlines);
    bottom: 0; /*  of the anchor tag element */
    left: 0;
    white-space: nowrap; /* will display the text within the tool tip in just one line of text */
    transform: scale(0); /* so it won't be display until I hover it */
    transition: transform ease-out 300ms,
                bottom ease-out 300ms;
}

a[data-tool-tip]:hover::after{
    transform: scale(1); /* the tool tip will display when I hover  the link */
    bottom: 100%;
    left: -5px;
}

main nav a:hover {
    color: var(--color-accent1);
    background-color: var(--text-content-color);
    font-weight: bold;
    border-top-left-radius: 0px;
}

/* ======================= services =====================  */
.services-container {
    margin: 0px auto;
    background-color: var(--page-background);
    width: 80%; height: 90vh;
    display: flex;
    flex-flow: row wrap;
}

/*========= child one of services-container============= */
.services {
    display: flex;
    flex-flow: row wrap;
    width: 100%;
    color: var(--text-content-color);
    padding: 10px; /* so that there is some space around the p elements */
}

.services-items {
    flex-grow: 2;
    flex-shrink: 0;
    flex-basis: 50%;
    font-size: 24px;
    font-weight: bold;
    padding: 20px;
}

/*========= child two of services-container============= */
.social-media {
    width: 100%;
    display: flex;
    flex-flow: row wrap;
}

.social-media-item {
    text-align: center;
    padding: 5px;
    font-size: 24px;
    text-decoration: none;
    color: var(--text-content-color);
    flex-grow: 1;
    flex-shrink: 0;
    flex-basis: 33%;
}

/* paragraph leading to social media */
.social-media-item:nth-child(1) {
    flex-grow: 2;
    flex-shrink: 0;
    flex-basis: 100%;
    text-align: center;
    font-size: 24px;
    color: var(--color-accent1);
    font-weight: bold;
}

/*========= child three of services-container============= */
.signup-form {
    width: 100%;
    display: flex;
    flex-flow: row wrap;
}

.subscribe {
    margin: 0px auto;
    padding: 5px;
    text-shadow: 2px 2px 2px var(--color-accent1), -3px 2px 15px var(--dark-background-headlines);
    flex-grow: 2;
    flex-shrink: 0;
    flex-basis: 100%;
}

.subscribe-paragraph {
    font-size: 3rem;
    text-align: center;
    padding: 8px;
    font-family: Georgia, 'Times New Roman', Times, serif;
    letter-spacing: 2px;
    color: var(--color-accent1);
    flex-grow: 2;
    flex-shrink: 0;
    flex-basis: 100%;
    filter: blur(0px);
}

.signup-info {
    width: 100%;
    display: flex; 
    flex-flow: row wrap;
    justify-content: space-around;
}

.signup-info-item {
    border: 2px solid var(--color-accent1);
    height: 50px;
    text-align: center;
    font-size: 18px;
    padding: 8px;
    color: var(--text-content-color);
    border-radius: 4px;
    flex-basis: 33%;
}

.signup-info-item:nth-child(3):hover {
    cursor: pointer;
    background-color: var(--color-accent1);
}

/* ======================== contact form ======================== */
#contact-form-container {
    background-color: var(--page-background);
    width: 80%; height: 80vh;
    margin: 60px auto;
    display: flex;
    flex-flow: row wrap;
}

/* ============ child one of the contact form ======================= */
.contact-paragraph {
    font-size: 3.5rem;
    text-align: center;
    font-family: Georgia, 'Times New Roman', Times, serif;
    letter-spacing: 3px;
    color: var(--color-accent1);
    width: 100%; height: 80px;
    padding: 20px;
    margin-top: 150px;
}

/* ======= child two of the contact form ============ */
.contact-info-items {
    display: flex;
    flex-flow: row wrap;
    width: 50%;
}

label {
    color: var(--text-content-color);
    display: flex;
    flex-flow: row wrap;
    font-size: 24px;
    height: 32px;
    flex-basis: 100%;
}

.contact-info-item {
    margin-top: -48px;
    border: 2px solid var(--color-accent1);
    height: 50px;
    font-size: 18px;
    color: var(--text-content-color);
    border-radius: 4px;
    flex-basis: 75%;
}

/* ========== child three of the contact form ============ */
#message-container {
    display: flex;
    flex-flow: row wrap;
    width: 50%;
}

#message-paragraph {
    color: var(--text-content-color);
    padding: 10px;
    font-size: 24px;
    height: 50px;
    flex-basis: 100%;
    margin-bottom: -8px;
}

#contact-message {
    border: 2px solid var(--color-accent1);
    border-radius: 4px;
    height: 250px;
    padding: 10px;
    font-size: 18px;
    flex-basis: 100%;
}

#submit-contact-info {
    color: var(--text-content-color);
    border: 2px solid var(--color-accent1);
    border-radius: 4px;
    height: 50px;
    flex-basis: 50%;
    margin-bottom: 30px;
    margin-top: 8px;
    font-size: 24px;
}

#submit-contact-info:hover {
    background-color: var(--color-accent1);
    cursor: pointer;
}

/* ====================== footer section ========================= */
/* FOOTER GRID */
.footer-container {
    background-color: var(--page-background);
    width: 80%; min-height: 60vh;
    margin: 32px auto 8px auto;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    grid-template-rows: 200px 1fr;
    grid-template-areas:"title-letters . . ."
                        "links links links links";
    column-gap: 16px;
    row-gap: 16px;
}

/* first child of the footer, it takes all the first row  and it's the parent of the top row
which contains the letters of the title*/
.child-one {
    grid-area: title-letters;
    display: grid;
    grid-template-columns: repeat(21, 1fr);
    grid-template-rows: repeat(12, 1fr);
}

/* letter l ================================================= */
.title-letters:nth-child(1) {
    background-color: var(--text-content-color);
    grid-column: 4/5;
    grid-row: 2/7;
}

.title-letters:nth-child(2) {
    background-color: var(--text-content-color);
    grid-column: 5/7;
    grid-row: 6/7;
}

/* letter a ============================================== */
.title-letters:nth-child(3) {
    background-color: var(--text-content-color);
    grid-column: 8/9;
    grid-row: 2/7;
}

.title-letters:nth-child(4) {
    background-color: var(--text-content-color);
    grid-column: 9/12;
    grid-row: 2/3;
}

.title-letters:nth-child(5) {
    background-color: var(--text-content-color);
    grid-column: 9/11;
    grid-row: 4/5;
}

.title-letters:nth-child(6) {
    background-color: var(--text-content-color);
    grid-column: 11/12;
    grid-row: 2/7;
}

.title-letters:nth-child(7) {
    grid-column: 13/18;
    grid-row: 2/7;
    width: 100%; height: 100%; 
    object-fit: cover;
}

/* letter c ==================================================*/
.title-letters:nth-child(8) {
    background-color: var(--text-content-color);
    grid-column: 3/4;
    grid-row: 8/13;
}

.title-letters:nth-child(9) {
    background-color: var(--text-content-color);
    grid-column: 4/6;
    grid-row: 8/9;
}

.title-letters:nth-child(10) {
    background-color: var(--text-content-color);
    grid-column: 4/6;
    grid-row: 12/13;
}

/* letter o ===========================================================*/
.title-letters:nth-child(11) {
    background-color: var(--text-content-color);
    grid-column: 7/11;
    grid-row: 8/9;
}

.title-letters:nth-child(12) {
    background-color: var(--text-content-color);
    grid-column: 7/8;
    grid-row: 9/13;
}

.title-letters:nth-child(13) {
    background-color: var(--text-content-color);
    grid-column: 8/11;
    grid-row: 12/13;
}

.title-letters:nth-child(14) {
    background-color: var(--text-content-color);
    grid-column: 10/11;
    grid-row: 9/12;
}

/* letter d ================================================= */
.title-letters:nth-child(15) {
    background-color: var(--text-content-color);
    grid-column: 12/16;
    grid-row: 8/9;
}

.title-letters:nth-child(16) {
    background-color: var(--text-content-color);
    grid-column: 13/14;
    grid-row: 9/13;
}

.title-letters:nth-child(17) {
    background-color: var(--text-content-color);
    grid-column: 12/16;
    grid-row: 12/13;
}

.title-letters:nth-child(18) {
    background-color: var(--text-content-color);
    grid-column: 15/16;
    grid-row: 9/12;
}

/* letter e ================================================= */
.title-letters:nth-child(19) {
    background-color: var(--text-content-color);
    grid-column: 17/18;
    grid-row: 8/13;
}

.title-letters:nth-child(20) {
    background-color: var(--text-content-color);
    grid-column: 18/20;
    grid-row: 8/9;
}

.title-letters:nth-child(21) {
    background-color: var(--text-content-color);
    grid-column: 18/20;
    grid-row: 10/11;
}

.title-letters:nth-child(22) {
    background-color: var(--text-content-color);
    grid-column: 18/20;
    grid-row: 12/13;
}

/* it takes all the second row, and it's the parent for the links in the footer */
.child-two{
    grid-area: links;
    display: grid;
    grid-template-columns: repeat(19, 1fr);
    grid-template-rows: 1fr 1fr 1fr 1fr;
}

.footer-links {
    border-bottom: 4px solid var(--text-content-color);
    padding: 6px;
    text-decoration: none;
    text-align: center;
    font-size: larger;
    color: var(--color-accent1);
    font-weight: bold;
    align-self: end;
}

.footer-links:hover {
    color: var(--color-accent1);
    background-color: var(--text-content-color);
    border: 5px solid var(--color-accent1);
    transition: 1s;
}

.socialm-icon {
    margin-bottom: -10px;
    font-size: 2em;
}

.footer-links:nth-child(1) {
    grid-column: 4/7;
    grid-row: 2/3;
}

.footer-links:nth-child(2) {
    grid-column: 9/12;
    grid-row: 2/3;
}

.footer-links:nth-child(3) {
    grid-column: 14/17;
    grid-row: 2/3;
}

.footer-links:nth-child(4) {
    grid-column: 4/7;
    grid-row: 4/5;
}

.footer-links:nth-child(5) {
    grid-column: 9/12;
    grid-row: 4/5;
}

.footer-links:nth-child(6) {
    grid-column: 14/17;
    grid-row: 4/5;
}

.copyright {
    grid-column: 1/20;
    grid-row: 5/6;
    text-align: left;
    margin-top: 32px;
    color:var(--text-content-color);
    align-self: center;
}

/*====================== media queries ============================*/
@media screen and (max-width: 900px) {

    #header-nav-menu > li {
        margin-right: 8px;
    }

    #header-nav-menu > li > a {
        font-size: 1.2rem;
    }
    
    main > nav > ul > li  {
        width: 100%;
    }

    #submenu-list1 {
        width: 94.5%;
    }

    main::before{
        position: absolute;  top: -60px; left: 8px;
    }

    main::after {
        position: absolute; bottom: -60px; right: -8px;
    }

    .services-items {
        flex-basis: 100%;
    }

    .social-media-item {
        flex-basis: 100%;
    }

    .subscribe {
        font-size: 32px;
    }

    .subscribe-paragraph {
        font-size: 1.8rem;
    }

    .signup-info {
        flex-flow: column wrap;
        padding: 16px;
    }

    .singup-info-item {
        flex-basis: 100%;
    }

    #contact-form-container {
        margin: 260px auto;
    }

    /* div container */
    .contact-info-items {
        margin: 60px auto;
        width: 100%;
    }

    label {
        font-size: 18px;
    }

    .contact-info-item {
        height: 32px;
        font-size: 18px;
        flex-basis: 100%;
        margin-top: 0px;
    }

    #message-container {
        width: 100%;
    }

    #message-paragraph{
        margin-bottom: 0px;
    }

    #submit-contact-info {
        flex-basis: 100%;
    }

    /* container for the letters of the title will take three columns */
    .footer-container {
        grid-template-areas:"title-letters title-letters title-letters ."
                            "links links links links";
        margin-top: 360px;
        margin-bottom: 8px;
    }

    .child-two{
        grid-template-columns: repeat(10, 1fr);
        grid-template-rows: 1fr 1fr 1fr;
        row-gap: 10px;
    }

    .footer-links:nth-child(1) {
        grid-column: 2/5;
        grid-row: 1/2;
    }
    
    .footer-links:nth-child(2) {
        grid-column: 2/5;
        grid-row: 3/4;
    }

    .footer-links:nth-child(3) {
        grid-column: 2/5;
        grid-row: 2/3;
    }
    
    .footer-links:nth-child(4) {
        grid-column: 6/9;
        grid-row: 2/3;
    }
    
    .footer-links:nth-child(5) {
        grid-column:  6/9;
        grid-row:  1/2;
    }
    
    .footer-links:nth-child(6) {
        grid-column: 6/9;
        grid-row: 3/4;
    }
    
    .copyright {
        font-size: smaller;
        grid-column: 1/11;
        grid-row: 4/5;
    }

}
/* end of media queries for 900px screens */

@media screen and (max-width: 400px) {

    /* header nav menu */
    nav#header-nav {
        display: none;
    }

    /* menu icon */
    #open-mobile-menu-icon{ 
        border: 1px solid var(--dark-background-headlines);
        display: block;
        position: absolute; top: 8px; left: 8px;
        width: 40px; height: 40px;
        color: var(--dark-background-headlines);
        background-image: url(../images/menu-open.png);
        background-position: center;
        background-repeat: no-repeat;
        background-size: 100%;
    }

    main {
        display: block;
        margin: 0px;
        padding: 0px;
        position: static; top: 270px; left: 0px;
        width: 100%;
    }

    /* =============================== main pseudo elements =====================================*/
    main::before{
        position: absolute;  top: -60px; left: 30px;
        display: none;
    }

    main::after {
        position: absolute; bottom: -60px; right: -30px;
        display: none;
    }
    /*============================================ end of main pseudo elements ========================= */
    
    main .main-mobile-menu {
        background-color: var(--page-background);
        flex-flow: column wrap;
        width: 100%;
        transition: left 2s ease-in-out;
    }

    /* styles for mobile menu when is closed */
    main .closed {
        position: absolute; left: -500px;
    }

    main > nav > ul > li > a {
        --box-shadow-color: none;
        display: block;
        text-align: left;
        padding: 12px 12px;
        margin: 0px;
        text-decoration: none;
        background-color: var(--color-accent1);
        color: var(--text-content-color);
        box-shadow: none;
        font-size: 2.5rem;
        border-left: none;  
        border-top: 1px solid var(--text-content-color);
    }

    #about-me-on-mobile{
        display: block;
    }
    
    #contact-me-on-mobile{
        display: block;
    }

    .submenu-list1-arrow {
        display: none;
    }

    #submenu-list1-parent > a {
        margin-top: 0px;
        margin-right: 0px;
    }

    #submenu-list1 {
        border-left: 0px;
        position: absolute; right: 0px; 
        margin-left: 0px;
        width: 100%;
        display: block;
    }

    #submenu-list1  > li > a {
        text-align: left;
        text-indent: 60px;
        border-top: 1px solid var(--text-content-color);
    }

 /* tool tip won't be displayed on screens less than 400px wide*/
    a[data-tool-tip]:hover::after{
        display: none;
    }

    /* container for the letters of the title will take four columns */
    .footer-container {
        grid-template-areas:"title-letters title-letters title-letters title-letters"
                            "links links links links";
    }

    .child-two{
        grid-template-columns: repeat(10, 1fr);
        grid-template-rows: 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
        row-gap: 10px;
    }

    .footer-links:nth-child(1) {
        grid-column: 3/9;
        grid-row: 1/2;
    }
    
    .footer-links:nth-child(2) {
        grid-column: 3/9;
        grid-row: 2/3;
    }

    .footer-links:nth-child(3) {
        grid-column: 3/9;
        grid-row: 3/4;
    }
    
    .footer-links:nth-child(4) {
        grid-column: 3/9;
        grid-row: 4/5;
    }
    
    .footer-links:nth-child(5) {
        grid-column: 3/9;
        grid-row: 5/6;
    }
    
    .footer-links:nth-child(6) {
        grid-column: 3/9;
        grid-row: 6/7;
    }
    
    .copyright {
        font-size: x-small;
        grid-column: 1/11;
        grid-row: 7/8;
    }

}