/* Public site styles. Colours and fonts come from Site settings (set in the page as --bg, --text, etc.). */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
}
main { flex: 1; width: 100%; }
a { color: var(--accent); }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-heading); font-weight: var(--heading-weight); line-height: 1.15; }

.muted { color: color-mix(in srgb, var(--text) 65%, transparent); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Header and menu */
.site-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .75rem 1.5rem; padding: .75rem 1.25rem; background: var(--panel);
}
.brand { font-family: var(--font-heading); font-weight: var(--heading-weight); font-size: 1.6rem; color: var(--text); text-decoration: none; }
.brand img { display: block; max-height: 56px; width: auto; }
.site-nav { display: flex; flex-wrap: wrap; gap: .25rem 1.4rem; }
.site-nav a {
  color: var(--text); text-decoration: none; font-family: var(--font-heading);
  padding: .2rem 0; border-bottom: 2px solid transparent;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); border-color: var(--accent); }

/* Page body */
.wrap { max-width: var(--page-width); margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.wrap-wide { max-width: 1200px; }
.wrap.narrow { max-width: 720px; }
.comic-head { text-align: center; margin-bottom: 2rem; }
.comic-head h1 { font-size: clamp(1.9rem, 5vw, 3.2rem); margin: .3em 0 .2em; }
.comic-head p { margin: .2rem 0; }
.prose p { margin: 0 0 1em; }
.comic-head .prose { max-width: 40rem; margin: 1rem auto 0; }
.back { margin: 0 0 1rem; }
.back:last-child { margin: 2rem 0 0; text-align: center; }
.empty { text-align: center; padding: 3rem 1rem; font-size: 1.25rem; }

/* Comic pages */
.comic-page { margin: 0 0 2.75rem; }
.comic-page img { display: block; width: 100%; height: auto; margin: 0 auto; }
.comic-page a { display: block; }
.comic-page figcaption {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .2rem 1.1rem;
  padding-top: .6rem; font-size: .92rem;
}
.page-num { font-family: var(--font-heading); }
.caption { flex-basis: 100%; text-align: center; margin: .2rem 0 0; }

/* Buttons and page-at-a-time controls */
.button {
  display: inline-block; padding: .55rem 1.1rem; border: 0; border-radius: 4px; cursor: pointer;
  background: var(--button); color: var(--button-text); font: inherit; font-family: var(--font-heading);
  line-height: 1.2; text-decoration: none;
}
.button:hover { filter: brightness(1.12); }
.button.disabled { opacity: .3; pointer-events: none; }
.pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .5rem; margin: 0 0 1.5rem; }
.comic-page + .pager { margin-top: -1rem; }
.pager .count { min-width: 6ch; text-align: center; font-family: var(--font-heading); }

/* Archive */
.archive-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.5rem;
}
.archive-card a { display: block; height: 100%; overflow: hidden; border-radius: 6px; background: var(--panel); color: inherit; text-decoration: none; }
.archive-card .cover { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: color-mix(in srgb, var(--text) 8%, transparent); }
.archive-card .cover img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.archive-card a:hover .cover img { transform: scale(1.03); }
.archive-card .info { padding: .8rem 1rem 1rem; }
.archive-card h3 { margin: 0 0 .3rem; font-size: 1.3rem; }
.archive-card a:hover h3 { color: var(--accent); }
.new-badge {
  position: absolute; top: .6rem; left: .6rem; padding: .2rem .6rem; border-radius: 3px;
  background: var(--button); color: var(--button-text); font-family: var(--font-heading); font-size: .85rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}
.comics-section { margin: 0 0 3rem; }
.comics-section > h2 { margin: 0 0 1rem; font-size: clamp(1.5rem, 3.5vw, 2.1rem); }
.archive-card p { margin: .1rem 0; font-size: .92rem; }

/* About */
.about-section { margin-top: 2.5rem; }
.social { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.25rem; padding: 0; margin: 0 0 .75rem; }
.social-left { justify-content: flex-start; }

/* Footer */
.site-footer { padding: 1.5rem 1rem; background: var(--panel); text-align: center; font-size: .9rem; }
.site-footer p { margin: .25rem 0; }

/* Landing page */
body.landing { background-image: none; }
.hero { position: relative; display: block; height: 100vh; height: 100svh; overflow: hidden; color: var(--text); text-decoration: none; }
.hero picture { display: block; width: 100%; height: 100%; }
.hero-img { display: block; width: 100%; height: 100%; object-fit: var(--hero-fit); object-position: center; }
.hero-placeholder { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; text-align: center; }
.hero-placeholder h1 { margin: 0; font-size: clamp(2.8rem, 11vw, 8rem); }
.hero-placeholder p { margin: .5rem 0 0; font-size: clamp(1rem, 2.5vw, 1.4rem); }
.hero .enter {
  position: absolute; left: 50%; bottom: 14%; transform: translateX(-50%);
  padding: .8rem 2.2rem; font-size: 1.3rem; box-shadow: 0 4px 20px rgba(0, 0, 0, .45);
}
.hero:hover .enter { filter: brightness(1.12); }
.landing-links { position: fixed; left: 0; right: 0; bottom: 1rem; display: flex; justify-content: center; gap: 1.5rem; font-size: .95rem; }
.landing-links a { color: var(--text); text-shadow: 0 1px 4px rgba(0, 0, 0, .8); }

/* "Back soon" page and admin notice */
.maintenance { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; text-align: center; }
.maintenance h1 { font-size: clamp(2.2rem, 8vw, 5rem); margin: 0 0 .5rem; }
.admin-bar { padding: .45rem 1rem; background: #ffb703; color: #111; text-align: center; font: 14px/1.4 system-ui, sans-serif; }
.admin-bar a { color: #111; }

@media (max-width: 600px) {
  .site-header { justify-content: center; text-align: center; }
  .site-nav { justify-content: center; }
  .wrap { padding: 1rem .5rem 2.5rem; }
  .comic-page { margin-bottom: 2rem; }
  .pager .button { padding: .5rem .7rem; }
}
