/* Announcements as a school notice board: a wooden frame, cork, and notices
   on paper held by push-pins or tape. Pure CSS, no images or web fonts. */

.nb-frame {
    position: relative;
    padding: 14px;
    border-radius: 10px;
    background:
        repeating-linear-gradient(92deg, rgba(255, 255, 255, .05) 0 2px, transparent 2px 9px),
        repeating-linear-gradient(88deg, rgba(0, 0, 0, .07) 0 1px, transparent 1px 13px),
        linear-gradient(180deg, #8a5a32, #6b4423 45%, #5a3819);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 -2px 0 rgba(0, 0, 0, .25) inset, 0 14px 30px rgba(40, 20, 0, .25);
    margin-bottom: 1rem;
}

.nb-cork {
    position: relative;
    border-radius: 4px;
    min-height: 220px;
    background-color: #c79a63;
    background-image:
        radial-gradient(rgba(92, 56, 22, .38) 1px, transparent 1.7px),
        radial-gradient(rgba(255, 238, 205, .28) 1px, transparent 1.5px),
        radial-gradient(rgba(74, 42, 12, .22) 1.6px, transparent 2.3px),
        radial-gradient(rgba(140, 92, 45, .35) 2px, transparent 3px),
        linear-gradient(135deg, rgba(255, 255, 255, .07), rgba(0, 0, 0, .08));
    background-size: 6px 6px, 11px 11px, 17px 17px, 29px 29px, 100% 100%;
    background-position: 0 0, 3px 5px, 9px 2px, 14px 11px, 0 0;
    box-shadow: inset 0 3px 9px rgba(50, 25, 0, .45), inset 0 -1px 4px rgba(50, 25, 0, .3);
}

.nb-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px 0;
    gap: .75rem;
}

.nb-plaque {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: 5px 16px;
    border-radius: 3px;
    font-weight: 800;
    font-size: .78rem;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: #3d2a05;
    background: linear-gradient(180deg, #f2db8c, #c9a243 55%, #a8832b);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 2px 4px rgba(40, 20, 0, .45);
    text-shadow: 0 1px 0 rgba(255, 255, 255, .45);
}
.nb-plaque::before, .nb-plaque::after {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #fff6cf, #7a5c1c);
}

.nb-head a.nb-all {
    color: #fff;
    background: rgba(60, 35, 10, .55);
    padding: 3px 12px;
    border-radius: 999px;
    font-size: .8rem;
    text-decoration: none;
}
.nb-head a.nb-all:hover { background: rgba(60, 35, 10, .75); }

.nb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 34px 26px;
    padding: 30px 26px 26px;
    align-items: start;
}

