/*
Theme Name: How To Revenge Comic
Description: Child theme of GeneratePress. Every article is a page from a gag comic: halftone ground, keyline panels, balloons, SFX headlines. Playful, never menacing.
Template: generatepress
Version: 1.0.0
Author: Unilome
Text Domain: htr-comic
*/

/* Display face: Bangers (Google Fonts, OFL), self-hosted, latin subset, 5 KB. */
@font-face {
  font-family: "SFX";
  src: url("fonts/Bangers.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #fff7d6;
  --panel: #ffffff;
  --ink: #111111;
  --ink-2: #4a4638;
  --red: #ff2e2e;
  --red-deep: #c81616;
  --yellow: #ffd400;
  --blue: #1f8fff;
  --blue-deep: #0b5fb8;
  --keyline: 3px solid var(--ink);
  --pop: 6px 6px 0 var(--ink);
  --pop-sm: 4px 4px 0 var(--ink);
  --sfx: "SFX", "Impact", "Arial Narrow Bold", sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 68ch;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --contrast: var(--ink);
  --contrast-2: var(--ink-2);
  --base-2: var(--paper);
  --base-3: var(--panel);
  --accent: var(--blue-deep);
}

html { scrollbar-color: var(--ink) var(--paper); }
body {
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  background-image: url("halftone.svg");
  background-size: 14px 14px;
  font-variant-numeric: tabular-nums;
  caret-color: var(--red);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--yellow); color: var(--ink); }
a { color: var(--blue-deep); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.16em; }
a:hover, a:focus-visible { color: var(--red-deep); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

h1, h2, h3, h4, .main-title, .htr-sfx {
  font-family: var(--sfx);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: clamp(2.2rem, 1.5rem + 2.8vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.3rem); margin-top: 2em; margin-bottom: 0.45em; }
h3 { font-size: 1.45rem; margin-top: 1.7em; margin-bottom: 0.4em; }
h4 { font-size: 1.2rem; }

/* ---------- masthead ---------- */
.site-header { background: var(--panel); border-bottom: var(--keyline); }
.inside-header { padding: 18px 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.main-title { margin: 0; font-size: clamp(2.1rem, 1.5rem + 2.4vw, 3.2rem); line-height: 1; position: relative; padding: 14px 8px 14px 22px; }
.main-title::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 50%;
  width: 120px;
  height: 120px;
  margin-top: -60px;
  background: url("burst.svg") no-repeat center / contain;
  z-index: 0;
}
.main-title a {
  position: relative;
  z-index: 1;
  color: var(--red);
  text-decoration: none;
  text-shadow: 3px 3px 0 var(--ink);
  letter-spacing: 0.03em;
}
.main-title a:hover { color: var(--red); text-shadow: 4px 4px 0 var(--ink); }
.site-description { font-family: var(--sans); color: var(--ink-2); margin: 2px 0 0 8px; font-size: 0.95rem; }

.main-navigation, .main-navigation ul ul { background: transparent; }
.main-navigation .main-nav ul { display: flex; flex-wrap: wrap; gap: 8px; }
.main-navigation .main-nav ul li a {
  font-family: var(--sfx);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--ink);
  background: var(--panel);
  border: var(--keyline);
  box-shadow: var(--pop-sm);
  padding: 10px 14px 9px;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), background 0.2s;
}
.main-navigation .main-nav ul li a:hover, .main-navigation .main-nav ul li a:focus { color: var(--ink); background: var(--yellow); transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.main-navigation .main-nav ul li[class*="current-menu-"] > a, .main-navigation .main-nav ul li[class*="current-menu-"] > a:hover, .main-navigation .main-nav ul li.current_page_item > a { background: var(--yellow); color: var(--ink); }
.main-navigation .menu-toggle { font-family: var(--sfx); font-size: 1.1rem; color: var(--ink); }
.main-navigation .menu-toggle:hover, .main-navigation .menu-toggle:focus, .main-navigation.toggled .menu-toggle { color: var(--red-deep); background: transparent; }
@media (max-width: 768px) {
  .inside-header { flex-wrap: nowrap; }
  .main-title { padding-left: 26px; font-size: 1.85rem; flex: 1 1 auto; min-width: 0; }
  .main-title a { white-space: nowrap; }
  .main-title::before { left: -8px; width: 76px; height: 76px; margin-top: -38px; }
  .main-navigation .main-nav ul { display: block; padding: 6px 0 12px; }
  .main-navigation .main-nav ul li a { display: inline-block; margin: 6px 12px; }
}

/* ---------- balloons and stamps ---------- */
.htr-balloon {
  position: relative;
  display: inline-block;
  background: var(--panel);
  border: var(--keyline);
  border-radius: 22px;
  padding: 14px 20px;
  box-shadow: var(--pop-sm);
  color: var(--ink);
}
.htr-balloon::after {
  content: "";
  position: absolute;
  left: 34px;
  bottom: -14px;
  width: 20px;
  height: 20px;
  background: var(--panel);
  border-right: var(--keyline);
  border-bottom: var(--keyline);
  transform: skewX(-24deg) rotate(45deg);
}
.htr-balloon--faq { display: block; margin: 8px 0 26px; }
.htr-balloon--faq p:last-child { margin-bottom: 0; }
.htr-balloon--tag { font-family: var(--sfx); font-size: 1.15rem; letter-spacing: 0.03em; padding: 10px 16px; }
.htr-stamp, .cat-links a {
  display: inline-block;
  font-family: var(--sfx);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--ink);
  background: var(--yellow);
  border: 2px solid var(--ink);
  padding: 5px 9px 4px;
  text-decoration: none;
  transform: rotate(-2deg);
  margin: 0 8px 6px 0;
}
.cat-links a:hover, .htr-stamp:hover { background: var(--panel); color: var(--ink); }
.cat-links .gp-icon, .tags-links .gp-icon { display: none; }
.tags-links a { font-size: 0.85rem; text-decoration: none; color: var(--ink-2); margin-right: 8px; }
.tags-links a::before { content: "#"; }
.tags-links a:hover { color: var(--red-deep); }

