/* The serif headline has its own bold outlines, including the italic case name. */
@font-face {
  font-family: "Noto Serif Display";
  src: url("fonts/wingo-display-bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif Display";
  src: url("fonts/wingo-display-bold-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 700;
  font-display: swap;
}

/* Set ink for each surface so a source note can move from paper to a film panel. */
:root,
.wv-transcript-disclosure,
.wvo-transcript-text,
.wvo-transcript-page,
.events-chapters details,
.events-chapters .event-sources,
.wvw-transcript li[aria-current="true"] {
  --reading-title: #0b1719;
  --reading-text: #182629;
  --reading-note: #29393b;
  --reading-link: #063d40;
  --reading-accent: #1b4341;
}
:is(.case-banner, .case-reading-links, .co-geography, .proceeding-film,
    .events-handoff, .wvo-hero, .wvo-endcap, .wvev-downloads, .wvt-opening,
    .wv-audio-evidence, .wv-live-caption, .wv-motion-control, .wvmc-record-finding, .wvw-screen,
    .archive-header, .archive-footer, .wingo-native-header, .wingo-native-footer,
    .wingo-native-home-sections, .testimony-portrait),
:is(.court-document, .events-hero-art, .wv-section-cover, .wvh-scene) figcaption,
.wvh-motion-toggle > summary {
  --reading-title: #fffaf0;
  --reading-text: #f7f6ef;
  --reading-note: #e6ece8;
  --reading-link: #ffe0a1;
  --reading-accent: #f1ca85;
}

/* Imported WordPress layouts set important font shorthands and colors inside the page.
   This layer overrides the reading properties while leaving each layout in control. */
@layer wingo-reading {
  :where(main.wv-main, main.wp-block-group, .events-main, .wp-block-post-content) {
    color: var(--reading-text) !important;
  }
  :where(main.wv-main, main.wp-block-group, .events-main, .wp-block-post-content)
    :is(p, li, dd, td, blockquote, pre, .wm-detail, .wv-rd-topic,
        .w-home-route-text > span:last-child, .home-evidence li span, .wg-topic-grid small) {
    color: var(--reading-text) !important;
  }
  :where(main.wv-main, main.wp-block-group, .events-main, .wp-block-post-content)
    :is(h1, h2, h3, h4, h5, h6, dt, th, strong, b, summary, .wv-rd-name, .wm-title) {
    color: var(--reading-title) !important;
    font-weight: 700 !important;
  }
  :where(main.wv-main, main.wp-block-group, .events-main, .wp-block-post-content)
    :is(h1, h2, h3, h4, h5, h6) {
    overflow-wrap: break-word;
    text-wrap: pretty;
  }
  :where(main.wv-main, main.wp-block-group, .events-main, .wp-block-post-content)
    :is(h1, h2, h3, h4, h5, h6) :is(em, i) {
    color: var(--reading-accent) !important;
    font-weight: 700 !important;
  }
  :where(main.wv-main, main.wp-block-group, .events-main, .wp-block-post-content)
    :is(figcaption, cite, small, .jour-source, .wv-source, .wv-source-note, .wv-access-note,
        .wv-audio-sources, .wv-audio-note, .wm-credit, .wvh-small, .wg-press-note,
        .wh-film-support, .wvw-caption-note, .court-cases li span) {
    color: var(--reading-note) !important;
    font-weight: 500 !important;
  }
  :where(main.wv-main, main.wp-block-group, .events-main, .wp-block-post-content)
    :is(.jour-source, .wv-source, .wv-source-note, .wv-access-note, .wv-audio-note,
        .wm-credit, .wh-film-support, .wv-source-label, .court-cases li span) {
    font-size: .90rem !important;
    line-height: 1.55 !important;
  }
  :where(main.wv-main, main.wp-block-group, .events-main, .wp-block-post-content)
    :is(.jour-kicker, .jour-date, .wh-pub, .wh-watch, .w-home-date, .event-kicker,
        .case-label, .wv-eyebrow, .wv-date, .wv-film-runtime, .wv-rd-date,
        .wv-source-label, .co-geography span) {
    color: var(--reading-accent) !important;
    font-weight: 700 !important;
    font-size: .875rem !important;
    line-height: 1.45 !important;
  }
  :where(main.wv-main, main.wp-block-group, .events-main, .wp-block-post-content)
    a:not(.wp-element-button, .wp-block-button__link, .case-primary, .jour-button,
          .case-court-feature > a, .archive-header a, .wingo-native-home-sections a) {
    color: var(--reading-link) !important;
    text-underline-offset: .17em;
  }
  :where(main.wv-main, main.wp-block-group, .events-main, .wp-block-post-content)
    :is(p, .case-sources, .event-sources, figcaption, .events-nav, .archive-guide-index) a {
    font-weight: 650 !important;
  }
  :where(main.wv-main, main.wp-block-group, .events-main, .wp-block-post-content)
    :is(p, .case-sources, .event-sources, figcaption) a:not(.wp-element-button) {
    text-decoration-line: underline;
    text-decoration-thickness: max(1px, .07em);
  }
  :where(main.wv-main, main.wp-block-group, .events-main, .wp-block-post-content)
    :is(h1, h2, h3, h4, h5, h6, summary) a,
  :where(main.wv-main, main.wp-block-group, .events-main, .wp-block-post-content)
    a:not(.wp-element-button, .wp-block-button__link) > strong {
    font-weight: 700 !important;
  }
  :where(main.wv-main, main.wp-block-group, .events-main, .wp-block-post-content)
    :is(.proceeding-film h2, .events-handoff h2, .testimony-portrait figcaption,
        .court-document figcaption, .events-hero-art figcaption, .wv-section-cover figcaption) {
    color: var(--reading-title) !important;
  }
  /* Keep native hearing-record buttons legible in both the dark opening and the paper annex. */
  :is(.wvo-hearing, .wvo-hero, .wvo-endcap, .wvev-downloads) .wp-block-button__link {
    background-color: #f1d098 !important;
    border-color: #f1d098 !important;
    color: #102629 !important;
    font-weight: 700 !important;
  }
  :is(.wvo-hearing, .wvo-hero, .wvo-endcap, .wvev-downloads) .wp-block-button__link:is(:hover, :focus-visible) {
    background-color: #ffe4b4 !important;
    text-decoration: underline;
  }
  .case-banner h1, .case-banner h1 em,
  .archive-dock .archive-brand, .wingo-native-header .wingo-native-brand,
  .archive-brand i, .wingo-native-brand i,
  footer.archive-footer .archive-footer-quote, footer.archive-footer .archive-footer-quote em,
  footer.wingo-native-footer .wingo-native-foot-inner > p, footer.wingo-native-footer .wingo-native-foot-inner > p em {
    font-weight: 700 !important;
  }
  :is(.archive-footer, .wingo-native-footer) :is(nav a, a[href^="mailto:"]),
  .archive-header .archive-nav :is(a, summary),
  .wingo-native-header .wp-block-navigation-item__label, .wingo-native-home-sections .wp-block-navigation-item__label {
    font-weight: 650 !important;
  }
}

/* At phone widths keep both controls in view, with room for the case name to wrap. */
@media (max-width: 24rem) {
  .archive-dock .archive-mast, .wingo-native-header .wingo-native-mast {
    gap: .45rem;
  }
  .archive-dock .archive-brand, .wingo-native-header .wingo-native-brand {
    min-width: 0;
    font-size: 1.125rem;
    white-space: normal;
    text-wrap: balance;
  }
  .archive-dock .archive-nav, .wingo-native-mast > .wp-block-navigation {
    flex-shrink: 0;
  }
  .archive-dock .archive-home-pin, .archive-dock .archive-nav[data-ready] .archive-menu-toggle {
    padding-inline: .62rem;
  }
}

/* Keep text and its surface together. The archive's reading layer uses these
   tokens for headings, paragraphs, inline emphasis, links and source credits. */
@media screen and (forced-colors: none) {
  body :is(.wc-head, .wc-film > figcaption, .wc-button, #wingo-hearing-film, .xp-wilson-cover > b) {
    --reading-title: #fffaf0;
    --reading-text: #f4f5ee;
    --reading-note: #e5ece5;
    --reading-link: #ffe0a1;
    --reading-accent: #f4d18c;
  }

  @layer wingo-reading {
    #main-content .wc-head .wc-kicker { color: var(--reading-accent) !important; }
    #main-content .wc-button, #main-content .xp-wilson-cover > b { color: #fff8e5 !important; }
    #main-content :is(.wc-button, #wingo-hearing-film, .xp-wilson-cover):is(:hover, :focus-visible) {
      text-decoration: underline !important;
      text-underline-offset: .16em;
    }
    #main-content .events-chapters > .events-handoff {
      background: #12373a !important;
    }
    /* Fallback ink surfaces also hold when decorative gradients are unavailable. */
    #main-content .case-opening.case-banner { background-color: #0b242b !important; }
    #main-content .xp-audio.xp-dark { background-color: #103534 !important; }

    #main-content :is(.wv-audio-clock, .wvw-original, .wvw-original a,
        .xp-wordplay, .wj-series-name) {
      font-size: .875rem !important;
      line-height: 1.45 !important;
    }
    #main-content .wv-audio-clock { flex-wrap: wrap; gap: .25rem 1rem; }

    /* Preserve the courtroom artwork while keeping the judge's title readable
       against even the brightest part of its responsive crop. */
    #main-content .wj-banner .wj-plate {
      animation: none !important;
      opacity: 1;
    }
    #main-content .xp-scene-foot > span {
      background-color: #0b282b;
      color: #fff8e5 !important;
      padding: .22em .45em;
      border-radius: .15rem;
    }
    #main-content .wj-banner::after {
      background: linear-gradient(90deg, #061e20ed, #061e20df 55%, #061e2055 74%, transparent);
    }

    /* Put a constant dark surface under type laid over photographs. */
    #main-content .xp-hero .xp-hero-copy {
      background-color: rgba(5, 28, 31, .92);
      padding: clamp(.75rem, 1.8vw, 1.4rem);
      border-radius: .2rem;
      box-sizing: border-box;
    }
    .wci-panel .wci-banner .wci-heading {
      background-color: #102d31;
      color: #fff5dc !important;
      padding: .12em .32em;
      border-radius: .15rem;
    }
    .wci-panel .wci-banner .wci-search a {
      background-color: #153c3f !important;
      color: #fff5df !important;
    }
  }
}

