/* ==========================================================
   HOPE 2: Site theme (every theme except Claro)
   Replaces: Custom, Front Page, Language Options, Mobile Header
   and Footer, Media Specific, Slide Show, Video Study Guides.

   Content-type rules are scoped with :where(.page-node-type-…)
   on <body>. :where() adds no specificity, so these rules win
   and lose exactly as they did as separate injectors.
   Keep the section order: later sections override earlier ones.
   ========================================================== */

/* ==========================================================
   1. Site-wide
   ========================================================== */
body { background: #e7dfd4 url("/sites/default/files/themes/noise_light.png") repeat; }

#block-dxpr-theme-logo,
#block-thehopeproject-logoen { width: 300px; }
.body--dxpr-theme-nav-desktop .dxpr-theme-header--top {
  background-image: url("/themes/contrib/dxpr_theme/images/header-bg00.png");
  height: 114px;
}
.site-slogan { font-family: "Crimson"; font-size: 0.85em; line-height: 1em; color: #684423; padding-top: 10px; }
#block-thehopeproject-logoen .site-slogan { padding-top: 31px; }   /* centre on the 71px logo */
/* Desktop: logo and tagline side by side, the tagline centred against the
   logo however many lines it takes (French and other longer languages
   wrap to three lines, which a fixed top padding pushed onto the moulding). */
body:not(.body--dxpr-theme-nav-mobile) #block-thehopeproject-logoen .field--name-body {
  display: flex;
  align-items: center;
}
body:not(.body--dxpr-theme-nav-mobile) #block-thehopeproject-logoen .field--name-body .site-slogan {
  padding-top: 0;
  margin: 0;
}
body:not(.body--dxpr-theme-nav-mobile) #block-thehopeproject-logoen .field--name-body > a {
  flex: 0 0 auto;   /* the logo keeps its size; only the tagline wraps */
}

.dxpr-theme-boxed-container,
.dxpr-theme-footer { background-color: transparent; }
.dxpr-theme-header .dropdown-menu li { line-height: 1.1em; }   /* items that wrap (longer languages) mustn't overlap */

