/*------------------------------------------------
Hero
------------------------------------------------*/
.hero.election {
    background-image: url("https://ahead.africa/wp-content/uploads/2024/09/shapes-tile-blue.svg");
}

.hero .back-button a,
.hero .back-button a strong {
    background-color: #ffffff;
    color: #2d83f5;
    font-weight: 600; /* Ensures bold for both the link and strong text */
    transition: scale 0.25s ease;
}
.hero.election .wp-block-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-height: 300px;
}
.hero.election :is(figure, img) {
    height: 100%;
	max-height: 270px;
    object-fit: contain !important;
}

.hero-nav {
    --_hero-nav-height: 40px;

    position: absolute;
    inset: 10px 10px auto;
    min-height: var(--_hero-nav-height);
    margin: 0;
}

@media screen and (max-width: 590px) {
    .hero-nav {
        position: static;
    }
    .hero-nav .wp-block-buttons {
        position: absolute;
        inset: 10px auto auto 10px;
    }
}
.hero .back-button a {
    background-color: #ffffff;
    color: #2d83f5;
   
    transition: scale 0.25s ease;
}
.hero .back-button a::before {
    content: '‹ ';
    font-size: 1.25em;
    line-height: 1;
}
.hero .back-button a:hover {
    opacity: 0.9;
}

.hero .wp-block-post-featured-image img {
	max-height: 300px;
}

@media screen and (max-width: 782px) {
    .hero.election {
        padding-bottom: var(--wp--preset--spacing--60) !important;
    }
    .hero.election .wp-block-columns {
        gap: 8px;
    }
    .hero.election h2.wp-block-heading {
        margin-top: 0px;
    }
}

/*------------------------------------------------
Observers
------------------------------------------------*/
.observer-divider,
.resources-divider {
    background-color: transparent !important;
    margin-top: calc(var(--_min-height) * -1);
}
.observer-divider .shape,
.resources-divider .shape {
    position: absolute;
    right: 0;
    top: 5%;
    translate: 0 -50%;
    max-width: clamp(40px, 6%, 85px);
    z-index: 1;
}
.resources-divider .shape {
	top: 50%;
	max-width: clamp(76px, 11%, 104px);
}

.observers-wrapper {
    margin: 0;
}
.observers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
}
.observer img {
    max-height: 80px;
    max-width: 100%;
}
.observer {
    filter: grayscale(1);
    transition: filter 0.3s ease;
}
.observer:hover {
    filter: grayscale(0);
}

.observers-wrapper:not(:has(.observer)),
.wp-site-blocks:not(:has(.observers-wrapper .observer)) .observer-divider,
.recommendations:not(:has(.entry-content > *)),
body:not(:has(.recommendations .entry-content > *)) .recommendations-divider,
.gallery-wrapper:not(:has(img)),
body:not(:has(.observers-wrapper img)) .observer-divider,
body:not(:has(.main-findings)) .resources-divider,
.main-findings-section:not(:has(.main-findings)),
.resources-section:not(:has(.resource-wrapper)) {
	display: none;
}

/*------------------------------------------------
Main Findings
------------------------------------------------*/
.main-findings {
    --_transition-duration: 0.2s;
    --_accordion-spacing: 0;

    background-color: transparent;
    border-radius: 0;
    transition: background-color var(--_transition-duration) ease;
    position: relative;
    margin: var(--_accordion-spacing) 0;
    padding: 0.5rem 0;
    max-width: none;
    border: 0px solid #0000001A;
    border-top-width: 1px;
}
.main-findings:last-of-type {
    border-bottom-width: 1px;
}
.main-findings > summary {
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
	cursor: pointer;
}
.main-findings[open] > summary {
    color: var(--wp--preset--color--text);
    transition: color var(--_transition-duration) ease;
}
.main-findings > summary .toggle-icon {
    font-weight: 100;
    color: var(--wp--preset--color--background);
    position: relative;
    width: 26px;
    background-color: var(--wp--preset--color--primary);
    aspect-ratio: 1;
    text-align: center;
    border-radius: 50%;
    pointer-events: none;
}

.main-findings > summary .toggle-icon::before,
.main-findings > summary .toggle-icon::after {
    content: '';
    width: 40%;
    height: 1px;
    position: absolute;
    inset: 50%;
    translate: -50% -50%;
    background-color: var(--wp--preset--color--background);
    transition: width 0.2s ease;
}
.main-findings > summary .toggle-icon::after {
    rotate: 90deg;
}
.main-findings[open] > summary .toggle-icon::after {
    width: 0%;
}

