/* =========================================================
   KAISERKY — Classic Imageboard Theme
   4chan-inspired / original implementation
   ========================================================= */

:root {
  --page-bg: #eef2ff;
  --page-bg-alt: #e5e9f5;

  --header-bg: #d6daf0;
  --header-border: #b7bfd9;

  --post-bg: #d6daf0;
  --post-bg-hover: #cfd4e9;

  --thread-bg: #d6daf0;

  --border: #b7bfd9;
  --border-dark: #aaaebe;

  --text: #000;
  --muted: #555;
  --light-muted: #777;

  --link: #0000ee;
  --link-hover: #ff0000;

  --green: #008000;

  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
}

/* =========================================================
   RESET
   ========================================================= */

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  padding: 0;

  color: var(--text);
  background: var(--page-bg);

  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.3;
}

a {
  color: var(--link);
  text-decoration: underline;
}

a:hover {
  color: var(--link-hover);
}

img {
  max-width: 90%;
  display: block;
  margin-left: auto; 
  margin-right: auto;
  border-top: 25px solid #eef2ff;
}

button,
input,
textarea {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
}

/* =========================================================
   HEADER
   ========================================================= */


.site-header {
  align-items: center;
  justify-content: center;
  width: 40%;
  text-align: center;
  border-bottom: 15px solid #eef2ff;
  background: #d6daf0;
  margin: 0 auto;
  border-top: 10px solid #eef2ff;
}
.site-header h1 {
  margin: 0;
  font-size: 28px;
}

.site-header h1 a {
  text-decoration: none;
  color: #000000;
}

.tagline {
  margin: 6px 0 0;
  color: #999;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;

  width: fit-content;
  min-height: 38px;

  margin: 10px auto 5px;
  padding: 5px 10px;

  gap: 12px;

  border: 1px solid #b7bfd9;
  background: #d6daf0;

  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* =========================================================
   LOGO
   ========================================================= */

.brand {
  display: flex;
  align-items: center;

  flex-shrink: 0;

  gap: 6px;

  color: #af0a0a;

  font-size: 18px;
  font-weight: bold;

  text-decoration: none;
}

.brand:hover {
  color: #d00000;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 26px;
  height: 26px;

  border: 1px solid #999;

  background: #eee;

  color: #af0a0a;

  font-size: 15px;
  font-weight: bold;
}

/* =========================================================
   BOARD NAV
   ========================================================= */

.header-nav {
  display: flex;
  align-items: center;

  flex-wrap: wrap;

  gap: 0;
}

.header-nav a {
  display: inline-block;

  padding: 2px 6px;

  color: #0000ee;

  font-size: 12px;

  text-decoration: underline;
}

.header-nav a:hover {
  color: #ff0000;
}

.header-spacer {
  flex: 1;
}

.header-status {
  color: var(--green);

  font-size: 11px;
}

/* =========================================================
   PAGE
   ========================================================= */

.container {
  width: 90%;
  margin: 0 auto;
}

/* =========================================================
   HERO
   ========================================================= */

.hero {
  padding: 10px 0 12px;

  text-align: center;
}

.eyebrow {
  display: none;
}

.hero h1 {
  margin: 4px 0;

  color: #af0a0a;

  font-size: 22px;
  font-weight: bold;
}

.hero p {
  margin: 4px auto;

  max-width: 800px;

  color: #333;

  font-size: 12px;
}

/* =========================================================
   SECTION TITLES
   ========================================================= */

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;

  margin: 10px 0 4px;

  padding: 2px 5px;

  border: 1px solid var(--border);

  background: var(--header-bg);
}

.section-title h2 {
  margin: 0;

  font-size: 13px;
  font-weight: bold;
}

.section-title span {
  color: var(--muted);

  font-size: 11px;
}

/* =========================================================
   BOARD GRID
   ========================================================= */

.board-grid {
  display: flex;

  flex-wrap: wrap;

  gap: 5px;
}