.page-title-full-width-container { background: none; color: #000; }
.page-title-full-width-container#page-title-full-width-container h1 { color: #806e4d; }
h2 { color: #806e4d; }
.field--name-field-sub-title {
  font-family: "Crimson Text", serif;
  font-style: italic;
  font-weight: normal;
  font-size: 1.45em;
  line-height: 1em;
  color: #806e4d;
  margin-bottom: 1em;
}

li.page-item { margin-right: 10px; }
.pull-right { float: right !important; }

.btn, .btn:active {
  font-family: "Crimson Text", serif;
  font-size: 14px;
  line-height: normal;
  text-transform: uppercase;
  color: #c7bcb1 !important;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
  padding: 8px 15px;
  border: 0 none;
  background: linear-gradient(to bottom, #413121 0%, #301f0d 100%);
}

/* Spiritual Help page */
.well {
  min-height: 20px;
  padding: 20px;
  margin-bottom: 20px;
  background: rgba(41, 22, 0, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 0 25px rgba(41, 22, 0, 0.04), 0 0 5px rgba(41, 22, 0, 0.2);
}

/* Sidebar menu: plain list, long items wrap */
.block-system-menu-blockside-menu li { list-style-type: none; padding-left: 0; max-width: 100%; }
.block-system-menu-blockside-menu ul.navbar-nav { max-width: 98%; }
.block-system-menu-blockside-menu ul.navbar-nav .nav-item .nav-link {
  display: inline-block;
  max-width: 100%;
  white-space: normal;
  word-wrap: break-word;
  line-height: 1.4;
}

/* ==========================================================
   2. Video pages: front page, chapter selection, full movie,
      landing pages (incl. Language Options)
   ========================================================== */
html:where(:has(> body:is(.page-node-type-chapter-selection, .page-node-type-front-page, .page-node-type-full-movie, .page-node-type-landing-page))) {
  background-color: #000;
  color: #fff;
}
:where(.page-node-type-chapter-selection, .page-node-type-front-page, .page-node-type-full-movie, .page-node-type-landing-page) :is(.wrap-containers, .dxpr-theme-footer) {
  background-color: #000;
  color: #fff;
}
/* h3 is left out on purpose: the global h3 rule has always won there */
:where(.page-node-type-chapter-selection, .page-node-type-front-page, .page-node-type-full-movie, .page-node-type-landing-page) :is(h1, h2, h4, h5, h6, th),
:where(.page-node-type-chapter-selection, .page-node-type-front-page, .page-node-type-full-movie, .page-node-type-landing-page) .navbar-brand,
:where(.page-node-type-chapter-selection, .page-node-type-front-page, .page-node-type-full-movie, .page-node-type-landing-page) .nav-tabs > li > a {
  color: #fff;
}
:where(.page-node-type-chapter-selection, .page-node-type-front-page, .page-node-type-full-movie, .page-node-type-landing-page) .field--name-title {
  color: #806e4d;
  text-transform: uppercase;
  margin: -2px auto 10px auto;
  font-size: 1.1em;
  line-height: 18px;
  padding-bottom: 0;
  text-shadow: unset;
}
:where(.page-node-type-chapter-selection, .page-node-type-front-page, .page-node-type-full-movie, .page-node-type-landing-page) .site-slogan {
  font-size: 0.9em;
  line-height: 0.9em;
  color: #684423;
  padding-top: 17px;
}

/* "Watch full movie" and "View by chapter" tiles */
:where(.page-node-type-chapter-selection, .page-node-type-front-page, .page-node-type-full-movie, .page-node-type-landing-page) :is(.field--name-field-full-movie, .field--name-field-chapters) {
  /* Centre the caption in the tile. It used to be centred with a
     line-height as tall as the tile, so a caption that wrapped (French
     and other longer languages) put its second line far below. */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: top;
  height: 300px;
  width: 400px;
  font-size: 3em;
  text-align: center;
}
:where(.page-node-type-chapter-selection, .page-node-type-front-page, .page-node-type-full-movie, .page-node-type-landing-page) .field--name-field-full-movie {
  background: url("/sites/default/files/chapter_9.jpg") no-repeat;
}
:where(.page-node-type-chapter-selection, .page-node-type-front-page, .page-node-type-full-movie, .page-node-type-landing-page) .field--name-field-chapters {
  background: url("/sites/default/files/chapter_4.jpg") no-repeat;
}
:where(.page-node-type-chapter-selection, .page-node-type-front-page, .page-node-type-full-movie, .page-node-type-landing-page) :is(.field--name-field-full-movie, .field--name-field-chapters) a {
  padding: 5px;
  background: rgba(0, 0, 0, 0.5);
  text-transform: uppercase;
  text-align: center;
  color: #ddd2c7;
  font-size: 34px;
  font-weight: normal;
  white-space: normal;
  line-height: 1.15;
  display: inline-block;
  max-width: 88%;
}
:where(.page-node-type-chapter-selection, .page-node-type-front-page, .page-node-type-full-movie, .page-node-type-landing-page) .field--name-field-chapters a { margin: 0; }
:where(.page-node-type-chapter-selection, .page-node-type-front-page, .page-node-type-full-movie, .page-node-type-landing-page) .full-movie-left .field--name-field-full-movie {
  float: right;
  margin-left: 0;
  margin-right: 20px;
}
@media (min-width: 1201px) {
  :where(.page-node-type-chapter-selection, .page-node-type-front-page, .page-node-type-full-movie, .page-node-type-landing-page) :is(.field--name-field-full-movie, .field--name-field-chapters) {
    width: 240px;
    height: 180px;
    background-size: cover;
  }
  :where(.page-node-type-chapter-selection, .page-node-type-front-page, .page-node-type-full-movie, .page-node-type-landing-page) :is(.field--name-field-full-movie, .field--name-field-chapters) a {
    font-size: 21px;
  }
}
/* Tablets: the theme makes the tiles full-width blocks (a stronger rule),
   so centre the caption the same way here. */
@media (max-width: 1200px) {
  .front-page :is(.full-movie-left .field--name-field-full-movie, .field--name-field-full-movie, .field--name-field-chapters) {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Front page headline text */
:where(.page-node-type-chapter-selection, .page-node-type-front-page, .page-node-type-full-movie, .page-node-type-landing-page) .landing-page-text {
  color: #a35d01;
  padding: 0 0 20px 0;
  line-height: 0.85em;
  margin-bottom: 0;
  font-variant: small-caps;
  font-weight: normal;
  font-style: normal;
}
:where(.page-node-type-chapter-selection, .page-node-type-front-page, .page-node-type-full-movie, .page-node-type-landing-page) h2.landing-page-text {
  line-height: 0.9em;
  margin-left: 0;
  padding: 0 0 20px 0;
  font-size: 2.5em;
  text-transform: capitalize;
}
:where(.page-node-type-chapter-selection, .page-node-type-front-page, .page-node-type-full-movie, .page-node-type-landing-page) .landing-page-text-small {
  font-size: 0.7em;
  font-variant: normal;
  color: #8b8278;
  background: transparent none;
}
:where(.page-node-type-chapter-selection, .page-node-type-front-page, .page-node-type-full-movie, .page-node-type-landing-page) .landing-page-text h2 .small {
  font-size: 1.2em;
  color: #8b8278;
  font-variant: small-caps;
  background: transparent none;
}

:where(.page-node-type-chapter-selection, .page-node-type-front-page, .page-node-type-full-movie, .page-node-type-landing-page) .dc-video-player-wrapper {
  position: absolute;
  top: 0;
  left: 15%;
  width: 70%;
  height: 70%;
  overflow: hidden;
  background-color: #000;
}

/* Right-to-left languages */
[dir="rtl"] .path-frontpage .bs-text-right { text-align: left !important; }
[dir="rtl"] :where(.page-node-type-chapter-selection, .page-node-type-front-page, .page-node-type-full-movie, .page-node-type-landing-page) .full-movie-left .field--name-field-full-movie {
  float: left;
  margin-right: 0;
  margin-left: 20px;
}
@media (max-width: 1200px) {
  [dir="rtl"] :where(.page-node-type-chapter-selection, .page-node-type-front-page, .page-node-type-full-movie, .page-node-type-landing-page) .full-movie-left .field--name-field-full-movie {
    float: none;
    margin-left: 0;
  }
}

/* Language Options page */
.language-options a {
  display: block;
  margin: 10px 0;
  color: #a35d01;
  font-size: 1.2em;
  line-height: 1.4em;
  text-align: center;
}

/* ==========================================================
   3. Mobile header, dropdown menu and footer buttons (matches D7)
   Mobile rules are scoped to DXPR's .body--dxpr-theme-nav-mobile.
   Menu links are targeted by data-drupal-link-system-path (the same
   in every language), never by position:
     node/85 Study Guide   node/199 Language Options   node/28 Resources
     node/27 Spiritual Help   node/29 About   Feedback = a.menu-hide-mobile
   ========================================================== */

/* Desktop: hide the mobile-only blocks */
body:not(.body--dxpr-theme-nav-mobile) :is(#block-mobilelanguage, #block-mobilefootermenu, #block-mobilebuttonsmain, #block-mobilebuttonsfooter) {
  display: none !important;
}

/* Header bar */
/* Sticky on phones and tablets: the browser keeps the bar at the top
   with position: sticky (no script, so it doesn't bounce on iPhones).
   On desktop the DXPR theme setting "Fixed Position" + "Sticky Header"
   does it. top follows the admin toolbar when logged in. */
body.body--dxpr-theme-nav-mobile .dxpr-theme-header {
  position: sticky !important;
  top: var(--drupal-displace-offset-top, 0px) !important;
  z-index: 1000;
  height: 76px !important;
  background: #e8dfcc url("/sites/default/files/header-bg00.png") center bottom / cover no-repeat !important;
}
body.body--dxpr-theme-nav-mobile .dxpr-theme-header .navbar-header {
  position: static !important;
  height: 76px;
}

/* Logo: centred */
body.body--dxpr-theme-nav-mobile #block-thehopeproject-logoen {
  position: absolute !important;
  left: 50% !important;
  top: 4px !important;
  transform: translateX(-50%) !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
}
body.body--dxpr-theme-nav-mobile #block-thehopeproject-logoen .site-slogan { display: none; }
body.body--dxpr-theme-nav-mobile #block-thehopeproject-logoen article,
body.body--dxpr-theme-nav-mobile #block-thehopeproject-logoen .field--name-field-media-image,
body.body--dxpr-theme-nav-mobile #block-thehopeproject-logoen .field__item {
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block;
}
body.body--dxpr-theme-nav-mobile #block-thehopeproject-logoen img {
  width: 96px !important;
  height: auto;
  display: block;
  margin: 0 auto;
  clip-path: inset(0 8px 0 0);   /* hides the desktop divider baked into the logo */
}

/* Languages button (left) and hamburger (right) share the bevelled look.
   The button is 70% of its original size (text 16px -> 11.2px, padding
   8/10px -> 5.6/7px), about 78 x 24px. The bar's background picture has
   a dark line about 57px down with a torn paper strip below it, so the
   bar reads as 0-57px: top: 16px centres the button in that band
   (57 / 2 - 24 / 2). */
body.body--dxpr-theme-nav-mobile #block-mobilelanguage {
  position: absolute !important;
  left: 12px !important;
  top: 16px !important;
  width: auto !important;
  margin: 0;
  padding: 0;
}
#block-mobilelanguage ul:not(.contextual-links) {
  margin: 0;
  padding: 0;
  list-style: none;
}
#block-mobilelanguage ul:not(.contextual-links) a {
  display: inline-block;
  padding: 5.6px 7px;
  font-size: 0.7rem;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  color: #7a5a2e;
  background: linear-gradient(#efe6d3, #d9ccb0);
  border: 1px solid #b9a98a;
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
body.body--dxpr-theme-nav-mobile .dxpr-theme-header #dxpr-theme-menu-toggle {
  position: absolute !important;
  right: 12px;
  /* Centred in the 0-57px band above the dark line in the bar's picture,
     level with the Languages button: 57 / 2 - 38 / 2 = 9.5. */
  top: 9px !important;
  width: 46px;
  height: 38px;
  margin: 0 !important;
  padding: 0 !important;
  background: linear-gradient(#efe6d3, #d9ccb0);
  border: 1px solid #b9a98a;
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
/* Hamburger bars stay bars when open (D7 has no X) */
body.body--dxpr-theme-nav-mobile .dxpr-theme-header #dxpr-theme-menu-toggle span,
body.body--dxpr-theme-nav-mobile .dxpr-theme-header #dxpr-theme-menu-toggle span::before,
body.body--dxpr-theme-nav-mobile .dxpr-theme-header #dxpr-theme-menu-toggle span::after {
  width: 24px !important;
  height: 3px !important;
  background-color: #7a5a2e !important;
  transform: none !important;
  opacity: 1 !important;
}
body.body--dxpr-theme-nav-mobile .dxpr-theme-header #dxpr-theme-menu-toggle span { left: 10px !important; top: 16px !important; }
body.body--dxpr-theme-nav-mobile .dxpr-theme-header #dxpr-theme-menu-toggle span::before { top: -7px !important; }
body.body--dxpr-theme-nav-mobile .dxpr-theme-header #dxpr-theme-menu-toggle span::after { top: 7px !important; }

/* Menu: full-width dropdown under the header instead of DXPR's side panel */
body.body--dxpr-theme-nav-mobile #dxpr-theme-main-menu {
  position: absolute !important;
  top: 76px !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  height: auto !important;
  max-height: calc(100vh - 76px);
  overflow-y: auto;
  padding: 0 !important;
  transition: none !important;
  display: none !important;
  background: #d9cfb8 !important;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.45);
}
body.body--dxpr-theme-nav-mobile #dxpr-theme-main-menu.menu--open { display: block !important; }
/* With the menu open, DXPR sets overflow: hidden and height: 100% on <html>.
   Keep the page scrolling on the window instead, so the sticky header (and
   the menu under it) stays on screen when the menu is opened mid-page. */
html.html--dxpr-theme-nav-mobile--open {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  height: auto !important;
}
html.html--dxpr-theme-nav-mobile--open body { overflow: visible !important; }

body.body--dxpr-theme-nav-mobile #dxpr-theme-main-menu .menu__breadcrumbs { display: none !important; }
body.body--dxpr-theme-nav-mobile #dxpr-theme-main-menu :is(.region-navigation-collapsible, .block) {
  margin: 0 !important;
  padding: 0 !important;
}
body.body--dxpr-theme-nav-mobile #dxpr-theme-main-menu ul:not(.contextual-links) {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}
body.body--dxpr-theme-nav-mobile #dxpr-theme-main-menu li { float: none !important; }

