/* ============================================
   RUBBLE THEME — From The Rubble
   fromtherubble.pro
   ============================================ */

/* ============================================
   FONTS — Self-hosted IBM Plex
   ============================================ */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-400-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-700.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-400.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-600.woff2') format('woff2');
}

/* ============================================
   VARIABLES
   ============================================ */
:root {
  --bone:       #F2F0EB;
  --stone:      #4A4A52;
  --dark:       #2B2B2F;
  --tan:        #C4A882;
  --rust:       #8B4A35;
  --rust-hover: #6e3a29;
  --border:     #D8D4CC;

  --font-sans:  'IBM Plex Sans', system-ui, sans-serif;
  --font-mono:  'IBM Plex Mono', 'Courier New', monospace;

  --measure:    680px;
  --pad:        1.5rem;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--bone);
  color: var(--stone);
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

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

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

/* ============================================
   LAYOUT
   ============================================ */
#main,
.site-foot {
  max-width: calc(var(--measure) + var(--pad) * 2);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

#main {
  padding-top: 3rem;
  padding-bottom: 4rem;
  min-height: calc(100vh - 140px);
}

/* ============================================
   HEADER
   ============================================ */
.site-head {
  max-width: calc(var(--measure) + var(--pad) * 2);
  margin: 0 auto;
  padding: 2rem var(--pad) 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.site-logo {
  display: block;
  text-decoration: none;
}

.site-logo img {
  width: 220px;
  height: auto;
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone);
  text-decoration: none;
  transition: color 0.15s;
}

.nav-link:hover,
.nav-rss { color: var(--rust); }

.site-wordmark {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--stone);
  opacity: 0.55;
}

/* ============================================
   SERIES GROUPS (index)
   ============================================ */
.series-group {
  margin-bottom: 2.5rem;
}

.series-heading {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tan);
  padding: 1.5rem 0 0.5rem;
  border-top: 1px solid var(--border);
}

.series-heading a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}
.series-heading a:hover { color: var(--rust); }

.series-heading--standalone { color: var(--stone); opacity: 0.4; }

/* ============================================
   POST LIST (index)
   ============================================ */
.post-list-wrap {}

.post-row {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  align-items: baseline;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.post-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--tan);
  white-space: nowrap;
  padding-top: 0.15rem;
}

.post-title-link {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--dark);
  text-decoration: none;
  line-height: 1.4;
  transition: color 0.15s;
}

.post-title-link:hover { color: var(--rust); }

/* ============================================
   SINGLE POST
   ============================================ */

.post-series-context {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.series-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rust);
  text-decoration: none;
}
.series-label:hover { color: var(--rust-hover); }

.series-position {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--tan);
}

.series-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.series-nav-link {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--stone);
  text-decoration: none;
  max-width: 45%;
  line-height: 1.4;
  transition: color 0.15s;
}
.series-nav-link:hover { color: var(--rust); }
.series-nav-next { text-align: right; margin-left: auto; }
.post { max-width: var(--measure); }

.post-head { margin-bottom: 1.5rem; }

.post-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.post-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rust);
}

.post-title {
  font-family: var(--font-sans);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--dark);
  line-height: 1.15;
  margin-bottom: 0.6rem;
}

.post-head .post-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--tan);
  display: block;
}

.post-rule {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0 2rem;
}

/* ============================================
   POST CONTENT (prose)
   ============================================ */
.post-content {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--stone);
}

.post-content p { margin-bottom: 1.4em; }

.post-content h2,
.post-content h3,
.post-content h4 {
  font-family: var(--font-sans);
  font-weight: 700;
  color: var(--dark);
  margin-top: 2.2em;
  margin-bottom: 0.6em;
  line-height: 1.2;
}

.post-content h2 { font-size: 1.45rem; }
.post-content h3 { font-size: 1.2rem; }
.post-content h4 { font-size: 1rem; }

.post-content a {
  color: var(--rust);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s;
}
.post-content a:hover { text-decoration-color: var(--rust); }

.post-content strong { color: var(--dark); font-weight: 700; }
.post-content em { font-style: italic; }

.post-content ul,
.post-content ol {
  margin-bottom: 1.4em;
  padding-left: 1.5rem;
}

.post-content ul { list-style: none; }
.post-content ul li { position: relative; padding-left: 1.2rem; margin-bottom: 0.4em; }
.post-content ul li::before {
  content: '—';
  font-family: var(--font-mono);
  color: var(--tan);
  position: absolute;
  left: 0;
}

.post-content ol { list-style: decimal; }
.post-content ol li { margin-bottom: 0.4em; }

.post-content blockquote {
  border-left: 2px solid var(--rust);
  margin: 1.8em 0;
  padding: 0.5em 0 0.5em 1.5rem;
  color: var(--stone);
}

.post-content blockquote p {
  font-style: italic;
  margin-bottom: 0;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5em 0;
}

.post-content pre {
  background: var(--dark);
  color: var(--bone);
  padding: 1.25rem 1.5rem;
  border-radius: 2px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  margin-bottom: 1.4em;
}

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: rgba(139, 74, 53, 0.08);
  color: var(--rust);
  padding: 0.1em 0.35em;
  border-radius: 2px;
}

.post-content pre code {
  background: none;
  color: inherit;
  padding: 0;
}

.post-content img {
  margin: 1.8em 0;
  border-radius: 2px;
}

/* ============================================
   POST FOOTER
   ============================================ */
.post-foot {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.back-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--stone);
  text-decoration: none;
  transition: color 0.15s;
}

.back-link:hover { color: var(--rust); }

/* ============================================
   LIST PAGE TITLE
   ============================================ */
.list-title {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  color: var(--dark);
  margin-bottom: 2rem;
}

/* ============================================
   FOOTER
   ============================================ */
.site-foot {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.foot-tagline,
.foot-copy,
.foot-rss,
.foot-sep {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--stone);
  opacity: 0.6;
}

.foot-rss { color: var(--rust); opacity: 1; text-decoration: none; }
.foot-rss:hover { opacity: 0.75; color: var(--rust); }
.foot-sep { opacity: 0.3; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 560px) {
  body { font-size: 17px; }

  .post-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .post-date { display: block; }

  .logo-text { font-size: 0.78rem; }

  .site-nav { gap: 1rem; }
}

/* Series index */
.series-index {
  margin: 2rem 0 1.5rem;
  padding: 1rem 1.25rem;
  border-left: 3px solid #444;
}
.series-index-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.6;
  display: block;
  margin-bottom: 0.5rem;
}
.series-index ol {
  margin: 0;
  padding-left: 1.25rem;
}
.series-index li {
  margin: 0.3rem 0;
}
.series-index-current {
  font-weight: 600;
}