.board-card {
  display: block;

  width: 220px;

  min-height: 75px;

  padding: 7px;

  border: 1px solid var(--border);

  background: var(--post-bg);

  color: #000;

  text-decoration: none;
}

.board-card:hover {
  border-color: #999;

  background: var(--post-bg-hover);

  color: #000;
}

.board-code {
  display: block;

  color: #800000;

  font-family: monospace;
  font-size: 11px;
  font-weight: bold;
}

.board-card strong {
  display: block;

  margin-top: 2px;

  color: #000;

  font-size: 14px;
}

.board-card span:last-child {
  display: block;

  margin-top: 3px;

  color: #555;

  font-size: 11px;

  line-height: 1.25;
}

/* =========================================================
   PANELS
   ========================================================= */

.panel {
  border: 1px solid var(--border);

  border-radius: 0;

  background: var(--post-bg);

  box-shadow: none;
}

/* =========================================================
   THREAD CREATION
   ========================================================= */

.new-thread,
.new-reply {
  margin: 8px auto;

  padding: 8px;

  max-width: 800px;
}

.new-thread h2,
.new-reply h2 {
  margin: 0 0 7px;

  padding-bottom: 4px;

  border-bottom: 1px solid var(--border);

  font-size: 13px;
  font-weight: bold;
}

.form-grid {
  display: grid;

  grid-template-columns: 180px 1fr;

  gap: 5px;
}

label {
  display: block;

  margin-bottom: 6px;

  color: #333;

  font-size: 11px;
  font-weight: bold;
}

input,
textarea {
  display: block;

  width: 100%;

  margin-top: 2px;

  padding: 4px;

  border: 1px solid #aaa;

  border-radius: 0;

  outline: none;

  color: #000;

  background: #fff;

  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

input:focus,
textarea:focus {
  border-color: #777;

  box-shadow: none;
}

textarea {
  min-height: 100px;

  resize: vertical;
}

input[type="file"] {
  padding: 2px;

  background: #fff;
}

.form-actions {
  display: flex;
  align-items: center;

  flex-wrap: wrap;

  gap: 8px;
}

button {
  padding: 3px 10px;

  border: 1px solid #888;

  border-radius: 2px;

  color: #000;

  background: #eee;

  cursor: pointer;

  font-size: 12px;
}

button:hover {
  background: #ddd;

  border-color: #666;
}

button.primary {
  border-color: #777;

  color: #000;

  background: #ddd;

  box-shadow: none;
}

button.primary:hover {
  background: #ccc;

  box-shadow: none;
}

.hint,
.status {
  color: #666;

  font-size: 10px;
}

.error {
  color: #a00 !important;
}

/* =========================================================
   BOARD HEADER
   ========================================================= */

.board-heading {
  margin: 5px 0;

  color: #af0a0a;

  font-size: 20px;
  font-weight: bold;

  text-align: center;
}

.board-description {
  margin: 0;

  color: #444;

  font-size: 11px;

  text-align: center;
}

/* =========================================================
   TOOLBAR
   ========================================================= */

.toolbar {
  display: flex;
  align-items: center;

  min-height: 26px;

  margin: 6px 0;

  padding: 3px 5px;

  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);

  background: var(--header-bg);
}

.toolbar .spacer {
  flex: 1;
}

.toolbar button {
  margin-left: 5px;
}

/* =========================================================
   THREADS
   ========================================================= */

.thread {
  display: block;

  width: fit-content;

  max-width: 100%;

  margin: 3px 0;

  padding: 6px;

  border: 1px solid var(--border);

  border-radius: 0;

  background: var(--post-bg);

  box-shadow: none;
}

.thread:hover {
  border-color: var(--border-dark);

  background: var(--post-bg-hover);
}

/* =========================================================
   POST HEADER
   ========================================================= */

.post-header {
  display: flex;
  align-items: center;

  flex-wrap: wrap;

  gap: 5px;

  margin-bottom: 3px;

  color: #555;

  font-size: 10px;
}

