:root{
    --primary-color: rgb(245,245,245);
    --secondary-color: rgb(18, 11, 78);
    --tertiary-color: orange;
    font-size: 16px;
}

body{
  color: var(--secondary-color);
}

/* Body Children */
.container,
main {
  margin: 0 5%;
}

/* Header and Nav */
header .container{
  display: flex;
  justify-content: space-between;
}

header {
  background-color:var(--secondary-color);
  color: var(--primary-color);
}

header .selfie {
  max-height: 50px;
  border-radius: 25px;
  margin:auto;
}
header h1 {
  width: 33%;
  font-family: 'Amiko', sans-serif;
  margin: auto;
}

header nav {
  width: 66%;
  display: flex;
  justify-content: flex-end;
}

nav li {
  display: inline-block;
  border-bottom: 2px solid var(--primary-color);
  margin:0 0.2rem;
}

nav li:hover {
  border-bottom: 2px solid var(--tertiary-color);
}

nav a {
  color: var(--primary-color);
  text-decoration: none;
  padding:0 0.6rem;
  font-size: 1.2rem;
}

/* Main Layout */
#about,
#work,
#contact {
  display: flex;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

#about h2,
#work h2,
#contact h2 {
  width: 25%;
}

main .content-block {
  width: 75%;
}

/* Hero */
.hero-banner{
  background-image: url("../images/code-944499_1920.jpg");
  background-size: cover;
  background-repeat: no-repeat;
  position: relative; /* contain the overlay */
}

.hero-banner,
.hero-banner .container{
  min-height: 25vh;
}

.hero-banner .container {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
}

.hero-meta {
  background-color: var(--primary-color);
  padding: 0.5rem;
  margin-bottom: 1rem;
  margin-right: 8px;
  z-index: 100; /* keep above the overlay */
}

/* About */
#about p {
  margin-bottom: 0.5rem;
}

/* Portfolio */
#portfolio-grid {
  display: grid;
  grid-template-rows: 50vh 25vh 25vh;
  grid-template-columns: 1fr 1fr;
  grid-template-areas: 
    "featured-portfolio-item featured-portfolio-item"
    "first-portfolio-item second-portfolio-item"
    "third-portfolio-item fourth-portfolio-item";
  gap: 10px;
}

#featured-portfolio-item {
  grid-area: featured-portfolio-item;
  background-image: url("../images/work/school-aid-sa.png");
}

#first-portfolio-item {
  grid-area: first-portfolio-item;
  background-image: url("../images/work/school-aid-2019.png");
}

#second-portfolio-item {
  grid-area: second-portfolio-item;
  background-image: url("../images/work/kolvin-psych.png");
}

#third-portfolio-item {
  grid-area: third-portfolio-item;
  background-image: url("../images/work/second-spring.png");
}

#fourth-portfolio-item {
  grid-area: fourth-portfolio-item;
  background-image: url("../images/work/vallecoppa.png");
}  

.portfolio-grid-area {
  background-position: top;
  background-size: cover;
  background-repeat: no-repeat;
  display: grid;
  align-content: end;
  justify-content: flex-start;
  border: 5px solid var(--primary-color);
  cursor: pointer;
  position: relative; /* contain the overlay */
  background-size: cover;
  text-decoration: none;
  color: var(--secondary-color);
}

.overlay::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: #000;
  opacity: 0.25;
  pointer-events: none;
  transition: opacity 0.5s;
}

.portfolio-grid-area:hover::before {
  opacity: 0; /* clear the overlay */
}

.portfolio-meta {
  background-color: var(--primary-color);
  padding: 0.5rem;
  margin-bottom: 1rem;
  pointer-events: none;
  z-index: 100; /* keep above the overlay */
}

/* Contact */
#contact ul {
  padding: 0;
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
}

#contact li{
  display: inline-block;

}

#contact a {
  color: var(--secondary-color);
  text-decoration: none;
  border-bottom: 2px solid var(--secondary-color);
}

#contact a:hover {
  border-bottom: 2px solid var(--tertiary-color);
}

/* Content Links */
p a {
  font-weight: bold;
  color: var(--secondary-color);
  text-decoration: none;
}

p a:hover {
  border-bottom: 2px solid var(--tertiary-color);
}

/* Large Screen */
@media only screen and (min-width: 768px) {
  #about h2,
  #work h2,
  #contact h2{
    text-align: right;
    padding-right: 50px;
  }
}

/* Small Screen */
@media only screen and (max-width: 767px) {
  #about, 
  #work, 
  #contact {
    display: flow;
  }

  main .content-block,
  #about h2,
  #work h2,
  #contact h2 {
    width: 100%;
  }

  #about h2,
  #work h2,
  #contact h2{
    text-align: left;
  }

  /* Stack all portfolio items */
  #portfolio-grid {
    grid-template-rows: 50vh 25vh 25vh 25vh 25vh;
    grid-template-columns: 100%;
    grid-template-areas: 
      "featured-portfolio-item"
      "first-portfolio-item"
      "second-portfolio-item"
      "third-portfolio-item"
      "fourth-portfolio-item";
  }

  /* center the hero message */
  .hero-banner .container {
    justify-content: center;
    align-items: center;
  }

  .hero-meta {
    margin: auto;
  }

  /* drop menu down and center */
  header .container {
    flex-wrap: wrap;
  }
  header nav {
    width: 100%;
    justify-content: center;
  }
  header h1 {
    width: 100%;
    text-align: center;
  }
  header nav {
    padding-left: 0px;
  }

  header .selfie {
    margin-top: 1vh;
  }

  header nav ul {
    padding-left: 0px;
  }

}
