/**
 * Rhythmsnet Portal
 * Notice Board
 *
 * File:
 *   /assets/css/noticeboard.css
 *
 * Purpose:
 *   Responsive styling for the homepage Notice Board.
 *
 * Design:
 *   - Full-screen blocking overlay
 *   - Professional centered panel
 *   - Responsive announcement cards
 *   - Single-notice presentation
 *   - Multiple-notice grid
 *   - In-panel detail view
 *   - Mobile-friendly near-full-screen layout
 */


/* ============================================================
   OVERLAY
   ============================================================ */

.rn-noticeboard-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;
    box-sizing: border-box;

    background: rgba(15, 23, 42, 0.68);

    overflow: hidden;
}


/* ============================================================
   MAIN NOTICE BOARD PANEL
   ============================================================ */

.rn-noticeboard-panel {
    position: relative;

    width: 100%;
    max-width: 920px;
    max-height: 90vh;

    display: flex;
    flex-direction: column;

    background: #ffffff;

    border-radius: 16px;

    box-shadow:
        0 28px 70px rgba(0, 0, 0, 0.32),
        0 4px 16px rgba(0, 0, 0, 0.12);

    overflow: hidden;
}


/* ============================================================
   HEADER
   ============================================================ */

.rn-noticeboard-header {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 20px 24px;

    background: #ffffff;

    border-bottom: 1px solid #e5e7eb;
}


.rn-noticeboard-heading-wrap {
    display: flex;
    align-items: center;

    gap: 13px;

    min-width: 0;
}


.rn-noticeboard-icon {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;

    font-size: 24px;

    background: #f3f4f6;

    border-radius: 50%;
}


.rn-noticeboard-title {
    margin: 0;

    font-size: 25px;
    line-height: 1.2;
    font-weight: 700;

    color: #111827;
}


.rn-noticeboard-subtitle {
    margin-top: 3px;

    font-size: 14px;
    line-height: 1.4;

    color: #6b7280;
}


/* ============================================================
   CLOSE BUTTON
   ============================================================ */

.rn-noticeboard-close {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;

    padding: 0;

    border: 0;
    border-radius: 8px;

    background: transparent;

    color: #6b7280;

    font-family: Arial, sans-serif;
    font-size: 32px;
    line-height: 1;

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}


.rn-noticeboard-close:hover,
.rn-noticeboard-close:focus {
    background: #f3f4f6;
    color: #111827;
    outline: none;
}


/* ============================================================
   SCROLLABLE CONTENT AREA
   ============================================================ */

.rn-noticeboard-content {
    flex: 1 1 auto;

    min-height: 0;

    padding: 24px;

    overflow-y: auto;
    overscroll-behavior: contain;

    background: #f8fafc;
}


/* ============================================================
   NOTICE GRID
   ============================================================ */

.rn-noticeboard-grid {
    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(240px, 1fr));

    gap: 20px;

    align-items: stretch;
}


/*
 * When only one announcement exists, keep it comfortably
 * centered rather than stretching it across the entire board.
 */

.rn-noticeboard-grid-single {
    grid-template-columns: minmax(280px, 540px);
    justify-content: center;
}


/* ============================================================
   NOTICE CARD
   ============================================================ */

.rn-notice-card {
    position: relative;

    display: flex;
    flex-direction: column;

    min-width: 0;

    background: #ffffff;

    border: 1px solid #e2e8f0;
    border-radius: 13px;

    overflow: hidden;

    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07);

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}


.rn-notice-card:hover {
    transform: translateY(-2px);

    border-color: #cbd5e1;

    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.11);
}


/* Important / pinned notice */

.rn-notice-card-pinned {
    border-top: 4px solid #b45309;
}


/* ============================================================
   CARD IMAGE
   ============================================================ */

.rn-notice-card-image-wrap {
    width: 100%;

    aspect-ratio: 16 / 7;

    overflow: hidden;

    background: #e5e7eb;
}


.rn-notice-card-image {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}


/* No thumbnail supplied */

.rn-notice-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;

    background:
        linear-gradient(
            135deg,
            #f1f5f9 0%,
            #e2e8f0 100%
        );
}

/*
 * When no announcement image exists, use a compact
 * decorative placeholder instead of a large image area.
 */
.rn-notice-card-placeholder {
    aspect-ratio: auto;
    height: 92px;
}


.rn-notice-placeholder-icon {
    font-size: 32px;
    line-height: 1;

    opacity: 0.75;
}


