/* brandsign.css — "brand sign" banner for MultiverseSocial.com Code Share project pages.
   Load AFTER /ms-pages.css.  Every class is prefixed .bs-  ; no inline styles, no JS needed.
   Palette variables come from body.ms-page (--ms-*); each is given a fallback so the sign also
   renders if dropped into a page that is not body.ms-page.                                        */

.bs-sign,.bs-upload{
  --bs-accent:var(--ms-accent,#89b4fa); --bs-edge:var(--ms-edge,#3344aa); --bs-text:var(--ms-text,#cdd6f4);
  --bs-dim:var(--ms-dim,#a6adc8); --bs-ok:var(--ms-ok,#00ff88); --bs-bad:var(--ms-bad,#ff6666);
  --bs-h:220;                         /* hue of the default banner; overridden by .bs-h0 … .bs-h7 */
  --bs-maxh:220px;                    /* image max-height (desktop) */
}
.bs-sign *,.bs-sign *::before,.bs-sign *::after,
.bs-upload *,.bs-upload *::before,.bs-upload *::after{box-sizing:border-box}
.bs-h0{--bs-h:220}.bs-h1{--bs-h:265}.bs-h2{--bs-h:300}.bs-h3{--bs-h:340}
.bs-h4{--bs-h:20}.bs-h5{--bs-h:48}.bs-h6{--bs-h:150}.bs-h7{--bs-h:190}

/* ===================================================================
   The sign: a dark, glowing-edged panel the full width of the column
   =================================================================== */
.bs-sign{
  position:relative; display:block; width:100%; max-width:100%; margin:0 0 20px; padding:0; overflow:hidden;
  border:1px solid var(--bs-edge); border-radius:16px; color:var(--bs-text);
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; line-height:1.4;
  background-color:#05060f;
  background-image:                                           /* faint CSS starfield behind the image (shows through PNG transparency) */
    radial-gradient(1.5px 1.5px at 7% 22%,#fff,transparent 60%),
    radial-gradient(1px 1px at 19% 74%,#cdd6f4,transparent 60%),
    radial-gradient(1px 1px at 33% 30%,#89b4fa,transparent 60%),
    radial-gradient(1.5px 1.5px at 47% 82%,#fff,transparent 60%),
    radial-gradient(1px 1px at 58% 16%,#fff,transparent 60%),
    radial-gradient(1px 1px at 71% 66%,#cdd6f4,transparent 60%),
    radial-gradient(1.5px 1.5px at 84% 28%,#fff,transparent 60%),
    radial-gradient(1px 1px at 93% 80%,#89b4fa,transparent 60%),
    radial-gradient(ellipse 60% 90% at 50% 50%,#0f1230 0%,#05060f 80%);
  box-shadow:0 0 36px rgba(137,180,250,.36), 0 0 4px rgba(137,180,250,.5), inset 0 0 0 1px rgba(137,180,250,.12), inset 0 0 26px rgba(0,0,0,.55);
}

/* stage: centres the picture; min-height keeps very flat images from producing a hairline banner */
.bs-stage{display:flex; align-items:center; justify-content:center; min-height:112px; padding:12px; position:relative; z-index:1}

/* THE IMAGE.  The CGI supplies the real pixel size as width/height ATTRIBUTES.  They are deliberately
   NOT overridden in width/height here: the attribute width is the natural-size cap (so the image is never
   upscaled), max-width:100% shrinks it to the column, height:auto keeps the ratio and lets the browser
   reserve the right space before the file loads (no layout jump).  max-height then caps the box on
   tall images; object-fit:contain makes sure the picture is letterboxed inside that box, never stretched. */
.bs-img{
  display:block; height:auto; max-width:100%; max-height:var(--bs-maxh);
  object-fit:contain; object-position:center; margin:0 auto; border:0; border-radius:0;
}

/* caption overlay (optional): project name + owner along the bottom edge */
.bs-cap{
  position:absolute; left:0; right:0; bottom:0; z-index:2; margin:0; padding:30px 16px 11px;
  display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 10px; pointer-events:none;
  background:linear-gradient(0deg,rgba(5,6,15,.92) 0%,rgba(5,6,15,.72) 45%,rgba(5,6,15,0) 100%);
}
.bs-cap-name{min-width:0; max-width:100%; font-weight:800; font-size:1.2rem; line-height:1.2; color:#fff; letter-spacing:.01em;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-shadow:0 1px 8px rgba(0,0,0,.8)}
.bs-cap-by{font:600 .72rem/1.2 ui-monospace,"Courier New",monospace; letter-spacing:.12em; text-transform:uppercase; color:var(--bs-accent); white-space:nowrap}
.bs-cap-by b{color:#fff; font-weight:700; letter-spacing:.06em; text-transform:none}
/* when a caption is present leave room under the picture so it is not covered */
.bs-sign.bs-has-cap .bs-stage{padding-bottom:46px}

/* ===================================================================
   DEFAULT banner (no image uploaded) — pure CSS, no files
   =================================================================== */
.bs-default{
  background-image:
    radial-gradient(1.5px 1.5px at 6% 20%,#fff,transparent 60%),
    radial-gradient(1px 1px at 14% 78%,#cdd6f4,transparent 60%),
    radial-gradient(2px 2px at 24% 40%,#fff,transparent 60%),
    radial-gradient(1px 1px at 37% 12%,#fff,transparent 60%),
    radial-gradient(1.5px 1.5px at 43% 88%,hsl(var(--bs-h) 90% 82%),transparent 60%),
    radial-gradient(1px 1px at 52% 52%,#cdd6f4,transparent 60%),
    radial-gradient(1px 1px at 61% 24%,#fff,transparent 60%),
    radial-gradient(1.5px 1.5px at 68% 74%,#fff,transparent 60%),
    radial-gradient(1px 1px at 79% 10%,hsl(var(--bs-h) 90% 82%),transparent 60%),
    radial-gradient(1px 1px at 96% 46%,#fff,transparent 60%),
    radial-gradient(ellipse 55% 120% at 88% 60%,hsl(var(--bs-h) 70% 40% / .5),transparent 70%),
    radial-gradient(ellipse 50% 90% at 4% 105%,hsl(var(--bs-h) 80% 70% / .2),transparent 70%),
    linear-gradient(105deg,#05060f 0%,hsl(var(--bs-h) 55% 11%) 60%,hsl(var(--bs-h) 55% 16%) 100%);
}
.bs-def{position:relative; display:flex; align-items:center; gap:22px; min-height:190px; padding:26px 190px 26px 28px}
.bs-mono{
  flex:0 0 72px; width:72px; height:72px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  font:800 2.1rem/1 system-ui,sans-serif; color:#fff; text-shadow:0 2px 8px rgba(0,0,0,.45); user-select:none; overflow:hidden;
  background:radial-gradient(circle at 30% 25%,hsl(var(--bs-h) 80% 72%),hsl(var(--bs-h) 60% 42%) 55%,hsl(var(--bs-h) 55% 16%));
  border:2px solid rgba(205,214,244,.55); box-shadow:0 0 24px hsl(var(--bs-h) 90% 70% / .45), inset -7px -7px 16px rgba(0,0,0,.35);
}
.bs-def-text{min-width:0; flex:1 1 auto}
.bs-def-eyebrow{margin:0 0 6px; font:600 .7rem/1 ui-monospace,monospace; letter-spacing:.2em; text-transform:uppercase; color:hsl(var(--bs-h) 90% 80%)}
.bs-def-name{
  margin:0; font:800 clamp(1.7rem,4.6vw,2.7rem)/1.1 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; color:#fff; letter-spacing:.005em;
  overflow-wrap:anywhere; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; line-clamp:2; overflow:hidden;
  padding-bottom:.14em; margin-bottom:-.14em; /* room for descenders under overflow:hidden */
  text-shadow:0 0 22px hsl(var(--bs-h) 90% 70% / .55), 0 2px 10px rgba(0,0,0,.6);
}
.bs-def-by{margin:8px 0 0; font:600 .78rem/1.2 ui-monospace,"Courier New",monospace; letter-spacing:.12em; text-transform:uppercase; color:var(--bs-dim); overflow-wrap:anywhere}
.bs-def-by b{color:var(--bs-text); font-weight:700; letter-spacing:.05em; text-transform:none}

/* CSS planet / ring / moon (same motif as the error pages) */
.bs-orbit{position:absolute; right:42px; top:50%; width:118px; height:118px; margin-top:-52px; pointer-events:none}
.bs-orbit::before{content:""; position:absolute; left:-24px; right:-24px; top:50%; height:40px; margin-top:-20px; border-radius:50%;
  border:2px solid hsl(var(--bs-h) 90% 75% / .55); transform:rotate(-18deg); box-shadow:0 0 12px hsl(var(--bs-h) 90% 70% / .35)}
.bs-planet{position:absolute; inset:14px; border-radius:50%;
  background:radial-gradient(circle at 32% 28%,hsl(var(--bs-h) 90% 85%) 0%,hsl(var(--bs-h) 62% 62%) 28%,hsl(var(--bs-h) 55% 36%) 62%,hsl(var(--bs-h) 60% 8%) 100%);
  box-shadow:0 0 34px hsl(var(--bs-h) 90% 70% / .5), inset -12px -9px 22px rgba(0,0,0,.55)}
.bs-planet::after{content:""; position:absolute; left:-26px; right:-26px; top:50%; height:40px; margin-top:-20px; border-radius:50%;
  border:2px solid rgba(205,214,244,.7); border-top-color:transparent; border-left-color:transparent; border-right-color:transparent; transform:rotate(-18deg)}
.bs-moon{position:absolute; width:13px; height:13px; border-radius:50%; right:-6px; top:4px;
  background:radial-gradient(circle at 35% 30%,#fff,#a6adc8 60%,#45475a); box-shadow:0 0 8px rgba(205,214,244,.6)}
@media (prefers-reduced-motion:no-preference){
  .bs-moon{animation:bs-float 6s ease-in-out infinite}
  .bs-planet{animation:bs-glow 5s ease-in-out infinite}
}
@keyframes bs-float{0%,100%{transform:translate(0,0)}50%{transform:translate(-6px,8px)}}
@keyframes bs-glow{0%,100%{box-shadow:0 0 28px hsl(var(--bs-h) 90% 70% / .4), inset -12px -9px 22px rgba(0,0,0,.55)}50%{box-shadow:0 0 44px hsl(var(--bs-h) 90% 70% / .7), inset -12px -9px 22px rgba(0,0,0,.55)}}

/* ===================================================================
   Owner-only "Change sign" button (CGI emits it only for the owner)
   =================================================================== */
.bs-edit{
  position:absolute; top:10px; right:10px; z-index:4; display:inline-flex; align-items:center; justify-content:center; gap:7px;
  min-height:44px; min-width:44px; padding:8px 16px; border:2px solid var(--bs-accent); border-radius:9999px;
  background:rgba(5,6,15,.82); color:var(--bs-accent) !important; text-decoration:none; cursor:pointer;
  font:700 .88rem/1 system-ui,sans-serif; letter-spacing:.02em; -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px);
  box-shadow:0 2px 12px rgba(0,0,0,.55); transition:background .2s,box-shadow .2s,transform .15s;
}
.bs-edit::before{content:"\270E"; font-size:1.05rem; line-height:1}
.bs-edit:hover,.bs-edit:focus-visible{background:rgba(24,30,70,.92); box-shadow:0 0 16px rgba(137,180,250,.65); transform:translateY(-1px)}
.bs-edit:focus-visible{outline:2px solid #fff; outline-offset:3px}

/* ===================================================================
   Upload form block (styled like ms-pages forms)
   =================================================================== */
.bs-upload{
  position:relative; width:100%; margin:0 0 20px; padding:18px 20px 20px; color:var(--bs-text);
  background:var(--ms-panel2,rgba(30,30,46,.95)); border:1px solid rgba(137,180,250,.25); border-radius:12px;
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; line-height:1.45;
}
/* no-JS reveal: add .bs-target to the form block and it stays hidden until the owner follows the
   "Change sign" link (href="#bs-upload").  Without .bs-target the block is always visible. */
.bs-upload.bs-target:not(:target){display:none}
.bs-upload:target{border-color:var(--bs-accent); box-shadow:0 0 22px rgba(137,180,250,.35)}
.bs-up-title{margin:0 0 6px; color:#fff; font-size:1.15rem; line-height:1.25; font-weight:700}
.bs-up-intro{margin:0 0 14px; color:var(--bs-dim); font-size:.92rem}
.bs-form{display:flex; flex-direction:column; gap:14px; margin:0}
.bs-field{display:flex; flex-direction:column; gap:6px; min-width:0}
.bs-label{display:block; margin:0; font-size:.88rem; font-weight:600; color:var(--bs-text); letter-spacing:.03em}
.bs-req{margin:0; font-size:.82rem; color:var(--bs-dim)}
.bs-req b{color:var(--bs-text); font-weight:600}
.bs-file{
  display:block; width:100%; min-width:0; min-height:56px; padding:6px 8px; background:#11111b; color:var(--bs-text);
  border:2px dashed var(--bs-edge); border-radius:10px; font:.92rem/1.3 system-ui,sans-serif; cursor:pointer; outline:none;
  transition:border-color .2s,box-shadow .2s;
}
.bs-file::file-selector-button{
  min-height:44px; margin:0 12px 0 0; padding:10px 18px; border:2px solid var(--bs-accent); border-radius:9999px; background:transparent;
  color:var(--bs-accent); font:700 .92rem/1 system-ui,sans-serif; cursor:pointer; transition:background .2s,box-shadow .2s;
}
.bs-file:hover::file-selector-button{background:rgba(137,180,250,.16)}
.bs-file:focus-visible{border-style:solid; border-color:var(--bs-accent); box-shadow:0 0 14px rgba(137,180,250,.45); outline:2px solid #fff; outline-offset:2px}
.bs-file[aria-invalid="true"]{border-color:var(--bs-bad)}

/* preview slot: current sign, or the JS-chosen file */
.bs-preview{
  display:flex; align-items:center; justify-content:center; min-height:120px; padding:10px; overflow:hidden; border-radius:10px; text-align:center;
  background:#07081a; border:1px solid rgba(137,180,250,.25);
}
.bs-preview-img{display:block; height:auto; max-width:100%; max-height:140px; object-fit:contain}
.bs-preview-empty{color:var(--bs-dim); font-size:.88rem; max-width:34ch}
.bs-preview-cap{margin:-2px 0 0; font:600 .68rem/1.2 ui-monospace,monospace; letter-spacing:.14em; text-transform:uppercase; color:var(--bs-dim)}

/* message / progress area (aria-live).  states: .bs-ok  .bs-err  (no state = neutral info) */
.bs-msg{
  margin:0; padding:10px 14px; border-left:4px solid var(--bs-accent); border-radius:0 8px 8px 0;
  background:rgba(137,180,250,.08); color:var(--bs-text); font-size:.92rem; overflow-wrap:anywhere;
}
.bs-msg:empty{display:none}
.bs-msg.bs-ok{border-left-color:var(--bs-ok); background:rgba(0,255,136,.07)}
.bs-msg.bs-err{border-left-color:var(--bs-bad); background:rgba(255,102,102,.09)}
.bs-msg.bs-ok::before{content:"\2713\00a0"; color:var(--bs-ok); font-weight:800}
.bs-msg.bs-err::before{content:"\26A0\00a0"; color:var(--bs-bad); font-weight:800}
.bs-progress{display:block; width:100%; height:10px; margin:0; border:0; border-radius:6px; overflow:hidden; background:rgba(137,180,250,.16); -webkit-appearance:none; appearance:none}
.bs-progress::-webkit-progress-bar{background:rgba(137,180,250,.16)}
.bs-progress::-webkit-progress-value{background:linear-gradient(90deg,var(--bs-edge),var(--bs-accent)); border-radius:6px}
.bs-progress::-moz-progress-bar{background:linear-gradient(90deg,var(--bs-edge),var(--bs-accent)); border-radius:6px}
.bs-progress[hidden]{display:none}
.bs-actions{display:flex; flex-wrap:wrap; gap:10px}

/* ===================================================================
   Small screens (390px must never overflow)
   =================================================================== */
@media (max-width:560px){
  .bs-sign,.bs-upload{--bs-maxh:140px}
  .bs-sign{border-radius:14px; margin-bottom:16px}
  .bs-stage{min-height:92px; padding:8px}
  .bs-sign.bs-has-cap .bs-stage{padding-bottom:40px}
  .bs-sign.bs-own .bs-stage{padding-top:8px}
  .bs-cap{padding:24px 12px 8px}
  .bs-cap-name{font-size:1.02rem}
  .bs-edit{top:8px; right:8px; padding:8px 14px}
  .bs-def{gap:14px; min-height:150px; padding:20px 14px 20px 16px; align-items:center}
  .bs-sign.bs-own .bs-def{padding-top:60px}
  .bs-mono{flex-basis:52px; width:52px; height:52px; font-size:1.5rem}
  .bs-def-name{font-size:1.5rem; line-height:1.12; -webkit-line-clamp:3; line-clamp:3}
  .bs-def-eyebrow{font-size:.62rem; letter-spacing:.14em}
  .bs-orbit{width:84px; height:84px; right:22px; top:auto; bottom:6px; margin-top:0; opacity:.55}
  .bs-orbit::before{left:-16px; right:-16px; height:30px; margin-top:-15px}
  .bs-planet{inset:10px}
  .bs-planet::after{left:-18px; right:-18px; height:30px; margin-top:-15px}
  .bs-moon{width:10px; height:10px}
  .bs-upload{padding:16px 14px 18px}
  .bs-actions .ms-btn{flex:1 1 100%}
  .bs-file::file-selector-button{display:block; margin:0 0 6px; width:100%}
  .bs-file{padding:8px}
}
@media (max-width:360px){
  .bs-def-name{font-size:1.3rem}
  .bs-orbit{display:none}
}
@media (prefers-reduced-motion:reduce){
  .bs-edit,.bs-file,.bs-file::file-selector-button{transition:none}
}

/* pod-copy form (merged from brandsign-pod-merge.css) */
.bs-upload-pod{display:flex; flex-direction:column; gap:10px; margin:16px 0 0; padding-top:16px; border-top:1px solid rgba(137,180,250,.18)}
.bs-title{margin:0; color:#fff; font-size:1.05rem; font-weight:700; line-height:1.25}
.bs-hint{margin:0; font-size:.85rem; color:var(--bs-dim)}
.bs-row{display:flex; flex-wrap:wrap; align-items:center; gap:10px}
.bs-submit{min-height:44px}
@media (max-width:560px){ .bs-row .bs-submit{flex:1 1 100%} }
