/*
 Theme Name:     SWANA NLC Child
 Theme URI:      https://swananorthernlights.org/
 Description:    SWANA NLC Child Theme
 Author:         SWANA NLC
 Author URI:     https://swananorthernlights.org/
 Template:       Divi
 Version:        1.0.0
*/

/* ============================================================
   Base Typography / Spacing
   ============================================================ */

p {
  margin-bottom: 5px !important;
}

h2 + p {
  margin-top: 5px;
}

ul + p {
  margin-top: -15px;
}

ul.sub-menu {
  margin-top: -30px;
}

/* ============================================================
   Posts & Blog Posts
   ============================================================ */

/* ============================================================
   News / Events Sidebar
   ============================================================ */

.news-sidebar .et_pb_post {
    margin-bottom: 20px !important;
    padding-bottom: 0 !important;
}

.news-sidebar .et_pb_post:last-child {
    margin-bottom: 0 !important;
}

/* ============================================================
   News / Events Grid
   ============================================================ */

.news-grid .et_pb_post {
    margin-bottom: 15px !important;
    margin-left: 7px !important;
    margin-right: 7px !important;
}

/* ============================================================
   Custom Dividers
   ============================================================ */

.custom-hr-dark {
  border: none;
  height: 1px;
  background-color: #555e6f;
  margin: -6px 0 10px;
}

.custom-hr-light {
  border: none;
  height: 1px;
  background-color: #ffffff;
  width: 70%;
  margin: 6px 0 10px auto;
}

/* ============================================================
   SWANA Unified Action Buttons
   Applies to:
   - Gravity Forms submit buttons
   - MemberPress checkout buttons
   - Existing attendee action links
   ============================================================ */

#gform_submit_button_9,
#gform_submit_button_7,
.mepr-submit,
.swana-summary-actions .swana-btn {
  display: inline-block;
  background: #1AAF8A;
  color: #ffffff !important;
  font-family: 'Urbanist', Helvetica, Arial, Lucida, sans-serif !important;
  font-size: 14px;
  font-weight: 600 !important;
  border: 1px solid #1AAF8A;
  border-radius: 3px;
  padding: 10px 30px !important;
  text-decoration: none !important;
  transition: all 300ms ease-in-out;
  cursor: pointer;
  line-height: 1.4;
}

#gform_submit_button_9:hover,
#gform_submit_button_7:hover,
.mepr-submit:hover,
.swana-summary-actions .swana-btn:hover {
  background: #ffffff;
  color: #1AAF8A !important;
  border-color: #1AAF8A;
  text-decoration: none !important;
}

/* Secondary / alternate action buttons */
.swana-summary-actions .swana-btn-secondary {
  background: #ffffff;
  color: #1AAF8A !important;
}

.swana-summary-actions .swana-btn-secondary:hover {
  background: #f4f4f4;
}

/* Ensure Form 9 submit is visible and clickable */
#gform_wrapper_9 .gform_footer,
#gform_wrapper_9 .gform_page_footer {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  overflow: visible !important;
}

#gform_wrapper_9 #gform_submit_button_9 {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* ============================================================
   MemberPress / MemberPress Courses
   ============================================================ */

/* Hide MemberPress Courses progress bar */
.mpcs-section {
  display: none !important;
}

.mpcs-cards * {
  border-radius: 10px;
}

.mepr-price-box {
  background-color: #ffffff;
  border-radius: 15px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 15px;
  margin-bottom: 15px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.mepr-price-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Hide native MemberPress "Back to home" link on thank-you page */
.mepr-thank-you-page .mp_wrapper a.mepr-btn {
  display: none !important;
}

/* ============================================================
   Divi / Theme Builder
   ============================================================ */

.et_pb_slider .et_pb_container {
  margin: 0 !important;
}

/* Admin labels visible only in Divi Theme Builder */
body:not(.et-fb) .mpem-admin-label {
  display: none !important;
}

/* Always visible while editing in Divi Builder */
body.et-fb .gf-step1-wrap,
body.et-fb .mp-checkout-wrap {
  display: block !important;
}

/* ============================================================
   Registration Flow Toggle
   Step 1 = Gravity Forms
   Step 2 = MemberPress checkout
   ============================================================ */

/* Default product-page state */
body.single-memberpressproduct .gf-step1-wrap {
  display: block;
}

body.single-memberpressproduct .mp-checkout-wrap {
  display: none;
}

/* Step 2 state: after Form 7 submit or active checkout */
body.single-memberpressproduct.swana-profile-done .gf-step1-wrap,
body.single-memberpressproduct.mepr-checkout-active .gf-step1-wrap {
  display: none !important;
}

body.single-memberpressproduct.swana-profile-done .mp-checkout-wrap,
body.single-memberpressproduct.mepr-checkout-active .mp-checkout-wrap {
  display: block !important;
}

/* Failsafe: hide Form 7 wrapper in Step 2 */
body.single-memberpressproduct.swana-profile-done #gform_wrapper_7,
body.single-memberpressproduct.mepr-checkout-active #gform_wrapper_7 {
  display: none !important;
}

