/* ==========================================================================
   MansionWiki — Habbo pre-beta UI × Wikipedia layout
   Three independent top blocks, working article pages
   ========================================================================== */

@font-face {
  font-family: 'Volter';
  src: url('fonts/Volter.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Volter';
  src: url('fonts/Volter_bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

:root {
  --habbo-blue: #003366;
  --habbo-blue-light: #004d99;
  --habbo-blue-dark: #002244;
  --habbo-orange: #ff6600;
  --habbo-orange-dark: #cc5200;
  --habbo-gold: #f2c94c;
  --habbo-light: #6fb5ff;
  --bg: #f6f6f6;
  --card: #ffffff;
  --text: #202122;
  --text-muted: #6b7280;
  --text-faint: #999;
  --border: #a7d2df;
  --border-light: #c8ccd1;
  --link: #0645ad;
  --link-visited: #0b0080;
  --link-red: #d33;
  --font-pixel: 'Volter', 'Courier New', monospace;
  --font-body: 'Volter', Georgia, 'Times New Roman', serif;
  --font-mono: 'Courier New', monospace;
}

* {
  box-sizing: border-box;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
}

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

/* ==========================================================================
   TOP AREA — three items in a row, zero visual grouping
   ========================================================================== */

.top-area {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px 16px 6px;
}

/* Site name: top-left */
.site-name-block {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.site-name-title {
  font-family: var(--font-pixel);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  line-height: 1.2;
}
.site-name-title:hover { text-decoration: none; }
.site-name-title:visited { color: var(--text); }

.site-name-sub {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Search: centered */
.search-block {
  flex: 1;
  max-width: 360px;
  margin-top: 4px;
}

.search-block__row {
  display: flex;
}

.search-block__input {
  flex: 1;
  height: 28px;
  padding: 0 8px;
  border: 1px solid silver;
  border-right: none;
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--text);
  outline: none;
  background: #fff;
}
.search-block__input:focus {
  border-color: var(--habbo-orange);
}

.search-block__btn {
  height: 28px;
  padding: 0 14px;
  background: var(--habbo-blue);
  border: 1px solid var(--habbo-blue);
  font-family: var(--font-pixel);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
}
.search-block__btn:hover {
  background: var(--habbo-blue-light);
}

/* Personal tools: top-right */
.personal-tools {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  font-family: var(--font-pixel);
  font-size: 10px;
  padding: 6px 0 0;
}
.personal-tools a {
  color: var(--link);
  text-decoration: none;
}
.personal-tools a:hover { text-decoration: underline; }
.personal-tools a:visited { color: var(--link); }
.personal-tools--bold { font-weight: 700; }

/* ==========================================================================
   CONTENT TABS
   ========================================================================== */

.content-tabs {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  padding: 0 16px 0;
  background: var(--bg);
}

.content-tabs__left,
.content-tabs__right {
  display: flex;
  gap: 0;
}

.content-tabs__tab {
  display: inline-block;
  padding: 6px 12px;
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--link);
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-bottom: none;
  margin-bottom: -1px;
  text-decoration: none;
  position: relative;
  top: 1px;
}
.content-tabs__tab:hover {
  text-decoration: none;
  background: #fff;
}
.content-tabs__tab--active {
  background: #fff;
  border-color: var(--border-light);
  color: var(--text);
  font-weight: 700;
  border-bottom: 1px solid #fff;
}
.content-tabs__tab--active-sub {
  background: #fff;
  border-color: var(--border-light);
  border-bottom: 1px solid #fff;
}

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

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
  display: grid;
  grid-template-columns: 176px 1fr;
  gap: 0;
  flex: 1;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */

.sidebar {
  border-right: 1px solid var(--border-light);
  padding: 12px 8px 12px 16px;
  font-family: var(--font-pixel);
  background: var(--bg);
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100vh;
  overflow-y: auto;
}

.sidebar__section { margin-bottom: 16px; }

.sidebar__heading {
  font-family: var(--font-pixel);
  font-size: 11px;
  font-weight: 700;
  color: var(--habbo-blue);
  text-transform: uppercase;
  margin-bottom: 4px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--border);
}

.sidebar__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar__list-item { margin: 0; padding: 0; }

.sidebar__list-item a {
  display: block;
  padding: 2px 0 2px 8px;
  font-size: 11px;
  color: var(--link);
  text-decoration: none;
  border-left: 3px solid transparent;
}
.sidebar__list-item a:hover { text-decoration: underline; }
.sidebar__list-item a:visited { color: var(--link); }

.sidebar__list-item--active a {
  color: var(--text);
  font-weight: 700;
  border-left-color: var(--habbo-orange);
  background: rgba(255,102,0,0.06);
}

.sidebar__stats { padding-left: 8px; }
.sidebar__stat {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.8;
}

/* ==========================================================================
   MAIN CONTENT
   ========================================================================== */

.main {
  min-width: 0;
  padding: 12px 16px 40px;
  background: #fff;
}

/* Page title */
.page-title {
  font-family: var(--font-pixel);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-light);
  line-height: 1.3;
}

/* Site notice */
.sitenotice {
  font-family: var(--font-pixel);
  font-size: 11px;
  background: #fff3cd;
  border: 1px solid var(--habbo-gold);
  padding: 8px 12px;
  margin-bottom: 14px;
  line-height: 1.6;
}

/* Search Info */
.search-info {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Article content box */
.article-content {
  border: 1px solid var(--border-light);
  margin-bottom: 14px;
}

.article-content__heading {
  font-family: var(--font-pixel);
  font-size: 11px;
  font-weight: 700;
  color: var(--habbo-blue);
  text-transform: uppercase;
  padding: 6px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
}

/* Featured article on home */
.featured-article {
  padding: 12px;
}

.featured-article__title {
  font-family: var(--font-pixel);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}
.featured-article__title a { color: var(--link); }

.featured-article__meta {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.featured-article__desc {
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 8px;
}

.featured-article__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.stat-badge {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border-light);
  padding: 2px 6px;
}

.featured-article__link {
  font-family: var(--font-pixel);
  font-size: 10px;
}

/* Recent changes */
.recent-list { display: flex; flex-direction: column; }

.recent-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-bottom: 1px dotted var(--border-light);
}
.recent-entry:last-child { border-bottom: none; }

.recent-entry__icon { font-size: 14px; flex-shrink: 0; }

.recent-entry__body { flex: 1; min-width: 0; }

.recent-entry__title { font-size: 12px; font-weight: 700; }
.recent-entry__title a { color: var(--link); }

.recent-entry__diff {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #006400;
  font-weight: 700;
  margin-left: 4px;
}

.recent-entry__meta {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--text-faint);
  margin-top: 1px;
}