/* ============================================================
   CARD BODY
   ============================================================ */

.rn-notice-card-body {
    flex: 1 1 auto;

    display: flex;
    flex-direction: column;

    padding: 18px 19px 19px;
}


/* ============================================================
   CARD META / BADGES
   ============================================================ */

.rn-notice-card-meta,
.rn-notice-detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;

    gap: 7px;

    margin-bottom: 10px;
}


.rn-notice-type {
    display: inline-flex;
    align-items: center;

    min-height: 24px;

    padding: 3px 9px;

    border-radius: 999px;

    background: #e8eef7;

    color: #334155;

    font-size: 11px;
    line-height: 1.2;
    font-weight: 700;

    letter-spacing: 0.04em;

    text-transform: uppercase;
}


.rn-notice-pinned {
    display: inline-flex;
    align-items: center;

    min-height: 24px;

    padding: 3px 9px;

    border-radius: 999px;

    background: #fff7ed;

    color: #9a3412;

    font-size: 11px;
    line-height: 1.2;
    font-weight: 700;

    letter-spacing: 0.03em;

    text-transform: uppercase;
}


/* ============================================================
   CARD TITLE
   ============================================================ */

.rn-notice-card-title {
    margin: 0 0 9px;

    color: #111827;

    font-size: 19px;
    line-height: 1.3;
    font-weight: 700;
}


/* ============================================================
   CARD SUMMARY
   ============================================================ */

.rn-notice-card-summary {
    flex: 1 1 auto;

    margin: 0 0 18px;

    color: #4b5563;

    font-size: 14px;
    line-height: 1.55;
}


/* ============================================================
   VIEW DETAILS BUTTON
   ============================================================ */

.rn-notice-details-btn {
    align-self: flex-start;

    margin-top: auto;

    padding: 9px 15px;

    border: 1px solid #1f4f7a;
    border-radius: 7px;

    background: #ffffff;

    color: #1f4f7a;

    font-family: inherit;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}


.rn-notice-details-btn:hover,
.rn-notice-details-btn:focus {
    background: #1f4f7a;
    color: #ffffff;

    outline: none;
}


/* ============================================================
   HIDDEN SOURCE CONTENT

   This is never displayed directly. JavaScript copies its
   contents into the detail-view area.
   ============================================================ */

.rn-notice-detail-source[hidden] {
    display: none !important;
}


/* ============================================================
   DETAIL VIEW
   ============================================================ */

.rn-noticeboard-detail-view {
    width: 100%;
    max-width: 820px;

    margin: 0 auto;

    box-sizing: border-box;
}


.rn-noticeboard-detail-view[hidden] {
    display: none !important;
}


/* ============================================================
   BACK BUTTON
   ============================================================ */

.rn-notice-back-btn {
    display: inline-flex;
    align-items: center;

    margin: 0 0 18px;

    padding: 8px 12px;

    border: 1px solid #d1d5db;
    border-radius: 7px;

    background: #ffffff;

    color: #374151;

    font-family: inherit;
    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}


.rn-notice-back-btn:hover,
.rn-notice-back-btn:focus {
    background: #f3f4f6;
    border-color: #9ca3af;

    outline: none;
}


/* ============================================================
   DETAIL CONTENT CARD
   ============================================================ */

.rn-noticeboard-detail-content {
    padding: 26px 28px;

    background: #ffffff;

    border: 1px solid #e2e8f0;
    border-radius: 13px;

    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);

    color: #374151;
}


/* ============================================================
   DETAIL TITLE
   ============================================================ */

.rn-notice-detail-title {
    margin: 0 0 18px;

    color: #111827;

    font-size: 25px;
    line-height: 1.3;
    font-weight: 700;
}


/* ============================================================
   DETAIL IMAGE
   ============================================================ */

.rn-notice-detail-image-wrap {
    width: 100%;

    margin: 0 0 22px;

    overflow: hidden;

    border-radius: 10px;

    background: #e5e7eb;
}


.rn-notice-detail-image {
    display: block;

    width: 100%;
    max-height: 420px;

    object-fit: contain;

    background: #f8fafc;
}


/* ============================================================
   DETAIL RICH-TEXT BODY
   ============================================================ */

.rn-notice-detail-body {
    color: #374151;

    font-size: 15px;
    line-height: 1.7;

    overflow-wrap: anywhere;
}


.rn-notice-detail-body h1,
.rn-notice-detail-body h2,
.rn-notice-detail-body h3,
.rn-notice-detail-body h4 {
    color: #111827;

    line-height: 1.3;
}


