/* ========== RESET & BASE ========== */
* { box-sizing: border-box; }

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: 'Heebo', sans-serif;
  background: #f8fafc;
  color: #0f172a;
}

/* ========== APP LAYOUT ========== */
.app--sidebar {
  display: flex;
  min-height: 100vh;
}

/* ========== SIDEBAR (DESKTOP) ========== */
.sidebar {
  width: 260px;
  background: #ffffff;
  border-left: 1px solid #e5e7eb;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  margin-bottom: 32px;
}

.sidebar__brand img {
  width: 36px;
  height: 36px;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar__link {
  padding: 10px 14px;
  border-radius: 10px;
  color: #475569;
  text-decoration: none;
  font-weight: 600;
}

.sidebar__link.is-active,
.sidebar__link:hover {
  background: #eef1ff;
  color: #2563eb;
}

.sidebar__account {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar__account a {
  font-weight: 600;
  text-decoration: none;
}

.sidebar__account .primary {
  background: #2563eb;
  color: #fff;
  padding: 10px;
  border-radius: 10px;
  text-align: center;
}

/* ========== MAIN CONTENT ========== */
.main-content {
  flex: 1;
  margin-right: 260px; /* מקום ל-sidebar */
  padding: 32px 20px;
}

.content-inner {
  max-width: 1200px;
  margin: 0 auto;
}

/* ========== HERO ========== */
.hero {
  background: #ffffff;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 32px;
}

.hero p {
  margin: 0;
  color: #475569;
}

/* ========== SECTIONS ========== */
.section-title {
  margin: 40px 0 16px;
  font-size: 18px;
  font-weight: 800;
}

/* ========== HOT TERMS ========== */
.cards-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
}

.term-card {
  min-width: 200px;
  background: #ffffff;
  padding: 16px;
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(0,0,0,.06);
  text-decoration: none;
  color: inherit;
}

.term-card span {
  display: block;
  margin-top: 6px;
  color: #2563eb;
  font-size: 14px;
}

/* ========== CATEGORIES ========== */
.category-carousel {
  display: flex;
  gap: 20px;
  overflow-x: auto;
}

.category-card {
  min-width: 200px;
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,.06);
  text-decoration: none;
  color: inherit;
}

.category-card img {
  width: 100%;
  height: 130px;
  object-fit: cover;
}

.category-card .content {
  padding: 12px;
  font-weight: 700;
}

/* ========== MOBILE TOPBAR ========== */
.mobile-topbar {
  display: none;
}

/* Hamburger */
.hamburger {
  width: 32px;
  height: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}

.hamburger span {
  height: 3px;
  background: #0f172a;
  border-radius: 2px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {

  /* Sidebar hidden by default */
  .sidebar {
    transform: translateX(100%);
    transition: transform .3s ease;
  }

  /* Toggle sidebar */
  #menu-toggle:checked ~ .app--sidebar .sidebar {
    transform: translateX(0);
  }

  /* Main content full width */
  .main-content {
    margin-right: 0;
    padding-top: 72px;
  }

  /* Mobile topbar */
  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: 56px;
    padding: 0 16px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    z-index: 1100;
  }

  .mobile-title {
    font-weight: 800;
  }
}

/* ========== FOOTER ========== */
.footer {
  display: none;
}

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

.term-page {
  background: #ffffff;
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 10px 30px rgba(15,23,42,.08);
  margin-bottom: 48px;
}

/* Header */

.term-header h1 {
  margin: 0 0 12px;
  font-size: 40px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.5px;
}

.term-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  color: #64748b;
}

.term-meta a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 700;
}

.term-meta a:hover {
  text-decoration: underline;
}

/* Body */

.term-body {
  margin-top: 32px;
  font-size: 18px;
  line-height: 1.9;
}

/* Definition */

.term-definition {
  background: #f8fafc;
  border-radius: 18px;
  padding: 24px 28px;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px #e5e7eb;
}

/* Example */

