/* =============================================================
   LUDAFOX Blog — skeleton (fallback) theme.
   A clean, image-forward canvas distinct from the retro bot wiki.
   Per-generation tokens (--accent, --secondary, --brush, --sans, --mono)
   are injected at runtime by BlogUtil.applyGenerationTheme(); the values
   below are the defaults so the page is styled before JS runs.
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink: #fff;
  --ink-soft: rgba(255, 255, 255, 0.85);
  --shadow: 0 2px 18px rgba(40, 70, 120, 0.45);
  --brush: 'Caveat Brush', cursive;
  --sans: 'Nunito', system-ui, sans-serif;
  --mono: 'Share Tech Mono', monospace;
  --accent: #2e5a9e;
  --secondary: #26d07c;
  --card: rgba(255, 255, 255, 0.96);
  --paper: #fffdfa;
  --text: #1f2c44;
  --text-soft: #56657c;
  --rule: #e6eaf1;
}

body { font-family: var(--sans); color: var(--ink); min-height: 100vh; overflow-x: hidden; }

/* Background: skeleton clouds by default; post pages override per entry. */
.sky {
  position: fixed; inset: 0; z-index: -1;
  background: url('/assets/brand/clouds5.webp') center/cover no-repeat fixed;
  transition: background-image .4s ease;
}
.sky::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20, 40, 70, 0.18), rgba(20, 40, 70, 0.5));
}

