/* General */
* {
  margin: 0;
  padding: 0;
  text-decoration: none;
}
h1, h2, h3, p, a {
  font-family: sans-serif;
  font-size: 16px;
  color: hsla(0, 0%, 0%, 1);
  line-height: 1.2;
}
h1 {
  font-size: 28px;  
}
h2 {
  font-size: 24px;  
}
h3 {
  font-size: 20px;  
}
a {
  width: auto;
  height: auto;
}
a:hover {
  text-decoration: underline;
  transition: text-decoration 0.1s ease;
}
/* ---- body ---- */
body {
  width: 80%;
  margin: 0 auto;
  background-color: gray;
  transition: width 0.3s ease;
}
/* If viewport is below 1000px */
@media (max-width: 1000px) {
  body {
    width: 90%;
  }
}
/* If viewport is below 500px */
@media (max-width: 500px) {
  body {
    width: 98%;
  }
}
body h2 {
  margin-top: 12px;
}
/* ---- header ---- */
header div {
  background-color: lightgrey;
  border-radius: 12px;
  padding: 12px;
}
/* ---- projects ---- */
.projects, .work {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(clamp(300px, 50%, 500px), 1fr));
  max-width: calc(2 * 1fr);
  gap: 12px;
}
/* Grid cells */
.cell, .cell_img {
  display: grid;
  grid-template-rows: auto 1fr auto;
  background-color: lightgrey;
  border-radius: 12px;
  padding: 12px;
  gap: 8px;
  overflow: hidden;
}
/* with img */
.cell_img {
  grid-template-columns: 40% 1fr;
  grid-template-areas:
    "title title"
    "img text"
    "img repo";
}
@media (max-width: 500px) {
  .cell_img {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto 165px auto auto !important;
    grid-template-areas:
      "title"
      "img"
      "text"
      "repo" !important;
  }
}
/* without img */
.cell {
  grid-template-columns: 1fr;
  grid-template-areas:
    "title"
    "text"
    "repo";
}

.cell .title, .cell_img .title {
  grid-area: title;
}
.cell_img img {
  grid-area: img;
  width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
  align-self: start;
}
@media (max-width: 500px) {
  .cell_img img {
    width: auto;
    height: 100%;
  }
}
.cell p, .cell_img p {
  grid-area: text;
}
.cell .repo, .cell_img .repo {
  grid-area: repo;
  text-align: right;
}
/* ---- fotter ---- */
footer {
  margin-top: 12px;
  display: grid;
  width: 100%;
  grid-template-columns: 1fr 1fr 1fr;
  grid-gap: 8px;
}
@media (max-width: 600px) {
  footer {
    grid-template-columns: 1fr !important;
    grid-template-rows: 1fr 1fr 1fr !important;
  }
}
.copyright, .external, .email {
  margin: auto;
}
/* external icon */
.external * img {
  width: 48px;
}