.term-example {
  margin: 28px 0 0;
  padding: 20px 28px;
  background: linear-gradient(135deg, #eef2ff, #f0f9ff);
  border-radius: 18px;
  font-style: italic;
  font-weight: 600;
  color: #1e293b;
  position: relative;
}

.term-example::before {
  content: "“";
  position: absolute;
  top: -20px;
  right: 20px;
  font-size: 80px;
  color: rgba(37,99,235,.15);
  font-weight: 900;
}

/* Tags */

.term-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.term-tags .tag {
  background: #eef2ff;
  color: #3730a3;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

/* =========================
   RELATED TERMS
========================= */

.related-terms {
  margin-top: 56px;
}

.related-terms h2 {
  margin-bottom: 20px;
  font-size: 22px;
  font-weight: 900;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.related-card {
  background: #ffffff;
  padding: 20px;
  border-radius: 18px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 6px 20px rgba(15,23,42,.08);
  transition: transform .15s ease, box-shadow .15s ease;
}

.related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(15,23,42,.14);
}

.related-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 17px;
  font-weight: 900;
}

.related-card span {
  font-size: 14px;
  color: #475569;
}

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

@media (max-width: 640px) {
  .term-page {
    padding: 24px;
    border-radius: 20px;
  }

  .term-header h1 {
    font-size: 30px;
  }

  .term-body {
    font-size: 16px;
  }
}

.term-actions {
  margin-top: 16px;
}

.share-btn {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
}

.term-votes {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
}

.term-votes button {
  border: none;
  background: #f1f5f9;
  padding: 10px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
}

.vote-score {
  font-weight: 900;
  font-size: 18px;
}

.category-carousel-section {
  margin-top: 64px;
}

.category-carousel-section h2 {
  margin-bottom: 16px;
  font-size: 22px;
  font-weight: 900;
}

/* Votes */
.term-votes {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
  justify-content: flex-start;
}

.term-votes .vote {
  border: none;
  background: #f1f5f9;
  padding: 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 18px;
  transition: transform .12s ease, background .12s ease;
}

.term-votes .vote:hover {
  transform: translateY(-2px);
  background: #e2e8f0;
}

.vote-score {
  font-weight: 900;
  font-size: 18px;
  min-width: 34px;
  text-align: center;
}

/* Letters row */
.letters-row {
  margin-top: 56px;
}

.letters-row h2 {
  margin-bottom: 16px;
  font-size: 22px;
  font-weight: 900;
}

.letters-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.letter-pill {
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(0,0,0,.06);
  border-radius: 999px;
  padding: 10px 14px;
  text-decoration: none;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
}

.letter-pill:hover {
  background: #eef2ff;
  color: #2563eb;
}

/* Category section title spacing */
.category-carousel-section {
  margin-top: 56px;
}

.category-carousel-section h2 {
  margin-bottom: 16px;
  font-size: 22px;
  font-weight: 900;
}

/* =========================
   LETTERS PORTAL
========================= */

/* Hero */
.letters-hero {
  background: linear-gradient(135deg, #eef2ff, #f8fafc);
  border-radius: 28px;
  padding: 48px 32px;
  margin-bottom: 32px;
}

.letters-hero h1 {
  margin: 0 0 8px;
  font-size: 42px;
  font-weight: 900;
}

.letters-hero h1 span {
  color: #2563eb;
}

.letters-hero p {
  margin: 0;
  font-size: 18px;
  color: #475569;
  font-weight: 600;
}

/* Letters Row */
.letters-row {
  margin-bottom: 32px;
}

.letters-list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.letter-pill {
  background: #ffffff;
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 900;
  text-decoration: none;
  color: #0f172a;
  box-shadow: 0 4px 14px rgba(0,0,0,.06);
  white-space: nowrap;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}

.letter-pill:hover {
  background: #eef2ff;
  color: #2563eb;
  transform: translateY(-2px);
}

.letter-pill.is-active {
  background: #2563eb;
  color: #ffffff;
}

/* Portal Grid */
.letters-portal {
  margin-top: 24px;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.portal-card {
  background: #ffffff;
  border-radius: 22px;
  padding: 22px 24px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 8px 26px rgba(15,23,42,.08);
  transition: transform .18s ease, box-shadow .18s ease;
}

.portal-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(15,23,42,.14);
}

.portal-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 900;
}

.portal-card p {
  margin: 0;
  font-size: 14px;
  color: #475569;
  line-height: 1.6;
}

/* Empty */
.empty-state {
  font-size: 16px;
  color: #64748b;
  font-weight: 700;
}

/* Mobile */
@media (max-width: 640px) {
  .letters-hero {
    padding: 32px 20px;
  }

  .letters-hero h1 {
    font-size: 32px;
  }

  .portal-card {
    padding: 18px;
  }
}

/* =========================
   CATEGORY PORTAL
========================= */

/* Hero */
.category-hero {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  margin-bottom: 40px;
  min-height: 220px;
  display: flex;
  align-items: flex-end;
}

.category-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: saturate(1.05);
}

.category-hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(15,23,42,0.65),
    rgba(15,23,42,0.15)
  );
}

.category-hero-content {
  position: relative;
  padding: 32px;
  color: #fff;
}

.category-hero-content h1 {
  margin: 0 0 6px;
  font-size: 40px;
  font-weight: 900;
}

.category-hero-content p {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  opacity: 0.9;
}

/* Letter Sections */
.category-letter-section {
  margin-bottom: 56px;
}

.category-letter {
  font-size: 28px;
  font-weight: 900;
  margin: 0 0 20px;
  color: #2563eb;
}

/* Empty */
.empty-state {
  font-size: 16px;
  font-weight: 700;
  color: #64748b;
}

/* Mobile */
@media (max-width: 640px) {
  .category-hero-content {
    padding: 24px;
  }

  .category-hero-content h1 {
    font-size: 30px;
  }

  .category-letter {
    font-size: 24px;
  }
}

/* =========================
   CATEGORIES PORTAL
========================= */

.categories-hero {
  background: linear-gradient(135deg, #eef2ff, #f8fafc);
  border-radius: 28px;
  padding: 48px 32px;
  margin-bottom: 40px;
}

.categories-hero h1 {
  margin: 0 0 8px;
  font-size: 42px;
  font-weight: 900;
}

.categories-hero p {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #475569;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.category-portal-card {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  min-height: 180px;
  box-shadow: 0 10px 30px rgba(15,23,42,.12);
  transition: transform .2s ease, box-shadow .2s ease;
}

.category-portal-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 44px rgba(15,23,42,.18);
}

.category-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.category-card-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(15,23,42,.7),
    rgba(15,23,42,.2)
  );
}

.category-card-content {
  position: relative;
  padding: 24px;
}

.category-card-content h3 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 900;
}

.category-card-content span {
  font-size: 14px;
  font-weight: 700;
  opacity: 0.9;
}

/* =========================
   CATEGORY PAGE (INNER)
========================= */

.category-hero {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  margin-bottom: 40px;
  min-height: 220px;
  display: flex;
  align-items: flex-end;
}

.category-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.category-hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(15,23,42,.65),
    rgba(15,23,42,.15)
  );
}

.category-hero-content {
  position: relative;
  padding: 32px;
  color: #fff;
}

.category-hero-content h1 {
  margin: 0 0 6px;
  font-size: 40px;
  font-weight: 900;
}

.category-hero-content p {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  opacity: 0.9;
}

.category-letter-section {
  margin-bottom: 56px;
}

.category-letter {
  font-size: 28px;
  font-weight: 900;
  margin: 0 0 20px;
  color: #2563eb;
}

