/* OneEach fixes on top of the camelback_d10 theme (Catawba County UW). Loaded after the theme's own CSS.
   Each rule names the backlog row. */

/* R9: event side-card headings asked for images/prev_red.png + next_red.png, which never existed (404 on every
   event page). The decoration never showed on prod-d11; the empty pseudo-elements are dropped so nothing is
   requested and the look stays the same. The background is cleared too: Chrome still requested the image of a
   content:none pseudo-element (stg 5b1178d, 11-24). */
.node--type-events .side-col .card.mb-3 h2::before,
.node--type-events .side-col .card.mb-3 h2::after {
  content: none;
  background: none;
}

/* R8: phone widths. The news pager (9 x 75px) made /news 675px wide on a 375px phone. */
.pagination,
.js-pager__items {
  flex-wrap: wrap;
}
@media (max-width: 767.98px) {
  .pagination .page-item {
    width: auto;
    min-width: 2.75rem;
  }
  /* Bootstrap rows directly inside full-width regions: their -12px margins pushed 12px past the screen edge. */
  .region-banner.row,
  .view-content.row {
    margin-left: 0;
    margin-right: 0;
  }
}

@media (max-width: 767.98px) {
  /* R8: home "Latest News" row (hidden on phones by design, but its row still overflowed 23px). */
  .region-news.row {
    margin-left: 0;
    margin-right: 0;
  }
  /* R8: event pages: the side card was 386px wide inside a 351px column. */
  .node--type-events .side-col .card.mb-3,
  .node--type-events .card.mb-3 {
    max-width: 100%;
  }
  /* R8: forms (volunteer registration): options shown in 2/3 columns were wider than the phone. */
  .webform-options-display-two-columns,
  .webform-options-display-three-columns {
    column-count: 1;
  }
  /* R8: images and embeds typed into page bodies with fixed widths (Christmas Bureau, HHAW, About us). */
  .field--name-body img,
  .paragraph img,
  .text-formatted img {
    max-width: 100%;
    height: auto;
  }
  .field--name-body iframe,
  .paragraph iframe,
  .text-formatted iframe {
    max-width: 100%;
  }
  /* R8: the closed mobile menu panel sits just off the right edge; clip it so the page never scrolls sideways. */
  .dialog-off-canvas-main-canvas {
    overflow-x: clip;
  }
}

@media (max-width: 767.98px) {
  /* R8: the theme gives the (phone-hidden) news row margin-right:-35px with a stronger selector. */
  .region-news.row {
    margin-right: 0 !important;
  }
  /* R8: long option labels without spaces ("Food Collection/Distribution/Preparation/Serving"). */
  .form-check-label {
    overflow-wrap: anywhere;
  }
}

/* R8 (QA 11-24, also on prod-d11): at tablet widths the news-item image carousel puts its prev/next buttons 32px
   outside the page (the page scrolled sideways at 768 and 1024). The page wrapper clips sideways overflow at every
   width; the buttons stay visible inside the carousel. */
.dialog-off-canvas-main-canvas {
  overflow-x: clip;
}
/* R8: long option labels without spaces overlapped the next column at 768 too. */
.form-check-label {
  overflow-wrap: anywhere;
}

/* R8: staff e-mail addresses are one long word: they spilled out of the card at 768. */
.email,
.field--name-field-email {
  overflow-wrap: anywhere;
}

/* R8 (QA 11-24, also on prod-d11): on news cards with a long title the yellow title box grows upward over the red
   date badge (seen at 768, three narrow cards per row). At tablet widths the card titles are a little smaller so
   they fit under the badge; the badge also stays on top. */
.views-row .n-date {
  z-index: 2;
}
@media (min-width: 768px) and (max-width: 1199.98px) {
  .page-view-news .view-news .views-row .n-title a,
  .latest-news-block .views-row .n-title a {
    font-size: 19px;
    line-height: 24px;
  }
}

/* ---- Hub contact-sheet review 11-24 (all items below are also on prod-d11: same theme CSS and settings) ---- */

/* R14 page hero, title box grows downward. The title box was anchored to the bottom of a fixed-height hero and grew
   upward, so long titles (news) slid under the header and the Donate/Volunteer bar at 375. Now the hero keeps its old
   height as a minimum, the title sits at its bottom as before, and a longer title makes the hero taller. */
.bImage {
  overflow: hidden; /* the banner image zooms in slightly on load (scaleUp) */
}
.bImage .t-outer {
  position: relative;
  height: auto;
}
.bImage .t-outer .container {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: auto;
  min-height: 450px;
}
.withImage .bImage .t-outer .container {
  min-height: 550px;
}
.bImage .t-outer .t-outer-content {
  position: relative;
  bottom: auto;
  top: auto;
  padding: 170px 20px 50px 0; /* clears the header, which sits on top of the hero from 768px up */
}
.withImage .bImage #inner-banner-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
@media (min-width: 768px) and (max-width: 1199.98px) {
  /* Tablet widths: the main menu sits lower in the header, so the title starts a little lower too. */
  .bImage .t-outer .t-outer-content {
    padding-top: 200px;
  }
}
@media (max-width: 767.98px) {
  /* The header is above the hero on phones, not on top of it. */
  .bImage .t-outer .t-outer-content {
    max-width: 100%;
    padding: 40px 15px 40px 0;
  }
}

