/* ==========================================================================
   NOTICEBOARD — redesign (home page). Two designed states:
     • with notices: heading column + a scrolling stack of notice cards
     • empty: a calm, friendly empty card (message text still from the CMS)
   Presentation only; the view's query/filters are unchanged.
   ========================================================================== */

body .notice-board-block {
  --ink: #0f243e;
  --lime: #a6cf37;
  --teal: #52cfae;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --pad: clamp(1.5rem, 4vw, 4.5rem);

  padding: clamp(3rem, 6vw, 5rem) 0 clamp(2.5rem, 5vw, 4rem);
  font-family: var(--sans);
}

body .notice-board-block .noticeboard-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.75rem, 3vw, 2.5rem);
  align-items: start;
  max-width: none;
  width: 100%;
  margin: 0;
  padding-inline: var(--pad);
}
@media (min-width: 960px) {
  body .notice-board-block .noticeboard-view {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.5fr);
    column-gap: clamp(2.5rem, 6vw, 6rem);
  }
  body .notice-board-block .noticeboard-view > header { position: sticky; top: 8.5rem; }
}
/* anything else the view may output spans the full width */
body .notice-board-block .noticeboard-view > *:not(header):not(.noticeboard-view-content-wrapper):not(.nb-empty) { grid-column: 1 / -1; }

/* ----- Left: heading ----------------------------------------------------- */
body .notice-board-block .noticeboard-view header {
  margin: 0;
  padding: 0;
  border: 0;
  font-family: var(--sans);
  text-align: left;
}
body .notice-board-block .nb-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 1.1rem;
  font: 800 0.74rem/1 var(--sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #4d6b12;
}
body .notice-board-block .nb-eyebrow__dot {
  width: 0.55rem; height: 0.55rem; border-radius: 50%;
  background: linear-gradient(135deg, var(--lime), var(--teal));
  box-shadow: 0 0 0 5px rgba(166, 207, 55, 0.25);
}
body .notice-board-block .nb-title {
  display: block;
  font: 300 clamp(2.4rem, 4.6vw, 4rem)/1.04 var(--serif);
  letter-spacing: -0.025em;
  color: var(--ink);
}
body .notice-board-block .nb-sub {
  max-width: 22rem;
  margin: 1rem 0 0;
  font: 500 1rem/1.7 var(--sans);
  color: #4a5a6b;
}
body .notice-board-block .nb-count {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1.5rem 0 0;
  padding: 0.5rem 1rem 0.5rem 0.6rem;
  border-radius: 999px;
  background: #f1f8e2;
  border: 1px solid rgba(166, 207, 55, 0.4);
  font: 700 0.82rem/1 var(--sans);
  color: var(--ink);
}
body .notice-board-block .nb-count__num {
  display: grid;
  place-items: center;
  min-width: 1.7rem;
  height: 1.7rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--lime), var(--teal));
  font: 800 0.8rem/1 var(--sans);
  color: var(--ink);
}

/* ----- Right: notice cards ----------------------------------------------- */
body .notice-board-block .noticeboard-view .noticeboard-view-content-wrapper {
  counter-reset: nb;
  display: grid;
  gap: 1rem;
  height: auto;
  max-height: clamp(360px, 56vh, 520px);
  overflow-y: auto;
  padding: 0.35rem 0.6rem 1.2rem 0.25rem;
  margin-right: -0.6rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 36, 62, 0.25) transparent;
  /* soft fade where the list continues */
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 2.5rem), transparent);
  mask-image: linear-gradient(180deg, #000 calc(100% - 2.5rem), transparent);
}
body .notice-board-block .noticeboard-view .noticeboard-view-content-wrapper::-webkit-scrollbar { width: 6px; }
body .notice-board-block .noticeboard-view .noticeboard-view-content-wrapper::-webkit-scrollbar-thumb { background: rgba(15, 36, 62, 0.22); border-radius: 6px; }

