/* Minimal Card v2 - deployed client styles
   Sharp, square-edged monochrome card. Visuals mirror the editor's mn-*
   preview rules (NewEditor.css) so the live page matches the builder; the
   page structure (root/scroll/page-bg/hero/desktop frame) follows Modern
   Card's deployed layout with the legacy Minimal Card values (420px hero,
   480px on desktop, blurred fullscreen hero behind a centered 566px card
   with a 24px radius + dark scrim). Tone (light/dark) comes from the page
   base via inline CSS vars: --mn-text, --mn-muted, --mn-faint, --mn-border,
   --mn-hover, --mn-fade-color.
   VERSION: 1.1 (desktop card body-stack fills the 566px card) */

* { box-sizing: border-box; }

html,
body,
#root {
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: #ffffff;
  color: #0a0a0a;
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* Center the card; the frame (below) sits behind it on desktop. On mobile the
   card fills the screen. */
#root {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* Desktop backdrop behind the card — a blurred, darkened version of the hero
   (set by the client) or a tone-matched neutral. Hidden on mobile. */
.mn-frame { display: none; }

.mn-root {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
  color: var(--mn-text, #0a0a0a);
  background: #ffffff;
  font-family: 'Inter', system-ui, sans-serif;
}

.mn-page-bg-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.mn-scroll {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 32px;
  -webkit-overflow-scrolling: touch;
}
.mn-scroll::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* Desktop: blurred fullscreen hero behind a centered 566px card — the legacy
   Minimal Card layout. */
@media (min-width: 768px) {
  #root { align-items: center; padding: 20px; }
  .mn-frame {
    display: block;
    position: fixed;
    inset: -40px;
    z-index: 0;
    background-color: #ffffff;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(40px) saturate(1.2);
  }
  .mn-frame.is-page-dark { background-color: #0a0a0a; }
  .mn-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
  }
  .mn-frame.is-page-dark::after { background: rgba(0, 0, 0, 0.5); }
  .mn-root {
    width: 566px;
    max-width: calc(100vw - 40px);
    height: calc(100vh - 64px);
    min-height: 600px;
    max-height: 900px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  }
  .mn-hero { height: 480px; }
  /* Fill the wider desktop card — the 430px mobile cap would otherwise leave
     the name, links and buttons floating narrow inside the 566px card. */
  .mn-body-stack { max-width: 100%; }
}

.mn-header { position: relative; width: 100%; }

/* Hero — optional photo/video that dissolves into the page base (mask fade) */
.mn-hero {
  position: relative;
  width: 100%;
  height: 420px;
  overflow: hidden;
}
.mn-hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
}
.mn-hero-fade { position: absolute; inset: 0; pointer-events: none; }

/* Body */
.mn-body-stack {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}
.mn-body-stack.has-hero { margin-top: -8px; }
.mn-section-item { position: relative; width: 100%; }
.mn-section-item + .mn-section-item { margin-top: 26px; }

