/*
Theme Name: Miyetu Tree Foundation
Theme URI: https://miyetutree.org
Author: Miyetu Tree Foundation
Author URI: https://miyetutree.org
Description: Custom WordPress theme for Miyetu Tree Foundation, a grassroots tree-planting and ICT-skills organisation in Kawangware, Nairobi.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: miyetu
Tags: one-column, two-columns, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* --- Base template CSS below --- */
/********** Template CSS **********/
:root {
    --primary: #348E38;
    --secondary: #525368;
    --light: #E8F5E9;
    --dark: #0F4229;
}

.back-to-top {
    position: fixed;
    display: none;
    right: 30px;
    bottom: 30px;
    z-index: 99;
}

h1,
.h1,
h2,
.h2,
.fw-bold {
    font-weight: 700 !important;
}

h3,
.h3,
h4,
.h4,
.fw-medium {
    font-weight: 600 !important;
}

h5,
.h5,
h6,
.h6,
.fw-semi-bold {
    font-weight: 500 !important;
}


/*** Spinner ***/
#spinner {
    opacity: 0;
    visibility: hidden;
    transition: opacity .5s ease-out, visibility 0s linear .5s;
    z-index: 99999;
}

#spinner.show {
    transition: opacity .5s ease-out, visibility 0s linear 0s;
    visibility: visible;
    opacity: 1;
}


/*** Button ***/
.btn {
    transition: .5s;
    font-weight: 500;
}

.btn-primary,
.btn-outline-primary:hover {
    color: var(--light);
}

.btn-square {
    width: 38px;
    height: 38px;
}

.btn-sm-square {
    width: 32px;
    height: 32px;
}

.btn-lg-square {
    width: 48px;
    height: 48px;
}

.btn-square,
.btn-sm-square,
.btn-lg-square {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: normal;
}


/*** Navbar ***/
.navbar.sticky-top {
    top: 0;
    transition: .5s;
}

.navbar .navbar-brand,
.navbar a.btn {
    height: 80px
}

.navbar .navbar-nav .nav-link {
    margin-right: 35px;
    padding: 25px 0;
    color: var(--dark);
    font-size: 18px;
    font-weight: 500;
    outline: none;
}

.navbar .navbar-nav .nav-link:hover,
.navbar .navbar-nav .nav-link.active {
    color: var(--primary);
}

.navbar .dropdown-toggle::after {
    border: none;
    content: "\f107";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    vertical-align: middle;
    margin-left: 8px;
}

@media (max-width: 991.98px) {
    .navbar .navbar-nav .nav-link  {
        margin-right: 0;
        padding: 10px 0;
    }

    .navbar .navbar-nav {
        border-top: 1px solid #EEEEEE;
    }
}

@media (min-width: 992px) {
    .navbar .nav-item .dropdown-menu {
        display: block;
        border: none;
        margin-top: 0;
        top: 150%;
        opacity: 0;
        visibility: hidden;
        transition: .5s;
    }

    .navbar .nav-item:hover .dropdown-menu {
        top: 100%;
        visibility: visible;
        transition: .5s;
        opacity: 1;
    }
}


/*** Header ***/
.carousel-caption {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(to bottom, rgba(10, 45, 28, .35) 0%, rgba(10, 45, 28, .55) 55%, rgba(10, 45, 28, .7) 100%);
    z-index: 1;
}

#header-carousel .carousel-item {
    position: relative;
    height: min(82vh, 760px);
    min-height: 480px;
}

#header-carousel .carousel-item > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 35%;
}

.carousel-control-prev,
.carousel-control-next {
    width: 15%;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 3rem;
    background-color: var(--primary);
    border: 10px solid var(--primary);
}

@media (max-width: 768px) {
    #header-carousel .carousel-item {
        position: relative;
        min-height: 450px;
    }
    
    #header-carousel .carousel-item img {
        position: absolute;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

.page-header {
    background: linear-gradient(rgba(10, 45, 28, .62), rgba(10, 45, 28, .62)), url(img/carousel-1.jpg) center 40% / cover no-repeat;
}

.page-header .breadcrumb-item+.breadcrumb-item::before {
    color: var(--light);
}

.page-header .breadcrumb-item,
.page-header .breadcrumb-item a {
    font-size: 18px;
    color: var(--light);
}


/*** Top Feature ***/
@media (min-width: 991.98px) {
    .top-feature {
        position: relative;
        margin-top: -80px;
        z-index: 1;
    }
}


/*** Facts & Quote ***/
.facts,
.quote {
    background: linear-gradient(rgba(10, 45, 28, .6), rgba(10, 45, 28, .6)), var(--band-img) center / cover fixed;
    position: relative;
}