.rn-notice-detail-body h1 {
    font-size: 25px;
}


.rn-notice-detail-body h2 {
    font-size: 22px;
}


.rn-notice-detail-body h3 {
    font-size: 19px;
}


.rn-notice-detail-body h4 {
    font-size: 17px;
}


.rn-notice-detail-body p:first-child {
    margin-top: 0;
}


.rn-notice-detail-body p:last-child {
    margin-bottom: 0;
}


.rn-notice-detail-body img {
    max-width: 100%;
    height: auto;

    border-radius: 7px;
}


.rn-notice-detail-body table {
    width: 100%;

    border-collapse: collapse;

    margin: 16px 0;
}


.rn-notice-detail-body th,
.rn-notice-detail-body td {
    padding: 8px 10px;

    border: 1px solid #d1d5db;

    text-align: left;
    vertical-align: top;
}


.rn-notice-detail-body a {
    color: #1f4f7a;

    text-decoration: underline;
}


/* ============================================================
   DETAIL ACTION BUTTON
   ============================================================ */

.rn-notice-detail-action {
    margin-top: 24px;

    padding-top: 20px;

    border-top: 1px solid #e5e7eb;
}


.rn-notice-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;

    padding: 10px 18px;

    border-radius: 7px;

    background: #1f4f7a;

    color: #ffffff !important;

    font-size: 14px;
    line-height: 1.2;
    font-weight: 600;

    text-decoration: none !important;

    transition:
        background 0.15s ease,
        transform 0.15s ease;
}


.rn-notice-action-btn:hover,
.rn-notice-action-btn:focus {
    background: #173d60;

    transform: translateY(-1px);

    outline: none;
}


/* ============================================================
   FOOTER
   ============================================================ */

.rn-noticeboard-footer {
    flex: 0 0 auto;

    padding: 11px 24px;

    background: #ffffff;

    border-top: 1px solid #e5e7eb;

    color: #6b7280;

    font-size: 12px;
    line-height: 1.4;

    text-align: right;
}


/* ============================================================
   TABLET
   ============================================================ */

@media (max-width: 820px) {

    .rn-noticeboard-overlay {
        padding: 16px;
    }


    .rn-noticeboard-panel {
        max-height: 92vh;
    }


    .rn-noticeboard-grid {
        grid-template-columns:
            repeat(auto-fit, minmax(220px, 1fr));

        gap: 16px;
    }


    .rn-noticeboard-content {
        padding: 20px;
    }

}


/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 640px) {

    .rn-noticeboard-overlay {
        align-items: center;

        padding: 8px;
    }


    /*
     * Nearly full-screen on phones while retaining a small
     * outer margin so the Notice Board still feels like a modal.
     */

    .rn-noticeboard-panel {
        width: 100%;
        max-width: none;

        max-height: 96vh;

        border-radius: 12px;
    }


    /* ---------------- HEADER ---------------- */

    .rn-noticeboard-header {
        gap: 10px;

        padding: 14px 14px;
    }


    .rn-noticeboard-heading-wrap {
        gap: 10px;
    }


    .rn-noticeboard-icon {
        width: 36px;
        height: 36px;

        font-size: 19px;
    }


    .rn-noticeboard-title {
        font-size: 20px;
    }


    .rn-noticeboard-subtitle {
        font-size: 12px;
    }


    .rn-noticeboard-close {
        width: 38px;
        height: 38px;

        font-size: 29px;
    }


    /* ---------------- CONTENT ---------------- */

    .rn-noticeboard-content {
        padding: 14px;
    }


    /*
     * Stack all announcements vertically on mobile.
     */

    .rn-noticeboard-grid,
    .rn-noticeboard-grid-single {
        grid-template-columns: 1fr;

        gap: 14px;
    }


    /* ---------------- CARD ---------------- */

    .rn-notice-card {
        border-radius: 10px;
    }


    /*
     * Reduce image height on phones so the user sees the
     * announcement information without excessive scrolling.
     */

    .rn-notice-card-image-wrap {
        aspect-ratio: 16 / 6;
    }


    .rn-notice-placeholder-icon {
        font-size: 34px;
    }


    .rn-notice-card-body {
        padding: 15px;
    }


    .rn-notice-card-title {
        font-size: 17px;
    }


    .rn-notice-card-summary {
        margin-bottom: 14px;

        font-size: 13px;
        line-height: 1.5;
    }


    .rn-notice-details-btn {
        width: 100%;

        padding: 10px 14px;

        text-align: center;
    }


    /* ---------------- DETAIL VIEW ---------------- */

    .rn-notice-back-btn {
        margin-bottom: 12px;
    }


    .rn-noticeboard-detail-content {
        padding: 18px 16px;

        border-radius: 10px;
    }


    .rn-notice-detail-title {
        margin-bottom: 14px;

        font-size: 21px;
    }


    .rn-notice-detail-body {
        font-size: 14px;
        line-height: 1.65;
    }


    .rn-notice-detail-image-wrap {
        margin-bottom: 17px;
    }


    .rn-notice-action-btn {
        width: 100%;

        box-sizing: border-box;
    }


    /* ---------------- FOOTER ---------------- */

    .rn-noticeboard-footer {
        padding: 9px 14px;

        font-size: 11px;

        text-align: center;
    }

}