.recommendations-divider .shape {
    position: absolute;
    left: 0;
    top: 7%;
    translate: 0 -50%;
    max-width: clamp(40px, 6%, 85px);
    z-index: 1;
}
@media screen and (max-width: 600px) {
	.recommendations-divider .shape {
		top: 10%;
	}
}

/*------------------------------------------------
Resources
------------------------------------------------*/
.resource-wrapper {
    --_gap: 0.8rem;
    --_padding: 1rem;

    display: flex;
    background-color: var(--wp--preset--color--background);
    padding: var(--_padding);
    border-radius: var(--border-radius);
    gap: var(--_gap);
}
.resource {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--_gap);
    border-radius: var(--border-radius);
    background-color: var(--wp--preset--color--background);
}
.resource * {
    margin: 0;
}
.resource .title-wrapper {
    flex-grow: 1;
}
.resource .title-wrapper h3 {
    margin-block-end: 10px;
}
.resource .apply-by {
    color: var(--wp--preset--color--primary);
}
.resource-wrapper .opportunities-post-button .wp-element-button {
    background-color: var(--wp--preset--color--tertiary);
    color: var(--wp--preset--color--text);
}

@media screen and (max-width: 850px) {
    .resource-wrapper {
        background-color: transparent;
        flex-direction: column;
		padding-block: 5px;
    }
    .resource {
        padding: var(--_padding);
        flex-direction: column;
    }
    .resource > *,
    .resource-wrapper :is(.opportunities-post-button, .wp-element-button) {
        width: 100%;
    }
}

/*------------------------------------------------
CTA
------------------------------------------------*/
.cta.hero {
    background-image: url("https://ahead.africa/wp-content/uploads/2024/10/shapes-tile-yellow.svg");
    margin: 0;
}
.cta-divider {
    --_min-height: 50px;
    background-color: transparent !important;
	margin-top: 5rem;
    margin-bottom: calc(var(--_min-height) * -1);
}
.cta-divider .shape {
    position: absolute;
    left: 0;
    top: 5%;
    translate: 0 -50%;
    max-width: clamp(40px, 6%, 70px);
    z-index: 1;
}

/*------------------------------------------------
Gallery Slider
------------------------------------------------*/
.gallery-wrapper {
    margin: 0;
}

.election-gallery-slider .swiper-slide {
    height: auto;
}
.election-gallery-slider .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    padding: 0;
	border-radius: 15px;
}

.election-gallery-slider.election-gallery-slider {
    --_pagination-height: 2rem;
    --_pagination-size: 10px;
    --_pagination-large-size: 15px;

    padding-bottom: calc(var(--_pagination-height) + 1rem);
}
.election-gallery-slider .number {
    font-size: 4rem;
    font-weight: bold;
}
.election-gallery-slider .swiper-pagination {
    height: var(--_pagination-height);
    border-radius: 500px;
}
.election-gallery-slider .swiper-horizontal > .swiper-pagination-bullets,
.election-gallery-slider .swiper-pagination-bullets.swiper-pagination-horizontal {
	line-height: var(--_pagination-size);
	top: auto;
	bottom: 0;
    left: 50%;
    translate: -50% 0%;
    width: fit-content;
    background-color: var(--wp--preset--color--background);
}
.election-gallery-slider .swiper-pagination-bullet {
	background-color: var(--wp--preset--color--background);
	border-radius: 50px;
	height: var(--_pagination-size);
    width: fit-content;
	outline: none;
    padding: 7px 10px;
    border-radius: 500px;
    transition: background-color 0.25s ease, opacity 0.25s ease, color 0.25s ease;
}
.election-gallery-slider .swiper-pagination-bullet-active {
	scale: 1;
    background-color: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--background);
}
.election-gallery-slider .swiper-pagination-bullet:not(.swiper-pagination-bullet-active):hover {
    background-color: var(--wp--preset--color--primary-alt);
    color: var(--wp--preset--color--);
    opacity: 0.7;
}
@media screen and (max-width: 850px) {
	.gallery-slider-wrapper {
		padding-left: 0 !important;
		padding-right: 0 !important;
	}
	.election-gallery-slider.election-gallery-slider {
		padding-bottom: 0;
	}
	.election-gallery-slider .swiper-pagination-bullets.swiper-pagination-horizontal {
		flex-wrap: wrap;
		width: 100%;
		border-radius: 12px;
		position: static;
		translate: 0;
		height: fit-content;
		margin-top: 1rem;
		background-color: transparent;
		--swiper-pagination-bullet-inactive-opacity: 0.5;
	}
}

/* Override heading colors in election hero sections */
.hero.election h1,
.hero.election h2,
.hero.election .wp-block-heading {
    color: #ffffff !important;
}

/* Also target the date text if it's not in a heading */
.hero.election p,
.hero.election .wp-block-paragraph {
    color: #ffffff;
}