@media (max-width: 991.98px) {
    .facts,
    .quote {
        background-attachment: scroll;
    }
}


/*** Service ***/
.service-item {
    position: relative;
    text-align: center;
}

.service-item .service-img {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    z-index: -1;
}

.service-item .service-img img {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    object-fit: cover;
    transform: scale(1.2);
    transition: .3s;
    z-index: -1;
}

.service-item:hover .service-img img {
    transform: scale(1);
}

.service-item .service-text {
    background: #FFFFFF;
    box-shadow: 0 0 45px rgba(0, 0, 0, .08);
    transition: .3s;
}

.service-item:hover .service-text {
    background: rgba(15, 66, 41, .6);
}

.service-item .service-text h4,
.service-item .service-text p {
    transition: .3;
}

.service-item:hover .service-text h4 {
    color: #FFFFFF;
}

.service-item:hover .service-text p {
    color: var(--light);
}

.service-item .service-text .btn-square {
    width: 100px;
    height: 100px;
    background: transparent;
    transition: .5s;
}

.service-item:hover .service-text .btn-square {
    background: var(--light);
}

.service-item .service-text .btn {
    width: 31px;
    height: 31px;
    display: inline-flex;
    align-items: center;
    color: var(--dark);
    background: var(--light);
    white-space: nowrap;
    overflow: hidden;
    transition: .3s;
}

.service-item:hover .service-text .btn {
    width: 112px;
}


/*** Project Portfolio ***/
#portfolio-flters {
    display: inline-block;
    background: var(--light);
    padding: 10px 15px;
}

#portfolio-flters li {
    display: inline-block;
    font-weight: 500;
    color: var(--primary);
    cursor: pointer;
    transition: .5s;
    border-bottom: 2px solid transparent;
}

#portfolio-flters li:hover,
#portfolio-flters li.active {
    color: var(--dark);
    border-color: var(--dark);
}

.portfolio-inner {
    position: relative;
    overflow: hidden;
}

.portfolio-inner::before,
.portfolio-inner::after {
    position: absolute;
    content: "";
    width: 0;
    height: 100%;
    top: 0;
    left: 0;
    background: rgba(15, 66, 41, .6);
    transition: .5s;
}

.portfolio-inner::after {
    left: auto;
    right: 0;
}

.portfolio-inner:hover::before,
.portfolio-inner:hover::after {
    width: 50%;
}

.portfolio-inner .portfolio-text {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: .5s;
    z-index: 3;
    opacity: 0;
}

.portfolio-inner:hover .portfolio-text {
    transition-delay: .3s;
    opacity: 1;
}

.portfolio-inner .portfolio-text .btn {
    background: var(--light);
    color: var(--primary);
}

.portfolio-inner .portfolio-text .btn:hover {
    background: var(--primary);
    color: var(--light);
}


/*** Team ***/
.team-item {
    position: relative;
    overflow: hidden;
}

.team-item .team-text {
    position: absolute;
    width: calc(100% - 45px);
    left: -100%;
    bottom: 45px;
    padding: 1.5rem;
    background: #FFFFFF;
    border-radius: 0 4px 4px 0;
    opacity: 0;
    transition: .5s;
}

.team-item:hover .team-text {
    left: 0;
    opacity: 1;
}

.team-item .team-social .btn {
    background: var(--light);
    color: var(--primary);
}

.team-item .team-social .btn:hover {
    background: var(--primary);
    color: var(--light);
}

.team-item .team-img .team-social {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .5s;
    z-index: 3;
    opacity: 0;
}

.team-item:hover .team-img .team-social {
    transition-delay: .3s;
    opacity: 1;
}


/*** Testimonial ***/

.testimonial-carousel .owl-item img {
    width: 100px;
    height: 100px;
}

.testimonial-carousel .owl-nav {
    margin-top: 30px;
    display: flex;
}

.testimonial-carousel .owl-nav .owl-prev,
.testimonial-carousel .owl-nav .owl-next {
    margin-right: 15px;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    background: var(--light);
    border-radius: 4px;
    font-size: 22px;
    transition: .5s;
}

.testimonial-carousel .owl-nav .owl-prev:hover,
.testimonial-carousel .owl-nav .owl-next:hover {
    background: var(--primary);
    color: var(--light);
}


/*** Footer ***/
.footer .btn.btn-link {
    display: block;
    margin-bottom: 5px;
    padding: 0;
    text-align: left;
    color: var(--light);
    font-weight: normal;
    text-transform: capitalize;
    transition: .3s;
}

.footer .btn.btn-link::before {
    position: relative;
    content: "\f105";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-right: 10px;
}

.footer .btn.btn-link:hover {
    color: var(--primary);
    letter-spacing: 1px;
    box-shadow: none;
}

