/* IMPORTING FONTS */
@import url("https://fonts.googleapis.com/css2?family=Abril+Fatface&family=Cantarell:ital,wght@0,400;0,700;1,400;1,700&family=Ubuntu+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap");

/* VARIABLES */
:root {
  /* Default Light Mode colors */
  --header-color: #2b404a;
  --color: #2b404a;
  --background-color: #f2f2f2;
  --overlay-background-color: rgba(0, 0, 0, 0.8);
  --card-bg: #ffffff;
  --table-header: #a4bdda;
  --border-color: #ddd;
  --link-color: #446094;

  /* Font Family's */
  --headers: "Abril Fatface";
  --default: "Cantarell";
}

/* Dark Mode Overrides */
@media (prefers-color-scheme: dark) {
  :root {
    --header-color: #e0e0e0;
    --color: #c0c0c0;
    --background-color: #1a1a1a;
    --overlay-background-color: rgba(40, 40, 40, 0.8);
    --card-bg: #2d2d2d;
    --table-header: #3d5a80;
    --border-color: #444;
    --link-color: #5f7faa;
  }
  .profile .name {
    filter: invert(100%);
  }
}

/* UNIVERSAL STYLES */
html {
  scroll-behavior: smooth;
}
body {
  max-width: 1000px;
  margin: 10px auto;
  padding: 0 20px;
  font-family: var(--default);
  color: var(--color);
  background-color: var(--background-color);
}
h1,
h2,
h3,
h4,
h5 {
  color: var(--header-color);
  font-family: var(--headers);
}
b {
  font-family: var(--default);
  font-weight: bold;
}
a {
  text-decoration: none;
  color: var(--link-color);
}
img {
  user-select: none;
}
button {
  font-family: var(--default);
  font-weight: bold;
  background-color: #f2f2f2;
  color: #2b404a;
  padding: 10px;
  border: none;
  border-radius: 5px;
  transition: background-color 0.25s;
}
button:hover {
  background-color: #e0e0e0;
}
button:active {
  background-color: #c0c0c0;
}

/* HEADER */
header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
}
.profile {
  display: flex;
  width: min(460px, 100%);
}
.profile .pic {
  border-radius: 50%;
  width: 15%;
  height: auto;
}
.profile .name {
  padding-top: 10px;
  padding-left: 10px;
  width: 85%;
  height: auto;
}
.navigation a {
  margin-left: 10px;
  color: var(--color);
}

/* ABOUT ME */
.aboutme {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-content: center;
}
.aboutme .text {
  width: 500px;
}
.images {
  width: 460px;
  height: 460px;
  overflow: scroll;
}
.columns {
  width: 460px;
  column-gap: 5px;
  column-count: 3;
}
.columns > .image {
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  margin-bottom: 5px;
  cursor: pointer;
}
.image > p {
  user-select: none;
}
.photo {
  display: block;
  height: auto;
  transition-property: filter, transform;
  transition-duration: 0.5s;
}
.image:hover > .photo {
  filter: blur(4px) brightness(75%);
  transform: scale(104%);
}

.image > p {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);

  opacity: 0;
  color: white;
  width: 80%;
  transition-property: opacity;
  transition-duration: 0.5s;
}
.image:hover > p {
  opacity: 1;
}

/* PROJECTS */
.projects {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}
.projects .project {
  width: 480px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.project .product {
  width: 100%;
}

/* SKILLS */
.skills {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.skills .logos {
  display: grid;
  grid-template-columns: repeat(auto-fill, 80px);
  width: min(480px, 100%);
  gap: 5px;
  justify-content: center;
  align-content: center;
}
.skills .logos img {
  width: 80px;
  height: 80px;
}

/* EDUCATION */
table {
  margin-top: 5px;
  width: 100%;
  border-collapse: collapse; /* Merges cell borders */
}
th,
td {
  border: 2px solid var(--border-color); /* Light gray border */
  padding: 8px;
  text-align: left;
}
th {
  font-weight: bold;
  background-color: var(--table-header);
}
td {
  background-color: var(--card-bg);
}

/* CONTACT */
.contact-me {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
}
.contact-me a {
  padding: 5px;
  border-radius: 5px;
  background-color: var(--link-color);
  color: white;
  text-decoration: none;
}
.contact-me > div {
  width: 100%;
  display: flex;
  gap: 5px;
}
.downloads > * {
  width: 50%;
  text-align: center;
  padding: 5px;
}
.email > * {
  width: 100%;
  text-align: center;
}
.socials > * {
  width: 33%;
  text-align: center;
}

/* IMAGE VIEWER */
#image-viewer-overlay {
  /* Positioning */
  position: fixed;
  top: 0;
  left: 0;
  z-index: 5;

  /* Box Sizing */
  height: calc(100vh - 40px);
  width: calc(100% - 40px);
  padding: 20px;

  /* Background Color */
  background-color: var(--overlay-background-color);
  backdrop-filter: blur(4px);

  /* Flex */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  /* Disable scrolling */
  overscroll-behavior: contain;
}
#image-viewer-overlay > .exit {
  align-self: baseline;
}
#image-viewer-overlay > .content > img {
  max-height: 70vh;
  width: 100%;
  object-fit: cover;
  border-radius: 20px 20px 0 0;
  display: block;
}
#image-viewer-overlay > .content > .description {
  /* Box Sizing */
  width: calc(100% - 2em);
  margin: 0;
  padding: 1em;
  border-radius: 0 0 20px 20px;

  /* Alignment */
  text-align: center;

  /* Color */
  background-color: white;
  color: #1a1a1a;
}
#image-viewer-overlay .nav {
  display: flex;
  place-items: center;
  gap: 4em;
}
#image-viewer-overlay .nav > button {
  height: fit-content;
  padding: 5px 10px;
}
#image-viewer-overlay .nav > .img-num {
  color: white;
}

/* RESPONSIVE DESIGN */
@media (max-width: 999px) {
  body {
    max-width: 600px;
  }
  header,
  .aboutme,
  .aboutme .text,
  .product {
    all: unset;
  }
  header {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
  }
  header .profile {
    width: unset;
  }
  .images {
    width: 100%;
    height: fit-content;
    display: grid;
    justify-content: center;
  }
  .projects {
    flex-direction: column;
    flex-wrap: nowrap;
  }
  .projects .project {
    width: 100%;
  }
  .project .product {
    max-width: 500px;
    margin: 0 auto;
  }
  .skills .logos {
    margin: 0 auto;
  }
  .skills .text {
    width: 100%;
  }
}

@media (max-width: 499px) {
  .images .columns {
    column-count: 2;
    width: 305px;
  }
}
