/* ============================================================
   Redefinition Ministries — Animations layer
   Loaded AFTER style.css on: index.php, events.php,
   resources.php and contact.php
   ============================================================ */

/* ── 1. Scroll-reveal: start hidden ──────────────────────────
   (the class "rm-js" is only added when the browser supports
   the animation and the visitor has not asked for reduced motion)  */
html.rm-js [data-anim]:not(.rm-on) {
    opacity: 0;
}

/* Sliding-in cards must never create a sideways scrollbar */
html.rm-js body {
    overflow-x: clip;
}

@supports not (overflow: clip) {
    html.rm-js body {
        overflow-x: hidden;
    }
}

/* ── 2. Hero ─────────────────────────────────────────────────── */
.hero-title .rm-line {
    display: block;
}

/* slow, cinematic zoom on the hero photo */
.hero-image-section .hero-image-bg {
    animation: rmKenBurns 26s ease-in-out infinite alternate;
    transform-origin: center center;
    will-change: transform;
}

@keyframes rmKenBurns {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.1);
    }
}

/* ── 3. "Join an Event" button — solid blue + lightning glow ── */
.about-actions .btn.btn-join-event {
    background: #0F2347 !important;
    border: 2px solid #0F2347 !important;
    color: #ffffff !important;
    box-shadow: 0 6px 18px rgba(15, 35, 71, 0.40);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease !important;
}

.about-actions .btn.btn-join-event:hover,
.about-actions .btn.btn-join-event:focus-visible {
    background: #0F2347 !important;
    /* stays the same navy blue */
    border-color: #0F2347 !important;
    color: #ffffff !important;
    transform: translateY(-3px) !important;
    box-shadow:
        0 0 0 3px rgba(56, 189, 248, 0.35),
        0 0 22px 5px rgba(56, 189, 248, 0.70),
        0 12px 34px rgba(14, 165, 233, 0.55);
    animation: rmLightning 1.1s ease-in-out infinite alternate;
}

@keyframes rmLightning {
    from {
        box-shadow:
            0 0 0 3px rgba(56, 189, 248, 0.30),
            0 0 16px 4px rgba(56, 189, 248, 0.55),
            0 10px 28px rgba(14, 165, 233, 0.45);
    }

    to {
        box-shadow:
            0 0 0 5px rgba(125, 211, 252, 0.45),
            0 0 34px 10px rgba(56, 189, 248, 0.95),
            0 14px 44px rgba(14, 165, 233, 0.75);
    }
}

/* "Learn Our Story" — same reacting-glow treatment, in orange to match its own colour */
.btn.btn-glow-orange {
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease !important;
}

.btn.btn-glow-orange:hover,
.btn.btn-glow-orange:focus-visible {
    transform: translateY(-3px) !important;
    box-shadow:
        0 0 0 3px rgba(251, 191, 36, 0.35),
        0 0 22px 5px rgba(245, 158, 11, 0.70),
        0 12px 34px rgba(217, 119, 6, 0.55);
    animation: rmLightningOrange 1.1s ease-in-out infinite alternate;
}

@keyframes rmLightningOrange {
    from {
        box-shadow:
            0 0 0 3px rgba(251, 191, 36, 0.30),
            0 0 16px 4px rgba(245, 158, 11, 0.55),
            0 10px 28px rgba(217, 119, 6, 0.45);
    }

    to {
        box-shadow:
            0 0 0 5px rgba(253, 224, 71, 0.45),
            0 0 34px 10px rgba(245, 158, 11, 0.95),
            0 14px 44px rgba(217, 119, 6, 0.75);
    }
}

/* ── 4. Testimony ("What God Is Doing") — smaller cards on phones ── */
@media (max-width: 768px) {
    .testimonies-section {
        padding: 3rem 0 3.25rem;
    }

    .testimonies-section .section-header {
        margin-bottom: 1rem;
    }

    .testimonies-section .testimonies-carousel {
        padding: 0.4rem 0 0.7rem;
    }

    .testimonies-section .testimonies-track {
        gap: 0.75rem;
        align-items: flex-start;   /* each card is only as tall as its own text */
    }

    .testimonies-section .testimony-card,
    .testimonies-section .testimony-card--timeline {
        flex: 0 0 min(205px, 60vw);
        width: min(205px, 60vw);
        min-width: 0;
        min-height: 0;
        padding: 0.15rem 0 0.15rem 0.85rem;
        gap: 0.5rem;
    }

    .testimonies-section .testimony-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
        box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.08);
    }

    .testimonies-section .testimony-card--timeline h3 {
        font-size: 0.86rem;
        margin-bottom: 0.25rem;
    }

    .testimonies-section .testimony-card--timeline p {
        font-size: 0.74rem;
        line-height: 1.45;
        margin-bottom: 0.35rem;
        -webkit-line-clamp: 2;
    }

    .testimonies-section .testimony-location {
        font-size: 0.72rem;
    }

    .testimonies-section .add-testimony-card h3 {
        font-size: 0.88rem;
    }

    .testimonies-section .add-testimony-card p {
        display: none;
    }

    .testimonies-section .add-testimony-card {
        padding: 0.15rem 0 0.15rem 0.85rem;
        min-height: 0;
    }

    .testimonies-section .add-testimony-card .plus-icon {
        width: 30px;
        height: 30px;
    }
}

