/*
 * geesko — ink & paper comic theme
 *
 * The site is a web comic, so the page is dressed like one: warm cream
 * "newsprint" with a faint halftone dot screen, ink-black bands for the
 * masthead and footer framing a white "panel" the strip is printed on,
 * hard offset ink shadows instead of blur shadows, and classic comic
 * primaries — caption yellow #FFD23F, comic red #E23B2E — used as accents
 * against warm near-black ink #1B1712. Links use a deep print blue.
 *
 * Type: Bangers (self-hosted, latin) carries display lettering — wordmark,
 * caption title, buttons; Patrick Hand (self-hosted) carries
 * hand-lettered annotations (tagline, alt text); UI text stays on the
 * system sans; permalinks and metadata stay on the system mono.
 *
 * Layout facts the markup depends on: body is a flex column with
 * min-height: 100vh and #middleContainer (flex: 1 0 auto) so the footer
 * sits at the viewport bottom on short pages; the masthead is a flex row
 * (wordmark left, nav right) with a yellow registration rule underneath;
 * the strip renders inside a white .panel figure between two identical
 * ul.comicNav rows; admin pages reuse the chrome via #middleContainer.admin.
 * Breakpoints: 880px (stacked masthead, tighter panel shadow) and 640px
 * (admin table becomes stacked cards). Every interactive element has a
 * focus-visible ring; transitions are disabled under prefers-reduced-motion.
 */

@font-face {
  font-family: "Bangers";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/bangers-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                 U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
                 U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF,
                 U+FFFD;
}

@font-face {
  font-family: "Patrick Hand";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/patrick-hand-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                 U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
                 U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF,
                 U+FFFD;
}

:root {
  /* Newsprint */
  --paper: #faf3e7;
  --panel: #fffdf4;
  --line: #e7dcc9;
  --line-strong: #cfc2a9;

  /* Ink */
  --ink: #1b1712;
  --ink-2: #3f3a32;
  --muted: #6e6759;
  --faint: #a79e8e;

  /* Comic primaries */
  --yellow: #ffd23f;
  --yellow-deep: #f0be1a;
  --red: #e23b2e;
  --red-deep: #c62a1f;

  /* Links: deep print blue (7.0:1 on --paper) */
  --blue: #2255a4;
  --blue-deep: #173f7a;

  /* Semantics */
  --danger: #c62a1f;

  /* Type */
  --display: "Bangers", "Arial Black", sans-serif;
  --hand: "Patrick Hand", "Comic Sans MS", cursive;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, "DejaVu Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --measure: 900px;
  --gutter: max(20px, calc((100% - var(--measure)) / 2));
  --speed: .16s;
  --lift: .12s;
}

* { box-sizing: border-box; }

html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background-color: var(--paper);
  /* Faint halftone screen, the way old pulp paper was printed. */
  background-image: radial-gradient(circle, rgba(27, 23, 18, .038) 1px,
                                             transparent 1.2px);
  background-size: 24px 24px;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.6;
  text-align: center;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--yellow); color: var(--ink); }

a {
  color: var(--blue);
  text-decoration: none;
  transition: color var(--speed) ease;
}
a:hover {
  color: var(--blue-deep);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
a:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
  border-radius: 2px;
}

img { border: 0; }

/* --- Skip link ----------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -64px;
  left: 16px;
  z-index: 10;
  padding: 10px 18px 11px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 6px;
  box-shadow: 4px 4px 0 var(--ink);
  color: var(--ink);
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: top var(--lift) ease;
}
.skip-link:focus-visible {
  top: 12px;
  color: var(--ink);
  text-decoration: none;
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

/* --- Masthead band -------------------------------------------------------- */
/* Ink band with its own halftone screen and a yellow registration rule —
   think of the top bar of a printed comic cover. */
#topContainer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 22px var(--gutter) 20px;
  background-color: var(--ink);
  background-image: radial-gradient(circle, rgba(255, 255, 255, .075) 1.2px,
                                             transparent 1.45px);
  background-size: 17px 17px;
  border-bottom: 5px solid var(--yellow);
  text-align: left;
}

