/**
 * Jameya compatibility and contrast safeguards.
 *
 * Loaded after Wise shortcode styles so configurable theme colors remain
 * readable even when an accent and its "light" variant are identical.
 */

:root {
    --primary-color-soft-safe: #e1ece8;
    --primary-color-soft-safe: color-mix(in srgb, var(--primary-color) 12%, var(--body-bg-color));
    --primary-color-readable: #2c6455;
    --primary-color-readable: color-mix(in srgb, var(--primary-color) 62%, #10231d);
    --heading-color-readable: #254f43;
    --heading-color-readable: color-mix(in srgb, var(--heading-color) 68%, #101b17);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--heading-color-readable);
}

.section-subtitle,
.news-card-category a,
.accordion-button:not(.collapsed),
.about-image-placeholder,
.pdf-card__pdf-icon {
    background-color: var(--primary-color-soft-safe) !important;
}

.section-subtitle,
.news-card-category a,
.accordion-button:not(.collapsed),
.about-image-placeholder i,
.pdf-card__pdf-icon i,
.pdf-card__download,
.btn-light,
.btn-light:hover {
    color: var(--primary-color-readable) !important;
}

.main-navigation .menu-item > a:hover,
.main-navigation .menu-item.active > a,
.main-navigation .sub-menu .menu-item > a:hover {
    background-color: var(--primary-color-soft-safe);
    color: var(--primary-color-readable);
}

.site-header.header-transparent .main-navigation .menu-item > a:hover,
.site-header.header-transparent .main-navigation .menu-item.active > a,
.site-header.header-colored .main-navigation .menu-item > a:hover,
.site-header.header-colored .main-navigation .menu-item.active > a {
    background-color: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.btn-primary {
    color: var(--button-primary-text-safe);
}

.btn-primary:hover,
.btn-outline-primary:hover,
.tag-link:hover {
    color: var(--primary-color-hover-text-safe);
}

.btn-secondary {
    color: var(--button-secondary-text-safe);
}

.btn-secondary:hover {
    color: var(--secondary-color-hover-text-safe);
}

.header-btn {
    color: var(--header-button-text-safe);
}

.header-btn:hover,
.header-btn:focus-visible {
    color: var(--header-button-text-hover-safe);
}

.donation-amount-btn:hover,
.donation-amount-btn.active {
    color: var(--secondary-color-text-safe);
}

/* Wise shortcodes inherit Jameya colors but need their own contrast layer. */
.wise-shortcode .wise-card__icon,
.wise-shortcode .wise-team__social a,
.wise-shortcode .wise-badge,
.wise-shortcode .eyebrow,
.wise-shortcode .wise-eyebrow,
.wise-shortcode .section-header__eyebrow,
.wise-shortcode .wise-hero__title em,
.wise-shortcode .wise-hero__title .accent {
    background: var(--primary-color-soft-safe) !important;
    color: var(--primary-color-readable) !important;
}

.wise-shortcode .wise-card__icon > i,
.wise-shortcode .wise-card__icon > i::before {
    color: inherit !important;
}

.wise-shortcode .wise-card__link,
.wise-shortcode .wise-post-card__cta,
.wise-shortcode .wise-post-card__title a,
.wise-shortcode .wise-testimonial__name,
.wise-shortcode .wise-timeline__title,
.wise-shortcode .wise-pricing__title,
.wise-shortcode .wise-pricing__price,
.wise-shortcode .text-primary-wise {
    color: var(--primary-color-readable) !important;
}

.wise-shortcode .section-header__title,
.wise-shortcode .wise-card__title,
.wise-shortcode .wise-section-title,
.wise-shortcode .section-title {
    color: var(--heading-color-readable) !important;
}

.wise-shortcode .btn-wise-primary,
.wise-shortcode .btn-primary {
    color: var(--button-primary-text-safe) !important;
}

.wise-shortcode .btn-wise-primary:hover,
.wise-shortcode .btn-wise-primary:focus,
.wise-shortcode .btn-primary:hover,
.wise-shortcode .btn-primary:focus {
    color: var(--primary-color-hover-text-safe) !important;
}

.wise-shortcode .btn-wise-secondary,
.wise-shortcode .btn-secondary {
    color: var(--button-secondary-text-safe) !important;
}

.wise-shortcode .btn-wise-secondary:hover,
.wise-shortcode .btn-wise-secondary:focus,
.wise-shortcode .btn-secondary:hover,
.wise-shortcode .btn-secondary:focus {
    color: var(--secondary-color-hover-text-safe) !important;
}

.wise-shortcode .wise-card--dark .wise-card__icon,
.wise-shortcode .wise-band--dark .wise-card__icon,
.wise-shortcode .wise-hero--dark .wise-card__icon {
    background: rgba(255, 255, 255, 0.14) !important;
    color: #ffffff !important;
}

.wise-shortcode .wise-card--dark .wise-card__title,
.wise-shortcode .wise-band--dark .section-header__title,
.wise-shortcode .wise-hero--dark .wise-hero__title {
    color: #ffffff !important;
}

/**
 * Jameya presentation layer for Wise shortcodes.
 *
 * Keep the flexible Wise markup while matching the compact, civic visual
 * language used by Jameya's original association sections.
 */
.wise-shortcode {
    --jameya-card-border: rgba(48, 115, 97, 0.12);
    --jameya-card-shadow: 0 12px 32px rgba(31, 82, 68, 0.08);
    --jameya-card-shadow-hover: 0 18px 42px rgba(31, 82, 68, 0.14);
    --jameya-section-space: clamp(58px, 7vw, 88px);
    overflow: clip;
}

/* Shortcode content must remain visible if AOS is delayed or blocked in production. */
.wise-shortcode [data-aos] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    visibility: visible !important;
}

.wise-shortcode > section:not(.wise-hero-slider):not(.wise-hero) {
    min-height: auto !important;
}

.wise-shortcode > section:not(.wise-band):not(.wise-stats):not(.wise-hero-slider):not(.wise-hero) {
    background-color: #ffffff;
}

.wise-shortcode .pt-wise-section-lg,
.wise-shortcode .pt-wise-section-xl {
    padding-top: var(--jameya-section-space) !important;
}

.wise-shortcode .pb-wise-section-lg,
.wise-shortcode .pb-wise-section-xl {
    padding-bottom: var(--jameya-section-space) !important;
}

.wise-shortcode .wise-band {
    padding-block: 0;
}

.wise-shortcode .section-header {
    position: relative;
    max-width: 760px;
    margin-bottom: clamp(28px, 4vw, 44px) !important;
    padding-bottom: 17px;
}

.wise-shortcode .section-header::after {
    content: "";
    position: absolute;
    inset-inline-start: 50%;
    bottom: 0;
    width: 64px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: translateX(50%);
}

[dir="ltr"] .wise-shortcode .section-header::after {
    transform: translateX(-50%);
}

.wise-shortcode .section-header__title,
.wise-shortcode > section > .container > .d-flex h2 {
    font-size: clamp(1.8rem, 3.2vw, 2.55rem) !important;
    line-height: 1.25 !important;
    margin-bottom: 10px !important;
}

.wise-shortcode .section-header__subtitle {
    margin-bottom: 0 !important;
}

.wise-shortcode > section > .container > .d-flex {
    margin-bottom: clamp(28px, 4vw, 44px) !important;
}

.wise-shortcode > section > .container > .d-flex > div {
    max-width: 720px;
}

.wise-shortcode .eyebrow,
.wise-shortcode .wise-eyebrow,
.wise-shortcode .section-header__eyebrow {
    text-transform: none !important;
    letter-spacing: normal !important;
}

/* Image and text / about */
.wise-shortcode .wise-imagetext {
    gap: clamp(32px, 6vw, 76px);
}

.wise-shortcode .wise-imagetext__image {
    position: relative;
    isolation: isolate;
    overflow: visible;
    min-height: 320px;
    border-radius: 20px;
    background: var(--primary-color-soft-safe);
}

.wise-shortcode .wise-imagetext__image::before {
    content: "";
    position: absolute;
    inset: 24px -18px -18px 24px;
    z-index: -1;
    border-radius: 22px;
    background: var(--primary-color-soft-safe);
}

.wise-shortcode .wise-imagetext__image img {
    width: 100%;
    height: clamp(320px, 34vw, 470px);
    border-radius: 20px;
    object-fit: cover;
    box-shadow: var(--jameya-card-shadow);
}

.wise-shortcode .wise-imagetext__content h2 {
    position: relative;
    margin-bottom: 22px;
    padding-bottom: 14px;
    font-size: clamp(1.8rem, 3vw, 2.55rem) !important;
}

.wise-shortcode .wise-imagetext__content h2::after {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    bottom: 0;
    width: 58px;
    height: 3px;
    border-radius: 999px;
    background: var(--secondary-color);
}

.wise-shortcode .wise-imagetext__content .ck-content {
    color: var(--text-color);
    font-size: 1.05rem;
    line-height: 1.9;
}

/* Services and reusable cards */
.wise-shortcode .wise-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 250px;
    padding: 28px 26px !important;
    border: 1px solid var(--jameya-card-border) !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    box-shadow: var(--jameya-card-shadow) !important;
}

.wise-shortcode .wise-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    border-radius: 16px 16px 0 0;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.25s ease;
}

