*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #000;
  color: #e8e8e8;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

/* Top-left logo: floats over the bar — change size here without affecting header height */
:root {
  --site-logo-width: 175px;
  --site-logo-height: 195px;
  --site-logo-top: 10px;
  --site-logo-left: 10px;
  --site-logo-right-height: 190px;
  --site-logo-right-inset: 10px;
  --feed-column-width: 1000px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding-top: 30px;
  padding-bottom: 30px;
  padding-left: calc(var(--site-logo-left) + var(--site-logo-width) + 12px);
  padding-right: calc(var(--site-logo-right-inset) + min(40vw, 280px) + 12px);
  background: #000000;
  font-family: "Times New Roman", Times, serif;
  min-height: 0;
}

.site-logo-link {
  position: fixed;
  top: var(--site-logo-top);
  left: var(--site-logo-left);
  z-index: 30;
  display: block;
  width: var(--site-logo-width);
  height: var(--site-logo-height);
  margin: 0;
  padding: 0;
  line-height: 0;
  text-decoration: none;
  pointer-events: auto;
}

.site-logo-right-link {
  position: fixed;
  top: var(--site-logo-top);
  right: var(--site-logo-right-inset);
  z-index: 30;
  display: block;
  height: var(--site-logo-right-height);
  line-height: 0;
  text-decoration: none;
  pointer-events: auto;
}

.site-logo {
  display: block;
  width: var(--site-logo-width);
  height: var(--site-logo-height);
  max-width: none;
  object-fit: contain;
  object-position: left top;
  image-rendering: crisp-edges;
}

.site-logo-right {
  display: block;
  height: var(--site-logo-right-height);
  width: auto;
  max-width: min(40vw, 280px);
  object-fit: contain;
  object-position: right top;
  image-rendering: crisp-edges;
}

@media (max-width: 768px) {
  :root {
    --site-logo-width: 46px;
    --site-logo-height: 54px;
  }

  .site-header {
    gap: 4px 6px;
    padding-top: 10px;
    padding-bottom: 10px;
    padding-left: calc(var(--site-logo-left) + var(--site-logo-width) + 8px);
    padding-right: calc(var(--site-logo-right-inset) + min(36vw, 120px) + 6px);
  }

  main {
    padding-top: 16px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .site-logo-right-link {
    --site-logo-right-height: 52px;
    top: var(--site-logo-top);
    right: 8px;
  }

  .site-logo-right {
    max-width: min(36vw, 120px);
  }
}

.site-header .tab {
  flex: 0 0 auto;
  display: inline;
  padding: 0;
  font-family: "Times New Roman", Times, serif;
  font-size: calc(1.3rem + 2px);
  font-weight: normal;
  letter-spacing: normal;
  line-height: 1.4;
  text-decoration: underline;
  border-bottom: none;
  transition: none;
}

/* Classic default link colors (readable on black) */
.site-header .tab:link {
  color: #6666ff;
}

.site-header .tab:visited {
  color: #cc66ff;
}

.site-header .tab:hover,
.site-header .tab:active {
  color: #ff0000;
  background: transparent;
}

.site-header .tab[aria-current="page"] {
  color: #ffffff;
  font-weight: bold;
  text-decoration: underline;
}

@media (max-width: 768px) {
  .site-header .tab {
    font-size: 0.82rem;
    line-height: 1.25;
  }
}

main {
  max-width: var(--feed-column-width);
  margin-left: auto;
  margin-right: auto;
  padding: 28px 18px 96px;
}

.main-home {
  width: 100%;
  max-width: var(--feed-column-width);
}

.lede {
  margin: 0 0 20px;
  font-size: 0.95rem;
  color: #9a9a9a;
  font-family: "Times New Roman", Times, serif;
}

.lede-home-footer {
  margin: 36px 0 0;
  text-align: center;
}

.feed {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.feed:not(.feed--artist-grid) .comic {
  width: 100%;
  max-width: var(--feed-column-width);
}

.feed-sentinel {
  height: 1px;
  width: 100%;
  flex-shrink: 0;
  pointer-events: none;
  visibility: hidden;
}

.comic {
  border: 1px solid #222;
  border-radius: 10px;
  overflow: hidden;
  background: #111;
}

.comic-media-wrap {
  position: relative;
  line-height: 0;
}

.comic-media-wrap.has-comic-carousel,
.comic-grid-thumb-wrap.has-comic-carousel {
  overflow: hidden;
}

.comic-carousel-nav {
  position: absolute;
  top: 50%;
  z-index: 4;
  transform: translateY(-50%);
  margin: 0;
  padding: 0 10px;
  min-width: 40px;
  min-height: 48px;
  border: 0;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.45);
  color: #e8e8e8;
  font-family: "Times New Roman", Times, serif;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.comic-carousel-nav:hover,
.comic-carousel-nav:focus-visible {
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  outline: 2px solid #888;
  outline-offset: 1px;
}

.comic-carousel-prev {
  left: 6px;
}

.comic-carousel-next {
  right: 6px;
}

.comic-carousel-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 4px 8px;
  pointer-events: none;
  opacity: 0.75;
}

.comic-carousel-dot {
  pointer-events: auto;
  width: 8px;
  height: 8px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  touch-action: manipulation;
}

.comic-carousel-dot:hover,
.comic-carousel-dot:focus-visible {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.22);
  outline: none;
}