/* ============================================================
   VERY SMALL PHONES
   ============================================================ */

@media (max-width: 380px) {

    .rn-noticeboard-overlay {
        padding: 5px;
    }


    .rn-noticeboard-panel {
        max-height: 98vh;

        border-radius: 9px;
    }


    .rn-noticeboard-subtitle {
        display: none;
    }


    .rn-noticeboard-content {
        padding: 10px;
    }


    .rn-notice-card-body {
        padding: 13px;
    }


    .rn-noticeboard-detail-content {
        padding: 15px 13px;
    }

}


/* ============================================================
   ACCESSIBILITY — REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

    .rn-notice-card,
    .rn-notice-details-btn,
    .rn-notice-action-btn,
    .rn-noticeboard-close,
    .rn-notice-back-btn {
        transition: none;
    }

}

/*
 * Rich Notice Board content
 * including ranking / tabular announcements.
 */

.rn-noticeboard-detail-content table {
    width: 100%;

    margin: 16px 0;

    border-collapse: collapse;

    font-size: 14px;
}

.rn-noticeboard-detail-content th,
.rn-noticeboard-detail-content td {
    padding: 8px 10px;

    border: 1px solid #cbd5e1;

    text-align: left;
    vertical-align: top;
}

.rn-noticeboard-detail-content th {
    background: #f1f5f9;

    font-weight: 600;
}


/*
 * Allow wide ranking tables to scroll rather
 * than crushing columns on phones/tablets.
 */
.rn-noticeboard-detail-content {
    overflow-x: auto;
}

.rn-noticeboard-detail-content a {
    color: #1d4ed8;
    text-decoration: underline;
}

/* ============================================================
   SPOTLIGHT SUBMISSION — DYNAMIC NOTICE DETAIL
   ============================================================ */

.rn-notice-spotlight-submission {
    max-width: 760px;
    margin: 0 auto;
}

.rn-notice-spotlight-heading {
    margin-bottom: 4px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
}

.rn-notice-spotlight-month {
    margin-bottom: 16px;
    text-align: center;
    color: #64748b;
    font-size: 15px;
    font-weight: 600;
}

.rn-notice-spotlight-deadline {
    margin: 0 0 18px;
    padding: 12px 15px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-align: center;
    line-height: 1.5;
}

.rn-notice-spotlight-instruction {
    margin: 0 0 14px;
}

.rn-notice-spotlight-prompts {
    margin: 0;
    padding-left: 26px;
}

.rn-notice-spotlight-prompt {
    margin-bottom: 20px;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
}

.rn-notice-spotlight-prompt:last-child {
    margin-bottom: 0;
}

.rn-notice-spotlight-prompt-text {
    line-height: 1.55;
}

.rn-notice-spotlight-prompt-text p:first-child {
    margin-top: 0;
}

.rn-notice-spotlight-prompt-text p:last-child {
    margin-bottom: 0;
}

.rn-notice-spotlight-audio {
    margin-top: 12px;
}

.rn-notice-spotlight-audio audio {
    display: block;
    width: 100%;
}

.rn-notice-spotlight-complexity {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 9px;
    background: #f1f5f9;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.3;
}

.rn-notice-spotlight-submit-wrap {
    margin-top: 22px;
    text-align: center;
}

.rn-notice-spotlight-submit {
    display: inline-block;
    min-width: 160px;
    text-align: center;
}

@media (max-width: 640px) {

    .rn-notice-spotlight-heading {
        font-size: 21px;
    }

    .rn-notice-spotlight-prompts {
        padding-left: 20px;
    }

    .rn-notice-spotlight-prompt {
        padding: 12px;
    }
}

