/* =========================================================================
   Nabofest design system — "Sommerfest"
   Shared by index.php, vote.php, admin.php
   ========================================================================= */

:root {
    --bg:        #F4F7F1;   /* pale birch lawn */
    --card:      #FFFFFF;
    --ink:       #24382C;   /* spruce */
    --ink-soft:  #5F6F64;
    --line:      #E3E9E0;
    --rod:       #E2503C;   /* bunting red — primary action */
    --rod-dark:  #C43F2D;
    --sol:       #F5B83D;   /* sun yellow — winner / highlight */
    --sol-soft:  #FDF3DC;
    --vann:      #2F6F8F;   /* lake blue — info / links */
    --vann-soft: #E7F0F5;
    --gress:     #3E7C4F;   /* success green */
    --gress-soft:#E8F2EA;
    --radius:    14px;
    --shadow:    0 10px 30px rgba(36, 56, 44, 0.08);
    --shadow-sm: 0 3px 10px rgba(36, 56, 44, 0.07);
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Instrument Sans', -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.55;
    font-size: 16px;
}

h1, h2, h3, .display {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ink);
}

a { color: var(--vann); }

/* ---------- Bunting garland (page signature) ---------- */
.bunting-wrap {
    line-height: 0;
    overflow: hidden;
    background: var(--ink);
}
.bunting-wrap svg { display: block; width: 100%; height: 46px; }

/* ---------- Page shell ---------- */
.nf-shell {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 16px 60px;
}
.nf-header {
    background: var(--ink);
    color: #fff;
    text-align: center;
    padding: 26px 16px 34px;
}
.nf-header .eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 0.72rem;
    color: #B8C7BC;
    margin-bottom: 6px;
}
.nf-header h1 {
    color: #fff;
    font-size: clamp(2rem, 6vw, 3.2rem);
    margin: 0;
}
.nf-header .sub {
    color: #C8D4CB;
    margin-top: 8px;
    font-size: 0.95rem;
}

/* ---------- Cards ---------- */
.nf-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 24px;
}
.nf-card + .nf-card { margin-top: 20px; }

.nf-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    margin: 0 0 14px;
}
.nf-section-title i { color: var(--rod); }