/* ---------- the splash panel (home, first page) ---------- */
.htr-splash {
  position: relative;
  background: var(--paper) url("halftone-splash.svg") 0 0 / 10px 10px;
  border: var(--keyline);
  box-shadow: var(--pop);
  padding: clamp(24px, 4vw, 48px) clamp(20px, 4vw, 48px) clamp(28px, 4vw, 48px);
  margin: 8px 6px 40px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.8fr);
  gap: 24px 36px;
  align-items: start;
}
.htr-splash__caption {
  position: absolute;
  top: -14px;
  left: 18px;
  margin: 0;
  font-family: var(--sfx);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--ink);
  background: var(--yellow);
  border: var(--keyline);
  padding: 6px 10px 5px;
  transform: rotate(-1.5deg);
}
.htr-splash__title {
  margin: 0 0 18px;
  font-size: clamp(2.4rem, 1.4rem + 4.4vw, 4.6rem);
  line-height: 0.98;
  color: var(--red);
  text-shadow: 4px 4px 0 var(--ink);
  letter-spacing: 0.02em;
}
.htr-splash__title a { color: inherit; text-decoration: none; }
.htr-splash__title a:hover { color: var(--red-deep); }
.htr-splash__excerpt { font-size: 1.05rem; line-height: 1.5; margin: 0 0 22px; max-width: 52ch; }
.htr-splash__excerpt p { margin: 0; }
.htr-splash__cta {
  display: inline-block;
  font-family: var(--sfx);
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--red-deep);
  border: var(--keyline);
  box-shadow: var(--pop-sm);
  padding: 12px 22px 10px;
  text-decoration: none;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.htr-splash__cta:hover, .htr-splash__cta:focus-visible { color: #fff; background: var(--red); transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.htr-splash__aside { display: grid; gap: 18px; justify-items: end; align-content: start; }
.htr-splash__aside .htr-balloon { transform: rotate(2deg); }
.htr-splash__aside .htr-balloon::after { left: auto; right: 30px; transform: skewX(24deg) rotate(45deg); }
.htr-splash__stamps { justify-self: start; }
@media (max-width: 800px) {
  .htr-splash { grid-template-columns: 1fr; margin-right: 0; }
  .htr-splash__aside { justify-items: start; }
  .htr-splash__aside .htr-balloon::after { left: 34px; right: auto; transform: skewX(-24deg) rotate(45deg); }
}
@media (prefers-reduced-motion: no-preference) {
  .htr-splash__title { animation: htr-pop 0.7s var(--ease-out) both; }
  .htr-splash__aside .htr-balloon { animation: htr-pop 0.7s 0.18s var(--ease-out) both; }
  @keyframes htr-pop {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
  }
}

/* ---------- layout ---------- */
.site.grid-container { max-width: 1240px; }
.site-content { padding: 26px 24px 40px; display: flex; gap: 32px; }
.content-area { flex: 1 1 auto; min-width: 0; }
.separate-containers .inside-article, .one-container .inside-article { padding: 0; }
.separate-containers .site-main > *, .separate-containers .site-main { margin: 0; background: transparent; }

/* the panel grid */
.blog .site-main, .archive .site-main, .search .site-main {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  grid-auto-flow: dense;
  gap: 30px 26px;
  align-items: start;
}
.blog .site-main > .htr-splash, .blog .site-main > .page-header, .archive .site-main > .page-header, .blog .site-main > nav, .archive .site-main > nav, .search .site-main > .page-header { grid-column: 1 / -1; }
.home:not(.paged) .site-main > article.post:first-of-type { display: none; }
@media (min-width: 900px) { .blog .site-main > article.post:nth-of-type(4n+2), .archive .site-main > article.post:nth-of-type(4n) { grid-column: span 2; } }
.archive .page-header { background: var(--panel); border: var(--keyline); box-shadow: var(--pop-sm); padding: 18px 22px; }
.archive .page-header .page-title { margin: 0; font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.5rem); }
.archive .page-header .archive-description { color: var(--ink-2); margin: 6px 0 0; }
.blog article.post, .archive article.post, .search article.post {
  background: var(--panel);
  border: var(--keyline);
  box-shadow: var(--pop);
  padding: 18px 20px 20px;
  margin-right: 6px;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}