/* Mobile */
@media (max-width: 640px) {
  .categories-hero,
  .category-hero-content {
    padding: 24px;
  }

  .categories-hero h1 {
    font-size: 32px;
  }

  .category-hero-content h1 {
    font-size: 30px;
  }
}

/* =========================
   DISCOVER
========================= */

.discover-section {
  margin-top: 48px;
}

/* Contributors */
.user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.user-card {
  background: #ffffff;
  padding: 16px;
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(0,0,0,.06);
  text-align: center;
}

.user-card strong {
  display: block;
  font-weight: 900;
}

.user-card span {
  font-size: 13px;
  color: #64748b;
}

/* Masonry-style grid */
.discover-masonry {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.discover-block {
  background: #ffffff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(15,23,42,.08);
}

.discover-block h3 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 900;
}

.discover-block a {
  display: block;
  padding: 6px 0;
  text-decoration: none;
  color: #0f172a;
  font-weight: 600;
}

.discover-block a small {
  color: #64748b;
  font-weight: 700;
  margin-right: 6px;
}

/* Variants */
.discover-block.hot { border-top: 4px solid #ef4444; }
.discover-block.cold { border-top: 4px solid #38bdf8; }
.discover-block.new { border-top: 4px solid #22c55e; }
.discover-block.random { border-top: 4px solid #a855f7; }

/* Responsive */
@media (max-width: 900px){
  .discover-masonry{ display:none; } /* לא שימושי כרגע אצלך – ומשבש במובייל */
}

/* ===== DISCOVER HERO ===== */
.discover-hero {
  background: #fff;
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
  margin-bottom: 32px;
}

.discover-hero h1 {
  margin: 0 0 10px;
  font-size: 34px;
  font-weight: 900;
    color: #ffffff;
}

.discover-hero p {
  margin: 0 0 16px;
  color: #ffffff;
}

.hero-link {
  font-weight: 800;
  color: #2563eb;
  text-decoration: none;
}

/* ===== TWO COL ===== */
.discover-two-col {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 24px;
  margin-top: 48px;
}

.hot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px,1fr));
  gap: 16px;
}

.hot-card {
  background: #fff;
  padding: 16px;
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(0,0,0,.06);
  text-decoration: none;
  color: inherit;
}

.hot-card span {
  display: block;
  margin-top: 6px;
  color: #16a34a;
  font-weight: 800;
}

/* Contributors */
.contributors {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 4px 14px rgba(0,0,0,.06);
}

.contributors h3 {
  margin-top: 0;
}

.contributor {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 6px 0;
}

/* ===== THREE COL ===== */
.discover-three-col {
  margin-top: 56px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
}

.discover-list {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 4px 14px rgba(0,0,0,.06);
}

.discover-list a {
  display: flex;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
  padding: 6px 0;
  font-weight: 600;
}

.discover-list .pos { color: #16a34a; }
.discover-list .neg { color: #dc2626; }

.discover-ad {
  background: #f1f5f9;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #64748b;
}

/* Responsive */
@media (max-width: 900px) {
  .discover-two-col,
  .discover-three-col {
    grid-template-columns: 1fr;
  }
}
/* =====================================================
   MOBILE MENU OVERLAY
===================================================== */

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.45);
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

/* כשהתפריט פתוח – overlay פעיל */
#menu-toggle:checked ~ .menu-overlay {
  opacity: 1;
  pointer-events: auto;
}

/* =====================================================
   CAROUSEL – NO SCROLLBAR
===================================================== */

.cards-row,
.category-carousel,
.letters-list {
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* IE/Edge */
}

.cards-row::-webkit-scrollbar,
.category-carousel::-webkit-scrollbar,
.letters-list::-webkit-scrollbar {
  display: none;                  /* Chrome/Safari */
}

/* שמירה על swipe */
.cards-row,
.category-carousel,
.letters-list {
  scroll-behavior: smooth;
}

/* =====================================================
   MOBILE MENU Z-INDEX SAFETY
===================================================== */

@media (max-width: 900px) {
  .sidebar {
    z-index: 1200;
  }
}

/* =====================================================
   FIX PACK (MOBILE + CAROUSELS) — ADDED SAFELY
   - no breaking changes
===================================================== */

/* Flex overflow guard (prevents side-spill on mobile) */
.app--sidebar,
.main-content,
.content-inner {
  min-width: 0;
}

.main-content {
  width: 100%;
}

.content-inner {
  width: 100%;
}

/* Make media never overflow */
img, video, iframe, svg {
  max-width: 100%;
  height: auto;
}

/* Carousels: keep swipe working on iOS/Android + prevent shrinking */
.cards-row,
.category-carousel,
.letters-list {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
}

.cards-row > *,
.category-carousel > *,
.letters-list > * {
  flex: 0 0 auto;
}

/* Mobile topbar: prevent layout drift */
@media (max-width: 900px) {
  .mobile-topbar {
    box-sizing: border-box;
    width: 100%;
  }

  .hamburger { flex: 0 0 auto; }

  /* soften big paddings on small screens to avoid perceived "broken" layout */
  .hero,
  .discover-hero {
    padding: 28px 20px;
  }
  .letters-hero,
  .categories-hero {
    padding: 32px 20px;
  }

  /* ensure cards don't push sideways */
  .term-card { min-width: 180px; }
  .category-card { min-width: 180px; }
}

/* Overlay as label support (works even without JS) */
label.menu-overlay { cursor: pointer; }

/* Compatibility: if overlay remains a <div>, keep it clickable */
.menu-overlay{ -webkit-tap-highlight-color: transparent; }

/* =====================================================
   MOBILE SIDEBAR CLOSE BUTTON (CSS-ONLY)
===================================================== */
.sidebar__close {
  display: none;
}

@media (max-width: 900px) {
  .sidebar__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #f1f5f9;
    color: #0f172a;
    font-weight: 900;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    position: absolute;
    top: 12px;
    left: 12px; /* RTL: close button on left; hamburger is on right */
    z-index: 1300;
    user-select: none;
  }

  /* When menu open, prevent background scroll (JS also toggles .menu-open but this is extra safety) */
  body.menu-open {
    overflow: hidden;
  }
}
/* =====================================================
   CAROUSEL FIX – MOBILE + RTL
===================================================== */

