/* Root pseudo-class defining color scheme */
:root {
    --primary-color: #d1d1e0;
    --secondary-color: #001a33;
    --tertiary-color: #336699;
}

/* default page style */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background: var(--primary-color);
    color: var(--secondary-color);
}

/* default body style */
body {
    color: var(--tertiary-color);
    font-family: Helvetica, Arial, sans-serif;
}
.icon {
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
}

/* utility classes */
.text-left {
    text-align: left;
}
.text-right {
    text-align: right;
}
.flex-row {
    display: flex;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.hide {
    display: none;
}
div[hidden] {
    display: none;
}

/* --------------------------------------------- */
/* Header Style */
/* --------------------------------------------- */
header {
    padding: 10px 35px;
    background-color: var(--tertiary-color);
    background-attachment: fixed;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 9999;
    opacity: 0.9;
}

/* style for h1 inside <header> */
header h1 {
    font-weight: bold;
    font-size: 36px;
    color: var(--primary-color);
    background-color: var(--tertiary-color);
    margin: 0;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* style for anchor elements in the header */
header a {
    text-decoration: none;
    color: var(--primary-color);
    background-color: var(--tertiary-color);
}

/* style for <nav> elements in the header */
header nav {
    margin: 7px 0;
}

header nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    list-style: none;
}

header nav ul li a {
    padding: 10px 15px;
    font-weight: lighter;
    font-size: 1.55vw;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

header nav ul li a:hover {
    background: var(--primary-color);
    color: var(--secondary-color);
    border-radius: 15px;
    text-shadow: none;
    text-decoration: underline;
}

/* --------------------------------------------- */
/* Section Style */
/* --------------------------------------------- */
section { 
    padding: 60px;
    background: var(--primary-color);
}

.section-title {
    font-size: 48px;
    color: var(--secondary-color);
    border-right: 3px solid;
    padding: 10px 20px 20px 5px;
    text-align: left;
    margin: 10px 25px 10px 25px;
    width: 240px;
    display: inline-flex;
    flex-direction: column;
    align-self: flex-start;
    justify-content: flex-start;
}

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

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

a {
    text-decoration-style: double;
    color: var(--secondary-color);
}

/* --------------------------------------------- */
/* Hero Style */
/* --------------------------------------------- */
.hero {
    background-image: url(../images/cherryblossoms.jpg);
    background-size: cover;
    background-position: 70%;
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 150px;
}

/* --------------------------------------------- */
/* About Me Style */
/* --------------------------------------------- */
.about-me{
    background: var(--primary-color);
    display: inline-flex;
    flex-direction: row;
}
.about-me-wrapper {
    display: inline-flex;
    flex-direction: column;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}
.about-me-info {
    line-height: 1.7;
    color: var(--tertiary-color);
    width: 80%;
    font-size: 20px;
    margin: 0 auto;
    text-align: left;
    display: flex;
    flex-direction: column;
}
.about-me img{
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    width: 15%;
    justify-content: left;
}

/* --------------------------------------------- */
/* Skills Style */
/* --------------------------------------------- */
.skills{
    background: var(--primary-color);
    display: inline-flex;
    flex-direction: row;
}
.skills-wrapper {
    display: inline-flex;
    flex-direction: column;
    width: 100%;
    justify-content: flex-start;
    align-items: flex-start;
    flex-wrap: wrap;
}
.skills-info {
    line-height: 1.7;
    color: var(--tertiary-color);
    width: 100%;
    font-size: 25px;
    padding: 0px 30px;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-self: flex-start;
}

/* --------------------------------------------- */
/* Tooltip Styles
/* --------------------------------------------- */

/* Add this attribute to the element that needs a tooltip */
[data-tooltip] {
    position: relative;
    z-index: 2;
    cursor: pointer;
  }
  
  /* Hide the tooltip content by default */
  [data-tooltip]:before,
  [data-tooltip]:after {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }
  
  /* Position tooltip above the element */
  [data-tooltip]:before {
    position: absolute;
    bottom: 150%;
    left: 50%;
    margin-bottom: 5px;
    margin-left: -80px;
    padding: 7px;
    width: 160px;
    border-radius: 3px;
    background-color: #000;
    background-color: hsla(0, 0%, 20%, 0.9);
    color: #fff;
    content: attr(data-tooltip);
    text-align: center;
    font-size: 14px;
    line-height: 1.2;
  }
  
  /* Triangle to point the tooltip */
  [data-tooltip]:after {
    position: absolute;
    bottom: 150%;
    left: 50%;
    margin-left: -5px;
    width: 0;
    border-top: 5px solid #000;
    border-top: 5px solid hsla(0, 0%, 20%, 0.9);
    border-right: 5px solid transparent;
    border-left: 5px solid transparent;
    content: " ";
    font-size: 0;
    line-height: 0;
  }
  
  /* Show tooltip content on hover */
  [data-tooltip]:hover:before,
  [data-tooltip]:hover:after {
    visibility: visible;
    opacity: 1;
  }

/* --------------------------------------------- */
/* Projects Style */
/* --------------------------------------------- */
.projects {
    background: var(--primary-color);
    display: inline-flex;
    flex-direction: row;
}
.project-grid-wrapper {
    display: inline-flex;
    flex-direction: column;
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
}
.project-grid-container {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: minmax(100px, auto);
    color: var(--secondary-color);
    font-size: 1.2rem;
    grid-gap: 20px;
    grid-auto-flow: dense;
    justify-content: center;
}
.project-grid-item {
    padding: 25px 0;
    border: 2px solid var(--secondary-color);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    text-align: center;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}

.project-grid-item > div {
    flex: 1;
}

.project-grid-item img{
    max-width: 100%;
    vertical-align: middle;
    max-height: 400px;
}

.project-grid-item p {
    background: lightgrey;
    color: var(--secondary-color);
    font-size: small;
}

.large {
    grid-column: span 2;
}

.large img {
    max-height: 600px;
}

.project-caption {
    position: absolute;
    bottom: 5px;
    left: 5px;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    padding: 2px;
    width: 50%;
    opacity: 0.85;
    border-radius: 5px;
    flex-wrap: wrap;
    transition: all 0.5s ease-in-out;
    overflow: visible;
}

.project-caption-2 {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: var(--primary-color);
    color: var(--secondary-color);
    padding: 2px;
    width: 45%;
    opacity: 0.85;
    border-radius: 5px;
    font-size: 0.8rem;
    flex-wrap: wrap;
    transition: all 0.5s ease-in-out;
}

.project-caption h3 {
    background: lightgrey;
    color: var(--secondary-color);
    font-size: 0.8rem;
    font-weight: bold;
}
.project-caption p {
    background: lightgrey;
    color: var(--secondary-color);
    font-size: 0.7rem;
}

/* Add an effect when hovering on a project to emphasize cursor position */
.project-grid-item:hover {
    content: "";
    background: lightsteelblue;
    opacity: 0.85;
    border: 5px solid var(--tertiary-color);
    transition: all 0.5s ease-in-out;
}

/* When the project is hovered on, child divs with links and a title and description are shown */
.project-grid-item:hover > .hide {
    display: block;
    transition: all 0.5s ease-in-out;
}

/* --------------------------------------------- */
/* Contact Me Style */
/* --------------------------------------------- */
.contact {
    background: var(--tertiary-color);
    color: var(--primary-color);
    display: flex;
    flex-direction: row;
    flex: 0 1;
}
.contact-wrapper {
    display: flex;
    flex-direction: row;
    width: 100%;
    margin: auto;
    justify-content: left;
    flex-wrap: wrap;
    background: var(--tertiary-color);
    color: var(--primary-color);
}
.contact h2 {
    color: var(--secondary-color);
    background: var(--tertiary-color);
}

.contact-info h3 {
    color: var(--primary-color);
    background: var(--tertiary-color);
    font-size: 32px;
}
.contact-info-wrapper {
    width: 100%;
    background: var(--tertiary-color);
}
.contact-grid-container {
    padding: 25px 0;
    margin: auto;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto;
    color: var(--secondary-color);
    background: var(--tertiary-color);
    font-size: 1.2rem;
    grid-gap: 20px;
    grid-auto-flow: dense;
    flex-wrap: wrap;
}
.contact-info-item {
    margin: auto;
    padding: auto;
    width: 80%;
    line-height: 1.5;
    font-size: 16px;
    font-style: normal;
    color: var(--primary-color);
    background: var(--tertiary-color);
    flex-wrap: wrap;
}

.contact-info-item a {
    color: var(--primary-color);
    background: var(--tertiary-color);
    text-decoration: none;
}

.contact-info-item i {
    color: var(--primary-color);
    background-color: var(--tertiary-color);
}

/* MEDIA QUERY FOR SMALLER DESKTOP SCREENS AND SMALLER */
@media screen and (max-width: 980px) {
    /* This will be applied on any screen smaller than 980px */
    header {
        padding-bottom: 0;
        justify-content: center;
        position: relative;
    }
    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;
    }
    .section-title {
        width: 80%;
    }
    .about-me img {
        width: 25%;
    }
    .section-title {
        font-size: 35px;
    }
    .project-grid-container {
        grid-template-columns: 1fr 1fr;
    }
    .project-grid-item {
        flex: 1 1;
    }
    .project-grid-item.large {
        flex: 1 1;
        grid-column: 1 / -1;
    }
    .project-caption h3 {
        font-size: 18px;
    }
    .project-caption{
        position: static;
        justify-self: flex-start;
    }
    .project-caption-2 {
        position: static;
        justify-self: flex-start;
    }
    .skills-info h2 {
        font-size: 25px;
    }
}

/* MEDIA QUERY FOR TABLETS AND SMALLER */
@media screen and (max-width: 768px) {
    /* This will be applied on any screen between 768px and 575px */
    section {
        padding: 30px 15px;
    }
    .section-title {
        font-size: 30px;
    }
    .about-me img {
        width: 35%;
    }
    .project-grid-container {
        grid-template-columns: 1fr 1fr;
    }
    .project-grid-item {
        flex: 1 1;
    }
    .project-grid-item.large {
        flex: 1 1;
        grid-column: 1 / -1;
    }
    .project-caption {
        font-size: 15px;
        width: 75%;
        position: static;
        justify-self: flex-start;
        justify-content: flex-start;
    }
    .project-caption h3 {
        font-size: 20px;
    }
    .contact-grid-container {
        grid-template-columns: 1fr;
    }
    .project-caption-2 {
        font-size: 20px;
        width: 100%;
        position: static;
        justify-self: flex-start;
        justify-content: flex-start;
    }
    .skills-info h2 {
        font-size: 25px;
    }
}

/* MEDIA QUERY FOR MOBILE PHONES AND SMALLER */
@media screen and (max-width: 575px) {
    /* This will be applied on any screen smaller than 575px */
    .section-title {
        width: 75%;
        font-size: 25px;
        justify-content: left;
        text-align: left;
        flex: 0 1;
    }
    .projects {
        flex: 0 1;
    }
    .project-grid-container {
        grid-template-columns: 1fr;
    }
    .project-grid-item.large {
        grid-column: 1;
    }
    .about-me img {
        width: 45%;
    }
    .contact {
        flex: 0 1;
    }
    .contact-info-item {
        font-size: 13px;
    }
    .project-caption {
        display: block;
        justify-self: flex-start;
    }
    .project-caption-2 {
        font-size: 20px;
        width: 100%;
        display: block;
        justify-self: flex-start;
    }
    .skills-info h2 {
        font-size: 20px;
    }
}

/* For devices that don't support hover, remove the hover effect for showing the caption and links on projects */

@media (hover:none), (hover:on-demand) {
    .hide {
        display: block;
    }
}