/* Profile — uppercase letter-spaced name, quiet supporting copy */
.mn-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 26px 4px 0;
}
.mn-name-row { display: flex; align-items: center; justify-content: center; gap: 8px; }
.mn-name {
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.3;
  margin: 0 0 6px;
  word-break: break-word;
}
.mn-handle { margin: 0 0 4px; letter-spacing: 0.02em; }
.mn-bio { margin: 8px 0 0; max-width: 300px; line-height: 1.6; word-break: break-word; white-space: pre-wrap; }
.mn-profile-pills { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 6px; }
.mn-profile-pill { display: inline-flex; align-items: center; gap: 4px; letter-spacing: 0.02em; }
.mn-pill-icon { width: 11px; height: 11px; flex-shrink: 0; }
.mn-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  animation: mn-pulse 2s ease-in-out infinite;
}
@keyframes mn-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Socials — joined 40px cells, shared 1px borders, zero radius */
.mn-socials {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
}
.mn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--mn-border, #e8e8e8);
  margin-left: -1px;
  margin-top: -1px;
  background: transparent;
  transition: background 0.15s ease;
  font-size: 10px;
  font-weight: 600;
  color: var(--mn-muted, rgba(10, 10, 10, 0.5));
}
.mn-social:hover { background: var(--mn-hover, #fafafa); z-index: 1; }
.mn-social:focus-visible { outline: 2px solid rgba(120, 170, 255, 0.7); outline-offset: -2px; z-index: 1; }
.mn-social.is-disabled { cursor: default; opacity: 0.7; }
.mn-social.is-disabled:hover { background: transparent; }
.mn-social img { width: 16px; height: 16px; object-fit: contain; display: block; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.mn-socials.is-mono .mn-social img { filter: grayscale(1) contrast(1.05); }
.mn-socials.is-badge .mn-social { width: 44px; height: 44px; }

/* Links column — hairline divider above, 12px gaps */
.mn-links { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.mn-section-item.is-links::before {
  content: '';
  display: block;
  height: 1px;
  background: var(--mn-border, #e8e8e8);
  margin-bottom: 26px;
}
.mn-link-wrap { position: relative; }
.mn-link-anchor {
  display: block;
  position: relative;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  outline-offset: 2px;
}
.mn-link-anchor:focus-visible { outline: 2px solid rgba(120, 170, 255, 0.7); }

/* Simple link — flat row with arrow */
.mn-link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border: 1px solid var(--mn-link-border, var(--mn-border, #e8e8e8));
  background: var(--mn-link-bg, transparent);
  color: var(--mn-link-text, var(--mn-text, #0a0a0a));
  transition: background 0.15s ease;
}
.mn-link-wrap:hover .mn-link-card { background: var(--mn-hover, #fafafa); }
.mn-link-icon { display: inline-flex; align-items: center; flex-shrink: 0; }
.mn-link-icon img { width: 16px; height: 16px; object-fit: contain; display: block; user-select: none; -webkit-user-drag: none; }
.mn-link-icon span { font-size: 10px; font-weight: 800; line-height: 1; }
.mn-link-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mn-link-arrow {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.3;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.mn-link-wrap:hover .mn-link-arrow { opacity: 1; transform: translateX(2px); }

/* Header block — small uppercase label */
.mn-link-header {
  padding: 6px 0 0;
  letter-spacing: 0.08em;
  font-weight: 600;
  background: var(--mn-header-bg, transparent);
  border-bottom: 1px solid var(--mn-header-border, transparent);
}

/* Text block — bordered quiet note */
.mn-link-note {
  padding: 14px 16px;
  border: 1px solid var(--mn-text-border, var(--mn-border, #e8e8e8));
  background: var(--mn-text-bg, transparent);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Divider block */
.mn-link-divider { display: flex; align-items: center; padding: 4px 0; }
.mn-link-divider span {
  display: block;
  width: 100%;
  height: var(--mn-divider-thickness, 1px);
  background: var(--mn-divider-color, var(--mn-border, #e8e8e8));
}
.mn-link-divider-chars { color: var(--mn-divider-color, currentColor); }
.mn-link-divider-chars span { background: none; width: auto; height: auto; letter-spacing: 0.3em; }

/* Featured card — image with overlay copy + tag chip */
.mn-featured-card {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--mn-featured-border, var(--mn-border, #e8e8e8));
  background: var(--mn-featured-bg, transparent);
}
.mn-featured-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.mn-featured-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: repeating-linear-gradient(45deg, transparent 0 10px, rgba(127, 127, 127, 0.06) 10px 20px);
}
.mn-featured-copy {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mn-featured-card.is-empty .mn-featured-copy { background: none; }
.mn-featured-card.is-empty .mn-featured-title { color: var(--mn-featured-title, var(--mn-text)); }
.mn-featured-card.is-empty .mn-featured-subtitle { color: var(--mn-featured-subtitle, var(--mn-muted)); }
.mn-featured-tag {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mn-featured-tag-text, #ffffff);
  background: var(--mn-featured-tag-bg, #0a0a0a);
  display: inline-block;
  padding: 2px 6px;
  align-self: flex-start;
  margin-bottom: 4px;
}
.mn-featured-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--mn-featured-title, #ffffff);
}
.mn-featured-icon { display: inline-flex; align-items: center; }
.mn-featured-icon img { width: 14px; height: 14px; object-fit: contain; display: block; user-select: none; -webkit-user-drag: none; }
.mn-featured-icon span { font-size: 9px; font-weight: 800; line-height: 1; }
.mn-featured-subtitle { font-size: 11px; color: var(--mn-featured-subtitle, rgba(255, 255, 255, 0.78)); }

/* Gallery — square tiles, 1px borders, quiet labels below */
.mn-gallery-card { width: 100%; }
.mn-gallery-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mn-muted, rgba(10, 10, 10, 0.5));
  margin-bottom: 8px;
}
.mn-gallery-grid {
  display: grid;
  grid-template-columns: repeat(var(--mn-gallery-columns, 2), minmax(0, 1fr));
  gap: 12px;
}
.mn-gallery-tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}
.mn-gallery-tile.is-clickable { cursor: zoom-in; }
.mn-gallery-tile.is-clickable:focus-visible { outline: 2px solid rgba(120, 170, 255, 0.7); outline-offset: 2px; }
.mn-gallery-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--mn-gallery-border, var(--mn-border, #e8e8e8));
  background: transparent;
}
.mn-gallery-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.mn-gallery-empty {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, transparent 0 10px, rgba(127, 127, 127, 0.06) 10px 20px);
}
.mn-gallery-label {
  padding: 7px 2px 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--mn-gallery-text, var(--mn-text, #0a0a0a));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Media embed — flat 1px frame, sizing applied inline per platform */
.mn-media-card { width: 100%; }
.mn-media-frame {
  width: 100%;
  display: block;
  border: 1px solid var(--mn-media-border, var(--mn-border, #e8e8e8));
  background: #000;
  overflow: hidden;
}
.mn-media-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 1px dashed var(--mn-media-border, var(--mn-border, #e8e8e8));
  color: var(--mn-muted, rgba(10, 10, 10, 0.5));
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.mn-media-copy { padding: 8px 2px 0; }
.mn-media-title { font-size: 12px; font-weight: 600; color: var(--mn-media-title, var(--mn-text)); }
.mn-media-caption { font-size: 11px; margin-top: 2px; color: var(--mn-media-caption, var(--mn-muted)); }

/* Empty state */
.mn-empty-prompt {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 56px 28px;
}
.mn-empty-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mn-text, #0a0a0a);
}
.mn-empty-sub { font-size: 12px; margin-top: 6px; color: var(--mn-muted, rgba(10, 10, 10, 0.5)); }

/* "Powered by Bouncy" footer — uppercase, square, monochrome (theme-var driven) */
.mn-footer { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--mn-border, #e8e8e8); text-align: center; }
.mn-footer-content { display: inline-flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; color: var(--mn-muted, rgba(10, 10, 10, 0.5)); }
.mn-footer-brand { color: var(--mn-text, #0a0a0a); text-decoration: none; transition: opacity 0.15s; }
.mn-footer-brand:hover { opacity: 0.6; }

/* Adult content inline warning */
.mn-link-anchor.has-adult-warning { overflow: hidden; }
.mn-adult-inline {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 10px;
  background: rgba(0, 0, 0, 0.95);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  color: #ffffff;
  text-align: center;
  border-radius: inherit;
}
.mn-adult-inline-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; max-width: 300px; }
.mn-adult-inline-title {
  display: block;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mn-adult-inline-body { display: block; color: rgba(255, 255, 255, 0.8); font-size: 11px; font-weight: 400; line-height: 1.3; }
.mn-adult-actions { display: flex; justify-content: center; gap: 8px; width: 100%; }
.mn-adult-btn {
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0;
  padding: 6px 14px;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.mn-adult-btn.secondary { background: rgba(255, 255, 255, 0.1); color: #ffffff; }
.mn-adult-btn.secondary:hover { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.3); }
.mn-adult-btn.primary { border-color: #ffffff; background: #ffffff; color: #0a0a0a; }
.mn-adult-btn.primary:hover { background: rgba(255, 255, 255, 0.9); }
/* Compact variant for flat simple rows */
.mn-link-anchor-simple .mn-adult-inline { padding: 7px 10px; }
.mn-link-anchor-simple .mn-adult-inline-inner { gap: 6px; }
.mn-link-anchor-simple .mn-adult-inline-title { display: none; }
.mn-link-anchor-simple .mn-adult-inline-body { font-size: 10px; white-space: nowrap; }
.mn-link-anchor-simple .mn-adult-btn { min-height: 22px; padding: 3px 10px; font-size: 10px; }

/* Gallery image lightbox */
.mn-image-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.mn-image-panel { position: relative; width: min(760px, 100%); max-height: min(82vh, 760px); display: grid; gap: 10px; }
.mn-image-preview {
  width: 100%;
  max-height: min(76vh, 700px);
  display: block;
  object-fit: contain;
  background: #0a0a0a;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
  user-select: none;
  -webkit-user-drag: none;
}
.mn-image-close {
  justify-self: end;
  min-height: 32px;
  border: 1px solid #0a0a0a;
  border-radius: 0;
  padding: 0 14px;
  background: #ffffff;
  color: #0a0a0a;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.mn-image-caption {
  justify-self: center;
  max-width: min(560px, 100%);
  padding: 7px 12px;
  border: 1px solid #e8e8e8;
  background: #ffffff;
  color: #0a0a0a;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .mn-status-dot { animation: none !important; }
}

/* ============================================================================
   Combined follower counter — themed pill (.ne-fpill via --fp-*) + ALWAYS-DARK
   breakdown sheet (.ne-fsheet-*). KEEP IN PARITY with NewEditor.css.
   ============================================================================ */
.mn-socials-wrap { display: flex; flex-direction: column; align-items: center; }
.ne-fpill { display: flex; align-items: baseline; justify-content: center; gap: 6px; width: fit-content; margin: var(--fp-margin, 14px auto 0); padding: var(--fp-pad, 8px 16px); background: var(--fp-bg, rgba(0,0,0,0.05)); border: var(--fp-border, 1px solid rgba(0,0,0,0.12)); border-radius: var(--fp-radius, 999px); color: var(--fp-text, inherit); font-family: inherit; line-height: 1; cursor: pointer; transition: border-color .15s, transform .12s, background .15s; }
.ne-fpill:hover { border-color: var(--fp-border-hover, rgba(0,0,0,0.28)); }
.ne-fpill:active { transform: scale(0.97); }
.ne-fpill-num { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; }
.ne-fpill-label { font-size: 12.5px; color: var(--fp-muted, currentColor); opacity: .72; }
.ne-fsheet-overlay { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: flex-end; background: rgba(0,0,0,0.5); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.ne-fsheet { width: 100%; max-width: 520px; margin: 0 auto; max-height: 80%; overflow-y: auto; background: #161618; color: #f4f4f6; border-radius: 20px 20px 0 0; padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -16px 44px rgba(0,0,0,0.5); animation: ne-fsheet-up .3s cubic-bezier(.22,.61,.36,1); }
@keyframes ne-fsheet-up { from { transform: translateY(100%); } to { transform: none; } }
.ne-fsheet-grab { width: 38px; height: 4px; border-radius: 999px; background: rgba(255,255,255,0.22); margin: 2px auto 14px; }
.ne-fsheet-total { text-align: center; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.ne-fsheet-sub { text-align: center; font-size: 12.5px; opacity: .6; margin-top: 2px; }
.ne-fsheet-list { display: flex; flex-direction: column; margin-top: 14px; }
.ne-fsheet-row { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-top: 1px solid rgba(255,255,255,0.08); }
.ne-fsheet-row:first-child { border-top: none; }
.ne-fsheet-ic { width: 28px; height: 28px; flex: none; display: grid; place-items: center; opacity: .85; }
.ne-fsheet-ic img { width: 24px; height: 24px; object-fit: contain; }
.ne-fsheet-name { flex: 1; min-width: 0; font-size: 14.5px; }
.ne-fsheet-count { font-size: 14.5px; font-weight: 700; }
.ne-fsheet-empty { opacity: .6; font-size: 13px; text-align: center; padding: 14px; }
.ne-fsheet-done { width: 100%; margin-top: 16px; min-height: 46px; border: none; border-radius: 12px; background: #ffffff; color: #111111; font-weight: 700; font-size: 14.5px; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .ne-fsheet { animation: none; } }

/* theme: Minimal Card — square, sharp; pill adapts to the page tone (--mn-* vars) */
.mn-root {
  --fp-bg: transparent;
  --fp-border: 1px solid var(--mn-border, rgba(128,128,128,0.4));
  --fp-border-hover: var(--mn-text, #111111);
  --fp-text: var(--mn-text, #111111); --fp-muted: var(--mn-muted, #777777); --fp-radius: 0;
}
