/* ── Corkboard Bulletin Board — Styles ─────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@500;700&family=DM+Sans:wght@400;500;600&display=swap');

:root {
    --cork:      #c8956c;
    --cork-dark: #a0714a;
    --cork-tex:  rgba(0,0,0,0.08);
    --shadow:    rgba(0,0,0,0.25);
    --modal-bg:  rgba(15,15,15,0.7);
}

/* ── Wrapper ──────────────────────────────────────────────── */
.cbb-wrap {
    font-family: 'DM Sans', sans-serif;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px 60px;
}

/* ── Header ───────────────────────────────────────────────── */
.cbb-header {
    text-align: center;
    padding: 36px 20px 28px;
}
.cbb-board-title {
    font-family: 'Caveat', cursive;
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 700;
    color: #2c1a0e;
    margin: 0 0 8px;
    letter-spacing: -0.5px;
}
.cbb-board-desc {
    font-size: 1rem;
    color: #6b4c2a;
    margin: 0 0 20px;
}
.cbb-submit-toggle {
    display: inline-block;
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 26px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(192,57,43,0.35);
    transition: transform .15s, box-shadow .15s;
}
.cbb-submit-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(192,57,43,0.4);
}

/* ── Cork Board ───────────────────────────────────────────── */
.cbb-cork-board {
    background-color: var(--cork);
    background-image:
        repeating-linear-gradient(
            0deg,
            var(--cork-tex) 0px, var(--cork-tex) 1px,
            transparent 1px, transparent 8px
        ),
        repeating-linear-gradient(
            90deg,
            var(--cork-tex) 0px, var(--cork-tex) 1px,
            transparent 1px, transparent 8px
        ),
        radial-gradient(ellipse at 20% 30%, rgba(255,255,255,0.07) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 70%, rgba(0,0,0,0.06) 0%, transparent 60%);
    border: 14px solid var(--cork-dark);
    border-radius: 6px;
    box-shadow:
        inset 0 2px 8px rgba(0,0,0,0.2),
        0 8px 40px rgba(0,0,0,0.3);
    padding: 32px 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    align-items: flex-start;
    min-height: 320px;
}

/* ── Post-it Note ─────────────────────────────────────────── */
.cbb-note {
    position: relative;
    width: calc(33.333% - 20px);
    min-width: 220px;
    padding: 32px 18px 18px;
    border-radius: 2px;
    box-shadow:
        3px 3px 0 rgba(0,0,0,0.08),
        4px 6px 14px var(--shadow);
    cursor: pointer;
    transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s;
    word-break: break-word;
    flex: 1 1 220px;
    max-width: 340px;
}
.cbb-note::before {
    /* paper fold at bottom-right */
    content: '';
    position: absolute;
    bottom: 0; right: 0;
    width: 24px; height: 24px;
    background: linear-gradient(135deg, transparent 50%, rgba(0,0,0,0.12) 50%);
    border-radius: 0 0 2px 0;
}
.cbb-note:hover {
    transform: rotate(0deg) scale(1.04) translateY(-4px) !important;
    box-shadow: 6px 12px 28px var(--shadow);
    z-index: 10;
}

/* Featured note */
.cbb-note.cbb-featured {
    outline: 3px solid #f59e0b;
    outline-offset: 2px;
    order: -1;
}

/* ── Push Pin ─────────────────────────────────────────────── */
.cbb-pin {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #e05c5c, #8b0000);
    box-shadow: 0 2px 6px rgba(0,0,0,0.4), inset 0 1px 2px rgba(255,255,255,0.3);
    z-index: 5;
}
.cbb-pin::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 8px;
    background: linear-gradient(to bottom, #aaa, #666);
    border-radius: 0 0 2px 2px;
}
.cbb-pin-gold {
    background: radial-gradient(circle at 35% 35%, #fbbf24, #b45309);
}

/* ── Note content ─────────────────────────────────────────── */
.cbb-featured-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #fef3c7;
    color: #92400e;
    padding: 2px 7px;
    border-radius: 20px;
    margin-bottom: 8px;
}
.cbb-note-title {
    font-family: 'Caveat', cursive;
    font-size: 1.35rem;
    font-weight: 700;
    color: #1c1c1c;
    margin: 0 0 10px;
    line-height: 1.2;
}
.cbb-note-desc {
    font-size: 0.85rem;
    color: #333;
    line-height: 1.5;
    margin: 0 0 16px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cbb-note-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    color: #555;
    border-top: 1px dashed rgba(0,0,0,0.15);
    padding-top: 10px;
    margin-top: auto;
}
.cbb-more {
    font-style: italic;
    color: #1a56db;
    font-size: 0.72rem;
}
.cbb-empty {
    color: rgba(255,255,255,0.7);
    font-size: 1.1rem;
    text-align: center;
    width: 100%;
    padding: 40px;
    font-style: italic;
}