body .notice-board-block .noticeboard-view .noticeboard-view-content-wrapper .notice {
  counter-increment: nb;
  position: relative;
  padding: 1.35rem 1.6rem 1.4rem 2.1rem;
  border: 1px solid rgba(15, 36, 62, 0.08);
  border-bottom: 1px solid rgba(15, 36, 62, 0.08);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 44px -34px rgba(15, 36, 62, 0.4);
  font: 500 1.02rem/1.7 var(--sans);
  letter-spacing: 0;
  text-align: left;
  color: #34465a;
  transition: transform 0.45s var(--ease), box-shadow 0.45s ease, border-color 0.3s ease;
}
/* accent rail (replaces the old green dash) */
body .notice-board-block .noticeboard-view .noticeboard-view-content-wrapper .notice::before {
  content: "";
  position: absolute;
  top: 1.15rem;
  bottom: 1.15rem;
  left: 0.9rem;
  width: 4px;
  height: auto;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--lime), var(--teal));
  opacity: 0.9;
}
body .notice-board-block .noticeboard-view .noticeboard-view-content-wrapper .notice:last-child { border-bottom: 1px solid rgba(15, 36, 62, 0.08); }
body .notice-board-block .noticeboard-view .noticeboard-view-content-wrapper .notice:hover {
  transform: translateY(-3px);
  border-color: rgba(166, 207, 55, 0.5);
  box-shadow: 0 30px 52px -34px rgba(15, 36, 62, 0.5);
}
body .notice-board-block .notice__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.6rem;
}
body .notice-board-block .notice__meta::before {
  content: counter(nb, decimal-leading-zero);
  font: 300 1.5rem/1 var(--serif);
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, #6f9a14, #2fb394);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #5d8510;
}
body .notice-board-block .notice__date {
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  background: #f4f8ea;
  font: 700 0.7rem/1 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #55701c;
}
body .notice-board-block .notice__body p { margin: 0 0 0.6em; }
body .notice-board-block .notice__body p:last-child { margin-bottom: 0; }
body .notice-board-block .notice__body strong { font-weight: 800; color: var(--ink); }
body .notice-board-block .notice__body a { color: #3f7d0a; text-decoration-color: rgba(166, 207, 55, 0.7); text-underline-offset: 3px; }

/* ----- Empty state -------------------------------------------------------- */
body .notice-board-block .nb-empty {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  min-height: 15rem;
  padding: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 4vw, 3rem);
  border-radius: 28px;
  border: 1px dashed rgba(15, 36, 62, 0.18);
  background:
    radial-gradient(22rem 14rem at 0% 0%, rgba(166, 207, 55, 0.2), transparent 70%),
    radial-gradient(20rem 14rem at 100% 100%, rgba(82, 207, 174, 0.16), transparent 70%),
    #fbfdf5;
  text-align: center;
}
body .notice-board-block .nb-empty__icon {
  display: grid;
  place-items: center;
  width: 4.4rem;
  height: 4.4rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--lime), var(--teal));
  color: var(--ink);
  box-shadow: 0 0 0 8px rgba(166, 207, 55, 0.18), 0 18px 34px -16px rgba(120, 190, 40, 0.8);
}
body .notice-board-block .nb-empty .no-result-noticeboard {
  max-width: 34rem;
  margin: 0;
  padding: 0;
  font: 500 1.05rem/1.75 var(--sans);
  letter-spacing: 0;
  text-align: center;
  color: #34465a;
}

/* ----- Reveal motion (only when JS added .has-nb-reveal) ------------------ */
.has-nb-reveal .noticeboard-view [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
  transition-delay: var(--delay, 0ms);
}
.has-nb-reveal .noticeboard-view [data-reveal].is-visible { opacity: 1; transform: none; }
/* once revealed, hover lift must not wait on the reveal delay */
.has-nb-reveal .noticeboard-view .notice.is-visible { transition: transform 0.45s var(--ease), box-shadow 0.45s ease, border-color 0.3s ease, opacity 0.2s ease; }

@media (prefers-reduced-motion: reduce) {
  body .notice-board-block * { transition: none !important; }
}
