/* ==========================================================================
   Notice Board Slider - styles
   ========================================================================== */

.nbs-wrap {
    --nbs-header-start: #ff5113;
    --nbs-header-end: #ff9a5a;
    --nbs-header-text: #ffffff;
    --nbs-card-bg: #ffffff;
    --nbs-image-size: 76px;
    --nbs-arrow-color: #ff5113;
    --nbs-dot-color: #ffd3bd;
    --nbs-dot-active: #ff5113;
    box-sizing: border-box;
}
.nbs-wrap *,
.nbs-wrap *::before,
.nbs-wrap *::after {
    box-sizing: inherit;
}

.nbs-card-box {
    background: transparent;
    width: 100%;
}

/* ---------------- Header bar ---------------- */
.nbs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 12px 12px 0 0;
    background: linear-gradient(90deg, var(--nbs-header-start), var(--nbs-header-end));
    color: var(--nbs-header-text);
}
.nbs-header__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
}
.nbs-header__title svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.nbs-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: rgba(255, 255, 255, .18);
    padding: 5px 10px;
    border-radius: 999px;
}
.nbs-dot-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffffff;
    animation: nbs-pulse 1.4s infinite;
}
@keyframes nbs-pulse {
    0%   { transform: scale(1);   opacity: 1; }
    70%  { transform: scale(1.9); opacity: 0; }
    100% { transform: scale(1.9); opacity: 0; }
}

.nbs-body {
    padding: 20px 0;
}

/* ---------------- Card - base ---------------- */
.nbs-card {
    background: var(--nbs-card-bg);
    border-radius: 14px;
    box-shadow: 0 2px 14px rgba(0, 0, 0, .07);
    height: 100%;
    overflow: hidden;
}
.nbs-card__inner {
    height: 100%;
}
.nbs-card__title {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.35;
}
.nbs-card__text {
    font-size: 14px;
    line-height: 1.6;
    color: #5c5c5c;
}
.nbs-card__text p {
    margin: 0;
}
.nbs-readmore {
    display: inline-block !important;
    margin-top: 8px !important;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #ff5113 !important;
    cursor: pointer !important;
}
.nbs-card__full {
    display: none; /* only ever read by JS, never shown directly */
}
.nbs-card__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

/* =========================================================================
   TABLET / MOBILE - stacked list (image left, title+description right)
   ========================================================================= */
.nbs-grid {
    display: grid;
    grid-template-columns: repeat(var(--nbs-grid-cols, 1), 1fr);
    gap: 14px;
    overflow-y: auto;
    max-height: var(--nbs-grid-max-height, 480px);
    padding: 2px 4px;
}
.nbs-grid[data-cols="2"] { --nbs-grid-cols: 2; }
.nbs-grid[data-cols="1"] { --nbs-grid-cols: 1; }

.nbs-grid .nbs-card { padding: 14px; }
.nbs-grid .nbs-card__inner {
    display: grid;
    grid-template-columns: var(--nbs-image-size) 1fr;
    grid-template-areas:
        "image title"
        "image content";
    column-gap: 14px;
    row-gap: 4px;
    align-items: start;
}
.nbs-grid .nbs-card.no-image .nbs-card__inner {
    grid-template-columns: 1fr;
    grid-template-areas:
        "title"
        "content";
}
.nbs-grid .nbs-card__title   { grid-area: title; }
.nbs-grid .nbs-card__image   {
    grid-area: image;
    width: var(--nbs-image-size);
    height: var(--nbs-image-size);
    border-radius: 10px;
    overflow: hidden;
    align-self: start;
}
.nbs-grid .nbs-card__content { grid-area: content; }

/* =========================================================================
   DESKTOP SLIDER - Title on top, square Image in the middle, Description
   (with Read More) at the bottom.
   ========================================================================= */