.blog article.post:hover, .archive article.post:hover, .search article.post:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--ink); }
.blog article.post .entry-header, .archive article.post .entry-header { margin: 0 0 10px; }
.blog article.post .entry-title, .archive article.post .entry-title, .search article.post .entry-title { font-size: 1.55rem; margin: 0 0 6px; line-height: 1.02; }
.blog article.post .entry-title a, .archive article.post .entry-title a { color: var(--ink); text-decoration: none; }
.blog article.post .entry-title a:hover, .archive article.post .entry-title a:hover { color: var(--red-deep); }
.blog article.post .entry-meta, .archive article.post .entry-meta { font-size: 0.8rem; color: var(--ink-2); }
.blog article.post .entry-meta .byline, .archive article.post .entry-meta .byline { display: none; }
.blog .post-image, .archive .post-image { margin: 6px 0 12px; border: 2px solid var(--ink); }
.blog .post-image img, .archive .post-image img { width: 100%; height: 180px; object-fit: cover; display: block; }
.blog .entry-summary, .archive .entry-summary { font-size: 0.95rem; color: var(--ink-2); }
.blog .entry-summary p, .archive .entry-summary p { margin: 0 0 8px; }
.read-more { font-family: var(--sfx); font-size: 1.05rem; letter-spacing: 0.04em; color: var(--red-deep); text-decoration: none; }
.read-more:hover { text-decoration: underline; }
.blog footer.entry-meta, .archive footer.entry-meta { margin-top: 12px; }
.paging-navigation, .post-navigation { font-family: var(--sfx); font-size: 1.15rem; letter-spacing: 0.04em; }
.paging-navigation a, .post-navigation a { color: var(--ink); text-decoration: none; }
.paging-navigation a:hover, .post-navigation a:hover { color: var(--red-deep); }

