/* =====================================================================
   Inspire Design — Portfolio page (/portofoliu/)
   Professional rebuild: before/after slider per card, lightbox + zoom,
   per-item downloads. Monochrome UI (no colored icons).
   ===================================================================== */

:root {
  --ip-bg: #fff;
  --ip-fg: #1a1a1a;
  --ip-fg-soft: #888;
  --ip-border: #ececec;
  --ip-bg-soft: #f7f7f7;
  --ip-radius: 18px;
}

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@200;300;400;500;600&display=swap");

html, body {
  margin: 0;
  background: var(--ip-bg);
  color: var(--ip-fg);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 200;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Header ---------- */
.ip-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--ip-border);
  height: 70px;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
}
.ip-header__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 999px;
  color: var(--ip-fg);
  transition: background .15s;
}
.ip-header__back:hover { background: #f5f5f5; }
.ip-header__logo img { height: 26px; width: auto; }
.ip-header__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---------- Page ---------- */
.ip-main { padding: 40px 0 80px; }
.ip-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 32px;
}

.ip-page-head {
  margin-bottom: 32px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.ip-page-head__text { min-width: 0; }
.ip-page-head__title {
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 200;
  letter-spacing: -0.5px;
  margin: 0 0 6px;
}
.ip-page-head__sub {
  font-size: 14px;
  color: var(--ip-fg-soft);
  margin: 0;
}
.ip-page-head__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1a1a1a;
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .03em;
  transition: background .15s;
}
.ip-page-head__cta:hover { background: #DE0000; }
.ip-page-head__cta svg { width: 16px; height: 16px; }

/* ---------- States ---------- */
.ip-state { min-height: 200px; display: flex; align-items: center; justify-content: center; }
.ip-loading { text-align: center; color: var(--ip-fg-soft); }
.ip-loading p { font-size: 13px; margin-top: 12px; }
.ip-loading .is-loader__spin,
.ip-spin {
  width: 34px; height: 34px;
  border: 3px solid #e6e6e6;
  border-top-color: #1a1a1a;
  border-radius: 50%;
  margin: 0 auto;
  animation: ip-spin .8s linear infinite;
}
@keyframes ip-spin { to { transform: rotate(360deg); } }

.ip-empty {
  text-align: center;
  padding: 60px 24px;
  max-width: 520px;
  margin: 0 auto;
}
.ip-empty svg { color: #d4d4d4; margin: 0 auto 20px; display: block; }
.ip-empty__title { font-size: 22px; font-weight: 300; margin: 0 0 6px; }
.ip-empty__sub {
  font-size: 14px; color: var(--ip-fg-soft); font-weight: 300;
  line-height: 1.5; margin: 0 0 20px;
}
.ip-empty .is-btn,
.ip-empty__btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: #1a1a1a; color: #fff; border: 0;
  border-radius: 999px; padding: 13px 26px;
  font-size: 13px; font-weight: 400; letter-spacing: .03em;
  transition: background .15s;
}
.ip-empty .is-btn:hover,
.ip-empty__btn:hover { background: #DE0000; }

/* ---------- Grid ---------- */
.ip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

/* ---------- Card ---------- */
.ip-card {
  background: #fff;
  border: 1px solid var(--ip-border);
  border-radius: var(--ip-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.ip-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
  border-color: #ddd;
}

/* Media: before/after slider OR status placeholder */
.ip-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--ip-bg-soft);
  overflow: hidden;
}

/* Before/After slider component (reusable) */
.ip-ba {
  position: absolute;
  inset: 0;
  overflow: hidden;
  --pos: 50%;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}
.ip-ba__layer { position: absolute; inset: 0; }
.ip-ba__layer img {
  width: 100%; height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
  pointer-events: none;
}
.ip-ba__after  { z-index: 0; }                 /* "După" (result) full */
.ip-ba__before {                                /* "Înainte" (original) clipped from right */
  z-index: 1;
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}
.ip-ba__divider {
  position: absolute; top: 0; bottom: 0;
  left: var(--pos);
  width: 2px; background: #fff;
  transform: translateX(-50%);
  z-index: 2; pointer-events: none;
  box-shadow: 0 0 8px rgba(0,0,0,0.35);
}
.ip-ba__handle {
  position: absolute; top: 50%; left: var(--pos);
  transform: translate(-50%, -50%);
  width: 38px; height: 38px;
  background: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  z-index: 3; cursor: ew-resize;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.ip-ba__handle svg { width: 18px; height: 18px; color: #1a1a1a; pointer-events: none; }
.ip-ba__tag {
  position: absolute; bottom: 12px;
  z-index: 4; pointer-events: none;
  background: rgba(0,0,0,0.62);
  color: #fff; font-size: 10px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 11px; border-radius: 999px;
}
.ip-ba__tag--before { left: 12px; }
.ip-ba__tag--after  { right: 12px; }

/* Card top-right quick actions (enlarge) */
.ip-card__expand {
  position: absolute; top: 12px; right: 12px;
  z-index: 6;
  width: 36px; height: 36px;
  border: 0; border-radius: 999px;
  background: rgba(255,255,255,0.92);
  color: #1a1a1a;
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(.92);
  transition: opacity .18s, transform .18s, background .15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.ip-card:hover .ip-card__expand { opacity: 1; transform: scale(1); }
.ip-card__expand:hover { background: #1a1a1a; color: #fff; }
.ip-card__expand svg { width: 17px; height: 17px; }

/* Status placeholder (processing / failed / no image) — never a broken black image */
.ip-card__placeholder,
.ip-img-broken::after {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; text-align: center;
  background: var(--ip-bg-soft);
  color: var(--ip-fg-soft);
  padding: 20px;
}
.ip-img-broken::after {
  content: "Imaginea nu poate fi afișată";
  font-size: 12px; font-weight: 300;
}
.ip-card__placeholder p { margin: 0; font-size: 13px; font-weight: 300; }
.ip-card__placeholder svg { width: 30px; height: 30px; opacity: .5; }
.ip-card__placeholder--failed { color: #b91c1c; }

/* Card footer */
.ip-card__body {
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}
.ip-card__meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ip-card__room { font-size: 14px; font-weight: 400; color: var(--ip-fg); }
.ip-card__date { font-size: 12px; color: var(--ip-fg-soft); font-weight: 300; }
.ip-card__badge {
  flex-shrink: 0;
  font-size: 10px; font-weight: 500;
  padding: 4px 10px; border-radius: 999px;
  letter-spacing: .4px; text-transform: uppercase;
  background: #efefef; color: #555;
}
.ip-card__badge--processing { background: #f5e9d2; color: #92660a; }
.ip-card__badge--failed { background: #fde2e2; color: #b91c1c; }

/* Card download (mini) */
.ip-card__dl {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border: 1px solid var(--ip-border); border-radius: 999px;
  background: #fff; color: #1a1a1a;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s, border-color .15s;
}
.ip-card__dl:hover { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }
.ip-card__dl svg { width: 16px; height: 16px; }

/* ---------- Actions ---------- */
.ip-actions { display: flex; justify-content: center; margin-top: 40px; }
.ip-link {
  background: none; border: 0; color: #1a1a1a;
  text-decoration: underline; cursor: pointer; font: inherit;
}

/* =====================================================================
   Lightbox (detail) — large before/after + thumbnails + downloads
   ===================================================================== */
.ip-lb {
  position: fixed; inset: 0; z-index: 1100;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity .2s, visibility .2s;
}
.ip-lb.is-open { opacity: 1; visibility: visible; }
.ip-lb__overlay {
  position: absolute; inset: 0;
  background: rgba(12,12,12,0.82);
  backdrop-filter: blur(6px);
}
.ip-lb__dialog {
  position: relative;
  background: #fff;
  border-radius: 22px;
  width: min(1100px, 94vw);
  max-height: 92vh;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 30px 90px rgba(0,0,0,0.4);
}
.ip-lb__close {
  position: absolute; top: 14px; right: 14px;
  width: 40px; height: 40px; border-radius: 999px;
  background: rgba(255,255,255,0.92); border: 0; color: #1a1a1a;
  display: inline-flex; align-items: center; justify-content: center;
  z-index: 10; transition: background .15s, color .15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.ip-lb__close:hover { background: #1a1a1a; color: #fff; }

.ip-lb__head {
  padding: 22px 28px 14px;
  display: flex; align-items: baseline; gap: 14px;
}
.ip-lb__title { font-size: 22px; font-weight: 300; margin: 0; }
.ip-lb__date { font-size: 13px; color: var(--ip-fg-soft); margin: 0; }

.ip-lb__stage {
  position: relative;
  margin: 0 28px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--ip-bg-soft);
  aspect-ratio: 16 / 10;
  max-height: 56vh;
}
.ip-lb__stage .ip-ba { position: absolute; inset: 0; }
.ip-lb__stage .ip-ba__handle { width: 44px; height: 44px; }
.ip-lb__stage .ip-ba__tag { font-size: 11px; }

/* Stage hint + per-image enlarge buttons overlaid */
.ip-lb__zoombtn {
  position: absolute; top: 12px; left: 12px; z-index: 7;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,0.6); color: #fff;
  border: 0; border-radius: 999px; padding: 7px 13px;
  font-size: 11px; font-weight: 400; letter-spacing: .03em;
  transition: background .15s;
}
.ip-lb__zoombtn:hover { background: #000; }
.ip-lb__zoombtn svg { width: 14px; height: 14px; }

/* Thumb strip (original + each result) */
.ip-lb__thumbs {
  display: flex; gap: 10px; flex-wrap: wrap;
  padding: 16px 28px 4px;
}
.ip-thumb {
  position: relative;
  width: 92px; height: 70px;
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--ip-border);
  background: var(--ip-bg-soft);
  padding: 0; cursor: zoom-in;
  transition: border-color .15s, transform .15s;
}
.ip-thumb:hover { border-color: #1a1a1a; transform: translateY(-2px); }
.ip-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ip-thumb__cap {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,0.6); color: #fff;
  font-size: 9px; font-weight: 500; letter-spacing: .05em;
  text-transform: uppercase; text-align: center;
  padding: 3px 0;
}

/* Footer: prompt + downloads */
.ip-lb__foot {
  padding: 16px 28px 24px;
  border-top: 1px solid var(--ip-border);
  margin-top: 14px;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
}
.ip-lb__prompt {
  font-size: 13px; color: #555; font-weight: 300;
  line-height: 1.55; max-width: 560px; margin: 0;
}
.ip-lb__prompt strong { font-weight: 500; color: #1a1a1a; }
.ip-lb__downloads { display: flex; gap: 10px; flex-wrap: wrap; }
.ip-dl-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--ip-border); border-radius: 999px;
  background: #fff; color: #1a1a1a;
  padding: 10px 18px; font-size: 13px; font-weight: 400;
  transition: background .15s, color .15s, border-color .15s;
}
.ip-dl-btn:hover { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }
.ip-dl-btn--all { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }
.ip-dl-btn--all:hover { background: #DE0000; border-color: #DE0000; }
.ip-dl-btn svg { width: 16px; height: 16px; }

.ip-lb__err {
  margin: 0 28px 22px;
  background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
  padding: 12px 14px; border-radius: 12px; font-size: 13px;
}

/* =====================================================================
   Full-screen single-image zoom viewer
   ===================================================================== */
.ip-zoom {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(8,8,8,0.94);
  display: none; align-items: center; justify-content: center;
  overflow: hidden;
}
.ip-zoom.is-open { display: flex; }
.ip-zoom__img {
  max-width: 94vw; max-height: 90vh;
  object-fit: contain;
  cursor: zoom-in;
  transform-origin: center center;
  transition: transform .2s ease;
  -webkit-user-drag: none;
  will-change: transform;
}
.ip-zoom.is-zoomed .ip-zoom__img { cursor: zoom-out; transition: none; }
.ip-zoom__close {
  position: absolute; top: 18px; right: 18px;
  width: 44px; height: 44px; border-radius: 999px;
  background: rgba(255,255,255,0.12); color: #fff; border: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.ip-zoom__close:hover { background: rgba(255,255,255,0.25); }
.ip-zoom__cap {
  position: absolute; bottom: 22px; left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.12); color: #fff;
  font-size: 12px; font-weight: 300; letter-spacing: .04em;
  padding: 7px 16px; border-radius: 999px;
}
.ip-zoom__dl {
  position: absolute; bottom: 22px; right: 22px;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.12); color: #fff; border: 0;
  border-radius: 999px; padding: 10px 18px;
  font-size: 13px; transition: background .15s;
}
.ip-zoom__dl:hover { background: rgba(255,255,255,0.25); }
.ip-zoom__dl svg { width: 16px; height: 16px; }

body.ip-modal-open { overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .ip-header { padding: 12px 16px; height: 60px; }
  .ip-container { padding: 0 16px; }
  .ip-main { padding: 24px 0 60px; }
  .ip-grid { grid-template-columns: 1fr; gap: 16px; }
  .ip-card__expand { opacity: 1; transform: none; }
  .ip-lb__head, .ip-lb__thumbs, .ip-lb__foot { padding-left: 18px; padding-right: 18px; }
  .ip-lb__stage { margin: 0 18px; max-height: 44vh; }
  .ip-lb__downloads { width: 100%; }
}