.post-header .subject {
  color: #800000;

  font-size: 13px;
  font-weight: bold;
}

.number {
  color: #0000ee;

  font-weight: normal;
}

.post-header time {
  color: #555;
}

/* =========================================================
   POST BODY
   ========================================================= */

.post-body {
  color: #000;

  font-size: 13px;

  line-height: 1.35;

  overflow-wrap: anywhere;

  white-space: pre-wrap;
}

.post-body a {
  color: #0000ee;
}

/* =========================================================
   POST FOOTER
   ========================================================= */

.post-footer {
  display: flex;

  gap: 10px;

  margin-top: 4px;

  color: #666;

  font-size: 10px;
}

.post-footer a {
  color: #0000ee;
}

/* =========================================================
   IMAGES
   ========================================================= */

.thumb {
  display: block;

  width: auto;

  max-width: 250px;

  max-height: 250px;

  margin: 3px 8px 5px 0;

  border: 1px solid #aaa;

  border-radius: 0;

  background: #eee;

  object-fit: contain;

  cursor: pointer;

  box-shadow: none;
}

.thumb:hover {
  border-color: #666;

  transform: none;
}

/* =========================================================
   INDIVIDUAL POSTS
   ========================================================= */

.post {
  width: fit-content;

  min-width: 400px;

  max-width: 100%;

  margin: 3px 0;

  padding: 6px;

  border: 1px solid var(--border);

  border-radius: 0;

  background: var(--post-bg);

  box-shadow: none;
}

.post.op {
  border-color: var(--border);

  background: var(--post-bg);
}

/* =========================================================
   EMPTY STATE
   ========================================================= */

.empty {
  padding: 25px;

  border: 1px solid var(--border);

  border-radius: 0;

  color: #555;

  background: var(--post-bg);

  text-align: center;
}

/* =========================================================
   PAGINATION
   ========================================================= */

.pagination {
  display: flex;
  justify-content: center;

  gap: 4px;

  margin: 10px 0;
}

.pagination a {
  display: inline-block;

  padding: 3px 7px;

  border: 1px solid #aaa;

  border-radius: 0;

  color: #0000ee;

  background: #eee;

  font-size: 11px;
}

.pagination a:hover {
  color: #ff0000;

  background: #ddd;
}

/* =========================================================
   FOOTER
   ========================================================= */

.site-footer {
  padding: 20px 10px;

  border-top: 1px solid var(--border);

  color: #666;

  background: var(--header-bg);

  text-align: center;

  font-size: 10px;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {
  .header-inner {
    min-height: 38px;

    padding: 4px 6px;
  }

  .brand {
    font-size: 15px;
  }

  .brand-mark {
    width: 23px;
    height: 23px;

    font-size: 12px;
  }

  .header-nav {
    display: none;
  }

  .header-status {
    display: none;
  }

  .container {
    padding: 5px;
  }

  .hero {
    padding: 8px 0;
  }

  .hero h1 {
    font-size: 18px;
  }

  .hero p {
    font-size: 11px;
  }

  .board-grid {
    display: block;
  }

  .board-card {
    width: 100%;

    min-height: auto;

    margin-bottom: 4px;
  }

  .form-grid {
    display: block;
  }

  .new-thread,
  .new-reply {
    width: 100%;

    padding: 6px;
  }

  .thread {
    width: 100%;

    padding: 5px;
  }

  .post {
    width: 100%;

    min-width: 0;

    padding: 5px;
  }

  .thumb {
    max-width: 180px;

    max-height: 180px;
  }

  .post-body {
    font-size: 12px;
  }

  .toolbar {
    font-size: 11px;
  }
}

/* =========================================================
   VERY SMALL SCREENS
   ========================================================= */

@media (max-width: 400px) {
  .form-actions {
    align-items: stretch;

    flex-direction: column;
  }

  .form-actions button {
    width: 100%;
  }

  .hint {
    text-align: center;
  }

  .post-header {
    font-size: 9px;
  }

  .post-header .subject {
    font-size: 12px;
  }
}