#masthead { line-height: 1; }
.brand {
  display: inline-block;
  color: var(--panel);
  font-family: var(--display);
  font-size: clamp(32px, 4.5vw, 42px);
  letter-spacing: .045em;
  line-height: .95;
  text-transform: lowercase;
}
.brand::after { content: "!"; color: var(--yellow); }
.brand:hover { color: var(--panel); text-decoration: none; }
.brand:focus-visible { outline-color: var(--yellow); }
.tagline {
  display: block;
  margin-top: 5px;
  color: rgba(255, 255, 255, .66);
  font-family: var(--hand);
  font-size: 16px;
  line-height: 1.2;
  transform: rotate(-.6deg);
  transform-origin: left center;
  width: max-content;
  max-width: 100%;
}

#topNav ul {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
#topNav a {
  display: inline-block;
  padding: 4px 2px;
  color: rgba(255, 255, 255, .78);
  font-family: var(--display);
  font-size: 17px;
  letter-spacing: .1em;
  text-transform: uppercase;
  border-bottom: 3px solid transparent;
  transition: color var(--speed) ease, border-color var(--speed) ease,
              transform var(--lift) ease;
}
#topNav a:hover,
#topNav a:focus-visible {
  color: var(--yellow);
  border-bottom-color: var(--yellow);
  text-decoration: none;
  transform: translateY(-2px);
}
#topNav a:focus-visible { outline-color: var(--yellow); }
.nav-star { color: var(--yellow); font-size: 13px; }

/* --- Comic column -------------------------------------------------------- */
#middleContainer {
  flex: 1 0 auto;
  width: 100%;
  max-width: calc(var(--measure) + 40px);
  margin: 0 auto;
  padding: 46px 20px 56px;
  text-align: center;
}

/* Narrator caption box — the yellow rectangle comics use for voice-over. */
#ctitle {
  display: inline-block;
  margin: 0 auto 20px;
  padding: 10px 22px 12px;
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 3px;
  box-shadow: 5px 5px 0 var(--ink);
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(25px, 4.8vw, 38px);
  letter-spacing: .05em;
  line-height: 1.02;
  text-transform: uppercase;
  text-wrap: balance;
  transform: rotate(-1.1deg);
}

/* The strip itself prints on a white panel with a hard ink drop. */
#comic.panel {
  width: fit-content;
  max-width: 100%;
  margin: 26px auto 0;
  padding: 12px;
  background: var(--panel);
  border: 3px solid var(--ink);
  border-radius: 6px;
  box-shadow: 10px 10px 0 var(--ink);
}

.comic-img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  vertical-align: baseline;
}

/* Comic navigation: chunky letterpress buttons. Press to travel. */
ul.comicNav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 22px 0;
  padding: 0;
  list-style: none;
}
ul.comicNav li { display: block; margin: 0; }
ul.comicNav li a,
ul.comicNav li .disabled {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 8px 17px 9px;
  background: var(--panel);
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  box-shadow: 4px 4px 0 var(--ink);
  color: var(--ink);
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: .07em;
  line-height: 1.35;
  text-transform: uppercase;
  transition: transform var(--lift) ease, box-shadow var(--lift) ease,
              background var(--speed) ease, color var(--speed) ease;
}
ul.comicNav li a:hover,
ul.comicNav li a:focus-visible {
  background: var(--yellow);
  color: var(--ink);
  text-decoration: none;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}
ul.comicNav li a:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}
ul.comicNav li .disabled {
  background: transparent;
  border-style: dashed;
  border-color: var(--line-strong);
  box-shadow: none;
  color: var(--faint);
  cursor: default;
}

/* The punchline prints as one hand-lettered line under the strip, on a
   highlighter swash. It shrink-wraps and stays centred; a longer punchline
   scrolls inside its own box rather than wrapping or widening the page. */
.comic-alt {
  width: max-content;
  max-width: 100%;
  margin: 22px auto 0;
  overflow-x: auto;
  overflow-y: hidden;
  color: var(--ink-2);
  font-family: var(--hand);
  font-size: 20px;
  line-height: 1.45;
  text-align: left;
  white-space: nowrap;
  scrollbar-width: thin;
  scrollbar-color: var(--yellow-deep) var(--panel);
}
.comic-alt::-webkit-scrollbar { height: 8px; }
.comic-alt::-webkit-scrollbar-track { background: var(--panel); }
.comic-alt::-webkit-scrollbar-thumb { background: var(--yellow-deep); border-radius: 4px; }
.alt-text {
  display: inline-block;
  padding: 1px 6px 2px;
  background-image: linear-gradient(transparent 8%, rgba(255, 210, 63, .65) 8%,
                    rgba(255, 210, 63, .65) 92%, transparent 92%);
}