.wise-shortcode .wise-card:hover {
    transform: translateY(-6px) !important;
    border-color: rgba(48, 115, 97, 0.26) !important;
    box-shadow: var(--jameya-card-shadow-hover) !important;
}

.wise-shortcode .wise-card:hover::before {
    opacity: 1;
}

.wise-shortcode .wise-card__icon {
    width: 58px !important;
    height: 58px !important;
    margin-bottom: 20px !important;
    border: 1px solid rgba(48, 115, 97, 0.12);
    border-radius: 50% !important;
    font-size: 23px !important;
}

.wise-shortcode .wise-card__title {
    margin-bottom: 10px !important;
    font-size: 1.25rem !important;
    line-height: 1.5 !important;
}

.wise-shortcode .wise-card__text {
    flex: 1;
    color: var(--text-color) !important;
    line-height: 1.8;
}

.wise-shortcode .wise-card__media,
.wise-shortcode .wise-card > div[style*="aspect-ratio"] {
    aspect-ratio: 16 / 9 !important;
    border-radius: 12px !important;
}

.wise-shortcode .wise-card__media img,
.wise-shortcode .wise-card > div[style*="aspect-ratio"] img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wise-shortcode .wise-card__text {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.wise-shortcode .wise-card__link {
    width: fit-content;
    margin-top: 18px;
}

/* Statistics */
.wise-shortcode > .wise-stats {
    position: relative;
    background:
        radial-gradient(circle at 12% 10%, rgba(255, 255, 255, 0.1), transparent 27%),
        radial-gradient(circle at 88% 90%, rgba(241, 194, 50, 0.12), transparent 24%),
        var(--section-bg-dark) !important;
}

.wise-shortcode > .wise-stats::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 34px 34px;
}

