/* ---------- two-column layout ---------- */
.profile-layout{
  max-width:var(--maxw);margin:0 auto;padding:44px 24px 96px;
  display:grid;grid-template-columns:340px 1fr;gap:48px;align-items:start;
}

.sidebar-toggle{
  display:none;
  align-items:center;gap:8px;
  background:var(--surface);border:1px solid var(--line);
  color:var(--text);font-family:var(--font-body);font-weight:600;font-size:13.5px;
  padding:10px 16px;border-radius:999px;cursor:pointer;
  position:sticky;top:88px;z-index:40;margin-bottom:18px;
}
.sidebar-toggle svg{width:16px;height:16px;}

.sidebar-backdrop{
  display:none;
  position:fixed;inset:0;background:rgba(0,0,0,0.6);
  z-index:150;opacity:0;pointer-events:none;transition:opacity .25s ease;
}
.sidebar-backdrop.show{opacity:1;pointer-events:auto;}

.sidebar-close{display:none;}

/* ---------- profile sidebar (left) ---------- */
.profile-sidebar{
  position:relative;text-align:center;
  background:var(--surface);border:1px solid var(--line);
  border-radius:18px;padding:32px 26px 28px;
  overflow:hidden;
}
.profile-glow{
  position:absolute;top:-60px;left:50%;transform:translateX(-50%);
  width:280px;height:220px;
  background:radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  pointer-events:none;filter:blur(4px);z-index:0;
}
.profile-sidebar > *:not(.profile-glow){position:relative;z-index:1;}

