:root {
  --bg: #ffffff;
  --bg-post: #ffffff;
  --accent: #000000;
  --accent2: #ffffff;
  --accent3: #ffff00;
  --text: #000000;
  --text-muted: #4b4b4b;
  --border: #000000;
  --error: #ff4422;
  --error-bg: #220000;
  --success: #00ff88;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, 'Times New Roman', Times, monospace;
  min-height: 100vh;
}

/* ── Site Header ─────────────────────────────────────────── */

.website-title {
  text-align: center;
  padding: 16px 20px 12px;
  border-bottom: none;
  background: #ffffff;
}

.website-title h1 {
  margin: 0;
  font-size: 1.6rem;
  color: var(--accent);
  text-shadow: none;
  text-transform: none;
  letter-spacing: 4px;
}

/* ── Two-column layout ───────────────────────────────────── */

.website-body {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  min-height: calc(100vh - 70px);
}

/* ── Sidebar ─────────────────────────────────────────────── */

.side-menu {
  width: 180px;
  min-width: 180px;
  margin-top: 24px;
  padding: 0 10px 16px;
  border-top: 20px solid transparent;
  border-right: 20px solid transparent;
  border-bottom: 20px solid transparent;
  border-left: 0;
  border-image: url("../assets/menu_border.png") 6 stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
}

.side-menu a {
  display: block;
  width: 100%;
}

.menu-item {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
  transition: opacity 0.1s;
}

.menu-item:hover {
  opacity: 0.8;
}

/* ── Newsletter widget ───────────────────────────────────── */

#newsletter-widget {
  margin-top: 16px;
  width: 100%;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

#newsletter-widget h3 {
  color: var(--accent);
  font-size: 0.65rem;
  margin: 0 0 6px;
  text-transform: none;
  letter-spacing: 2px;
}

#newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

#newsletter-form label {
  font-size: 0.65rem;
  color: var(--text-muted);
}

#newsletter-form input[type="email"] {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 6px;
  font-family: inherit;
  font-size: 0.65rem;
  width: 100%;
}

#newsletter-form input[type="email"]:focus {
  outline: 1px solid var(--accent2);
}

#newsletter-form button[type="submit"] {
  background: var(--accent2);
  color: #000;
  border: none;
  padding: 4px 8px;
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: bold;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 1px;
}

#newsletter-form button[type="submit"]:hover {
  background: var(--accent2);
}

#newsletter-feedback {
  font-size: 0.6rem;
  color: var(--accent3);
  min-height: 1em;
  line-height: 1.4;
}

/* ── Main content area ───────────────────────────────────── */

.content-box {
  flex: 1;
  padding: 24px 32px;
  max-width: 820px;
  min-width: 0;
}

/* ── Post containers (dynamic feed) ─────────────────────── */

.post-container {
  margin-bottom: 28px;
  padding: 20px 24px;
  background: var(--bg-post);
  /* Swap to assets/frames/post-frame.png for a custom post border: */
  border: 20px solid transparent;
  border-image: url("../assets/menu_border.png") 6 stretch;
}

.post-title {
  font-size: 1.2rem;
  color: var(--accent);
  margin: 0 0 6px;
  text-transform: none;
  letter-spacing: 1px;
}

.post-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 14px;
}

.post-body {
  line-height: 1.7;
  color: var(--text);
}

.post-body p {
  margin: 0 0 1em;
}

.post-body figure {
  margin: 1rem 0;
}

.post-body figcaption {
  font-style: italic;
  font-size: 0.8rem;
  text-align: center;
  color: var(--text-muted);
  margin-top: 4px;
}

.post-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.blurb-images {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.blurb figure {
  flex: 1;
  margin: 0;
}

.blurb figcaption {
  font-style: italic;
  font-size: 0.8rem;
  text-align: center;
  color: var(--text-muted);
  margin-top: 4px;
}

.blurb img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* ── Static page content (About, Contact) ────────────────── */

.page-content {
  padding: 4px 0;
}

.page-content h1 {
  color: var(--accent);
  text-transform: none;
  letter-spacing: 2px;
  font-size: 1.4rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 20px;
}

.blurb {
  line-height: 1.8;
  max-width: 580px;
}

.contact-info {
  line-height: 2;
}

.contact-info a {
  color: var(--accent);
  text-decoration: none;
}

.contact-info a:hover {
  text-decoration: underline;
  color: var(--accent);
}

/* ── Feed state messages ─────────────────────────────────── */

.end-of-feed {
  text-align: center;
  color: var(--accent);
  padding: 20px;
  font-style: oblique;
  font-size: 0.9rem;
}

.feed-error {
  color: var(--error);
  padding: 16px;
  border: 1px solid var(--error);
  background: var(--error-bg);
  margin: 10px 0;
}

.fetch-error {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--error);
  background: var(--error-bg);
  color: var(--error);
  margin: 10px 0;
  font-size: 0.875rem;
}

.fetch-error button {
  background: transparent;
  border: 1px solid var(--error);
  color: var(--error);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.75rem;
  padding: 3px 8px;
  white-space: nowrap;
}

.fetch-error button:hover {
  background: var(--error);
  color: #fff;
}

.scroll-sentinel {
  height: 40px;
}

/* ── Legacy static prototype styles (home.html) ──────────── */

.entry {
  margin: 0 15% 5%;
  border: 1px solid var(--border);
  padding: 16px;
  background: var(--bg-post);
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 640px) {
  .website-body {
    flex-direction: column;
  }

  .side-menu {
    width: 100%;
    min-width: unset;
    max-height: none;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    border-right: none;
    border-bottom: 2px solid var(--border);
    border-image: none;
    padding: 10px;
  }

  .side-menu a {
    width: 60px;
  }

  #newsletter-widget {
    display: none;
  }

  .content-box {
    padding: 16px;
  }
}