/* ============================================================
   NOTICE BOARD — VISUAL REFINEMENT
   ============================================================ */

/*
 * Main modal panel
 */
.rn-noticeboard-panel {
    background: #f8f6f1;
}


/*
 * Main content area behind the cards
 */
.rn-noticeboard-content {
    background: #f3f6f8;
}


/*
 * Individual announcement cards
 */
.rn-notice-card {
    background: #fffdf8;
    border: 1px solid #d8e0e7;
    box-shadow:
        0 4px 14px rgba(15, 23, 42, 0.06);
}


/*
 * Slightly stronger visual treatment for pinned notices
 */
.rn-notice-card-pinned {
    border-color: #c8d4df;
}


/*
 * Card body
 */
.rn-notice-card-body {
    background: #fffdf8;
}


/*
 * Detail view background
 */
.rn-noticeboard-detail-view {
    background: #f3f6f8;
}


/*
 * Main detail content panel
 */
.rn-noticeboard-detail-content {
    background: #fffdf8;
    border: 1px solid #d8e0e7;
    border-radius: 12px;
    padding: 22px;
}


/*
 * Prompt cards inside Spotlight detail
 */
.rn-notice-spotlight-prompt {
    background: #f8fafc;
    border: 1px solid #dbe3ea;
}


/*
 * Spotlight deadline box
 */
.rn-notice-spotlight-deadline {
    background: #eef4f7;
    border-color: #d7e2e8;
}


/*
 * Header remains crisp and clean
 */
.rn-noticeboard-header {
    background: #ffffff;
}


/*
 * Footer slightly differentiated
 */
.rn-noticeboard-footer {
    background: #fafafa;
}

/* ============================================================
   SPOTLIGHT WINNERS — DYNAMIC NOTICE BOARD DETAIL
   ============================================================ */

.rn-notice-spotlight-winners {
    text-align: center;
}


.rn-notice-spotlight-winners-heading {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 4px;
}


.rn-notice-spotlight-winners-month {
    font-size: 1rem;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 14px;
}


.rn-notice-spotlight-winners-intro {
    max-width: 720px;
    margin: 0 auto 20px;
    line-height: 1.6;
}


/* ================= WINNER GRID ================= */

.rn-notice-spotlight-winners-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(190px, 1fr)
    );
    gap: 18px;
    align-items: start;
    margin-top: 18px;
}


.rn-notice-spotlight-winner {
    background: #f8fafc;
    border: 1px solid #dbe3ea;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}


.rn-notice-spotlight-winner-rank {
    font-size: 0.84rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 8px;
}


/* ================= PERFORMANCE MEDIA ================= */

.rn-notice-spotlight-winner-media {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 9px;
    overflow: hidden;
    position: relative;
}


.rn-notice-spotlight-winner-media video,
.rn-notice-spotlight-winner-media iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
}


.rn-notice-spotlight-winner-media video {
    object-fit: cover;
}


.rn-notice-spotlight-winner-no-media {
    width: 100%;
    height: 100%;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.85rem;
}


/* ================= WINNER NAME ================= */

.rn-notice-spotlight-winner-name {
    margin-top: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1f2937;
}


/* ================= CLOSING MESSAGE ================= */

.rn-notice-spotlight-winners-closing {
    margin: 22px auto 0;
    max-width: 700px;
    line-height: 1.6;
}


/* ================= MOBILE ================= */

@media (max-width: 640px) {

    .rn-notice-spotlight-winners-heading {
        font-size: 1.18rem;
    }


    .rn-notice-spotlight-winners-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }


    .rn-notice-spotlight-winner {
        padding: 10px;
    }
}

/* ============================================================
   SPOTLIGHT WINNERS — CARD BADGE
   Show the full badge instead of cropping it like a photograph.
   ============================================================ */

.rn-notice-card-image-winner {
    object-fit: contain;
    padding: 14px;
    box-sizing: border-box;
    background: #f8fafc;
}

/* ============================================================
   SPOTLIGHT WINNERS — DETAIL BADGE
   Keep the badge visible, but secondary to the winners.
   ============================================================ */

.rn-notice-detail-image-wrap-winner {
    text-align: center;
    background: transparent;
    margin: 8px 0 14px;
}

.rn-notice-detail-image-winner {
    width: auto;
    max-width: 130px;
    max-height: 110px;
    object-fit: contain;
    border-radius: 0;
    margin: 0 auto;
}