.wise-shortcode .wise-stats .container {
    position: relative;
}

.wise-shortcode .wise-stats .section-header__title {
    color: #ffffff !important;
}

.wise-shortcode .wise-stats .section-header__subtitle {
    color: rgba(255, 255, 255, 0.78) !important;
}

.wise-shortcode .wise-stats .wise-stats__item {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 18px !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    box-shadow: none !important;
    backdrop-filter: blur(8px);
}

.wise-shortcode .wise-stats .wise-stats__item:hover {
    transform: translateY(-5px) !important;
    background: rgba(255, 255, 255, 0.15) !important;
}

.wise-shortcode .wise-stats .wise-stats__item i {
    color: var(--secondary-color) !important;
}

.wise-shortcode .wise-stats .wise-stats__number {
    margin-bottom: 8px;
    color: #ffffff !important;
    font-size: clamp(2.2rem, 4vw, 3.5rem) !important;
}

.wise-shortcode .wise-stats .wise-stats__number .suffix {
    color: var(--secondary-color) !important;
}

.wise-shortcode .wise-stats .wise-stats__label {
    color: rgba(255, 255, 255, 0.84) !important;
}

/* Testimonials */
.wise-shortcode .wise-testimonial {
    position: relative;
    min-height: 270px;
    padding: 32px 28px 26px !important;
    border: 1px solid var(--jameya-card-border) !important;
    border-radius: 16px !important;
    box-shadow: var(--jameya-card-shadow) !important;
}

