:root {
  --bg: #3a718e;
  --card: #204e75;
  --card-alt: #2b5c85;
  --text: #ffffff;
  --muted: #cbd5e1;
  --accent: #60a5fa;
  --accent-hover: #3b82f6;
  --border: #173a58;
  --yellow: #facc15;
  --yellow-hover: #fde047;
  --yellow-border: #ca8a04;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Verdana, Arial, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* Header & Yellow Button Bar */
header {
  background: var(--card);
  border-bottom: 2px solid #ffffff;
  padding: 16px 20px 14px;
  text-align: center;
}

header h1 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: 0.04em;
}

header p {
  margin: 4px 0 14px;
  color: var(--muted);
  font-size: 0.95rem;
}

.logo-link {
  display: inline-block;
  text-decoration: none;
}

.site-logo {
  width: 897px;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 8px;
}

nav.yellow-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

nav.yellow-nav a {
  background: var(--yellow);
  color: #111827;
  border: 2px solid var(--yellow-border);
  padding: 7px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  transition: background 0.15s ease, transform 0.1s ease;
}

nav.yellow-nav a:hover {
  background: var(--yellow-hover);
  transform: translateY(-1px);
}

nav.sub-links {
  margin-top: 6px;
  font-size: 0.9rem;
}

nav.sub-links a {
  margin: 0 12px;
  text-decoration: none;
  color: var(--yellow);
  font-weight: 700;
}

nav.sub-links a:hover {
  text-decoration: underline;
}

/* Front Page Two-Column Layout */
main.front-layout {
  max-width: 1020px;
  margin: 22px auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr 270px;
  gap: 18px;
  align-items: start;
}

@media (max-width: 800px) {
  main.front-layout {
    grid-template-columns: 1fr;
  }
}

.section-bar {
  background: var(--card);
  border: 2px solid #ffffff;
  padding: 7px 14px;
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.section-bar.center-title {
  justify-content: center;
}

/* News Post Boxes */
.news-post {
  background: var(--card);
  border: 2px solid #ffffff;
  padding: 16px;
  margin-bottom: 16px;
}

.news-post-header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid #ffffff;
  margin-bottom: 12px;
}

.news-avatar {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border: 2px solid #ffffff;
  background: #173a58;
  flex-shrink: 0;
}

.news-meta h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  line-height: 1.2;
}

.news-headline-link {
  color: #ffffff;
  text-decoration: none;
}

.news-headline-link:hover {
  color: var(--yellow);
  text-decoration: underline;
}


.news-timestamp {
  font-size: 0.85rem;
  color: #e2e8f0;
}

.news-author {
  font-size: 0.85rem;
  color: #e2e8f0;
}

.news-author span {
  color: var(--accent);
  font-weight: 700;
}

.news-body {
  font-size: 0.95rem;
  line-height: 1.6;
}

.news-body p {
  margin: 0 0 12px;
}

.news-body p:last-child {
  margin-bottom: 0;
}

.news-body a {
  color: var(--yellow);
}

/* Bottom News Archive Bar */
.news-bottom-bar {
  background: var(--card);
  border: 2px solid #ffffff;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}

.news-bottom-bar button,
.news-bottom-bar a {
  background: none;
  border: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  padding: 4px 8px;
}

.news-bottom-bar button:hover:not(:disabled),
.news-bottom-bar a:hover {
  color: var(--yellow);
  text-decoration: underline;
}

.news-bottom-bar button:disabled {
  color: #64748b;
  cursor: not-allowed;
}

/* Right Sidebar: 10 Most Recent Comics */
.updates-panel {
  border: 2px solid #ffffff;
  background: var(--card);
}

.updates-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.updates-list li {
  text-align: center;
  padding: 9px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  background: var(--card);
}

.updates-list li:nth-child(even) {
  background: var(--card-alt);
}

.updates-list li:last-child {
  border-bottom: none;
}

.updates-list a {
  text-decoration: none;
  color: #ffffff;
  display: block;
}

.updates-list a:hover .update-title {
  color: var(--yellow);
  text-decoration: underline;
}

.update-label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
}

