/* ─────────────────────────────────────────────────────────────
   omhood.css — retro lokalisten.de look, responsive + mobile
   signature: all-lowercase ui, green + grey, boxy modules
   ───────────────────────────────────────────────────────────── */
:root {
  --green:        #74991f;
  --green-dark:   #5e7f12;
  --green-darker: #4d6b0e;
  --green-pale:   #eef3dc;
  --grey-side:    #4b4b4b;
  --grey-side-2:  #3e3e3e;
  --grey-mod:     #e5e5e5;
  --grey-border:  #cfcfcf;
  --grey-bg:      #f2f2f2;
  --text:         #333;
  --muted:        #888;
  --orange:       #f7a800;
  --red:          #d44;
}

* { box-sizing: border-box; }
/* always reserve the scrollbar so pages never jump horizontally
   when content height changes (pjax swaps, short pages, modals) */
html { background: var(--grey-bg); -webkit-text-size-adjust: 100%; overflow-y: scroll; scrollbar-gutter: stable; }
body {
  margin: 0;
  font-family: Verdana, Tahoma, "DejaVu Sans", sans-serif;
  font-size: 13px;
  color: var(--text);
  background: var(--grey-bg);
}
a { color: var(--green-darker); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, h4, .module-head, .topnav, .sidenav, .btn, .badge, .tab {
  text-transform: lowercase; /* the lokalisten signature */
}
h1 { font-size: 18px; } h2 { font-size: 16px; } h3 { font-size: 14px; }

/* ── Top bar ─────────────────────────────────────────────── */
.topbar {
  background: linear-gradient(180deg, #87a93b 0%, var(--green) 45%, var(--green-dark) 100%);
  color: #fff;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.topbar-inner {
  max-width: 1060px; margin: 0 auto; padding: 8px 12px;
  display: flex; align-items: center; gap: 12px;
}
.logo { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: bold; font-size: 22px; letter-spacing: -1px; white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo .logo-dot {
  width: 28px; height: 28px; border-radius: 50%;
  background: #fff; color: var(--green-dark);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 900;
}
.logo .claim { font-size: 10px; font-weight: normal; letter-spacing: 0; opacity: .9; display: block; margin-top: -3px; }
.homebase-tag {
  font-size: 12px; color: #fff; background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.35); border-radius: 14px;
  padding: 4px 12px; white-space: nowrap; max-width: 280px;
  overflow: hidden; text-overflow: ellipsis;
}
.homebase-tag:hover { background: rgba(0,0,0,.3); text-decoration: none; }
.homebase-tag .hb-caret { opacity: .7; font-size: 10px; }

.topsearch { margin-left: auto; display: flex; }
.topsearch input {
  border: 1px solid var(--green-dark); border-radius: 3px 0 0 3px;
  padding: 5px 8px; font-size: 12px; width: 150px; outline: none;
}
.topsearch button {
  background: var(--green-darker); color: #fff; border: 1px solid var(--green-darker);
  border-radius: 0 3px 3px 0; padding: 5px 10px; cursor: pointer;
}

/* main nav strip */
.topnav {
  background: var(--green-dark);
  border-top: 1px solid rgba(255,255,255,.25);
}
.topnav-inner {
  max-width: 1060px; margin: 0 auto;
  display: flex; align-items: center; gap: 2px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.topnav-inner::-webkit-scrollbar { display: none; }
.topnav a {
  color: #fff; padding: 8px 13px; font-size: 13px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px;
}
.topnav a:hover, .topnav a.active { background: var(--green-darker); text-decoration: none; }
.badge {
  background: var(--orange); color: #fff; border-radius: 9px;
  font-size: 10px; padding: 1px 6px; font-weight: bold;
}
.badge.red { background: var(--red); }

/* ── Layout ──────────────────────────────────────────────── */
.layout {
  max-width: 1060px; margin: 12px auto; padding: 0 10px;
  display: grid; grid-template-columns: 190px 1fr; gap: 12px;
  align-items: start;
}
.layout.no-side { grid-template-columns: 1fr; }

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar { min-width: 0; }
.sidecard {
  background: var(--grey-side); color: #eee;
  border-radius: 4px; overflow: hidden; margin-bottom: 12px;
}
.sidecard .me {
  padding: 12px; display: flex; gap: 10px; align-items: center;
  background: var(--grey-side-2);
}
.sidecard .me .avatar { border-radius: 3px; border: 2px solid #666; }
.sidecard .me b { color: #fff; font-size: 13px; word-break: break-all; }
.sidecard .me .motto { font-size: 10px; color: #bbb; font-style: italic; }
.sidenav a {
  display: flex; justify-content: space-between; align-items: center;
  color: #ddd; padding: 8px 14px; font-size: 12px;
  border-top: 1px solid #585858;
}
.sidenav a:hover, .sidenav a.active { background: var(--green-dark); color: #fff; text-decoration: none; }

/* ── Content modules ─────────────────────────────────────── */
.content { min-width: 0; }
.module {
  background: #fff; border: 1px solid var(--grey-border);
  border-radius: 4px; margin-bottom: 12px; overflow: hidden;
}
.module-head {
  background: linear-gradient(180deg, #efefef, var(--grey-mod));
  border-bottom: 1px solid var(--grey-border);
  padding: 7px 12px; font-weight: bold; font-size: 12px; color: #555;
  display: flex; justify-content: space-between; align-items: center;
}
.module-head a { font-weight: normal; font-size: 11px; }
.module-body { padding: 12px; }
.module-body.tight { padding: 0; }
.muted { color: var(--muted); font-size: 11px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.cols-37 { display: grid; grid-template-columns: 280px 1fr; gap: 12px; align-items: start; }

/* ── Buttons / forms ─────────────────────────────────────── */
.btn {
  display: inline-block; background: var(--green); color: #fff !important;
  border: 1px solid var(--green-dark); border-radius: 3px;
  padding: 6px 14px; font-size: 12px; font-weight: bold; cursor: pointer;
  font-family: inherit;
}
.btn:hover { background: var(--green-dark); text-decoration: none; }
.btn-grey { background: #999; border-color: #777; }
.btn-grey:hover { background: #777; }
.btn-red { background: var(--red); border-color: #b22; }
.btn-red:hover { background: #b22; }
.btn-sm { padding: 3px 9px; font-size: 11px; }

input[type=text], input[type=email], input[type=password], input[type=date],
input[type=datetime-local], input[type=number], select, textarea {
  width: 100%; padding: 7px 9px; font-size: 13px; font-family: inherit;
  border: 1px solid var(--grey-border); border-radius: 3px;
  background: #fff; color: var(--text);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--green-pale); border-color: var(--green); }
label { display: block; font-size: 11px; color: #666; margin: 10px 0 3px; }
form .hint { font-size: 11px; color: var(--muted); margin-top: 3px; }

.flash { padding: 9px 12px; border-radius: 3px; margin-bottom: 12px; font-size: 12px; }
.flash.ok { background: var(--green-pale); border: 1px solid var(--green); color: #3c5b00; }
.flash.err { background: #fdecec; border: 1px solid var(--red); color: #a22; }

/* ── User cells / lists ──────────────────────────────────── */
.avatar { object-fit: cover; border-radius: 3px; background: #ddd; }
.avatar-link { display: inline-block; line-height: 0; flex-shrink: 0; }
.avatar-link:hover .avatar { outline: 2px solid var(--green); }
.userlink { font-weight: bold; }
.user-row {
  display: flex; gap: 10px; align-items: center;
  padding: 8px 12px; border-bottom: 1px solid #eee;
}
.user-row:last-child { border-bottom: 0; }
.user-row .info { min-width: 0; flex: 1; }
.user-row .info .sub { font-size: 11px; color: var(--muted); }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; margin-right: 4px; }
.offline-dot { width: 8px; height: 8px; border-radius: 50%; background: #ccc; display: inline-block; margin-right: 4px; }

.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; padding: 12px; }
.user-grid .cell { text-align: center; font-size: 11px; }
.user-grid .cell img { width: 100%; aspect-ratio: 1; height: auto; }
.user-grid .cell a { display: block; word-break: break-all; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; padding: 12px; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 3px; }

/* ── Profile page ────────────────────────────────────────── */
.profile-head { display: flex; gap: 14px; padding: 14px; align-items: flex-start; flex-wrap: wrap; }
.profile-head .avatar { width: 130px; height: 130px; }
.profile-head h1 { margin: 0 0 4px; }
.profile-facts { width: 100%; border-collapse: collapse; font-size: 12px; }
.profile-facts td { padding: 5px 12px; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
.profile-facts td:first-child { color: var(--muted); width: 110px; white-space: nowrap; }
.gift-shelf { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; font-size: 22px; }
.gift-shelf span { cursor: default; }

/* ── Comments / guestbook ────────────────────────────────── */
.comment { display: flex; gap: 8px; padding: 8px 12px; border-bottom: 1px solid #f0f0f0; }
.comment-body { font-size: 12px; min-width: 0; flex: 1; }
.comment-form { padding: 10px 12px; display: flex; gap: 8px; align-items: flex-start; }
.comment-form textarea { flex: 1; }

/* ── Messages ────────────────────────────────────────────── */
.msg-bubble { max-width: 75%; padding: 8px 11px; border-radius: 8px; margin-bottom: 8px; font-size: 12px; }
.msg-bubble.mine { background: var(--green-pale); margin-left: auto; border: 1px solid #d6e6ad; }
.msg-bubble.theirs { background: #f4f4f4; border: 1px solid #e4e4e4; }
.msg-bubble .when { font-size: 10px; color: var(--muted); margin-top: 3px; }
.thread-box { max-height: 55vh; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; }

/* ── Chat ────────────────────────────────────────────────── */
.chat-rooms { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 12px; }
.chat-log { height: 50vh; overflow-y: auto; padding: 10px 12px; font-size: 12px; }
.chat-log .line { margin-bottom: 5px; }
.chat-log .who { font-weight: bold; color: var(--green-darker); }
.chat-log .when { color: #bbb; font-size: 10px; }
.chat-input { display: flex; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--grey-border); }

/* ── Events / market / groups lists ──────────────────────── */
.item-row { padding: 10px 12px; border-bottom: 1px solid #eee; }
.item-row:last-child { border-bottom: 0; }
.item-row .title { font-weight: bold; font-size: 13px; }
.item-row .meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.cat-tag {
  display: inline-block; background: var(--grey-mod); border-radius: 3px;
  font-size: 10px; padding: 1px 7px; color: #555; text-transform: lowercase;
}

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--grey-border); background: #efefef; }
.tab { padding: 8px 14px; font-size: 12px; color: #555; }
.tab.active { background: #fff; font-weight: bold; border-bottom: 2px solid var(--green); }
.tab:hover { text-decoration: none; background: #fff; }

.pager { padding: 10px 12px; }

/* ── Landing page ────────────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, #a3cc46, var(--green-dark));
  color: #fff; border-radius: 6px; padding: 36px 26px; margin-bottom: 14px;
}
.hero h1 { font-size: 30px; margin: 0 0 6px; letter-spacing: -1px; }
.hero p { font-size: 14px; max-width: 520px; }
.stats-strip { font-size: 11px; color: var(--muted); text-align: center; padding: 6px 0; }

/* ── Widgets dashboard ───────────────────────────────────── */
.dash { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.feed-line { display: flex; gap: 8px; padding: 7px 12px; border-bottom: 1px solid #f3f3f3; font-size: 12px; align-items: center; }
.feed-line:last-child { border-bottom: 0; }

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  max-width: 1060px; margin: 20px auto; padding: 14px 10px;
  border-top: 1px solid var(--grey-border);
  font-size: 11px; color: var(--muted); text-align: center;
}
.footer a { color: var(--muted); margin: 0 6px; }

/* ── PJAX loading bar ────────────────────────────────────── */
#pjax-bar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: var(--orange); z-index: 999; transition: width .25s ease;
}

/* ── Mobile ──────────────────────────────────────────────── */
.menu-btn {
  display: none; background: none; border: 0; color: #fff;
  font-size: 22px; cursor: pointer; padding: 2px 6px;
}
@media (max-width: 820px) {
  .layout, .cols-37, .dash, .grid-2 { grid-template-columns: 1fr; }
  .menu-btn { display: block; }
  .sidebar {
    display: none; position: fixed; inset: 0; z-index: 100;
    background: rgba(0,0,0,.5); padding: 54px 14px 14px; overflow-y: auto;
  }
  .sidebar.open { display: block; }
  .topsearch input { width: 110px; }
  .homebase-tag { max-width: 150px; font-size: 11px; }
  .profile-head .avatar { width: 96px; height: 96px; }
  .thread-box { max-height: 45vh; }
}
@media (max-width: 480px) {
  body { font-size: 14px; }
  .logo { font-size: 19px; }
  .topsearch { display: none; }
}

/* ── Photo page ──────────────────────────────────────────── */
.photo-stage {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: #1d1d1d; padding: 10px; min-height: 220px;
}
.photo-stage img { max-width: calc(100% - 80px); max-height: 70vh; object-fit: contain; border-radius: 3px; }
.photo-nav {
  color: #fff; font-size: 34px; padding: 4px 12px; border-radius: 4px;
  text-decoration: none; user-select: none;
}
.photo-nav:hover { background: rgba(255,255,255,.15); text-decoration: none; }
.photo-nav.off { opacity: .25; cursor: default; }

/* ── Likes & comment threads ─────────────────────────────── */
.like-btn {
  background: #fff; border: 1px solid var(--grey-border); border-radius: 12px;
  color: #999; font-size: 11px; padding: 2px 10px; cursor: pointer; font-family: inherit;
}
.like-btn:hover { border-color: #e66; color: #e66; }
.like-btn.liked { background: #fdecec; border-color: #e66; color: #d44; font-weight: bold; }
.comment-actions { margin-top: 4px; display: flex; align-items: center; gap: 10px; }
.reply-link { font-size: 11px; color: var(--muted); }
.reply-form textarea { font-size: 12px; }
