/* CSPC Library: news, events, hours, feedback form and news pages.
   Extends styles.css with the patterns from the Home, News page and Single post artboards. */

/* Colors come from the tokens in styles.css :root. */

:focus-visible { box-shadow: 0 0 0 2px var(--navy-900); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }

/* Buttons added by the new sections */
.btn { gap: 8px; }
.btn--md { height: auto; min-height: 48px; padding: 0 20px; font-weight: 600; }
.btn--outline, .btn--ghost {
  height: auto; min-height: 44px; padding: 0 16px; font-size: var(--text-body); font-weight: 600;
  color: var(--navy-700); background: var(--white); border: 1px solid var(--navy-700);
}
.btn--ghost { border-color: var(--line-strong); }
.btn--outline:hover, .btn--ghost:hover { color: var(--navy-900); background: var(--tint); filter: none; }
.btn.is-disabled { color: var(--muted); border-color: var(--line-strong); background: var(--tint); cursor: not-allowed; }
.btn.is-disabled:hover { filter: none; }

.more-link {
  display: inline-flex; align-items: center; min-height: 44px;
  font-weight: 600; font-size: var(--text-body); color: var(--navy-700);
}
.meta { font-size: var(--text-meta); color: var(--muted); }
.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tag {
  display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px;
  font-size: var(--text-label); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap;
  color: var(--navy-700); background: var(--tag-bg); border-radius: var(--radius-sm);
}
.pinned { display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-meta); font-weight: 600; color: var(--pin); }

/* Urgent advisory banner */
.advisory { background: var(--gold); color: var(--navy-900); }
.advisory .container { padding-top: 6px; padding-bottom: 6px; display: flex; align-items: center; gap: 12px; }
.advisory svg { flex: none; }
.advisory p { flex: 1 1 0; min-width: 0; font-size: var(--text-body); font-weight: 500; line-height: 1.4; }
.advisory a { color: var(--navy-900); font-weight: 700; }
.advisory__close {
  flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: var(--radius); color: var(--navy-900); cursor: pointer;
}
.advisory__close:hover { background: color-mix(in srgb, var(--navy-900) 12%, transparent); }
.advisory :focus-visible { outline-color: var(--navy-900); box-shadow: 0 0 0 2px var(--white); }

/* Hero additions: scope dropdown and quick links */
.search select {
  flex: 0 0 auto; height: 52px; padding: 0 12px; font: var(--text-body) var(--font-body); color: var(--ink);
  background: var(--white); border: 2px solid var(--white); border-radius: var(--radius);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  font: 500 var(--text-meta) var(--font-body); color: var(--white); text-decoration: none;
  background: transparent; border: 1px solid var(--line-on-navy); border-radius: 999px; cursor: pointer;
}
.chip:hover { color: var(--white); background: var(--wash-on-navy); border-color: var(--white); }
a.today__news { color: var(--white); text-decoration-color: var(--line-on-navy); text-underline-offset: 3px; }
a.today__news:hover { color: var(--gold); }

/* News section on the homepage */
.news { display: flex; flex-direction: column; gap: 32px; }
.news__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  font: 500 var(--text-body) var(--font-body); color: var(--navy-700); text-decoration: none;
  background: var(--white); border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer;
}
.pill:hover { border-color: var(--navy-700); }
.pill[aria-pressed="true"], .pill[aria-current="true"] {
  font-weight: 600; color: var(--white); background: var(--navy-700); border-color: var(--navy-700);
}
.news__body { display: flex; flex-wrap: wrap; gap: 32px; }
.featured {
  flex: 3 1 440px; min-width: 0; background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column;
}
.cover { display: block; width: 100%; object-fit: cover; background: var(--navy-700); }
.cover--empty { display: flex; align-items: center; justify-content: center; color: var(--line-on-navy); }
.featured__cover { height: 280px; }
.featured__text { padding: 28px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.featured h3 { font-weight: 700; font-size: var(--text-title); line-height: 1.15; }
.featured p { color: var(--muted); }
.news-list { flex: 2 1 360px; min-width: 0; display: flex; flex-direction: column; border-top: 2px solid var(--navy-700); }
.news-list__item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px 0;
  border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none;
}
.news-list__title { font-family: var(--font-display); font-weight: 700; font-size: var(--text-title-sm); line-height: 1.25; }
.news-list__item:hover .news-list__title { color: var(--navy-700); text-decoration: underline; }
.news-list__empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 24px;
  text-align: center; font-size: var(--text-body); color: var(--muted); border-bottom: 1px solid var(--line);
}
.news-list__empty svg { color: var(--border-input); }
.news-list__empty-title { font-family: var(--font-display); font-weight: 700; font-size: var(--text-title-sm); color: var(--ink); }
.news-list__empty span:last-child { max-width: 320px; }

.empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 72px 24px;
  text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg);
}
.empty svg { color: var(--border-input); }
.empty h1, .empty h2, .empty h3 { font-weight: 700; font-size: var(--text-title); }
.empty p { color: var(--muted); max-width: 440px; }
.empty .btn { margin-top: 6px; }

/* Upcoming events */
.events { display: flex; flex-wrap: wrap; gap: 24px; }
.event {
  flex: 1 1 320px; min-width: 0; background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 24px; display: flex; align-items: flex-start; gap: 20px;
}
.event__date {
  flex: 0 0 72px; display: flex; flex-direction: column; align-items: center; padding: 10px 0;
  background: var(--navy-700); border-radius: var(--radius); color: var(--white);
}
.event__month { font-size: var(--text-label); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }
.event__day { font-family: var(--font-display); font-weight: 800; font-size: var(--text-numeral); line-height: 1.1; font-variant-numeric: tabular-nums; }
.event__body { min-width: 0; display: flex; flex-direction: column; gap: 6px; font-size: var(--text-body); color: var(--muted); }
.event__body h3 { font-weight: 700; font-size: var(--text-title-sm); line-height: 1.25; color: var(--ink); }

/* Library hours strip */
.hours { background: var(--navy-900); color: var(--white); scroll-margin-top: 5.5rem; }
.hours .container { padding-top: 28px; padding-bottom: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 20px 48px; }
.hours__status { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 14px;
  font-size: var(--text-meta); font-weight: 700; color: var(--navy-900); background: var(--white); border-radius: 999px;
}
.status-pill__dot { width: 10px; height: 10px; border: 2px solid var(--navy-900); border-radius: 50%; }
.status-pill.is-open { color: var(--ok-ink); background: var(--ok-bg); }
.status-pill.is-open .status-pill__dot { background: var(--ok); border-color: var(--ok); }
.hours__note { font-size: var(--text-meta); color: var(--on-navy-muted); }
.hours__slot { display: flex; flex-direction: column; }
.hours__label { font-size: var(--text-label); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--on-navy-muted); }
.hours__value { font-size: var(--text-lead); font-weight: 600; font-variant-numeric: tabular-nums; }
.hours__spacer { flex: 1 1 0; }
.hours__link { display: inline-flex; align-items: center; min-height: 44px; color: var(--gold); font-weight: 600; font-size: var(--text-body); text-decoration: none; }
.hours__link:hover { color: var(--white); }

/* Forms downloads */
.forms-list__text { display: flex; flex-direction: column; }
.tile--static:hover { border-color: var(--line); box-shadow: none; }

/* Feedback form */
.form { display: flex; flex-direction: column; gap: 16px; max-width: 620px; }
.form__row { display: flex; flex-wrap: wrap; gap: 16px; }
.form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.field { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: var(--text-meta); font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; min-width: 0; height: 48px; padding: 0 14px; font: var(--text-body) var(--font-body); color: var(--ink);
  background: var(--white); border: 1px solid var(--border-input); border-radius: var(--radius);
}
.field textarea { height: auto; padding: 12px 14px; line-height: 1.5; resize: vertical; }
.field--error input, .field--error select, .field--error textarea { border: 2px solid var(--danger); }
.field__error { display: flex; align-items: center; gap: 6px; font-size: var(--text-meta); font-weight: 500; color: var(--danger); }
.field__error svg { flex: none; }
.form__submit { align-self: flex-start; }
.form-alert {
  max-width: 620px; display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
  background: var(--danger-bg); border: 1px solid var(--danger); border-radius: var(--radius-lg); color: var(--danger-ink);
}
.form-alert svg { flex: none; margin-top: 1px; }
.form-alert div { display: flex; flex-direction: column; }
.success {
  max-width: 620px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 28px;
  background: var(--ok-bg); border: 1px solid var(--ok); border-radius: var(--radius-lg);
}
.success svg { color: var(--ok); }
.success h3 { font-weight: 700; font-size: var(--text-title); }
.contact a { overflow-wrap: anywhere; }
.map { display: flex; flex-direction: column; gap: 4px; }
.map__frame {
  display: block; width: 100%; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--on-navy);
}
.map__link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-weight: 600; font-size: var(--text-body); }

/* Footer additions */
.footer__brand { gap: 12px; }
.footer__id { display: flex; align-items: center; gap: 14px; }
.footer__id > span { display: flex; flex-direction: column; }
.footer__id .footer__logo { width: 56px; height: 56px; margin: 0; }
.footer__name { line-height: 1.1; }
.footer__legal { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.footer__social { display: flex; gap: 8px; }
.footer__social a {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--white); border: 1px solid var(--navy-500); border-radius: 50%;
}
.footer__social a:hover { color: var(--gold); border-color: var(--gold); }