/* Share bar: pass the strip along. */
.comic-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 12px;
  max-width: 640px;
  margin: 18px auto 0;
}
.share-label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.share-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.share-links li { display: block; margin: 0; }
.share-btn {
  display: inline-block;
  padding: 5px 11px 6px;
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: 5px;
  box-shadow: 3px 3px 0 var(--ink);
  color: var(--ink);
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: .06em;
  line-height: 1.35;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--lift) ease, box-shadow var(--lift) ease,
              background var(--speed) ease, color var(--speed) ease;
}
a.share-btn:hover,
a.share-btn:focus-visible,
button.share-btn:hover,
button.share-btn:focus-visible {
  background: var(--yellow);
  color: var(--ink);
  text-decoration: none;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}
.share-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}
.share-btn:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}
button.share-btn { font: inherit; font-family: var(--display); font-size: 13px; }
.share-copy.is-copied { background: var(--yellow); }

/* Like button: a heart chip above the share bar. */
.comic-like {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  max-width: 640px;
  margin: 18px auto 0;
}
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px 6px;
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: 5px;
  box-shadow: 3px 3px 0 var(--ink);
  color: var(--ink);
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: .06em;
  line-height: 1.35;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform var(--lift) ease, box-shadow var(--lift) ease,
              background var(--speed) ease, color var(--speed) ease;
}
.like-btn:hover:not(:disabled),
.like-btn:focus-visible:not(:disabled) {
  background: var(--yellow);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}
.like-btn:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}
.like-btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.like-btn:disabled { cursor: default; }
.like-heart { color: var(--red); font-size: 16px; line-height: 1; }
.like-count {
  padding-left: 7px;
  border-left: 1px solid var(--line-strong);
  font-family: var(--mono);
  letter-spacing: 0;
}
.like-btn.is-liked { background: var(--red); color: var(--panel); }
.like-btn.is-liked .like-heart { color: var(--yellow); }
.like-btn.is-liked .like-count { border-left-color: rgba(255, 253, 244, .5); }
.like-status { color: var(--red-deep); font-size: 12px; }

.comic-meta {
  /* The nav directly above already carries the bottom spacing. */
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .24em;
  text-transform: uppercase;
}

/* --- Archive: the table of contents of a comic annual -------------------- */
.page-title {
  display: inline-block;
  margin: 0 auto 6px;
  padding: 4px 18px 8px;
  background: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 3px;
  box-shadow: 4px 4px 0 var(--yellow);
  color: var(--panel);
  font-family: var(--display);
  font-size: clamp(26px, 4.6vw, 36px);
  letter-spacing: .06em;
  line-height: 1.05;
  text-transform: uppercase;
}
.page-note {
  margin: 12px 0 28px;
  color: var(--muted);
  font-family: var(--hand);
  font-size: 16px;
}

.archive {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: 760px;
  margin: 0 auto;
  padding: 0 0 10px;
  text-align: left;
}
.archive-item {
  display: grid;
  grid-template-columns: 58px 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 13px 14px;
  border-bottom: 2px solid var(--line);
  color: var(--ink);
  transition: background var(--speed) ease;
}
.archive-item:first-child { border-top: 2px solid var(--ink); }
.archive-item:last-child { border-bottom: 2px solid var(--ink); }
.archive-item:hover,
.archive-item:focus-visible {
  background: #fff8dc;
  text-decoration: none;
  outline-offset: -3px;
}
.archive-num {
  display: inline-block;
  padding: 2px 4px 3px;
  background: var(--ink);
  border-radius: 4px;
  color: var(--yellow);
  font-family: var(--display);
  font-size: 17px;
  letter-spacing: .06em;
  text-align: center;
  transition: background var(--speed) ease, color var(--speed) ease;
}
.archive-item:hover .archive-num,
.archive-item:focus-visible .archive-num {
  background: var(--red);
  color: var(--panel);
}
.archive-title {
  color: var(--ink-2);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}
.archive-item:hover .archive-title { color: var(--ink); }
.archive-thumb {
  width: 84px;
  height: 54px;
  object-fit: contain;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 4px;
  box-shadow: 2px 2px 0 var(--ink);
}
.archive-date {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
}

