/* lp-showcase-modal.css — Shared Showcase preview modal (Persona-style 3-section).
 *
 * Used by both home (`/`) and `/showcase` landing pages. 3-section vertical
 * layout: head bar (kind + author + ×) / body (cover + info side-by-side or
 * stacked) / footer (close + CTA). Mode switching via data-mode attr:
 *   - card    → static cover + info + footer
 *   - iframe  → fullscreen embed (head bar + iframe, hides body + foot)
 *   - video   → local mp4/webm playback
 *   - youtube → youtube embed
 *
 * Namespace: lpscm-* ("LP showcase modal"). Dual-theme via :root[data-page="lp"]
 * tokens. Sharp corners (border-radius: 0) and clip-path parallelograms for
 * accent badges match Persona aesthetic.
 */

/* ─── Backdrop ─── */
.lpscm-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px) saturate(120%);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.lpscm-modal[data-open="1"] {
  opacity: 1;
  pointer-events: auto;
}

/* ─── Dialog box (3-section column) ─── */
.lpscm-box {
  position: relative;
  width: 100%;
  max-width: 760px;
  max-height: calc(100vh - 64px);
  background: var(--p5-card);
  color: var(--p5-text);
  border: 1px solid var(--p5-border-strong);
  border-radius: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(12px) scale(0.985);
  opacity: 0;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms;
  box-shadow: 0 32px 88px rgba(0, 0, 0, 0.55);
}
.lpscm-modal[data-open="1"] .lpscm-box {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Iframe / video / youtube modes — bigger frame for embedded content */
.lpscm-box[data-mode="iframe"],
.lpscm-box[data-mode="youtube"] {
  max-width: 1100px;
  width: calc(100vw - 48px);
  height: calc(100vh - 64px);
  max-height: none;
}
/* In media modes hide the static info body + footer (head bar stays) */
.lpscm-box[data-mode="iframe"] .lpscm-body,
.lpscm-box[data-mode="iframe"] .lpscm-foot,
.lpscm-box[data-mode="youtube"] .lpscm-body,
.lpscm-box[data-mode="youtube"] .lpscm-foot,
.lpscm-box[data-mode="video"] .lpscm-foot { display: none; }

/* Hide media elements that aren't active for the current mode */
.lpscm-box[data-mode="card"] .lpscm-iframe,
.lpscm-box[data-mode="card"] .lpscm-video,
.lpscm-box[data-mode="card"] .lpscm-youtube-frame { display: none; }
.lpscm-box[data-mode="iframe"] .lpscm-video,
.lpscm-box[data-mode="iframe"] .lpscm-youtube-frame { display: none; }
.lpscm-box[data-mode="youtube"] .lpscm-iframe,
.lpscm-box[data-mode="youtube"] .lpscm-video { display: none; }
.lpscm-box[data-mode="video"] .lpscm-iframe,
.lpscm-box[data-mode="video"] .lpscm-youtube-frame { display: none; }

/* Hide any legacy floating chip (now rendered in head bar) */
.lpscm-cat-chip { display: none !important; }

.lpscm-iframe {
  width: 100%;
  flex: 1;
  border: 0;
  display: block;
  background: var(--p5-bg);
}

/* Video mode — local mp4/webm. Box auto-sizes to video's aspect ratio. */
.lpscm-box[data-mode="video"] {
  max-width: 1100px;
  width: auto;
  height: auto;
  max-height: calc(100vh - 64px);
}
.lpscm-box[data-mode="video"] .lpscm-body { padding: 0; display: block; }
.lpscm-box[data-mode="video"] .lpscm-cover { display: none; }
.lpscm-box[data-mode="video"] .lpscm-info { display: none; }
.lpscm-video {
  width: 100%;
  max-width: 1100px;
  max-height: calc(100vh - 64px);
  display: block;
  background: #000;
  outline: none;
}

/* YouTube mode — iframe inside .lpscm-youtube-frame */
.lpscm-youtube-frame {
  position: relative;
  width: 100%;
  flex: 1;
  background: #000;
}
.lpscm-youtube-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ─── Head bar (kind mark + label + by-author + ×) ─── */
.lpscm-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 14px 20px;
  border-bottom: 1px solid var(--p5-border);
  background: var(--p5-card);
  gap: 14px;
}
.lpscm-head-l {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-family: 'Consolas', 'Monaco', 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--p5-muted);
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lpscm-kind-mark {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--p5-red);
  flex-shrink: 0;
}
.lpscm-head-kind { color: var(--p5-text); font-weight: 700; }
.lpscm-head-sep { color: var(--p5-border-strong); }
.lpscm-head-author {
  color: var(--p5-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* Close button — square outline, top-right of head bar */
.lpscm-close {
  width: 36px;
  height: 36px;
  background: transparent;
  color: var(--p5-text-secondary);
  border: 1px solid var(--p5-border);
  border-radius: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 140ms ease, color 140ms ease;
}
.lpscm-close:hover {
  border-color: var(--p5-red);
  color: var(--p5-red);
}
.lpscm-close svg { width: 14px; height: 14px; }

/* ─── Body (cover on top, info below — card mode only) ─── */
.lpscm-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0;
}

/* ─── Cover (top, big visual) ─── */
.lpscm-cover {
  position: relative;
  width: 100%;
  background: var(--p5-bg);
  aspect-ratio: 16 / 10;
  overflow: hidden;
  flex-shrink: 0;
  border-bottom: 1px solid var(--p5-border);
}
.lpscm-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.lpscm-cover-ph {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(230, 57, 70, 0.18), transparent 60%),
    linear-gradient(135deg, var(--p5-card) 0%, var(--p5-bg) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--p5-muted);
  font-family: 'Consolas', 'Monaco', 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ─── Info block ─── */
.lpscm-info {
  padding: 28px 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lpscm-kind {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Oswald', 'Noto Sans SC', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--p5-red);
  text-transform: uppercase;
}
.lpscm-kind-swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--p5-red);
}
.lpscm-title {
  margin: 0;
  font-family: 'Oswald', 'Noto Sans SC', sans-serif;
  font-weight: 700;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.005em;
  color: var(--p5-text);
  word-break: break-word;
}
.lpscm-en {
  font-family: 'Playfair Display', 'DM Serif Display', Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: 16px;
  color: var(--p5-red-2, var(--p5-red));
  line-height: 1.25;
  letter-spacing: -0.005em;
}
.lpscm-en:empty { display: none; }
.lpscm-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--p5-text-secondary);
  word-break: break-word;
  max-height: 110px;
  overflow-y: auto;
}
.lpscm-desc:empty { display: none; }