/* Hide profile search in Step 2 */
body.single-memberpressproduct.swana-profile-done .profile-search-wrap,
body.single-memberpressproduct.mepr-checkout-active .profile-search-wrap {
  display: none !important;
}

/* ============================================================
   Registrant Search / Profile Toggle
   ============================================================ */

/* Default on product pages: show search, hide registration form */
body.single-memberpressproduct .profile-search-wrap {
  display: block !important;
}

body.single-memberpressproduct .course-registration-wrap {
  display: none !important;
}

/* After lookup or new-attendee selection */
body.single-memberpressproduct.swana-existing-registrant .profile-search-wrap,
body.single-memberpressproduct.swana-new-registrant .profile-search-wrap {
  display: none !important;
}

body.single-memberpressproduct.swana-existing-registrant .course-registration-wrap,
body.single-memberpressproduct.swana-new-registrant .course-registration-wrap {
  display: block !important;
}

/* Existing attendee: hide native Form 7 footer/button */
body.swana-existing-registrant #gform_wrapper_7 .gform_footer,
body.swana-existing-registrant #gform_wrapper_7 .gform_page_footer,
body.swana-existing-registrant #gform_submit_button_7 {
  display: none !important;
}

/* ============================================================
   Locked / Prefilled Gravity Forms Fields
   Add class 'swana-lock-if-filled' to fields that should lock
   when prefilled.
   ============================================================ */

.swana-locked {
  opacity: 0.65 !important;
}

.swana-lock-if-filled {
  opacity: 0.9;
}

.swana-lock-if-filled .ginput_container input.swana-locked,
.swana-lock-if-filled .ginput_container textarea.swana-locked,
.swana-lock-if-filled .ginput_container select.swana-locked {
  background: #f3f3f3 !important;
}

/* ============================================================
   SWANA Existing Attendee Summary / Action Buttons
   ============================================================ */

.swana-summary {
  margin-top: 10px;
}

.swana-summary-actions {
  margin-top: 24px;
}

.swana-action-row {
  margin: 10px 0;
}

.swana-action-or,
.swana-summary-actions .swana-or {
  margin: 12px 0;
  opacity: 0.8;
  font-family: 'Urbanist', Helvetica, Arial, Lucida, sans-serif;
  font-size: 14px;
  font-weight: 600;
}

/* ============================================================
   SWANA Gravity Forms Focus / Selected State
   ============================================================ */

/* Text inputs, selects, textareas */
.gform_wrapper input:focus,
.gform_wrapper select:focus,
.gform_wrapper textarea:focus {
  border-color: #1AAF8A !important;
  box-shadow: 0 0 0 1px #1AAF8A !important;
  outline: none !important;
}

/* Radio buttons + checkboxes */
.gform_wrapper input[type="radio"]:checked,
.gform_wrapper input[type="checkbox"]:checked {
  accent-color: #1AAF8A;
}

/* Multi-page progress / active states (optional) */
.gform_wrapper .gf_step_active .gf_step_number,
.gform_wrapper .gf_step_completed .gf_step_number {
  background: #1AAF8A !important;
  border-color: #1AAF8A !important;
}

/* ========================================================+==============
   SWANA Gravity Forms Conditional Address — three-column conditional row
   ======================================================================= */

/* Form 7: Home Address — three-column conditional row */
@media (min-width: 768px) {

    /* Column 1: Province or State */
    #field_7_70,
    #field_7_115 {
        grid-column: span 4;
    }

    /* Column 2: Postal Code or ZIP Code */
    #field_7_30,
    #field_7_116 {
        grid-column: span 4;
    }

    /* Column 3: Preferred Address */
    #field_7_47 {
        grid-column: span 4;
    }
}

/* Stack fields on mobile */
@media (max-width: 767px) {
    #field_7_70,
    #field_7_115,
    #field_7_30,
    #field_7_116,
    #field_7_47 {
        grid-column: 1 / -1;
    }
}

/* Form 7: Employer / Business Address — three-column conditional row */
@media (min-width: 768px) {

    /* Column 1: Country */
    #field_7_73 {
        grid-column: span 4;
    }

    /* Column 2: Province or State */
    #field_7_72,
    #field_7_118 {
        grid-column: span 4;
    }

    /* Column 3: Postal Code or ZIP Code */
    #field_7_41,
    #field_7_119 {
        grid-column: span 4;
    }
}

/* Stack these fields on mobile */
@media (max-width: 767px) {
    #field_7_73,
    #field_7_72,
    #field_7_118,
    #field_7_41,
    #field_7_119 {
        grid-column: 1 / -1;
    }
}

/* ============================================================
   Conference Proceedings 
   ============================================================ */

/* Image Styles */
.conference-proceedings-template img {
    max-width: 250px;
    height: auto;
}



/* ============================================================
   Optional / Disabled
   ============================================================ */

/*
Fixed-header body offset:
#page-container {
  padding-top: 115px;
}

Tighten spacing above lists:
p + ul {
  margin-top: -25px;
}
*/
