/*
 Theme Name: PURC Divi Child
 Theme URI: https://www.elegantthemes.com/gallery/divi/
 Description: Divi Child Theme
 Author: admin@pasadenaurc.org
 Template: Divi
 Version: 1.0.2
*/

/* Theme customization starts here
------------------------------------------------------- */

/* Change the width of main content blocks */

.container,
.et_pb_row:not([class*=et_flex_column]) {
  width: 87.5%;
}

.et_pb_row_0 {
  padding-bottom: 0;
}

/* Increase v-space between h2s */

h2:not(h2:first-child) {
  margin-top: 1em;
}

/* Undo incorrect inheritance of padding-bottom to mobile menu links, and just remove unneccessary default padding. */

.et_header_style_left #et-top-navigation #mobile_menu > li > a {
  font-size: 1em;
  padding-top: 1em;
  padding-bottom: 1em;
}

/* Remove excessive mobile menu padding */

#mobile_menu {
  padding: 0;
}

/* Add Skip Link styling */

.skip-link {
  background: #333;
  color: #fff;
  font-weight: bold;
  padding: 0.5em 1em;
  position: absolute;
  z-index: 9999;
  left: 50%;
  transform: translate(-50%, -100%);
  transition: all 0.2s ease-out;
  opacity: 0;
  border-radius: 0 0 0.5em 0.5em;
}

.skip-link:focus {
  opacity: 1;
  transform: translate(-50%, 0%);
}

/* Add space before footer on non-Divi pages */

#main-content:not(:has(.et_builder_inner_content, .directory)) {
  margin: 1em auto 50px;
}

/* Fix weird Divi default on final paragraphs */

p:not(.has-background):last-of-type {
  padding-bottom: 1em;
}

p:not(.has-background):last-child {
  padding-bottom: 0em;
}

/* Make main nav active link color same as standard link color (for better contrast) */

#top-menu li.current-menu-ancestor > a,
#top-menu li.current-menu-item > a,
.mobile_menu_bar:after,
.mobile_menu_bar:before {
  color: #1e73be;
}

/* Put fixed top nav bar on lower z-index so lightboxes (like on /worship-videos) appear above the header */

#main-header {
  z-index: 10;
}

/* Restore focus rings/outlines */

:root {
  --purc-color-cta-hue: 208deg;
  --purc-color-cta-text: hsl(var(--purc-color-cta-hue) 72% 43%);
  --purc-color-cta-rule: hsl(var(--purc-color-cta-hue) 72% 48%);
  --purc-focus-outline-style-without-offset: 2px solid
    var(--purc-color-cta-rule);
  --purc-focus-outline-offset: 2px;
}

:focus-visible {
  outline: var(--purc-focus-outline-style-without-offset);
  outline-offset: var(--purc-focus-outline-offset);
}

/* Fix button ::after element so CSS content isn't spoken by some screen readers */

/* prettier-ignore */
.et_pb_button:after,
.et_pb_button:before {
  content: "\35" / " "; /* alt text appears after the slash; note the empty space is necessary */
}

/* Fix nested ol styling */

#left-area ol,
.entry-content ol,
.et-l--body ol,
.et-l--footer ol,
.et-l--header ol {
  list-style-position: unset;
  padding-inline-start: 2em;
}

ol li > ol li {
  list-style-type: lower-alpha;
}

:is(#left-area, .entry-content) ol li > ol {
  padding-bottom: 0;
}

/* Fix 'Links rely on color to be distinguishable' */

/**
 * Specifying IDs as below instead of using # reduces
 * the specificity of the selector, so class selectors
 * can override them, which we want here.
 */
[id='main-content'] a {
  text-decoration: underline;
  text-underline-offset: 0.1em;
}

[id='main-content'] a[class*='button'] {
  /* if class name includes 'button', don't add underlines */
  text-decoration: none;
}

/* Fix broken icon fonts */

/**
 * For unknown reasons the Divi icon fonts occasionally
 * don't seem to load properly because the dynamic way
 * they load causes the IP address to be used instead
 * of the domain name. This brittle fix just uses relative
 * links to the assets in the Divi directory.
 */

@font-face {
  font-family: ETmodules;
  font-display: block;
  src: url(../Divi/core/admin/fonts/modules/all/modules.eot);
  src: url(../Divi/core/admin/fonts/modules/all/modules.eot?#iefix)
      format('embedded-opentype'),
    url(../Divi/core/admin/fonts/modules/all/modules.woff) format('woff'),
    url(../Divi/core/admin/fonts/modules/all/modules.ttf) format('truetype'),
    url(../Divi/core/admin/fonts/modules/all/modules.svg#ETmodules)
      format('svg');
  font-weight: 400;
  font-style: normal;
}

/** 
 * Make parent nav item appear active on child pages
 * (e.g. 'For Members' on For Members child pages) 
 */

:is(#top-menu, #mobile_menu) li.current-page-ancestor > a {
  color: var(--purc-color-cta-text) !important;
}

/* Edit password-protect page styles - MJ 2025-09-02 */

.post-password-required .et_password_protected_form { /* reduce max-width */
  max-width:48rem;
}

.et_password_protected_form p input { /* Restore form input field to more familiar styling than gray box */
  background-color: #fafafa;
  border: 2px solid #bbb !important;
  border-radius: 0.5em !important;
  box-shadow: inset 0 0px 0 2px rgb(0 0 0 / 0.1);
  transition: border 0.2s linear;
  font-size: 22px;
  padding: 0.5em !important;
  color: #444 !important;
}

.et_password_protected_form p :is(input:hover, input:focus-visible) {
  border: 2px solid #444 !important;
}