/* --- a notice ------------------------------------------------------------------ */
.nb-note {
    position: relative;
    display: block;
    min-height: 190px;
    padding: 26px 18px 14px;
    color: #2a2a2a;
    text-decoration: none;
    border-radius: 2px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .18), 0 9px 16px -4px rgba(45, 22, 0, .5);
    transition: transform .18s ease, box-shadow .18s ease;
}
.nb-note:hover, .nb-note:focus-visible {
    color: #111;
    z-index: 2;
    transform: rotate(0deg) translateY(-4px) scale(1.025);
    box-shadow: 0 2px 2px rgba(0, 0, 0, .15), 0 18px 26px -6px rgba(45, 22, 0, .55);
}
.nb-note:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* papers */
.nb-paper-0 {   /* ruled exercise-book sheet with a margin line */
    background:
        linear-gradient(90deg, transparent 30px, rgba(220, 70, 70, .55) 30px 31px, transparent 31px),
        repeating-linear-gradient(180deg, #fffdf7 0 23px, #c9dcf2 23px 24px);
    padding-left: 40px;
}
.nb-paper-1 {   /* sticky note */
    background: linear-gradient(170deg, #fff6a8, #ffec70 70%, #f5df55);
    border-bottom-right-radius: 26px 6px;
}
.nb-paper-2 {   /* pale blue memo */
    background: linear-gradient(180deg, #eef6ff, #dcecff);
}
.nb-paper-3 {   /* pink slip */
    background: linear-gradient(180deg, #fff0f4, #ffdfe8);
}
.nb-paper-4 {   /* plain white typed notice */
    background: #fdfdfb;
    border-top: 5px solid var(--tblr-primary, #283891);
}

/* tilts */
.nb-tilt-0 { transform: rotate(-2.2deg); }
.nb-tilt-1 { transform: rotate(1.6deg); }
.nb-tilt-2 { transform: rotate(-.7deg); }
.nb-tilt-3 { transform: rotate(2.3deg); }
.nb-tilt-4 { transform: rotate(-1.4deg); }

/* push-pins */
.nb-pin {
    position: absolute;
    top: -8px;
    left: 50%;
    width: 18px;
    height: 18px;
    margin-left: -9px;
    border-radius: 50%;
    background: radial-gradient(circle at 34% 32%, #fff 0 2px, var(--pin, #e2363c) 3.5px, var(--pin-dark, #8d0f14) 100%);
    box-shadow: 2px 4px 3px rgba(0, 0, 0, .4);
    z-index: 1;
}
.nb-pin::after {   /* the needle's shadow on the paper */
    content: "";
    position: absolute;
    left: 9px;
    top: 14px;
    width: 2px;
    height: 7px;
    background: rgba(0, 0, 0, .18);
    transform: rotate(-25deg);
    border-radius: 1px;
}
.nb-pin-red    { --pin: #e2363c; --pin-dark: #8d0f14; }
.nb-pin-blue   { --pin: #3d6fe0; --pin-dark: #17327e; }
.nb-pin-green  { --pin: #2fb36a; --pin-dark: #0f5a31; }
.nb-pin-yellow { --pin: #f5c425; --pin-dark: #8a6a00; }

/* tape (sticky notes and slips) */
.nb-tape {
    position: absolute;
    top: -12px;
    left: 50%;
    width: 92px;
    height: 24px;
    margin-left: -46px;
    background: rgba(255, 255, 255, .5);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
    transform: rotate(-3deg);
    -webkit-mask: linear-gradient(90deg, transparent 0 2px, #000 2px calc(100% - 2px), transparent calc(100% - 2px));
}

/* an important (pinned) notice: two red pins and a ribbon */
.nb-pin-l { left: 26px; margin-left: 0; }
.nb-pin-r { left: auto; right: 22px; margin-left: 0; }
.nb-important {
    position: absolute;
    top: 8px;
    left: -6px;
    padding: 1px 9px 1px 8px;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #fff;
    background: #c8102e;
    box-shadow: 0 2px 3px rgba(0, 0, 0, .25);
}
.nb-paper-0 .nb-important { left: 4px; }

/* rubber stamps */
.nb-stamp {
    position: absolute;
    right: 12px;
    bottom: 16px;
    padding: 1px 9px;
    border: 2.5px solid #c8102e;
    border-radius: 5px;
    color: #c8102e;
    font-weight: 900;
    font-size: .74rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    transform: rotate(-13deg);
    opacity: .82;
    mix-blend-mode: multiply;
    background: transparent;
}
.nb-stamp-grey { border-color: #6b7280; color: #6b7280; }

.nb-date {
    font-size: .72rem;
    color: #6b6255;
    text-align: right;
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
}
.nb-title {
    font-weight: 800;
    font-size: 1.02rem;
    line-height: 1.25;
    margin: 0 0 6px;
    color: #1d1d1d;
}
.nb-body {
    font-size: .88rem;
    line-height: 1.45;
    color: #3a3a3a;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: pre-line;
}
.nb-sign {
    margin-top: 12px;
    font-family: "Segoe Script", "Segoe Print", "Bradley Hand", "Brush Script MT", cursive;
    font-size: .95rem;
    color: #1f3a8a;
    line-height: 1.15;
}
.nb-sign small {
    display: block;
    font-family: var(--tblr-font-sans-serif, sans-serif);
    font-size: .7rem;
    color: #6b6255;
}
.nb-meta { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; padding-right: 74px; }
.nb-meta span {
    font-size: .66rem;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .06);
    color: #4a4a4a;
}
.nb-note.is-ended { filter: grayscale(.85); opacity: .7; }

/* empty board */
.nb-empty {
    display: grid;
    place-items: center;
    padding: 50px 20px 60px;
}
.nb-empty .nb-note { min-height: 0; max-width: 300px; text-align: center; }

/* --- one notice, read in full ------------------------------------------------ */
.nb-sheet {
    position: relative;
    max-width: 760px;
    margin: 26px auto 30px;
    padding: 46px 48px 34px 64px;
    color: #222;
    background:
        linear-gradient(90deg, transparent 44px, rgba(220, 70, 70, .5) 44px 45px, transparent 45px),
        repeating-linear-gradient(180deg, #fffdf7 0 27px, #d3e2f4 27px 28px);
    box-shadow: 0 1px 1px rgba(0, 0, 0, .2), 0 16px 30px -8px rgba(45, 22, 0, .55);
    transform: rotate(-.4deg);
}
.nb-sheet .nb-pin { top: -9px; width: 22px; height: 22px; margin-left: -11px; }
.nb-sheet .nb-pin.nb-pin-left { left: 70px; }
.nb-sheet .nb-pin.nb-pin-right { left: auto; right: 48px; margin-left: 0; }
.nb-sheet h2 { font-weight: 800; font-size: 1.45rem; line-height: 28px; margin: 0 0 14px; }
.nb-sheet .nb-text { white-space: pre-wrap; font-size: 1.05rem; line-height: 28px; }
.nb-sheet .nb-sign { font-size: 1.2rem; margin-top: 28px; }
.nb-sheet .nb-date { text-align: right; line-height: 28px; margin: -24px 0 0; }

@media (max-width: 575.98px) {
    .nb-frame { padding: 9px; }
    .nb-grid { grid-template-columns: 1fr; gap: 30px; padding: 26px 16px 18px; }
    .nb-sheet { padding: 40px 18px 26px 52px; transform: none; }
    .nb-sheet .nb-pin.nb-pin-left { left: 40px; }
}

@media (prefers-reduced-motion: reduce) {
    .nb-note, .nb-note:hover { transition: none; }
}

/* dark mode: the board darkens a little; the paper stays paper */
[data-bs-theme="dark"] .nb-frame { background:
        repeating-linear-gradient(92deg, rgba(255, 255, 255, .03) 0 2px, transparent 2px 9px),
        linear-gradient(180deg, #5a3a1f, #45290f 45%, #3a220c); }
[data-bs-theme="dark"] .nb-cork { background-color: #9a7445; filter: brightness(.88); }
[data-bs-theme="dark"] .nb-cork .nb-note { filter: brightness(.94); }
[data-bs-theme="dark"] .nb-cork .nb-note.is-ended { filter: grayscale(.85) brightness(.85); }
