/* Breakthrough Wall — white / minimal, coral pink + black.
 * Palette matched to smilepop.com: coral #FE9EA7 as the single accent, near-
 * black type, lots of white. Colombia-flag colors appear only in the small
 * flag elements (top stripe + chips) to signal the cause.
 *   Headings Rubik · Body Work Sans
 */
:root {
    /* Black + pink on a very light pink page. The vivid pink (#D81B60) is the
     * readable accent for text/links/buttons (~4.7:1 on light, ~5:1 white-on-
     * pink); the pale pink is decorative fill only. No coral/berry, no gold. */
    --coral: #FF9CB6;          /* soft pink — decorative FILLS/progress only */
    --coral-deep: #D81B60;     /* readable pink: text, links, buttons */
    --coral-hover: #B0154F;    /* button/link hover */
    --coral-ink: #D81B60;      /* alias for pink text on light */
    --blush: #FFEDF2;          /* subtle pink surface hover */
    --blush-deep: #FFD9E3;     /* progress track */
    --hero-band: #FFE3EC;      /* light-pink hero band */
    /* Colombia flag (only used in flag elements) */
    --co-yellow: #FCD116;
    --co-blue: #003893;
    --co-red: #CE1126;
    --ink: #1A1A1A;            /* near-black body + headline text */
    --bg: #FFF1F4;             /* very light pink page */
    --card: #FFFFFF;
    --border: #F1DBE2;         /* soft pink hairline */
    --text: #1A1A1A;
    --muted: #7A6B70;          /* readable secondary */
    --error: #C62828;
    --radius: 16px;
}

* { box-sizing: border-box; }
html, body {
    margin: 0; min-height: 100%;
    font-family: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-weight: 400; font-size: 16px;
    color: var(--text); background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: "Rubik", sans-serif; }
button { font-family: inherit; }
.hidden { display: none !important; }

/* ── Icons ───────────────────────────────────────────────────────── */
.icon { width: 18px; height: 18px; flex-shrink: 0; vertical-align: -3px; }
.icon-sm { width: 14px; height: 14px; }
.kind-chip, .modal-tab, .act-btn, #media-pick, .media-ok {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.act-like .icon-heart { transition: fill .15s, transform .15s; }
.act-btn.liked { color: var(--coral-ink); }
.act-btn.liked .icon-heart { fill: var(--coral); stroke: var(--coral-deep); transform: scale(1.08); }

/* ── Top bar ─────────────────────────────────────────────────────── */
/* Colombia flag stripe — sits above the header so the cause reads instantly */
.flag-stripe { height: 9px; display: flex; }
.flag-stripe::before, .flag-stripe::after, .flag-stripe { }
.flag-stripe {
    background: linear-gradient(
        to right,
        var(--co-yellow) 0 50%, var(--co-blue) 50% 75%, var(--co-red) 75% 100%);
}
#topbar {
    position: sticky; top: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    height: 60px; padding: 0 18px;
    padding-top: env(safe-area-inset-top);
    background: rgba(255,248,244,.88);
    -webkit-backdrop-filter: saturate(1.3) blur(10px);
    backdrop-filter: saturate(1.3) blur(10px);
    border-bottom: 1px solid var(--border);
    color: var(--ink);
}
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand-mark { height: 26px; width: 26px; }
.brand-name {
    font-family: "Rubik", sans-serif; font-weight: 800; font-size: 19px;
    letter-spacing: -.2px; white-space: nowrap; color: var(--ink);
}
.brand-accent { color: var(--coral-deep); }

/* ── Hero ────────────────────────────────────────────────────────── */
#hero {
    padding: 42px 22px 40px; text-align: center; color: var(--ink);
    background: linear-gradient(180deg, var(--hero-band) 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--border);
}
/* Actual Colombia flag: horizontal bands, yellow top half, blue + red quarters,
   3:2 proportions. */