/* Main menu: show Viewing Options' children flat */
body.body--dxpr-theme-nav-mobile #block-thehopeproject-main-menu ul.menu__level {
  position: static !important;
  inset: auto !important;
  width: auto !important;
  height: auto !important;
  overflow: visible !important;
  visibility: visible !important;
  transform: none !important;
}
body.body--dxpr-theme-nav-mobile #block-thehopeproject-main-menu ul.menu__level--current > li > a.dropdown-toggle,
body.body--dxpr-theme-nav-mobile #block-thehopeproject-main-menu li:has(> a[data-drupal-link-system-path="node/85"]),
body.body--dxpr-theme-nav-mobile #block-thehopeproject-main-menu li:has(> a[data-drupal-link-system-path="node/199"]) {
  display: none !important;
}

/* Footer menu in the dropdown, D7 order:
   Resources, About, Prayer & Giving, Spiritual Help, then the rest */
body.body--dxpr-theme-nav-mobile #block-mobilefootermenu ul:not(.contextual-links) {
  display: flex !important;
  flex-direction: column;
}
body.body--dxpr-theme-nav-mobile #block-mobilefootermenu ul:not(.contextual-links) > li { order: 5; }
body.body--dxpr-theme-nav-mobile #block-mobilefootermenu li:has(> a[data-drupal-link-system-path="node/28"]) { order: 1; }
body.body--dxpr-theme-nav-mobile #block-mobilefootermenu li:has(> a[data-drupal-link-system-path="node/29"]) { order: 2; }
body.body--dxpr-theme-nav-mobile #block-mobilefootermenu li:has(> a[href*="prayer"]) { order: 3; }
body.body--dxpr-theme-nav-mobile #block-mobilefootermenu li:has(> a[data-drupal-link-system-path="node/27"]) { order: 4; }
body.body--dxpr-theme-nav-mobile #block-mobilefootermenu li:has(> a.menu-hide-mobile) { display: none !important; }

