/* Global theming variables */
/* Set the default to root.light-theme */
:root, :root.light-theme {
  --bg-color: #FFFAFA;
  --secondary-bg-color: #AAAAAA;
  --primary-text-color: #000000;
  --nav-link-color: royalblue;
  --secondary-color: #26547C;
}

:root.dark-theme {
  --bg-color: #000000;
  --secondary-bg-color: #666666;
  --primary-text-color: #ffffff;
  --nav-link-color: #FFE787;
  --secondary-color: #FE938C;
}

@media (prefers-color-scheme: dark) {
  /* Set the default to root.dark-theme */
  :root {
    --bg-color: #000000;
    --secondary-bg-color: #666666;
    --primary-text-color: #ffffff;
    --nav-link-color: #FFE787;
    --secondary-color: #FE938C;
  }  
}

/* Body */
html, body {
  min-height: 100%;
  height: 100%;
}

body {
  background-color: var(--bg-color);
  color: var(--primary-text-color);
  font-family: 'Open Sans', sans-serif;
}

main {
  text-align: center;
}

header {
  padding: 5px 10px;
  border-bottom: 1px solid var(--secondary-bg-color);
  font-family: 'Oswald', sans-serif;
}

header, nav {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

nav ul {
  list-style: none;
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  gap: 20px;
}

nav ul a, nav ul a:visited {
  color: var(--nav-link-color);
  text-decoration: none;
}

nav ul a:hover {
  opacity: 0.5;
}

nav ul a.active-page {
  border-bottom: 1px solid var(--secondary-color);
}

footer {
  width: 100%;
  display: flex;
  box-sizing: border-box;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--secondary-bg-color);
  padding: 8px 10px;
}

footer p, footer a, footer a:visited {
  color: var(--primary-text-color);
}

footer a, footer a:visited {
  color: var(--nav-link-color);
  text-decoration: none;
}

.content-wrapper {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.copyright-container {
  font-size: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  align-items: center;
  padding: 0;
  margin: 0;
}

.copyright-container p {
  padding: 0;
  margin: 0;
}

.theme-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.theme-toggle {
  background-color: var(--secondary-bg-color);
  color: var(--primary-text-color);
  border: none;
  border-radius: 15px;
  padding: 5px 8px;
  font-family: 'Roboto', sans-serif;
}

.projects-grid {
  display: grid;
  grid-template-columns: calc(100% / 3) calc(100% / 3) calc(100% / 3);
  grid-template-rows: auto;
  margin: 20px auto 0 auto;
}

.grid-item {
  display: block;
  text-align: center;
}

.project-link {
  position: relative;
  display: block;
  height: fit-content;
  width: fit-content;
  margin: 0 auto;
}

.project-item {
  width: 500px;
  height: 250px;
  margin: 10px auto;
  border-radius: 15px;
  box-shadow: 2px 2px 6px var(--secondary-color);
}

.overlay {
  position: absolute;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: middle;
  bottom: 0;
  top: 0;
  left: 0;
  right: 0;
  color: #f1f1f1;
  font-size: 20px;
  text-align: center;
  box-sizing: border-box;
  padding: 25px 0;
  gap: 5px;
}

.overlay * {
  display: block;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  border-top: 1px solid var(--secondary-color);
  border-right: 1px solid var(--secondary-color);
  border-bottom: 1px solid var(--secondary-color);
  border-radius: 0 10px 10px 0;
  width: fit-content;
  padding: 2px 7px 2px 5px;
  margin: 0;
  font-size: 14px;
  font-family: 'Roboto', sans-serif;
}

/* Media queries */
@media only screen and (max-width: 1600px) {
    .projects-grid {
        grid-template-columns: calc(100% / 2) calc(100% / 2);
    }
}

@media only screen and (max-width: 1100px) {
    .projects-grid {
        grid-template-columns: 100%;
    }
}

@media only screen and (max-width: 600px) {
    .project-item {
        width: 375px;
        height: 187.5px;
    }

    footer p, footer a, footer a:visited {
      font-size: 12px;
    }
    
    footer a, footer a:visited {
      font-size: 12px;
    }
}

@media only screen and (max-width: 450px) {
    .project-item {
        width: 250px;
        height: 125px;
    }
}