.hero-flag {
    display: inline-flex; flex-direction: column;
    height: 42px; width: 63px; border-radius: 5px;
    overflow: hidden; margin-bottom: 16px; box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.hero-flag span { width: 100%; flex: 1; }
.hero-flag span:nth-child(1) { background: var(--co-yellow); flex: 2; }
.hero-flag span:nth-child(2) { background: var(--co-blue); }
.hero-flag span:nth-child(3) { background: var(--co-red); }
#hero h1 {
    margin: 0 0 14px; font-size: clamp(28px, 6.5vw, 44px);
    font-weight: 800; letter-spacing: -.8px; line-height: 1.08; color: var(--ink);
}
.hero-gold { color: var(--coral-deep); }
#hero p {
    margin: 0 auto; max-width: 470px;
    font-size: 15.5px; font-weight: 400; color: #6B5C57; line-height: 1.6;
}
#hero p strong { color: var(--ink); font-weight: 700; }

/* ── Layout ──────────────────────────────────────────────────────── */
#wall {
    max-width: 560px; margin: -18px auto 40px; padding: 0 14px;
    display: flex; flex-direction: column; gap: 14px; position: relative;
}
#feed { display: flex; flex-direction: column; gap: 14px; }
.card {
    background: var(--card); border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
    overflow: hidden;
}

