/* twxxd.com
   Colours follow the old "High Society" look: damask-brown masthead, gold menu bar,
   dark rounded panels with orange and yellow links. The light theme keeps the
   masthead and menu bar and swaps the page for warm paper tones. */

:root {
  --bg: #f4eee2;
  --panel: #fffdf8;
  --panel-2: #f8f2e6;
  --text: #211b14;
  --muted: #6a5f52;
  --link: #a44f00;
  --link-hover: #6f3400;
  --border: #e0d3bb;
  --shadow: 0 1px 3px rgba(60, 40, 10, .18);
  --accent: #f1a616;
  --accent-bright: #ffcf00;
  --badge-bg: #f1a616;
  --badge-text: #1b1206;
  --masthead: #3a1708;
  --gold-top: #ffd23a;
  --gold-bottom: #f1a616;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111111;
    --panel: #050505;
    --panel-2: #141210;
    --text: #f3efe8;
    --muted: #a99f90;
    --link: #f1a616;
    --link-hover: #ffcf00;
    --border: #3a2a0c;
    --shadow: 1px 2px 3px #000;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111111;
  --panel: #050505;
  --panel-2: #141210;
  --text: #f3efe8;
  --muted: #a99f90;
  --link: #f1a616;
  --link-hover: #ffcf00;
  --border: #3a2a0c;
  --shadow: 1px 2px 3px #000;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 100%/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  overflow-wrap: break-word;
}
img, iframe, audio { max-width: 100%; }
img { height: auto; }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--accent-bright); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; line-height: 1.25; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: 1064px; margin: 0 auto; padding: 0 16px; }
.skip-link { position: absolute; left: -999px; top: 0; background: #000; color: #fff; padding: 8px 12px; z-index: 10; }
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- masthead ---------- */
.masthead { background: var(--masthead) url("img/damask.jpg") repeat-x top / auto 100%; color: #fff; }
.masthead-inner { display: flex; flex-direction: column; align-items: center; padding-top: 14px; padding-bottom: 12px; text-align: center; }
.brand { display: block; line-height: 0; }
.brand img { width: 620px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .55)); }
.tagline { margin: 8px 0 0; text-shadow: 1px 1px 1px #000; }
.tagline-main { font: italic 700 1.3rem/1.2 Georgia, "Times New Roman", serif; color: var(--accent-bright); letter-spacing: .01em; }
.tagline-by { display: block; font-size: .85rem; color: #f0dcc0; letter-spacing: .04em; margin-top: 2px; }

/* ---------- menu bar ---------- */
.menubar { background: linear-gradient(var(--gold-top), var(--gold-bottom)); border-top: 1px solid #ffe58a; border-bottom: 1px solid #a86d00; }
.menubar-inner { display: flex; align-items: center; gap: 8px; }
.menubar ul { list-style: none; margin: 0; padding: 4px 0; display: flex; flex-wrap: wrap; gap: 2px; flex: 1; }
.menubar a, .theme-toggle {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px;
  color: #000; font-weight: 700; font-size: .95rem; text-decoration: none; border-radius: var(--radius);
}
.menubar a:hover, .menubar a[aria-current="page"], .theme-toggle:hover { background: #303030; color: #fcff00; }
.theme-toggle { border: 0; background: transparent; font-family: inherit; cursor: pointer; gap: 6px; white-space: nowrap; }
.theme-toggle-icon { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; background: linear-gradient(90deg, currentColor 50%, transparent 50%); }

main.wrap { padding-top: 16px; padding-bottom: 32px; }

/* ---------- panels ---------- */
.panel, .comic-figure, .comic-nav, .comments, .pager {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.panel, .comments { padding: 16px 20px; margin: 0 auto 12px; max-width: 780px; }
.meta { color: var(--muted); font-size: .9rem; }
.button {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: var(--radius);
  background: linear-gradient(var(--gold-top), var(--gold-bottom)); color: #000; font-weight: 700; text-decoration: none; border: 1px solid #a86d00;
}
.button:hover { background: #303030; color: #fcff00; }

/* ---------- comic ---------- */
.comic-title { text-align: center; font-size: 1.5rem; margin: 4px 0 10px; }
.comic-figure { margin: 0 auto 10px; padding: 6px; width: fit-content; max-width: 100%; line-height: 0; }
.comic-figure img { display: block; margin: 0 auto; border-radius: 6px; }
.comic-nav { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; max-width: 780px; margin: 0 auto 10px; padding: 4px; }
.comic-nav a, .comic-nav span.is-disabled {
  display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 6px; border-radius: 8px;
  font-weight: 700; text-decoration: none; text-align: center; white-space: nowrap;
}
.comic-nav a:hover { background: linear-gradient(var(--gold-top), var(--gold-bottom)); color: #000; }
.comic-nav .is-disabled { color: var(--muted); opacity: .45; }
.nav-short { display: none; }
.hover-text { margin: 0 0 1em; }
.hover-text summary { cursor: pointer; color: var(--link); font-weight: 700; width: fit-content; min-height: 32px; display: list-item; }
.hover-text p { margin: .4em 0 0; padding: 10px 12px; background: var(--panel-2); border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0; font-style: italic; }
.post > :last-child, .panel > :last-child { margin-bottom: 0; }

/* ---------- written content ---------- */
.prose img { border-radius: 6px; }
.prose .aligncenter, .prose img.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.prose .alignleft { float: left; margin: 0 1em .5em 0; }
.prose .alignright { float: right; margin: 0 0 .5em 1em; }
.prose table { border-collapse: collapse; max-width: 100%; display: block; overflow-x: auto; }
.prose td, .prose th { padding: 6px 10px; vertical-align: top; border-bottom: 1px solid var(--border); }
.prose blockquote { margin: 0 0 1em; padding: 2px 14px; border-left: 3px solid var(--accent); color: var(--muted); }
.prose iframe { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; }
.prose::after { content: ""; display: block; clear: both; }

/* ---------- audio ---------- */
.audio { margin: 0 0 1em; }
.audio audio { display: block; width: 100%; height: 40px; }
.audio-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 8px 0 0; color: var(--muted); font-size: .9rem; }

/* ---------- lists: archive, episodes, news ---------- */
.archive-year h2 { margin-top: 1.2em; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.archive-list { list-style: none; margin: 0; padding: 0; }
.archive-list li { display: flex; gap: 12px; padding: 5px 0; align-items: baseline; }
.archive-list time { flex: 0 0 4.2em; color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.news-list time { flex-basis: 10.5em; }
.archive-list a { padding: 3px 0; }
.episode-list { list-style: none; margin: 0; padding: 0; }
.episode h2 { font-size: 1.1rem; margin-bottom: .2em; }
.episode .meta { margin-bottom: .6em; }
.pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; max-width: 780px; margin: 0 auto 12px; padding: 10px 16px; font-size: .95rem; }
.pager > :last-child { text-align: right; }

/* ---------- tags ---------- */
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 1em 0 0; font-size: .85rem; }
.tags-label { color: var(--muted); margin-right: 2px; }
.tag { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); text-decoration: none; }
a.tag { color: var(--link); }
a.tag:hover { background: linear-gradient(var(--gold-top), var(--gold-bottom)); color: #000; border-color: #a86d00; }
.tag-cloud { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 14px; }
.tag-cloud li { display: inline-flex; align-items: center; gap: 5px; }
.tag-cloud .tag { min-height: 32px; font-size: .9rem; }
.count, .kind { color: var(--muted); font-size: .8rem; }
.tag-items time { flex-basis: 10.5em; }

/* ---------- comments ---------- */
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment { margin: 0 0 12px; }
.comment article { padding: 10px 12px; background: var(--panel-2); border-radius: 8px; border: 1px solid var(--border); }
.replies { margin: 10px 0 0 18px; padding-left: 10px; border-left: 2px solid var(--border); }
.replies .replies .replies .replies { margin-left: 0; }
.comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 6px; font-size: .9rem; }
.comment-avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--border); color: var(--text); font-weight: 700; font-size: .8rem;
}
.comment-author { font-weight: 700; }
.comment-head time { color: var(--muted); }
.badge { background: var(--badge-bg); color: var(--badge-text); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 1px 6px; border-radius: 6px; }
.by-creator > article { border-color: var(--accent); }
.comment-body > :last-child { margin-bottom: 0; }
.comments-closed { color: var(--muted); font-size: .9rem; margin: 0; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 18px 0 28px; text-align: center; color: var(--muted); font-size: .9rem; }
.site-footer p { margin: 0 0 .4em; }

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  h1 { font-size: 1.35rem; }
  .wrap { padding: 0 10px; }
  .masthead-inner { padding-top: 10px; padding-bottom: 10px; }
  .tagline-main { font-size: 1.1rem; }
  .menubar a, .theme-toggle { padding: 0 9px; font-size: .9rem; min-height: 44px; }
  .theme-toggle-label { display: none; }
  .panel, .comments { padding: 14px; }
  .comic-figure { padding: 3px; }
  .nav-long { display: none; }
  .nav-short { display: inline; }
  .replies { margin-left: 6px; padding-left: 8px; }
  .pager { grid-template-columns: 1fr; text-align: center; }
  .pager > :last-child { text-align: center; }
  .news-list li, .tag-items li { flex-direction: column; gap: 0; }
  .news-list time, .tag-items time { flex-basis: auto; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media print {
  .menubar, .comic-nav, .site-footer, .skip-link, .pager { display: none; }
  body { background: #fff; color: #000; }
  .masthead { background: none; }
}