/* Meta-row — # hashtag chips with mono font + thin border */
.lpscm-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.lpscm-meta-row:empty { display: none; }
.lpscm-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--p5-border);
  font-family: 'Consolas', 'Monaco', 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--p5-text-secondary);
  letter-spacing: 0.04em;
  background: transparent;
}

/* Author block — dashed top border + 36px square avatar swatch + 2-line label */
.lpscm-by {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 18px;
  border-top: 1px dashed var(--p5-border);
}
.lpscm-by-avatar {
  width: 36px;
  height: 36px;
  background: var(--p5-red);
  display: inline-block;
  flex-shrink: 0;
}
.lpscm-by-who {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: 'Oswald', 'Noto Sans SC', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--p5-text);
  letter-spacing: 0.04em;
  min-width: 0;
}
.lpscm-by-who > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lpscm-by-who small {
  font-family: 'Consolas', 'Monaco', 'JetBrains Mono', monospace;
  font-weight: 400;
  font-size: 10px;
  color: var(--p5-muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ─── Footer (close ghost + CTA parallelogram) ─── */
.lpscm-foot {
  flex-shrink: 0;
  border-top: 1px solid var(--p5-border);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--p5-card);
}
.lpscm-btn-ghost {
  background: transparent;
  border: 1px solid var(--p5-border);
  color: var(--p5-text-secondary);
  font-family: 'Oswald', 'Noto Sans SC', sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.14em;
  padding: 11px 22px;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease;
}
.lpscm-btn-ghost:hover {
  border-color: var(--p5-red);
  color: var(--p5-text);
}

.lpscm-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--p5-red-gradient, var(--p5-red));
  color: #fff;
  border: none;
  font-family: 'Oswald', 'Noto Sans SC', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 13px 24px 13px 28px;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.lpscm-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px -8px rgba(230, 57, 70, 0.7);
}
.lpscm-btn-primary svg { width: 14px; height: 14px; }

/* ─── Body lock when modal open ─── */
body.lpscm-locked {
  overflow: hidden;
}

/* ─── Mobile ─── */
@media (max-width: 720px) {
  .lpscm-modal { padding: 12px; }
  .lpscm-box { max-height: calc(100vh - 24px); }
  .lpscm-box[data-mode="iframe"],
  .lpscm-box[data-mode="youtube"] {
    width: calc(100vw - 24px);
    height: calc(100vh - 24px);
  }
  .lpscm-head { padding: 12px 12px 12px 16px; }
  .lpscm-head-l { font-size: 10px; gap: 8px; }
  .lpscm-info { padding: 22px 20px 14px; gap: 10px; }
  .lpscm-title { font-size: 22px; }
  .lpscm-en { font-size: 14px; }
  .lpscm-by { margin-top: 10px; padding-top: 14px; }
  .lpscm-by-avatar { width: 32px; height: 32px; }
  .lpscm-foot { padding: 12px 16px; gap: 10px; }
  .lpscm-btn-ghost,
  .lpscm-btn-primary {
    padding: 10px 16px;
    font-size: 12px;
    letter-spacing: 0.12em;
  }
  .lpscm-btn-primary { padding-left: 22px; padding-right: 18px; }
}
