/* =========================================================================
   Wanderings — consolidated stylesheet
   Replaces normalize.css + screen.css + blog.css + photoset.css + tocbot.css
   Retro identity preserved: VT323 body, "Press Start 2P" titles, sunset banner.
   ========================================================================= */

:root {
  --ink: #222;
  --ink-soft: #5b5b5b;
  --accent: #443e40;
  --paper: #fefefe;
  --rule: #d9d6d2;
  --max-width: 52rem;
  --gap: 0.5rem;
}

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

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

body {
  margin: 0;
  font: 400 1.25rem/1.6 "VT323", ui-monospace, monospace;
  color: var(--ink);
  background: var(--paper);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

h1,
h2,
h3 {
  font-weight: 400;
  line-height: 1.4;
}

/* --- Layout -------------------------------------------------------------- */
#main {
  width: 90%;
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-header {
  text-align: center;
  padding-top: 1.5rem;
}

/* Sunset banner — decorative pixel-art block linking home. */
.banner {
  display: block;
  width: 182px;
  height: 242px;
  margin: 0 auto 1rem;
  background: #8e8387 url("../img/sunset.jpg") center / cover no-repeat;
  position: relative;
}

.banner::after {
  content: "";
  position: absolute;
  left: 2px;
  bottom: -3px;
  width: 178px;
  height: 3px;
  background: var(--accent);
}

@media (min-resolution: 192dpi) {
  .banner {
    background-image: url("../img/sunset@2x.jpg");
  }
}

@media (min-resolution: 288dpi) {
  .banner {
    background-image: url("../img/sunset@3x.jpg");
  }
}

.site-title {
  font-family: "Press Start 2P", system-ui, cursive;
  font-size: clamp(1.1rem, 5vw, 2.3rem);
  text-align: center;
  margin: 0.5rem 0 0.25rem;
  color: var(--ink);
}

.site-title a {
  color: inherit;
}

.site-title a:hover {
  text-decoration: none;
}

/* --- Posts --------------------------------------------------------------- */
.post-header {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.75rem;
  margin: 1.5rem 0;
}

.post-title {
  font-family: "Press Start 2P", system-ui, cursive;
  font-size: clamp(1rem, 4vw, 1.4rem);
  line-height: 1.7;
  margin: 0 0 0.75rem;
}

.post-date {
  display: block;
  font-size: 1rem;
  color: var(--ink-soft);
}

.post-body p {
  margin: 0 0 1.1rem;
}

.post-body h2 {
  font-size: 1.5rem;
  margin: 2rem 0 0.75rem;
}

.post-footer {
  margin-top: 1.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--rule);
}

.post-footer-location::before {
  content: "📍 ";
}

/* --- Justified photo gallery -------------------------------------------- */
/* Each row is a flex line; items grow to fill the row width while keeping
   their aspect ratio (--ar) so nothing is cropped awkwardly. */
.gallery {
  margin: 1.5rem 0;
}

.gallery-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.gallery-item {
  position: relative;
  flex-grow: var(--ar, 1);
  flex-basis: calc(var(--ar, 1) * 14rem);
  aspect-ratio: var(--ar, 1.5);
  overflow: hidden;
  border-radius: 3px;
  background: #eee;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.gallery-item:hover img,
.gallery-item:focus img {
  transform: scale(1.03);
  opacity: 0.92;
}

@media (max-width: 600px) {
  .gallery-row {
    flex-direction: column;
  }

  .gallery-item {
    flex-basis: auto;
    width: 100%;
  }
}

/* --- Listing cards (home + section landing pages) ------------------------ */
.post-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(16rem, 100%), 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.post-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.post-card-link {
  color: inherit;
  display: block;
  overflow: hidden;
  border-radius: 4px;
}

.post-card-link:hover {
  text-decoration: none;
}

.post-card-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.post-card-link:hover .post-card-img {
  transform: scale(1.03);
}

.post-card-title {
  font-family: "Press Start 2P", system-ui, cursive;
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 0.6rem 0 0.25rem;
}

.post-card-summary {
  margin: 0.25rem 0;
}

.post-card .post-date {
  font-size: 0.95rem;
}

/* --- Pagination ---------------------------------------------------------- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin: 2.5rem 0 1rem;
  font-size: 1.1rem;
}

.pagination a {
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
}

.pagination [aria-current="page"] {
  font-weight: 700;
  color: var(--ink);
}

.pagination .is-disabled {
  visibility: hidden;
}

/* --- Footer -------------------------------------------------------------- */
.site-footer {
  width: 90%;
  max-width: var(--max-width);
  margin: 3rem auto 2.5rem;
  text-align: center;
}

.social {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 0.5rem;
}

.social a {
  color: var(--ink);
}

.legal {
  color: #818181;
  font-style: italic;
  font-size: 0.95rem;
  margin: 0;
}

/* --- PhotoSwipe caption -------------------------------------------------- */
.pswp__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.75rem 1rem;
  text-align: center;
  color: #fff;
  font-family: "VT323", ui-monospace, monospace;
  font-size: 1.1rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
  pointer-events: none;
}