/* Top bar — consistent with the rest of ludafox.net */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 18px 26px; }
.topbar a.mark { font-family: var(--brush); font-size: 26px; color: #fff; text-decoration: none; text-shadow: var(--shadow); }
.topbar nav { display: flex; gap: 16px; flex-wrap: wrap; }
.topbar nav a { font-family: var(--brush); font-size: 21px; color: var(--ink-soft); text-decoration: none; text-shadow: var(--shadow); }
.topbar nav a:hover, .topbar nav a.on { color: #fff; }

main { max-width: 980px; margin: 0 auto; padding: 6px 20px 70px; }
.page-title { font-family: var(--brush); font-size: clamp(46px, 9vw, 84px); text-align: center; text-shadow: var(--shadow); }
.page-sub { text-align: center; color: var(--ink-soft); font-weight: 600; text-shadow: var(--shadow); margin-bottom: 18px; }
.page-sub a { color: #fff; }

/* ---- index: search + tag filter ---- */
.controls { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 18px; }
.srch { flex: 1 1 280px; max-width: 420px; border: 1px solid #cfd8e6; border-radius: 8px; padding: 10px 14px; font-family: var(--mono); font-size: 13px; outline: none; }
.srch:focus { border-color: var(--accent); }
.tagbar { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-bottom: 20px; }
.tagbar button { font-family: var(--mono); font-size: 11px; color: #fff; background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 999px; padding: 4px 12px; cursor: pointer; text-shadow: var(--shadow); }
.tagbar button.on, .tagbar button:hover { background: var(--accent); border-color: var(--accent); }

/* ---- featured hero ---- */
.feature { display: block; background: var(--card); border-radius: 16px; overflow: hidden; text-decoration: none; color: var(--text); margin-bottom: 26px; box-shadow: 0 8px 30px rgba(20, 40, 70, 0.35); }
.feature .cover { width: 100%; aspect-ratio: 16/7; object-fit: cover; background: #dde4ee; display: block; }
.feature .body { padding: 20px 24px 24px; }
.feature .kicker { font-family: var(--mono); font-size: 11px; letter-spacing: .6px; text-transform: uppercase; color: var(--accent); }
.feature h2 { font-family: var(--brush); font-size: clamp(30px, 5vw, 46px); line-height: 1.05; margin: 4px 0 6px; }
.feature .sub { color: var(--text-soft); font-size: 1.05rem; }
.feature .meta { font-family: var(--mono); font-size: 12px; color: #7c8aa0; margin-top: 10px; }

/* ---- post grid + list ---- */
.section-h { font-family: var(--brush); font-size: 34px; color: #fff; text-shadow: var(--shadow); margin: 8px 0 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 30px; }
.pcard { background: var(--card); border-radius: 13px; overflow: hidden; text-decoration: none; color: var(--text); display: flex; flex-direction: column; box-shadow: 0 4px 16px rgba(20, 40, 70, 0.25); transition: transform .12s ease; }
.pcard:hover { transform: translateY(-3px); }
.pcard .cover { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #dde4ee; }
.pcard .body { padding: 12px 14px 16px; flex: 1; display: flex; flex-direction: column; }
.pcard h3 { font-size: 1.15rem; line-height: 1.2; margin-bottom: 4px; }
.pcard .sub { color: var(--text-soft); font-size: .92rem; flex: 1; }
.pcard .meta { font-family: var(--mono); font-size: 11px; color: #7c8aa0; margin-top: 8px; }

/* ---- archive ---- */
.archive { background: var(--card); border-radius: 14px; padding: 16px 20px; color: var(--text); }
.archive h2 { font-family: var(--brush); font-size: 30px; margin-bottom: 6px; }
.archive .gen { margin-top: 12px; }
.archive .gen > .gh { font-weight: 800; color: var(--accent); border-bottom: 2px solid var(--rule); padding-bottom: 4px; margin-bottom: 6px; }
.archive .mo { font-weight: 700; color: var(--text); margin: 8px 0 2px; }
.archive ul { list-style: none; margin-left: 4px; }
.archive li { padding: 2px 0; }
.archive a { color: var(--text); text-decoration: none; }
.archive a:hover { color: var(--accent); text-decoration: underline; }

.muted { color: var(--ink-soft); font-family: var(--mono); font-size: 13px; padding: 16px; text-align: center; text-shadow: var(--shadow); }

/* ---- single post ---- */
.article { background: var(--paper); color: var(--text); border-radius: 16px; overflow: hidden; box-shadow: 0 10px 40px rgba(20, 40, 70, 0.4); margin-top: 6px; }
.article .hero { width: 100%; aspect-ratio: 16/6; object-fit: cover; background: #dde4ee; display: block; }
.article .inner { padding: clamp(22px, 4vw, 46px); max-width: 760px; margin: 0 auto; }
.article .kicker { font-family: var(--mono); font-size: 12px; letter-spacing: .6px; text-transform: uppercase; color: var(--accent); }
.article h1 { font-family: var(--brush); font-size: clamp(38px, 7vw, 62px); line-height: 1.02; margin: 6px 0 4px; }
.article .subtitle { color: var(--text-soft); font-size: 1.2rem; margin-bottom: 10px; }
.article .meta { font-family: var(--mono); font-size: 12px; color: #7c8aa0; display: flex; gap: 14px; flex-wrap: wrap; border-bottom: 1px solid var(--rule); padding-bottom: 14px; margin-bottom: 22px; }
.article .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.article .tags span { background: #eef3fb; color: var(--accent); border-radius: 999px; padding: 1px 9px; }

/* markdown body */
.md { font-size: 1.08rem; line-height: 1.72; }
.md h1, .md h2, .md h3, .md h4 { font-family: var(--brush); line-height: 1.1; margin: 1.4em 0 .4em; color: #18243c; }
.md h2 { font-size: 2rem; } .md h3 { font-size: 1.5rem; }
.md p { margin: 0 0 1.1em; }
.md a { color: var(--accent); }
.md img { max-width: 100%; border-radius: 10px; margin: 1em 0; display: block; }
.md blockquote { border-left: 4px solid var(--secondary); background: #f4f8f5; padding: 8px 16px; margin: 1.2em 0; border-radius: 0 8px 8px 0; color: #3a4a5e; }
.md ul, .md ol { margin: 0 0 1.1em 1.4em; }
.md li { margin: .25em 0; }
.md code { font-family: var(--mono); font-size: .92em; background: #eef1f6; padding: 1px 6px; border-radius: 5px; }
.md pre { background: #1c2331; color: #e6edf6; padding: 14px 16px; border-radius: 10px; overflow-x: auto; margin: 1.2em 0; }
.md pre code { background: none; padding: 0; color: inherit; }
.md hr { border: 0; border-top: 1px solid var(--rule); margin: 1.8em 0; }

/* related artwork + prev/next */
.related { margin: 26px 0 6px; padding: 16px 18px; background: #f4f8f5; border-radius: 12px; }
.related a { color: var(--accent); font-weight: 700; text-decoration: none; }
.related a:hover { text-decoration: underline; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }
.pager a { flex: 1; background: var(--card); color: var(--text); text-decoration: none; border-radius: 10px; padding: 12px 16px; box-shadow: 0 4px 14px rgba(20, 40, 70, 0.22); }
.pager a.next { text-align: right; }
.pager .dir { font-family: var(--mono); font-size: 11px; color: #7c8aa0; text-transform: uppercase; }
.pager .t { font-weight: 700; }
.backlink { display: inline-block; margin-top: 20px; color: #fff; font-family: var(--mono); font-size: 12px; text-shadow: var(--shadow); text-decoration: none; }
.backlink:hover { text-decoration: underline; }

/* reading progress bar */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--secondary); z-index: 10; transition: width .1s ease; }

/* site footer — Wiki/Guestbook, then smaller social links */
.site-foot { max-width: 980px; margin: 50px auto 0; padding: 24px 20px 30px; text-align: center; border-top: 1px solid rgba(255,255,255,0.25); }
.site-foot .foot-links { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
.site-foot .foot-links a { font-family: var(--brush); font-size: 22px; color: #fff; text-decoration: none; text-shadow: var(--shadow); }
.site-foot .foot-links a:hover { text-decoration: underline; }
.site-foot .foot-socials { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.site-foot .foot-socials a { font-family: var(--mono); font-size: 11px; letter-spacing: .4px; color: var(--ink-soft); text-decoration: none; text-shadow: var(--shadow); }
.site-foot .foot-socials a:hover { color: #fff; }

@media (max-width: 540px) {
  .topbar { padding: 12px 16px; }
  .pager { flex-direction: column; }
}
