
body {
  font-family: sans-serif;
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: #fff;
  /* Default light mode */
  color: #000;
}

header {
  position: relative;
  /* padding: env(safe-area-inset-top, 1em) 2em 1em; */
  background-color: #f0f0f0;
  min-height: 50px;
  display: flex;
  align-items: center;
  padding: 0 2em;
  width: 100%;
  box-sizing: border-box;
}

header::before {
  content: '';
  position: absolute;
  top: calc(-1 * env(safe-area-inset-top, 0));
  left: 0;
  width: 100%;
  height: env(safe-area-inset-top, 0);
  background-color: inherit;
  z-index: -1;
}

main {
  padding: 2em;
  flex: 1;
}

h3 {
  text-align: center;
}

p {
  text-align: center;
  margin: 10px auto;
  width: 90%;
  max-width: 1200px;
  padding: 0 10px;
}

footer {
  text-align: center;
  padding: 1em 0;
  background-color: #f0f0f0;
}

/* Navigation Styles - Improved for Dark Mode */
.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 15px;
}

nav li {
  margin: 0;
}

nav a {
  text-decoration: none;
  color: #333;
  padding: 5px 10px;
  border-radius: 5px;
  transition: color 0.3s, background-color 0.3s;
}

nav a.active {
  background-color: #007bff;
  color: white;
}

body.dark-mode nav a {
  color: #eee;
}

body.dark-mode nav a.active {
  color: white;
}

h1 {
  font-size: 1.5em;
  margin: 0;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.dark-mode-toggle {
  cursor: pointer;
  background: none;
  border: none;
  font-size: 1em;
  padding: 5px;
  display: flex;
  align-items: center;
  position: absolute;
  margin: 5px auto;
  top: 50%;
  transform: translateY(-50%);
  right: 2em;
}

.dark-mode-toggle .toggle-switch {
  width: 20px;
  height: 20px;
  background-color: #333;
  border-radius: 50%;
  display: inline-block;
}

@media (max-width: 768px) {
  header {
      justify-content: center; /* ONLY center on smaller screens */
      flex-direction: column;
  }

  .nav-content {
      flex-direction: column;
      align-items: center;
  }

  nav ul {
      justify-content: center;
      margin-bottom: 10px;
  }

  h1 {
      position: static;
      transform: none;
      margin-top: 10px;
      text-align: center;
  }

  .dark-mode-toggle {
    position: relative; /* Key change */
    margin: 12px auto;
    order: 3;
    align-self: center;
  }
}

/* @media (max-width: 480px) {
  nav ul {
      flex-direction: column;
      gap: 5px;
  }

  h1 {
      font-size: 1em;
  }
  .dark-mode-toggle {
      margin: 10px 0;
  }
} */

/* Art Grid Styles */
.art-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  /* 3 equal columns */
  grid-auto-rows: minmax(200px, auto);
  /* Minimum row height */
  grid-gap: 10px;
  /* Adjust gap as needed */
  padding: 20px;
  overflow-x: hidden;
}

.art-item {
  background-size: cover;
  background-position: center;
  cursor: pointer;
  transition: transform 0.3s ease;
  /* Add transition for smooth scaling */
  width: 100%; /* Ensure each item takes full width */
  height: 100%; /* Ensure items fit within their grid cell */
  box-sizing: border-box; /* Include padding in width and height */
}

.art-item:hover {
  transform: scale(1.05);
  /* Slightly scale on hover */
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

/* Media Queries for smaller screens */
@media (max-width: 768px) { /* Tablet screens */
  .art-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 equal columns */
  }
}

@media (max-width: 480px) { /* Mobile screens */
  .art-grid {
    grid-template-columns: 1fr; /* 1 column */
  }

  /* Reset grid-column and grid-row for smaller screens */
  .art-item {
    grid-column: span 1 !important; /* Force each item to take up one column */
    grid-row: span 1 !important; /* Force each item to take up one row */
  }
}

/* Gallery Grid Styles */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  grid-gap: 10px;
}

.gallery-item-link {
  /* Style for the link */
  text-decoration: none;
  /* Remove underlines */
  color: inherit;
  /* Inherit color from parent */
  display: block;
  /* Make the link fill the grid cell */
}

.gallery-item {
  text-align: center;
  border: 1px solid transparent;
  /* Add transparent border for hover effect */
  transition: border-color 0.3s ease;
  /* Smooth border transition */
}

.gallery-item img {
  display: block;
  width: 100%;
}

.gallery-item h3 {
  margin-top: 10px;
}

.gallery-item:hover {
  border-color: #ccc;
  /* Show border on hover */
}

/* About Page Styles */
.about-page {
  text-align: center;
  max-width: 960px;
  margin: 0 auto;
}