.wise-shortcode .wise-testimonial::before {
    content: "\201C";
    position: absolute;
    inset-inline-end: 22px;
    top: 8px;
    color: var(--primary-color-soft-safe);
    font-family: Georgia, serif;
    font-size: 5.5rem;
    font-weight: 700;
    line-height: 1;
}

.wise-shortcode .wise-testimonial__rating,
.wise-shortcode .wise-testimonial__content,
.wise-shortcode .wise-testimonial__author {
    position: relative;
}

.wise-shortcode .wise-testimonial__content {
    min-height: 95px;
    line-height: 1.9 !important;
}

.wise-shortcode .wise-testimonial__avatar {
    width: 54px;
    height: 54px;
    border: 3px solid var(--primary-color-soft-safe);
}

/* News */
.wise-shortcode .wise-post-card {
    border: 1px solid var(--jameya-card-border) !important;
    border-radius: 16px !important;
    box-shadow: var(--jameya-card-shadow) !important;
}

.wise-shortcode .wise-post-card:hover {
    transform: translateY(-6px) !important;
    box-shadow: var(--jameya-card-shadow-hover) !important;
}

.wise-shortcode .wise-post-card__image {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    background:
        radial-gradient(circle at 70% 25%, rgba(255, 255, 255, 0.62), transparent 28%),
        linear-gradient(135deg, var(--primary-color-soft-safe), #edf4f1);
}

.wise-shortcode .wise-post-card__image::before {
    content: "\f1ea";
    position: absolute;
    inset: 50% auto auto 50%;
    color: var(--primary-color-readable);
    font-family: "Font Awesome 6 Free";
    font-size: 2.25rem;
    font-weight: 900;
    opacity: 0.35;
    transform: translate(-50%, -50%);
}

.wise-shortcode .wise-post-card__image img {
    position: relative;
    z-index: 1;
    display: block;
    object-fit: cover;
}

.wise-shortcode img.is-broken,
.site-footer img.is-broken {
    display: none !important;
}

.wise-shortcode .wise-post-card:hover .wise-post-card__image img {
    transform: scale(1.04);
}

.wise-shortcode .wise-post-card__body {
    padding: 22px 22px 24px;
}

.wise-shortcode .wise-post-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.wise-shortcode .wise-post-card__meta .ms-2 {
    margin-inline-start: 0 !important;
}

.wise-shortcode .wise-post-card__title {
    margin-bottom: 10px;
    font-size: 1.18rem !important;
    line-height: 1.55;
}

.wise-shortcode .wise-post-card__excerpt {
    line-height: 1.75;
}

/* Partners */
.wise-shortcode .wise-partners__item {
    min-height: 138px;
    padding: 18px 14px;
    border: 1px solid var(--jameya-card-border) !important;
    border-radius: 14px !important;
    filter: none;
    box-shadow: 0 8px 24px rgba(31, 82, 68, 0.05) !important;
}

.wise-shortcode .wise-partners__item:hover {
    transform: translateY(-4px);
    border-color: rgba(48, 115, 97, 0.28) !important;
    box-shadow: var(--jameya-card-shadow) !important;
}

.wise-shortcode .wise-partners__logo img {
    max-height: 68px;
    filter: grayscale(0.12);
}

.wise-shortcode .wise-partners__name {
    color: var(--heading-color-readable);
}

@media (min-width: 992px) {
    .wise-shortcode > section > .container > .row {
        justify-content: center;
    }

    .wise-shortcode .wise-stats .row {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    }

    .wise-shortcode .wise-stats .row > * {
        width: auto;
        max-width: none;
    }

    .wise-shortcode .wise-partners .row {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .wise-shortcode .wise-partners .row > * {
        width: auto;
        max-width: none;
    }
}

/* Timeline */
.wise-shortcode .wise-timeline {
    max-width: 820px;
    margin-inline: auto;
    padding: 8px 46px 8px 0;
}

[dir="ltr"] .wise-shortcode .wise-timeline {
    padding: 8px 0 8px 46px;
}

.wise-shortcode .wise-timeline::before {
    top: 10px;
    bottom: 10px;
    inset-inline-start: 12px;
    width: 3px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary-color) 28%, transparent) !important;
}