/* News page */
.page-head { background: var(--tint); border-bottom: 1px solid var(--line); }
.page-head .container { padding-top: 20px; padding-bottom: 40px; display: flex; flex-direction: column; gap: 8px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: var(--text-meta); color: var(--muted); }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }
.crumbs > span { padding: 0 4px; }
.news-page { padding-top: 48px; padding-bottom: 80px; display: flex; flex-direction: column; gap: 28px; }
.news-page__tools { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; }
.news-search { flex: 1 1 280px; max-width: 420px; display: flex; flex-direction: column; gap: 6px; }
.news-search label { font-size: var(--text-meta); font-weight: 600; }
.news-search__row { display: flex; gap: 8px; }
.news-search input {
  flex: 1 1 auto; min-width: 0; height: 48px; padding: 0 12px; font: var(--text-body) var(--font-body); color: var(--ink);
  background: var(--white); border: 1px solid var(--border-input); border-radius: var(--radius);
}
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 24px; }
.post-card {
  min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; display: flex; flex-direction: column;
}
.post-card__cover { height: 150px; }
.post-card__body { flex: 1 1 auto; padding: 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.post-card h2 { font-weight: 700; font-size: var(--text-title-sm); line-height: 1.25; }
.post-card p { font-size: var(--text-body); color: var(--muted); }
.post-card__foot {
  margin-top: auto; padding-top: 6px; align-self: stretch;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
}
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 8px; }
.pagination__pages { display: flex; flex-wrap: wrap; gap: 6px; }
.page-btn {
  min-width: 44px; min-height: 44px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--text-body); font-weight: 600; text-decoration: none; color: var(--navy-700);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
}
.page-btn:hover { border-color: var(--navy-700); }
.page-btn[aria-current="page"] { color: var(--white); background: var(--navy-700); border-color: var(--navy-700); }
.page-btn.is-disabled { color: var(--border-input); border-color: var(--line); }

/* Single post */
.article { max-width: 808px; margin: 0 auto; padding: 24px 24px 64px; display: flex; flex-direction: column; gap: 24px; }
.article__head { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.article__head h1 {
  font-weight: 800; font-size: var(--text-display); line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance;
}
.article__meta { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: var(--text-meta); color: var(--muted); }
.article__meta span { display: inline-flex; align-items: center; gap: 6px; }
.article__cover { width: 100%; max-height: 460px; object-fit: cover; border-radius: var(--radius-lg); display: block; }
.prose { font-size: var(--text-lead); line-height: 1.65; overflow-wrap: anywhere; }
.prose > * + * { margin-top: 18px; }
.prose h2, .prose h3 { margin-top: 30px; font-family: var(--font-display); font-weight: 700; font-size: var(--text-title); line-height: 1.2; }
.prose h3 { font-size: var(--text-title-sm); }
.prose ul, .prose ol { margin-bottom: 0; padding-left: 0; list-style: none; border-top: 2px solid var(--navy-700); counter-reset: li; }
.prose li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.prose ol li { counter-increment: li; }
.prose ol li::before { content: counter(li) ". "; font-weight: 600; }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius); }
.prose blockquote { margin-left: 0; margin-right: 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--gold); color: var(--muted); }
.share {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 20px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.share__label { font-size: var(--text-meta); font-weight: 600; padding-right: 6px; }
.more { padding-top: 64px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 28px; }
.more__cards { display: flex; flex-wrap: wrap; gap: 24px; }
.more-card {
  flex: 1 1 280px; min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  color: var(--ink); text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.more-card:hover { color: var(--ink); border-color: var(--navy-700); box-shadow: var(--shadow-raised); }
.more-card__title { font-family: var(--font-display); font-weight: 700; font-size: var(--text-title-sm); line-height: 1.25; }
.preview-bar { background: var(--warn-bg-strong); color: var(--warn-ink); border-bottom: 1px solid var(--warn-line); }
.preview-bar .container { padding-top: 10px; padding-bottom: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: var(--text-body); }
.preview-bar a { margin-left: auto; font-weight: 600; color: var(--warn-ink); display: inline-flex; align-items: center; min-height: 44px; }

@media (max-width: 600px) {
  .featured__cover { height: 200px; }
  .featured__text, .event { padding: 20px; }
  .hours .container { gap: 16px 32px; }
  .hours__spacer { display: none; }
  .news-page { padding-top: 32px; padding-bottom: 56px; }
  .article { padding-left: 16px; padding-right: 16px; }
  .prose { font-size: var(--text-body); }
  .search select { flex: 1 1 100%; }
  .news-search { max-width: none; }
}

/* "Coming soon" modal for systems that are not live yet */
.modal--soon { width: min(560px, calc(100% - 32px)); }
.soon { display: flex; align-items: flex-start; gap: 16px; }
.soon__icon {
  flex: none; width: 56px; height: 56px; border-radius: var(--radius-lg); background: var(--navy-700); color: var(--gold);
  display: inline-flex; align-items: center; justify-content: center;
}
.soon p { font-size: var(--text-body); color: var(--ink); }
.soon__actions { display: flex; flex-wrap: wrap; gap: 8px; }
