/* SJPD Press Release Archive — shared stylesheet */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: #1a1a1a;
  background: #f0f2f5;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ── Skip navigation (WCAG 2.4.1) ── */

.skip-link {
  position: absolute;
  top: -3rem;
  left: 0;
  background: #000080;
  color: #fff;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  text-decoration: none;
  z-index: 100;
  transition: top 0.1s;
}

.skip-link:focus {
  top: 0;
}

/* ── Site header ── */

.site-header {
  background: #003366;
  color: #fff;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 4px solid #c5a945;
  flex-shrink: 0;
}

.site-header .header-title {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.3em;
  font-weight: bold;
  color: #fff;
  margin: 0;
  white-space: nowrap;
}

.site-header .header-title a {
  color: #fff;
  text-decoration: none;
  font-size: 1.2em;
}

.site-header .header-title a:hover {
  text-decoration: underline;
}

.site-header .header-search {
  flex: 0 1 400px;
  min-width: 200px;
}

.site-header .gsc-control-cse {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}

.site-header .gsc-search-box {
  margin-bottom: 0 !important;
}

.site-header table.gsc-search-box td {
  vertical-align: middle;
  height: 25px;
}

/* ── Sidebar back link ── */

.sidebar-back-link {
  display: block;
  font-size: 0.9em;
  color: #00237a;
  text-decoration: underline;
  margin: 0.75rem 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #333333;
}

.sidebar-back-link:hover {
  color: #000080;
}

/* ── Index page two-column layout ── */

.layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Left sidebar */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  background: #f0f0f0;
  color: #1a1a1a;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  border-right: 2px solid #333;
}

.sidebar-header {
  padding: 0.9rem 0.85rem 0.75rem;
  border-bottom: 1px solid #333;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sidebar-header strong {
  font-size: 0.95rem;
  color: #1a1a1a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar details {
  border-bottom: 1px solid #b0b0b0;
}

.sidebar summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.88rem;
  color: #1a1a1a;
  padding: 0.45rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
  user-select: none;
}

.sidebar summary::-webkit-details-marker { display: none; }
.sidebar summary::before {
  content: "▶";
  font-size: 0.6rem;
  transition: transform 0.15s;
  flex-shrink: 0;
}
.sidebar details[open] > summary::before { transform: rotate(90deg); }

.sidebar .count {
  font-weight: 400;
  font-size: 0.8rem;
  color: #555555;
  margin-left: auto;
}

.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0.1rem 0 0.4rem 0;
}

.sidebar li {
  border-top: 1px solid #d0d0d0;
}

.sidebar a {
  display: block;
  padding: 0.3rem 0.85rem 0.3rem 1.4rem;
  color: #00237a;
  text-decoration: underline;
  font-size: 0.85em;
  line-height: 1.4;
}

.sidebar .item-date {
  display: block;
  font-size: 0.75rem;
  color: #555555;
  margin-top: 0.1rem;
  font-weight: 400;
}

.sidebar a:hover {
  color: #000080;
}

.sidebar a:focus {
  color: #000080;
}

.sidebar a.active {
  background: #003366;
  color: #fff;
  border-left: 3px solid #c5a945;
  padding-left: calc(1.4rem - 3px);
  text-decoration: none;
}

.sidebar a.active .item-date {
  color: #fff;
}

.sidebar a:focus-visible {
  outline: 2px solid #003366;
  outline-offset: -2px;
}

.sidebar summary:focus {
  outline: none;
}

.sidebar summary:focus-visible {
  outline: 2px solid #003366;
  outline-offset: -2px;
  background: #e0e8f0;
}

/* ── Sidebar "Back to Top" sticky footer link ── */

.sidebar-top-link {
  display: block;
  position: sticky;
  bottom: 0;
  background: #e8eaf0;
  border-top: 2px solid #333;
  padding: 0.55rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #00237a;
  text-decoration: underline;
  text-align: center;
  cursor: pointer;
}

.sidebar-top-link:hover {
  background: #d0d4e8;
  color: #000080;
}

.sidebar-top-link:focus-visible {
  outline: 2px solid #003366;
  outline-offset: -2px;
}

/* Right main area */
.content {
  flex: 1;
  overflow: hidden;
  background: #fff;
}

#article-frame {
  width: 100%;
  height: 100%;
  border: none;
}

/* ── Responsive reflow — WCAG 1.4.10 ── */
/* At narrow viewports the sidebar stacks above the content area.     */
/* min-height: 50vh prevents the sidebar from collapsing completely.  */

@media (max-width: 600px) {
  .layout {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }
  .sidebar {
    width: 100%;
    max-height: 50vh;
  }
  .content {
    height: 70vh;
  }
}

/* ── Individual article pages ── */

.article-wrapper {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
  background: #fff;
}


.article-wrapper h1 {
  font-size: 1.55rem;
  font-weight: 700;
  margin: 0 0 0.3rem;
  color: #0a0a0a;
  line-height: 1.2;
}

.article-date {
  font-size: 0.88rem;
  color: #555;
  margin: 0 0 1.5rem;
}

.article-body p  { margin: 0 0 0.75rem; }
.article-body h2 { font-size: 1.2rem; margin: 1.25rem 0 0.5rem; }
.article-body h3 { font-size: 1.05rem; margin: 1rem 0 0.4rem; }

/* Preserve author-intended sizing from inline styles; only enforce max-width
   to prevent overflow and height:auto to avoid distortion on narrow viewports. */
.article-body img {
  max-width: 100%;
  height: auto;
}

.article-body a {
  color: #003a6e;
  text-decoration: underline;
}

.article-body a:hover { color: #001f3f; }

/* Data tables (have <th> header cells) */
.article-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.article-body th,
.article-body td {
  border: 1px solid #ccc;
  padding: 0.4rem 0.6rem;
  text-align: left;
  vertical-align: top;
}

.article-body th { background: #003a6e; color: #fff; font-weight: 700; }

/* Layout tables (no <th> — used for visual positioning in the CMS) */
.article-body table.layout-table {
  border: none;
}

.article-body table.layout-table td {
  border: none;
  padding: 0;
  text-align: inherit;    /* restore cascade from table's inline style */
  vertical-align: inherit;
}

/* ── CMS alignment patterns ── */
/* govAccess may use class-based or attribute-based alignment that has no   */
/* meaning without the CMS stylesheet — restore it here.                    */

.article-body [align="center"],
.article-body .text-center,
.article-body .text_center,
.article-body center {
  text-align: center;
}

.article-body [align="right"],
.article-body .text-right,
.article-body .text_right {
  text-align: right;
}


/* ── YouTube embed replacement ── */

.article-body .yt-embed {
  text-align: center;
  margin: 1rem 0;
}

.article-body .yt-embed img {
  max-width: 560px;
  width: 100%;
  display: block;
  margin: 0 auto;
  border: 2px solid #003a6e;
}

.article-body .yt-label {
  display: block;
  margin-top: 0.4rem;
  color: #003a6e;
  font-size: 0.88rem;
  text-decoration: underline;
}

.article-body .yt-embed a:hover .yt-label {
  color: #001f3f;
}
