/* bad comics dot com: one small stylesheet, no framework. */

/* One light theme: a white column on soft green. Contrast ratios are against white. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --fg: #111111;
  --muted: #555555;        /* 7.5:1 */
  --link: #2a6b4a;         /* 6.4:1 */
  --btn-bg: #2f5d46;       /* white text: 7.6:1 */
  --btn-bg-hover: #1f4232;
  --btn-fg: #ffffff;
  --border: #d4ddd2;
  --focus: #b45309;        /* 5.0:1 */
  --side: #b7cfb4;         /* sage green either side of the column */
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--side);
  color: var(--fg);
  font: 1.0625rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  text-align: center;
}

/* The central column; the body colour shows either side of it. */
.page {
  max-width: 860px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--border);
}

@media (max-width: 600px) {
  .page { padding: 0 1rem 1.5rem; box-shadow: none; }
}

a { color: var(--link); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

main:focus { outline: none; }

/* Hidden on screen but still read by screen readers (e.g. labels for the arrow buttons). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link: hidden until focused. */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  padding: 0.5rem 1rem;
  background: var(--btn-bg);
  color: var(--btn-fg);
  z-index: 10;
}
.skip-link:focus { top: 0.5rem; }

/* Header */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.site-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.site-header ul {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-header li a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.75rem;
}

/* Comic page */
.comic h1 { margin: 0.5rem 0 1rem; font-size: 1.75rem; line-height: 1.2; }

.comic-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.375rem;
  margin: 0.75rem 0;
  padding: 0;
  list-style: none;
}
.comic-nav a,
.comic-nav [aria-disabled="true"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 44px;
  padding: 0 0.9rem;
  border-radius: 4px;
  font-size: 1.375rem;
  font-weight: 600;
  text-decoration: none;
}
.comic-nav a {
  background: var(--btn-bg);
  color: var(--btn-fg);
}
.comic-nav a:hover { background: var(--btn-bg-hover); }
.comic-nav [aria-disabled="true"] {
  border: 1px dashed var(--border);
  color: var(--muted);
  cursor: default;
}

/* Comics display at a fixed 450px wide (full width on phones). */
.comic-figure { margin: 0; }
.comic-figure picture { display: block; }
.comic-img {
  display: block;
  width: 450px;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.comic-figure + .comic-nav ul { margin-top: 1.25rem; }


.permalink {
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.commentary {
  max-width: 640px;
  margin: 1.5rem auto 0;
  text-align: left;
}

/* Archive */
.archive {
  max-width: 640px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  text-align: left;
}
.archive li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.75rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--border);
}
.archive a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
}
.archive-num { min-width: 3.5ch; color: var(--muted); font-variant-numeric: tabular-nums; }
