/* The home page's cyan CTA needs dark text, including its decorative arrow. */
body.home #page-container .et_pb_section .et_pb_button_0_tb_body,
body.home #page-container .et_pb_section .et_pb_button_0_tb_body:hover,
body.home #page-container .et_pb_section .et_pb_button_0_tb_body:focus-visible {
  color:#262626!important;
}
body.home #page-container .et_pb_section .et_pb_button_0_tb_body::after {
  color:inherit!important;
}

/* The two prompt blocks have an inline light surface; keep them legible in night mode. */
body.postid-7786 #main-content .et_pb_post_content_0_tb_body pre {
  font-size:14px;
  line-height:1.6;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}
html[data-s2f-theme="dark"] body.postid-7786 #main-content .et_pb_post_content_0_tb_body pre {
  background:var(--s2f-card,#272726)!important;
  color:var(--s2f-text,#E8E8E6)!important;
}

/* Daily News has its own light surfaces; adapt those without changing its prompt. */
html[data-s2f-theme="dark"] body.postid-7724 #main-content .dn {
  --dn-txt:var(--s2f-text);
  --dn-mute:var(--s2f-secondary);
  --dn-line:var(--s2f-line);
  --dn-soft:var(--s2f-blue-surface);
  --dn-link:var(--s2f-accent);
}
html[data-s2f-theme="dark"] body.postid-7724 #main-content .dn :is(.dn-acc,.dn-tool,.dn-mail,.dn-blk,.dn-if-b,.dn-lane-v,.dn-c-prompt,.dn-c-auto) {
  background:var(--s2f-card)!important;
  border-color:var(--s2f-line);
  box-shadow:none;
}
html[data-s2f-theme="dark"] body.postid-7724 #main-content .dn :is(.dn-an-note,.dn-if-yes,.dn-lane-one) {
  background:var(--s2f-blue-surface)!important;
  border-color:var(--s2f-line);
  box-shadow:none;
}
html[data-s2f-theme="dark"] body.postid-7724 #main-content .dn :is(.dn-tool,.dn-num,.dn-label,.dn-m-rub,.dn-m-hl,.dn-m-row,.dn-lane-one),
html[data-s2f-theme="dark"] body.postid-7724 #main-content .dn :is(.dn-acc,.dn-ex)>summary,
html[data-s2f-theme="dark"] body.postid-7724 #main-content .dn :is(.dn-if-b,.dn-flow li,.dn-chain li) b,
html[data-s2f-theme="dark"] body.postid-7724 #main-content .dn .dn-lane-four i,
html[data-s2f-theme="dark"] body.postid-7724 #main-content .dn .dn-blk-more .dn-blk-k {
  color:var(--s2f-text);
}
html[data-s2f-theme="dark"] body.postid-7724 #main-content .dn :is(.dn-m-src,.dn-m-foot) { color:var(--s2f-secondary); }
html[data-s2f-theme="dark"] body.postid-7724 #main-content .dn .dn-m-row { border-color:var(--s2f-line); }
html[data-s2f-theme="dark"] body.postid-7724 #main-content .dn .dn-if-yes { border-color:var(--s2f-accent); }
html[data-s2f-theme="dark"] body.postid-7724 #main-content .dn .dn-chev { border-color:var(--s2f-accent); }

