/* ============================================================
   GELTAN — Projects Studio (add-on for style.css)
   ============================================================ */

/* ---------- Filter bar ---------- */
.filter-bar {
  position: static;
  top: 88px;
  z-index: 60;
  align-self: start;
  background: #fff;
  backdrop-filter: none;
  border: 0;
  border-bottom: 1px solid var(--g-ice-2);
  border-radius: 0;
  padding: 14px 16px;
  box-shadow: none;
}
.fchip {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--g-ice-2);
  background: #fff;
  color: var(--g-navy);
  font-weight: 700;
  font-size: 13.5px;
  transition: all .3s ease;
  white-space: nowrap;
}
.fchip:hover { border-color: var(--g-sky); color: var(--g-blue); }
.fchip.on { background: var(--g-blue); border-color: var(--g-blue); color: #fff; box-shadow: 0 8px 18px rgba(42,95,180,.22); }

.filter-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--g-ice);
  border-radius: 999px;
  padding: 8px 16px;
  min-width: 210px;
  border: 1.5px solid transparent;
  transition: all .3s ease;
}
.filter-search:focus-within { background:#fff; border-color: var(--g-blue); box-shadow: 0 0 0 4px rgba(42,95,180,.10); }
.filter-search input { background: transparent; outline: none; width: 100%; font-size: 14px; color: var(--g-navy); }
.filter-search input::placeholder { color: #8ea3c2; }

/* ---------- Status badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; padding: 5px 12px; border-radius: 999px; }
.badge::before { content:""; width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
.badge-done { background: #e7f6ee; color: #178a52; }
.badge-run  { background: #fdf3e0; color: #c07d10; }
.badge-maint{ background: var(--g-ice); color: var(--g-blue); }

/* ---------- Project card ---------- */
.p-card {
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 12px 34px rgba(28,50,85,.08);
  transition: transform .4s var(--ease-soft), box-shadow .4s ease;
  display: flex; flex-direction: column;
}
.p-card:hover { transform: translateY(-7px); box-shadow: 0 26px 52px rgba(28,50,85,.15); }
.p-cover { position: relative; height: 230px; overflow: hidden; cursor: pointer; }
.p-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease-soft); }
.p-card:hover .p-cover img { transform: scale(1.07); }
.p-cover::after {
  content:""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(28,50,85,.28), transparent 40%, transparent 70%, rgba(28,50,85,.35));
  pointer-events: none;
}
.p-cover .badge { position: absolute; top: 14px; inset-inline-start: 14px; z-index: 2; backdrop-filter: blur(6px); }
.p-media-count {
  position: absolute; bottom: 12px; inset-inline-end: 12px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(15,26,46,.55); backdrop-filter: blur(6px);
  color: #fff; font-size: 12px; font-weight: 700;
  padding: 5px 12px; border-radius: 999px;
}
.p-body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.p-sector { font-size: 12.5px; font-weight: 800; color: var(--g-red); letter-spacing: .02em; }
.p-title { font-size: 19px; font-weight: 800; color: var(--g-navy); line-height: 1.5; }
.p-sol { font-size: 13.5px; color: #5f749a; font-weight: 600; line-height: 1.8; }
.p-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; padding-top: 12px; border-top: 1.5px dashed var(--g-ice-2); }
.p-meta span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: #6c81a6; }
.p-cta {
  margin-top: auto;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px solid var(--g-blue); color: var(--g-blue);
  border-radius: 999px; padding: 11px; font-weight: 800; font-size: 14px;
  transition: all .3s ease; cursor: pointer; background: #fff;
}
.p-cta:hover { background: var(--g-blue); color: #fff; }
.p-cta:hover .arrow { transform: translateX(var(--arrow-shift,4px)); }

.projects-empty { text-align:center; padding: 70px 20px; color:#8ea3c2; font-weight:700; }

/* ---------- Project Studio (detail modal) ---------- */
.p-modal {
  position: fixed; inset: 0; z-index: 95;
  background: rgba(15,26,46,.72); backdrop-filter: blur(10px);
  display: grid; place-items: center; padding: 18px;
  opacity: 0; pointer-events: none; transition: opacity .35s ease;
}
.p-modal.open { opacity: 1; pointer-events: auto; }
.p-studio {
  width: min(1180px, 100%); max-height: calc(100vh - 40px);
  background: #fff; border-radius: 26px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 40px 100px rgba(0,0,0,.4);
  transform: translateY(24px) scale(.985); transition: transform .4s var(--ease-soft);
}
.p-modal.open .p-studio { transform: none; }

.p-studio-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 24px; border-bottom: 1.5px solid var(--g-ice);
  background: linear-gradient(120deg, #fff 55%, var(--g-ice));
  flex: none;
}
.p-studio-head h3 { font-size: 18px; font-weight: 800; color: var(--g-navy); }
.p-close {
  width: 40px; height: 40px; border-radius: 999px; flex: none;
  display: grid; place-items: center;
  border: 1.5px solid var(--g-ice-2); color: var(--g-navy);
  transition: all .3s ease; cursor: pointer; background:#fff;
}
.p-close:hover { background: var(--g-red); border-color: var(--g-red); color: #fff; transform: rotate(90deg); }

.p-studio-body { display: grid; grid-template-columns: 1.35fr 1fr; min-height: 0; flex: 1; }

/* media side */
.p-media { display: flex; flex-direction: column; background: var(--g-navy); min-height: 0; }
.p-viewer { position: relative; flex: 1; min-height: 320px; display: grid; place-items: center; background: #0f1a2e; }
.p-viewer img, .p-viewer video { width: 100%; height: 100%; max-height: calc(100vh - 250px); object-fit: contain; display:block; }
.p-viewer-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border-radius: 999px;
  background: rgba(255,255,255,.12); backdrop-filter: blur(6px);
  color: #fff; display: grid; place-items: center; cursor: pointer;
  transition: all .3s ease; z-index: 3;
}
.p-viewer-nav:hover { background: var(--g-blue); }
.p-viewer-nav.prev { inset-inline-start: 14px; }
.p-viewer-nav.next { inset-inline-end: 14px; }
.p-viewer-caption {
  position: absolute; bottom: 12px; inset-inline-start: 14px;
  background: rgba(15,26,46,.6); backdrop-filter: blur(6px);
  color: #fff; font-size: 12.5px; font-weight: 700; padding: 6px 14px; border-radius: 999px; z-index: 3;
}
.p-thumbs { display: flex; gap: 8px; padding: 12px 14px; overflow-x: auto; flex: none; }
.p-thumbs::-webkit-scrollbar { height: 6px; }
.p-thumb {
  flex: none; width: 76px; height: 56px; border-radius: 10px; overflow: hidden;
  border: 2px solid transparent; opacity: .65; cursor: pointer;
  transition: all .3s ease; position: relative; padding:0; background:#0f1a2e;
}
.p-thumb img { width:100%; height:100%; object-fit: cover; display:block; }
.p-thumb.on { border-color: var(--g-sky); opacity: 1; }
.p-thumb:hover { opacity: 1; }
.p-thumb .vid-ico { position:absolute; inset:0; display:grid; place-items:center; color:#fff; background:rgba(15,26,46,.35); }

/* info side */
.p-info { overflow-y: auto; padding: 26px 26px 30px; min-height: 0; }
.p-info::-webkit-scrollbar { width: 8px; }
.pi-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.pi-sec { font-size: 12px; font-weight: 800; color: var(--g-red); }
.pi-title { font-size: 24px; font-weight: 900; color: var(--g-navy); line-height: 1.5; margin-bottom: 4px; }
.pi-sub { font-size: 13.5px; color: #5f749a; font-weight: 600; margin-bottom: 16px; }
.pi-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.pi-fact { background: var(--g-ice); border-radius: 14px; padding: 10px 14px; }
.pi-fact b { display: block; font-size: 11.5px; color: #8ea3c2; font-weight: 700; margin-bottom: 3px; }
.pi-fact span { font-size: 14px; font-weight: 800; color: var(--g-navy); }

.pi-h { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 800; color: var(--g-blue); margin: 24px 0 12px; }
.pi-h::before { content:""; width: 22px; height: 3px; border-radius: 3px; background: var(--g-red); flex:none; }
.pi-text { font-size: 14.5px; line-height: 2; color: #41557a; }
.pi-list { display: flex; flex-direction: column; gap: 9px; }
.pi-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; font-weight: 600; color: #41557a; line-height: 1.8; }
.pi-list .svc-check { margin-top: 3px; }

/* specs table */
.spec-table { border: 1.5px solid var(--g-ice-2); border-radius: 16px; overflow: hidden; }
.spec-row { display: flex; justify-content: space-between; gap: 14px; padding: 11px 16px; font-size: 13.5px; }
.spec-row:nth-child(odd) { background: var(--g-ice); }
.spec-row b { color: #8ea3c2; font-weight: 700; flex: none; }
.spec-row span { font-weight: 800; color: var(--g-navy); text-align: end; }
.spec-note { font-size: 12.5px; color: #8ea3c2; font-weight: 600; margin-top: 8px; }

/* phases */
.phase-item { position: relative; padding-inline-start: 30px; padding-bottom: 16px; }
.phase-item::before {
  content:""; position: absolute; inset-inline-start: 6px; top: 6px;
  width: 10px; height: 10px; border-radius: 999px; background: var(--g-blue);
  box-shadow: 0 0 0 4px rgba(42,95,180,.14);
}
.phase-item::after { content:""; position: absolute; inset-inline-start: 10.5px; top: 22px; bottom: 0; width: 2px; background: var(--g-ice-2); }
.phase-item:last-child::after { display: none; }
.phase-item b { display:block; font-size: 14px; color: var(--g-navy); }
.phase-item span { font-size: 12.5px; color: #8ea3c2; font-weight: 700; }

/* gallery grid inside modal */
.pi-gallery { display: grid; grid-cols-3; gap: 8px; }
.pi-gallery button { border-radius: 12px; overflow: hidden; position: relative; padding:0; cursor:pointer; aspect-ratio: 4/3; background:#0f1a2e; }
.pi-gallery img { width:100%; height:100%; object-fit:cover; display:block; transition: transform .4s var(--ease-soft); }
.pi-gallery button:hover img { transform: scale(1.08); }
.pi-gallery .vid-ico { position:absolute; inset:0; display:grid; place-items:center; color:#fff; background:rgba(15,26,46,.35); }

/* result box */
.pi-result { background: linear-gradient(120deg, var(--g-ice), #fff); border-inline-start: 4px solid var(--g-blue); border-radius: 14px; padding: 16px 18px; font-size: 14.5px; line-height: 2; color: #41557a; font-weight: 600; }

/* similar */
.sim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sim-card { border: 1.5px solid var(--g-ice-2); border-radius: 14px; overflow: hidden; text-align: start; cursor: pointer; background:#fff; padding:0; transition: all .3s ease; }
.sim-card:hover { border-color: var(--g-blue); box-shadow: 0 10px 24px rgba(42,95,180,.12); transform: translateY(-3px); }
.sim-card img { width: 100%; height: 86px; object-fit: cover; display: block; }
.sim-card div { padding: 9px 12px; font-size: 12.5px; font-weight: 800; color: var(--g-navy); line-height: 1.6; }

.pi-cta {
  margin-top: 28px; display: flex; flex-direction: column; gap: 10px;
}
.pi-cta .btn-primary { justify-content: center; }

/* ---------- Lightbox (images & video) ---------- */
.lightbox { z-index: 120; }
.lightbox video { max-width: min(92vw, 1000px); max-height: 84vh; border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.5); animation: svcIn .4s var(--ease-soft) both; background:#000; }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; border-radius: 999px;
  background: rgba(255,255,255,.1); color: #fff;
  display: grid; place-items: center; cursor: pointer; transition: all .3s ease; z-index: 5;
}
.lb-nav:hover { background: var(--g-blue); }
.lb-prev { inset-inline-start: 22px; }
.lb-next { inset-inline-end: 22px; }
.lb-count { position: absolute; bottom: 22px; inset-inline-start: 50%; transform: translateX(50%); color:#fff; font-weight:800; font-size:13px; background:rgba(15,26,46,.6); padding:6px 16px; border-radius:999px; z-index:5; }

@media (max-width: 1023px) {
  .p-studio-body { grid-template-columns: 1fr; }
  .p-media { max-height: 46vh; }
  .p-info { overflow: visible; }
  .p-studio { overflow-y: auto; display: block; }
}