/* R14 photo heroes, readable title and menu. White title and white menu sat on the bare photo. As on live, the title
   gets a dark box; from 768px up (where the header lies on the photo) a dark band sits behind the menu. */
.withImage .bImage #pTitle h1 .field--name-title,
.withImage .bImage .pTitle h1 .field--name-title {
  background: rgba(0, 0, 0, 0.78);
  padding: 0 0.2em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
@media (min-width: 768px) {
  .withImage .bImage .t-outer.t-outer {
    background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.65) 0, rgba(0, 0, 0, 0.4) 110px, rgba(0, 0, 0, 0) 200px);
  }
}

/* R14 text-graphic banners (Why Give, What you do matters, Live Informed, Season of Giving flyer, Impact collage): the
   picture is lettering, so it is shown whole (not cropped) under the header, on the theme's dark blue. Node ids:
   201 /donate, 206 /online-pledge-portals, 554 /helping-local-families-teens, 582 /your-catawba-county-united-ways-impact-0,
   629 /live-informed-live-united. A new lettering banner needs its node id added here. */
.page-node-201 .bImage, .page-node-206 .bImage, .page-node-554 .bImage, .page-node-582 .bImage, .page-node-629 .bImage {
  background-color: #21296B;
}
.page-node-201 .bImage #inner-banner-image,
.page-node-206 .bImage #inner-banner-image,
.page-node-554 .bImage #inner-banner-image,
.page-node-582 .bImage #inner-banner-image,
.page-node-629 .bImage #inner-banner-image {
  background-size: contain !important;
  background-color: #21296B !important;
  background-origin: content-box !important;
  padding-top: 140px; /* below the header */
}
.page-node-201 .bImage .t-outer.t-outer, .page-node-206 .bImage .t-outer.t-outer, .page-node-554 .bImage .t-outer.t-outer,
.page-node-582 .bImage .t-outer.t-outer, .page-node-629 .bImage .t-outer.t-outer {
  background: none;
}
@media (max-width: 767.98px) {
  /* Phones: the whole banner first, then the title on dark blue below it. */
  .page-node-201 .bImage #inner-banner-image,
  .page-node-206 .bImage #inner-banner-image,
  .page-node-554 .bImage #inner-banner-image,
  .page-node-582 .bImage #inner-banner-image,
  .page-node-629 .bImage #inner-banner-image {
    position: static;
    height: 22.5vw; /* the hero image style is 2000 x 450 */
    padding-top: 0;
  }
  .page-node-201 .bImage .t-outer .container, .page-node-206 .bImage .t-outer .container, .page-node-554 .bImage .t-outer .container,
  .page-node-582 .bImage .t-outer .container, .page-node-629 .bImage .t-outer .container {
    min-height: 0;
  }
  .page-node-201 .bImage .t-outer .t-outer-content, .page-node-206 .bImage .t-outer .t-outer-content, .page-node-554 .bImage .t-outer .t-outer-content,
  .page-node-582 .bImage .t-outer .t-outer-content, .page-node-629 .bImage .t-outer .t-outer-content {
    padding: 10px 15px 30px 0;
  }
}

/* R14 status/error messages in the page flow. The theme setting "messages: alerts" pins every message to the bottom of
   the screen (fixed), where it covered headings, videos, form text and the footer. Shown where Drupal prints them. */
[data-drupal-messages].alert-wrapper {
  position: relative !important;
  bottom: auto !important;
  left: auto !important;
  z-index: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
/* The "Status message" / "Error message" heading stays for screen readers only (live shows just the message text). */
[data-drupal-messages] .alert-heading {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* R14 long one-word form labels (field names like "Individuals.Transactions.TRANSACTIONTYPE") wrap on phones. */
legend .fieldset-legend,
.form-item > label {
  overflow-wrap: anywhere;
}

/* Pre-launch QA 11-30 (full sweep, every page). Body text only (.text-formatted), so galleries, sliders and header images
   keep their own sizing.
   1. Pictures in body text keep their shape and never get wider than the column: editors' width/height attributes had
      squashed or stretched 12 images (up to 338% on /online-pledge-portals) and a pasted 946px picture made
      /2020-catawba-valley-health-system scroll sideways on phones. */
.text-formatted img {
  max-width: 100%;
  height: auto !important;
}
/* 2. Long web addresses in links wrap on phones instead of running out of the text column. Links only: wrapping whole
      paragraphs also let narrow columns split ordinary words ("Uni-ted"; re-sweep 11-30). */
.text-formatted a {
  overflow-wrap: break-word;
}
/* 3. Text pasted from Word carries inline Calibri/Aptos/Cambria, which are not web fonts, so every visitor got a
      fallback font (102 pages). Body text shows the site's own font instead. */
.text-formatted [style*="font-family"],
.text-formatted font[face] {
  font-family: inherit !important;
}
/* 4. Pictures and drawing groups pasted from Word sit in absolutely positioned boxes with large margins (/2020-catawba-valley-health-system:
      the page was 946px wide on a phone and 1,717px on a laptop). Body text keeps them in the normal flow. */
.text-formatted [style*="position:absolute"],
.text-formatted [style*="position: absolute"] {
  position: static !important;
  margin: 0 !important;
  width: auto !important;
}
/* 5. Wide tables in body text (fixed cell widths from Word) scroll inside their own box on phones, not the whole page. */
.text-formatted table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}
