/* ==========================================================
   railgun.blog stylesheet
   Colors are from the Everforest palette. Change them here
   and the whole site updates.
   ========================================================== */

:root {
  --bg: #fdf6e3;        /* page background */
  --bg-soft: #f4f0d9;   /* cards, header, footer */
  --text: #5c6a72;      /* normal text */
  --heading: #3a464c;   /* headings */
  --muted: #939f91;     /* dates, small text */
  --accent: #8da101;    /* links, highlights */
  --border: #e6e2cc;

  --max-width: 720px;   /* how wide the content column can get */
}

/* Dark colors, used automatically when the visitor's device is in dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #2d353b;
    --bg-soft: #343f44;
    --text: #d3c6aa;
    --heading: #e6dfc8;
    --muted: #859289;
    --accent: #a7c080;
    --border: #475258;
  }
}

/* ---------- Basics ---------- */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 18px;
  line-height: 1.6;
}

h1, h2, h3 {
  color: var(--heading);
  line-height: 1.25;
}

a {
  color: var(--accent);
}

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

/* Centers content and keeps it from getting too wide */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Header and navigation ---------- */

.site-header {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.site-title {
  color: var(--heading);
  font-size: 1.3rem;
  font-weight: bold;
  text-decoration: none;
}

.site-nav a {
  margin-left: 16px;
  color: var(--text);
  text-decoration: none;
}

.site-nav a:first-child {
  margin-left: 0;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--accent);
}

/* ---------- Banner image ---------- */

/* Full-width picture under the header. To change the picture,
   replace images/banner.jpg or change the src in index.html. */
.banner {
  position: relative;
  height: 25vh;           /* 25% of the screen height; change to resize */
  min-height: 150px;      /* keeps the text from getting cut off on short screens */
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;      /* fills the space and crops the edges */
  display: block;
}

/* Text on top of the banner. Delete the <div class="banner-text">
   in index.html if you want only the picture. */
.banner-text {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 24px 16px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
  color: #fff;
  text-align: center;
}

.banner-text h1 {
  margin: 0;
  color: #fff;
  font-size: 2rem;
}

.banner-text p {
  margin: 4px 0 0;
}

/* ---------- Main content ---------- */

main {
  padding-top: 32px;
  padding-bottom: 48px;
}

/* A post in the list on the home page */
.post-card {
  padding: 20px;
  margin-bottom: 20px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.post-card h2 {
  margin: 0 0 4px;
  font-size: 1.3rem;
}

.post-card h2 a {
  color: var(--heading);
  text-decoration: none;
}

.post-card h2 a:hover {
  color: var(--accent);
}

.post-card p {
  margin: 8px 0 0;
}

.date {
  color: var(--muted);
  font-size: 0.9rem;
}

/* A full blog post page */
.post h1 {
  margin-bottom: 4px;
}

.back-link {
  display: inline-block;
  margin-top: 32px;
}

/* "See all posts" link under the post list on the home page */
.see-all {
  display: inline-block;
  margin-top: 8px;
}

/* Images inside a post */
.post img {
  border-radius: 8px;
  margin: 16px 0;
}

/* ---------- Timeline page ---------- */

/* A year heading, like "2026" */
.timeline-year {
  margin: 32px 0 12px;
  font-size: 1.5rem;
}

/* The list of posts, drawn as a line with a dot for each post */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 24px;
  border-left: 2px solid var(--border);
}

.timeline li {
  position: relative;
  padding-bottom: 20px;
}

/* The dot on the line */
.timeline li::before {
  content: "";
  position: absolute;
  left: -32px;            /* moves the dot onto the line */
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}

.timeline .date {
  display: block;
}

.timeline a {
  color: var(--heading);
  font-weight: 600;
  text-decoration: none;
}

.timeline a:hover {
  color: var(--accent);
}

/* About page photo */
.avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
}

/* Code snippets inside posts */
code {
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* Code blocks (Org mode exports #+begin_src blocks as <pre>) */
pre {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  overflow-x: auto;       /* long lines scroll instead of breaking the page */
  font-size: 0.9rem;
}

/* Org adds section numbers like "1." to headings. Delete this rule to show them. */
.section-number-2,
.section-number-3 {
  display: none;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}