/* --- About ---------------------------------------------------------------- */
.about {
  max-width: 660px;
  margin: 0 auto;
  padding: 4px 0 24px;
  text-align: left;
}
.about h1 {
  margin: 0 auto 8px;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(30px, 5vw, 40px);
  letter-spacing: .05em;
  line-height: 1.05;
  text-align: center;
  text-transform: lowercase;
}
.about h1 a { color: var(--ink); }
.about h1 a::after { content: "!"; color: var(--red); }
.about h1 a:hover { color: var(--ink); text-decoration: none; }
.about > p:first-of-type {
  margin: 0 0 32px;
  color: var(--muted);
  font-family: var(--hand);
  font-size: 18px;
  text-align: center;
}
.about h2 {
  position: relative;
  margin: 30px 0 10px;
  padding-left: 18px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  line-height: 1.5;
  text-transform: uppercase;
}
.about h2::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--red);
  border: 1.5px solid var(--ink);
}
.about blockquote {
  margin: 0;
  padding: 12px 18px;
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: 3px;
  box-shadow: 4px 4px 0 var(--line-strong);
  font-size: 15px;
  line-height: 1.7;
}
.about blockquote p { margin: 0 0 8px; }
.about blockquote p:last-child { margin-bottom: 0; }
.about code {
  padding: 1px 5px;
  background: #f3ecdd;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: .85em;
}
.about-back { margin: 34px 0 0; text-align: center; }
.about-back a {
  display: inline-block;
  padding: 8px 18px 9px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 6px;
  box-shadow: 3px 3px 0 var(--ink);
  color: var(--ink);
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  transition: transform var(--lift) ease, box-shadow var(--lift) ease;
}
.about-back a:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
  text-decoration: none;
}

/* --- Footer band ---------------------------------------------------------- */
#bottom {
  width: auto;
  margin: 0;
  padding: 26px var(--gutter) 28px;
  background-color: var(--ink);
  background-image: radial-gradient(circle, rgba(255, 255, 255, .075) 1.2px,
                                             transparent 1.45px);
  background-size: 17px 17px;
  border-top: 5px solid var(--yellow);
  text-align: center;
}
.foot-brand {
  margin: 0 0 6px;
  color: var(--panel);
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: .09em;
  text-transform: lowercase;
}
.foot-star { color: var(--yellow); margin-left: .35em; font-size: .8em; }