.cards-row,
.category-carousel,
.letters-list {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: scroll;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
}

/* חשוב: לא לחסום גלילה פנימית */
@media (max-width: 900px) {
  body {
    overflow-x: hidden;
  }

  .cards-row,
  .category-carousel,
  .letters-list {
    overflow-x: scroll !important;
  }
}
/* =========================
   AUTH PAGES (LOGIN / REGISTER)
========================= */

.auth-wrapper {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.auth-card {
  background: #ffffff;
  width: 100%;
  max-width: 420px;
  border-radius: 24px;
  padding: 36px 32px;
  box-shadow: 0 20px 50px rgba(15,23,42,.12);
}

.auth-card h1 {
  margin: 0 0 8px;
  font-size: 32px;
  font-weight: 900;
  text-align: center;
}

.auth-card p.subtitle {
  margin: 0 0 28px;
  text-align: center;
  color: #475569;
  font-weight: 600;
}

/* Form */

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  font-size: 15px;
  font-family: inherit;
}

.auth-form input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.auth-form button.primary {
  margin-top: 6px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 14px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 16px;
  cursor: pointer;
}

.auth-form button.primary:hover {
  background: #1d4ed8;
}

/* Divider */

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 700;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

/* Google button (disabled) */

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f1f5f9;
  color: #64748b;
  font-weight: 800;
  cursor: not-allowed;
  opacity: 0.7;
}

.google-btn img {
  width: 18px;
  height: 18px;
}

/* Footer links */

.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}

.auth-footer a {
  color: #2563eb;
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* Error */

.auth-error {
  background: #fee2e2;
  color: #991b1b;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 16px;
  text-align: center;
}

/* Mobile */

@media (max-width: 640px) {
  .auth-card {
    padding: 28px 22px;
  }

  .auth-card h1 {
    font-size: 26px;
  }
}
/* =========================
   AUTH PAGES (LOGIN / REGISTER)
========================= */

.auth-wrapper {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 24px;
  padding: 36px 32px;
  box-shadow: 0 12px 40px rgba(15,23,42,.12);
}

.auth-card h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 900;
  text-align: center;
}

.auth-card p.subtitle {
  margin: 0 0 24px;
  text-align: center;
  color: #64748b;
  font-weight: 600;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  font-size: 15px;
  font-family: inherit;
}

.auth-form input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.auth-form button {
  margin-top: 6px;
  padding: 14px;
  border-radius: 14px;
  border: none;
  font-weight: 900;
  cursor: pointer;
  font-size: 15px;
}

.auth-form .primary {
  background: #2563eb;
  color: #ffffff;
}

.auth-form .primary:hover {
  background: #1e40af;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: #94a3b8;
  font-weight: 800;
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

/* Google button (disabled) */
.google-btn {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  color: #94a3b8;
  font-weight: 900;
  cursor: not-allowed;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.google-btn span {
  font-size: 13px;
  font-weight: 800;
}

/* Auth footer */
.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #64748b;
}

.auth-footer a {
  color: #2563eb;
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* Mobile safety */
@media (max-width: 900px) {
  .auth-wrapper {
    padding-top: 80px;
  }
}
/* =========================
   AUTH PAGES (LOGIN / REGISTER)
========================= */

.auth-wrapper {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 24px;
  padding: 32px 28px;
  box-shadow: 0 12px 36px rgba(15,23,42,.12);
}

.auth-card h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 900;
  text-align: center;
}

.auth-card p.subtitle {
  margin: 0 0 24px;
  text-align: center;
  color: #64748b;
  font-weight: 600;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form input {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  font-size: 15px;
  font-family: inherit;
}

.auth-form input:focus {
  outline: none;
  border-color: #2563eb;
}

.auth-form button.primary {
  margin-top: 8px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 14px;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
}

.auth-form button.primary:hover {
  background: #1e40af;
}

/* Google (disabled) */

.google-btn {
  margin-top: 14px;
  background: #f1f5f9;
  color: #64748b;
  border: 1px dashed #cbd5f5;
  padding: 14px;
  border-radius: 999px;
  font-weight: 800;
  cursor: not-allowed;
  text-align: center;
}

/* Footer link */

.auth-footer {
  margin-top: 18px;
  text-align: center;
  font-size: 14px;
}

.auth-footer a {
  color: #2563eb;
  font-weight: 800;
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* Mobile */
@media (max-width: 640px) {
  .auth-card {
    padding: 26px 22px;
  }
}
/* =========================
   AUTH PAGES
========================= */

.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 80px);
  padding: 40px 16px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  padding: 32px;
  border-radius: 24px;
  box-shadow: 0 12px 36px rgba(15,23,42,.12);
  text-align: center;
}

.auth-card h1 {
  margin-bottom: 24px;
  font-size: 28px;
  font-weight: 900;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form input {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  font-size: 15px;
}

.auth-form input:focus {
  outline: none;
  border-color: #2563eb;
}

.auth-error {
  background: #fee2e2;
  color: #991b1b;
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-weight: 700;
}

.auth-divider {
  margin: 24px 0;
  font-weight: 800;
  color: #64748b;
}

.btn.google {
  background: #e5e7eb;
  color: #475569;
}

.btn.google.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-footer {
  margin-top: 20px;
  font-size: 14px;
}

.auth-footer a {
  font-weight: 800;
  color: #2563eb;
  text-decoration: none;
}
/* =========================
   AUTH PAGES (LOGIN / REGISTER)
========================= */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

/* במחשב – להשאיר מקום לסיידבר */
@media (min-width: 901px) {
  .auth-page {
    margin-right: 260px;
  }
}

/* במובייל – בלי offset */
@media (max-width: 900px) {
  .auth-page {
    margin-right: 0;
    padding-top: 96px; /* מתחת לטופבר */
  }
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 24px;
  padding: 36px 32px;
  box-shadow: 0 20px 50px rgba(15,23,42,.12);
}

.auth-card h1 {
  margin: 0 0 24px;
  font-size: 32px;
  font-weight: 900;
  text-align: center;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form input {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  font-size: 15px;
  font-family: inherit;
}

.auth-form input:focus {
  outline: none;
  border-color: #2563eb;
}

.auth-form button {
  margin-top: 8px;
}

.auth-divider {
  margin: 24px 0;
  text-align: center;
  font-weight: 700;
  color: #64748b;
}

.btn.google {
  background: #f1f5f9;
  color: #475569;
  font-weight: 800;
}

.btn.google.disabled {
  opacity: .6;
  cursor: not-allowed;
}

.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}

.auth-footer a {
  color: #2563eb;
  text-decoration: none;
}

/* =========================
   AUTH PAGES (LOGIN / REGISTER)
========================= */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

/* Desktop – leave room for sidebar */
@media (min-width: 901px) {
  .auth-page {
    margin-right: 260px;
  }
}

/* Mobile */
@media (max-width: 900px) {
  .auth-page {
    margin-right: 0;
    padding-top: 96px;
  }
}
/* USER MENU */
.user-menu {
  position: relative;
}

.user-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 800;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.user-badge {
  background: #2563eb;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 999px;
}

.user-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 110%;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,.12);
  padding: 8px 0;
  min-width: 180px;
  z-index: 2000;
}