.comic-carousel-dot.is-active {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.35);
}

.comic-nsfw.is-nsfw-hidden .comic-carousel-nav,
.comic-nsfw.is-nsfw-hidden .comic-carousel-dots {
  display: none;
}

.comic-grid-thumb-wrap .comic-carousel-nav {
  min-width: 32px;
  min-height: 40px;
  font-size: 1.4rem;
}

.comic-grid-thumb-wrap .comic-carousel-dots {
  bottom: 5px;
  gap: 5px;
}

.comic-grid-thumb-wrap .comic-carousel-dot {
  width: 6px;
  height: 6px;
}

.comic-grid-thumb-wrap .comic-carousel-dot.is-active {
  width: 7px;
  height: 7px;
}

.comic-grid-item:not(.is-expanded) .comic-carousel-nav,
.comic-grid-item:not(.is-expanded) .comic-carousel-dots {
  display: none;
}

.comic-media-wrap.comic-nsfw.is-nsfw-hidden {
  min-height: 220px;
  background: #1a1a1a;
}

.comic-nsfw-shield {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 16px;
  border: 0;
  background: rgba(0, 0, 0, 0.88);
  color: #c8c8c8;
  font-family: "Times New Roman", Times, serif;
  font-size: 0.95rem;
  line-height: 1.35;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
}

.comic-nsfw-shield:hover,
.comic-nsfw-shield:focus-visible {
  color: #fff;
  background: rgba(20, 20, 20, 0.94);
  outline: 2px solid #666;
  outline-offset: -2px;
}

.comic-nsfw.is-nsfw-hidden .comic-img,
.comic-nsfw.is-nsfw-hidden .comic-grid-img {
  visibility: hidden;
  max-height: 0;
  overflow: hidden;
}

.comic-grid-thumb-wrap {
  position: relative;
  display: inline-block;
  line-height: 0;
}

.comic-grid-thumb-wrap.comic-nsfw.is-nsfw-hidden {
  min-width: 140px;
  min-height: 140px;
  background: #1a1a1a;
}

.comic-grid-thumb-wrap .comic-nsfw-shield {
  font-size: 0.72rem;
  padding: 10px;
}

.comic-full-link {
  display: block;
  line-height: 0;
  text-decoration: none;
  color: inherit;
  outline-offset: 2px;
  cursor: pointer;
}

.comic-img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.comic-meta {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 3px 5px 5px;
  font-family: "Times New Roman", Times, serif;
  font-size: 1.2rem;
  line-height: 1.4;
}

