/* ===== מסנן הפרספקטיבה — עיצוב רגוע, אנטי-פאניקה ===== */
:root {
  --bg: #f4f7f5;
  --bg-soft: #ffffff;
  --ink: #21302b;
  --ink-soft: #5b6b64;
  --line: #e2ebe6;
  --accent: #3a8a6d;       /* ירוק רגוע */
  --accent-soft: #e8f4ee;
  --optimistic: #2f9e6f;
  --neutral: #4a7a96;
  --bottom: #b9842f;
  --shadow: 0 1px 3px rgba(33, 48, 43, .06), 0 6px 24px rgba(33, 48, 43, .05);
  --radius: 16px;
}

/* ===== מצב לילה ===== */
[data-theme="dark"] {
  --bg: #111714;
  --bg-soft: #1a2420;
  --ink: #e8efea;
  --ink-soft: #9db0a7;
  --line: #2a3a33;
  --accent: #5cc198;
  --accent-soft: #1d322a;
  --optimistic: #4fd0a0;
  --neutral: #7fb0cc;
  --bottom: #e0a64e;
  --shadow: 0 1px 3px rgba(0, 0, 0, .3), 0 6px 24px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Heebo", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(960px, 92vw); margin-inline: auto; }

/* ===== Header ===== */
.site-header {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(8px);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 0; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .leaf { font-size: 34px; line-height: 1; }
.brand h1 { margin: 0; font-size: 1.4rem; font-weight: 800; letter-spacing: -.5px; }
.tagline { margin: 2px 0 0; font-size: .82rem; color: var(--ink-soft); font-weight: 400; }

.status-bar { display: flex; align-items: center; gap: 10px; }
.badge {
  font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); white-space: nowrap;
}
.badge.sample { background: color-mix(in srgb, #c47d1a 18%, var(--bg-soft)); color: #c47d1a; }
.badge.partial { background: color-mix(in srgb, #3f6bb0 16%, var(--bg-soft)); color: var(--neutral); }
.updated { font-size: .74rem; color: var(--ink-soft); }
.icon-btn {
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--ink-soft);
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 1rem;
  transition: transform .4s ease, color .2s, border-color .2s; line-height: 1;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Filters ===== */
.filters { background: var(--bg); padding-top: 18px; }
.perspective-switch {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  background: var(--accent-soft); padding: 6px; border-radius: var(--radius);
  border: 1px solid var(--line);
}
.persp {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  border: none; background: transparent; cursor: pointer; padding: 9px 6px;
  border-radius: 12px; color: var(--ink-soft); transition: all .18s ease;
  font-family: inherit;
}
.persp:hover { background: color-mix(in srgb, var(--bg-soft) 60%, transparent); }
.persp.active { background: var(--bg-soft); color: var(--ink); box-shadow: var(--shadow); }
.persp-emoji { font-size: 1.15rem; }
.persp-name { font-weight: 700; font-size: .92rem; }
.persp-desc { font-size: .68rem; color: var(--ink-soft); }

.sub-filters {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 14px; flex-wrap: wrap;
}
.sub-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--ink-soft);
  padding: 5px 13px; border-radius: 999px; cursor: pointer; font-size: .82rem;
  font-family: inherit; transition: all .15s;
}
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.calm-toggle {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: .82rem; color: var(--ink-soft); user-select: none;
  border: 1px solid var(--line); background: var(--bg-soft);
  padding: 5px 12px; border-radius: 999px; transition: all .15s;
}
.calm-toggle:hover { border-color: var(--accent); }
.calm-toggle input { accent-color: var(--accent); margin: 0; }

.search-box input {
  border: 1px solid var(--line); background: var(--bg-soft); border-radius: 999px;
  padding: 7px 16px; font-size: .85rem; font-family: inherit; width: 200px; max-width: 50vw;
  color: var(--ink);
}
.search-box input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

/* ===== Feed ===== */
.result-meta { color: var(--ink-soft); font-size: .8rem; margin: 18px 0 8px; }
.feed { display: flex; flex-direction: column; gap: 14px; padding-bottom: 30px; }

.card {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow);
  animation: rise .35s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.card-top {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  font-size: .76rem; color: var(--ink-soft); flex-wrap: wrap;
}
.card-source { font-weight: 700; color: var(--accent); }
.card-cat {
  background: var(--accent-soft); color: var(--accent); padding: 1px 9px;
  border-radius: 999px; font-size: .7rem; font-weight: 500;
}
.card-time { margin-inline-start: auto; }

.card-title {
  font-size: 1.12rem; font-weight: 700; line-height: 1.45; margin: 0 0 8px;
  color: var(--ink);
}
.card-title a { color: inherit; text-decoration: none; }
.card-title a:hover { color: var(--accent); }

.card-body { font-size: .95rem; color: var(--ink); }
.card-body p { margin: 0; }

/* פרספקטיבה אופטימית */
.opt-framing {
  display: flex; gap: 8px; align-items: flex-start;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 12px; padding: 10px 13px;
  font-size: .88rem; color: var(--optimistic); margin-top: 6px;
}
.opt-framing .ico { font-size: 1rem; }
.opt-highlights { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.opt-highlights li {
  position: relative; padding-inline-start: 22px; font-size: .92rem; color: var(--ink);
}
.opt-highlights li::before {
  content: "🌱"; position: absolute; inset-inline-start: 0; top: 1px; font-size: .85rem;
}

/* נקודת טון (anti-panic) */
.tone-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.tone-uplift { background: var(--optimistic); }
.tone-heavy { background: #d98a8a; }
.tone-neutral { background: var(--ink-soft); opacity: .45; }

/* מספר מקורות (קיבוץ כפילויות) */
.card-sources {
  background: color-mix(in srgb, var(--neutral) 16%, var(--bg-soft));
  color: var(--neutral); padding: 1px 8px; border-radius: 999px;
  font-size: .7rem; font-weight: 600;
}

/* פרספקטיבה שורה תחתונה */
.bottom-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bottom-lines li {
  position: relative; padding-inline-start: 26px; font-size: .95rem; line-height: 1.5;
}
.bottom-lines li .num {
  position: absolute; inset-inline-start: 0; top: 0;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--bottom); color: #fff; font-size: .7rem; font-weight: 700;
  display: grid; place-items: center;
}

.card-actions {
  display: flex; align-items: center; gap: 14px; margin-top: 12px; flex-wrap: wrap;
}
.read-more {
  font-size: .82rem; color: var(--accent); text-decoration: none; font-weight: 500;
}
.read-more:hover { text-decoration: underline; }
.share-btn {
  border: none; background: none; cursor: pointer; font-family: inherit;
  font-size: .82rem; color: var(--ink-soft); padding: 0; transition: color .15s;
}
.share-btn:hover { color: var(--accent); }

/* ===== Skeleton loading ===== */
.card.skeleton { pointer-events: none; }
.sk-line {
  height: 13px; border-radius: 7px; margin: 9px 0;
  background: linear-gradient(90deg, var(--line) 25%, color-mix(in srgb, var(--line) 50%, var(--bg-soft)) 50%, var(--line) 75%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite;
}
.sk-top { width: 40%; height: 10px; }
.sk-title { width: 75%; height: 20px; margin-bottom: 14px; }
.sk-short { width: 55%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sk-line { animation: none; } }

/* tinted accents per perspective on card border */
.feed.view-neutral .card { border-inline-start: 3px solid var(--neutral); }
.feed.view-optimistic .card { border-inline-start: 3px solid var(--optimistic); }
.feed.view-bottomLine .card { border-inline-start: 3px solid var(--bottom); }
.feed.view-original .card { border-inline-start: 3px solid var(--line); }

/* ===== States ===== */
.loading, .empty {
  text-align: center; color: var(--ink-soft); padding: 40px 0; font-size: .95rem;
}
.hidden { display: none; }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--line); background: var(--bg-soft); margin-top: 20px;
  padding: 24px 0; color: var(--ink-soft); font-size: .78rem;
}
.sources-line { margin-top: 8px; opacity: .8; }

@media (max-width: 560px) {
  .persp-desc { display: none; }
  .brand h1 { font-size: 1.15rem; }
  .tagline { font-size: .74rem; }
  .search-box input { width: 100%; }
  .sub-filters { flex-direction: column; align-items: stretch; }
}
