/* ==========================================================================
   Horizon Roleplay — tema v3: grått + vitt
   Laddas EFTER horizon.css. Ljust innehåll (vita kort på ljusgrå yta) med
   mörk grafit i topbar, hero och sidfot. Alla klassnamn är oförändrade.
   ========================================================================== */

:root {
  color-scheme: dark;

  --bg: #1c1c1e;
  --bg-2: #161617;
  --surface: #252527;
  --surface-2: #2d2d30;
  --surface-3: #38383c;
  --hover: #2a2a2d;
  --bar: #141415;

  --line: #343437;
  --line-2: #424246;
  --line-3: #58585d;

  --text: #f5f5f6;
  --text-2: #d0d0d4;
  --text-3: #a3a3aa;
  --text-4: #8b8b92;

  --accent: #f5f5f6;
  --accent-hover: #ffffff;
  --accent-ink: #141415;
  --accent-tint: rgba(255, 255, 255, .08);
  --accent-line: rgba(255, 255, 255, .5);

  --ok: #74c493;   --ok-tint: rgba(116, 196, 147, .13);
  --warn: #dfb35f; --warn-tint: rgba(223, 179, 95, .13);
  --bad: #e8776e;  --bad-tint: rgba(232, 119, 110, .13);
  --info: #82aee0; --info-tint: rgba(130, 174, 224, .13);

  --r-xs: 5px; --r-sm: 8px; --r: 12px; --r-lg: 16px;

  --display: 'Archivo', 'Geist', ui-sans-serif, system-ui, sans-serif;
}

html, body { background: var(--bg); }
body { color: var(--text); font-size: 15px; }

h1, h2, h3, h4 { letter-spacing: -.02em; }
h1 { font-family: var(--display); font-weight: 850; font-style: italic; font-stretch: 112%; font-size: clamp(30px, 4vw, 44px); line-height: 1.04; letter-spacing: -.03em; }
h2 { font-family: var(--display); font-weight: 800; font-stretch: 108%; font-size: 21px; }
h3 { font-weight: 700; }

