/* ==========================================================================
   פורטל החברים · app shell
   Builds on assets/css/misadanim.css (tokens and components live there)
   ========================================================================== */

.app-body { background: var(--paper); }

.app { display: flex; align-items: stretch; min-height: 100vh; }

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */

.app-sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  flex: 0 0 264px;
  width: 264px;
  height: 100vh;
  overflow-y: auto;
  border-radius: 0;
  border-left: var(--bw-thick) solid var(--ink);
  z-index: 30;
}

.sidenav-head { text-decoration: none; }
.sidenav-head:hover { text-decoration: none; }

.app-nav { display: flex; flex-direction: column; gap: 6px; }
.app-nav .sidenav-item { text-decoration: none; }
.app-nav .sidenav-item:hover { text-decoration: none; }

.app-logout {
  align-self: flex-start;
  padding: 9px 4px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--on-ink-3);
  text-decoration: none;
}
.app-logout:hover { color: var(--yellow); text-decoration: none; }

/* --------------------------------------------------------------------------
   Main column
   -------------------------------------------------------------------------- */

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 30px;
  background: rgba(247, 244, 236, .93);
  backdrop-filter: blur(8px);
  border-bottom: var(--bw) solid var(--ink);
}
.app-topbar .search-bar { flex: 1; min-width: 0; max-width: 520px; }
.app-topbar-actions { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }

.app-burger {
  display: none;
  padding: 8px 12px;
  font-size: 18px;
  line-height: 1;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: var(--r-sm);
  cursor: pointer;
}

.app-content {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 30px;
  animation: riseIn .25s ease both;
}

.app-scrim { display: none; }

/* --------------------------------------------------------------------------
   Notifications dropdown
   -------------------------------------------------------------------------- */

.notif { position: relative; }
.notif > summary { cursor: pointer; list-style: none; }
.notif > summary::-webkit-details-marker { display: none; }

.notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 40;
  width: min(360px, calc(100vw - 40px));
  gap: 4px;
  box-shadow: var(--shadow);
}

.notif-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  border: 1.5px solid transparent;
}
.notif-item:hover { background: var(--paper); text-decoration: none; }
.notif-item.is-unread { background: var(--paper); border-color: var(--line); }
.notif-title { font-family: var(--font-display); font-weight: 900; font-size: 14.5px; }
.notif-body  { font-size: 13.5px; color: var(--text-2); }
.notif-time  { font-size: 12.5px; font-weight: 700; color: var(--text-4); }

/* --------------------------------------------------------------------------
   Page furniture
   -------------------------------------------------------------------------- */

.page-head { display: flex; flex-direction: column; gap: 6px; }
.page-head--split {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.chip-row .chip { text-decoration: none; }
.chip-row .chip:hover { text-decoration: none; }

.empty-state { gap: 10px; }

.toast-stack {
  position: fixed;
  bottom: 26px;
  left: 26px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast-stack .toast--live { position: static; }

/* --------------------------------------------------------------------------
   Feed
   -------------------------------------------------------------------------- */

.feed-hero { align-items: stretch; }
.feed-hero .pinned h2 { margin: 0; }

/* --------------------------------------------------------------------------
   Article and thread
   -------------------------------------------------------------------------- */

.article-column { display: flex; flex-direction: column; gap: 18px; max-width: 860px; }
.article-title { font-size: clamp(28px, 4vw, 38px); }

.attachments {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 13px;
}
.attachment {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  background: var(--white);
  border: 1.5px solid var(--ink);
  border-radius: 10px;
}

.reply-card { gap: 10px; box-shadow: var(--shadow-sm); }
.avatar--ink { background: var(--ink); color: var(--yellow); }

/* --------------------------------------------------------------------------
   Community
   -------------------------------------------------------------------------- */

.community-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 18px;
  align-items: start;
}
.community-cats { gap: 8px; }

.forum-cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--on-ink);
  text-decoration: none;
  border: 1.5px solid transparent;
}
.forum-cat:hover { background: rgba(255,201,0,.14); color: var(--on-ink); text-decoration: none; }
.forum-cat.is-active { background: var(--yellow); color: var(--ink); border-color: var(--ink); }
.forum-cat-count { font-size: 12.5px; font-weight: 800; color: var(--on-ink-3); }
.forum-cat.is-active .forum-cat-count { color: var(--ink); }