.user-dropdown a {
  display: block;
  padding: 10px 16px;
  text-decoration: none;
  color: #0f172a;
  font-weight: 700;
}

.user-dropdown a:hover {
  background: #eef2ff;
  color: #2563eb;
}

.user-dropdown hr {
  margin: 6px 0;
  border: none;
  border-top: 1px solid #e5e7eb;
}

/* Desktop hover */
@media (min-width: 901px) {
  .user-menu:hover .user-dropdown {
    display: block;
  }
}
/* =========================
   USER DROPDOWN (DESKTOP)
========================= */

.user-menu {
  position: relative;
}

.user-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f1f5f9;
  border: none;
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 800;
  cursor: pointer;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.user-badge {
  background: #e0e7ff;
  color: #3730a3;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  margin-right: auto;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(15,23,42,.18);
  padding: 8px;
  min-width: 200px;
  display: none;
  z-index: 2000;
}

.user-dropdown a {
  display: block;
  padding: 10px 12px;
  text-decoration: none;
  color: #0f172a;
  font-weight: 700;
  border-radius: 10px;
}

.user-dropdown a:hover {
  background: #eef2ff;
}

.user-dropdown hr {
  border: none;
  height: 1px;
  background: #e5e7eb;
  margin: 6px 0;
}

/* visible */
.user-menu.is-open .user-dropdown {
  display: block;
}

/* Mobile – no dropdown */
@media (max-width: 900px) {
  .user-dropdown {
    position: static;
    display: block;
    box-shadow: none;
    padding: 0;
    background: transparent;
  }

  .user-trigger {
    display: none;
  }
}
/* =========================
   USER MENU DROPDOWN (FIX)
========================= */

.user-menu {
  position: relative;
}

/* dropdown סגור כברירת מחדל */
.user-dropdown {
  position: absolute;
  right: 0;
  bottom: 100%;              /* 👈 נפתח למעלה */
  margin-bottom: 12px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(15,23,42,.18);
  padding: 8px 0;
  min-width: 200px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .15s ease, transform .15s ease;
  z-index: 2000;
}

/* מצב פתוח */
.user-menu.is-open .user-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* קישורים */
.user-dropdown a {
  display: block;
  padding: 10px 16px;
  font-weight: 700;
  text-decoration: none;
  color: #0f172a;
  white-space: nowrap;
}

.user-dropdown a:hover {
  background: #f1f5f9;
}

.user-dropdown hr {
  margin: 6px 0;
  border: none;
  border-top: 1px solid #e5e7eb;
}

/* מובייל – בלי dropdown */
@media (max-width: 900px) {
  .user-dropdown {
    position: static;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    box-shadow: none;
    background: transparent;
    padding: 0;
  }
}
/* =========================
   USER BOX (SIDEBAR)
========================= */

.user-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: #e5e7eb;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-info strong {
  font-weight: 900;
  font-size: 15px;
}

.user-badge {
  font-size: 12px;
  color: #2563eb;
  font-weight: 800;
}

.user-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.user-links a {
  font-weight: 700;
  text-decoration: none;
  color: #475569;
  padding: 6px 10px;
  border-radius: 8px;
}

.user-links a:hover {
  background: #eef2ff;
  color: #2563eb;
}

.user-links .danger {
  color: #dc2626;
}
/* Contributors – row style */
.contributor-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  text-decoration: none;
  color: inherit;
}

.contributor-row:hover {
  opacity: 0.85;
}

.contributor-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #e5e7eb;
}

.contributor-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.contributor-meta strong {
  font-weight: 900;
  font-size: 14px;
}

