/* Shared editorial reader for News and service insight pages. */
body.news-reader-open {
  overflow: hidden;
}

#newsModal.modal-overlay {
  position: fixed;
  z-index: 10020;
  inset: 0;
  display: none;
  padding: 24px;
  align-items: center;
  justify-content: center;
  background: rgba(10, 24, 42, .66);
  backdrop-filter: blur(8px);
}

#newsModal.modal-overlay[aria-hidden="false"] {
  animation: news-reader-backdrop .2s ease both;
}

#newsModal.modal-overlay .modal-content.news-reader {
  position: relative;
  display: flex;
  width: min(100%, 960px) !important;
  max-width: 960px !important;
  max-height: calc(100dvh - 48px) !important;
  padding: 0 !important;
  overflow: hidden !important;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, .42) !important;
  border-radius: 20px !important;
  background: #fff !important;
  box-shadow: 0 32px 90px rgba(7, 21, 38, .32) !important;
}

#newsModal[aria-hidden="false"] .news-reader {
  animation: news-reader-enter .24s cubic-bezier(.2, .75, .2, 1) both;
}

.news-reader-toolbar {
  z-index: 3;
  display: flex;
  min-height: 60px;
  padding: 8px 14px 8px 22px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e7eeec;
  background: rgba(255, 255, 255, .96);
}

.news-reader-label {
  color: #647487;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .16em;
  line-height: 1;
  text-transform: uppercase;
}

#newsModal .news-reader-close {
  position: static !important;
  display: inline-grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 1px solid #dce7e4;
  border-radius: 50%;
  color: #304256;
  background: #fff;
  font-family: Arial, sans-serif;
  font-size: 27px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background-color .18s ease, transform .18s ease;
}

#newsModal .news-reader-close:hover,
#newsModal .news-reader-close:focus-visible {
  color: #0a665d;
  border: 2px solid #108477;
  background: #f0f7f5;
  outline: none !important;
  transform: rotate(4deg);
}

.news-reader-scroll {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #9db2ae transparent;
  scrollbar-gutter: stable;
}

.news-reader-media {
  display: none;
  width: 100%;
  max-height: min(34dvh, 320px);
  margin: 0;
  overflow: hidden;
  aspect-ratio: 16 / 6;
  background: #eef4f2;
}

.news-reader-media.has-image {
  display: block;
}

#newsModal .news-reader-media #modalImg {
  display: block;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  object-fit: cover !important;
  border-radius: 0 !important;
}

.news-reader-heading {
  width: min(100%, 800px);
  margin: 0 auto;
  padding: 38px 32px 24px;
}

#newsModal .news-reader-category {
  display: inline-flex;
  padding: 0 !important;
  align-items: center;
  gap: 9px;
  color: #108477 !important;
  background: transparent !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  letter-spacing: .11em;
  line-height: 1.3;
  text-transform: uppercase;
}

#newsModal .news-reader-category::before {
  width: 22px;
  height: 2px;
  content: "";
  border-radius: 2px;
  background: currentColor;
}

#newsModal .news-reader-title {
  margin: 14px 0 0 !important;
  color: #10233f !important;
  font-size: clamp(30px, 4vw, 46px) !important;
  font-weight: 760 !important;
  letter-spacing: -.035em;
  line-height: 1.12 !important;
  text-wrap: balance;
}

#newsModal .news-reader-body {
  width: min(100%, 800px);
  margin: 0 auto;
  padding: 0 32px 58px;
  color: #3f5062 !important;
  font-size: 17px !important;
  line-height: 1.78 !important;
}

.news-reader-body > :first-child {
  margin-top: 0 !important;
}

.news-reader-body > :last-child {
  margin-bottom: 0 !important;
}

.news-reader-body p {
  margin: 0 0 1.3em;
  text-align: left !important;
}

.news-reader-body h2,
.news-reader-body h3,
.news-reader-body h4 {
  color: #10233f !important;
  font-weight: 740 !important;
  letter-spacing: -.018em;
  line-height: 1.3;
}