/* ── 5. "See more" button (events + resources) ───────────────── */
.rm-more-hidden {
    display: none !important;
}

.rm-seemore {
    display: flex;
    justify-content: center;
    margin: 1.6rem 0 0.5rem;
}

.rm-seemore[hidden] {
    display: none !important;
}

.rm-seemore-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1.9rem;
    border-radius: 999px;
    border: 2px solid #1A3A6E;
    background: #1A3A6E;
    color: #ffffff;
    font-family: 'Archivo', system-ui, sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.rm-seemore-btn:hover,
.rm-seemore-btn:focus-visible {
    background: #D97706;
    border-color: #D97706;
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(217, 119, 6, 0.38);
    outline: none;
}

.rm-seemore-btn i {
    font-size: 0.8rem;
    animation: rmBounceY 1.3s ease-in-out infinite;
}

@keyframes rmBounceY {

    0%,
    100% {
        transform: translateY(-1px);
    }

    50% {
        transform: translateY(3px);
    }
}

/* ── 6. Little extras ─────────────────────────────────────────── */
/* stats & about cards lift when hovered */
.pastor-stats .stat,
.about-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.about-card:hover {
    transform: translateY(-6px);
}

/* Respect visitors who prefer less motion */
@media (prefers-reduced-motion: reduce) {

    .hero-image-section .hero-image-bg,
    .rm-seemore-btn i,
    .about-actions .btn.btn-join-event:hover {
        animation: none !important;
    }
}

/* ── Hero: bolder headline + a typewriter entrance / wave-ripple hover ── */
.hero-title.hero-title-bold {
    font-weight: 900;
    letter-spacing: -0.01em;
    text-shadow: 0 4px 26px rgba(0, 0, 0, 0.35);
}

.hero-title .rm-word {
    display: inline-block;
    white-space: nowrap;
}

.hero-title .rm-letter {
    display: inline-block;
    transition: transform 0.12s ease-out;
    will-change: transform;
}

html.rm-js .hero-title .rm-letter {
    opacity: 0;   /* the typewriter script reveals each letter as its turn comes */
}

.hero-title .rm-caret {
    display: inline-block;
    width: 3px;
    margin: 0 1px;
    background: #FBBF24;
    vertical-align: -0.08em;
    height: 0.85em;
    animation: rmCaretBlink 0.85s step-end infinite;
}

.hero-title .rm-caret.rm-caret-done {
    animation: rmCaretBlink 0.85s step-end infinite, rmCaretFade 0.6s ease 1.4s forwards;
}

@keyframes rmCaretBlink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@keyframes rmCaretFade {
    to {
        opacity: 0;
        width: 0;
        margin: 0;
    }
}

/* ── Testimonies: no boxed card - content just displays and scrolls ── */
.testimonies-section .testimonies-track {
    align-items: stretch;   /* each card sizes to its own text, instead of the tallest one stretching them all */
}

.testimonies-section .testimony-card,
.testimonies-section .testimony-card--timeline {
    flex: 0 0 235px;
    min-width: 235px;
    min-height: 0;
    padding: 0.2rem 0 0.2rem 1.1rem;
    gap: 0.65rem;
    background: transparent !important;
    border: none !important;
    border-left: 2px solid rgba(245, 158, 11, 0.35) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}

.testimonies-section .testimony-avatar {
    width: 36px;
    height: 36px;
    font-size: 0.92rem;
}

.testimonies-section .testimony-card--timeline h3 {
    font-size: 0.98rem;
    margin-bottom: 0.3rem;
}

.testimonies-section .testimony-card--timeline p {
    font-size: 0.84rem;
    line-height: 1.5;
    margin-bottom: 0.35rem;
    -webkit-line-clamp: 2;
}

.testimonies-section .testimony-location {
    font-size: 0.86rem;
}

.testimonies-section .add-testimony-card {
    flex-basis: 235px;
    min-width: 235px;
    min-height: 0;
    padding: 0.2rem 0 0.2rem 1.1rem;
    background: transparent !important;
    border: none !important;
    border-left: 2px dashed rgba(245, 158, 11, 0.45) !important;
    border-radius: 0 !important;
    align-items: flex-start !important;
    text-align: left !important;
}

.testimonies-section .add-testimony-card .add-testimony-content {
    align-items: flex-start !important;
    text-align: left !important;
}

