/**
 * School Notice Board – Frontend Stylesheet
 *
 * All rules are scoped under .wl-noticeboard so they never
 * interfere with an existing WordPress theme.
 *
 * @package SchoolNoticeBoard
 * @version 1.0.0
 */

/* ── Reset (scoped) ───────────────────────────────────────────── */
.wl-noticeboard *,
.wl-noticeboard *::before,
.wl-noticeboard *::after {
    box-sizing: border-box;
}

/* ── Wrapper ──────────────────────────────────────────────────── */
.wl-noticeboard {
    font-family: 'Nunito', sans-serif;
    color: #2c3e2d;
    line-height: 1.65;
    background: #f5f7f2;
    padding: 60px 20px 80px;
}

/* ── Section heading ──────────────────────────────────────────── */
.wl-nb-heading {
    text-align: center;
    margin-bottom: 50px;
}
.wl-nb-heading__tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #e8f5e9;
    color: #2e7d32;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    padding: 5px 16px;
    border-radius: 50px;
    margin-bottom: 12px;
}
.wl-nb-heading h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    color: #1a3a1c;
    margin-bottom: 8px;
    font-weight: 700;
}
.wl-nb-heading p {
    color: #6b7c6b;
    font-size: .93rem;
    max-width: 520px;
    margin: 0 auto;
}

/* ── Notice list ──────────────────────────────────────────────── */
.wl-nb-list {
    max-width: 860px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* ── Notice card ──────────────────────────────────────────────── */
.wl-nb-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 3px 22px rgba(45, 106, 48, .09);
    border: 1px solid rgba(45, 106, 48, .1);
    overflow: hidden;
    display: grid;
    grid-template-columns: 6px 1fr;
    transition: transform .27s ease, box-shadow .27s ease;
    animation: wlCardIn .4s ease both;
}

@keyframes wlCardIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wl-nb-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 36px rgba(45, 106, 48, .16);
}

/* Left colour bar — colour set inline by PHP for dynamic cycling */
.wl-nb-card__bar {
    /* fallback if inline style missing */
    background: linear-gradient(180deg, #2e7d32, #43a047);
}

/* ── Card body ────────────────────────────────────────────────── */
.wl-nb-card__body {
    padding: 26px 30px;
}

/* ── Top row: title-wrap + dates ──────────────────────────────── */
.wl-nb-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

/* ── Title wrapper ────────────────────────────────────────────── */
.wl-nb-card__title-wrap {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    flex: 1;
    min-width: 0;
}

/* ── Speaker icon ─────────────────────────────────────────────── */
.wl-nb-card__title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.05rem;
    color: #fff;
    flex-shrink: 0;
    margin-top: 1px;
    /* colour set inline by PHP */
    background: linear-gradient(135deg, #2e7d32, #66bb6a);
    box-shadow: 0 3px 10px rgba(0, 0, 0, .22);
    transition: transform .22s ease, box-shadow .22s ease;
}
.wl-nb-card__title-icon:hover {
    transform: scale(1.18) rotate(-8deg);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
}

/* ── Title text ───────────────────────────────────────────────── */
.wl-nb-card__title {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a3a1c;
    line-height: 1.4;
    margin: 0;
    flex: 1;
    min-width: 0;
}

/* ── Date tags ────────────────────────────────────────────────── */
.wl-nb-card__dates {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    flex-shrink: 0;
}
.wl-date-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .73rem;
    font-weight: 700;
    padding: 4px 11px;
    border-radius: 20px;
    white-space: nowrap;
}
.wl-date-tag--pub { background: #e8f5e9; color: #2e7d32; }
.wl-date-tag--exp { background: #fff3e0; color: #e65100; }

/* ── Greeting ─────────────────────────────────────────────────── */
.wl-nb-card__greeting {
    font-size: .88rem;
    color: #8a9e8b;
    font-style: italic;
    margin-bottom: 12px;
    padding-left: 14px;
    border-left: 3px solid #c8e6c9;
}

/* ── Content ──────────────────────────────────────────────────── */
.wl-nb-card__content {
    font-size: .92rem;
    color: #4a5e4b;
    line-height: 1.75;
}
.wl-nb-card__content p { margin-bottom: .65rem; }
.wl-nb-card__content p:last-child { margin-bottom: 0; }

/* ── Footer ───────────────────────────────────────────────────── */
.wl-nb-card__footer {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px dashed #d4e8d4;
    display: flex;
    align-items: center;
    gap: 10px;
}
.wl-nb-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2e7d32, #43a047);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    flex-shrink: 0;
}
.wl-nb-school {
    font-size: .8rem;
    font-weight: 700;
    color: #5a6e5b;
}

/* ── Empty state ──────────────────────────────────────────────── */
.wl-nb-empty {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 3px 22px rgba(45, 106, 48, .09);
    border: 1px solid rgba(45, 106, 48, .12);
    padding: 28px 30px;
    max-width: 860px;
    margin: 0 auto;
    /* ensure it's always visible */
    min-height: 90px;
    position: relative;
    z-index: 1;
}
.wl-nb-empty__icon {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2e7d32, #66bb6a) !important;
    color: #fff !important;
    font-size: 1.35rem;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(46, 125, 50, .30);
}
.wl-nb-empty__icon i {
    color: #fff !important;
    font-size: 1.2rem;
}
.wl-nb-empty__text h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a3a1c !important;
    margin: 0 0 4px !important;
    padding: 0 !important;
}
.wl-nb-empty__text p {
    font-size: .88rem;
    color: #6b7c6b !important;
    margin: 0 !important;
    line-height: 1.6;
}

/* Make sure wrapper never collapses when empty */
.wl-noticeboard .wl-nb-list:empty,
.wl-noticeboard .wl-nb-list {
    min-height: 10px;
}

@media (max-width: 480px) {
    .wl-nb-empty { flex-direction: column; text-align: center; }
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 580px) {
    .wl-nb-card__body  { padding: 20px; }
    .wl-nb-card__top   { flex-direction: column; gap: 10px; }
    .wl-nb-card__dates { flex-direction: row; align-items: center; flex-wrap: wrap; }
}
