/* MLMPage Projects — front-end styles.
   Every rule is scoped to a .mlmp-* class. No bare element selectors, no
   :root variables, nothing that can leak into the theme or other plugins. */

.mlmp-wrap,
.mlmp-single,
.mlmp-manage {
    --mlmp-ink: #14213d;
    --mlmp-soft: #3a4666;
    --mlmp-line: #e4e0d3;
    --mlmp-gold: #b8862f;
    --mlmp-gold-d: #8f6822;
    --mlmp-teal: #2e7d6b;
    --mlmp-panel: #f1efe6;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--mlmp-soft);
    box-sizing: border-box;
    max-width: 100%;
}
.mlmp-wrap *, .mlmp-single *, .mlmp-manage * { box-sizing: border-box; }

/* ── Intro ──────────────────────────────────────────────────────── */
.mlmp-intro { text-align: center; margin: 0 0 28px; }
.mlmp-intro-title { font-size: clamp(1.6rem, 3.5vw, 2.2rem); color: var(--mlmp-ink); margin: 0 0 10px; }
.mlmp-intro-text { max-width: 60ch; margin: 0 auto 18px; font-size: 15.5px; }

/* ── Buttons ────────────────────────────────────────────────────── */
.mlmp-btn {
    display: inline-block; cursor: pointer;
    font: 600 13px/1 'IBM Plex Mono', ui-monospace, monospace;
    letter-spacing: .03em; padding: 12px 22px; border-radius: 8px;
    text-decoration: none!important; border: 1px solid var(--mlmp-ink);
    background: #fff; color: var(--mlmp-ink);
    transition: background .15s ease, color .15s ease;
}
.mlmp-btn:hover { background: var(--mlmp-ink); color: #fff; }
.mlmp-btn-primary { background: var(--mlmp-ink); color: #fff; }
.mlmp-btn-primary:hover { background: var(--mlmp-gold-d); border-color: var(--mlmp-gold-d); color: #fff; }
.mlmp-btn-sm { padding: 7px 13px; font-size: 12px; }
.mlmp-btn[disabled] { opacity: .55; cursor: default; }

/* ── Grid + cards ───────────────────────────────────────────────── */
.mlmp-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 620px)  { .mlmp-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .mlmp-grid { grid-template-columns: repeat(3, 1fr); } }

.mlmp-card {
    display: flex; flex-direction: column;
    border: 1px solid var(--mlmp-line); border-radius: 8px;
    background: #fff; overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease;
}
.mlmp-card:hover { transform: translateY(-2px); box-shadow: 0 8px 26px rgba(20,33,61,.10); }

.mlmp-card-media { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--mlmp-panel); overflow: hidden; }
.mlmp-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mlmp-card-media-ph { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, #eceadf, #f7f5ee); }

.mlmp-flag {
    position: absolute; top: 10px; left: 10px;
    background: var(--mlmp-gold); color: #fff;
    font: 600 11px/1 'IBM Plex Mono', monospace;
    padding: 5px 9px; border-radius: 3px; letter-spacing: .04em;
}
.mlmp-flag-inline { position: static; display: inline-block; }

.mlmp-card-body { padding: 16px 18px 14px; display: flex; flex-direction: column; flex: 1; }
.mlmp-card-head { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 9px; }
.mlmp-card-logo { width: 38px; height: 38px; border-radius: 7px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--mlmp-line); }
.mlmp-card-titles { min-width: 0; }
.mlmp-card-title { font-size: 1.03rem; margin: 0 0 2px; line-height: 1.3; }
.mlmp-card-title a { color: var(--mlmp-ink); text-decoration: none; }
.mlmp-card-title a:hover { color: var(--mlmp-gold-d); }

.mlmp-cat { display: inline-block; font: 500 11px/1 'IBM Plex Mono', monospace; color: var(--mlmp-teal); letter-spacing: .05em; text-transform: uppercase; }
.mlmp-card-desc { font-size: 14px; line-height: 1.6; margin: 0 0 12px; flex: 1; }

.mlmp-card-owner { display: flex; align-items: center; gap: 7px; font-size: 12.5px; margin-bottom: 11px; }
.mlmp-card-owner img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }

.mlmp-badge { font: 600 10.5px/1 'IBM Plex Mono', monospace; padding: 4px 8px; border-radius: 20px; letter-spacing: .04em; }
.mlmp-badge-free     { background: #eef1f6; color: #4b5772; }
.mlmp-badge-premium  { background: #e7f2ef; color: var(--mlmp-teal); }
.mlmp-badge-pro      { background: #f6edda; color: var(--mlmp-gold-d); }
.mlmp-badge-coaching { background: #eae6f8; color: #5b45a8; }

.mlmp-card-foot { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--mlmp-line); padding-top: 11px; flex-wrap: wrap; }
.mlmp-stat { font: 500 12px/1 'IBM Plex Mono', monospace; color: #8b93a7; }
.mlmp-cta {
    margin-left: auto; font: 600 12px/1 'IBM Plex Mono', monospace;
    background: var(--mlmp-ink); color: #fff !important; text-decoration: none!important;
    padding: 9px 15px; border-radius: 8px;
}
.mlmp-cta:hover { background: var(--mlmp-gold-d); }

.mlmp-more-wrap { text-align: center; margin-top: 26px; }
.mlmp-empty, .mlmp-login-note, .mlmp-limit-note, .mlmp-no-comments { text-align: center; font-size: 14.5px; color: #8b93a7; padding: 18px 0; }

/* ── Single project ─────────────────────────────────────────────── */
.mlmp-single { max-width: 860px; margin: 0 auto; }
.mlmp-single-cover { border-radius: 8px; overflow: hidden; margin-bottom: 20px; aspect-ratio: 21 / 9; }
.mlmp-single-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mlmp-single-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.mlmp-single-logo { width: 62px; height: 62px; border-radius: 10px; object-fit: cover; border: 1px solid var(--mlmp-line); flex-shrink: 0; }
.mlmp-single-title { font-size: clamp(1.5rem, 3.4vw, 2.1rem); color: var(--mlmp-ink); margin: 0 0 8px; line-height: 1.2; }
.mlmp-single-meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 13.5px; }
.mlmp-mini-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }

.mlmp-single-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.mlmp-react.is-on { background: var(--mlmp-gold); border-color: var(--mlmp-gold); color: #fff; }

.mlmp-socials { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; font-size: 13px; }
.mlmp-socials a { color: var(--mlmp-gold-d); }

.mlmp-single-stats { display: flex; gap: 22px; flex-wrap: wrap; border-top: 1px solid var(--mlmp-line); border-bottom: 1px solid var(--mlmp-line); padding: 13px 0; margin-bottom: 24px; font-size: 13.5px; }
.mlmp-single-stats strong { color: var(--mlmp-ink); }

/* ── Forms ──────────────────────────────────────────────────────── */
.mlmp-contact, .mlmp-comments, .mlmp-related { margin-top: 34px; }
.mlmp-contact h3, .mlmp-comments h3, .mlmp-related h3 { color: var(--mlmp-ink); font-size: 1.2rem; margin: 0 0 14px; }

.mlmp-lead-form, .mlmp-comment-form, .mlmp-project-form { display: flex; flex-direction: column; gap: 11px; max-width: 560px; }
.mlmp-project-form { max-width: 100%; }
.mlmp-lead-form input, .mlmp-lead-form textarea,
.mlmp-comment-form textarea,
.mlmp-project-form input, .mlmp-project-form textarea, .mlmp-project-form select {
    width: 100%; padding: 11px 13px; font-size: 15px; font-family: inherit;
    border: 1px solid var(--mlmp-line); border-radius: 6px; background: #fff; color: var(--mlmp-ink);
}
.mlmp-lead-form input:focus, .mlmp-lead-form textarea:focus,
.mlmp-comment-form textarea:focus,
.mlmp-project-form input:focus, .mlmp-project-form textarea:focus, .mlmp-project-form select:focus {
    outline: none; border-color: var(--mlmp-gold);
}
.mlmp-project-form label { display: block; font-size: 13px; font-weight: 600; color: var(--mlmp-ink); }
.mlmp-project-form label input, .mlmp-project-form label textarea, .mlmp-project-form label select { margin-top: 5px; font-weight: 400; }
.mlmp-check { display: flex !important; align-items: center; gap: 8px; }
.mlmp-check input { width: auto !important; }
.mlmp-socials-fields { border: 1px solid var(--mlmp-line); border-radius: 8px; padding: 14px; display: grid; gap: 9px; }
.mlmp-socials-fields legend { font-size: 12px; font-weight: 600; color: var(--mlmp-ink); padding: 0 6px; }
.mlmp-form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mlmp-form-msg, .mlmp-lead-msg, .mlmp-comment-msg { font-size: 13px; color: var(--mlmp-teal); }

/* Honeypot — hidden from people, visible to naive bots. */
.mlmp-hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; }

/* ── Comments ───────────────────────────────────────────────────── */
.mlmp-comment { display: flex; gap: 11px; padding: 13px 0; border-bottom: 1px solid var(--mlmp-line); }
.mlmp-comment strong { color: var(--mlmp-ink); font-size: 14px; }
.mlmp-comment-body { font-size: 14.5px; line-height: 1.6; margin-top: 3px; }

/* ── My Projects ────────────────────────────────────────────────── */
.mlmp-manage { max-width: 860px; margin: 0 auto; }
.mlmp-manage-head h2 { color: var(--mlmp-ink); margin: 0 0 6px; }
.mlmp-manage-list { display: flex; flex-direction: column; gap: 12px; margin: 20px 0; }
.mlmp-manage-item { border: 1px solid var(--mlmp-line); border-left: 3px solid var(--mlmp-gold); border-radius: 8px; padding: 15px 18px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.mlmp-manage-info strong { color: var(--mlmp-ink); display: block; }
.mlmp-manage-stats { display: flex; gap: 14px; flex-wrap: wrap; font: 500 12px/1 'IBM Plex Mono', monospace; color: #8b93a7; }
.mlmp-manage-actions { display: flex; gap: 8px; }
.mlmp-status { font: 600 10.5px/1 'IBM Plex Mono', monospace; padding: 4px 8px; border-radius: 20px; text-transform: uppercase; letter-spacing: .04em; }
.mlmp-status-publish { background: #e7f2ef; color: var(--mlmp-teal); }
.mlmp-status-pending { background: #fdf3e0; color: var(--mlmp-gold-d); }
.mlmp-status-draft   { background: #eef1f6; color: #4b5772; }
.mlmp-status-private { background: #f2eded; color: #8a5a5a; }

.mlmp-editor { border: 1px solid var(--mlmp-line); border-radius: 8px; padding: 22px; margin-top: 20px; background: #fff; }
.mlmp-editor h3 { color: var(--mlmp-ink); margin: 0 0 16px; }

@media (max-width: 600px) {
    .mlmp-single-head { flex-direction: column; }
    .mlmp-manage-item { flex-direction: column; align-items: flex-start; }
    .mlmp-card-foot { gap: 9px; }
    .mlmp-cta { margin-left: 0; width: 100%; text-align: center; }
}

/* ── Page shell (our own single template) ──────────────────────── */
.mlmp-page-shell { max-width: 1000px; margin: 0 auto; padding: 34px 20px 60px; }
@media (max-width: 600px) { .mlmp-page-shell { padding: 20px 14px 40px; } }

.mlmp-single-body { font-size: 16px; line-height: 1.75; margin: 26px 0; }
.mlmp-single-body p { margin: 0 0 16px; }
.mlmp-single-body h2, .mlmp-single-body h3 { color: var(--mlmp-ink); margin: 26px 0 10px; }
.mlmp-single-body img { max-width: 100%; height: auto; border-radius: 8px; }

/* ── Public gallery ─────────────────────────────────────────────── */
.mlmp-gallery-wrap { margin-top: 32px; }
.mlmp-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 700px) { .mlmp-gallery { grid-template-columns: repeat(4, 1fr); } }
.mlmp-gallery-item {
    padding: 0; border: 1px solid var(--mlmp-line); border-radius: 8px;
    overflow: hidden; cursor: zoom-in; background: none; aspect-ratio: 1 / 1;
}
.mlmp-gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Zoom overlay. Close button offset for the phone status bar in PWA mode,
   and the backdrop is tappable too so a single control can't trap anyone. */
.mlmp-zoom-overlay {
    position: fixed; inset: 0; z-index: 9999999;
    background: rgba(0,0,0,.92);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.mlmp-zoom-overlay img { max-width: 95vw; max-height: 90vh; object-fit: contain; border-radius: 6px; }
.mlmp-zoom-close {
    position: fixed;
    top: calc(16px + env(safe-area-inset-top, 0px));
    right: calc(16px + env(safe-area-inset-right, 0px));
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(0,0,0,.6); border: 1.5px solid rgba(255,255,255,.3);
    color: #fff; font-size: 24px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    z-index: 10000000; -webkit-appearance: none; appearance: none;
}

/* ── Editor media controls ──────────────────────────────────────── */
.mlmp-media-row { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .mlmp-media-row { grid-template-columns: 200px 1fr; } }
.mlmp-media-field { border: 1px solid var(--mlmp-line); border-radius: 8px; padding: 14px; }
.mlmp-media-label { display: block; font-size: 13px; font-weight: 600; color: var(--mlmp-ink); margin-bottom: 9px; }
.mlmp-media-label em { font-weight: 400; font-style: normal; color: #8b93a7; font-size: 12px; }
.mlmp-media-preview {
    border: 1px dashed var(--mlmp-line); border-radius: 8px; background: var(--mlmp-panel);
    display: flex; align-items: center; justify-content: center; overflow: hidden; margin-bottom: 10px;
}
.mlmp-media-logo { width: 90px; height: 90px; }
.mlmp-media-cover { width: 100%; aspect-ratio: 21 / 9; }
.mlmp-media-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mlmp-media-empty { font: 500 11.5px/1 'IBM Plex Mono', monospace; color: #a8afc0; padding: 8px; text-align: center; }
.mlmp-media-clear { color: #9a5b5b; }

.mlmp-gallery-field { margin-top: 4px; }
.mlmp-gallery-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; min-height: 40px; align-items: center; }
.mlmp-gal-thumb { position: relative; width: 64px; height: 64px; border-radius: 5px; overflow: hidden; border: 1px solid var(--mlmp-line); }
.mlmp-gal-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mlmp-gal-x {
    position: absolute; top: 2px; right: 2px; width: 20px; height: 20px;
    border-radius: 50%; border: none; background: rgba(0,0,0,.65); color: #fff;
    font-size: 14px; line-height: 1; cursor: pointer; padding: 0;
    display: flex; align-items: center; justify-content: center;
}
.mlmp-upsell {
    background: var(--mlmp-panel); border-left: 3px solid var(--mlmp-gold);
    padding: 12px 15px; border-radius: 8px; font-size: 13.5px; margin: 0;
}
.mlmp-upsell a { color: var(--mlmp-gold-d); font-weight: 600; }

/* ── Tier gating: locked fields + value-first upsell ───────────── */
.mlmp-locked-field { border: 1px dashed var(--mlmp-line); border-radius: 8px; padding: 14px; }
.mlmp-value-note {
    flex-basis: 100%;
    background: var(--mlmp-panel); border-left: 3px solid var(--mlmp-teal);
    padding: 11px 14px; border-radius: 8px; margin: 10px 0 0;
    font-size: 13.5px; line-height: 1.6;
}
.mlmp-value-note strong { color: var(--mlmp-ink); }
.mlmp-value-note a { color: var(--mlmp-gold-d); font-weight: 600; }

/* ── List layout ─────────────────────────────────────────────────
   Stacked, one project per row — reads as a ranked social feed, where
   the #1 scored project is unambiguously first rather than sharing a
   row. Same cards, different arrangement; ranking order is identical
   either way. */
.mlmp-grid-list { grid-template-columns: 1fr !important; gap: 16px; }
@media (min-width: 700px) {
    .mlmp-grid-list .mlmp-card { flex-direction: row; }
    .mlmp-grid-list .mlmp-card-media { width: 300px; flex-shrink: 0; aspect-ratio: 16 / 10; }
    .mlmp-grid-list .mlmp-card-body { flex: 1; }
    .mlmp-grid-list .mlmp-card-desc { max-width: 70ch; }
}

/* ── Heat / momentum indicators ─────────────────────────────────────
   Based purely on the last 7 days of engagement — no membership boost —
   so a Free project genuinely catching fire outshines a quiet Pro one.
   There is deliberately no 'cold' badge: momentum is shown as a reward
   for activity, never as a public mark against a quiet project. */

.mlmp-heat {
    position: absolute; top: 10px; right: 10px;
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 10px 5px 8px; border-radius: 20px;
    font: 600 11px/1 'IBM Plex Mono', monospace; letter-spacing: .03em;
    color: #fff; backdrop-filter: blur(4px); z-index: 2;
}
.mlmp-heat-icon { font-size: 12px; line-height: 1; }

.mlmp-heat-badge-fire   { background: linear-gradient(135deg, #ff6a00, #ee0979); box-shadow: 0 0 14px rgba(255,106,0,.55); }
.mlmp-heat-badge-warm   { background: linear-gradient(135deg, #f7971e, #ffd200); color: #3d2c00; }
.mlmp-heat-badge-rising { background: rgba(46,125,107,.92); }

/* Fire: flicker on the icon + a slow breathing glow on the badge. */
@keyframes mlmp-flicker {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
    25%      { transform: scale(1.16) rotate(-6deg); opacity: .92; }
    50%      { transform: scale(1.04) rotate(4deg); }
    75%      { transform: scale(1.2) rotate(-3deg); opacity: .96; }
}
@keyframes mlmp-glow {
    0%, 100% { box-shadow: 0 0 12px rgba(255,106,0,.45); }
    50%      { box-shadow: 0 0 22px rgba(255,106,0,.85); }
}
.mlmp-heat-badge-fire .mlmp-heat-icon { animation: mlmp-flicker 1.5s ease-in-out infinite; transform-origin: center bottom; }
.mlmp-heat-badge-fire { animation: mlmp-glow 2.4s ease-in-out infinite; }

/* Warm: a gentler pulse, clearly a step below fire. */
@keyframes mlmp-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.12); }
}
.mlmp-heat-badge-warm .mlmp-heat-icon { animation: mlmp-pulse 2s ease-in-out infinite; }

/* Rising: a small nudge upward, hinting at direction rather than heat. */
@keyframes mlmp-nudge {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-2px); }
}
.mlmp-heat-badge-rising .mlmp-heat-icon { animation: mlmp-nudge 2.2s ease-in-out infinite; }

/* Card-level treatment: an ambient border tint so the whole card reads
   as hot, not just the badge. Kept subtle so the feed stays readable. */
.mlmp-card.mlmp-heat-fire  { border-color: rgba(255,106,0,.5); }
.mlmp-card.mlmp-heat-fire:hover  { box-shadow: 0 8px 30px rgba(255,106,0,.22); }
.mlmp-card.mlmp-heat-warm  { border-color: rgba(247,151,30,.45); }

/* Respect the OS "reduce motion" setting. Vestibular sensitivity is a real
   accessibility concern, and a looping glow is exactly the kind of thing
   that triggers it — the badges still convey heat through colour and
   wording with every animation switched off. */
@media (prefers-reduced-motion: reduce) {
    .mlmp-heat-badge-fire,
    .mlmp-heat-badge-fire .mlmp-heat-icon,
    .mlmp-heat-badge-warm .mlmp-heat-icon,
    .mlmp-heat-badge-rising .mlmp-heat-icon { animation: none !important; }
}

@media (max-width: 480px) {
    .mlmp-heat-label { display: none; } /* icon-only on small screens */
    .mlmp-heat { padding: 6px 8px; }
}

/* ── Project video (Pro) ────────────────────────────────────────────
   Responsive 16:9 wrapper. The iframe is lazy-loaded and points at
   youtube-nocookie.com, so a visitor who never plays the video doesn't
   get a tracking cookie set just for landing on the page. */
.mlmp-video { margin: 26px 0; }
.mlmp-video-frame {
    position: relative; width: 100%; padding-top: 56.25%;
    background: #0d1120; border-radius: 8px; overflow: hidden;
    border: 1px solid var(--mlmp-line);
}
.mlmp-video-frame iframe {
    position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