/* ---------- Buttons ---------- */
.btn-nf, .btn-nf-outline, .btn-nf-quiet {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    border-radius: 999px;
    padding: 12px 26px;
    cursor: pointer;
    text-decoration: none;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
    border: none;
    line-height: 1.2;
}
.btn-nf { background: var(--rod); color: #fff; box-shadow: 0 6px 16px rgba(226, 80, 60, .3); }
.btn-nf:hover { background: var(--rod-dark); color: #fff; transform: translateY(-1px); }
.btn-nf:disabled { opacity: .6; transform: none; cursor: default; }
.btn-nf-outline { background: transparent; color: var(--ink); border: 2px solid var(--line); }
.btn-nf-outline:hover { border-color: var(--ink); color: var(--ink); }
.btn-nf-quiet { background: var(--vann-soft); color: var(--vann); padding: 9px 18px; font-size: .9rem; }
.btn-nf-quiet:hover { background: #d9e8f0; color: var(--vann); }

/* ---------- Status pills / banners ---------- */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 999px;
    padding: 5px 14px;
    font-size: 0.82rem;
    font-weight: 600;
}
.pill-open   { background: var(--gress-soft); color: var(--gress); }
.pill-voting { background: var(--vann-soft);  color: var(--vann); }
.pill-ended  { background: var(--sol-soft);   color: #9A6B12; }
.pill-muted  { background: #EEF1ED; color: var(--ink-soft); }

.winner-banner {
    background: var(--sol-soft);
    border: 1px solid #F1DCA9;
    color: #6E4E0C;
    border-radius: var(--radius);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.02rem;
}
.winner-banner i { color: var(--sol); font-size: 1.2rem; }

.chosen-banner {
    background: var(--gress-soft);
    border: 1px solid #C8E0CE;
    color: #2C5A38;
    border-radius: var(--radius);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.chosen-banner i { color: var(--gress); font-size: 1.2rem; }

/* ---------- Poll result bars ---------- */
.poll-rows { display: flex; flex-direction: column; gap: 10px; }
.poll-row { display: grid; grid-template-columns: minmax(0, 42%) 1fr 34px; gap: 10px; align-items: center; }
.poll-row .lbl { font-size: 0.92rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poll-row .lbl i { color: var(--vann); margin-right: 6px; }
.poll-row .lbl i.special { color: var(--sol); }
.poll-row .bar { background: #EDF1EC; border-radius: 999px; height: 20px; overflow: hidden; }
.poll-row .fill {
    height: 100%;
    background: linear-gradient(90deg, var(--vann), #4A93B5);
    color: #fff;
    font-size: .74rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    padding-left: 9px;
    border-radius: 999px;
    min-width: 6px;
    transition: width .4s ease;
}
.poll-row .fill.special { background: linear-gradient(90deg, var(--sol), #F0A22C); color: #5c4104; }
.poll-row .fill.winner  { background: linear-gradient(90deg, var(--gress), #55a06a); }
.poll-row .cnt { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

@media (max-width: 560px) {
    .poll-row { grid-template-columns: 1fr; gap: 4px; }
    .poll-row .cnt { display: none; }
    .poll-row .fill { font-size: .72rem; }
    .poll-row .lbl { white-space: normal; }
}

/* ---------- Household cards (public list) ---------- */
.house-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.house-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 4px solid var(--rod);
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
}
.house-card.hybel { border-left-color: var(--vann); }
.house-card .addr {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.08rem;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}
.house-card .contact { color: var(--ink-soft); font-size: .86rem; margin: 2px 0 10px; }
.chiplist { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: .84rem;
}
.chip .age { color: var(--ink-soft); font-size: .78rem; margin-left: 3px; }
.chip.contact-chip { border-color: #F0BFB6; background: #FDF0EE; }

/* Avatar chips (clickable, with photo or initials) */
.avatar-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    font-family: var(--font-body);
    padding: 3px 12px 3px 4px;
    transition: border-color .12s ease, transform .12s ease;
}
.avatar-chip:hover { border-color: var(--vann); transform: translateY(-1px); }
.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.avatar-initials {
    color: var(--ink);
    font-weight: 700;
    font-size: .84rem;
}
.avatar-lg { width: 52px; height: 52px; }
.avatar-lg.avatar-initials { font-size: 1.1rem; }

/* Aggregate participation stats (anonymous public view) */
.agg-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 18px 0 10px;
}
.agg-stat { text-align: center; }
.agg-stat .num {
    font-family: var(--font-display);
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.agg-stat .lbl { color: var(--ink-soft); font-size: .9rem; }

/* Festhilsen rotation ("Kari kommer!") */
.hype-strip { display: flex; justify-content: center; margin-top: 20px; }
.hype-card {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 10px 22px 10px 10px;
    box-shadow: var(--shadow-sm);
    transition: opacity .3s ease;
    min-height: 72px;
}
.hype-card.fade-out { opacity: 0; }
.hype-bubble {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.15rem;
    color: var(--ink);
    position: relative;
    background: var(--sol-soft);
    border: 1px solid #F1DCA9;
    border-radius: 16px;
    padding: 8px 18px;
}
.hype-bubble::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: var(--sol-soft);
    border-left: 1px solid #F1DCA9;
    border-bottom: 1px solid #F1DCA9;
}

/* ---------- Forms ---------- */
.form-control, .form-select {
    border-radius: 10px;
    border: 1.5px solid var(--line);
    padding: 11px 14px;
    font-family: var(--font-body);
}
.form-control:focus, .form-select:focus {
    border-color: var(--vann);
    box-shadow: 0 0 0 .2rem rgba(47, 111, 143, .15);
}
.form-label { font-weight: 600; font-size: .9rem; }

/* ---------- Toasts ---------- */
.nf-toast {
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%) translateY(10px);
    background: var(--ink);
    color: #fff;
    padding: 12px 22px;
    border-radius: 999px;
    font-size: .92rem;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
    z-index: 3000;
    max-width: min(92vw, 480px);
    text-align: center;
}
.nf-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.nf-toast.error { background: var(--rod-dark); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* Public list meta line */
.list-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    color: var(--ink-soft);
    font-size: .9rem;
    margin-bottom: 16px;
}

/* Own household highlight + non-clickable chips */
.house-card.own { border-left-color: var(--gress); box-shadow: 0 0 0 1px var(--gress-soft), var(--shadow-sm); }
.avatar-chip.static { cursor: default; }
.avatar-chip.static:hover { border-color: var(--line); transform: none; }

/* Likes & comments under the announcement */
.social-block {
    border-top: 1px solid var(--line);
    margin-top: 22px;
    padding-top: 14px;
}
.like-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.like-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1.5px solid var(--line);
    background: #fff;
    color: var(--ink-soft);
    border-radius: 999px;
    padding: 7px 16px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
    transition: border-color .12s ease, color .12s ease, background .12s ease;
}
.like-btn:hover { border-color: var(--vann); color: var(--vann); }
.like-btn.liked { background: var(--vann-soft); border-color: var(--vann); color: var(--vann); }
.like-summary { color: var(--ink-soft); font-size: .88rem; }

.comments-list { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.comment-row { display: flex; gap: 10px; align-items: flex-start; }
.comment-row .avatar { width: 34px; height: 34px; flex-shrink: 0; }
.comment-bubble {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 4px 16px 16px 16px;
    padding: 9px 14px;
    max-width: 100%;
    min-width: 0;
}
.comment-head { display: flex; align-items: baseline; gap: 8px; }
.comment-head strong { font-size: .9rem; }
.comment-time { color: var(--ink-soft); font-size: .76rem; }
.comment-delete {
    background: none;
    border: none;
    color: var(--ink-soft);
    cursor: pointer;
    font-size: .76rem;
    padding: 0 4px;
    margin-left: auto;
}
.comment-delete:hover { color: var(--rod); }
.comment-text { font-size: .94rem; overflow-wrap: anywhere; }

.comment-input {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 16px;
}
.comment-input .avatar { width: 34px; height: 34px; flex-shrink: 0; margin-top: 3px; }
.comment-input textarea {
    flex: 1;
    resize: none;
    border-radius: 18px;
    min-height: 42px;
}
.comment-input .btn-nf { padding: 10px 16px; flex-shrink: 0; }
