/* CANAL PASS — public News & Announcements list styles.
   Self-contained: does not depend on the theme or any other plugin CSS. */

.cpau-news-section {
  padding: clamp(48px, 7vw, 90px) 0;
}
.cpau-news-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 32px);
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}
.cpau-news-container * { box-sizing: border-box; }

.cpau-news-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #dde4ec;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.cpau-tab {
  padding: 12px 18px;
  font-weight: 600;
  font-size: .9rem;
  color: #6b7c8f;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color .15s ease, border-color .15s ease;
}
.cpau-tab:hover { color: #0a3d62; }
.cpau-tab.is-active {
  color: #0a3d62;
  border-bottom-color: #c9a86a;
}

.cpau-news-list { padding-top: 8px; }

/* Capped list: JS sets the max-height to exactly N rows (see the inline
   script in cpau_render_news) and adds this class, so a long archive
   scrolls inside the block instead of pushing the rest of the page down.
   Without JS the class never lands and the full list shows — long, but
   never clipped. */
.cpau-news-list.is-capped {
  overflow-y: auto;
  /* Keeps the scrollbar clear of the row's right-hand badges. */
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: #dde4ec transparent;
}
/* The last row normally drops its separator. Inside a scroller it is no
   longer the end of anything on screen, so it earns its line back. */
.cpau-news-list.is-capped .cpau-news-row:last-child { border-bottom: 1px solid #dde4ec; }
.cpau-news-list.is-capped::-webkit-scrollbar { width: 6px; }
.cpau-news-list.is-capped::-webkit-scrollbar-thumb { background: #dde4ec; border-radius: 3px; }
.cpau-news-list.is-capped::-webkit-scrollbar-track { background: transparent; }

/* Phones: no inner scroll — rows past the first few fold away behind a
   "Show more" button (see the inline script in cpau_render_news). */
.cpau-news-row.is-folded { display: none; }
.cpau-news-more {
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 14px 0 0;
  padding: 12px 18px;
  border: 1px solid #0a3d62;
  border-radius: 8px;
  background: #fff;
  color: #0a3d62;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.cpau-news-more:hover { background: #f3f7fb; }
.cpau-news-more:focus-visible { outline: 2px solid #c9a86a; outline-offset: 2px; }
.cpau-news-more[hidden] { display: none; }

.cpau-news-row {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 18px;
  align-items: start;
  padding: 18px 16px;
  border-bottom: 1px solid #dde4ec;
  border-left: 3px solid transparent;
}
.cpau-news-row:last-child { border-bottom: 0; }
.cpau-news-row.is-urgent {
  border-left-color: #b23b3b;
  background: #fdf6f6;
}

.cpau-news-date {
  font-size: .8rem;
  color: #6b7c8f;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding-top: 2px;
}

.cpau-news-title {
  font-size: 1.02rem;
  font-weight: 600;
  color: #0b1b2b;
  margin: 0 0 6px;
}
.cpau-news-excerpt {
  color: #3b4e62;
  font-size: .92rem;
  line-height: 1.55;
  margin: 0;
}

.cpau-news-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.cpau-channel-badge {
  background: #0a3d62;
  color: #ffffff;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  white-space: nowrap;
}
.cpau-urgent-badge {
  background: #b23b3b;
  color: #ffffff;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

.cpau-empty-state {
  color: #6b7c8f;
  font-size: .95rem;
  padding: 24px 0;
}

@media (max-width: 640px) {
  .cpau-news-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .cpau-news-meta {
    flex-direction: row;
    align-items: center;
  }
}

/* ============================================================
   "Read more" trigger + shared modal — used by both the classic
   news list (this file) and the timeline cards (channel-frontend.css).
   Lives here since news-frontend.css, channel-frontend.css and
   submit-frontend.css are always enqueued together on every page.
   ============================================================ */
.cpau-read-more {
  display: inline-block;
  background: none;
  border: none;
  padding: 0;
  margin-top: 4px;
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  color: #0a3d62;
  cursor: pointer;
}
.cpau-read-more:hover { text-decoration: underline; }

.cpau-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 27, 43, .55);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.cpau-modal-overlay[hidden] { display: none; }
body.cpau-modal-open { overflow: hidden; }

.cpau-modal {
  background: #ffffff;
  border-radius: 14px;
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  box-sizing: border-box;
}
.cpau-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f5f7fa;
  color: #0b1b2b;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}
.cpau-modal-close:hover { background: #dde4ec; }

.cpau-modal-meta {
  font-size: .78rem;
  color: #6b7c8f;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
  padding-right: 30px;
}
.cpau-modal-meta .cpau-urgent-badge {
  text-transform: none;
  letter-spacing: normal;
  background: #b23b3b;
  color: #ffffff;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
}
.cpau-modal-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #0b1b2b;
  margin: 0 0 18px;
  padding-right: 30px;
  line-height: 1.3;
}
.cpau-modal-body {
  font-size: .95rem;
  color: #3b4e62;
  line-height: 1.7;
}
.cpau-modal-body p { margin: 0 0 1em; }
.cpau-modal-body p:last-child { margin-bottom: 0; }

@media (max-width: 480px) {
  .cpau-modal { padding: 24px 20px; max-height: 90vh; }
}
