/* ============================================================
   fict10nal.xyz — terminal theme
   Purple phosphor on near-black, monospace, prompt-style chrome.
   ============================================================ */
:root {
  --bg: #0a0510;              /* page background (near-black, faint purple) */
  --bg-panel: #100a17;        /* window body */
  --bg-header: #180f23;       /* title bar / nav / footer */
  --bg-inset: #221433;        /* code, tag buttons, hover fills */
  --purple: #b388ff;           /* primary phosphor purple */
  --purple-bright: #d0b3ff;    /* hover / bright accent */
  --purple-dim: #7c4dcc;       /* borders */
  --text: #d3c6ee;            /* default text */
  --text-bright: #ece2fb;
  --text-dim: #7a63a8;        /* footer, muted */
  --mono: 'Cascadia Code', 'Consolas', 'Courier New', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  background-color: var(--bg);
  font-family: var(--mono);
  color: var(--text);
  min-height: 65vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* faint scanlines for a phosphor-CRT feel, kept very subtle */
  background-image: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.25) 0px,
    rgba(0, 0, 0, 0.25) 1px,
    transparent 1px,
    transparent 3px
  );
}
header {
  width: 100%;
  padding: 10px;
  background-color: var(--bg-header);
  text-align: center;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--purple-dim);
}
header h1 {
  font-size: 1.5rem;
  color: var(--purple);
  letter-spacing: 2px;
  font-weight: 500;
  text-shadow: 0 0 8px rgba(179, 136, 255, 0.5);
  text-transform: lowercase;
}
nav {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-wrap: wrap;           /* allow links to flow to new lines */
  justify-content: center;
  row-gap: 4px;
  background-color: var(--bg-header);
  padding: 4px;
  border: 1px solid var(--purple-dim);
  border-radius: 6px;
  margin-bottom: 10px;
}
nav a {
  color: var(--text);
  text-decoration: none;
  padding: 4px 20px;
  margin: 0 5px;
  font-size: 0.9rem;
  border-radius: 4px;
  transition: all 0.15s ease;
}
/* Mobile: tighten links so they fit comfortably in fewer rows */
@media (max-width: 600px) {
  nav a {
    padding: 6px 12px;
    margin: 0 3px;
    font-size: 0.85rem;
  }
}
nav a:hover, nav a.active {
  background-color: var(--bg-inset);
  color: var(--purple);
  text-shadow: 0 0 6px rgba(179, 136, 255, 0.4);
}
/* Makes page ignore this div as if it's not there */
.div-js {
  display: contents;
}
.window-body {
  width: 100%;
  max-width: 800px;
  background-color: var(--bg-panel);
  border: 1px solid var(--purple-dim);
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7), 0 0 20px rgba(179, 136, 255, 0.08);
  overflow: hidden;
  /* flex column so the footer's margin-top: auto pins it to the panel's
     bottom edge, and the panel can stretch to fill the viewport */
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.window-header {
  background-color: var(--bg-header);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--purple-dim);
  font-size: 0.85rem;
}
.window-title {
  color: var(--purple);
  font-size: 0.9rem;
  font-weight: 400;
}
main {
  padding: 15px;
  line-height: 1.7;
  /* contain the floated .about-photo so main's height includes it
     (footer no longer slides up alongside the image on short pages) */
  display: flow-root;
}
main p {
  margin-bottom: 15px;
  color: var(--text);
}
/* About page photo: float left so the first paragraph wraps around it */
.about-photo {
  float: left;
  width: 220px;
  max-width: 45%;
  height: auto;
  margin: 4px 18px 10px 0;
  border: 1px solid var(--purple-dim);
  border-radius: 6px;
  box-shadow: 0 0 12px rgba(179, 136, 255, 0.25);
}
footer {
  width: 100%;
  max-width: 800px;
  text-align: center;
  padding: 15px;
  background-color: var(--bg-header);
  margin-top: auto;
  font-size: 0.8rem;
  color: var(--text-dim);
}
/* code for a terminal code block */
code {
  background-color: var(--bg-inset);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--purple-dim);
  color: var(--purple);
  font-family: var(--mono);
}
.terminal {
  background-color: #07040d;
  color: var(--purple);
  padding: 20px;
  border: 1px solid var(--purple-dim);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.9rem;
  margin-bottom: 15px;
}
.terminal .prompt {
  color: var(--purple-bright);
  font-weight: 700;
}
/* Blinking block cursor after a prompt */
.cursor-blink::after {
  content: '▋';
  color: var(--purple);
  animation: blink 1.1s steps(1) infinite;
  margin-left: 2px;
}
@keyframes blink {
  50% { opacity: 0; }
}