.wise-shortcode .wise-timeline__item {
    margin-bottom: 18px;
    padding: 22px 24px;
    border: 1px solid var(--jameya-card-border);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(31, 82, 68, 0.05);
}

.wise-shortcode .wise-timeline__item:last-child {
    margin-bottom: 0;
}

.wise-shortcode .wise-timeline__dot {
    inset-inline-start: -43px;
    top: 27px;
    width: 18px;
    height: 18px;
    border-color: #ffffff !important;
}

.wise-shortcode .wise-timeline__title {
    margin-bottom: 7px;
    font-size: 1.15rem !important;
}

.wise-shortcode .wise-timeline__item .text-mute {
    color: var(--text-color) !important;
    line-height: 1.75;
}

.wise-shortcode .swiper-pagination {
    position: relative;
    bottom: auto !important;
    margin-top: 28px !important;
}

.wise-shortcode .swiper-pagination-bullet {
    width: 9px;
    height: 9px;
    opacity: 0.28;
}

.wise-shortcode .swiper-pagination-bullet-active {
    width: 24px;
    border-radius: 999px;
    opacity: 1;
}

@media (max-width: 991.98px) {
    .wise-shortcode .wise-imagetext__image {
        min-height: 280px;
    }

    .wise-shortcode .wise-imagetext__image img {
        height: clamp(280px, 70vw, 430px);
    }

    .wise-shortcode .wise-imagetext__image::before {
        inset: 16px -10px -10px 16px;
    }
}

@media (max-width: 767.98px) {
    .wise-shortcode {
        --jameya-section-space: 48px;
        overflow: hidden;
    }

    .wise-shortcode .section-header {
        margin-bottom: 28px !important;
    }

    .wise-shortcode .section-header__title,
    .wise-shortcode > section > .container > .d-flex h2,
    .wise-shortcode .wise-imagetext__content h2 {
        font-size: 1.75rem !important;
    }

    .wise-shortcode > section > .container > .d-flex {
        align-items: flex-start !important;
    }

    .wise-shortcode .wise-card {
        min-height: 0;
        padding: 24px 22px !important;
    }

    .wise-shortcode .wise-testimonial {
        min-height: 0;
    }

    .wise-shortcode .wise-testimonial__content {
        min-height: 0;
    }

    .wise-shortcode .wise-stats .wise-stats__item {
        min-height: 150px;
    }

    .wise-shortcode .wise-partners__item {
        min-height: 120px;
        padding: 14px 10px;
    }

    .wise-shortcode .wise-partners__logo img {
        max-height: 54px;
    }

    .wise-shortcode .wise-timeline {
        padding-inline-start: 32px;
    }

    .wise-shortcode .wise-timeline__item {
        padding: 18px;
    }

    .wise-shortcode .wise-timeline__dot {
        inset-inline-start: -29px;
        top: 23px;
    }
}
