/* === BASE STYLES (Dark mode is default) === */
body {
  background: linear-gradient(135deg, #001F3F, #8A0303);
  color: #f0d9d9;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 20px;
}

header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 40px;
  position: relative;
}

.logo {
  align-self: flex-start;
  max-width: 100px;
  height: auto;
  margin-bottom: 10px;
}

#theme-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

h1 {
  font-size: 3rem;
  color: #ff3b3b;
  text-shadow: 1px 1px 2px #001F3F;
}

.tagline {
  font-style: italic;
  color: #ffa6a6;
  margin-top: -10px;
  font-size: 1.2rem;
  letter-spacing: 1px;
}

nav a {
  color: #a0c4ff;
  margin: 0 15px;
  text-decoration: none;
  font-weight: bold;
}

nav a:hover {
  color: #ff4444;
}

main {
  margin: auto;
}

.page-selection-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 25px;
  max-width: 960px;
  margin: 20px auto 60px;
  padding: 0 10px;
  justify-items: center;
}

.comic-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  background-color: #162238;
  border: 3px solid #8a0303;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 0 15px #8a0303aa;
  color: #f0d9d9;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  width: 140px;
}

.comic-thumb:hover {
  border-color: #ff3b3b;
  box-shadow: 0 0 20px #ff3b3baa;
}

.comic-thumb img {
  max-width: 100%;
  border-radius: 8px;
  margin-bottom: 8px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.comic-thumb span {
  font-weight: bold;
  font-size: 1rem;
  text-align: center;
  color: inherit;
}

article {
  background-color: #1a2b44;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
  box-shadow: 0 0 10px #8a0303aa;
}

article h2 {
  color: #ff4c4c;
  margin-bottom: 10px;
}

article p {
  line-height: 1.6;
  color: #f0d9d9;
}

.sections-container {
  display: flex;
  gap: 40px;
  max-width: 960px;
  margin: 0 auto 60px;
  padding: 0 10px;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: nowrap;
}

.sections-container section {
  flex: 1 1 45%;
  background-color: #1a2b44;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 0 15px #8a0303aa;
  color: #f0d9d9;
  min-width: 280px;
  box-sizing: border-box;
}

#written-works {
  text-align: left;
}

#comics {
  text-align: right;
}

.sections-container .grid-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 20px;
  padding: 0;
}

.item-link {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: #162238;
  border: 3px solid #8a0303;
  border-radius: 10px;
  padding: 10px;
  color: #f0d9d9;
  font-weight: bold;
  text-decoration: none;
  box-shadow: 0 0 10px #8a0303aa;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.item-link:hover {
  border-color: #ff3b3b;
  box-shadow: 0 0 12px #ff3b3baa;
}

.item-link img {
  max-width: 80px;
  max-height: 80px;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0;
}

.item-link span {
  font-weight: bold;
  font-size: 1rem;
  color: inherit;
}

@media (max-width: 900px) {
  .sections-container {
    flex-direction: column;
    gap: 40px;
    align-items: stretch;
  }
  .sections-container section {
    flex: 1 1 100%;
    width: auto;
    margin-bottom: 40px;
    text-align: left !important;
  }
  .item-link {
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
  }
  .item-link img {
    max-width: 100%;
    max-height: 280px;
  }
  .item-link span {
    margin-top: 10px;
  }
}

button {
  background-color: #8a0303;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  margin-top: 20px;
  box-shadow: 0 0 8px #001f3f88;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #ff4444;
}

.panel {
  display: block;
  margin-left: auto;
  margin-right: auto;
  margin: 10px auto;
  max-width: 100%;
  height: auto;
}

footer {
  text-align: center;
  padding: 15px 10px;
  background-color: #1a2b44;
  color: #f0d9d9;
  font-size: 0.9rem;
  border-top: 2px solid #8a0303;
  margin-top: 40px;
}

footer a {
  color: #a0c4ff;
  text-decoration: none;
  font-weight: bold;
  margin: 0 8px;
}

footer a:hover {
  color: #ff4444;
}

/* === LIGHT MODE OVERRIDES === */
body.light-mode {
  background: linear-gradient(135deg, #cce7ff, #ffb6c1);
  color: #333;
}

body.light-mode h1 {
  color: #ff6b81;
  text-shadow: 1px 1px 2px #cce7ff;
}

body.light-mode .tagline {
  color: #cc6699;
}

body.light-mode nav a {
  color: #3366cc;
}

body.light-mode nav a:hover {
  color: #ff6699;
}

body.light-mode article {
  background-color: #f0f8ff;
  box-shadow: 0 0 10px #ffb6c1aa;
}

body.light-mode article h2 {
  color: #ff6699;
}

body.light-mode article p {
  color: #333;
}

body.light-mode #theme-toggle {
  color: #333;
}

body.light-mode .grid-container {
  background-color: #f0f8ff;
  max-width: 900px;
  margin: 20px auto 40px auto;
  padding: 0 10px;
}

body.light-mode .item-link {
  background-color: #fff;
  border-color: #ffb6c1;
  color: #333;
  box-shadow: 0 0 10px #ffb6c1aa;
}

body.light-mode .item-link:hover {
  border-color: #ff6699;
  box-shadow: 0 0 12px #ff6699aa;
}

body.light-mode .comic-thumb {
  background-color: #fff;
  border-color: #ffb6c1;
  color: #333;
  box-shadow: 0 0 10px #ffb6c1aa;
}

body.light-mode .comic-thumb:hover {
  border-color: #ff6699;
  box-shadow: 0 0 15px #ff6699aa;
}

/* === DUSK MODE OVERRIDES (Add your dusk mode styles here) === */
body.dusk-mode {
  background: linear-gradient(135deg, #5a2a83, #ff7f50);
  color: #e0d5c5;
}

body.dusk-mode h1 {
  color: #dda0dd; /* plum */
  text-shadow: 1px 1px 2px #5a2a83;
}

body.dusk-mode .tagline {
  color: #ffa07a; /* light salmon */
}

body.dusk-mode nav a {
  color: #dda0dd;
}

body.dusk-mode nav a:hover {
  color: #ff7f50;
}

body.dusk-mode article {
  background-color: #4b3573;
  box-shadow: 0 0 10px #ff7f50aa;
}

body.dusk-mode article h2 {
  color: #ff7f50;
}

body.dusk-mode article p {
  color: #e0d5c5;
}

body.dusk-mode #theme-toggle {
  color: #e0d5c5;
}

body.dusk-mode .item-link {
  background-color: #3b2c61;
  border-color: #dda0dd;
  color: #e0d5c5;
  box-shadow: 0 0 10px #dda0ddaa;
}

body.dusk-mode .item-link:hover {
  border-color: #ff7f50;
  box-shadow: 0 0 12px #ff7f50aa;
}

body.dusk-mode .comic-thumb {
  background-color: #3b2c61;
  border-color: #dda0dd;
  color: #e0d5c5;
  box-shadow: 0 0 10px #dda0ddaa;
}

body.dusk-mode .comic-thumb:hover {
  border-color: #ff7f50;
  box-shadow: 0 0 15px #ff7f50aa;
}