.avatar-lg{
  position:relative;
  width:104px;height:104px;margin:6px auto 20px;
  clip-path:path('M16,0 L59,0 L104,45 L104,88 A16,16 0 0 1 88,104 L16,104 A16,16 0 0 1 0,88 L0,16 A16,16 0 0 1 16,0 Z');
  background:linear-gradient(135deg, var(--accent) 0%, #4D7FFF 45%, #B24BFF 100%);
  box-shadow:0 0 24px -6px var(--accent-glow);
  display:block;padding:0;border:0;cursor:pointer;
  transition:transform .15s ease;
}
.avatar-lg:hover{transform:scale(1.03);}
.avatar-lg[tabindex="-1"]{cursor:default;}
.avatar-lg[tabindex="-1"]:hover{transform:none;}
.avatar-lg img{
  position:absolute;top:4px;left:4px;width:96px;height:96px;
  object-fit:cover;display:block;
  clip-path:path('M15,0 L54,0 L96,42 L96,81 A15,15 0 0 1 81,96 L15,96 A15,15 0 0 1 0,81 L0,15 A15,15 0 0 1 15,0 Z');
}
.avatar-lg img[hidden]{display:none;}
.avatar-placeholder{
  position:absolute;top:4px;left:4px;width:96px;height:96px;
  clip-path:path('M15,0 L54,0 L96,42 L96,81 A15,15 0 0 1 81,96 L15,96 A15,15 0 0 1 0,81 L0,15 A15,15 0 0 1 15,0 Z');
  background:transparent;
  display:flex;align-items:center;justify-content:center;
  font-family:var(--font-display);font-weight:700;font-size:40px;line-height:1;
  color:rgba(255,255,255,0.9);
}
.avatar-lg::after{
  content:"";position:absolute;top:4px;left:4px;width:96px;height:96px;
  clip-path:path('M15,0 L54,0 L96,42 L96,81 A15,15 0 0 1 81,96 L15,96 A15,15 0 0 1 0,81 L0,15 A15,15 0 0 1 15,0 Z');
  background:linear-gradient(135deg, rgba(255,255,255,0.30) 0%, rgba(255,255,255,0) 32%, rgba(255,255,255,0) 68%, rgba(255,255,255,0.12) 100%);
  pointer-events:none;
}

.profile-name-row{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:6px;}
.profile-name-row h1{font-size:23px;}
.profile-handle{font-family:var(--font-mono);font-size:13px;color:var(--text-faint);margin-top:6px;}

.zf-badge{
  display:inline-flex;align-items:center;gap:7px;
  background:var(--accent);color:var(--bg);
  font-family:var(--font-mono);font-weight:700;font-size:12.5px;
  padding:8px 14px;border-radius:9px;
  margin-top:16px;
}
.zf-badge b{font-weight:700;}

.profile-meta{
  display:flex;align-items:center;justify-content:center;gap:8px;
  margin-top:15px;font-family:var(--font-mono);font-size:12px;color:var(--text-dim);
}
.profile-meta span{display:inline-flex;align-items:center;gap:5px;}
.profile-meta svg{width:13px;height:13px;color:var(--text-faint);}
.profile-meta .sep{color:var(--text-faint);}

.profile-bio{
  margin:18px auto 0;max-width:38ch;
  font-size:14px;line-height:1.6;color:var(--text-dim);
}

/* ---------- links (inside sidebar) ---------- */
.links{margin-top:26px;display:flex;flex-direction:column;gap:9px;text-align:left;}
.link-row{
  display:flex;align-items:center;gap:12px;
  background:var(--surface-2);border:1px solid var(--line);
  border-radius:12px;padding:13px 15px;
  font-size:13.5px;font-weight:500;text-decoration:none;
  transition:border-color .15s ease, transform .15s ease;
}
.link-row:hover{border-color:var(--accent);transform:translateX(2px);}
.link-row svg{width:17px;height:17px;flex:none;color:var(--text-dim);}
.link-row span{flex:1;text-align:left;}
.link-row .chev{width:13px;height:13px;color:var(--text-faint);}
.link-row.disabled{opacity:0.4;cursor:not-allowed;}
.link-row.disabled:hover{border-color:var(--line);transform:none;}

/* ---------- feed (right) ---------- */
.profile-feed{min-width:0;}
#feedLoadMore{display:flex;justify-content:center;padding:12px 0 0;}
.feed-loading{font-family:var(--font-mono);font-size:13px;color:var(--text-faint);}
.feed-load-more-btn{
  background:var(--surface);border:1px solid var(--line);color:var(--text);
  font-family:var(--font-body);font-weight:600;font-size:14px;
  padding:11px 24px;border-radius:999px;cursor:pointer;
  transition:border-color .15s ease;
}
.feed-load-more-btn:hover{border-color:var(--accent);}

/* Admin-only toolbar, shown just above the feed when the visitor is logged
   into /admin (ROLE_ADMIN) and happens to be looking at a profile's public
   page — see profile/show.html.twig. Separate from the owner-only
   self-service editor UI (profile-editor.css), which this reuses none of. */
.admin-profile-bar{
  display:flex;flex-wrap:wrap;align-items:center;gap:14px;
  background:var(--surface);border:1px solid rgba(255,107,107,0.25);border-radius:12px;
  padding:12px 16px;margin-bottom:20px;
  font-family:var(--font-body);font-size:13.5px;
}
.admin-profile-bar-label{
  font-family:var(--font-mono);font-size:11px;font-weight:700;letter-spacing:.04em;
  color:#ff6b6b;text-transform:uppercase;
}
.admin-profile-bar a,
.admin-profile-bar button{
  all:unset;color:var(--text-dim);cursor:pointer;transition:color .15s ease;
}
.admin-profile-bar a:hover,
.admin-profile-bar button:hover{color:var(--text);}
.admin-profile-bar form{margin:0;}
.admin-profile-bar-danger{color:#ff6b6b !important;}
.admin-profile-bar-danger:hover{color:#ff8f8f !important;}
.admin-profile-bar-stats{
  margin-left:auto;font-family:var(--font-mono);font-size:12px;color:var(--text-faint);
}

.feed-head{margin-bottom:20px;}
.feed-item{
  background:var(--surface);border:1px solid var(--line);
  border-radius:14px;padding:19px 21px;margin-bottom:14px;
}
.feed-time{font-family:var(--font-mono);font-size:11.5px;color:var(--text-faint);margin-bottom:10px;}
.feed-text{font-size:14.5px;color:var(--text);line-height:1.6;}
.feed-photo{
  margin-top:14px;border-radius:10px;overflow:hidden;
  aspect-ratio:16/9;border:1px solid var(--line);
  display:block;width:100%;padding:0;background:none;cursor:pointer;
  transition:opacity .15s ease;
}
.feed-photo:hover{opacity:0.9;}
.feed-photo img{width:100%;height:100%;object-fit:cover;display:block;}
.feed-video{
  margin-top:14px;border-radius:10px;overflow:hidden;
  aspect-ratio:16/9;border:1px solid var(--line);background:#000;
}
.feed-video video,.feed-video iframe{width:100%;height:100%;display:block;border:0;}
/* TikTok's raw iframe embed (no embed.js, so no JS auto-resize) needs a
   fixed box or its own page just gets cropped by our overflow:hidden.
   9:16 only covers the video itself — TikTok also renders a header
   (avatar/follow) and a footer (caption, music, like/comment/share) above
   and below it, so the full embed is noticeably taller than a plain 9:16
   video. 325×730 is TikTok's own recommended embed size and leaves that
   chrome fully visible instead of overflowing past the bottom. */
.feed-video.feed-video-portrait{
  aspect-ratio:325/730;max-width:325px;margin-left:auto;margin-right:auto;
}

/* ---------- private feed posts: blur + unlock code ----------
   Only .feed-locked-media (the photo/video placeholder) is blurred — the
   teaser text (.feed-text) lives outside it, in normal flow, so it stays
   fully readable above the blur instead of being blurred along with it. */
.feed-locked-media{position:relative;min-height:64px;margin-top:10px;}
.feed-lock{
  position:absolute;inset:0;z-index:2;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:10px;text-align:center;padding:16px;
}
.feed-lock-btn{
  display:inline-flex;align-items:center;gap:8px;
  background:var(--accent);color:var(--bg);border:0;border-radius:999px;
  padding:11px 20px;font-family:var(--font-display);font-weight:700;font-size:13.5px;
  cursor:pointer;transition:transform .15s ease,background .15s ease;
}
.feed-lock-btn[hidden]{display:none;}
.feed-lock-btn:hover{transform:translateY(-1px);background:var(--accent-dim);}
.feed-lock-btn svg{width:16px;height:16px;}
.feed-unlock-form{display:flex;gap:8px;}
.feed-unlock-form[hidden]{display:none;}
.feed-unlock-input{
  width:88px;text-align:center;letter-spacing:4px;text-transform:uppercase;
  font-family:var(--font-mono);font-size:16px;background:var(--surface-2);
  border:1px solid var(--line);border-radius:8px;color:var(--text);padding:9px 6px;
}
.feed-unlock-input:focus{outline:none;border-color:var(--accent);}
.feed-unlock-submit{
  background:var(--accent);color:var(--bg);border:0;border-radius:8px;
  padding:0 16px;font-weight:700;cursor:pointer;
}
.feed-unlock-submit:hover{background:var(--accent-dim);}
.feed-unlock-submit:disabled{opacity:0.6;cursor:not-allowed;}
.feed-unlock-error{color:#FF5C5C;font-size:12.5px;margin:0;}
.feed-photo-locked{
  border-radius:10px;overflow:hidden;
  aspect-ratio:16/9;border:1px solid var(--line);
}
.feed-photo-locked img{
  width:100%;height:100%;object-fit:cover;display:block;
  image-rendering:pixelated;
}
.feed-video-locked{
  border-radius:10px;
  aspect-ratio:16/9;border:1px solid var(--line);background:var(--surface-2);
  display:flex;align-items:center;justify-content:center;
}
.feed-video-locked svg{width:40px;height:40px;color:var(--text-faint);}

/* ---------- mobile: stack + off-canvas sidebar ---------- */
@media (max-width:860px){
  .profile-layout{grid-template-columns:1fr;gap:0;padding-top:20px;}
  .sidebar-toggle{display:inline-flex;}
  .sidebar-backdrop{display:block;}

  .profile-sidebar{
    position:fixed;top:0;left:0;bottom:0;
    width:86vw;max-width:340px;
    margin:0;border-radius:0;border:0;border-right:1px solid var(--line);
    padding:24px 22px 32px;
    overflow-y:auto;overflow-x:hidden;
    transform:translateX(-100%);
    transition:transform .25s ease;
    z-index:200;text-align:left;
  }
  .profile-sidebar.open{transform:translateX(0);}
  .profile-sidebar .avatar-lg,
  .profile-sidebar .profile-name-row,
  .profile-sidebar .profile-handle,
  .profile-sidebar .zf-badge,
  .profile-sidebar .profile-meta{margin-left:auto;margin-right:auto;}
  .profile-sidebar .profile-name-row{width:fit-content;}

  .sidebar-close{
    display:flex;align-items:center;justify-content:center;
    width:32px;height:32px;margin-left:auto;margin-bottom:12px;
    background:var(--surface-2);border:1px solid var(--line);border-radius:50%;
    color:var(--text-dim);cursor:pointer;
  }
  .sidebar-close svg{width:15px;height:15px;}
}

/* ---------- lightbox viewer ---------- */
.lightbox{
  display:none;position:fixed;inset:0;z-index:500;
  background:rgba(6,6,6,0.96);
  align-items:center;justify-content:center;
}
.lightbox.open{display:flex;}
.lightbox-stage{
  width:100%;height:100%;
  display:flex;align-items:center;justify-content:center;
  overflow:hidden;touch-action:none;cursor:zoom-out;
}
.lightbox-stage img{
  max-width:90vw;max-height:86vh;
  border-radius:10px;
  touch-action:none;user-select:none;-webkit-user-drag:none;
  cursor:grab;
  box-shadow:0 30px 80px -20px rgba(0,0,0,0.7);
}
.lightbox-close{
  position:fixed;top:18px;right:18px;z-index:510;
  width:40px;height:40px;border-radius:50%;
  background:var(--surface);border:1px solid var(--line);
  color:var(--text);display:flex;align-items:center;justify-content:center;
  cursor:pointer;
}
.lightbox-close:hover{border-color:var(--accent);}
.lightbox-close svg{width:17px;height:17px;}
.lightbox-hint{
  position:fixed;bottom:22px;left:50%;transform:translateX(-50%);
  font-family:var(--font-mono);font-size:11.5px;color:var(--text-dim);
  background:var(--surface);border:1px solid var(--line);
  padding:7px 14px;border-radius:999px;
  pointer-events:none;opacity:0;transition:opacity .4s ease;
  z-index:510;white-space:nowrap;
}
@media (max-width:600px){
  .lightbox-hint{font-size:10.5px;padding:6px 12px;}
}