.contributor-meta span {
  font-size: 13px;
  color: #64748b;
}
.term-form {
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.term-form label {
  font-weight: 800;
  font-size: 14px;
}

.term-form input,
.term-form textarea,
.term-form select {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  font-family: inherit;
}

.term-form textarea {
  resize: vertical;
}

.auth-success {
  background: #dcfce7;
  color: #166534;
  padding: 12px;
  border-radius: 12px;
  font-weight: 800;
  margin-bottom: 16px;
}
/* =========================
   SUBMIT – CATEGORY PICKER
========================= */

.categories-picker {
  margin-top: 12px;
}

.picker-title {
  display: block;
  margin-bottom: 10px;
  font-weight: 900;
  font-size: 15px;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

/* Chip */
.category-chip {
  position: relative;
  display: block;
  cursor: pointer;
}

.category-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.category-chip span {
  display: block;
  padding: 10px 12px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 800;
  font-size: 14px;
  text-align: center;
  transition: all .15s ease;
  border: 1px solid transparent;
}

/* Hover */
.category-chip:hover span {
  background: #e0e7ff;
}

/* Selected */
.category-chip input:checked + span {
  background: #2563eb;
  color: #ffffff;
  border-color: #1d4ed8;
}

/* Mobile */
@media (max-width: 640px) {
  .categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}
.submit-page {
  max-width: 1200px;
  margin: 0 auto;
}

.submit-header {
  margin-bottom: 32px;
}

.submit-header h1 {
  margin: 0 0 6px;
  font-size: 34px;
  font-weight: 900;
}

.submit-header p {
  color: #64748b;
  font-weight: 700;
}

.submit-form {
  background: #fff;
  padding: 32px;
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(15,23,42,.08);
}

.form-row {
  margin-bottom: 22px;
}

.form-row label {
  display: block;
  margin-bottom: 6px;
  font-weight: 800;
}

.form-row input,
.form-row textarea {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  font-family: inherit;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px,1fr));
  gap: 10px;
}

.category-pill {
  background: #f8fafc;
  border-radius: 999px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 700;
}

.category-pill input {
  accent-color: #2563eb;
}

.submit-success {
  background: #ecfdf5;
  color: #065f46;
  padding: 14px;
  border-radius: 14px;
  font-weight: 800;
  margin-bottom: 20px;
}

.submit-btn {
  margin-top: 12px;
}
/* =========================
   SUBMIT PAGE
========================= */

.submit-page {
  max-width: 1200px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 28px;
  padding: 48px 40px;
  box-shadow: 0 20px 60px rgba(15,23,42,.08);
}

.submit-page h1 {
  margin: 0 0 32px;
  font-size: 36px;
  font-weight: 900;
  text-align: center;
}

.submit-form {
  display: grid;
  gap: 22px;
}

.submit-form label span,
.field-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 800;
  font-size: 14px;
  color: #0f172a;
}

.submit-form input[type="text"],
.submit-form textarea,
.submit-form input[type="file"] {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  font-size: 15px;
  font-family: inherit;
}

.submit-form textarea {
  resize: vertical;
}

/* =========================
   CATEGORY PILLS (NO CHECKBOX UI)
========================= */

.categories-picker {
  margin-top: 6px;
}

.categories-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.category-pill {
  position: relative;
  cursor: pointer;
}

.category-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.category-pill span {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 800;
  font-size: 14px;
  transition: all .15s ease;
  box-shadow: inset 0 0 0 1px #e5e7eb;
}

/* “נדלק” כשנבחר */
.category-pill input:checked + span {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(37,99,235,.25);
}

.category-pill span:hover {
  background: #e0e7ff;
}

/* =========================
   SUBMIT BUTTON + NOTES
========================= */

.submit-btn {
  margin-top: 10px;
  padding: 16px;
  font-size: 16px;
  font-weight: 900;
  border-radius: 999px;
}

.submit-note {
  margin-top: 8px;
  text-align: center;
  font-size: 13px;
  color: #64748b;
  font-weight: 700;
}

.submit-success {
  background: #ecfdf5;
  color: #065f46;
  padding: 14px;
  border-radius: 14px;
  font-weight: 800;
  margin-bottom: 20px;
  text-align: center;
}

/* Mobile */
@media (max-width: 900px) {
  .submit-page {
    padding: 32px 20px;
  }

  .submit-page h1 {
    font-size: 28px;
  }
}
/* =====================================================
   TERM IMAGES + HERO BG (COVER + DARK OVERLAY)
   (להדביק בסוף הקובץ)
===================================================== */

/* HERO עם תמונת רקע */
.discover-hero.has-bg{
  position: relative;
  overflow: hidden;
  min-height: 260px;
  border-radius: 24px;
  background: #0f172a;
}

.discover-hero.has-bg::before{
  content:"";
  position:absolute;
  inset:0;
  background-image: var(--hero-bg);
  background-size: cover;       /* חשוב */
  background-position: center;  /* חשוב */
  background-repeat: no-repeat;
  transform: scale(1.02);
  z-index: 0;
}

/* שכבת החשכה אמיתית */
.discover-hero.has-bg::after{
  content:"";
  position:absolute;
  inset:0;
  background: rgba(15,23,42,.55);
  z-index: 1;
}

.discover-hero__inner{
  position: relative;
  z-index: 2;
  color: #fff;
}

.discover-hero.has-bg h1,
.discover-hero.has-bg p{
  color:#fff;
}

.discover-hero.has-bg .hero-link{
  color:#fff;
  text-decoration: none;
  font-weight: 900;
}

/* תמונה בתוך כרטיס מונח */
.term-card__img{
  width: 100%;
  height: 120px;
  border-radius: 14px;
  background-size: cover;       /* חשוב */
  background-position: center;  /* חשוב */
  background-repeat: no-repeat;
  margin-bottom: 10px;
}

/* תמונה בתוך כרטיס חם */
.hot-card__img{
  width: 100%;
  height: 110px;
  border-radius: 14px;
  background-size: cover;       /* חשוב */
  background-position: center;  /* חשוב */
  background-repeat: no-repeat;
  margin-bottom: 10px;
}

