:root {
  --scale: 0.7;
  --card-scale: 0.8;
}

body {
  font-size: calc(1rem * var(--scale));
  font-family: 'Helvetica Neue', Arial, sans-serif;
  margin: 0;
  background: #fff;
  color: #333;
  text-align: left;
  padding-top: 4rem;
  padding-right: 30rem; /* Added 30rem right padding to the main body */
}

header {
  position: fixed;
  top: 0.5rem;
  width: 100%;
  background: transparent;
  padding-left: 3rem;
  text-align: left;
  font-size: calc(1.2rem * var(--scale));
  display: flex;
  align-items: baseline;
}

header h1 {
  margin: 0;
}

header nav a {
  margin-right: 1rem;
  text-decoration: none;
  color: #333333;
}

header nav a.active {
  color: red;
}

main {
  display: flex;
  flex-direction: row;
  width: 100%;
  padding-right: 30rem; /* Added 30rem right padding to the main body for detail page */
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(calc(300px * var(--card-scale)), 1fr));
  gap: 1rem;
}

.project-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.project-card img {
  width: 100%;
  display: block;
  transition: transform 0.3s ease;
}

.project-card:hover img {
  transform: scale(1.1);
}

.project-card figcaption {
  text-align: left;
  font-size: calc(1rem * var(--scale));
  margin-top: 0.5rem;
}

.scrollable-box {
  display: block;
  width: auto;
  padding: 0;
  overflow: visible;
  border: none;
  background: none;
}

.scrollable-box img,
.scrollable-box iframe,
.scrollable-box embed {
  margin-bottom: 1rem;
  width: 100%;
  height: auto;
}

.filter {
  cursor: pointer;
  text-decoration: none;
  padding: 1rem;
  color: #333333;
  font-weight: bold;
  transition: color 0.3s ease, opacity 0.3s ease;
}

.filter:hover {
  opacity: 0.8;
}

.filter.active {
  color: red;
}


/* Restrict images to fit within 50rem left in detail project page */
#project-details img {
  max-width: 50rem;
  display: block;
  margin: 0 auto;
  padding: 1rem;
}

