/*
 * Project specific additions on top of the Crafto "blogger" theme.
 * The theme files themselves are left untouched so they can be updated.
 */

/* Logo lockup: the mark plus the name of the fund */
header .navbar-brand {
    padding: 12px 0;
}

header .navbar-brand img.site-logo {
    max-height: 58px;
    width: auto;
}

.navbar-brand .site-brand {
    font-size: 20px;
    letter-spacing: -0.5px;
}

.navbar-brand .site-brand-tagline {
    margin-top: 2px;
}

.footer-logo-image {
    max-height: 80px;
    width: auto;
}

@media (max-width: 991px) {
    header .navbar-brand img.site-logo {
        max-height: 46px;
    }

    .navbar-brand .site-brand {
        font-size: 17px;
    }
}

@media (max-width: 575px) {
    .navbar-brand .site-brand-text {
        display: none;
    }
}

/* Home page slider */
.hero-slider .carousel-item {
    height: clamp(360px, 62vh, 620px);
}

.hero-slider .carousel-image {
    height: 100%;
    object-fit: cover;
}

.hero-slider .carousel-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(23, 23, 23, 0.8) 0%, rgba(23, 23, 23, 0.35) 60%, rgba(23, 23, 23, 0.15) 100%);
}

.hero-slider .carousel-caption {
    right: auto;
    bottom: auto;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    text-align: left;
    padding: 0;
}

.hero-slider .carousel-indicators {
    margin-bottom: 24px;
}

.hero-slider .carousel-control-prev,
.hero-slider .carousel-control-next {
    width: 6%;
}

/* Rich text coming from the visual editor */
.page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.page-content figure {
    margin: 30px 0;
}

.page-content figure.image img {
    display: block;
    margin: 0 auto;
}

.page-content figure figcaption {
    margin-top: 10px;
    color: #828282;
    font-size: 14px;
    text-align: center;
}

.page-content figure.media,
.page-content .raw-html-embed {
    position: relative;
    margin: 30px 0;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.page-content figure.media iframe,
.page-content .raw-html-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 6px;
}

.page-content h2 {
    font-size: 28px;
    margin-top: 35px;
    margin-bottom: 15px;
}

.page-content h3 {
    font-size: 22px;
    margin-top: 30px;
    margin-bottom: 12px;
}

.page-content ul,
.page-content ol {
    margin-bottom: 20px;
    padding-left: 20px;
}

.page-content ul {
    list-style: disc;
}

.page-content ol {
    list-style: decimal;
}

.page-content li {
    margin-bottom: 8px;
}

.page-content blockquote {
    border-left: 3px solid var(--base-color, #c89666);
    padding-left: 20px;
    margin: 25px 0;
    color: #626262;
}

.page-content table {
    width: 100%;
    margin-bottom: 20px;
    border-collapse: collapse;
}

.page-content table td,
.page-content table th {
    border: 1px solid #e4e4e4;
    padding: 10px;
}

/* Cards in the news grid keep an even height */
.news-grid .card {
    height: 100%;
}

.news-grid .blog-image img {
    width: 100%;
    height: 240px;
    object-fit: cover;
}

.news-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 240px;
    background-color: #f4f2ee;
    color: #999;
    font-size: 14px;
}

/*
 * Fundraiser progress bar.
 *
 * Crafto restyles ".progress .progress-bar" as an absolutely positioned block
 * with no height of its own, which collapses the bar to nothing. These rules
 * put it back into the normal flow and give it the height of its track.
 */
.fundraiser-progress .progress {
    position: relative;
    display: block;
    height: 10px;
    background-color: #e6e2dd;
    border-radius: 6px;
    overflow: hidden;
}

.fundraiser-progress .progress .progress-bar {
    position: relative;
    top: auto;
    left: auto;
    display: block;
    height: 100%;
    min-height: 10px;
    border-radius: 6px;
    transition: width 0.4s ease;
}

.fundraiser-progress-compact .progress {
    height: 7px;
}

.fundraiser-progress-compact .progress .progress-bar {
    min-height: 7px;
}

.fundraiser-progress-compact .fw-700 {
    font-size: 15px;
}

/*
 * Page title bar with the fundraising picture behind it.
 * The photo is dark, so the text on top is white and a gradient keeps it
 * readable regardless of what part of the picture ends up behind the words.
 */
.page-title-banner {
    position: relative;
    padding-top: 90px;
    padding-bottom: 90px;
}

.page-title-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(20, 22, 20, 0.85) 0%, rgba(20, 22, 20, 0.55) 55%, rgba(20, 22, 20, 0.35) 100%);
}

@media (max-width: 991px) {
    .page-title-banner {
        padding-top: 60px;
        padding-bottom: 60px;
    }
}