/* Dropdown rows */
body.body--dxpr-theme-nav-mobile #block-thehopeproject-main-menu ul.dropdown-menu a,
body.body--dxpr-theme-nav-mobile #block-mobilefootermenu ul:not(.contextual-links) a {
  display: block !important;
  margin: 0 !important;
  padding: 9px 20px !important;
  font-size: 1rem !important;
  line-height: 1.3 !important;
  letter-spacing: 0.02em;
  text-transform: uppercase !important;
  text-decoration: none !important;
  color: #3d2f1f !important;
  background: linear-gradient(to bottom, #e3dac6 0%, #d8ceb6 100%) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.55) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.14) !important;
  box-shadow: inset 0 0 18px rgba(120, 100, 70, 0.18);
}
body.body--dxpr-theme-nav-mobile #block-thehopeproject-main-menu ul.dropdown-menu a:is(:hover, :focus),
body.body--dxpr-theme-nav-mobile #block-mobilefootermenu ul:not(.contextual-links) a:is(:hover, :focus) {
  background: #cfc3a6 !important;
}

/* Footer: three D7-style buttons (Study Guide | Feedback / Spiritual Help) */
body.body--dxpr-theme-nav-mobile .dxpr-theme-footer {
  background: #1c1712 !important;
  background-image: none !important;
  padding: 24px 0 36px !important;
}
body.body--dxpr-theme-nav-mobile .dxpr-theme-footer .region-footer > *:not(#block-mobilebuttonsmain):not(#block-mobilebuttonsfooter) {
  display: none !important;
}
body.body--dxpr-theme-nav-mobile .dxpr-theme-footer .region-footer {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 16px 20px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 16px !important;
  box-sizing: border-box;
}
/* Flatten the two menu blocks so their links become the flex items */
body.body--dxpr-theme-nav-mobile :is(#block-mobilebuttonsmain, #block-mobilebuttonsfooter),
body.body--dxpr-theme-nav-mobile :is(#block-mobilebuttonsmain, #block-mobilebuttonsfooter) *:not(a):not(.contextual):not(.contextual *) {
  display: contents !important;
}
body.body--dxpr-theme-nav-mobile :is(#block-mobilebuttonsmain, #block-mobilebuttonsfooter)::before,
body.body--dxpr-theme-nav-mobile :is(#block-mobilebuttonsmain, #block-mobilebuttonsfooter)::after,
body.body--dxpr-theme-nav-mobile :is(#block-mobilebuttonsmain, #block-mobilebuttonsfooter) *::before,
body.body--dxpr-theme-nav-mobile :is(#block-mobilebuttonsmain, #block-mobilebuttonsfooter) *::after {
  display: none !important;
  content: none !important;
}
body.body--dxpr-theme-nav-mobile :is(#block-mobilebuttonsmain, #block-mobilebuttonsfooter) :is(.contextual, a) {
  display: none !important;
}
body.body--dxpr-theme-nav-mobile #block-mobilebuttonsmain a[data-drupal-link-system-path="node/85"],
body.body--dxpr-theme-nav-mobile #block-mobilebuttonsfooter a.menu-hide-mobile,
body.body--dxpr-theme-nav-mobile #block-mobilebuttonsfooter a[data-drupal-link-system-path="node/27"] {
  display: block !important;
  flex: 0 0 auto;
  width: calc(50% - 10px) !important;
  max-width: 170px !important;
  min-width: 0 !important;
  box-sizing: border-box;
  margin: 0 !important;
  padding: 12px 14px !important;
  font-size: 1rem !important;
  font-weight: 400 !important;
  line-height: 1.2 !important;
  letter-spacing: 0.02em;
  text-align: center;
  text-transform: uppercase !important;
  text-decoration: none !important;
  text-shadow: none !important;
  color: #d9cbb4 !important;
  background: linear-gradient(to bottom, #4a3626 0%, #2e2117 100%) !important;
  border: 1px solid #20170f !important;
  border-radius: 3px !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}
body.body--dxpr-theme-nav-mobile #block-mobilebuttonsmain a[data-drupal-link-system-path="node/85"] { order: 1; }
body.body--dxpr-theme-nav-mobile #block-mobilebuttonsfooter a.menu-hide-mobile { order: 2; }
body.body--dxpr-theme-nav-mobile #block-mobilebuttonsfooter a[data-drupal-link-system-path="node/27"] { order: 3; }
body.body--dxpr-theme-nav-mobile :is(#block-mobilebuttonsmain, #block-mobilebuttonsfooter) a:is(:hover, :focus, :active) {
  color: #2e2117 !important;
  background: linear-gradient(to bottom, #c9b089 0%, #a8885c 100%) !important;
}
body.body--dxpr-theme-nav-mobile #backtotop { display: none !important; }

/* Study guides on phones: tighter outline indents.
   The migrated D7 body text hard-codes margin-left inline. */
@media (max-width: 767.98px) {
  .study-guide .field--name-body p[style*="margin-left"] { margin-left: 1rem !important; }
  .study-guide .field--name-body ul[style*="margin-left"] { margin-left: 1.75rem !important; padding-left: 1.1rem !important; }
  .study-guide .field--name-body ol[style*="margin-left"] { margin-left: 1rem !important; padding-left: 1.25rem !important; }

  /* Home page tiles: captions that wrap (longer languages) stay inside the tile */
  .front-page :is(.field--name-field-full-movie, .field--name-field-chapters) {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
  }
  .front-page :is(.field--name-field-full-movie, .field--name-field-chapters) a {
    display: inline-block !important;
    line-height: 1.15 !important;
    max-width: 88%;
    padding: 8px 14px !important;
  }
}

/* Desktop fixed footer: clear it by padding the black content wrapper,
   not the body (which showed a beige band on short pages) */
body:not(.body--dxpr-theme-nav-mobile) { padding-bottom: 0 !important; }
body:not(.body--dxpr-theme-nav-mobile) .wrap-containers { padding-bottom: 160px; }

/* Dacast video: responsive 16:9 (embeds ship with blank width/height) */
.media--type-dacast-video iframe {
  display: block;
  width: 100%;
  max-width: min(1280px, calc((100vh - 380px) * 16 / 9));
  height: auto;
  aspect-ratio: 16 / 9;
  margin: 0 auto;
}
/* Short screens (phones and tablets in landscape): the rule above would
   shrink the player to almost nothing, so fit it to the screen height instead. */
@media (max-height: 600px) {
  .media--type-dacast-video iframe {
    max-width: min(100%, calc((100vh - 90px) * 16 / 9));
  }
}

/* ==========================================================
   4. Breakpoints (DXPR's header_mobile_breakpoint is 1200)
   ========================================================== */
@media (max-width: 1200px) {
  .tall-banner h2 { font-size: 2.3em; }
  .tall-banner h3 { font-size: 2em; }
  .tall-banner h4 { font-size: 1.3em; }
  .block-inline-blocklarge-banner h2 { font-size: 2em; }
  .block-inline-blocklarge-banner h4 { font-size: 1.5em; }
  .hidden-mobile { display: none; }
}

@media (min-width: 1201px) {
  .hidden-desktop { display: none; }
  .theo-player-wrapper { height: 100vh; }
  body { scroll-padding-bottom: 96px; }

  /* Footer fixed to the bottom of the viewport */
  .dxpr-theme-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 96px;
    z-index: 100;
    color: white;
    text-align: center;
    background: rgba(0, 0, 0, 0) url(/sites/default/files/themes/footer-bg00.png) repeat-x scroll top center;
  }
  ul.navbar-nav[data-block="footer"] {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    justify-content: center;
    list-style: none;
    margin-top: 39px;
    padding: 0;
  }
  ul.navbar-nav[data-block="footer"] > li.nav-item {
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    font-size: 0.8em;
  }
  ul.navbar-nav[data-block="footer"] > li.nav-item + li.nav-item::before {
    content: "|";
    margin: 0 10px;
    color: #666;
  }
  ul.navbar-nav[data-block="footer"] a.nav-link {
    display: inline;
    padding: 0;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 1.1em;
    font-family: "Crimson Text", "Times", "Times New Roman", Georgia, serif;
    color: #402819 !important;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5);
  }
  .icons a {
    display: block;
    width: 36px;
    height: 36px;
    margin: 5px;
    opacity: 0.7;
    background: url("/sites/all/themes/thehope/assets/images/sprite.png") 0 0 no-repeat;
  }
  #block-thehopeproject-footer-right-logos,
  #block-thehopeproject-footer-help-reach {
    position: absolute;
    top: 50%;
    transform: translateY(calc(-50% + 7px));
  }
}

.dxpr-theme-footer .footer-container { padding-top: 0; }
#block-thehopeproject-copyright { margin-top: -6px; }
/* Social icons: the block body has an inline margin-top: -65px */
#block-thehopeproject-copyright .field--name-body > div[style*="margin-top"] { margin-top: -42px !important; }

/* ==========================================================
   5. Chapter slider and prev/next buttons
      (front page and chapter selection only)
   ========================================================== */
:where(.page-node-type-chapter-selection, .page-node-type-front-page) :is(.field--name-field-previous-video, .field--name-field-next-video) a {
  display: flex;
  height: 71px;
  width: 268px;
  margin-top: 100%;
  text-indent: -9999px;
  overflow: hidden;
}
:where(.page-node-type-chapter-selection, .page-node-type-front-page) .field--name-field-previous-video a {
  float: right;
  background: url("/sites/default/files/previous.png") no-repeat;
}
:where(.page-node-type-chapter-selection, .page-node-type-front-page) .field--name-field-next-video a {
  background: url("/sites/default/files/next-no-bg.png") no-repeat;
}
:where(.page-node-type-chapter-selection, .page-node-type-front-page) :is(.field--name-field-previous-video, .field--name-field-next-video) a:hover {
  font-size: 0.9em;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #fff;
  text-transform: uppercase;
  text-indent: 0;
  z-index: 1000;
}
:where(.page-node-type-chapter-selection, .page-node-type-front-page) .field--name-field-previous-video a:hover {
  background: url("/sites/default/files/previous-chapter-blank.png") no-repeat;
}
:where(.page-node-type-chapter-selection, .page-node-type-front-page) .field--name-field-next-video a:hover {
  background: url("/sites/default/files/next-bg.png") no-repeat;
  width: 240px;
}

:where(.page-node-type-chapter-selection, .page-node-type-front-page) .flexslider { background: #000; border: none; }
:where(.page-node-type-chapter-selection, .page-node-type-front-page) .flex-next a { margin-left: 50px; color: #fff; }
:where(.page-node-type-chapter-selection, .page-node-type-front-page) .flex-direction-nav a {
  position: absolute;
  top: 50%;
  z-index: 10;
  display: block;
  width: 40px;
  height: 70px;
  margin: -40px;
  overflow: hidden;
  cursor: pointer;
  color: white;
  text-decoration: none;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.3);
}
:where(.page-node-type-chapter-selection, .page-node-type-front-page) .flex-direction-nav a::before { color: #fff; }

/* Arrows: pinned inside the slider, fade only (stock FlexSlider slides
   them in on hover, which made them bounce away from the cursor) */
:where(.page-node-type-chapter-selection, .page-node-type-front-page) .flexslider .flex-direction-nav a {
  display: block;
  opacity: 0.7 !important;
  transition: opacity 0.2s ease !important;
}
:where(.page-node-type-chapter-selection, .page-node-type-front-page) .flexslider .flex-direction-nav .flex-prev { left: 10px !important; }
:where(.page-node-type-chapter-selection, .page-node-type-front-page) .flexslider .flex-direction-nav .flex-next { right: 10px !important; }
:where(.page-node-type-chapter-selection, .page-node-type-front-page) .flexslider .flex-direction-nav a:is(:hover, :focus) { opacity: 1 !important; }
:where(.page-node-type-chapter-selection, .page-node-type-front-page) .flexslider .flex-direction-nav a.flex-disabled {
  opacity: 0 !important;
  pointer-events: none;
}

/* ==========================================================
   6. Study guides
   ========================================================== */
:where(.page-node-type-study-guide) .video-container {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding-top: 56.25%;   /* 16:9, the Dacast player's shape (was 4:3, which left a white band) */
}
/* Space between the lesson video and the lesson menu below it. The video
   block is sticky, so the space goes on the wrapper the sticky script adds
   (it sets the wrapper's height without the block's margin). */
:where(.page-node-type-study-guide) :is(.sticky-wrapper:has(> .block-field-blocknodestudy-guidefield-chapter-video), .block-field-blocknodestudy-guidefield-chapter-video:not(.sticky-wrapper > *)) {
  margin-bottom: 20px;
}
:where(.page-node-type-study-guide) .dxpr-theme-boxed-container {
  background-image: url("/sites/default/files/dxpr_theme/images/noise_light_0.png");
}
:where(.page-node-type-study-guide) h1 {
  font-family: "Crimson Text", serif;
  font-size: 2.25em;
  font-weight: normal;
  line-height: 1em;
  color: #402819;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5);
}
:where(.page-node-type-study-guide) .translation-notice h3 {
  font-family: "Crimson Text", serif;
  font-size: 1.5em;
  font-weight: normal;
  text-transform: none;
  letter-spacing: 0.01em;
  color: #6b4c27;
  text-shadow: 1px 1px 0 #f9f7f4;
}
:where(.page-node-type-study-guide) .media--type-dacast-video iframe { border: 0; }

/* ==========================================================
   7. Chapter pages on desktop (above 1200px): video as wide as the
      Full Movie page, with the Previous / Next chevrons over its left
      and right edges. They stay put on hover and only brighten.
      Phones and tablets use the theme's own chapter-arrow rules
      (dxpr_theme_subtheme.css: video first, arrows side by side under
      it, no hover swap); nothing here applies at those sizes, because
      two sets of rules fighting over the arrow's size made it jump and
      swallow taps.
   ========================================================== */
@media (min-width: 1201px) {
  /* The layout section adds its own 60px-padded container inside the page's;
     the Full Movie page has none, so trim it to match that video's width. */
  :where(.page-node-type-chapter-selection) .container:has(> .layout.row .block-field-blocknodechapter-selectionfield-chapter-media) {
    padding-left: 15px;
    padding-right: 15px;
  }
  /* As wide as the video can be at this screen height, so the chevrons
     sit on the video's edges rather than out in the page margin. */
  :where(.page-node-type-chapter-selection) .layout.row:has(.block-field-blocknodechapter-selectionfield-chapter-media) {
    position: relative;
    max-width: min(1310px, calc((100vh - 380px) * 16 / 9 + 30px));   /* the video's own limits + 30px column padding */
    margin-left: auto;
    margin-right: auto;
  }
  :where(.page-node-type-chapter-selection) .layout.row:has(.block-field-blocknodechapter-selectionfield-chapter-media) > :nth-child(2) {
    flex: 0 0 100%;
    max-width: 100%;
  }
  :where(.page-node-type-chapter-selection) .layout.row:has(.block-field-blocknodechapter-selectionfield-chapter-media) > :is(:first-child, :last-child) {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    width: auto;
    max-width: none;
    padding: 0;
    pointer-events: none;
  }
  :where(.page-node-type-chapter-selection) .layout.row:has(.block-field-blocknodechapter-selectionfield-chapter-media) > :first-child {
    left: 0;
  }
  :where(.page-node-type-chapter-selection) .layout.row:has(.block-field-blocknodechapter-selectionfield-chapter-media) > :last-child {
    right: 0;
  }
  /* The chevron alone, the same in every state: no label swap on hover */
  :where(.page-node-type-chapter-selection) :is(.field--name-field-previous-video, .field--name-field-next-video) a,
  :where(.page-node-type-chapter-selection) :is(.field--name-field-previous-video, .field--name-field-next-video) a:is(:hover, :focus, :active) {
    width: 60px;
    margin-top: 0;
    float: none;
    text-indent: -9999px;
    pointer-events: auto;
  }
  :where(.page-node-type-chapter-selection) .field--name-field-previous-video a:is(:hover, :focus, :active) {
    background: url("/sites/default/files/previous.png") no-repeat;
  }
  /* The Next chevron is at the right end of its image */
  :where(.page-node-type-chapter-selection) .field--name-field-next-video a,
  :where(.page-node-type-chapter-selection) .field--name-field-next-video a:is(:hover, :focus, :active) {
    background: url("/sites/default/files/next-no-bg.png") no-repeat right center;
  }
}
/* Hover / keyboard focus feedback that doesn't change size (all sizes) */
:where(.page-node-type-chapter-selection) :is(.field--name-field-previous-video, .field--name-field-next-video) a:is(:hover, :focus-visible) {
  filter: brightness(1.4);
}
:where(.page-node-type-chapter-selection) :is(.field--name-field-previous-video, .field--name-field-next-video) a:focus-visible {
  outline: 2px solid #fea026;
  outline-offset: 2px;
}

/* ==========================================================
   8. Phones and tablets: footer buttons at the bottom of the screen
      On a short page the dark footer (Study Guide | Feedback /
      Spiritual Help) sat part-way up the screen. Make the page at least
      as tall as the screen and let the content area take the extra
      space.
   ========================================================== */
body.body--dxpr-theme-nav-mobile .dxpr-theme-boxed-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;   /* follows Safari's toolbar as it shrinks and grows */
}
/* Whatever shows past the page (the strip under Safari's floating toolbar,
   the home-indicator area, the bounce when scrolling past the end) is the
   page canvas: make it the footer's near-black so the bottom looks solid. */
html:has(> body.body--dxpr-theme-nav-mobile) {
  background-color: #1c1712;
}
/* Safari on iOS 26 tints its floating toolbar (and the strip around it)
   from the body's background, which was the beige parchment. Keep the
   parchment on the page container, which fills the screen, and give the
   body itself the footer's near-black. */
body.body--dxpr-theme-nav-mobile {
  background: #1c1712;
}
body.body--dxpr-theme-nav-mobile .dxpr-theme-boxed-container {
  background: #e7dfd4 url("/sites/default/files/themes/noise_light.png") repeat;
}
body.body--dxpr-theme-nav-mobile.page-node-type-study-guide .dxpr-theme-boxed-container {
  background-image: url("/sites/default/files/dxpr_theme/images/noise_light_0.png");
}
body.body--dxpr-theme-nav-mobile .dxpr-theme-boxed-container > .wrap-containers {
  flex: 1 0 auto;
}

/* ==========================================================
   9. Empty alert bar above the header
   The Alerts block sits in the secondary header, which keeps 7px of
   padding even when there is no alert, leaving a light strip above the
   header. Collapse it only when the view has no rows, so a real alert
   still gets its spacing. Applies at every screen size.
   ========================================================== */
#secondary-header:not(:has(.views-row)) {
  padding-top: 0;
  padding-bottom: 0;
}

/* Front page of every language, phones and tablets: the big HOPE logo and
   the "The Story of God's Promise for All People" headline are 20% smaller
   (logo 80% of its column, centred; headline 2.5em -> 2em, and its small
   words scale with it), and the headline is centred under the logo. The
   welcome text keeps its size and alignment. */
body.body--dxpr-theme-nav-mobile.page-node-type-front-page img.image-style-home-page-logo {
  display: block;
  width: 80%;
  height: auto;
  margin: 0 auto;
}
body.body--dxpr-theme-nav-mobile.page-node-type-front-page h2.landing-page-text {
  font-size: 2em;
  text-align: center;
}

/* Front page tiles ("View full movie", "View by chapter"), phones and
   tablets (the DXPR mobile-menu layout, up to 1200px; wider screens keep
   the desktop layout): always side by side, never stacked, with the three
   buttons below. Each tile takes half the row (10px gap) in the photo's
   4:3 shape, and the caption scales with the screen width (13px on a
   320px phone, 24px at most), wrapping inside the tile in longer
   languages. */
body.body--dxpr-theme-nav-mobile.page-node-type-front-page .front-page .layout--twocol {
  flex-wrap: nowrap !important;
  gap: 10px;
}
body.body--dxpr-theme-nav-mobile.page-node-type-front-page .front-page .layout--twocol > .layout__region {
  flex: 1 1 0 !important;
  min-width: 0;
  max-width: none !important;
  width: auto !important;
}
body.body--dxpr-theme-nav-mobile.page-node-type-front-page .front-page :is(.full-movie-left .field--name-field-full-movie, .field--name-field-full-movie, .field--name-field-chapters) {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 4 / 3;
  margin: 0 !important;
  float: none !important;
  background-size: cover !important;
  background-position: center !important;
}
body.body--dxpr-theme-nav-mobile.page-node-type-front-page .front-page :is(.field--name-field-full-movie, .field--name-field-chapters) a {
  font-size: clamp(13px, 4.2vw, 24px) !important;
  max-width: 92% !important;
  padding: 4px 6px !important;
}

/* Front page, phones and tablets: half the space between the welcome text
   ("...you've come to the right place.") and the tiles, so the tiles sit
   higher (69px -> 37px: drops the 32px Bootstrap Styles bottom margin of
   the welcome section, which uses !important). */
body.body--dxpr-theme-nav-mobile.page-node-type-front-page .front-page > .content > .bs-mb-3:has(.field--name-body) {
  margin-bottom: 0 !important;
}

/* Chapter selection page, phones and tablets. It is built from the same
   content type as the front page, so the headline rules above already
   apply; these make the rest match the front page and bring the chapter
   videos above the fold:
   - logo 80% of its column and centred (as on the front page; this page's
     logo uses a different image style, so the rule above didn't catch it),
   - headline and welcome text use the full width (drops the section's
     48px right padding and 16px right margin from Bootstrap Styles),
   - no extra 32px above the logo (the front page has none). */
body.body--dxpr-theme-nav-mobile.page-node-type-front-page .field--name-field-page-logo img {
  display: block;
  width: 80% !important;
  height: auto;
  margin: 0 auto;
}
body.body--dxpr-theme-nav-mobile.page-node-type-front-page .front-page .block-layout-builder:has(> .field--name-body) {
  padding-right: 0 !important;
  margin-right: 0 !important;
}
body.body--dxpr-theme-nav-mobile.page-node-type-front-page:has(.view-chapter-slideshow) .front-page > .content > .bs-mt-3:has(.field--name-field-page-logo) {
  margin-top: 0 !important;
}

/* ==========================================================
   4:3 Dacast videos
   ========================================================== */
/* Most of The HOPE film is 4:3; some language versions and other videos
   are 16:9. The thehope_video_aspect module marks each Dacast video
   media--aspect-4-3 or media--aspect-16-9 from its "Aspect ratio" field,
   so a 4:3 video gets a 4:3 player instead of black bars at the sides.
   These follow the 16:9 rules above, with 4 / 3 in place of 16 / 9. */
.media--type-dacast-video.media--aspect-4-3 iframe {
  aspect-ratio: 4 / 3;
  max-width: min(1280px, calc((100vh - 380px) * 4 / 3));
}
@media (max-height: 600px) {
  .media--type-dacast-video.media--aspect-4-3 iframe {
    max-width: min(100%, calc((100vh - 90px) * 4 / 3));
  }
}
/* Chapter pages, desktop: the row (and its arrows) is as wide as the video. */
@media (min-width: 1201px) {
  :where(.page-node-type-chapter-selection) .layout.row:has(.block-field-blocknodechapter-selectionfield-chapter-media .media--aspect-4-3) {
    max-width: min(1310px, calc((100vh - 380px) * 4 / 3 + 30px));
  }
}
/* Study guides: the video box is shaped by its top padding. */
:where(.page-node-type-study-guide) .video-container:has(.media--aspect-4-3) {
  padding-top: 75%;
}

/* Basic pages (Resources, Spiritual Help...), phones and tablets: the
   title and text start 12px from the left, in line with the Languages
   button, and end 12px from the right. The containers were 85% wide and
   centred, which put the text 44px in. The title's box starts 2px further
   left (10px), because at 53px the first letter's ink sits about 2px inside
   its box; that puts the R of "Resources" right above the text. */
body.body--dxpr-theme-nav-mobile.page-node-type-page #page-title.page-title-container {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 10px !important;
  padding-right: 12px !important;
}
body.body--dxpr-theme-nav-mobile.page-node-type-page .main-container {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
body.body--dxpr-theme-nav-mobile.page-node-type-page .main-container > .row {
  margin-left: 0 !important;
  margin-right: 0 !important;
}
body.body--dxpr-theme-nav-mobile.page-node-type-page .main-container > .row > [class*="col-"] {
  padding-left: 12px !important;
  padding-right: 12px !important;
}