/* Image Feed Area */
.image-feed-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0px;
}
.image-feed {
  gap: 10px;
}
/* Gallery entries in the home feed get the same left line as text posts */
.image-feed .image-post {
  border-left: 2px solid var(--purple-dim);
  padding: 4px 0 4px 16px;
  margin-bottom: 22px;
  transition: border-color 0.15s ease;
}
.image-feed .image-post:hover {
  border-left-color: var(--purple);
}
.image-post {
  position: relative;
  overflow: hidden;
}
.post-image-wrapper {
  position: relative;
  overflow: hidden;
  background-color: #07040d;
}
/* Videos get a stable intrinsic ratio from the width/height attributes set
   by gallery.js (borrowed from the sibling media on swap, 16:9 default
   before metadata arrives), so no CSS ratio override is needed here. */
.post-image-wrapper img,
.post-image-wrapper video {
  display: block;
  width: 100%;
  height: auto;
  border-bottom: 1px solid var(--purple-dim);
  border-top: 1px solid var(--purple-dim);
}
.post-image-wrapper :is(img, video) + :is(img, video) {
  margin-top: 2px;
}
/* Lazy-video placeholder: shown until the card scrolls near the viewport,
   when gallery.js swaps it for the real <video>. 16:9 matches the
   video's default width/height attributes so nothing shifts on swap. */
.media-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-bottom: 1px solid var(--purple-dim);
  border-top: 1px solid var(--purple-dim);
  background: linear-gradient(135deg, var(--bg-inset) 25%, #0d0818 50%, var(--bg-inset) 75%);
  background-size: 200% 200%;
  animation: media-placeholder-shimmer 1.6s ease-in-out infinite;
}
@keyframes media-placeholder-shimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.post-content {
  padding: 10px;
}
.post-description {
  font-size: 1.0rem;
  line-height: 1.5;
}
.post-title {
  margin: 0 0 4px 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--purple);
}

/* Gallery Page */
/* Load-more row (posts page) — its button reuses the gallery tag-button style below */
.load-more {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}
.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.tag-filters button,
.load-more button {
  background-color: var(--bg-inset);
  color: var(--text);
  border: 1px solid var(--purple-dim);
  border-radius: 4px;
  padding: 6px 12px;
  font-family: var(--mono);
  font-size: 0.85rem;
  cursor: pointer;
}
.tag-filters button:hover,
.load-more button:hover {
  background-color: var(--purple-dim);
  color: var(--text-bright);
}
/* Disabled "end of posts" state — dimmed, no hover feedback */
.load-more button:disabled {
  cursor: default;
  color: var(--text-dim);
}
.load-more button:disabled:hover {
  background-color: var(--bg-inset);
  color: var(--text-dim);
}
.tag-filters button.active {
  background-color: var(--purple);
  border-color: var(--purple);
  color: #07040d;
  text-shadow: none;
}
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
}
.gallery-grid .image-post {
  background-color: var(--bg-panel);
  border: 1px solid var(--purple-dim);
  border-radius: 6px;
  overflow: hidden;
}
/* Grouped posts (multiple images, same id) get a brighter border so
   it's clear the images belong to one post. */
.gallery-grid .image-post:has(.post-image-nav) {
  border: 1px solid var(--purple-dim);
  box-shadow: 0 0 10px rgba(179, 136, 255, 0.2);
}
/* Prev/next row below a grouped post's single visible image */
.post-image-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 6px;
  background-color: var(--bg-inset);
  border-top: 1px solid var(--purple-dim);
}
.post-image-nav button {
  background-color: transparent;
  color: var(--text);
  border: 1px solid var(--purple-dim);
  border-radius: 4px;
  padding: 2px 10px;
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.4;
  cursor: pointer;
}
.post-image-nav button:hover,
.post-image-nav button:focus-visible {
  background-color: var(--purple-dim);
  color: var(--text-bright);
}
.post-image-counter {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}
.gallery-grid .post-content {
  padding: 12px;
}
/* Date above each gallery card: centered, no tags (unlike the home feed) */
.gallery-grid .post-meta {
  justify-content: center;
  padding: 10px 10px 6px;
  margin-bottom: 0;
}
/* Title sits to the left of the date in the centered meta row */
.gallery-grid .post-title {
  margin: 0;
}

.gallery-empty {
  color: var(--text-dim);
  font-style: normal;
}

/* Posts / Microblog Page */
.microblog-intro {
  color: var(--text-dim);
  margin-bottom: 25px;
}
.micro-post {
  border-left: 2px solid var(--purple-dim);
  padding: 4px 0 4px 16px;
  margin-bottom: 22px;
  transition: border-color 0.15s ease;
}
.micro-post:hover {
  border-left-color: var(--purple);
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin-bottom: 4px;
  font-size: 0.85rem;
}
.post-meta time {
  color: var(--purple-bright);
  text-shadow: 0 0 6px rgba(179, 136, 255, 0.4);
}
.post-meta .post-tags {
  color: var(--text-dim);
}
.micro-post p {
  color: var(--text);
}
.microblog-empty {
  color: var(--text-dim);
}