.new-thread { gap: 4px; }
.new-thread .input-group { margin-bottom: 8px; }

select.input-field { cursor: pointer; }

/* Compact field that fits inside a data-table row */
.input-field--sm {
  width: auto;
  padding: 7px 10px;
  font-size: 13.5px;
  border-radius: var(--r-sm);
}

/* --------------------------------------------------------------------------
   Profile
   -------------------------------------------------------------------------- */

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr);
  gap: 18px;
  align-items: start;
}
.profile-card { gap: 18px; }
.profile-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }

.restaurant-photo {
  display: grid;
  place-items: center;
  flex: 0 0 88px;
  width: 88px;
  height: 88px;
  border-radius: var(--r-lg);
  border: var(--bw) solid var(--ink);
  background-image: repeating-linear-gradient(45deg, #e9e2d3 0 7px, var(--paper) 7px 14px);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  text-align: center;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 0 16px;
}

.activity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--on-ink);
  background: rgba(255,255,255,.06);
  border: 1.5px solid rgba(255,255,255,.14);
  border-radius: 11px;
}
.activity-value { font-family: var(--font-display); font-weight: 900; font-size: 19px; color: var(--yellow); }

.activity-row--paper {
  color: var(--text-2);
  background: var(--paper);
  border-color: var(--line);
}

/* --------------------------------------------------------------------------
   Admin
   -------------------------------------------------------------------------- */

.invite-form { gap: 4px; }
.invite-list { gap: 12px; max-width: 760px; }

.invite-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 20px;
  background: var(--white);
  border: var(--bw) solid var(--ink);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.past-events { opacity: .72; }

/* --------------------------------------------------------------------------
   Login
   -------------------------------------------------------------------------- */

.login-body { background: var(--ink); }

.login-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  min-height: 100vh;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
  padding: 64px 72px;
  background: var(--paper);
  border-left: var(--bw-thick) solid var(--ink);
}

.login-side {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 26px;
  padding: 56px;
  background: var(--ink);
  overflow: hidden;
}
.login-side::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(135deg, rgba(255,201,0,.09) 0 12px, transparent 12px 26px);
}
.login-side > * { position: relative; }
.login-side p { max-width: 380px; font-size: 17px; line-height: 1.6; color: #e8e2d6; }

.login-form { max-width: 440px; gap: 12px; }
.login-form .input-label { font-size: 14px; }

.code-sent { padding: 11px 14px; font-family: var(--font-body); font-size: 14.5px; font-weight: 600; border-width: 2px; }

.dev-code {
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--on-ink);
  background: var(--ink);
  border: 2px solid var(--yellow);
  border-radius: 11px;
}
.dev-code strong { font-family: var(--font-mono); font-size: 18px; color: var(--yellow); letter-spacing: 2px; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .community-grid, .profile-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .app-sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    transform: translateX(100%);
    transition: transform .2s ease;
  }
  .nav-toggle:checked ~ .app-sidebar { transform: none; }
  .nav-toggle:checked ~ .app-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 28;
    background: rgba(18,18,18,.45);
  }
  .app-burger { display: inline-block; }
  .app-topbar { padding: 12px 16px; gap: 10px; }
  .app-topbar .search-bar { order: 3; flex: 1 0 100%; max-width: none; }
  .app-content { padding: 20px 16px; }
  .login-panel { padding: 40px 24px; border-left: none; border-bottom: var(--bw-thick) solid var(--ink); }
  .login-side { padding: 36px 24px; }
  .toast-stack { left: 14px; right: 14px; bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .app-content, .app-sidebar { animation: none; transition: none; }
}