/* ── Overlay ──────────────────────────────────────────────── */
.cbb-overlay {
    position: fixed;
    inset: 0;
    background: var(--modal-bg);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: cbb-fade-in .2s ease;
}
@keyframes cbb-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Detail Modal ─────────────────────────────────────────── */
.cbb-detail-modal {
    background: #fffef5;
    border-radius: 6px;
    padding: 40px 40px 32px;
    max-width: 680px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    animation: cbb-slide-up .25s ease;
}
@keyframes cbb-slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.cbb-detail-modal h2 {
    font-family: 'Caveat', cursive;
    font-size: 2rem;
    margin: 0 0 16px;
    color: #1c1c1c;
}
#cbb-detail-body {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #333;
    white-space: pre-wrap;
}
#cbb-detail-pdf {
    margin-top: 20px;
}
#cbb-detail-pdf a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #1a56db;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background .15s;
}
#cbb-detail-pdf a:hover { background: #1340a0; }

/* ── Form Modal ───────────────────────────────────────────── */
.cbb-form-modal {
    background: #fff;
    border-radius: 8px;
    padding: 36px 36px 28px;
    max-width: 580px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    animation: cbb-slide-up .25s ease;
}
.cbb-form-modal h3 {
    font-family: 'Caveat', cursive;
    font-size: 1.8rem;
    margin: 0 0 4px;
    color: #1c1c1c;
}
.cbb-form-note {
    font-size: 0.82rem;
    color: #888;
    margin: 0 0 22px;
}
.cbb-close {
    position: absolute;
    top: 14px; right: 16px;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: #666;
    line-height: 1;
    transition: color .15s;
}
.cbb-close:hover { color: #111; }

/* ── Form fields ──────────────────────────────────────────── */
.cbb-field {
    margin-bottom: 16px;
    flex: 1;
}
.cbb-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: #374151;
}
.req { color: #c0392b; }
.cbb-field input[type="text"],
.cbb-field input[type="email"],
.cbb-field input[type="date"],
.cbb-field textarea {
    width: 100%;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    padding: 9px 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    box-sizing: border-box;
    transition: border-color .15s;
}
.cbb-field input:focus,
.cbb-field textarea:focus {
    outline: none;
    border-color: #1a56db;
}
.cbb-row {
    display: flex;
    gap: 14px;
}

/* ── Featured box ─────────────────────────────────────────── */
.cbb-featured-box {
    background: #fffbeb;
    border: 1.5px solid #fcd34d;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 20px;
}
.cbb-featured-check {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    cursor: pointer;
}
.cbb-featured-check input { width: 16px; height: 16px; cursor: pointer; }
.cbb-featured-desc {
    font-size: 0.78rem;
    color: #92400e;
    margin: 6px 0 0 26px;
}

/* ── Submit button ────────────────────────────────────────── */
.cbb-btn-submit {
    width: 100%;
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 13px;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .15s;
}
.cbb-btn-submit:hover { background: #a93226; transform: translateY(-1px); }
.cbb-btn-submit:disabled { background: #9ca3af; cursor: default; transform: none; }

.cbb-form-msg {
    margin-top: 14px;
    font-size: 0.88rem;
    text-align: center;
    min-height: 20px;
    color: #166534;
}
.cbb-form-msg.error { color: #991b1b; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 700px) {
    .cbb-note { width: 100%; max-width: 100%; }
    .cbb-row  { flex-direction: column; gap: 0; }
    .cbb-form-modal,
    .cbb-detail-modal { padding: 28px 22px 24px; }
}
