/* =====================================================
   PROJECTS PAGE – archive: search, type filter, list / map
   ===================================================== */

/* ---------- Opening + search (same feel as the About page hero) ---------- */
.p-hero { position: relative; overflow: hidden; padding: calc(var(--header-h) + 70 * var(--s)) 0 calc(70 * var(--s)); background: linear-gradient(180deg, var(--bg) 0%, #dfe6f3 100%); }
.p-hero-inner { position: relative; z-index: 1; display: grid; justify-items: start; text-align: right; }
.p-hero .eyebrow { justify-content: flex-start; }
.p-title { margin-top: calc(24 * var(--s)); font-weight: 400; font-size: max(calc(104 * var(--s)), 42px); line-height: .8; letter-spacing: -.035em; }
.p-title .line { display: block; overflow: hidden; padding-block: .1em .06em; margin-block: -.1em -.06em; }
.p-title .line > span { display: inline-block; transform: translateY(110%); animation: lineUp 1.1s var(--ease) forwards; }
.p-lead { margin-top: calc(28 * var(--s)); font-size: max(calc(22 * var(--s)), 16px); line-height: 1.25; color: #3b4150; }
.p-lines { /* faint drawing grid, like the About hero */
  position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(31,46,184,.06) 0 1px, transparent 1px calc(80 * var(--s))),
    repeating-linear-gradient(0deg, rgba(31,46,184,.06) 0 1px, transparent 1px calc(80 * var(--s)));
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 30% 60%, #000 20%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 80% at 30% 60%, #000 20%, transparent 75%);
}

.p-search { width: min(100%, calc(760 * var(--s)), 760px); min-width: min(100%, 520px); margin-top: calc(44 * var(--s)); display: grid; gap: 18px; justify-items: start; }
.search { width: 100%; position: relative; display: flex; align-items: center; }
.search svg { position: absolute; right: 22px; width: 20px; height: 20px; fill: none; stroke: var(--blue); stroke-width: 1.8; pointer-events: none; }
.search input {
  width: 100%; height: max(calc(64 * var(--s)), 54px); padding: 0 58px 0 22px;
  border: 1px solid #c9d1e1; border-radius: 6px; background: #fff;
  font: inherit; font-size: max(calc(19 * var(--s)), 16px); color: var(--ink);
  box-shadow: 0 18px 40px -30px rgba(31,46,184,.5);
  transition: border-color .25s, box-shadow .25s;
}
.search input::placeholder { color: #8a92a6; }
.search input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31,46,184,.14), 0 18px 40px -30px rgba(31,46,184,.5); }
.chips { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-start; }
.chip { display: inline-flex; align-items: center; gap: 9px; height: 42px; padding: 0 16px 0 18px; border-radius: 999px; border: 1px solid #c9d1e1; background: #fff; font-size: 15px; transition: background .25s, color .25s, border-color .25s; }
.chip:hover { border-color: var(--blue); }
/* active chip keeps the icons in their full colours (no ring, no colour swap) */
.chip.on { background: #fff; border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); color: var(--blue); }
.chip[data-cat="all"].on { background: var(--blue); color: #fff; }
.tico { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.tico svg { width: 15px; height: 15px; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* type colours (badge + chip icon) */
.tico[data-cat="private"], .tbadge[data-cat="private"] { background: var(--lime); }
.tico[data-cat="private"] svg, .tbadge[data-cat="private"] svg { stroke: var(--ink); }
.tico[data-cat="inst"], .tbadge[data-cat="inst"] { background: var(--violet); }
.tico[data-cat="public"], .tbadge[data-cat="public"] { background: var(--blue); }
.tico[data-cat="inst"] svg, .tbadge[data-cat="inst"] svg, .tico[data-cat="public"] svg, .tbadge[data-cat="public"] svg { stroke: #fff; }


.archive { padding-top: calc(50 * var(--s)); padding-bottom: calc(150 * var(--s)); }
/* ---------- List ---------- */
.plist { margin-top: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pitem {
  position: relative; display: flex; align-items: flex-start; gap: 14px;
  padding: 20px 20px 22px; background: #fff; border-radius: 6px; min-height: 96px;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
  animation: itemIn .5s var(--ease) both; animation-delay: var(--i, 0s);
}
.pitem::after { content: ""; position: absolute; right: 0; bottom: 0; height: 3px; width: 100%; background: var(--blue); transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease); border-radius: 0 0 6px 6px; }
.pitem:hover { transform: translateY(-3px); box-shadow: 0 18px 34px -24px rgba(31,46,184,.55); }
.pitem:hover::after { transform: scaleX(1); }
.pitem[data-cat="private"]::after { background: #c9df00; }
.pitem[data-cat="inst"]::after { background: var(--violet); }
.tbadge { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; }
.tbadge svg { width: 21px; height: 21px; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.pitem h3 { font-weight: 400; font-size: 19px; line-height: 1.1; }
.pitem p { margin-top: 6px; font-size: 14px; color: #5d6475; }
.pitem a { position: absolute; inset: 0; border-radius: 6px; }
.pitem a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
@keyframes itemIn { from { opacity: 0; transform: translateY(12px); } }

.empty[hidden] { display: none; }
.empty { margin-top: 48px; text-align: center; display: grid; justify-items: center; gap: 22px; padding: 56px 20px; background: #fff; border-radius: 8px; }
.empty p { font-size: 20px; max-width: 520px; line-height: 1.3; }

/* ---------- Closing ---------- */
.p-end { padding-bottom: calc(150 * var(--s)); }
.p-end-inner { background: var(--blue); color: #fff; border-radius: 10px; padding: calc(80 * var(--s)) calc(90 * var(--s)); display: grid; justify-items: start; gap: calc(24 * var(--s)); }
.p-end h2 { font-weight: 400; font-size: max(calc(80 * var(--s)), 34px); line-height: .85; letter-spacing: -.03em; }
.p-end p { font-size: max(calc(22 * var(--s)), 16px); color: rgba(255,255,255,.82); }
.btn-white { background: #fff; color: var(--blue); }
.btn-white::before { background: var(--lime); }
.btn-white:hover { color: var(--ink); }

@media (max-width: 1100px) {
  .p-hero { padding: calc(68px + 40px) 0 48px; }
  .plist { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 24px; }
  .p-end-inner { padding: 44px 24px; }
}
@media (max-width: 600px) {
  .plist { grid-template-columns: 1fr; }
  .chips { overflow-x: auto; flex-wrap: nowrap; width: 100%; padding-bottom: 2px; }
  .chip { flex: none; }
}
@media (prefers-reduced-motion: reduce) {
  .p-title .line > span { transform: none !important; animation: none !important; }
  .pitem { animation: none !important; }
}

/* ---------- Card arrow + click target ---------- */
.pitem { align-items: center; padding-inline-end: 64px; }
.parrow { position: absolute; left: 16px; top: 50%; translate: 0 -50%; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); transition: background .3s, transform .35s var(--ease); }
.parrow svg { width: 7px; height: 12px; fill: none; stroke: var(--blue); stroke-width: 1.6; transition: stroke .3s; }
.pitem:hover .parrow { background: var(--blue); transform: translateX(-4px); }
.pitem:hover .parrow svg { stroke: #fff; }
.popen { position: absolute; inset: 0; border-radius: 6px; cursor: pointer; }
.popen:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- Project popup: details on the right, tall image on the left, small map tile ---------- */
html.pm-lock { overflow: hidden; }
.pm { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; }
.pm[hidden] { display: none; }
.pm-backdrop { position: absolute; inset: 0; background: rgba(14,20,90,.38); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .3s; }
.pm-card {
  position: relative; width: min(1040px, 100%); height: min(600px, calc(100vh - 48px));
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 40px 90px -30px rgba(14,20,90,.55);
  opacity: 0; transform: translateY(18px) scale(.98); transition: opacity .35s var(--ease), transform .45s var(--ease);
}
.pm.on .pm-backdrop { opacity: 1; }
.pm.on .pm-card { opacity: 1; transform: none; }
.pm-close { position: absolute; top: 16px; left: 16px; z-index: 6; width: 40px; height: 40px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 4px 14px -6px rgba(25,25,60,.35); transition: background .25s; }
.pm-close svg { width: 16px; height: 16px; stroke: var(--ink); stroke-width: 1.8; }
.pm-close:hover { background: var(--bg); }

/* details column (right in RTL) */
.pm-info { padding: 48px 46px 30px; display: flex; flex-direction: column; overflow: auto; }
.pm-type { display: flex; align-items: center; gap: 10px; font-size: 15px; color: #5d6475; }
.pm-type .tbadge { width: 34px; height: 34px; }
.pm-title { margin-top: 20px; font-weight: 400; font-size: clamp(34px, 3.4vw, 50px); line-height: .9; letter-spacing: -.02em; }
.pm-addr { margin-top: 14px; display: flex; align-items: center; gap: 8px; font-size: 17px; color: #3b4150; }
.pm-addr svg { width: 18px; height: 18px; fill: none; stroke: var(--blue); stroke-width: 1.6; flex: none; }
.pm-facts { margin-top: 30px; border-top: 1px solid #e3e8f2; }
.pm-facts div { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid #e3e8f2; }
.pm-facts dt { color: #5d6475; font-size: 15px; }
.pm-facts dd { margin: 0; font-size: 16px; text-align: left; }
.pm-features { margin-top: 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.pm-features[hidden] { display: none; }
.pm-features li { display: flex; align-items: center; gap: 10px; font-size: 15px; line-height: 1.2; }
.fico { flex: none; width: 34px; height: 34px; border-radius: 8px; background: var(--bg); display: grid; place-items: center; }
.fico svg { width: 19px; height: 19px; fill: none; stroke: var(--blue); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.pm-nav { margin-top: auto; padding-top: 26px; display: flex; justify-content: space-between; gap: 12px; }
.pm-step { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; color: var(--blue); padding: 6px 0; }
.pm-step svg { width: 7px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.pm-step:disabled { opacity: .3; cursor: default; }
.pm-step:not(:disabled):hover { text-decoration: underline; text-underline-offset: 4px; }

/* image column (left in RTL) */
.pm-hero { position: relative; margin: 0; background: #e9edf5; overflow: hidden; }
.pm-hero img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.03); animation: heroIn .7s var(--ease); }
.pm-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(0deg, rgba(14,20,90,.25), transparent 35%); }
.pm-generic { position: absolute; z-index: 2; left: 16px; bottom: 16px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.9); font-size: 12px; color: #5d6475; }
@keyframes heroIn { from { opacity: 0; transform: scale(1.08); } }

/* small map tile floating on the image corner */
.pm-mapbox { position: absolute; z-index: 3; right: 18px; bottom: 18px; width: 176px; height: 176px; border-radius: 10px; overflow: hidden; background: #eef1f7; box-shadow: 0 22px 44px -20px rgba(14,20,90,.6); transition: width .4s var(--ease), height .4s var(--ease); }
/* thin inner ring + label, in the site language (no thick white frame) */
.pm-mapbox::before { content: "על המפה"; position: absolute; z-index: 501; top: 8px; right: 8px; padding: 4px 9px 4px 10px; border-radius: 999px; background: rgba(255,255,255,.92); font-size: 11px; line-height: 1; color: var(--ink); pointer-events: none;
  box-shadow: 0 4px 10px -6px rgba(14,20,90,.4); }
.pm-mapbox:hover::before { content: "המיקום והפרויקטים בסביבה"; }
.pm-mapbox:hover { width: 260px; height: 220px; }
.pm-map { width: 100%; height: 100%; }
.pm-map[hidden], .pm-nomap[hidden], .pm-legend[hidden] { display: none !important; }
.pm-map .leaflet-tile-pane { filter: grayscale(1) contrast(.85) brightness(1.12) sepia(.35) hue-rotate(180deg) saturate(1.6); }
.pm-map .leaflet-control-attribution { display: none; }
.pm-map .leaflet-control-zoom { display: none; }
.pm-nomap { height: 100%; display: grid; place-items: center; padding: 14px; text-align: center; color: #5d6475; font-size: 13px; }

.pm-focus { background: none; border: 0; }
.pm-focus svg { position: relative; width: 100%; height: 100%; filter: drop-shadow(0 4px 6px rgba(25,25,60,.35)); animation: pinDrop .7s cubic-bezier(.3,1.6,.5,1) both; }
.pm-focus .halo { position: absolute; left: 50%; bottom: -6px; width: 30px; height: 12px; translate: -50% 0; border-radius: 50%; background: var(--c); opacity: .35; animation: halo 2s ease-out infinite; }
@keyframes halo { 0% { transform: scale(.6); opacity: .55; } 100% { transform: scale(2.4); opacity: 0; } }

@media (max-width: 860px) {
  .pm { padding: 0; place-items: end center; }
  .pm-card { grid-template-columns: 1fr; grid-template-rows: 260px auto; height: auto; max-height: 94vh; border-radius: 14px 14px 0 0; overflow: auto; }
  .pm-hero { order: -1; }
  .pm-mapbox { width: 120px; height: 120px; right: 12px; bottom: 12px; }
  .pm-mapbox:hover { width: 120px; height: 120px; }
  .pm-info { padding: 24px 20px 20px; overflow: visible; }
  .pm-features { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .pm-card, .pm-backdrop { transition: none !important; } .pm-focus .halo, .pm-hero img { animation: none; } }