/* Mobile reading layout; the desktop article templates retain their existing rules. */
@media (max-width:767px) {
  body.postid-7724 #main-content .dn .dn-tool { min-height:44px; }

  body.single-post #main-content .et-l--body .et_pb_row_0_tb_body.et_pb_row {
    box-sizing:border-box;
    width:95%!important;
    max-width:none!important;
    padding:12px 8px!important;
  }

  body.single-post #main-content .et_pb_post_title_0_tb_body .et_pb_title_container h1.entry-title {
    font-size:26px!important;
    line-height:1.2!important;
    font-weight:700!important;
    text-transform:none!important;
    font-variant-caps:normal;
    letter-spacing:normal;
    overflow-wrap:anywhere;
  }

  body.single-post #main-content .et_pb_post_content_0_tb_body {
    font-size:16px;
    line-height:1.65;
  }
  body.single-post #main-content .et_pb_post_content_0_tb_body > :is(h2,h3,h4,h5,h6),
  body.single-post #main-content .et_pb_post_content_0_tb_body .wp-block-heading {
    line-height:1.3;
    text-transform:none;
    font-variant-caps:normal;
    overflow-wrap:anywhere;
  }
  body.single-post #main-content .et_pb_post_content_0_tb_body > h2,
  body.single-post #main-content .et_pb_post_content_0_tb_body h2.wp-block-heading { font-size:22px; }
  body.single-post #main-content .et_pb_post_content_0_tb_body > h3,
  body.single-post #main-content .et_pb_post_content_0_tb_body h3.wp-block-heading { font-size:20px; }
  body.single-post #main-content .et_pb_post_content_0_tb_body > h4,
  body.single-post #main-content .et_pb_post_content_0_tb_body h4.wp-block-heading { font-size:18px; }
  body.single-post #main-content .et_pb_post_content_0_tb_body > :is(h5,h6),
  body.single-post #main-content .et_pb_post_content_0_tb_body :is(h5,h6).wp-block-heading { font-size:16px; }

  /* Keep the article's full H1 and the breadcrumb's links to its parents. */
  body.single-post #page-container .et-l--header .et_pb_text_0_tb_header,
  body.single-post #page-container .et-l--header .lwp-breadcrumbs [typeof="BreadcrumbList"] > .current,
  body.single-post #page-container .et-l--header .lwp-breadcrumbs [typeof="BreadcrumbList"] > .separator:has(+ .current) {
    display:none!important;
  }

  /* Long source URLs must wrap rather than widen the article or be clipped. */
  body.single-post #main-content .et_pb_post_content_0_tb_body a {
    overflow-wrap:anywhere;
    word-break:normal;
  }
  body.single-post #main-content .et_pb_post_content_0_tb_body .wp-block-group.is-layout-flex,
  body.single-post #main-content .et_pb_post_content_0_tb_body .wp-block-group.is-layout-flex > * {
    min-width:0;
    max-width:100%;
  }

  /* In this article, text and image columns must not squeeze their captions. */
  body.postid-1952 #main-content .et_pb_post_content_0_tb_body .wp-block-group.is-nowrap.is-layout-flex:has(> figure.wp-block-image.is-resized) {
    flex-direction:column;
    align-items:stretch;
  }
  body.postid-1952 #main-content .et_pb_post_content_0_tb_body .wp-block-group.is-nowrap.is-layout-flex:has(> figure.wp-block-image.is-resized) > * {
    width:100%;
  }
  body.postid-1952 #main-content .et_pb_post_content_0_tb_body .wp-block-group.is-nowrap.is-layout-flex > figure.wp-block-image.is-resized {
    width:auto;
    margin-left:0;
    margin-right:0;
  }

  /* These navigation controls apply to all mobile pages, including the home page. */
  #page-container .et-l--header .et_pb_menu {
    padding-left:16px!important;
    padding-right:16px!important;
  }
  #page-container .et-l--header .et_pb_menu :is(.et_pb_menu__search-button,.et_pb_menu__close-search-button,.mobile_menu_bar) {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 44px;
    box-sizing:border-box;
    width:44px;
    height:44px;
    min-width:44px;
    padding:0;
    line-height:1;
    color:var(--s2f-accent,#29C5F6)!important;
    cursor:pointer;
  }
  #page-container .et-l--header .et_pb_menu :is(.et_pb_menu__search-button,.et_pb_menu__close-search-button,.mobile_menu_bar)::before {
    position:static;
    color:var(--s2f-accent,#29C5F6)!important;
  }
  #page-container .et-l--header .mobile_menu_bar:focus-visible {
    outline:3px solid var(--s2f-focus,#007FAF);
    outline-offset:2px;
  }
}