/* single article: the issue's page */
.single .site-main > article, .page .site-main > article {
  background: var(--panel);
  border: var(--keyline);
  box-shadow: var(--pop);
  padding: clamp(24px, 4vw, 44px) clamp(20px, 4.5vw, 52px) clamp(28px, 4vw, 44px);
  margin-right: 6px;
}
.single .entry-header { margin-bottom: 18px; }
.single .entry-title { margin: 0 0 10px; }
.single .entry-meta { font-size: 0.85rem; color: var(--ink-2); }
.single .entry-meta .updated:not(.published) { display: none; }
.single .featured-image, .single .post-image { margin: 16px 0 24px; border: var(--keyline); }
.single .featured-image img, .single .post-image img { width: 100%; height: auto; max-height: 520px; object-fit: cover; display: block; }
.entry-content { max-width: var(--measure); }
.entry-content p, .entry-content ul, .entry-content ol { margin-bottom: 1.1em; }
.entry-content ul { padding-left: 1.3em; }
.entry-content ul li::marker { color: var(--red); }
.entry-content li { margin: 0.3em 0; }
.entry-content ol { list-style: none; padding-left: 0; counter-reset: htr-step; }
.entry-content ol > li { position: relative; padding-left: 52px; min-height: 40px; counter-increment: htr-step; }
.entry-content ol > li::before {
  content: counter(htr-step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-family: var(--sfx);
  font-size: 1.35rem;
  line-height: 1;
  color: var(--ink);
  background: var(--yellow);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}
.entry-content h2 { color: var(--ink); }
.entry-content h2::after { content: ""; display: block; width: 84px; height: 6px; background: var(--red); margin-top: 6px; border: 2px solid var(--ink); }
.entry-content img { height: auto; border: 2px solid var(--ink); }
.entry-content a[rel~="sponsored"], .entry-content a[href*="amazon.com"], .entry-content a[href*="amzn.to"] { background: linear-gradient(transparent 55%, var(--yellow) 55%); text-decoration: none; color: var(--ink); padding: 0 2px; }
.entry-content a[rel~="sponsored"]:hover, .entry-content a[href*="amazon.com"]:hover, .entry-content a[href*="amzn.to"]:hover { background: var(--yellow); }
.entry-content blockquote {
  margin: 1.4em 0 1.8em;
  position: relative;
  background: var(--panel);
  border: var(--keyline);
  border-radius: 22px;
  padding: 14px 20px;
  box-shadow: var(--pop-sm);
  font-style: normal;
}
.entry-content blockquote::after { content: ""; position: absolute; left: 34px; bottom: -14px; width: 20px; height: 20px; background: var(--panel); border-right: var(--keyline); border-bottom: var(--keyline); transform: skewX(-24deg) rotate(45deg); }
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content table { font-size: 0.95rem; border-collapse: collapse; border: var(--keyline); }
.entry-content th, .entry-content td { border: 2px solid var(--ink); padding: 6px 10px; }
.entry-content th { font-family: var(--sfx); letter-spacing: 0.04em; background: var(--yellow); text-align: left; }
.entry-content iframe { max-width: 100%; border: var(--keyline); }

/* comments: the letters page */
.comments-area { margin-top: 36px; border-top: var(--keyline); padding-top: 18px; }
.comments-title, .comment-reply-title { font-family: var(--sfx); }
.comment-body { background: var(--paper); border: 2px solid var(--ink); padding: 12px 16px; margin-bottom: 14px; }
.comment-author .fn { font-family: var(--sfx); letter-spacing: 0.03em; }
.comment-metadata { font-size: 0.8rem; color: var(--ink-2); }
input[type="text"], input[type="email"], input[type="search"], input[type="url"], textarea, select {
  font-family: var(--sans);
  border: var(--keyline);
  background: var(--panel);
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 0;
}
input:focus, textarea:focus, select:focus { outline: 3px solid var(--blue); outline-offset: 2px; }
button, input[type="submit"], .button, .wp-block-button__link, .wpcf7-submit {
  font-family: var(--sfx);
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  color: #fff;
  background: var(--red-deep);
  border: var(--keyline);
  border-radius: 0;
  padding: 10px 20px 9px;
  box-shadow: var(--pop-sm);
  cursor: pointer;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
button:hover, input[type="submit"]:hover, .button:hover, .wp-block-button__link:hover, .wpcf7-submit:hover { background: var(--red); color: #fff; transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
button:disabled, input[type="submit"]:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.wpcf7 form.invalid .wpcf7-response-output, .wpcf7 form.failed .wpcf7-response-output { border: var(--keyline); background: #ffe1e1; }
.wpcf7 form.sent .wpcf7-response-output { border: var(--keyline); background: #e2ffe6; }

/* sidebar: the side panel */
.sidebar .widget { background: var(--panel); border: var(--keyline); box-shadow: var(--pop-sm); padding: 16px 18px; margin: 0 6px 24px 0; }
.sidebar .widget-title { font-family: var(--sfx); font-size: 1.3rem; letter-spacing: 0.04em; margin: 0 0 10px; }
.sidebar .widget ul { list-style: none; padding: 0; margin: 0; }
.sidebar .widget li { padding: 4px 0; border-bottom: 2px dotted var(--ink-2); }
.sidebar .widget li:last-child { border-bottom: 0; }
/* the "Recommended For You!" text widget only holds Amazon's retired ads.js (assoc-amazon.com), which renders nothing; hide the dead slot until the widget is removed in wp-admin */
.sidebar .widget_text:not(:has(.textwidget > :not(script))) { display: none; }
.search-form { display: flex; gap: 0; }
.search-form .search-field { flex: 1 1 auto; min-width: 0; }
.search-form .search-submit { background: var(--yellow); color: var(--ink); box-shadow: none; border-left: 0; padding: 10px 14px; }
.search-form .search-submit:hover { background: var(--yellow); color: var(--ink); transform: none; box-shadow: none; }
.search-form .search-submit .gp-icon { color: var(--ink); }

/* footer: the back cover */
.site-footer { background: var(--ink); color: #fff; margin-top: 44px; border-top: var(--keyline); }
.footer-widgets { background: transparent; color: #fff; }
.site-info { background: transparent; color: #f2eee0; font-size: 0.85rem; padding: 22px 24px 30px; }
.site-info a { color: var(--yellow); }
.inside-site-info { max-width: 1240px; }
.copyright-bar { font-family: var(--sfx); font-size: 1.05rem; letter-spacing: 0.04em; }

.adsbygoogle, ins.adsbygoogle { display: block; margin: 24px auto; }

@media (max-width: 768px) {
  body { font-size: 1rem; }
  .site-content { padding: 18px 16px 32px; flex-direction: column; }
  .inside-header { padding: 14px 16px; }
  .blog article.post, .archive article.post, .single .site-main > article, .page .site-main > article, .htr-splash { margin-right: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