/* Pill-style newsletter field with the send button inside. */
.footer .footer-pill .form-control {
    border-radius: 50rem 0 0 50rem;
}

.footer .footer-pill .btn {
    border-radius: 0 50rem 50rem 0;
}

.copyright {
    color: var(--light);
    background: #072A19;
}

.copyright a {
    color: #FFFFFF;
}

.copyright a:hover {
    color: var(--primary);
}

/* =====================================================================
   Miyetu additions
   ===================================================================== */

/* Floating WhatsApp button (replaces back-to-top). */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #25D366;
    color: #fff;
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 211, 102, .4);
    z-index: 99999;
    transition: transform .2s ease, box-shadow .2s ease;
    text-decoration: none;
}

.whatsapp-float:hover {
    color: #fff;
    transform: scale(1.08);
}

/* Text on coloured backgrounds: set explicitly, do not rely on inheritance. */
.bg-primary h1, .bg-primary h2, .bg-primary h3, .bg-primary h4, .bg-primary p {
    color: #fff;
}

/* Sticky navbar: keep the Donate button readable. */
.sticky-top.navbar-light .navbar-nav .nav-link.btn {
    color: #fff !important;
}

/* Brand text sized like the old template logo, kept as a span for heading hygiene. */
.navbar .navbar-brand span {
    font-family: 'Jost', sans-serif;
    line-height: 1.1;
}

/* Dropdown menus open on hover on desktop, as in the source template. */
@media (min-width: 992px) {
    .navbar .nav-item:hover > .dropdown-menu {
        display: block;
    }
}

/* Bootstrap 5.0 builds hard-code the heading size; keep h2/h3 card titles consistent when used as h4. */
.h4, h3.h4, h2.h4 { font-size: 1.5rem; }
.h5, h3.h5, h2.h5 { font-size: 1.25rem; }

/* Blog and content typography */
.entry-content h2, .entry-content h3 { margin-top: 2rem; margin-bottom: 1rem; }
.entry-content ul { padding-left: 1.25rem; }
.entry-content li { margin-bottom: .5rem; }
article.post h2 a { color: var(--dark); }
article.post h2 a:hover { color: var(--primary); }

/* Donate amount presets */
[data-amount].active { background: var(--primary); color: #fff; }

/* Pagination */
.pagination, .nav-links { display: flex; gap: .5rem; flex-wrap: wrap; }
.page-numbers { padding: .5rem .9rem; border: 1px solid var(--primary); border-radius: 4px; color: var(--primary); }
.page-numbers.current, .page-numbers:hover { background: var(--primary); color: #fff; }


/* ---- Visual polish ---- */

/* Team portraits: one aspect ratio so the grid is even. */
.team-item img {
    aspect-ratio: 4 / 5;
    width: 100%;
    object-fit: cover;
    object-position: center 20%;
}

/* Program cards: whole card clickable via an empty stretched link (the Read More pill clips overflow). */
.service-item > .stretched-link { z-index: 2; }
.service-item .service-text .btn { position: relative; }

/* Project and gallery tiles: even crops. */
.portfolio-inner img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }

/* Section headings: keep long titles tidy on narrow screens. */
@media (max-width: 575.98px) {
    .display-5 { font-size: 1.9rem; }
    .display-1 { font-size: 2.6rem; }
    .display-3 { font-size: 2.2rem; }
}

/* Mobile header: brand and menu button share one row. */
@media (max-width: 991.98px) {
    .navbar { flex-wrap: wrap; }
    .navbar .navbar-brand { height: 70px; padding-left: 1rem !important; padding-right: .5rem !important; min-width: 0; }
    .navbar .navbar-brand img { width: 38px; height: auto; }
    .navbar .navbar-brand span { font-size: 1.05rem !important; }
    .navbar .navbar-toggler { margin-right: 1rem !important; }
    .navbar .navbar-nav .nav-link { margin-right: 0; padding: 12px 0; }
    .whatsapp-float { width: 52px; height: 52px; font-size: 26px; bottom: 16px; right: 16px; }
}

/* A photo band that sits directly above the footer: no white gap between them. */
.quote + .footer,
.facts + .footer { margin-top: 0 !important; }
.quote:has(+ .footer),
.facts:has(+ .footer) { margin-bottom: 0 !important; }


/* =====================================================================
   Cards: whole card is one tap target, text always visible
   ===================================================================== */

/* Program cards: image on top, text below, no hover-only reveal. */
.service-item {
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 0 45px rgba(0, 0, 0, .08);
    transition: transform .3s, box-shadow .3s;
}
.service-item:hover { transform: translateY(-4px); box-shadow: 0 8px 45px rgba(0, 0, 0, .14); }
.service-item .service-img {
    position: relative;
    width: 100%;
    height: auto;
    z-index: auto;
    border-radius: 0 !important;
}
.service-item .service-img img {
    position: static;
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transform: none;
    z-index: auto;
}
.service-item:hover .service-img img { transform: scale(1.05); }
.service-item .service-text,
.service-item:hover .service-text {
    background: #fff;
    box-shadow: none;
    flex: 1 1 auto;
    padding: 1.5rem !important;
}
.service-item:hover .service-text h4,
.service-item:hover .service-text .h4 { color: var(--dark); }
.service-item:hover .service-text p { color: inherit; }
.service-item .service-text .btn-square { width: 72px; height: 72px; margin-top: -3.5rem !important; background: var(--light); border: 4px solid #fff; }
.service-item:hover .service-text .btn-square { background: var(--light); }
.service-item .service-text .btn-square img { width: 40px; }
.service-item .service-text .btn,
.service-item:hover .service-text .btn { width: auto; height: auto; padding: .4rem .9rem; color: var(--primary); font-weight: 600; }

/* Project cards. */
.project-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: #fff;
    border-radius: .5rem;
    box-shadow: 0 0 45px rgba(0, 0, 0, .08);
    transition: transform .3s, box-shadow .3s;
}
.project-card:hover { transform: translateY(-4px); box-shadow: 0 8px 45px rgba(0, 0, 0, .14); }
.project-card .pc-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--light); }
.project-card .pc-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.project-card:hover .pc-media img { transform: scale(1.05); }
.project-card .pc-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 45, 28, .88) 0%, rgba(10, 45, 28, .35) 55%, rgba(10, 45, 28, 0) 100%);
}
.project-card .pc-caption { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 1rem 1.25rem; }
.project-card .pc-body { padding: 1.25rem; flex: 1 1 auto; }
.project-card .pc-body a { color: var(--primary); }

