:root {
  --body-bg-image: url('img/bg.png');
  --dark: #222323;
  --primaryText: #FF64B4;
}

/* 
https://bg-patterns.com/p/new0056/m_new00560.jpg
https://bg-patterns.com/p/da0099/m_da00990.jpg
https://bg-patterns.com/p/da0629/m_da06291.jpg
*/

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Cute Font", monospace, sans-serif;
  font-size: 1.0rem;
  line-height: 1.75rem;

  overflow-wrap: break-word;
  margin: 5% auto;
  background-color: var(--dark);
  background-size: 65px;
  color: var(--primaryText);
  background-image: var(--body-bg-image);
  background-repeat: no-repeat;
  background-position: top right;
  background-size: contain;
  background-attachment: fixed;
}

date {
  border-bottom: 2px dotted var(--primaryText);
  display: block;
  margin: 10px 0px;
}

hr {
  border: 1px solid var(--primaryText);
  margin: 10px 0px;
}

p {
  margin: 20px 0px;
}

a, a:link, a:visited, a:active {
  background-color: var(--dark);
  border: 1px solid var(--primaryText);
  color: var(--primaryText);
  padding: 0px 4px;
  text-decoration: none;
  text-transform: uppercase;
  border-radius: 0.13rem;
}

a:hover {
  background-color: var(--primaryText);
  color: var(--dark);
}

/* ====================== */
/* RESET FOR THE LOGO LINK */
/* (keeps your original code unchanged) */
/* ====================== */

.logo-link,
.logo-link:link,
.logo-link:visited,
.logo-link:active {
  /* Remove everything your original CSS added */
  background-color: transparent !important;
  border: none !important;
  color: inherit;               /* doesn't matter for image */
  padding: 0 !important;
  text-decoration: none;
  text-transform: none;
  border-radius: 0 !important;
  
  /* Optional: make sure the image doesn't get extra spacing */
  display: inline-block;
  line-height: 0;
}

.logo-link:hover {
  background-color: transparent !important;
  color: inherit;
}

h1 {
  font-size: 2rem;
  line-height: 3.5rem;
}

h2 {
  font-size: 1.75rem;
  line-height: 3rem;
}

h3 {
  font-size: 1.5rem;
  line-height: 2.8rem;
}

h4 {
  font-size: 1.25rem;
  line-height: 2.75rem;
}

h5 {
  font-size: 1rem;
  line-height: 2.25rem;
}

h6 {
  font-size: 1.75rem;
  line-height: 2rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: normal;
  text-transform: uppercase;
}

h1::before,
h2::before,
h3::before,
h4::before,
h5::before,
h6::before {
  content: '[';
  padding-right: 3px;
}

h1::after,
h2::after,
h3::after,
h4::after,
h5::after,
h6::after {
  content: ']';
  padding-left: 3px;
}

ul li {
  list-style-type: none;
  margin: 8px;
  margin-left: -2px;
}

ul li::before {
  content: '›';
  margin-right: 5px;
}

#container {
  max-width: 900px;
  margin: 0 auto;
  border: none;
}

#titlebar {
  display: flex;
  align-content: center;
  height: auto;
  border: none;
  background-color: transparent;
  width: 100%;
  margin-bottom: 40px;
}

#titlebar img {
  max-width: 300px;
  margin-bottom: -20px;
  margin-left: -20px;
}

.pinup {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  margin-top: -30px;
}

.pinup img {
  width: 300px;
}

#flex {
  display: flex;
  grid-gap: 10px;
}

aside {
  background-color: var(--dark);
  width: 200px;
  font-size: 1rem;
}

.counter a, .counter img {
  float: right;
  border: none;
  background-color: transparent;
}

.sidebar-inner {
  color: var(--primaryText);
  border: 2px solid var(--primaryText);
  border-radius: 0.13rem;
  padding: 20px;
  width: 100%;
  height: 100%;
  line-height: 1.25rem;
}