/* תמונת ערך בעמוד הערך עצמו */
.term-hero.has-bg{
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  height: 320px;
  margin-bottom: 18px;
  background: #0f172a;
}

.term-hero.has-bg::before{
  content:"";
  position:absolute;
  inset:0;
  background-image: var(--term-bg);
  background-size: cover;       /* חשוב */
  background-position: center;  /* חשוב */
  background-repeat: no-repeat;
  z-index: 0;
}

.term-hero.has-bg::after{
  content:"";
  position:absolute;
  inset:0;
  background: rgba(15,23,42,.35);
  z-index: 1;
}

/* במובייל - קצת פחות גובה */
@media (max-width: 640px){
  .discover-hero.has-bg{ min-height: 220px; }
  .term-hero.has-bg{ height: 220px; }
}
.hero-row{
  display:grid;
  grid-template-columns: 3fr 1fr;
  gap:24px;
  margin-bottom:32px;
}

.hero--with-bg{
  position:relative;
  min-height:280px;
  background-size:cover;
  background-position:center;
  border-radius:20px;
  overflow:hidden;
}

.hero-overlay{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,0.45);
}

.hero-content{
  position:relative;
  z-index:2;
  color:#fff;
  padding:32px;
  max-width:80%;
}

.hero-hot{
  background:#fff;
  border-radius:16px;
  padding:16px;
  box-shadow:0 6px 18px rgba(0,0,0,.08);
}

.hero-hot-row{
  display:flex;
  justify-content:space-between;
  padding:8px 0;
  text-decoration:none;
  color:#0f172a;
  font-weight:700;
}

.hero-hot-row + .hero-hot-row{
  border-top:1px solid #e5e7eb;
}

@media (max-width: 900px){
  .hero-row{
    grid-template-columns:1fr;
  }
}
.hero-hot-grid {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 24px;
  margin-bottom: 40px;
}

.hero-card {
  position: relative;
  min-height: 340px;
  border-radius: 28px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  text-decoration: none;
  color: #fff;
  box-shadow: 0 14px 40px rgba(15,23,42,.18);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,.55);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 40px;
  max-width: 80%;
}

.hero-content h1 {
  font-size: 36px;
  font-weight: 900;
  margin: 0 0 10px;
}

.hero-content p {
  font-size: 18px;
  opacity: .95;
}

.hot-box {
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
}

.hot-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  text-decoration: none;
  color: inherit;
  font-weight: 700;
}

.hot-row:hover {
  color: #2563eb;
}

.category-bg {
  height: 130px;
  background-size: cover;
  background-position: center;
}
.popular-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:16px;
}

.popular-card{
  height:360px;
  border-radius:16px;
  overflow:hidden;
  position:relative;
  display:flex;
  align-items:flex-end;
}

.popular-card .overlay{
  width:100%;
  padding:16px;
  background:linear-gradient(to top,rgba(0,0,0,.75),transparent);
  color:#fff;
}
.popular-card {
  height: 360px;
  border-radius: 20px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  position: relative;
}

.popular-card::after {
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(
    to top,
    rgba(15,23,42,.7),
    rgba(15,23,42,.15)
  );
}

.popular-card .content {
  position:absolute;
  bottom:0;
  padding:20px;
  color:#fff;
  font-weight:900;
}
/* =========================
   BUTTONS
========================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  font-family: inherit;
  font-size: 15px;
  font-weight: 800;

  padding: 12px 22px;
  border-radius: 999px;

  border: none;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;

  transition:
    background-color .15s ease,
    box-shadow .15s ease,
    transform .1s ease;
}

/* Primary */
.btn.primary {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(37,99,235,.25);
}

.btn.primary:hover {
  background: #1d4ed8;
  box-shadow: 0 10px 24px rgba(37,99,235,.35);
  transform: translateY(-1px);
}

.btn.primary:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(37,99,235,.25);
}

/* Disabled */
.btn:disabled,
.btn.disabled {
  opacity: .6;
  cursor: not-allowed;
  box-shadow: none;
}
/* =========================
   HERO + CONTRIBUTORS ROW
========================= */

.hero-row {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 24px;
  margin-bottom: 40px;
}

/* HERO IMAGE */
.hero--image {
  position: relative;
  min-height: 260px;
  border-radius: 24px;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,0.55);
}

.hero-content {
  position: relative;
  padding: 32px;
  color: #ffffff;
  max-width: 720px;
}

.hero-content h1 {
  margin: 0 0 12px;
  font-size: 34px;
  font-weight: 900;
}

.hero-content p {
  margin: 0 0 16px;
  font-size: 16px;
  line-height: 1.6;
  opacity: 0.95;
}

.hero-meta {
  display: flex;
  gap: 16px;
  font-weight: 800;
  margin-bottom: 16px;
}

/* CONTRIBUTORS NEXT TO HERO */
.hero-contributors {
  background: #ffffff;
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
}

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

@media (max-width: 900px) {

  .hero-row {
    grid-template-columns: 1fr;
  }

  /* hide contributors on mobile */
  .hero-contributors {
    display: none;
  }

  .hero-content {
    padding: 24px;
  }

  .hero-content h1 {
    font-size: 26px;
  }
}
.user-page {
  max-width: 1100px;
  margin: 40px auto;
}

.user-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}

.user-avatar img,
.avatar-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
}

.avatar-placeholder {
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 700;
}

.user-info h1 {
  margin: 0;
}

.user-info .meta {
  color: #777;
  margin-top: 4px;
}

.terms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.term-card {
  display: block;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 12px rgba(0,0,0,.06);
  transition: transform .15s ease, box-shadow .15s ease;
}

.term-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,.1);
}

.term-card__image {
  height: 120px;
  background-size: cover;
  background-position: center;
}

