/*===========================
    GLOBAL STYLES & SETUP
===========================*/

/* CSS variables for theming */
:root {
  --bg-color: #ffffff;
  --border-color: #1a1717;
  --hover-color: #DA5437;
  --link-color: #1f1e20;
  --link-hover: #5b999b;
  --footer-color: #421a1a;
  --footer-link: #c8d32b;
  --footer-hover: #868d26;
}

/* Optional Dark Mode support */
body.dark {
  --bg-color: #1e1e1e;
  --border-color: #444;
  --hover-color: #73473a;
  --link-color: #9ad8d9;
  --link-hover: #d8ab90;
  --footer-color: #e0e0e0;
  --footer-link: #d2ff82;
  --footer-hover: #c2d764;
}

/* Reset and box model */
html, body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

body {
  background: url('rm298-wan-09.jpg');
  background-size: cover;
  color: var(--text-color, #000);
  font-family: 'Open Sans', sans-serif;
}

/*===========================
    TYPOGRAPHY
===========================*/

#showComic, header, h1, h2, h3, h4, h5 {
  font-family: "Boldonse", system-ui;
  font-weight: 400;
  font-style: normal;
}

/* Paragraphs and footer text */
.subPage p, footer, #authorNotes, .archiveTable {
  font-size: large;
}

/*===========================
    LINKS
===========================*/

a {
  color: var(--link-color);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
}

a:focus {
  outline: none;
}

a:focus-visible {
  outline: 2px dashed var(--hover-color);
  outline-offset: 3px;
  border-radius: 4px;
  transition: outline 0.2s ease;
}

/*===========================
    HEADER
===========================*/

header img {
  width: 900px;
  max-width: 100%;
}

header #nav {
  background-color: var(--bg-color);
  outline: 5px solid #7be6c580;
  font-size: 20px;
  width: 100%;
  margin: auto;
}

/* clearfix hack */
.clearfix::after {
  content: "";
  clear: both;
  display: table;
}

/*===========================
    SUBPAGES
===========================*/

/* REVERTED ORIGINAL STYLES for About, Characters, Archive */

.subPage {
  width: 1000px;
  max-width: 100%;
  background-color: #ffffff;
  outline: 5px solid #7be6c580;
  margin: auto;
  margin-bottom: 10px;
  padding: 0px 12px 12px;
}

.subPage:not(.archivePage) {
  text-align: center;
}

/* archive page text aligned left */
.subPage.archivePage {
  text-align: center;
}

/*===========================
    IMAGE ALIGNMENT
===========================*/

/* for pictures displayed to the left */
.leftPic {
  clear: left;
  float: right;
  margin-left: 20px;
}

/* for pictures displayed to the right */
.rightPic {
  clear: right;
  float: left;
  margin-left: 20px;
}

/*===========================
    CHARACTER TABLE
===========================*/

.charTable, .charTable td {
  width: 100%;
}

/*===========================
    COMIC PAGE
===========================*/

.comicPage img {
  width: 900px;
  max-width: 100%;
  box-shadow: 0 20px 15px rgba(0, 0, 0, 0.3);
  border-radius: 6px; /* optional, rounds corners nicely */
  }

/*===========================
    COMIC NAVIGATION
===========================*/

.comicNav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
}

.comicNav img {
  width: 80px;
  max-width: 100%;
  padding-right: 30px;
  cursor: pointer;
}

/*===========================
    AUTHOR NOTES
===========================*/

#authorNotes {
  background-color: #ffffff;
  outline: 3px solid #000000;
  margin: auto;
  padding: 3px;
  padding-top: 0px;
  width: 900px;
  max-width: 100%;
}

/*===========================
    ARCHIVE PAGE
===========================*/

.archiveTable {
  width: 90%;
  border-collapse: collapse;
}

.archiveTable td {
  padding: 3px;
  vertical-align: center;
}

.archiveCellTitle:not(.leftAlignTableText) {
  max-width: 300px;
  text-align: center;
}

.archiveCellDate {
  text-align: right;
  min-width: 120px;
}

.archiveCellNum {
  text-align: center;
  min-width: 30px;
}

.archiveCellThumb {
  width: 500px;
  max-width: 60px;
}

.archiveCellThumb img {
  max-width: 100%;
}

.leftAlignTableText td {
  text-align: left;
}

.archiveRow:hover {
  background-color: #DA5437;
  cursor: pointer;
}

/*===========================
    FOOTER
===========================*/

footer {
  color: #421a1a;
  margin-top: 12px;
  margin-bottom: 15px;
  float: left;
  width: 100%;
  font-size: 12px;
}

footer p {
  margin: auto;
}

footer a {
  color: #c8d32b;
}

footer a:hover {
  color: #868d26;
}

/*===========================
    RESPONSIVE DESIGN
===========================*/

@media (max-width: 600px) {
  .comicPage img,
  .subPage,
  #authorNotes {
    padding: 8px;
    font-size: 1rem;
  }

  .comicNav img {
    width: 50px;
    padding-right: 10px;
  }

  .leftPic,
  .rightPic {
    float: none;
    margin: 10px auto;
    display: block;
  }

  header img {
    width: 100%;
  }
}