/* Follow chips on the dark footer band. */
.foot-social {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
  margin: 0 0 12px;
}
.foot-social-label {
  width: 100%;
  color: var(--yellow);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.foot-social ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.foot-social li { display: block; margin: 0; }
.foot-social-btn {
  display: inline-block;
  padding: 5px 11px 6px;
  background: transparent;
  border: 2px solid var(--yellow);
  border-radius: 5px;
  color: var(--yellow);
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: .06em;
  line-height: 1.35;
  text-transform: uppercase;
  text-decoration: none;
  transition: background var(--speed) ease, color var(--speed) ease,
              transform var(--lift) ease;
}
.foot-social-btn:hover,
.foot-social-btn:focus-visible {
  background: var(--yellow);
  color: var(--ink);
  text-decoration: none;
  transform: translateY(-1px);
}
.foot-social-btn:active { transform: translateY(1px); }
.foot-social-btn:focus-visible {
  outline: 3px solid var(--panel);
  outline-offset: 2px;
}

.foot-meta {
  margin: 0;
  color: rgba(255, 255, 255, .62);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .1em;
}
.foot-license {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, .62);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .06em;
}
.foot-license a {
  color: var(--yellow);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.foot-license a:hover { color: var(--panel); }
.foot-license a:focus-visible { outline-color: var(--yellow); }

/* --- Empty / 404 ---------------------------------------------------------- */
.empty { padding: 60px 0 64px; }
.empty h1 {
  margin: 0 0 10px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 40px;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.empty p {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .04em;
}

/* --- Admin ---------------------------------------------------------------- */
/* `#middleContainer` carries the comic padding; the admin variant replaces it. */
#middleContainer.admin {
  max-width: calc(var(--measure) + 40px);
  padding: 36px 20px 48px;
  text-align: left;
}
.admin a { color: var(--blue); }
.admin h1 {
  margin: 0 0 6px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 34px;
  font-weight: 400;
  letter-spacing: .05em;
  line-height: 1.1;
  text-transform: uppercase;
}
.admin > .muted {
  margin: 0 0 24px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .03em;
}
.admin > .muted a { font-weight: 700; }
.admin h2 {
  margin: 0 0 16px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.card {
  padding: 22px 24px;
  margin-bottom: 22px;
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: 6px;
  box-shadow: 5px 5px 0 var(--line-strong);
}
.card:last-of-type { margin-bottom: 0; }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.field input[type="text"],
.field input[type="password"],
.field input[type="file"],
.field input[type="date"],
.field textarea {
  width: 100%;
  padding: 9px 11px;
  background: #ffffff;
  border: 2px solid var(--line-strong);
  border-radius: 4px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.45;
  transition: border-color var(--speed) ease, box-shadow var(--speed) ease;
}
.field input[type="file"] { padding: 7px 9px; }
.field input:hover,
.field textarea:hover { border-color: var(--ink); }
.field input:focus,
.field textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(255, 210, 63, .75);
  outline: none;
}
.field textarea { min-height: 78px; resize: vertical; }
.field ::placeholder { color: var(--muted); }
.field ::file-selector-button {
  margin: 0 12px 0 0;
  padding: 5px 12px;
  background: var(--yellow);
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.field ::file-selector-button:hover { background: var(--yellow-deep); }

.btn {
  display: inline-block;
  padding: 10px 20px 11px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 6px;
  box-shadow: 4px 4px 0 var(--ink);
  color: var(--ink);
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: .1em;
  line-height: 1.4;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform var(--lift) ease, box-shadow var(--lift) ease,
              background var(--speed) ease;
}
.btn:hover {
  background: var(--yellow-deep);
  color: var(--ink);
  text-decoration: none;
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--ink);
}
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.btn-danger {
  background: var(--panel);
  border-color: var(--danger);
  color: var(--danger);
}
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

.inline-form { display: inline; margin: 0; }
.btn-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--blue);
  text-decoration: underline;
  cursor: pointer;
}
.btn-link:hover { color: var(--ink); }
.btn-link:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 2px; }