.term-card__image--placeholder {
  background: linear-gradient(135deg, #ddd, #f5f5f5);
}

.term-card__title {
  padding: 12px;
  font-weight: 600;
  text-align: center;
}
/* USER PAGE */

.user-profile-card {
  text-align: center;
  margin: 0 auto 40px;
}

.user-profile-card .user-avatar {
  display: block;
  margin: 0 auto 14px;
}

.terms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  justify-content: center;
}

.term-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 12px rgba(0,0,0,.06);
  transition: transform .15s ease, box-shadow .15s ease;
}

.term-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,.1);
}

.term-card__image {
  height: 120px;
  background-size: cover;
  background-position: center;
}

.term-card__image--placeholder {
  background: linear-gradient(135deg, #ddd, #f5f5f5);
}

.term-card__title {
  padding: 12px;
  font-weight: 600;
  text-align: center;
}
.user-profile-card h1 {
  font-size: 32px;
  font-weight: 800;
  margin: 12px 0 6px;
  text-align: center;
}
.user-profile-card {
  text-align: center;
  margin: 0 auto 40px;
}

.user-profile-card .user-avatar {
  display: block;
  margin: 0 auto 14px;
}

.user-profile-card .meta {
  margin-top: 6px;
  font-size: 15px;
  color: #555;
}

.term-card__stats {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 8px 0 12px;
  font-size: 14px;
  color: #666;
}
/* LETTER SECTIONS */

.letters-sections {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 32px;
}

.letter-section {
  display: flex;
  gap: 20px;
}

.letter-box {
  flex: 0 0 25%;
  background: #f3f3f3;
  border-radius: 16px;
  font-size: 72px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.letter-terms-card {
  flex: 1;
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,.06);
}

.letter-terms-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  columns: 2;
  column-gap: 24px;
}

.letter-terms-list li {
  margin-bottom: 6px;
}

.letter-terms-list a {
  text-decoration: none;
  color: inherit;
}

.all-terms-link {
  display: inline-block;
  margin-top: 8px;
  font-weight: 600;
}
/* RANKINGS */

.rankings-hero {
  text-align: center;
  margin: 40px 0 24px;
}

.rankings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.ranking-card {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 12px rgba(0,0,0,.06);
  transition: transform .15s ease, box-shadow .15s ease;
}

.ranking-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,.1);
}

.ranking-rank {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #111;
  color: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 700;
  font-size: 14px;
}

.ranking-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin-bottom: 10px;
}

.ranking-image {
  width: 100%;
  height: 100px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  margin-bottom: 10px;
}

.ranking-image--placeholder {
  background: linear-gradient(135deg, #ddd, #f5f5f5);
}

.ranking-stats {
  display: flex;
  justify-content: center;
  gap: 14px;
  font-size: 14px;
  color: #555;
}
/* RANKING LIST (ROWS) */

.ranking-list {
  display: grid;
  gap: 12px;
}

.ranking-list.two-cols {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 900px) {
  .ranking-list.two-cols {
    grid-template-columns: 1fr;
  }
}

.ranking-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  transition: background .15s ease, transform .1s ease;
}

.ranking-row:hover {
  background: #f7f7f7;
  transform: translateY(-1px);
}

.ranking-index {
  font-weight: 800;
  width: 28px;
  text-align: center;
  color: #999;
}

.ranking-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.ranking-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
}

.ranking-thumb--placeholder {
  background: linear-gradient(135deg, #ddd, #f5f5f5);
}

.ranking-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ranking-meta {
  font-size: 13px;
  color: #666;
}
/* RANKING LIST – ROWS, NOT COLUMNS */

.ranking-list {
  display: grid;
  gap: 12px;
}

/* Two columns of FULL rows */
.ranking-list.two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .ranking-list.two-cols {
    grid-template-columns: 1fr;
  }
}

.ranking-row {
  display: grid;
  grid-template-columns: 32px 56px 1fr;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  transition: background .15s ease, transform .1s ease;
}

.ranking-row:hover {
  background: #f7f7f7;
  transform: translateY(-1px);
}

.ranking-index {
  font-weight: 800;
  text-align: center;
  color: #999;
}

.ranking-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
}

.ranking-thumb--placeholder {
  background: linear-gradient(135deg, #ddd, #f5f5f5);
}

.ranking-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ranking-meta {
  font-size: 13px;
  color: #666;
}

.ranking-meta a {
  color: inherit;
  text-decoration: underline;
}
/* ===== TERMS RANKING – SIMPLE & CORRECT ===== */

.ranking-terms-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 900px) {
  .ranking-terms-grid {
    grid-template-columns: 1fr;
  }
}

.ranking-term-row {
  display: flex;
  align-items: center;
  gap: 14px;

  background: #fff;
  padding: 12px 16px;
  border-radius: 14px;

  text-decoration: none;
  color: inherit;

  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  transition: background .15s ease, transform .1s ease;
}

.ranking-term-row:hover {
  background: #f6f6f6;
  transform: translateY(-1px);
}

/* IMAGE */

.term-thumb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.term-thumb--placeholder {
  background: linear-gradient(135deg, #ddd, #f3f3f3);
}

/* TEXT */

.term-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.term-title {
  font-weight: 700;
  font-size: 16px;
}

.term-author {
  font-size: 13px;
  color: #666;
}
/* RANK + LIKES */

.term-rank {
  font-weight: 800;
  color: #999;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.term-likes {
  margin-inline-start: auto;
  font-size: 14px;
  font-weight: 600;
  color: #444;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.related-card {
  display: flex;
  gap: 12px;
  background: #fff;
  border-radius: 14px;
  padding: 10px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}

.related-thumb {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.related-thumb--placeholder {
  background: linear-gradient(135deg, #ddd, #f3f3f3);
}

.related-content strong {
  display: block;
  margin-bottom: 4px;
}