.sidebar-inner h2, .sidebar-inner h3 {
  color: var(--primaryText);
}

#leftSidebar {
  height:100%;
}

.sidebar-inner ul li {
  display: block;
  width: 100%;
}

nav ul li {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  width: 100%;
}

nav a:link, nav a:visited {
  background-color: var(--primaryText);
  border: 2px solid var(--primaryText);
  color: var(--dark);
  font-weight: 600;
  letter-spacing: 2px;
  border-radius: 0.13rem;
  width: 100%;
  list-style-type: none;
  margin: 0px 0px 3px 1px;
  padding-left: 10px;
}

nav a::before {
  content: '›';
  margin-right: 5px;
}

nav a:hover {
  border: 2px solid;
  background-color: var(--dark);
  color: var(--primaryText)
}

nav ul li::before {
  content: none;
}

nav ul li:hover {
  background-color: var(--dark);
  color: var(--primaryText);
}

main {
  background-color: var(--dark);
  flex: 1;
  padding: 40px;
  order: 2;
  border: 2px solid var(--primaryText);
  border-radius: 0.13rem;
  text-align: justify;
}

.cornerTopRight {
  text-align: right;
  margin-top: -40px;
  margin-right: -40px;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--dark);
  color: var(--primaryText);
  width: 100%;
  height: 40px;
  text-align: center;
}

.box {
  background-color: var(--dark);
  border: 2px solid var(--primaryText);
  border-radius: 0.13rem;
  margin-bottom: 10px;
  width: 100%;
}

.box a {
  font-size: smaller;
}

.cornerTopLeft {
  margin: -11px 0px 0px 0px;
  padding: 0;
}

.cornerBottomRight {
  text-align: right;
  margin: 0px 0px -10px 0px;
  padding: 0px;
}

.box-inner {
  padding:20px;
  color: var(--primaryText);
  line-height: 1rem;
}

.box-inner h2, .box-inner h3 {
  color: var(--primaryText);
}

#topBar {
  width: 100%;
  height: 30px;
  padding: 10px;
  background-color: var(--dark);
}

.characters {
  display: grid;
  grid-template-columns: 250px auto;
  width: 100%;
  margin: 50px 0px;
}

.characters img {
  border: 2px solid;
  margin: 8px 5px;
  padding: 5px;
}

.characters table {
  width: 100%;
  border: none;
}

.characters table th {
  border: none;
  font-weight: normal;
  border-bottom: 2px dotted var(--primaryText);
  width: 50%;
}

.characters table td {
  border: none;
  border-bottom: 2px dotted var(--primaryText);
  width: 50%;
}

section {
  margin: 20px 0px;
}

/* Gallery */
.img-gallery {
  width: 100%;
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  grid-gap: 50px;
}

.img-gallery img {
  width: 200px;
  height: auto;
  object-fit: cover;
  aspect-ratio: 1; /* This makes the preview image a square */
  cursor: pointer;
  padding: 0;
  border: 2px solid var(--primaryText);   
  filter: brightness(0.8) grayscale(1);          
}

.img-gallery img:hover {
  filter: none;
}

.full-img {
  display: none; 
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100vh;
  background: #000;
  position: fixed;
  top: 0;
  left: 0; 
  z-index: 100;
}

.full-img img {   
  display: flex;
  max-width: 80%;
  max-height: 80%;
}

.full-img span {
  position: absolute;
  top: 3%;
  right: 5%;
  font-size: 30px;
  color: var(--primaryText);
  cursor: pointer;
}



@media only screen and (max-width: 800px) {
  #flex {
      flex-wrap: wrap;
      margin: 10px;
  }

  aside {
      width: 100%;
  }

  main {
      order: 1;
      font-size: smaller;
      line-height: 1.25rem;
  }

  #leftSidebar {
      order: 2;
  }

  #titlebar ul {
      flex-wrap: wrap;
  }

  .characters {
    grid-template-columns: 1fr;
  }

  footer {
    padding: 10px;
  }
}