.flash {
  margin-bottom: 22px;
  padding: 11px 14px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.55;
}
.flash.success { background: #fff6d8; border-color: var(--ink); color: #5a4a00; }
.flash.error {
  background: #fdeae7;
  border-color: var(--danger);
  color: #7c1d12;
}
.flash.info {
  background: var(--panel);
  border-color: var(--line-strong);
  color: var(--ink-2);
}

.muted { color: var(--muted); }

.comic-list { width: 100%; border-collapse: collapse; }
.comic-list th,
.comic-list td {
  padding: 12px 8px;
  border-bottom: 2px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.comic-list tbody tr { transition: background var(--speed) ease; }
.comic-list tbody tr:hover { background: #fff8dc; }
.comic-list tbody tr:last-child td { border-bottom: 0; }
.comic-list th {
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.comic-list td {
  color: var(--ink-2);
  font-size: 13.5px;
}
.comic-list td:nth-child(4) { white-space: nowrap; }
.comic-list td a {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}
.comic-list td a:hover { color: var(--red-deep); }
.comic-list td img {
  display: block;
  width: 88px;
  height: auto;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 4px;
}
.comic-list td .muted {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}
.comic-list form { margin: 0; }
.comic-list .btn { padding: 7px 13px 8px; font-size: 11px; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-actions .btn { white-space: nowrap; }

/* Dashboard: two big action links */
.admin-menu { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.admin-menu-item {
  display: block;
  padding: 26px 24px;
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: 6px;
  box-shadow: 5px 5px 0 var(--line-strong);
  text-decoration: none;
  transition: transform var(--lift) ease, box-shadow var(--lift) ease,
              border-color var(--speed) ease;
}
.admin-menu-item:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--ink);
  border-color: var(--ink);
  text-decoration: none;
}
.admin-menu-item:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.admin-menu-title {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 21px;
  letter-spacing: .08em;
  line-height: 1.2;
  text-transform: uppercase;
}
.admin-menu-note {
  display: block;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.55;
}

/* Pagination */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 2px solid var(--line);
}
.page-link {
  display: inline-block;
  min-width: 34px;
  padding: 6px 10px 7px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}
.page-link:hover { background: var(--yellow); text-decoration: none; }
.page-link:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.page-link.current {
  background: var(--ink);
  color: var(--paper);
  cursor: default;
}
.page-link.disabled {
  border-color: var(--line-strong);
  color: var(--faint);
  cursor: default;
}
.page-gap { color: var(--muted); font-family: var(--mono); padding: 0 2px; }
.pagination-note { margin: 10px 0 0; font-family: var(--mono); font-size: 11px; letter-spacing: .04em; }

/* Edit page */
.edit-preview {
  display: block;
  max-width: 100%;
  width: 420px;
  height: auto;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 4px;
}
.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.btn-quiet {
  background: var(--panel);
  color: var(--ink-2);
  border-color: var(--line-strong);
  box-shadow: 4px 4px 0 var(--line-strong);
}
.btn-quiet:hover { background: #fff; border-color: var(--ink); box-shadow: 5px 5px 0 var(--ink); color: var(--ink); }

.login-wrap { max-width: 380px; margin: 12px auto 0; }
.login-wrap h1 {
  margin: 0 0 22px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: .05em;
  text-align: center;
  text-transform: uppercase;
}
.login-wrap .btn { width: 100%; }

@media (max-width: 880px) {
  #topContainer {
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 18px 20px 16px;
    text-align: center;
  }
  #masthead { text-align: center; }
  .tagline { margin-left: auto; margin-right: auto; }
  #topNav ul { justify-content: center; gap: 18px; }
  #middleContainer { padding: 32px 16px 42px; }
  #middleContainer.admin { padding: 26px 16px 36px; }
  #ctitle { font-size: 24px; letter-spacing: .04em; transform: rotate(-.6deg); }
  #comic.panel { box-shadow: 6px 6px 0 var(--ink); padding: 8px; }
  ul.comicNav { gap: 7px; margin: 18px 0; }
  ul.comicNav li a,
  ul.comicNav li .disabled { padding: 6px 12px 7px; font-size: 13px; box-shadow: 3px 3px 0 var(--ink); }
  ul.comicNav li .disabled { box-shadow: none; }
  .comic-alt { font-size: 18px; }
  .archive-item { grid-template-columns: 46px 1fr auto; row-gap: 2px; }
  .archive-date { grid-column: 2; }
  .archive-thumb { width: 64px; height: 42px; }
  .about h1 { font-size: 28px; }
  .card { padding: 18px 16px; }
  .comic-list th,
  .comic-list td { padding: 10px 6px; }
  .comic-list td img { width: 62px; }
  #bottom { padding: 22px 20px 24px; }
}

/* Phones: the five-column table becomes one stacked card per comic. */
@media (max-width: 640px) {
  .comic-list thead { display: none; }
  .comic-list tr {
    display: grid;
    align-items: start;
    grid-template-columns: 62px 1fr;
    grid-template-areas:
      "thumb id"
      "thumb title"
      "thumb uploaded"
      "thumb actions";
    row-gap: 3px;
    padding: 14px 0;
    border-bottom: 2px solid var(--line);
  }
  .comic-list tr:last-child { border-bottom: 0; }
  .comic-list td {
    display: block;
    padding: 0;
    border: 0;
  }
  .comic-list td:nth-child(1) {
    grid-area: id;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .1em;
  }
  .comic-list td:nth-child(2) { grid-area: thumb; padding-right: 14px; }
  .comic-list td:nth-child(2) img { width: 100%; }
  .comic-list td:nth-child(3) { grid-area: title; }
  .comic-list td:nth-child(4) {
    grid-area: uploaded;
    color: var(--muted);
    font-size: 11.5px;
  }
  .comic-list td:nth-child(5) { grid-area: actions; }
  .comic-list td:nth-child(5) .btn { margin-top: 4px; }
}

/* Printing: a comic page should honour the printer. Strip the chrome. */
@media print {
  body {
    background: #ffffff;
    background-image: none;
    color: #000;
  }
  .skip-link,
  #topContainer,
  #bottom,
  ul.comicNav,
  .comic-meta { display: none; }
  #middleContainer { padding: 0; max-width: none; }
  #ctitle {
    transform: none;
    box-shadow: none;
    background: none;
    border-width: 2px;
  }
  #comic.panel { box-shadow: none; border-width: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
