:root {
  --bg: #d8d2c4;
  --container: #fcfbf8;
  --text: #222;
  --heading: #1a1a2e;
  --border: #666;
  --link: #0044aa;
  --link-hover: #880000;
  /* Category Colors */
  --film: #e74c3c;
  --folklore: #8e44ad;
  --food: #d4ac0d;
  --gaming: #27ae60;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: Verdana, Geneva, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  padding: 20px;
}

.container {
  max-width: 860px;
  margin: 0 auto;
  background: var(--container);
  border: 2px solid var(--border);
  padding: 20px;
  box-shadow: 5px 5px 0 rgba(0,0,0,0.15);
}

header { text-align: center; border-bottom: 2px solid var(--border); padding-bottom: 15px; margin-bottom: 20px; }
header h1 { font-family: Georgia, serif; color: var(--heading); letter-spacing: 1px; }
header p { font-style: italic; color: #555; margin: 5px 0; }

nav { margin-top: 12px; font-family: 'Courier New', monospace; font-size: 0.9rem; }
nav a { margin: 0 10px; color: var(--link); text-decoration: underline; cursor: pointer; }
nav a:hover { color: var(--link-hover); }
nav a.active { font-weight: bold; text-decoration: none; color: var(--heading); }

/* Category Active Nav Colors */
body[data-page="film"] nav a[data-nav="film"],
body[data-page="folklore"] nav a[data-nav="folklore"],
body[data-page="food"] nav a[data-nav="food"],
body[data-page="gaming"] nav a[data-nav="gaming"],
body[data-page="search"] nav a[data-nav="search"] { color: var(--heading); }

.post-card {
  border: 1px solid var(--border);
  margin: 15px 0;
  background: #fff;
  padding: 15px;
  position: relative;
  border-left: 4px solid #999; /* default */
}
.post-card[data-cat="film"] { border-left-color: var(--film); }
.post-card[data-cat="folklore"] { border-left-color: var(--folklore); }
.post-card[data-cat="food"] { border-left-color: var(--food); }
.post-card[data-cat="gaming"] { border-left-color: var(--gaming); }

.post-card::before {
  content: attr(data-cat);
  position: absolute; top: 0; right: 0;
  background: var(--border); color: #fff;
  padding: 2px 8px; font-family: 'Courier New', monospace;
  font-size: 0.7rem; text-transform: uppercase;
}
.post-card[data-cat="film"]::before { background: var(--film); }
.post-card[data-cat="folklore"]::before { background: var(--folklore); }
.post-card[data-cat="food"]::before { background: var(--food); }
.post-card[data-cat="gaming"]::before { background: var(--gaming); }

.post-meta { font-family: 'Courier New', monospace; font-size: 0.75rem; color: #666; margin-bottom: 6px; }
.post-title { font-family: Georgia, serif; margin: 0 0 8px; font-size: 1.2rem; }
.post-title a { color: var(--heading); text-decoration: none; }
.post-title a:hover { text-decoration: underline; color: var(--link); }

.tag { display: inline-block; background: #f0ede6; border: 1px solid #aaa; padding: 2px 6px; font-family: 'Courier New', monospace; font-size: 0.7rem; margin: 2px; }
.tag[data-cat="film"] { background: #fadbd8; border-color: #e74c3c; color: #922b21; }
.tag[data-cat="folklore"] { background: #e8daef; border-color: #8e44ad; color: #6c3483; }
.tag[data-cat="food"] { background: #f9e79f; border-color: #d4ac0d; color: #7d6608; }
.tag[data-cat="gaming"] { background: #d5f5e3; border-color: #27ae60; color: #1e8449; }

/* Search Page */
.search-box { display: flex; margin: 15px 0; }
.search-input { flex: 1; padding: 8px; font-family: 'Courier New', monospace; border: 2px inset #aaa; }
#tag-filters { margin: 10px 0 20px; padding: 10px 0; border-top: 1px dashed #aaa; border-bottom: 1px dashed #aaa; }
.tag-btn { background: #eee; border: 1px solid #999; padding: 4px 10px; font-family: 'Courier New', monospace; cursor: pointer; margin: 3px; font-size: 0.8rem; }
.tag-btn:hover { background: #ccc; }
.tag-btn.active { background: var(--heading); color: #fff; border-color: #333; }
#result-count { font-family: 'Courier New', monospace; color: #555; margin-bottom: 10px; }

article h2, article h3 { font-family: Georgia, serif; margin: 20px 0 10px; color: var(--heading); }
article p { margin-bottom: 12px; }
article blockquote { border-left: 3px solid var(--heading); padding: 10px; margin: 15px 0; background: #f4f2eb; font-style: italic; }
article ul, article ol { margin-left: 25px; margin-bottom: 15px; }

.back-link { display: inline-block; margin-top: 25px; font-family: 'Courier New', monospace; color: var(--link); }
.back-link:hover { text-decoration: underline; }

/* About Page */
.about-grid { display: flex; gap: 20px; margin-top: 20px; flex-wrap: wrap; }
.about-avatar { flex: 0 0 160px; height: 160px; background: #eee; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-family: 'Courier New', monospace; font-size: 0.8rem; text-align: center; padding: 10px; color: #666; }
.about-text { flex: 1; min-width: 280px; }
.about-text hr { border: 0; border-top: 1px dashed #aaa; margin: 15px 0; }
.about-links { margin-top: 15px; font-family: 'Courier New', monospace; }
.about-links a { color: var(--link); margin-right: 10px; }

footer { text-align: center; font-size: 0.75rem; color: #666; margin-top: 30px; border-top: 2px solid var(--border); padding-top: 12px; font-family: 'Courier New', monospace; }

@media (max-width: 600px) {
  .container { padding: 12px; }
  .search-box { flex-direction: column; }
  .about-grid { flex-direction: column; align-items: center; }
}

/* Post Images & Captions */
.post-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 20px 0 10px;
    border: 2px solid var(--border);
    box-shadow: 4px 4px 0 rgba(0,0,0,0.15);
}
.image-caption {
    text-align: center;
    font-style: italic;
    color: #555;
    font-size: 0.85rem;
    margin-top: 0;
    margin-bottom: 25px;
    font-family: 'Courier New', monospace;
}