/* ---- RESET ---- */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, serif;
  background: #032f30;
  color: #ffe5c0;
  display: flex;
  flex-direction: column;
}

/* ---- HEADER + LOGO ---- */
header {
  position: relative;
  background: url('AAAA.png') center/cover no-repeat;
  height: 330px;
  width: 100%;
  max-width: 1190px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
}

#logo {
  position: absolute;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  width: 1190px;
  max-width: 100%;
  height: auto;
  z-index: 2;
}

header h1 {
  font-size: 2rem;
  margin: 0 0 .5rem;
  font-variant: small-caps;
  letter-spacing: 1px;
}

header p {
  font-style: italic;
  font-size: 1.3rem;
  color: #ffe5c0;
}

/* ---- LAYOUT ---- */
.container {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* ---- SIDEBAR ---- */
.sidebar {
  flex: 1;
  max-width: 300px;
  padding-right: 3rem;
  border-right: 1px solid #ffe5c0;
}

.sidebar h2 {
  font-size: 2.4rem;
  font-weight: bold;
  margin-bottom: .5rem;
  border-bottom: 2px solid #ffe5c0;
  padding-bottom: 0.4rem;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar ul li a {
  text-decoration: none;
  color: #ffe5c0;
  font-size: 1.7rem;
  font-weight: normal;
  padding: 0.4rem 0.6rem;
  border-radius: 5px;
  display: inline-block;
  transition: background 0.2s;
}

.sidebar a:hover {
  background: #e2e2e2;
  color: #222;
}

/* ---- ARCHIVE ---- */
.archive {
  flex: 3;
  padding-left: 2rem;
}

.chapter {
  margin-bottom: 4rem;
}

.chapter h2 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  color: #ffe5c0;
  border-left: 4px solid #ffe5c0;
  padding-left: .5rem;
  font-weight: normal;
}

/* ---- THUMB GRID (desktop) ---- */
.pages {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  justify-items: center;
  margin-top: 1rem;
}

.pages a {
  width: 160px;
  text-align: center;
  background: #032f30;
  color: #ffe5c0;
  padding: .5rem 1rem;
  border-radius: 6px;
  font-size: .95rem;
  text-decoration: none;
  transition: background .2s;
}

.pages a:hover {
  background: #d3d0cc;
  color: #222;
}

.pages a div {
  margin-top: 0.3rem;
}

/* ---- NAV BUTTONS ---- */
.nav-buttons a {
  padding: 0.4rem 0.8rem;
  margin: 0 0.3rem;
  text-decoration: none;
  color: #ffe5c0;
  border: 2px solid #ffe5c0;
  border-radius: 6px;
  font-weight: bold;
  transition: background 0.2s, color 0.2s;
}

.nav-buttons a:visited {
  color: #ffe5c0;
}

.nav-buttons a.active {
  background: #ffe5c0;
  color: #032f30;
}

.nav-buttons a.disabled {
  opacity: 0.4;
  pointer-events: none;
  border-color: #888;
  color: #888;
}

/* ---- FOOTER ---- */
footer {
  text-align: center;
  margin: 4rem 0 2rem;
  font-size: .9rem;
  color: #999;
}
/* Responsive adjustments for mobile */
@media (max-width: 768px) {
  header {
    width: 100%;
    height: auto;
  }

  #logo {
    width: 90%;
    top: 20px;
  }

  .container {
    flex-direction: column;
    padding: 1rem;
  }

  .sidebar {
    max-width: 100%;
    padding-right: 0;
    border-right: none;
    margin-bottom: 2rem;
  }

  .archive {
    padding-left: 0;
  }

  .pages {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .nav-buttons {
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav-buttons a {
    font-size: 1rem;
    margin: 0.4rem 0.6rem;
  }

  .comic-img {
    max-width: 100%;
    height: auto;
  }
}

/* Ensure buttons are consistent across layouts */
.nav-buttons {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.nav-buttons a {
  padding: 0.4rem 0.8rem;
  margin: 0.3rem;
  text-decoration: none;
  color: #ffe5c0;
  border: 2px solid #ffe5c0;
  border-radius: 6px;
  font-weight: bold;
  transition: background 0.2s, color 0.2s;
  display: inline-block;
}

.nav-buttons a.disabled {
  opacity: 0.4;
  pointer-events: none;
  border-color: #888;
  color: #888;
}

.nav-buttons a.active {
  background: #ffe5c0;
  color: #032f30;
}