.comic-meta .comic-title {
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  font-size: inherit;
  font-weight: normal;
  line-height: inherit;
  color: #c8c8c8;
  white-space: nowrap;
}

.comic-meta .comic-credit {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  font-size: inherit;
  line-height: inherit;
  color: #777;
  text-align: right;
}

.comic-credit--empty {
  padding: 0;
}

.comic-credit {
  margin: 0;
  padding: 6px 10px 10px;
  font-family: "Times New Roman", Times, serif;
  font-size: 0.75rem;
  line-height: 1.35;
  color: #777;
}

.comic-credit a:link {
  color: #6666ff;
  text-decoration: underline;
}

.comic-credit a:visited {
  color: #cc66ff;
  text-decoration: underline;
}

.comic-credit a:hover,
.comic-credit a:active {
  color: #ff0000;
}

.status {
  text-align: center;
  padding: 36px 16px;
  color: #666;
  font-size: 0.95rem;
}

.status.error {
  color: #d08080;
}

.prose {
  color: #c4c4c4;
}

.prose h1 {
  font-size: 1.5rem;
  margin-top: 0;
}

.prose p {
  max-width: 58ch;
}

.feed.feed--artist-grid {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

.artist-grid-columns {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 14px;
  width: 100%;
}

.artist-grid-column {
  flex: 0 0 288px;
  width: 288px;
  max-width: 288px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.comic-grid-item {
  margin: 0;
  width: 100%;
  max-width: 288px;
  border: 1px solid #222;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.comic-grid-item.is-expanded {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.comic-grid-toggle {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: #000;
  cursor: pointer;
  line-height: 0;
}

.comic-grid-item.is-expanded .comic-grid-toggle {
  display: block;
  width: 100%;
  max-width: 100%;
}

.comic-grid-item.is-expanded .comic-grid-thumb-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
}

.comic-grid-img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  vertical-align: middle;
  user-select: none;
  -webkit-user-drag: none;
}

.comic-grid-item.is-expanded .comic-grid-img {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  max-height: none;
}

.comic-grid-item.is-expanded .comic-grid-foot {
  width: 100%;
}

.comic-grid-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.comic-grid-foot .comic-meta {
  flex: 1;
  min-width: 0;
  padding: 3px 5px 5px;
}

.comic-grid-open {
  flex-shrink: 0;
  display: none;
  padding: 0;
  font-family: "Times New Roman", Times, serif;
  font-size: 1.2rem;
  line-height: 1.4;
  text-decoration: underline;
}

.comic-grid-item.is-expanded .comic-grid-open {
  display: inline;
}

.monthly-artist-feature {
  border-color: #3a3a3a;
}

.comic-grid-open:link {
  color: #6666ff;
}

.comic-grid-open:visited {
  color: #cc66ff;
}

.comic-grid-open:hover,
.comic-grid-open:active {
  color: #ff0000;
}

.artist-image-panel {
  position: fixed;
  left: var(--site-logo-left);
  top: calc(
    var(--site-logo-top) + var(--site-logo-height) + 70px
  );
  transform: none;
  z-index: 25;
}

.artist-image-panel-badge {
  width: 168px;
  padding: 5px 5px 4px;
  background: #b8b8b8;
  border: 1px solid #1e1e1e;
  box-shadow: 0 0 0 1px #c8c8c8 inset;
}

.artist-image-panel-label {
  margin: 0 0 4px;
  padding: 2px 3px;
  background: #d8d8d8;
  color: #111;
  font-family: "Times New Roman", Times, serif;
  font-size: calc(0.8rem + 1pt);
  line-height: 1.15;
  text-align: center;
  border: 1px solid #999;
}

.artist-image-panel-subtitle {
  margin: 2px 0 0;
  padding: 2px 3px 1px;
  background: #d8d8d8;
  color: #111;
  font-family: "Times New Roman", Times, serif;
  font-size: calc(0.9rem + 1pt);
  line-height: 1.15;
  text-align: center;
  border: 1px solid #999;
}