.nbs-slider {
    --nbs-image-size-desktop: 160px;
    width: 100%;
    padding-bottom: 8px; /* room for pagination dots */
}
.nbs-slider .swiper-wrapper {
    align-items: stretch;
}
.nbs-slider .nbs-card {
    height: auto;
    min-height: var(--nbs-slider-height, 340px);
}
.nbs-slider .nbs-card__inner {
    display: grid;
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
        "title"
        "image"
        "content";
    justify-items: center;
    text-align: center;
    padding: 22px 20px;
    gap: 12px;
    height: 100%;
}
.nbs-slider .nbs-card__title   { grid-area: title; }
.nbs-slider .nbs-card__image   {
    grid-area: image;
    width: var(--nbs-image-size-desktop);
    height: var(--nbs-image-size-desktop);
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}
.nbs-slider .nbs-card__content {
    grid-area: content;
    width: 100%;
}

/* Arrows */
.nbs-arrow {
    color: var(--nbs-arrow-color) !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
    margin-top: -20px !important;
}
.nbs-arrow::after {
    font-size: 16px !important;
    font-weight: 900;
}
.nbs-arrow.swiper-button-disabled {
    opacity: .35;
}

/* Pagination dots */
.nbs-pagination {
    position: static;
    margin-top: 14px;
    line-height: 1;
}
.nbs-pagination .swiper-pagination-bullet {
    background: var(--nbs-dot-color);
    opacity: 1;
    width: 8px;
    height: 8px;
}
.nbs-pagination .swiper-pagination-bullet-active {
    background: var(--nbs-dot-active);
    width: 22px;
    border-radius: 4px;
}

/* =========================================================================
   Layout switch helpers (toggled by notice-board-slider.js)
   ========================================================================= */
.nbs-wrap .nbs-slider { display: none; }
.nbs-wrap .nbs-grid    { display: grid; }
.nbs-wrap.nbs-is-desktop .nbs-slider { display: block; }
.nbs-wrap.nbs-is-desktop .nbs-grid    { display: none; }
.nbs-wrap.nbs-is-mobile .nbs-slider  { display: none; }
.nbs-wrap.nbs-is-mobile .nbs-grid     { display: grid; }

/* =========================================================================
   Read More popup / modal
   ========================================================================= */
.nbs-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;      /* vertical centering   */
    justify-content: center;  /* horizontal centering */
    padding: 24px;
    overflow-y: auto;
}
.nbs-modal.is-open {
    display: flex;
}
.nbs-modal__overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 15, 10, .55);
}
.nbs-modal__dialog {
    position: relative;
    z-index: 1;
    max-width: 560px;
    width: 100%;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    margin: auto; /* keeps it centered even if content is shorter/taller than viewport */
    background: #ffffff;
    border-radius: 14px;
    padding: 28px 26px 26px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .28);
}
.nbs-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: #f2f2f2;
    color: #333;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0px !important;
}
.nbs-modal__close:hover { background: #e6e6e6; }
.nbs-modal__title {
    font-size: 19px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 26px 12px 0;
}
.nbs-modal__body {
    font-size: 15px;
    line-height: 1.75;
    color: #444;
}
/* Rich content support: the popup now shows the notice's original
   formatting (bold, lists, headings, links, images) as authored in the
   editor, instead of flattened plain text. */
.nbs-modal__body p { margin: 0 0 12px; }
.nbs-modal__body p:last-child { margin-bottom: 0; }
.nbs-modal__body strong,
.nbs-modal__body b { font-weight: 700; color: #1a1a1a; }
.nbs-modal__body em,
.nbs-modal__body i { font-style: italic; }
.nbs-modal__body ul,
.nbs-modal__body ol { margin: 0 0 12px; padding-left: 22px; }
.nbs-modal__body li { margin-bottom: 4px; }
.nbs-modal__body h1,
.nbs-modal__body h2,
.nbs-modal__body h3,
.nbs-modal__body h4 {
    color: #1a1a1a;
    line-height: 1.35;
    margin: 0 0 10px;
}
.nbs-modal__body a { color: #ff5113; text-decoration: underline; }
.nbs-modal__body img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 4px 0 14px;
}
.nbs-modal__body blockquote {
    margin: 0 0 12px;
    padding: 6px 14px;
    border-left: 3px solid #ffd3bd;
    color: #666;
}

/* =========================================================================
   Small screens - tighten dialog padding
   ========================================================================= */
@media (max-width: 480px) {
    .nbs-modal { padding: 12px; }
    .nbs-modal__dialog {
        padding: 22px 18px 20px;
        max-height: calc(100vh - 24px);
    }
}