/* Random article */
.random-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
}

.random-card__icon { font-size: 24px; flex-shrink: 0; line-height: 1; }

.random-card__info { flex: 1; min-width: 0; }

.random-card__title {
  font-family: var(--font-pixel);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 3px;
}
.random-card__title a { color: var(--link); }

.random-card__desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 6px;
}

.random-card__tags { display: flex; flex-wrap: wrap; gap: 4px; }

.tag {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--text-faint);
  background: var(--bg);
  border: 1px solid var(--border-light);
  padding: 1px 5px;
}

.section__more {
  padding: 6px 12px;
  border-top: 1px solid var(--border-light);
  font-family: var(--font-pixel);
  font-size: 10px;
}

/* ==========================================================================
   ARTICLE PAGE VIEW
   ========================================================================== */

.article-page {}

.article-page__title {
  font-family: var(--font-pixel);
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-light);
}

.article-page__catlinks {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding: 4px 8px;
  background: var(--bg);
  border: 1px solid var(--border-light);
}
.article-page__catlinks a { color: var(--link); }

.article-page__body {
  font-size: 14px;
  line-height: 1.7;
}

.article-page__body p {
  margin: 0 0 12px;
}
.article-page__body sup.ref {
  font-size: 0.75em;
  line-height: 1;
}
.article-page__body sup.ref a {
  text-decoration: none;
  color: var(--link);
}

/* Infobox */
.article-page__infobox {
  float: right;
  width: 220px;
  margin: 0 0 12px 16px;
  border: 1px solid var(--border-light);
  background: var(--bg);
  font-size: 12px;
  clear: right;
}

.article-page__infobox-title {
  background: var(--habbo-blue);
  color: #fff;
  font-family: var(--font-pixel);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 8px;
  text-align: center;
}

.article-page__infobox-row {
  padding: 4px 8px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  gap: 6px;
}
.article-page__infobox-row:last-child { border-bottom: none; }
.article-page__infobox-row .ib-label {
  color: var(--text-muted);
  font-weight: 700;
  font-family: var(--font-pixel);
  font-size: 10px;
  min-width: 60px;
}
.article-page__infobox-row .ib-value {
  font-family: var(--font-pixel);
  font-size: 10px;
}

/* Article sections */
.article-page__section {
  margin-top: 16px;
  overflow: hidden;
}

.article-page__section h2 {
  font-family: var(--font-pixel);
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 8px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--border-light);
  scroll-margin-top: 16px;
}

.article-page__section p {
  margin: 0 0 10px;
}

.article-page__list {
  margin: 0 0 10px;
  padding: 0 0 0 24px;
}
.article-page__list li {
  margin-bottom: 3px;
  line-height: 1.6;
}
.article-page__list a {
  color: var(--link);
}

.alt-code-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-pixel);
  font-size: 11px;
  margin: 8px 0 12px;
}
.alt-code-table th {
  background: var(--habbo-blue);
  color: #fff;
  padding: 5px 8px;
  text-align: left;
  font-weight: 700;
}
.alt-code-table td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--border-light);
}
.alt-code-table tr:nth-child(even) td {
  background: var(--bg-card);
}

/* Footer of article */
.article-page__footer {
  margin-top: 20px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--text-faint);
  display: flex;
  gap: 6px;
}

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

.footer {
  background: var(--habbo-blue);
  border-top: 3px solid var(--habbo-orange);
  margin-top: auto;
}

.footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 16px;
  text-align: center;
}

.footer__info {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--habbo-light);
  margin-bottom: 6px;
}

.footer__links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 6px;
}
.footer__links a {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--habbo-light);
  text-decoration: none;
}
.footer__links a:hover { color: #fff; text-decoration: underline; }
.footer__links a:visited { color: var(--habbo-light); }

.footer__copy {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--habbo-light);
  opacity: 0.7;
  margin-bottom: 4px;
}

.footer__bottom {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--habbo-light);
  opacity: 0.5;
}

/* ==========================================================================
   SELECTION
   ========================================================================== */

::selection {
  background: var(--habbo-orange);
  color: #fff;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
  .page { grid-template-columns: 1fr; }
  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    padding: 12px 16px;
  }
  .top-area {
    flex-wrap: wrap;
    gap: 8px;
  }
  .search-block { order: 3; flex-basis: 100%; max-width: none; }
  .personal-tools { font-size: 9px; gap: 6px; }
  .content-tabs { overflow-x: auto; }
  .article-page__infobox { float: none; width: 100%; margin: 0 0 12px; }
}
