/* ==========================================================
   Easy Read blog pages (easyread-blogs.php, easyread-blog-detail.php)
   Font sizes come from easyread-common.css
   (.easyread-p, .easyread-sec-title, .easyread-sec-sub-title)
   so they follow the same xs / md (768px) / xxl (1400px) scale
   as the Easy Read job pages.
   ========================================================== */

:root {
  --dn-blue: #0057a8;
  --dn-blue-dark: #003d7a;
  --dn-black: #111111;
  --dn-white: #ffffff;
  --dn-off: #f5f7fa;
  --dn-border: #d0dce8;
  --dn-text: #1a1a1a;
  --dn-muted: #4a5568;
  --dn-focus: #ffbf47;
}

.er-blog-page {
  padding: 0 20px 20px;
}

/* Hero label above the article title */
.er-kicker {
  color: #cccccc;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* Easy Read <-> standard version links */
.er-version-bar {
  display: flex;
  justify-content: flex-end;
  padding: 16px 0 0;
}
.er-version-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--dn-blue);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.er-version-link:hover {
  color: var(--dn-blue-dark);
}
.er-version-icon {
  width: 1.2em;
  height: 1.2em;
  flex-shrink: 0;
}
.er-back-icon {
  transform: rotate(180deg);
}

/* ---------- Listing ---------- */
.er-list-heading {
  font-weight: 700;
  color: var(--dn-text);
  margin: 10px 0 0;
}

.er-article-grid {
  display: grid;
  grid-template-columns: 1fr; /* mobile: 1 column */
  gap: 20px;
  margin: 20px 0 10px;
}

.er-article-card {
  display: flex;
  flex-direction: column;
  border: 2px solid var(--dn-border);
  border-left: 5px solid var(--dn-blue);
  border-radius: 6px;
  overflow: hidden;
  background: var(--dn-white);
}
.er-article-image {
  display: block;
}
.er-article-image img {
  display: block;
  width: 100%;
  height: auto; /* full image, same as blogs.php (cover images often contain text) */
}
.er-article-content {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 20px;
}
.er-article-icon {
  flex-shrink: 0;
  color: var(--dn-blue);
}
.er-article-icon .er-icon {
  display: block;
}
.er-article-body {
  min-width: 0;
}
.er-article-title {
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 10px;
}
.er-article-title a {
  font-size: inherit;
  color: var(--dn-blue);
  text-decoration: none;
}
.er-article-title a:hover {
  text-decoration: underline;
}
.er-article-summary {
  color: var(--dn-text);
  line-height: 1.5;
  margin: 0 0 12px;
}
.er-read-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--dn-blue);
  font-weight: 700;
  text-decoration: underline dotted;
  text-underline-offset: 5px;
}
.er-read-link:hover {
  text-decoration-style: solid;
}
.er-read-link-icon {
  width: 0.8em;
  height: 0.8em;
  flex-shrink: 0;
}
.er-article-note {
  color: var(--dn-muted);
  font-size: 1rem !important;
  margin: 8px 0 0;
}

/* ---------- Article ---------- */
.er-intro .er-intro-text {
  color: var(--dn-text);
  line-height: 1.5;
  margin-bottom: 14px;
}
.er-blog-detail .ds-head {
  color: var(--dn-blue);
}
.er-blog-detail .ds-head h2 {
  font-weight: 700;
  color: var(--dn-blue);
  line-height: 1.2;
  margin: 0;
}
/* Bullets: centre the dot on the first line of text at every font size
   (easyread-jd.css uses a fixed 8px top margin, which drifts as the text grows) */
.er-blog-detail .ds-body ul li {
  --er-dot: 12px;
  line-height: 1.5;
  align-items: flex-start;
}
.er-blog-detail .ds-body ul li::before {
  width: var(--er-dot);
  height: var(--er-dot);
  min-width: var(--er-dot);
  margin-top: calc(0.75em - (var(--er-dot) / 2)); /* half the 1.5 line-height minus half the dot */
}
@media (min-width: 1400px) {
  .er-blog-detail .ds-body ul li {
    --er-dot: 15px;
  }
}

.er-source {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 20px;
  border-bottom: 1px solid var(--dn-border);
}
.er-source-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  color: var(--dn-blue);
}
.er-source a {
  font-weight: 700;
  color: var(--dn-blue);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.er-source-note {
  color: var(--dn-muted);
  font-size: 1rem !important;
  margin: 4px 0 0;
}

.er-back-row {
  padding: 20px 0;
}

/* Clear keyboard focus */
.er-blog-page a:focus-visible,
.er-blog-page button:focus-visible {
  outline: 3px solid var(--dn-focus);
  outline-offset: 3px;
}

/* Desktop: 2 article columns */
@media (min-width: 992px) {
  .er-article-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1400px) {
  .er-article-content {
    padding: 25px;
    gap: 30px;
  }
  .er-source-icon {
    width: 50px;
    height: 50px;
  }
  .er-article-note,
  .er-source-note {
    font-size: 1.3rem !important;
  }
}

/* ---------- Dark mode ---------- */
/* dark-mode.css gives .job-sec-icon a white box (for the PNG icons);
   these SVG icons use currentColor, so keep them on the dark background */
html[data-theme="dark"] .er-blog-page .er-icon,
html[data-theme="dark"] .er-blog-page .job-sec-icon {
  background: transparent;
  padding: 0;
  border-radius: 0;
}
html[data-theme="dark"] .er-article-card {
  background: #1e1e1e;
  border-color: #3a3a3a;
  border-left-color: #FFFF00;
}
html[data-theme="dark"] .er-list-heading,
html[data-theme="dark"] .er-article-summary,
html[data-theme="dark"] .er-intro .er-intro-text,
html[data-theme="dark"] .er-blog-detail .ds-body li {
  color: #FFFFFF;
}
html[data-theme="dark"] .er-article-title a,
html[data-theme="dark"] .er-read-link,
html[data-theme="dark"] .er-version-link,
html[data-theme="dark"] .er-source a,
html[data-theme="dark"] .er-article-icon,
html[data-theme="dark"] .er-source-icon,
html[data-theme="dark"] .er-blog-detail .ds-head,
html[data-theme="dark"] .er-blog-detail .ds-head h2 {
  color: #FFFF00;
}
html[data-theme="dark"] .er-blog-detail .ds-head {
  background: #222222;
}
html[data-theme="dark"] .er-article-note,
html[data-theme="dark"] .er-source-note {
  color: #FFFFFF;
}
