/*
Theme Name: Up the Road a Ways
Theme URI: https://uptheroadaways.com/
Author: Him & Her
Description: A focused, responsive comic-strip theme with edition navigation, archives, and configurable sharing.
Version: 1.0.2
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: utraw
*/

:root {
  --paper: #f9f2e7;
  --paper-light: #f9f2e7;
  --ink: #171512;
  --muted: #6f665a;
  --line: #cfc3b2;
  --wood: #725039;
  --pine: #263c31;
  --shadow: 0 12px 35px rgb(33 25 16 / 12%);
  --content: 1540px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.6;
}
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
button, input { font: inherit; }

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper-light);
}
.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: center;
  width: min(calc(100% - 2rem), var(--content));
  margin: 0 auto;
  padding: 1rem 0 .65rem;
}
.custom-logo-link { display: block; }
.custom-logo { width: min(100%, 980px); max-height: 150px; object-fit: contain; object-position: left center; }
.text-logo { text-decoration: none; }
.text-logo strong { display: block; font-size: clamp(2rem, 5vw, 4.8rem); line-height: 1; font-weight: 500; }
.text-logo small { color: var(--muted); font-style: italic; }
.byline { white-space: nowrap; font-size: clamp(1rem, 2vw, 1.35rem); font-style: italic; }
.site-nav {
  border-top: 1px solid rgb(207 195 178 / 65%);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.site-nav ul { display: flex; justify-content: center; gap: 1.4rem; margin: 0; padding: .65rem 1rem; list-style: none; }
.site-nav a { text-decoration: none; }
.site-nav a:hover, .site-nav a:focus-visible { color: var(--wood); }

.site-main { min-height: 60vh; }
.comic-shell {
  width: min(calc(100% - 1rem), var(--content));
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2.5rem) 0 3rem;
}
.comic-heading { text-align: center; margin-bottom: 1rem; }
.edition-kicker {
  margin: 0 0 .15rem;
  color: var(--wood);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.comic-title { margin: 0; font-size: clamp(1.35rem, 3vw, 2.2rem); font-weight: 500; line-height: 1.2; }
.comic-date { margin: .3rem 0 0; color: var(--muted); font-size: .9rem; }
.comic-art {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper-light);
  box-shadow: var(--shadow);
}
.comic-art a { display: block; cursor: zoom-in; }
.comic-art img { width: 100%; }
.comic-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .75rem;
  margin: 1.25rem auto;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
}
.comic-nav a, .comic-nav span, .share-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .65rem .85rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  text-decoration: none;
}
.comic-nav .next { justify-self: end; }
.comic-nav .disabled { opacity: .35; }
.comic-nav a:hover, .comic-nav a:focus-visible, .share-button:hover, .share-button:focus-visible {
  color: var(--paper-light);
  background: var(--ink);
}
.comic-copy { max-width: 760px; margin: 2rem auto 0; font-size: 1.08rem; }
.comic-copy:empty { display: none; }

.share-panel { margin: 1.5rem auto 0; text-align: center; }
.share-panel h2 { margin: 0 0 .75rem; font-size: 1rem; font-family: ui-sans-serif, system-ui, sans-serif; }
.share-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem; }
.share-button {
  width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: white;
  background: var(--ink);
  cursor: pointer;
  font-size: 1.15rem;
  text-decoration: none;
  box-shadow: 0 4px 12px rgb(23 21 18 / 15%);
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
.share-button:hover, .share-button:focus-visible {
  color: white;
  background: var(--ink);
  filter: brightness(.9);
  transform: translateY(-2px);
  box-shadow: 0 7px 16px rgb(23 21 18 / 22%);
}
.share-button--native { background: var(--pine); }
.share-button--copy { background: #725039; }
.share-button--bluesky { background: #1185fe; }
.share-button--facebook { background: #1877f2; }
.share-button--pinterest { background: #bd081c; }
.share-button--reddit { background: #ff4500; }
.share-button--whatsapp { background: #25d366; }
.share-button--x { background: #000; }
.share-button--native:hover, .share-button--native:focus-visible { background: var(--pine); }
.share-button--copy:hover, .share-button--copy:focus-visible { background: #725039; }
.share-button--bluesky:hover, .share-button--bluesky:focus-visible { background: #1185fe; }
.share-button--facebook:hover, .share-button--facebook:focus-visible { background: #1877f2; }
.share-button--pinterest:hover, .share-button--pinterest:focus-visible { background: #bd081c; }
.share-button--reddit:hover, .share-button--reddit:focus-visible { background: #ff4500; }
.share-button--whatsapp:hover, .share-button--whatsapp:focus-visible { background: #25d366; }
.share-button--x:hover, .share-button--x:focus-visible { background: #000; }
.share-status { min-height: 1.5em; margin: .5rem 0 0; color: var(--muted); font-size: .85rem; }

.archive-shell, .page-shell {
  width: min(calc(100% - 2rem), 1120px);
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
}
.page-title { margin: 0 0 1.5rem; font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 500; }
.comic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 1.5rem; }
.comic-card { overflow: hidden; border: 1px solid var(--line); background: var(--paper-light); box-shadow: 0 8px 22px rgb(33 25 16 / 8%); }
.comic-card a { text-decoration: none; }
.comic-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.comic-card-copy { padding: 1rem; }
.comic-card h2 { margin: .15rem 0 0; font-size: 1.25rem; line-height: 1.25; }
.pagination { margin-top: 2rem; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.pagination a, .pagination span { padding: .4rem .7rem; border: 1px solid var(--line); background: var(--paper-light); text-decoration: none; }

.site-footer { padding: 2rem 1rem; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: .9rem; }
.lightbox {
  position: fixed;
  z-index: 9999;
  inset: 0;
  display: none;
  place-items: center;
  padding: 1rem;
  background: rgb(15 13 10 / 94%);
}
.lightbox.is-open { display: grid; }
.lightbox img { max-height: calc(100vh - 2rem); max-width: calc(100vw - 2rem); }
.lightbox-close { position: fixed; top: .75rem; right: 1rem; border: 0; color: white; background: transparent; cursor: pointer; font: 2rem/1 ui-sans-serif, sans-serif; }

@media (max-width: 700px) {
  .masthead { grid-template-columns: 1fr; gap: .25rem; text-align: center; }
  .custom-logo { margin: 0 auto; object-position: center; }
  .byline { font-size: .95rem; }
  .site-nav ul { gap: 1rem; }
  .comic-shell { width: 100%; padding-top: 1rem; }
  .comic-heading, .comic-nav, .share-panel, .comic-copy { margin-left: 1rem; margin-right: 1rem; }
  .comic-art { border-left: 0; border-right: 0; border-radius: 0; }
  .comic-nav { grid-template-columns: 1fr 1fr; }
  .comic-nav .archive-link { grid-column: 1 / -1; grid-row: 2; }
  .comic-nav .next { justify-self: stretch; }
  .comic-nav a, .comic-nav span { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