/* ── Fundraiser banner + live progress bar ───────────────────────── */
.fundraiser-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
    padding: 18px 20px;
}
.fund-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.fund-flag {
    display: inline-flex; flex-direction: column; height: 13px; width: 19px; border-radius: 3px;
    overflow: hidden; flex-shrink: 0; box-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.fund-flag span { width: 100%; flex: 1; }
.fund-flag span:nth-child(1) { background: var(--co-yellow); flex: 2; }
.fund-flag span:nth-child(2) { background: var(--co-blue); }
.fund-flag span:nth-child(3) { background: var(--co-red); }
.fund-title {
    font-size: 11px; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: .8px;
}
.fund-amounts { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.fund-raised {
    font-family: "Rubik", sans-serif; font-weight: 800;
    font-size: 36px; line-height: 1; color: var(--ink); letter-spacing: -1px;
}
.fund-goal { font-size: 14px; font-weight: 500; color: var(--muted); }
.fund-bar {
    margin: 12px 0 9px; height: 10px; border-radius: 999px;
    background: var(--blush-deep); overflow: hidden;
}
.fund-fill {
    height: 100%; width: 0%; border-radius: 999px;
    background: linear-gradient(90deg, var(--coral) 0%, var(--coral-deep) 100%);
    transition: width .8s cubic-bezier(.2,.8,.2,1);
}
.fund-sub { font-size: 12.5px; color: var(--muted); }
.fund-sub strong { color: var(--coral-deep); font-weight: 700; }
.fundraiser-card.is-complete .fund-fill { background: var(--coral-deep); }

/* ── Goal-reached celebration ────────────────────────────────────── */
.goal-overlay {
    position: fixed; inset: 0; z-index: 400;
    display: flex; align-items: center; justify-content: center; padding: 20px;
    background: rgba(51,39,42,.55); backdrop-filter: blur(4px);
}
.confetti-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.goal-card {
    position: relative; z-index: 1; text-align: center;
    background: white; border-radius: 20px; padding: 30px 26px;
    max-width: 400px; width: 100%;
    box-shadow: 0 24px 60px rgba(0,0,0,.35); border-top: 6px solid var(--coral);
}
.goal-flag {
    display: inline-flex; flex-direction: column; height: 34px; width: 51px; border-radius: 4px;
    overflow: hidden; margin: 0 auto 12px; box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.goal-flag span { width: 100%; flex: 1; }
.goal-flag span:nth-child(1) { background: var(--co-yellow); flex: 2; }
.goal-flag span:nth-child(2) { background: var(--co-blue); }
.goal-flag span:nth-child(3) { background: var(--co-red); }
.goal-emoji { font-size: 44px; line-height: 1; }
.goal-headline {
    margin: 8px 0 4px; font-family: "Rubik", sans-serif; font-weight: 800;
    font-size: 26px; color: var(--ink);
}
.goal-amount {
    font-family: "Rubik", sans-serif; font-weight: 800; font-size: 34px;
    color: var(--coral-deep); margin-bottom: 10px; letter-spacing: -1px;
}
.goal-text { font-size: 14.5px; line-height: 1.55; color: var(--text); margin: 0 0 18px; }

/* ── Stats banner ────────────────────────────────────────────────── */
.stats-card {
    display: flex; align-items: stretch; gap: 12px;
    background: var(--card); border-radius: var(--radius);
    border: 1px solid var(--border); box-shadow: 0 1px 2px rgba(0,0,0,.04);
    padding: 16px 18px; overflow: hidden;
}
.stat-count { flex-shrink: 0; text-align: center; padding-right: 14px; border-right: 1px solid var(--border); }
/* Before anything has a like there is no "Most Loved" half to balance against. */
.stats-card.solo .stat-count { border-right: none; padding-right: 0; margin: 0 auto; }
.stat-number {
    font-family: "Rubik", sans-serif; font-weight: 800;
    font-size: 34px; line-height: 1; color: var(--ink); letter-spacing: -1px;
}
.stat-label {
    font-size: 10.5px; font-weight: 600; color: var(--muted);
    text-transform: uppercase; letter-spacing: .7px; margin-top: 5px;
}
.stat-top {
    flex: 1; min-width: 0; text-align: left; cursor: pointer;
    background: none; border: none; padding: 0 0 0 2px;
    display: flex; flex-direction: column; justify-content: center; gap: 3px;
}
.stat-top .stat-label { margin: 0 0 2px; }
.stat-top-body {
    font-size: 13.5px; line-height: 1.35; color: var(--text);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.stat-top-meta {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; color: var(--muted);
}
.stat-top-likes {
    display: inline-flex; align-items: center; gap: 4px;
    font-weight: 600; color: var(--coral-ink);
}
.icon-filled { fill: var(--coral); stroke: var(--coral-deep); }
.stat-top:hover .stat-top-body { color: var(--coral-ink); }
@media (max-width: 400px) {
    .stat-number { font-size: 28px; }
    .stats-card { padding: 12px; gap: 10px; }
}

/* ── Moderator badge ─────────────────────────────────────────────── */
.mod-badge {
    font-size: 10.5px; font-weight: 700; letter-spacing: .8px;
    text-transform: uppercase; color: white;
    background: var(--ink); padding: 4px 10px; border-radius: 999px;
}

/* ── Composer card ───────────────────────────────────────────────── */
.composer-card { padding: 14px 16px; }
.composer-prompt {
    width: 100%; text-align: left; padding: 12px 16px;
    background: #FAFAFA; color: var(--muted);
    border: 1px solid var(--border); border-radius: 999px;
    font-size: 15px; cursor: pointer; transition: border-color .15s, background .15s;
}
.composer-prompt:hover { border-color: var(--coral); background: var(--blush); }
.composer-kinds { display: flex; gap: 8px; margin-top: 12px; }
.kind-chip {
    flex: 1; padding: 9px 4px; font-size: 13px; font-weight: 600;
    background: white; color: var(--ink);
    border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
    transition: border-color .15s, background .15s, transform .05s;
}
.kind-chip:hover { border-color: var(--coral); background: var(--blush); color: var(--coral-ink); }
.kind-chip:active { transform: translateY(1px); }

/* ── Posts ───────────────────────────────────────────────────────── */
.post-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 8px; }
.post-author { flex: 1; min-width: 0; }
.post-author .name { font-weight: 600; font-size: 14.5px; color: var(--ink); }
.post-author .name-anon { color: var(--muted); font-weight: 500; font-style: italic; }
.post-flash { animation: post-flash 1.6s ease-out; }
@keyframes post-flash {
    0%, 100% { box-shadow: 0 1px 2px rgba(0,0,0,.05); }
    25%      { box-shadow: 0 0 0 3px var(--coral), 0 6px 18px rgba(254,158,167,.4); }
}
.post-author .meta { font-size: 12px; color: var(--muted); margin-top: 1px; }
.post-delete {
    background: none; border: none; color: #B7BEC9;
    cursor: pointer; padding: 6px 8px; border-radius: 6px; line-height: 1;
    display: inline-flex; align-items: center;
}
.post-delete:hover { color: var(--error); background: #FFEBEE; }

.post-body { padding: 2px 16px 12px; font-size: 15px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: break-word; }
.post-media { width: 100%; display: block; background: #F2EAE6; }
.post-media video { width: 100%; max-height: 70vh; display: block; }
.post-media img { width: 100%; max-height: 70vh; object-fit: contain; display: block; }

.post-actions {
    display: flex; align-items: center; gap: 4px;
    padding: 6px 10px; border-top: 1px solid var(--border);
}
.act-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 12px; background: none; border: none; border-radius: 8px;
    font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer;
    transition: background .15s, color .15s;
}
.act-btn:hover { background: var(--blush); color: var(--ink); }
.act-btn .heart { font-size: 16px; line-height: 1; }
.act-btn.liked .heart { transform: scale(1.1); }

/* ── Comments ────────────────────────────────────────────────────── */
.comments { border-top: 1px solid var(--border); padding: 10px 14px 12px; background: #FAFAFA; }
.comment { display: flex; gap: 9px; padding: 6px 0; }
.comment-bubble {
    flex: 1; background: white; border: 1px solid var(--border);
    border-radius: 12px; padding: 8px 12px; min-width: 0;
}
.comment-bubble .who { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.comment-bubble .who .when { font-weight: 400; color: var(--muted); margin-left: 6px; font-size: 11.5px; }
.comment-bubble .what { font-size: 14px; line-height: 1.45; margin-top: 2px; white-space: pre-wrap; overflow-wrap: break-word; }
.comment-delete { background: none; border: none; color: #B7BEC9; cursor: pointer; padding: 0 4px; vertical-align: -2px; }
.comment-delete:hover { color: var(--error); }
.comment-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.comment-form input {
    padding: 9px 14px; font-size: 14px; font-family: inherit;
    border: 1px solid var(--border); border-radius: 999px; min-width: 0;
}
.comment-form .comment-name { flex: 0 1 130px; }
.comment-form .comment-body { flex: 1 1 150px; }
.comment-form input:focus { outline: none; border-color: var(--coral); box-shadow: 0 0 0 3px rgba(254,158,167,.25); }
.comment-form button {
    padding: 9px 16px; border: none; border-radius: 999px;
    background: var(--coral-deep); color: white; font-weight: 600; font-size: 13.5px; cursor: pointer;
}
.comment-form button:hover { background: var(--coral-hover); }

/* ── Avatars ─────────────────────────────────────────────────────── */
.avatar {
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-family: "Rubik", sans-serif; font-weight: 700; font-size: 14px;
    color: white; background: var(--coral-deep); border: none;
}
.avatar-sm { width: 34px; height: 34px; font-size: 13px; }
.avatar-anon { background: #B7BEC9; }
.avatar-anon .icon { width: 16px; height: 16px; fill: white; stroke: none; }
.avatar-btn { cursor: pointer; box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.avatar-btn:hover { box-shadow: 0 0 0 2px var(--coral); }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
    padding: 10px 18px; font-size: 14px; font-weight: 600;
    border-radius: 8px; cursor: pointer; letter-spacing: .2px;
    transition: background .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--coral-deep); border: none; color: white; }
.btn-primary:hover { background: var(--coral-hover); }
.btn-primary:disabled { background: #D98D9C; color: #fff; cursor: wait; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: inherit; }
.btn-ghost:hover { border-color: var(--coral-deep); color: var(--coral-deep); }

/* ── Feed status ─────────────────────────────────────────────────── */
.feed-status { text-align: center; color: var(--muted); font-size: 14px; padding: 26px 0; }
#load-more { margin: 0 auto 10px; color: var(--coral-ink); }

/* ── Modals ──────────────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(8,25,52,.55); backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center; padding: 18px;
}
.modal {
    position: relative; width: 100%; max-width: 400px;
    max-height: calc(100vh - 40px); overflow-y: auto;
    background: white; border-radius: 18px; padding: 48px 22px 22px;
    box-shadow: 0 24px 60px rgba(0,0,0,.28);
}
.modal-close {
    position: absolute; top: 10px; right: 10px;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; border-radius: 50%;
    font-size: 22px; color: var(--muted);
    cursor: pointer; line-height: 1; padding: 0;
}
.modal-close:hover { color: var(--ink); background: var(--blush); }
.modal-title { margin: 0 0 14px; font-size: 19px; font-weight: 800; color: var(--ink); letter-spacing: -.3px; }
.modal-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.modal-tab {
    flex: 1; padding: 9px 6px; font-size: 13.5px; font-weight: 600;
    background: #FAFAFA; color: var(--muted);
    border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
}
.modal-tab.active { background: var(--coral-deep); color: white; border-color: var(--coral-deep); }
.modal-foot { margin-top: 14px; font-size: 12px; color: var(--muted); text-align: center; }

/* ── Optional-name hint under the composer name field ────────────── */
.name-hint { font-size: 11.5px; color: var(--muted); margin-top: -4px; }

.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form label { font-size: 13px; font-weight: 600; color: var(--ink); display: flex; flex-direction: column; gap: 4px; }
.label-muted { font-weight: 400; color: var(--muted); }
#form-post textarea, #form-post input[type="text"] {
    padding: 11px 14px; font-size: 15px; font-family: inherit;
    border: 1px solid var(--border); border-radius: 8px; width: 100%;
}
#form-post textarea:focus, #form-post input[type="text"]:focus {
    outline: none; border-color: var(--coral);
    box-shadow: 0 0 0 3px rgba(254,158,167,.25);
}
.form-error {
    color: var(--error); font-size: 13px;
    background: #FFEBEE; border: 1px solid #FFCDD2;
    padding: 8px 12px; border-radius: 8px;
}
.profile-email { font-size: 13px; color: var(--muted); padding: 2px 2px 4px; }

/* ── Composer modal ──────────────────────────────────────────────── */
#form-post { display: flex; flex-direction: column; gap: 12px; }
.media-zone {
    border: 2px dashed var(--border); border-radius: 12px;
    padding: 16px; text-align: center;
    display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.media-hint { font-size: 12.5px; color: var(--muted); }
.media-preview { width: 100%; }
.media-preview video, .media-preview img {
    width: 100%; max-height: 300px; border-radius: 10px; object-fit: contain; background: #F2F2F2;
}
.media-ok { font-size: 13px; color: #1B7F3B; font-weight: 600; }
.btn-post { font-size: 15px; padding: 12px; }

/* ── Footer ──────────────────────────────────────────────────────── */
#footer {
    margin-top: auto; padding: 30px 20px calc(34px + env(safe-area-inset-bottom));
    background: var(--bg); border-top: 1px solid var(--border);
    color: var(--muted);
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    text-align: center;
}
.footer-brand { display: flex; align-items: center; gap: 8px; font-family: "Rubik", sans-serif; font-weight: 700; color: var(--ink); }
.footer-brand img { height: 22px; width: 22px; }
.footer-tag { font-size: 12px; color: var(--muted); letter-spacing: .2px; }

/* ── Toast ───────────────────────────────────────────────────────── */
.toast {
    position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
    z-index: 300; max-width: 90vw;
    background: var(--ink); color: white;
    padding: 11px 20px; border-radius: 999px;
    font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.3);
    border-left: 3px solid var(--coral);
}

body { display: flex; flex-direction: column; min-height: 100vh; }

@media (min-width: 640px) {
    #hero { padding: 46px 20px 40px; }
    #wall { margin-top: -22px; }
}