.artist-image-panel-thumb-btn {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  margin: 0;
  padding: 2px;
  border: 1px solid #686868;
  background: #c4c4c4;
  line-height: normal;
  cursor: pointer;
  font: inherit;
  text-align: inherit;
}

.artist-image-panel-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 10 / 24;
  object-fit: cover;
  object-position: center;
  border: 1px solid #7a7a7a;
  background: #525252;
}

.artist-image-panel-dialog {
  border: 0;
  padding: 0;
  background: transparent;
}

.artist-image-panel-dialog::backdrop {
  background: rgba(0, 0, 0, 0.8);
}

.artist-image-panel-dialog-window {
  position: relative;
  width: min(88vw, 980px);
  max-height: 88vh;
  padding: 6px;
  border: 1px solid #000;
  background: #ececec;
}

.artist-image-panel-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border: 1px solid #000;
  background: #fff;
  color: #000;
  font-family: "Times New Roman", Times, serif;
  cursor: pointer;
}

.artist-image-panel-full {
  display: block;
  width: 100%;
  max-height: calc(88vh - 90px);
  object-fit: contain;
  background: #111;
  border: 1px solid #555;
}

.artist-image-panel-description {
  margin: 8px 2px 2px;
  padding: 6px 8px;
  border: 1px solid #555;
  background: #0a0a0a;
  color: #d8d8d8;
  font-family: "Times New Roman", Times, serif;
  font-size: 0.95rem;
  line-height: 1.35;
}

.artist-image-panel-credit {
  width: min(88vw, 980px);
  margin: 0 auto;
  padding: 6px 8px 8px;
  border: 0;
  background: #0a0a0a;
  box-shadow: none;
}

.artist-image-panel-dialog > .artist-image-panel-credit {
  margin-top: 0;
  padding: 6px 8px 8px;
}

body.has-artist-image-panel main {
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 900px) {
  /* Character of the Month: tiny tab → desktop preview → full image (mobile only) */
  .artist-image-panel {
    top: auto;
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
    left: max(10px, env(safe-area-inset-left, 0px));
    transform: none;
    opacity: 1;
    max-width: min(52vw, 230px);
    pointer-events: none;
  }

  .artist-image-panel-badge {
    width: auto;
    max-width: min(52vw, 230px);
    padding: 3px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
    pointer-events: auto;
  }

  .artist-image-panel-label {
    font-size: 0.72rem;
    margin-bottom: 0;
    padding: 3px 5px;
  }

  .artist-image-panel-subtitle {
    font-size: 0.82rem;
    margin-top: 0;
    padding: 2px 5px 3px;
  }

  .artist-image-panel-thumb-btn {
    padding: 0;
    gap: 0;
    touch-action: manipulation;
  }

  .artist-image-panel-thumb {
    display: none;
  }

  .artist-image-panel.is-mobile-expanded {
    max-width: min(132px, 32vw);
    pointer-events: auto;
  }

  .artist-image-panel.is-mobile-expanded .artist-image-panel-badge {
    width: 100%;
    max-width: 132px;
    padding: 3px;
  }

  .artist-image-panel.is-mobile-expanded .artist-image-panel-label {
    font-size: 0.8rem;
    margin-bottom: 2px;
    padding: 2px 3px;
  }

  .artist-image-panel.is-mobile-expanded .artist-image-panel-subtitle {
    font-size: 0.9rem;
    margin-top: 1px;
    padding: 2px 3px 1px;
  }

  .artist-image-panel.is-mobile-expanded .artist-image-panel-thumb-btn {
    padding: 1px;
    gap: 0;
  }

  .artist-image-panel.is-mobile-expanded .artist-image-panel-thumb {
    display: block;
    aspect-ratio: 10 / 18;
    cursor: pointer;
  }

  body.has-artist-image-panel main {
    margin-left: auto;
    padding-bottom: 0;
  }
}