/* Gallery tiles. */
.gallery-tile { position: relative; display: block; overflow: hidden; border-radius: .5rem; aspect-ratio: 4 / 3; }
.gallery-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gallery-tile:hover img { transform: scale(1.05); }
.gallery-tile .gt-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 2rem 1rem .75rem;
    color: #fff;
    font-size: .9rem;
    line-height: 1.3;
    background: linear-gradient(to top, rgba(10, 45, 28, .85), rgba(10, 45, 28, 0));
}

/* Team cards: name and role always under the photo (people are not links). */
.team-item { background: #fff; box-shadow: 0 0 45px rgba(0, 0, 0, .08); }
.team-item .team-text,
.team-item:hover .team-text {
    position: static;
    width: auto;
    left: auto;
    opacity: 1;
    padding: 1rem 1.25rem;
    border-radius: 0;
    background: #fff;
    text-align: center;
}

/* Top feature cards on small screens: even gaps, tighter padding. */
@media (max-width: 991.98px) {
    .top-feature { padding-top: 1.5rem !important; }
    .top-feature .container { padding-bottom: 0 !important; }
    .top-feature .row { row-gap: 1rem; }
    .top-feature .shadow { padding: 1.25rem 1.25rem !important; min-height: 0 !important; border-radius: .5rem; }
    .top-feature h2 { font-size: 1.25rem; margin-bottom: .25rem; }
    .top-feature span { font-size: .95rem; }
}

/* Touch screens have no hover: keep cards in their final, readable state. */
@media (hover: none) {
    .service-item:hover,
    .project-card:hover { transform: none; }
}

.service-item .service-text { position: relative; z-index: 1; }
@media (max-width: 991.98px) {
    .top-feature { padding-bottom: 0 !important; }
}

/* Thumb-friendly footer links on small screens. */
@media (max-width: 991.98px) {
    .footer .btn.btn-link { padding-top: .6rem; padding-bottom: .6rem; min-height: 44px; display: flex; align-items: center; }
    .footer .btn.btn-link::before { flex-shrink: 0; }
}

/* Mobile menu: comfortable tap rows and a proper Donate button. */
@media (max-width: 991.98px) {
    .navbar .dropdown-item { padding: .75rem 1rem; min-height: 44px; display: flex; align-items: center; }
    .navbar a.btn.d-lg-none { height: auto; display: block; margin: 0 1.5rem 1.5rem !important; padding: .9rem 1rem; border-radius: .5rem !important; text-align: center; }
}

/* Copy-to-clipboard icons on the Donate page: a real tap target. */
[data-copy] { min-width: 40px; min-height: 40px; padding: .5rem !important; margin-left: .25rem !important; display: inline-flex; align-items: center; justify-content: center; }

/* Hero arrows crowd the headline on phones; the carousel swipes. */
@media (max-width: 575.98px) {
    #header-carousel .carousel-control-prev,
    #header-carousel .carousel-control-next { display: none; }
}