.update-title {
  display: block;
  font-size: 0.85rem;
  color: #dbeafe;
}

/* Comic Reader & Archive Pages */
main.reader-main {
  max-width: 980px;
  margin: 24px auto;
  padding: 0 16px;
}

main.archive-main {
  max-width: 780px;
  margin: 24px auto;
  padding: 0 16px;
}

.comic-card {
  background: var(--card);
  border: 2px solid #ffffff;
  padding: 20px;
  text-align: center;
}

.comic-header {
  margin-bottom: 16px;
}

.comic-header h2 {
  margin: 0 0 4px;
  font-size: 1.4rem;
}

.comic-date {
  color: var(--muted);
  font-size: 0.9rem;
}

.comic-frame img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 20px 0 8px;
}

.controls button {
  background: var(--yellow);
  color: #111827;
  border: 2px solid var(--yellow-border);
  padding: 9px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 5px;
  cursor: pointer;
}

.controls button:hover:not(:disabled) {
  background: var(--yellow-hover);
}

.controls button:disabled {
  background: #475569;
  border-color: #334155;
  color: #94a3b8;
  cursor: not-allowed;
}

.reader-news-wrap {
  margin-top: 20px;
}

.archive-box,
.coming-soon-box {
  background: var(--card);
  border: 2px solid #ffffff;
  padding: 24px;
}

.coming-soon-box {
  text-align: center;
  padding: 48px 24px;
}

.archive-box h2 {
  margin-top: 0;
}

.archive-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.archive-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.archive-list li:last-child {
  border-bottom: none;
}

.archive-list a {
  text-decoration: none;
  color: var(--yellow);
  font-weight: 700;
  font-size: 1rem;
}

.archive-list a:hover {
  text-decoration: underline;
}

.archive-date {
  color: var(--muted);
  font-size: 0.88rem;
}

footer {
  text-align: center;
  color: #e2e8f0;
  font-size: 0.85rem;
  padding: 24px 16px 40px;
}

/* Forum Styles */
main.forum-main {
  width: 100%;
  max-width: 929px;
  margin: 22px auto;
  padding: 0 16px;
}

.forum-auth-bar,
.forum-breadcrumbs,
.forum-toolbar {
  background: var(--card);
  border: 2px solid #ffffff;
  padding: 10px 16px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.forum-breadcrumbs {
  justify-content: flex-start;
  font-size: 0.9rem;
  font-weight: 700;
}

.forum-breadcrumbs a {
  color: var(--yellow);
  text-decoration: none;
}

.forum-breadcrumbs a:hover {
  text-decoration: underline;
}

.forum-toolbar h2 {
  margin: 0;
  font-size: 1.25rem;
}

.forum-box {
  background: var(--card);
  border: 2px solid #ffffff;
  padding: 18px;
}

.forum-box h3 {
  margin-top: 0;
}

.forum-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 2px solid #ffffff;
}

.forum-table th {
  background: var(--border);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 2px solid #ffffff;
  font-size: 0.9rem;
}

.forum-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  vertical-align: middle;
}

.forum-table tr:nth-child(even) td {
  background: var(--card-alt);
}

.forum-cat-link,
.forum-thread-link {
  color: var(--yellow);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
}

.forum-cat-link:hover,
.forum-thread-link:hover {
  text-decoration: underline;
}

.forum-cat-desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 2px;
}

.num-col {
  width: 80px;
  text-align: center !important;
  font-weight: 700;
}

.author-col {
  width: 150px;
}

.date-col {
  width: 185px;
  font-size: 0.85rem;
  color: var(--muted);
}

.empty-row {
  text-align: center;
  padding: 24px !important;
  color: var(--muted);
}