.about-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.about-paragraph {
  width: 45%;
  margin-bottom: 2em;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.about-paragraph.right {
    align-items: flex-end;
  text-align: right;
}

.about-paragraph img {
  max-width: 100%;
  height: auto;
  margin-bottom: 1em;
}

/* Art Pages*/
.art-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 800px; /* Limit the width */
  margin: 20px auto; /* Center horizontally */
  padding: 20px;
  box-sizing: border-box;
}

#canvas-container {
  aspect-ratio: 1 / 1; /* Maintains a 1:1 aspect ratio */
  position: relative;
  border: 2px solid grey;
  box-sizing: border-box;
}

#canvas-container canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}

/* Media Queries for different screen sizes */
@media (max-width: 768px) {
  .art-container {
    padding: 10px;
  }
}

/* Code Snippet Styles */
.code-snippet {
  background-color: #f0f0f0;
  padding: 1em;
  overflow-x: auto;
  /* Enable horizontal scrolling for long code */
  white-space: pre-wrap;
  /* Allow line breaks */
  border-radius: 5px;
}

.code-snippet code {
  font-family: monospace;
}

/* Add Art Page navigation buttons styles */
.navigation-buttons {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 400px; /* Centered and constrained */
  margin: 20px auto;
}

.navigation-buttons button {
  background-color: #007bff;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.navigation-buttons button:hover {
  background-color: #0056b3;
}

.breadcrumb-container {
  padding: 0 20px;
  /* Padding on left and right */
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  /* Include padding in width calculation */
}

.breadcrumb {
  background-color: transparent;
  padding: 0.5rem 0;
  margin: 0; /* Remove top margin */
  list-style: none;
  display: flex;
  flex-wrap: wrap; /* Allow items to wrap when needed */
  align-items: center;
  justify-content: flex-start; /* Align to the left */
  gap: 5px; /* Add spacing between items */
}

.breadcrumb-item {
  display: inline;
  margin-right: 5px;
}

.breadcrumb-item+.breadcrumb-item::before {
  content: ">";
  margin: 0 5px;
}

.breadcrumb a {
  text-decoration: none;
  color: #333;
  transition: color 0.3s;
}

body.dark-mode .breadcrumb a {
  color: #eee;
}

/* Media Query for Smaller Screens */
@media (max-width: 768px) {
  .breadcrumb {
    flex-direction: column; /* Stack items vertically */
    align-items: flex-start; /* Align items to the left */
  }

  .breadcrumb-item {
    display: flex;
    align-items: center; /* Ensure proper vertical alignment */
  }

  .breadcrumb-item::before {
    margin-right: 10px; /* Add consistent spacing for '>' */
  }
}

/* Breadcrumb Styles 
.breadcrumb {
    background-color: transparent;
    padding: 1rem 0;
    margin-bottom: 0;
    justify-content: center;
}
.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
}*/

/* Responsive Design */
@media (max-width: 768px) {

  /* Tablet and smaller */
  .art-grid {
    grid-template-columns: repeat(2, 1fr);
    /* 2 columns on tablet */
  }

  .about-content {
    flex-direction: column;
  }

  .about-paragraph {
    width: 100%;
    text-align: center;
    align-items: center;
  }

  .about-paragraph.right {
    text-align: center;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .art-grid {
    grid-template-columns: 1fr;
    /* 1 column on mobile */
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* Style the active/current page link */
nav a.active {
  background-color: #007bff;
  /* Example: Blue background */
  color: white;
}

.art-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  /* Ensure it takes full width */
}

#canvas-container {
  width: 100%;
  /* Make the canvas container responsive */
  max-width: 800px;
  /* Set a maximum width if needed */
  margin-bottom: 20px;
  /* Add some spacing below the canvas */
}

/* Dark Mode Styles */
body.dark-mode {
  background-color: #000;
  color: #fff;
}

body.dark-mode header {
  background-color: #333;
}

body.dark-mode footer {
  background-color: #333;
}

body.dark-mode .code-snippet {
  background-color: #333;
  color: #fff;
}

/* Day/Night Mode Toggle */
.dark-mode-toggle {
  position: absolute;
  /* Or relative, depending on your layout */
  top: 20px;
  /* Adjust as needed */
  right: 20px;
  /* Adjust as needed */
  cursor: pointer;
  background-color: transparent;
  border: none;
  font-size: 1.2em;
}

/* Style for the toggle switch (optional) */
.dark-mode-toggle .toggle-switch {
  width: 60px;
  height: 30px;
  background-color: #ccc;
  border-radius: 15px;
  position: relative;
  display: inline-block;
  vertical-align: middle;
  transition: background-color 0.3s;
}

.dark-mode-toggle .toggle-switch::before {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: #fff;
  top: 3px;
  left: 3px;
  transition: transform 0.3s;
}

body.dark-mode .dark-mode-toggle .toggle-switch {
  background-color: #aaa;
}

body.dark-mode .dark-mode-toggle .toggle-switch::before {
  transform: translateX(30px);
}