::selection { background: #fff; color: #141415; }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.wrap, .container { width: min(1240px, calc(100% - 56px)); }
.wrap { padding-bottom: 0; }

/* ==========================================================================
   Topbar (mörk, kant i kant)
   ========================================================================== */
.topbar { height: 76px; margin-bottom: 0; }
.topbar::before { background: var(--bar); border-bottom: 1px solid var(--line); backdrop-filter: none; -webkit-backdrop-filter: none; }
.topbar + * { margin-top: 40px; }
.topbar + .home-hero { margin-top: 0; }

.brand { gap: 14px; }
.logo { width: 58px; height: 46px; background: none; border: 0; border-radius: 0; overflow: visible; }
.logo img { object-fit: contain; }
.brand-copy { flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.05; }
.brand-copy b { font-family: var(--display); font-style: italic; font-weight: 850; font-stretch: 118%; font-size: 18px; color: #fff; }
.brand-copy small { margin-top: 3px; color: var(--text-3); font-size: 12px; }

.nav { gap: 4px; }
.nav .btn { height: 40px; padding: 0 16px; color: var(--text-3); background: transparent; border: 0; border-radius: 9px; font-weight: 600; }
.nav .btn:hover { color: #fff; background: var(--surface); }
.nav .btn.active { color: #fff; background: var(--surface-2); }
.nav .btn.primary, .nav .btn.primary.active { margin-left: 10px; padding: 0 22px; color: #141415; background: #fff; font-weight: 700; }
.nav .btn.primary:hover { background: #dcdce0; }
.nav a[href="logout.php"] { border: 1px solid var(--line-3); }

/* ==========================================================================
   Knappar, formulär
   ========================================================================== */
.btn { min-height: 40px; padding: 0 18px; color: var(--text); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 9px; font-weight: 600; }
.btn:hover { background: var(--surface-3); border-color: var(--line-3); }
.btn.primary { color: #141415; background: #fff; border-color: #fff; font-weight: 700; }
.btn.primary:hover { background: #dcdce0; border-color: #dcdce0; }
.btn.small { min-height: 32px; padding: 0 12px; }
.btn.danger { color: var(--bad); background: transparent; border-color: rgba(232,119,110,.4); }
.btn.danger:hover { background: var(--bad-tint); }
.btn.warn { color: var(--warn); background: transparent; border-color: rgba(223,179,95,.4); }

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), textarea, select {
  color: var(--text); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 9px;
}
input[readonly] { background: var(--surface); }
input:focus, textarea:focus, select:focus { border-color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.12); }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a3a3aa' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }

/* ==========================================================================
   Kort
   ========================================================================== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: none; }
.card > .hd {
  min-height: 56px; padding: 14px 22px; background: transparent;
  border-bottom: 1px solid var(--line);
  font-family: var(--display); font-size: 15px; font-weight: 750; font-stretch: 106%; letter-spacing: -.01em;
}
.badge, .small-pill, .home-section-count, .my-notification-type {
  height: 24px; padding: 0 10px; color: var(--text-2); background: var(--surface-3); border: 0; border-radius: 999px; font-weight: 600;
}
.status { font-weight: 600; }


/* ==========================================================================
   Startsidan — hero (kant i kant, mörk, jättestor logga)
   ========================================================================== */
.card.hero.home-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  grid-template-areas: "content logo" "stats stats";
  align-items: center;
  gap: 0;
  padding: 0;
  color: #fff;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  border-bottom: 1px solid var(--line);
}

.home-hero-content { grid-area: content; max-width: none; padding: 64px 0 56px; }
.home-hero h1 { color: #fff; font-size: 22px; font-style: normal; font-weight: 600; font-stretch: 100%; letter-spacing: -.01em; line-height: 1.2; }
.home-hero h1 span {
  display: block; margin-top: 6px; color: #fff;
  font-family: var(--display); font-style: italic; font-weight: 900; font-stretch: 118%;
  font-size: clamp(38px, 5.6vw, 72px); line-height: .98; letter-spacing: -.035em;
}
.home-hero p { max-width: 46ch; margin-top: 24px; color: var(--text-2); font-size: 17px; line-height: 1.55; }
.home-hero .cta { margin-top: 32px; gap: 12px; }
.home-hero .btn { min-height: 48px; padding: 0 26px; color: #fff; background: transparent; border: 1px solid var(--line-3); border-radius: 10px; font-size: 15px; font-weight: 650; }
.home-hero .btn:hover { border-color: #fff; background: var(--surface); }
.home-hero .btn.primary { color: #141415; background: #fff; border-color: #fff; }
.home-hero .btn.primary:hover { background: #dcdce0; border-color: #dcdce0; }

.home-hero-logo { grid-area: logo; display: grid; place-items: center; padding: 40px 0 40px 24px; }
.home-hero-logo img {
  width: 100%; max-width: 520px; height: auto;
  /* Negativ version: vit kontur och svarta ytor mot grafit */
  filter: invert(1);
  user-select: none; -webkit-user-drag: none;
}

.home-hero-stats {
  grid-area: stats; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  border-top: 1px solid var(--line);
}
.home-hero-stats > div { flex-direction: row; align-items: baseline; gap: 12px; padding: 26px 0 28px; }
.home-hero-stats > div + div { padding-left: 32px; border-left: 1px solid var(--line); }
.home-hero-stats b { color: #fff; font-family: var(--display); font-size: 34px; font-weight: 800; font-stretch: 110%; letter-spacing: -.03em; }
.home-hero-stats span { color: var(--text-3); font-size: 15px; font-weight: 500; }

/* ==========================================================================
   Startsidan — forum som rutnät
   ========================================================================== */
.grid.home-layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 36px; margin-top: 44px; }
.home-main { gap: 40px; }

.home-forum-section { overflow: visible; background: none; border: 0; box-shadow: none; border-radius: 0; }
.home-forum-section .section-title {
  min-height: 0; padding: 0 0 14px; background: none; border-bottom: 1px solid var(--line);
  font-family: var(--display); font-weight: 800; font-stretch: 110%; font-size: 22px; letter-spacing: -.02em;
}
.home-forum-section .section-title > span:first-child { padding-left: 0; }
.home-forum-section .section-title > span:first-child::before { display: none; }
.home-forum-section .home-section-count { font-family: var(--font); font-style: normal; font-stretch: 100%; font-size: 13px; font-weight: 650; color: var(--text-3); }

.board-grid.home-board-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }

.board.home-board {
  position: relative; display: flex; flex-direction: column; padding: 22px; min-height: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  transition: background 140ms var(--ease), border-color 140ms var(--ease);
}
.board.home-board:first-child { border-top: 1px solid var(--line); }
.board.home-board:hover { background: var(--surface-2); border-color: var(--line-3); }
.board.home-board:hover h3 { color: #fff; }

.home-board-icon {
  display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 18px;
  color: #fff; background: var(--surface-3); border: 1px solid var(--line-2); border-radius: 10px; font-size: 17px; font-weight: 600;
}
.home-board-content { display: flex; flex-direction: column; flex: 1; gap: 0; }
.board-top { align-items: flex-start; }
.home-board-heading h3 { font-family: var(--display); font-size: 18px; font-weight: 750; font-stretch: 104%; letter-spacing: -.015em; }
.home-board-heading p { margin-top: 4px; color: var(--text-3); font-size: 14px; }
.board-top .small-pill { display: inline-flex; }

.board-meta { margin-top: 16px; gap: 6px 16px; color: var(--text-3); font-size: 13px; }
.board-meta b { color: var(--text); font-weight: 650; }

.home-board-latest { margin-top: auto; align-self: stretch; padding: 14px 0 0; border-left: 0; border-top: 1px solid var(--line); }
.board-meta + .home-board-latest { margin-top: 18px; }
.home-latest-label { color: var(--text-4); font-weight: 650; }
.home-board-latest b { color: var(--text); font-weight: 700; }
.home-no-thread { color: var(--text-4); }

/* Sidokolumn */
.home-sidebar { gap: 20px; }
.home-side-card > .body { padding: 8px; }
.home-staff-item:hover, .home-thread-item:hover { background: var(--hover); }
.home-thread-title-row b { font-weight: 700; }
.home-online-member { background: var(--surface-2); border-color: var(--line); }
.home-online-member:hover { color: #fff; border-color: var(--line-3); }

/* ==========================================================================
   Andra sidor: rubrikrader och statistik
   ========================================================================== */
.board-hero h1, .thread-hero-card h1, .create-thread-hero h1, .members-hero-card h1, .admin-hero h1, .profile-hero-card h1, .my-hero-card h1 {
  font-weight: 850; font-stretch: 112%; letter-spacing: -.03em; font-size: clamp(30px, 4.2vw, 48px);
}
.board-hero, .thread-hero-card, .create-thread-hero, .members-hero-card, .admin-hero.card { padding-bottom: 12px; }
.board-breadcrumbs a:hover, .thread-breadcrumbs a:hover, .create-thread-breadcrumbs a:hover { color: #fff; }
.board-stat-box b, .thread-hero-stats b, .members-hero-stats b, .my-hero-summary b, .admin-summary b {
  font-family: var(--display); font-size: 26px; font-weight: 800; font-stretch: 108%;
}
.my-hero-summary .has-unread b { color: #fff; }

/* Trådlistor / inlägg: tydligare rader på vitt */
.board-thread-item:hover { background: var(--hover); }

/* ==========================================================================
   Sidfot (mörk, kant i kant)
   ========================================================================== */
.site-footer { position: relative; isolation: isolate; align-items: center; margin-top: 72px; padding: 36px 0; border: 0; color: var(--text-3); }
.site-footer::before { content: ""; position: absolute; inset: 0 calc(50% - 50vw); z-index: -1; background: var(--bar); border-top: 1px solid var(--line); }
.site-footer-brand { gap: 14px; color: #fff; font-family: var(--display); font-style: italic; font-weight: 850; font-stretch: 118%; font-size: 17px; }
.site-footer-brand img { width: 52px; height: auto; }
.site-footer-dot { display: none; }
.site-footer-links a:hover { color: #fff; }
.cookie-banner { border-color: var(--line-3); }

/* ==========================================================================
   Responsivt
   ========================================================================== */
@media (max-width: 1040px) {
  .grid.home-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .wrap, .container { width: calc(100% - 32px); }
  .topbar { height: auto; min-height: 64px; flex-wrap: wrap; padding: 10px 0; gap: 8px 16px; }
  .nav { flex-wrap: wrap; }

  .card.hero.home-hero { grid-template-columns: 1fr; grid-template-areas: "logo" "content" "stats"; }
  .home-hero-logo { padding: 36px 0 0; justify-items: start; }
  .home-hero-logo img { max-width: 260px; }
  .home-hero-content { padding: 24px 0 36px; }
  .home-hero-stats > div { flex-direction: column; gap: 0; padding: 18px 0; }
  .home-hero-stats > div + div { padding-left: 16px; }
  .home-hero-stats b { font-size: 28px; }

  .board-grid.home-board-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .board.home-board { transition: none; }
}