.testimonies-section .add-testimony-card p {
    font-size: 0.82rem;
    line-height: 1.45;
}

/* ── Homepage events: straight line + capped rows ────────────── */
.events-section .events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    align-items: stretch;
}

@media (min-width: 1100px) {
    .events-section .events-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.rm-home-event-extra {
    display: none !important;
}

@media (max-width: 768px) {
    .events-section .events-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .rm-home-event-desktop-only {
        display: none !important;
    }
}

.rm-more-events-wrap {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.rm-more-events-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.7rem;
    border-radius: 999px;
    border: 2px solid #0F2347;
    color: #0F2347;
    background: transparent;
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none;
    transition: all 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.rm-more-events-btn:hover {
    background: #0F2347;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(15, 35, 71, 0.35);
}

/* ── Our Location v2 — heading + 3 columns in a row ──────────── */
.location-section-v2 {
    padding: 5rem 0;
}

.location-heading {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 3rem;
}

.location-heading h2 {
    font-size: clamp(2.2rem, 4vw, 3rem);
    font-weight: 900;
    margin: 0.5rem 0 0.75rem;
}

.location-heading p {
    color: var(--gray-500, #6B7280);
    font-size: 1.05rem;
}

.location-grid-v2 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
    align-items: stretch;
}

.location-branch {
    background: #fff;
    border: 1px solid #EEF2F7;
    border-radius: 20px;
    padding: 2.25rem 1.8rem;
    box-shadow: 0 8px 26px rgba(15, 23, 42, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.location-branch:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.location-branch-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #0F2347, #1E3A6E);
    color: #fff;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.location-branch-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #D97706;
    margin-bottom: 0.4rem;
}

.location-branch h3 {
    font-size: 1.3rem;
    margin-bottom: 0.9rem;
    color: #111827;
}

.location-branch p {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.92rem;
    color: #4B5563;
    line-height: 1.5;
    margin-bottom: 0.6rem;
}

.location-branch p i {
    color: #D97706;
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.location-map-v2 {
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 26px rgba(15, 23, 42, 0.10);
    border: 1px solid #EEF2F7;
}

.location-map-frame {
    flex: 1;
    min-height: 220px;
}

.location-map-frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 220px;
}

.location-map-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem;
    background: #0F2347;
    color: #fff;
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
    transition: background 0.25s ease;
}

.location-map-link:hover {
    background: #1E3A6E;
}

@media (max-width: 991px) {
    .location-grid-v2 {
        grid-template-columns: 1fr;
    }

    .location-map-frame {
        min-height: 260px;
    }
}

@media (max-width: 900px) {
    .footer-copyright-bar .copyright-center {
        text-align: center;
    }
}

/* ============================================================
   Shared section hero banner - used at the top of About, Events,
   Resources, Contact and Courses. Plays on page load (not tied to
   scroll, since it's always visible immediately).
   ============================================================ */
.rm-section-hero {
    position: relative;
    padding: 6.5rem 1.5rem 4.5rem;
    text-align: center;
    background:
        radial-gradient(circle at 15% 20%, rgba(245, 158, 11, 0.16), transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(56, 189, 248, 0.10), transparent 45%),
        linear-gradient(160deg, #0F172A 0%, #0F2347 55%, #14213D 100%);
    overflow: hidden;
}

.rm-section-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
    background-size: 26px 26px;
    opacity: 0.35;
    pointer-events: none;
}

.rm-section-hero .container {
    position: relative;
    z-index: 1;
    max-width: 720px;
}

.rm-section-hero-tag,
.rm-section-hero h1,
.rm-section-hero p {
    opacity: 0;
    animation: rmHeroBannerIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.rm-section-hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.95rem;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #FBBF24;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 1.1rem;
    animation-delay: 0.05s;
}

.rm-section-hero-tag::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #FBBF24;
}

.rm-section-hero h1 {
    font-size: clamp(2.1rem, 4.6vw, 3.1rem);
    font-weight: 900;
    color: #fff;
    line-height: 1.15;
    margin-bottom: 0.9rem;
    animation-delay: 0.16s;
}

.rm-section-hero h1 .highlight {
    background: linear-gradient(120deg, #FBBF24, #F59E0B);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.rm-section-hero p {
    color: rgba(226, 232, 240, 0.82);
    font-size: 1.05rem;
    line-height: 1.7;
    margin: 0 auto;
    animation-delay: 0.28s;
}

@keyframes rmHeroBannerIn {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {

    .rm-section-hero-tag,
    .rm-section-hero h1,
    .rm-section-hero p {
        opacity: 1;
        animation: none !important;
        transform: none !important;
    }
}

@media (max-width: 640px) {
    .rm-section-hero {
        padding: 5.5rem 1.25rem 3.25rem;
    }
}