body {
    background-image: url('media/tartan.jpg');
    color: #222222;
    background-position: center;
    background-repeat: repeat;
    font-family: "Sitka Display", "Merriweather", Georgia;
    margin: 0;
    padding: 0;
}

  
.container {
    max-width: 950px;
    margin: 0 auto;
    padding: 20px;
    background: #C3D3DB;
    box-shadow: 0 0 8px rgba(0,0,0,0.15);
    border: 3px solid #6f838d;
}

button {
  padding: 6px 12px;
  background-color: #6f838d;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  }

button:hover {
  background-color: #4f616d;
  }

nav {
  width: 100%;
  text-align: center;
}

nav a {
  padding: 6px 12px;
  text-decoration: none;
  background-color: #6f838d;
  color: white;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  display: inline-block;
  margin: 0 5px;
}

nav a:hover {
  background-color: #4f616d;
  }
 
main {
  margin: 60px;
  text-align: justify;
  }
  
main h2 {
  color: #4f616d;
  }

header {
    text-align: center;
    margin-bottom: 0px;
}

header h1 {
    font-size: 6rem;
    color: #6B5638;
    text-shadow: 1px 1px 0 #bbae9a;
}

h2 {
    color:#222222;
    border-bottom: 2px solid #4E7183;
    padding-bottom: 5px;
}

.gallery-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.gallery-grid img {
  width: 100%;
  border: 3px solid #4E7183;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.gallery-grid img:hover {
  transform: scale(1.05);
}

#lightbox {
  display: none;
  position: fixed;
  width: 300px;
  height: 200px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #D0D9DB;
  color: #333;
  padding: 20px;
  border: 3px solid #4E7183;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
  z-index: 1000;
  cursor: move;
  overflow: auto;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

#lightbox-close {
  position: absolute;
  top: 5px;
  right: 10px;
  font-size: 24px;
  font-weight: bold;
  color: #4E7183;
  cursor: pointer;
}

#writing-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
  width: 800px;
  margin: 0 auto;
  gap: 12px;
  border-radius: 8px;
}

#writing-viewer {
  background-color: #D1DEE6;
  border: 1px solid #6f838d;
  padding: 20px;
  width: 800px;
  }
  
#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: #4E7183;
  color: white;
  text-align: center;
  line-height: 50px;
  font-size: 24px;
  font-weight: bold;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

#back-to-top:hover {
  background-color: #6f838d;
  transform: scale(1.1);
}

#back-to-top.show {
  opacity: 1;
  pointer-events: auto;
}

.mc-wrapper, .shiro-wrapper {
  position: absolute;
  z-index: 100;
  display: inline-block;
}

.mc-wrapper {
  top: 20px;
  right: 20px;
}

.shiro-wrapper {
  top: 20px;
  left: 20px;
}

.mc-wrapper img, .shiro-wrapper img {
  width: 300px;
  height: auto;
  display: block;
}

.mc-wrapper::after, .shiro-wrapper::after {
  content: attr(data-name);
  position: absolute;
  bottom: -25px;  
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0,0,0,0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.mc-wrapper:hover::after,
.shiro-wrapper:hover::after {
  opacity: 1;
}

#comments a {
  justify-content: center;
  align-items: center;
  padding: 6px 12px;
  text-decoration: none;
  background-color: #6f838d;
  color: white;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  display: inline-block;
  margin: 5px 5px;
}

#comments a:hover {
  background-color: #4f616d;
  }