.news-reader-body h2,
.news-reader-body h3 {
  margin: 2em 0 .72em !important;
  font-size: clamp(21px, 2.5vw, 26px) !important;
}

.news-reader-body h4 {
  margin: 1.5em 0 .6em !important;
  font-size: 18px !important;
}

.news-reader-section {
  position: relative;
  margin: 34px 0 0;
  padding: 28px 0 0;
  border-top: 1px solid #dfe8e6;
}

.news-reader-section h3 {
  display: grid;
  margin: 0 0 18px !important;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  font-size: clamp(20px, 2.1vw, 24px) !important;
  line-height: 1.34 !important;
}

.news-reader-section-number {
  display: inline-grid;
  width: 36px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  color: #0a665d;
  background: #eaf4f1;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
}

.news-reader-body ul,
.news-reader-body ol {
  margin: 0 0 1.5em;
  padding-left: 1.3em;
}

.news-reader-body li {
  margin: .48em 0;
  padding-left: .25em;
}

.news-reader-body li::marker {
  color: #108477;
}

.news-reader-body blockquote {
  margin: 1.8em 0;
  padding: 18px 20px;
  border-left: 3px solid #108477;
  border-radius: 0 10px 10px 0;
  color: #30485d;
  background: #f2f7f6;
}

.news-reader-body .article-lead {
  color: #30485d;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.65;
}

.news-reader-body .article-callout {
  margin: 1.8em 0;
  padding: 18px 20px;
  border-left: 3px solid #108477;
  border-radius: 0 10px 10px 0;
  color: #30485d;
  background: #edf6f3;
}

.news-reader-body .article-callout > :last-child {
  margin-bottom: 0;
}

.news-reader-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.news-reader-body table {
  display: block;
  width: 100% !important;
  max-width: 100%;
  margin: 24px 0 !important;
  overflow-x: auto;
  border-collapse: collapse;
  white-space: nowrap;
}

.news-reader-body th,
.news-reader-body td {
  padding: 11px 13px !important;
  border: 1px solid #dfe8e6 !important;
  text-align: left;
}

.news-reader-body th {
  color: #10233f;
  background: #edf5f3;
  font-weight: 720;
}

.news-reader-body tbody tr:nth-child(even) {
  background: #f8faf9;
}

.news-reader-body blockquote footer {
  margin-top: 10px;
  color: #667688;
  font-size: 14px;
  font-weight: 650;
}

.news-reader-body a {
  color: #0a756a;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.news-reader-admin-actions {
  width: min(calc(100% - 64px), 736px);
  margin: 0 auto 32px;
  padding-top: 20px;
  border-top: 1px solid #e7eeec;
}

@keyframes news-reader-backdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes news-reader-enter {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 640px) {
  #newsModal.modal-overlay {
    padding: 0 !important;
    align-items: stretch;
  }

  #newsModal.modal-overlay .modal-content.news-reader {
    width: 100% !important;
    height: 100dvh;
    max-height: 100dvh !important;
    border: 0 !important;
    border-radius: 0 !important;
  }

  .news-reader-toolbar {
    min-height: 56px;
    padding: 6px 8px 6px 18px;
  }

  .news-reader-media {
    max-height: 240px;
    aspect-ratio: 16 / 9;
  }

  .news-reader-heading {
    padding: 26px 20px 20px;
  }

  #newsModal .news-reader-title {
    margin-top: 11px !important;
    font-size: clamp(27px, 8.4vw, 34px) !important;
    line-height: 1.16 !important;
  }

  #newsModal .news-reader-body {
    padding: 0 20px 42px;
    font-size: 16px !important;
    line-height: 1.72 !important;
  }

  .news-reader-section {
    margin-top: 28px;
    padding-top: 24px;
  }

  .news-reader-section h3 {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
  }

  .news-reader-section-number {
    width: 32px;
    height: 26px;
  }

  .news-reader-admin-actions {
    width: calc(100% - 40px);
    margin-bottom: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #newsModal.modal-overlay[aria-hidden="false"],
  #newsModal[aria-hidden="false"] .news-reader {
    animation: none;
  }
}