/* Thread Posts */
.forum-post {
  display: grid;
  grid-template-columns: 170px 1fr;
  background: var(--card);
  border: 2px solid #ffffff;
  margin-bottom: 14px;
}

@media (max-width: 650px) {
  .forum-post {
    grid-template-columns: 1fr;
  }
}

.post-sidebar {
  background: var(--card-alt);
  padding: 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.35);
}

.post-author {
  font-weight: 700;
  font-size: 1rem;
  color: var(--yellow);
  margin-bottom: 4px;
}

.post-main {
  padding: 14px 16px;
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--muted);
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.post-body {
  font-size: 0.95rem;
  line-height: 1.6;
  word-break: break-word;
}

/* Forms & Buttons */
.form-row {
  margin-bottom: 12px;
}

.form-row label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.form-row input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #ffffff;
  background: #173a58;
  color: #ffffff;
  font-family: inherit;
  font-size: 1.05rem;
}

.form-row textarea {
  width: 100%;
  min-height: 220px;
  padding: 12px 14px;
  border: 2px solid #ffffff;
  background: #173a58;
  color: #ffffff;
  font-family: inherit;
  font-size: 1.05rem;
  line-height: 1.5;
  resize: vertical;
}

.form-actions {
  display: flex;
  gap: 10px;
}

.btn-yellow {
  background: var(--yellow);
  color: #111827;
  border: 2px solid var(--yellow-border);
  padding: 6px 14px;
  font-weight: 700;
  font-size: 0.88rem;
  border-radius: 4px;
  cursor: pointer;
}

.btn-yellow:hover {
  background: var(--yellow-hover);
}

.btn-secondary {
  background: var(--card-alt);
  color: #ffffff;
  border: 2px solid #ffffff;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 0.88rem;
  border-radius: 4px;
  cursor: pointer;
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-delete {
  background: #dc2626;
  color: #ffffff;
  border: 1px solid #ffffff;
  padding: 2px 8px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 3px;
  cursor: pointer;
  margin-left: 8px;
}

.admin-badge {
  background: var(--yellow);
  color: #111827;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
}

.member-badge {
  font-size: 0.8rem;
  color: var(--muted);
}

.forum-error {
  color: #fca5a5;
  font-weight: 700;
  margin: 0 0 10px;
}

.muted-hint {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Mobile Forum Stacked Rows */
@media (max-width: 650px) {
  .forum-table,
  .forum-table tbody,
  .forum-table tr,
  .forum-table td {
    display: block;
    width: 100%;
  }

  .forum-table thead {
    display: none;
  }

  .forum-table tr {
    border-bottom: 2px solid #ffffff;
    padding: 12px 14px;
  }

  .forum-table tr:last-child {
    border-bottom: none;
  }

  .forum-table td {
    border: none;
    padding: 4px 0;
    text-align: left !important;
    width: 100% !important;
  }

  /* Category Index Mobile Labels */
  .forum-table td:nth-child(2)::before {
    content: "Topics: ";
    color: var(--muted);
    font-weight: 400;
  }

  .forum-table td:nth-child(3)::before {
    content: "Posts: ";
    color: var(--muted);
    font-weight: 400;
  }

  .forum-table td:nth-child(4)::before {
    content: "Last Activity: ";
    color: var(--muted);
    font-weight: 400;
  }

  /* Topic List Inside a Category Mobile Labels */
  .forum-table td.author-col::before {
    content: "Author: ";
    color: var(--muted);
    font-weight: 400;
  }

  .forum-table td.author-col + td.num-col::before {
    content: "Replies: ";
    color: var(--muted);
    font-weight: 400;
  }

  .forum-table td.author-col + td.num-col + td.date-col::before {
    content: "Last Post: ";
    color: var(--muted);
    font-weight: 400;
  }

  .forum-table td.empty-row::before {
    content: none !important;
  }
}