@media screen {
  :is(main, .wci-panel, .nm-panel, .archive-search-box)
    :where(h1,h2,h3,h4,p,figcaption,summary,dt,dd,th,td,a) {
    overflow-wrap: anywhere;
  }
  :is(.wc-film figcaption,.wc-head,.wc-turn,.wc-actions) > * { min-inline-size: 0; }
  :is(.wc-edition,.exp-chapter) :is(a,summary,button):focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 3px;
  }
  ::cue { color: white; background-color: #101820; }
}

@media (forced-colors: active) {
  @layer wingo-reading {
    :is(.archive-brand,.wingo-native-brand,.justice-lockup,.archive-footer-quote,.wingo-native-foot-inner > p),
    :is(.archive-brand,.wingo-native-brand,.justice-lockup,.archive-footer-quote,.wingo-native-foot-inner > p) * {
      -webkit-text-fill-color: CanvasText !important;
      color: CanvasText !important;
      background-image: none !important;
      text-shadow: none !important;
    }
  }
}

@media print {
  @layer wingo-reading {
    :is(.wc-head,.wc-film figcaption,.events-handoff,.case-opening-copy,.xp-audio,.xp-hero-copy,.xp-wilson-cover > b,#wingo-hearing-film,.wc-button),
    :is(.wc-head,.wc-film figcaption,.events-handoff,.case-opening-copy,.xp-audio,.xp-hero-copy,.xp-wilson-cover > b,#wingo-hearing-film,.wc-button) * {
      color: #111 !important;
      -webkit-text-fill-color: #111 !important;
      text-shadow: none !important;
      background: white !important;
    }
  }
}
