/* Ubwiza SACCO - Design System */
:root {
    --forest: #163A2B; --forest-dark: #0E2A1F; --teal: #2C6E8C; --gold: #C99A2E;
    --cream: #FAF7F0; --ink: #22282A; --sage: #E7EEE6; --white: #FFFFFF;
    --font-display: 'Fraunces', Georgia, serif; --font-body: 'Inter', -apple-system, sans-serif; --font-mono: 'IBM Plex Mono', monospace;
    --radius: 6px; --shadow: 0 4px 20px rgba(22, 58, 43, 0.08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font-body); color: var(--ink); background: var(--cream); line-height: 1.6; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--forest); line-height: 1.15; margin: 0 0 0.5em; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.btn { display: inline-block; padding: 12px 28px; border-radius: var(--radius); font-weight: 600; font-size: 15px; cursor: pointer; border: none; text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn-gold { background: var(--gold); color: var(--forest-dark); }
.btn-gold:hover { background: #b8892a; }
.btn-outline { background: transparent; border: 1px solid var(--white); color: var(--white); }
.btn-outline:hover { background: rgba(255,255,255,0.15); }
.btn-forest { background: var(--forest); color: var(--white); }
.btn-forest:hover { background: var(--forest-dark); }

.weave-divider {
    height: 10px;
    background-image: repeating-linear-gradient(45deg, var(--gold) 0px, var(--gold) 2px, transparent 2px, transparent 10px),
                       repeating-linear-gradient(-45deg, var(--forest) 0px, var(--forest) 2px, transparent 2px, transparent 10px);
    background-color: var(--cream);
}

.top-bar { background: var(--forest-dark); color: var(--sage); font-size: 13px; padding: 6px 0; }
.top-bar .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.top-bar a { color: var(--sage); margin-right: 18px; }

.social-icons { display: flex; gap: 12px; align-items: center; }
.social-icons a { color: inherit; display: inline-flex; opacity: 0.85; margin: 0; }
.social-icons a:hover { opacity: 1; color: var(--gold); text-decoration: none; }
.footer-socials a { color: var(--sage); }
.footer-socials a:hover { color: var(--gold); }

.site-header { background: var(--white); box-shadow: var(--shadow); position: relative; z-index: 100; }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--forest); }
.brand img { height: 42px; width: auto; }
.nav-menu { display: flex; align-items: center; gap: 26px; list-style: none; margin: 0; padding: 0; }
.nav-menu > li { position: relative; }
.nav-menu > li > a { color: var(--ink); font-weight: 600; font-size: 15px; padding: 8px 0; display: inline-block; }
.nav-menu > li > a:hover { color: var(--teal); text-decoration: none; }
.submenu { display: none; position: absolute; top: 100%; left: 0; background: var(--white); box-shadow: var(--shadow); border-radius: var(--radius); min-width: 200px; padding: 8px 0; list-style: none; margin: 0; }
.nav-menu > li:hover .submenu, .nav-menu > li.open .submenu { display: block; }
.submenu li a { display: block; padding: 10px 18px; color: var(--ink); font-size: 14px; font-weight: 500; }
.submenu li a:hover { background: var(--sage); text-decoration: none; }
.nav-toggle { display: none; background: none; border: none; font-size: 26px; cursor: pointer; color: var(--forest); }

@media (max-width: 900px) {
    .nav-toggle { display: block; }
    .nav-menu { display: none; flex-direction: column; align-items: flex-start; gap: 4px; position: absolute; top: 100%; left: 0; right: 0; background: var(--white); padding: 12px 24px 20px; box-shadow: var(--shadow); }
    .nav-menu.open { display: flex; }
    .submenu { position: static; box-shadow: none; padding-left: 12px; }
}

.hero { position: relative; height: 520px; overflow: hidden; background: var(--forest); }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 0.8s ease; background-size: cover; background-position: center; display: flex; align-items: center; }
.hero-slide.active { opacity: 1; }
.hero-slide::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(14,42,31,0.88) 0%, rgba(14,42,31,0.45) 55%, rgba(14,42,31,0.15) 100%); }
.hero-text { position: relative; z-index: 2; max-width: 560px; padding: 0 24px; color: var(--white); }
.hero-text .eyebrow { color: var(--gold); }
.hero-text h1 { font-size: 42px; color: var(--white); margin: 10px 0 16px; }
.hero-text p { font-size: 17px; color: var(--sage); margin-bottom: 24px; }
.hero-nav { position: absolute; z-index: 3; bottom: 24px; left: 0; right: 0; display: flex; justify-content: center; gap: 10px; }
.hero-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.4); border: none; cursor: pointer; }
.hero-dot.active { background: var(--gold); }
.hero-arrow { position: absolute; z-index: 3; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.15); border: none; color: var(--white); width: 42px; height: 42px; border-radius: 50%; font-size: 20px; cursor: pointer; }
.hero-arrow:hover { background: rgba(255,255,255,0.3); }
.hero-arrow.prev { left: 20px; }
.hero-arrow.next { right: 20px; }

@media (max-width: 700px) { .hero { height: 420px; } .hero-text h1 { font-size: 30px; } }

.section { padding: 64px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.section-head h2 { font-size: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
@media (max-width: 800px) { .grid-3 { grid-template-columns: 1fr; } }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 550px) { .grid-4 { grid-template-columns: 1fr; } }

.feature-card { background: var(--white); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.feature-card .icon { font-size: 30px; margin-bottom: 12px; }
.feature-card h3 { font-size: 19px; }

.card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.card img { height: 170px; object-fit: cover; }
.card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.card-date { font-family: var(--font-mono); font-size: 12px; color: var(--teal); margin-bottom: 8px; }
.card h3 { font-size: 18px; margin-bottom: 8px; }
.card p { font-size: 14px; color: #555; flex: 1; }
.card .read-more { font-size: 13px; font-weight: 600; margin-top: 10px; }

.section-sage { background: var(--sage); }
.cta-banner { background: var(--gold); color: var(--forest-dark); text-align: center; padding: 56px 24px; }
.cta-banner h2 { color: var(--forest-dark); font-size: 30px; }
.cta-banner p { margin-bottom: 22px; font-size: 16px; }
.empty-state { text-align: center; color: #777; padding: 40px 0; font-style: italic; }

.site-footer { background: var(--forest-dark); color: var(--sage); padding-top: 48px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; padding-bottom: 32px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: var(--white); font-size: 16px; margin-bottom: 14px; }
.site-footer a { color: var(--sage); font-size: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding: 16px 0; text-align: center; font-size: 13px; color: #9db3a8; }

.page-header { background: var(--forest); color: var(--white); padding: 48px 0; text-align: center; }
.page-header h1 { color: var(--white); }
.prose { max-width: 760px; margin: 0 auto; padding: 48px 24px; }
.submenu-links { display: flex; gap: 14px; flex-wrap: wrap; margin: 24px 0; }
.submenu-links a { background: var(--sage); padding: 10px 18px; border-radius: var(--radius); font-weight: 600; font-size: 14px; color: var(--forest); }
.submenu-links a:hover { background: var(--gold); text-decoration: none; }

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 48px 0; }
@media (max-width: 800px) { .contact-grid { grid-template-columns: 1fr; } }
.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.form-field input, .form-field textarea { width: 100%; padding: 10px 12px; border: 1px solid #ccc; border-radius: var(--radius); font-family: var(--font-body); font-size: 14px; }
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 18px; font-size: 14px; }
.alert-success { background: #e6f4ea; color: #1a5632; }
.alert-error { background: #fdecea; color: #b71c1c; }
.contact-info-item { margin-bottom: 18px; }
.contact-info-item .eyebrow { display: block; margin-bottom: 4px; }

.map-section { padding: 0 0 64px; }
.map-section iframe { box-shadow: var(--shadow); display: block; }

.gallery-card { display: block; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); color: var(--ink); }
.gallery-card:hover { text-decoration: none; box-shadow: 0 8px 28px rgba(22,58,43,0.15); }
.gallery-card .cover { height: 190px; background: linear-gradient(135deg, var(--forest), var(--teal)); display: flex; align-items: center; justify-content: center; font-size: 34px; color: var(--sage); }
.gallery-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.gallery-card .gc-body { padding: 18px 20px; }
.gallery-card h3 { font-size: 17px; margin-bottom: 6px; }
.gallery-card p { font-size: 14px; color: #555; margin: 0; }
.gallery-card .gc-link { font-size: 13px; font-weight: 600; color: var(--gold); margin-top: 8px; display: inline-block; }

.team-card { text-align: center; background: var(--white); border-radius: var(--radius); padding: 24px 18px; box-shadow: var(--shadow); }
.team-photo { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; margin: 0 auto 14px; background: var(--sage); }
.team-photo-placeholder { width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 14px; background: var(--sage); display: flex; align-items: center; justify-content: center; font-size: 30px; color: var(--forest); }
.team-card h3 { font-size: 16px; margin-bottom: 2px; }
.team-card .role { font-family: var(--font-mono); font-size: 12px; color: var(--gold); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; display: block; }
.team-card p { font-size: 13px; color: #667; }

.article-top { max-width: 820px; margin: 0 auto; padding: 40px 24px 24px; text-align: left; }
.article-top h1 { font-size: 38px; margin-top: 10px; }
.article-meta { font-family: var(--font-mono); font-size: 13px; color: #667; margin-top: 8px; }
.article-hero-image { max-width: 1100px; margin: 0 auto 40px; padding: 0 24px; }
.article-hero-image img { width: 100%; max-height: 480px; object-fit: cover; border-radius: 8px; box-shadow: var(--shadow); }
.article-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 48px; max-width: 1100px; padding-bottom: 64px; }
@media (max-width: 900px) { .article-layout { grid-template-columns: 1fr; } }
.article-sidebar { }
.sidebar-widget { background: var(--white); border-radius: 8px; padding: 20px; box-shadow: var(--shadow); margin-bottom: 24px; }
.sidebar-widget h4 { font-size: 15px; margin-bottom: 14px; }
.related-item { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; color: var(--ink); }
.related-item:last-child { margin-bottom: 0; }
.related-item img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.related-item span { font-size: 13px; font-weight: 600; line-height: 1.3; }
.related-item:hover { text-decoration: none; color: var(--teal); }

.rich-content { font-size: 17px; line-height: 1.85; color: #2a2f2b; }
.rich-content::after { content: ""; display: table; clear: both; }
.rich-content p { margin-bottom: 22px; }
.article-body.rich-content p:first-of-type::first-letter {
    font-family: var(--font-display); font-size: 64px; float: left; line-height: 0.8;
    padding-right: 10px; padding-top: 8px; color: var(--forest); font-weight: 600;
}
.rich-content h2, .rich-content h3 { margin-top: 36px; margin-bottom: 14px; }
.rich-content ul, .rich-content ol { margin-bottom: 22px; padding-left: 24px; }
.rich-content blockquote {
    border-left: 4px solid var(--gold); padding-left: 22px; margin: 36px 0;
    font-family: var(--font-display); font-style: italic; font-size: 22px; color: var(--forest);
    clear: both;
}
.rich-content img { width: 100%; border-radius: 8px; margin: 28px 0; box-shadow: var(--shadow); }
.rich-content img.img-float-left { float: left; width: 45%; max-width: 320px; margin: 6px 24px 16px 0; border-radius: 8px; box-shadow: var(--shadow); }
.rich-content img.img-float-right { float: right; width: 45%; max-width: 320px; margin: 6px 0 16px 24px; border-radius: 8px; box-shadow: var(--shadow); }
.rich-content img.img-center { float: none; display: block; width: 70%; margin: 28px auto; border-radius: 8px; box-shadow: var(--shadow); }
@media (max-width: 600px) {
    .rich-content img.img-float-left, .rich-content img.img-float-right { float: none; width: 100%; max-width: 100%; margin: 20px 0; }
}

/* -------------------- MD WELCOME NOTE -------------------- */
.md-wrap { display: flex; gap: 44px; align-items: center; }
.md-wrap.md-align-right { flex-direction: row-reverse; }
.md-photo-wrap { flex: 0 0 260px; }
.md-photo { width: 100%; height: 260px; object-fit: cover; box-shadow: var(--shadow); }
.md-photo.shape-square { border-radius: 12px; }
.md-photo.shape-circle { border-radius: 50%; }
.md-text { flex: 1; }
.md-role { font-family: var(--font-mono); color: var(--teal); font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 14px; }
@media (max-width: 800px) {
    .md-wrap, .md-wrap.md-align-right { flex-direction: column; text-align: center; }
    .md-photo-wrap { flex: 0 0 auto; width: 220px; height: 220px; margin: 0 auto; }
    .md-photo { height: 220px; }
}

/* -------------------- PROMO BANNER -------------------- */
.promo-banner-section { padding: 0 0 64px; }
.promo-banner-section img { width: 100%; border-radius: 8px; box-shadow: var(--shadow); }

/* Contact page: map inside the "Get in touch" column */
.contact-map { border-radius: 8px; box-shadow: var(--shadow); margin-top: 20px; display: block; }

/* Team page: CV download link on cards */
.team-cv-link { display: inline-block; margin-top: 10px; font-size: 12px; font-weight: 600; color: var(--teal); border: 1px solid var(--sage); padding: 6px 12px; border-radius: 20px; }
.team-cv-link:hover { background: var(--sage); text-decoration: none; }

/* -------------------- TEAM PHOTOS: bigger + hover zoom -------------------- */
.team-card {
    text-align: center; background: var(--white); border-radius: var(--radius);
    padding: 32px 20px 26px; box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.team-card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(22,58,43,0.16); }

.team-photo-frame {
    width: 150px; height: 150px; margin: 0 auto 18px;
    position: relative; z-index: 1;
}
.team-photo {
    width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
    transition: transform 0.3s ease, box-shadow 0.3s ease, z-index 0s;
    cursor: pointer;
    position: relative;
}
.team-photo-frame:hover .team-photo {
    transform: scale(1.55);
    box-shadow: 0 18px 44px rgba(0,0,0,0.38);
    z-index: 30;
}
.team-photo-placeholder {
    width: 150px; height: 150px; border-radius: 50%; margin: 0 auto;
    background: var(--sage); display: flex; align-items: center; justify-content: center;
    font-size: 52px; color: var(--forest);
}

@media (max-width: 550px) {
    .team-photo-frame, .team-photo-placeholder { width: 120px; height: 120px; }
    .team-photo-frame:hover .team-photo { transform: scale(1.3); }
}

/* -------------------- STATS STRIP -------------------- */
.stats-strip { background: var(--forest-dark); padding: 36px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; }
@media (max-width: 700px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-item-num { font-family: var(--font-display); font-size: 34px; color: var(--gold); font-weight: 600; }
.stat-item-label { font-family: var(--font-mono); font-size: 12px; color: var(--sage); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }

/* -------------------- TESTIMONIALS -------------------- */
.testimonial-card { background: var(--white); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.quote-mark { font-family: var(--font-display); font-size: 44px; color: var(--gold); line-height: 1; margin-bottom: 4px; }
.testimonial-quote { font-size: 15px; color: #444; font-style: italic; margin-bottom: 20px; }
.testimonial-author { display: flex; align-items: center; gap: 12px; }
.testimonial-author img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.testimonial-avatar-placeholder { width: 44px; height: 44px; border-radius: 50%; background: var(--sage); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.testimonial-name { font-weight: 700; font-size: 14px; color: var(--forest); }
.testimonial-role { font-size: 12px; color: #778; }

/* -------------------- LOGO BADGE (overlapping circular logo) -------------------- */
.site-header { position: relative; overflow: visible; }
.logo-badge {
    position: absolute;
    left: 50%;
    bottom: -72px;
    transform: translateX(-50%);
    width: 148px;
    height: 148px;
    border-radius: 50%;
    background: var(--white);
    padding: 8px;
    box-shadow: 0 12px 32px rgba(14, 42, 31, 0.28);
    z-index: 150;
}
.logo-badge img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.brand { font-size: 20px; }

@media (max-width: 900px) {
    .logo-badge { width: 108px; height: 108px; bottom: -52px; }
}
@media (max-width: 500px) {
    .logo-badge { width: 90px; height: 90px; bottom: -42px; }
}

/* -------------------- LOGO BADGE: left-aligned override -------------------- */
.nav-wrap { position: relative; }
.logo-badge {
    position: absolute;
    left: 24px;
    bottom: -72px;
    transform: none;
}
@media (max-width: 900px) {
    .logo-badge { left: 24px; bottom: -52px; }
}
@media (max-width: 500px) {
    .logo-badge { left: 16px; bottom: -42px; }
}

/* -------------------- LOGO BADGE: pushed further left -------------------- */
.logo-badge {
    left: -87px;
}
@media (max-width: 900px) {
    .logo-badge { left: -20px; }
}
@media (max-width: 500px) {
    .logo-badge { left: -8px; }
}

/* ============================================================
   PAGE LOAD FADE + SCROLL REVEAL + SHINE (Step 21)
============================================================ */
html.page-loading body { opacity: 0; }
html.page-loaded body { opacity: 1; transition: opacity 0.45s ease; }

.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

.shine-card { position: relative; overflow: hidden; }
.shine-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -75%;
    width: 45%;
    height: 100%;
    background: linear-gradient(115deg, transparent, rgba(255,255,255,0.55), transparent);
    transform: skewX(-18deg);
    pointer-events: none;
    z-index: 2;
}
.shine-card.in-view::after {
    animation: shineSweep 1.1s ease-out 0.15s forwards;
}
@keyframes shineSweep {
    from { left: -75%; }
    to { left: 130%; }
}

@media (prefers-reduced-motion: reduce) {
    html.page-loading body { opacity: 1; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .shine-card::after { display: none; }
}

/* ============================================================
   REVEAL: "materializing from a distance" depth effect (Step 22)
   Overrides the simpler fade+slide from Step 21 with more depth.
============================================================ */
.reveal {
    opacity: 0;
    transform: translateY(60px) scale(0.88);
    filter: blur(6px);
    transition:
        opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.9s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.9s ease-out;
    will-change: transform, opacity, filter;
}
.reveal.in-view {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; filter: none; transition: none; }
}

/* -------------------- PRIVACY & COOKIE CONSENT BANNER -------------------- */
.cookie-consent {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 360px;
    max-width: calc(100vw - 32px);
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 16px 44px rgba(14, 42, 31, 0.22);
    padding: 22px;
    z-index: 500;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}
.cookie-consent.show { opacity: 1; transform: translateY(0); }
.cookie-consent-header { font-family: var(--font-display); font-weight: 600; color: var(--forest); font-size: 16px; margin-bottom: 8px; }
.cookie-consent-text { font-size: 13px; color: #556; line-height: 1.6; margin-bottom: 16px; }
.cookie-consent-text a { color: var(--teal); font-weight: 600; }
.cookie-consent-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cookie-consent-actions .btn { padding: 9px 16px; font-size: 13px; }
.cookie-manage-link { background: none; border: none; color: var(--teal); font-size: 13px; font-weight: 600; cursor: pointer; padding: 9px 4px; text-decoration: underline; }
.cookie-toggle-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding: 8px 0; border-bottom: 1px solid #eee; }
.cookie-toggle-row em { color: #999; font-style: normal; font-size: 11px; }
.cookie-toggle-row input[type=checkbox] { width: 18px; height: 18px; }

@media (max-width: 500px) {
    .cookie-consent { left: 16px; right: 16px; bottom: 16px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .cookie-consent { transition: none; }
}

/* -------------------- STICKY NAV -------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 200;
    transition: box-shadow 0.3s ease;
}
.site-header.scrolled {
    box-shadow: 0 6px 22px rgba(14, 42, 31, 0.18);
}
.logo-badge {
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.site-header.scrolled .logo-badge {
    opacity: 0;
    transform: translateY(-16px) scale(0.8);
    pointer-events: none;
}

/* ============================================================
   LOGO BADGE: shrink-into-nav-bar transition (Step 25)
   Same horizontal position throughout - only size/vertical anchor change,
   so the big badge reads as shrinking into the small one, not disappearing.
============================================================ */
.logo-badge {
    transition: all 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.site-header.scrolled .logo-badge {
    opacity: 1;
    pointer-events: auto;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    padding: 3px;
    box-shadow: 0 4px 12px rgba(14, 42, 31, 0.22);
}

@media (prefers-reduced-motion: reduce) {
    .logo-badge { transition: none; }
}

/* -------------------- NAV UTILITY: language + search (far right) -------------------- */
.nav-utility {
    position: absolute;
    right: -140px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 250;
}
@media (max-width: 1300px) {
    .nav-utility { right: 8px; }
}

.lang-switch { position: relative; }
.lang-btn {
    background: var(--sage); border: none; color: var(--forest); font-weight: 600;
    font-size: 13px; padding: 8px 12px; border-radius: 20px; cursor: pointer;
}
.lang-btn:hover { background: var(--gold); color: var(--forest-dark); }
.lang-dropdown {
    display: none; position: absolute; top: 110%; right: 0;
    background: var(--white); border-radius: 8px; box-shadow: var(--shadow);
    min-width: 150px; padding: 8px 0; z-index: 260;
}
.lang-dropdown.open { display: block; }
.lang-dropdown a { display: block; padding: 9px 16px; font-size: 14px; color: var(--ink); }
.lang-dropdown a:hover { background: var(--sage); text-decoration: none; }

.search-toggle-wrap { position: relative; display: flex; align-items: center; }
.search-icon-btn {
    width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--sage);
    background: var(--white); display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 15px; color: var(--forest);
}
.search-icon-btn:hover { background: var(--sage); }
.search-input-box {
    position: absolute; right: 46px; top: 50%; transform: translateY(-50%);
    width: 0; opacity: 0; overflow: hidden;
    background: var(--white); border-radius: 24px; box-shadow: var(--shadow);
    transition: width 0.35s ease, opacity 0.25s ease;
}
.search-input-box.active { width: 220px; opacity: 1; }
.search-input-box input {
    width: 100%; border: none; padding: 10px 16px; font-size: 14px;
    border-radius: 24px; outline: none; font-family: var(--font-body);
}

@media (max-width: 900px) {
    .nav-utility { position: static; transform: none; margin-left: auto; order: 3; }
    .nav-wrap { flex-wrap: wrap; }
}

/* -------------------- PROMO BANNER: fade / marquee / video modes -------------------- */
.promo-fade { position: relative; height: 320px; border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); }
.promo-fade-slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1s ease; }
.promo-fade-slide.active { opacity: 1; }

.promo-marquee { overflow: hidden; white-space: nowrap; }
.promo-marquee-track { display: inline-flex; gap: 20px; animation: promoMarqueeScroll 22s linear infinite; }
.promo-marquee-track img { height: 220px; width: auto; border-radius: 8px; box-shadow: var(--shadow); flex-shrink: 0; }
@keyframes promoMarqueeScroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
    .promo-marquee-track { animation: none; }
}

.promo-video-wrap { position: relative; width: 100%; padding-top: 56.25%; border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); }
.promo-video-wrap iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* -------------------- PROMO SLIDE MODE (Step 28) -------------------- */
.promo-slide { position: relative; height: 320px; border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); }
.promo-slide-item {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    transform: translateX(100%); transition: transform 0.7s ease;
}
.promo-slide-item.active { transform: translateX(0); }
.promo-slide-item.exiting { transform: translateX(-100%); }

/* -------------------- BANNER IMAGES: show full image, no cropping (Step 29) -------------------- */
.promo-fade { background: var(--sage); }
.promo-fade-slide { object-fit: contain; background: var(--sage); }

.promo-slide { background: var(--sage); }
.promo-slide-item { object-fit: contain; background: var(--sage); }

.promo-marquee-track img { height: 260px; width: auto; object-fit: contain; background: var(--sage); padding: 6px; }

/* Give fade/slide banners a bit more room so contained images read clearly */
.promo-fade, .promo-slide { height: 380px; }
@media (max-width: 700px) {
    .promo-fade, .promo-slide { height: 260px; }
    .promo-marquee-track img { height: 180px; }
}

/* -------------------- BANNER HEIGHT: larger default, full-width fit (Step 30) -------------------- */
.promo-fade, .promo-slide { height: 450px; }
.promo-fade-slide, .promo-slide-item { width: 100%; height: 100%; object-fit: contain; }
.promo-marquee-track img { height: 320px; }

@media (max-width: 700px) {
    .promo-fade, .promo-slide { height: 300px; }
    .promo-marquee-track img { height: 200px; }
}

/* -------------------- FOOTER ICONS (Step 31) -------------------- */
.site-footer h4 { display: flex; align-items: center; gap: 8px; }
.site-footer ul li { display: flex; align-items: flex-start; gap: 8px; }

/* -------------------- PUBLICATIONS -------------------- */
.pub-list { display: flex; flex-direction: column; gap: 14px; }
.pub-card {
    display: flex; align-items: center; gap: 18px; background: var(--white);
    border-radius: var(--radius); padding: 18px 22px; box-shadow: var(--shadow);
    color: var(--ink);
}
.pub-card:hover { text-decoration: none; box-shadow: 0 8px 24px rgba(22,58,43,0.14); }
.pub-icon { font-size: 30px; flex-shrink: 0; }
.pub-body { flex: 1; }
.pub-body h3 { font-size: 16px; margin-bottom: 4px; }
.pub-body p { font-size: 14px; color: #556; margin: 0 0 6px; }
.pub-date { font-family: var(--font-mono); font-size: 12px; color: var(--teal); }
.pub-download { flex-shrink: 0; font-weight: 700; font-size: 13px; color: var(--gold); }

/* -------------------- STICKY FOOTER (Step 36) -------------------- */
html, body { height: 100%; }
body { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1 0 auto; }
.site-header, .top-bar, .weave-divider, .site-footer { flex-shrink: 0; }

/* -------------------- BACK TO TOP BUTTON -------------------- */
.back-to-top-btn {
    position: fixed;
    left: 24px;
    bottom: 24px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--forest);
    color: #fff;
    border: none;
    font-size: 20px;
    cursor: pointer;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s, background 0.15s ease;
    z-index: 400;
}
.back-to-top-btn.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top-btn:hover { background: var(--forest-dark); }

@media (max-width: 500px) {
    .back-to-top-btn { left: 16px; bottom: 16px; width: 42px; height: 42px; font-size: 18px; }
}

/* -------------------- STICKY NAV REINFORCEMENT (Step 38) -------------------- */
.site-header {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 200;
}

/* -------------------- LOGO + NAME LOCKUP (Step 40) -------------------- */
.logo-badge { display: flex; flex-direction: column; align-items: center; }
.logo-badge-circle {
    width: 148px; height: 148px; border-radius: 50%; background: var(--white);
    padding: 8px; box-shadow: 0 12px 32px rgba(14,42,31,0.28); overflow: hidden;
    transition: all 0.45s cubic-bezier(0.22,1,0.36,1);
}
.logo-badge-circle img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.logo-caption {
    margin-top: 6px; font-family: var(--font-display); font-size: 12px; font-weight: 700;
    color: var(--forest); text-align: center; white-space: nowrap;
    background: rgba(255,255,255,0.92); padding: 3px 12px; border-radius: 12px;
    transition: opacity 0.3s ease;
}
.logo-badge-link { text-decoration: none; display: block; }
.logo-badge-link:hover { text-decoration: none; }

.site-header.scrolled .logo-badge-circle { width: 46px; height: 46px; padding: 3px; }
.site-header.scrolled .logo-caption { opacity: 0; position: absolute; pointer-events: none; }
.site-header.scrolled .logo-badge { width: 46px; height: auto; }

/* -------------------- FOOTER WORKING HOURS -------------------- */
.footer-hours { background: rgba(0,0,0,0.15); padding: 10px 0; text-align: center; font-size: 13px; color: var(--sage); }

/* -------------------- ABOUT US: MISSION/VISION/HISTORY INLINE -------------------- */
.about-block { max-width: 820px; margin: 0 auto 48px; padding: 0 24px; }
.about-block h2 { font-size: 26px; margin-bottom: 14px; }

/* -------------------- ABOUT OVERVIEW BAND -------------------- */
.overview-band {
    position: relative; padding: 80px 24px; text-align: center; color: var(--white);
    background-size: cover; background-position: center; background-attachment: fixed;
}
.overview-band::before { content: ''; position: absolute; inset: 0; background: rgba(14,42,31,0.72); }
.overview-band-content { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; }
.overview-band-content h2 { color: var(--white); }
.overview-band-content p { font-size: 17px; color: var(--sage); }

/* -------------------- BRANCHES -------------------- */
.branch-card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.branch-card img { height: 160px; object-fit: cover; width: 100%; }
.branch-card-body { padding: 20px; }
.branch-card h3 { font-size: 17px; margin-bottom: 6px; }
.branch-card .branch-meta { font-size: 13px; color: #667; margin-bottom: 10px; }
.branch-card p { font-size: 14px; color: #556; }

/* -------------------- PUBLICATIONS: view/download buttons (Step 40) -------------------- */
.pub-card { flex-direction: row; }
.pub-actions { display: flex; gap: 8px; flex-shrink: 0; }
.pub-btn { font-size: 13px; font-weight: 700; padding: 8px 16px; border-radius: 20px; border: 1px solid var(--sage); color: var(--teal); }
.pub-btn:hover { background: var(--sage); text-decoration: none; }
.pub-btn-gold { background: var(--gold); color: var(--forest-dark); border-color: var(--gold); }
.pub-btn-gold:hover { background: #b8892a; }

/* ============================================================
   FIX: nav hiding on scroll + logo/name lockup sizing (Step 42)
============================================================ */

/* 1) Remove fixed-background parallax on the overview band - this can
   conflict with position:sticky on some browsers/GPUs */
.overview-band {
    background-attachment: scroll !important;
}

/* Reinforce sticky nav one more time, with maximum specificity */
header.site-header {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 500 !important;
}

/* 2) Fix logo+name lockup: let the badge size to its content
   (circle + caption stacked) instead of being clamped to the old
   fixed 148x148 box */
.logo-badge {
    width: auto !important;
    height: auto !important;
}
.site-header.scrolled .logo-badge {
    width: auto !important;
    height: auto !important;
}

/* ============================================================
   FIX: logo badge no longer overlaps the top-bar (Step 43)
============================================================ */
.logo-badge {
    bottom: -50px !important;
}
@media (max-width: 900px) {
    .logo-badge { bottom: -35px !important; }
}
@media (max-width: 500px) {
    .logo-badge { bottom: -28px !important; }
}

/* ============================================================
   LOGO BADGE: centered (Step 44) - resolves top-bar overlap
============================================================ */
.logo-badge {
    left: 50% !important;
    transform: translateX(-50%) !important;
    bottom: -40px !important;
}
@media (max-width: 900px) {
    .logo-badge { bottom: -28px !important; }
}
@media (max-width: 500px) {
    .logo-badge { bottom: -22px !important; }
}

/* ============================================================
   Step 45: logo back to original position, contact info centered
============================================================ */

/* 1) Logo: back to your original position */
.logo-badge {
    left: -200px !important;
    transform: none !important;
    bottom: -50px !important;
}
@media (max-width: 900px) {
    .logo-badge { left: -20px !important; bottom: -35px !important; }
}
@media (max-width: 500px) {
    .logo-badge { left: -8px !important; bottom: -28px !important; }
}

/* 2) Top bar: center the contact info (phone/email), keep socials on the right */
.top-bar .container {
    display: grid !important;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}
.top-bar .container > div:first-child {
    grid-column: 2;
    justify-self: center;
}
.top-bar .container > .social-icons {
    grid-column: 3;
    justify-self: end;
}
@media (max-width: 700px) {
    .top-bar .container {
        display: flex !important;
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }
}

/* ============================================================
   Step 46: pull logo back in so it's never cut off
============================================================ */
.logo-badge {
    left: -20px !important;
}

/* ============================================================
   Step 46: pull logo back in so it's never cut off
============================================================ */
.logo-badge {
    left: -20px !important;
}

/* ============================================================
   Step 47: push logo badge down so its top is never clipped
============================================================ */
.logo-badge {
    bottom: -100px !important;
}
@media (max-width: 900px) {
    .logo-badge { bottom: -70px !important; }
}
@media (max-width: 500px) {
    .logo-badge { bottom: -55px !important; }
}

/* ============================================================
   Step 48: FINAL logo positioning - smooth transform-based
   transition instead of switching between bottom/top (which
   cannot animate cleanly and was causing the jumpy look)
============================================================ */
.logo-badge {
    left: -130px !important;
    bottom: 0 !important;
    top: auto !important;
    transform: translateY(90px) !important;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1) !important;
}
.site-header.scrolled .logo-badge {
    bottom: 0 !important;
    top: auto !important;
    transform: translateY(-18px) !important;
}

@media (max-width: 900px) {
    .logo-badge { left: -20px !important; transform: translateY(60px) !important; }
    .site-header.scrolled .logo-badge { transform: translateY(-14px) !important; }
}
@media (max-width: 500px) {
    .logo-badge { left: -8px !important; transform: translateY(48px) !important; }
    .site-header.scrolled .logo-badge { transform: translateY(-10px) !important; }
}

@media (prefers-reduced-motion: reduce) {
    .logo-badge { transition: none !important; }
}

/* ============================================================
   Step 49: pull logo back toward center (~3cm right of last position)
============================================================ */
.logo-badge {
    left: -20px !important;
}

/* ============================================================
   Step 50: logo further toward center + pushed down slightly
============================================================ */
.logo-badge {
    left: 82px !important;
    transform: translateY(105px) !important;
}

/* ============================================================
   Step 51: menu always stays visible, above the logo, at every
   screen size (fixes recent desktop tweaks leaking into mobile)
============================================================ */

/* Guarantee nav links/toggle/utility icons are never covered by the logo */
.nav-menu, .nav-toggle, .nav-utility {
    position: relative;
    z-index: 300 !important;
}

/* Restore correct mobile-safe logo position (scoped, so it can't
   leak into desktop or override desktop values) */
@media (max-width: 900px) {
    .logo-badge {
        left: -20px !important;
        transform: translateY(60px) !important;
    }
    .site-header.scrolled .logo-badge {
        transform: translateY(-14px) !important;
    }
}
@media (max-width: 500px) {
    .logo-badge {
        left: -8px !important;
        transform: translateY(48px) !important;
    }
    .site-header.scrolled .logo-badge {
        transform: translateY(-10px) !important;
    }
}

/* ============================================================
   Step 52: ROLLBACK - clean, simple logo badge (no caption text,
   no melange with menu). This is the FINAL authoritative rule.
============================================================ */
.logo-badge {
    position: absolute !important;
    left: -200px !important;
    bottom: -72px !important;
    top: auto !important;
    transform: none !important;
    width: 148px !important;
    height: 148px !important;
    border-radius: 50%;
    background: var(--white);
    padding: 8px;
    box-shadow: 0 12px 32px rgba(14,42,31,0.28);
    z-index: 150;
    transition: all 0.45s cubic-bezier(0.22,1,0.36,1);
}
.logo-badge img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.site-header.scrolled .logo-badge {
    width: 46px !important;
    height: 46px !important;
    padding: 3px !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
}
.brand { font-size: 20px; }

.nav-menu, .nav-toggle, .nav-utility {
    position: relative;
    z-index: 300 !important;
}

@media (max-width: 900px) {
    .logo-badge { left: -20px !important; width: 108px !important; height: 108px !important; bottom: -52px !important; }
}
@media (max-width: 500px) {
    .logo-badge { left: -8px !important; width: 90px !important; height: 90px !important; bottom: -42px !important; }
}

/* ============================================================
   Step 50: logo further toward center + pushed down slightly
============================================================ */
.logo-badge {
    left: 82px !important;
    transform: translateY(105px) !important;
}

/* ============================================================
   Step 53: logo + name RESTORED, positioned safely at left:-200px
   (never overlaps the menu, since it stays off to the left)
============================================================ */
.logo-badge {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    position: absolute !important;
    left: -200px !important;
    bottom: 0 !important;
    top: auto !important;
    transform: translateY(90px) !important;
    width: auto !important;
    height: auto !important;
    z-index: 150;
    transition: transform 0.45s cubic-bezier(0.22,1,0.36,1) !important;
}
.logo-badge-circle {
    width: 148px; height: 148px; border-radius: 50%; background: var(--white);
    padding: 8px; box-shadow: 0 12px 32px rgba(14,42,31,0.28); overflow: hidden;
    transition: all 0.45s cubic-bezier(0.22,1,0.36,1);
}
.logo-badge-circle img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.logo-caption {
    margin-top: 6px; font-family: var(--font-display); font-size: 12px; font-weight: 700;
    color: var(--forest); text-align: center; white-space: nowrap;
    background: rgba(255,255,255,0.92); padding: 3px 12px; border-radius: 12px;
    transition: opacity 0.3s ease;
}
.logo-badge-link { text-decoration: none; display: block; }
.logo-badge-link:hover { text-decoration: none; }

.site-header.scrolled .logo-badge {
    bottom: 0 !important;
    top: auto !important;
    transform: translateY(-18px) !important;
}
.site-header.scrolled .logo-badge-circle { width: 46px; height: 46px; padding: 3px; }
.site-header.scrolled .logo-caption { opacity: 0; position: absolute; pointer-events: none; }

.nav-menu, .nav-toggle, .nav-utility {
    position: relative;
    z-index: 300 !important;
}

@media (max-width: 900px) {
    .logo-badge { left: -20px !important; transform: translateY(60px) !important; }
    .site-header.scrolled .logo-badge { transform: translateY(-14px) !important; }
    .logo-badge-circle { width: 108px; height: 108px; }
}
@media (max-width: 500px) {
    .logo-badge { left: -8px !important; transform: translateY(48px) !important; }
    .site-header.scrolled .logo-badge { transform: translateY(-10px) !important; }
    .logo-badge-circle { width: 90px; height: 90px; }
}
@media (prefers-reduced-motion: reduce) {
    .logo-badge { transition: none !important; }
}

/* ============================================================
   Step 54: logo pulled toward center + pushed down slightly
============================================================ */
.logo-badge {
    left: 8px !important;
    transform: translateY(102px) !important;
}

/* ============================================================
   Step 55: menu always starts clear of the logo (desktop only)
============================================================ */
@media (min-width: 901px) {
    .nav-menu {
        margin-left: 170px !important;
    }
}

/* -------------------- LOAN CALCULATOR + SCHEDULE MODAL (Step 56) -------------------- */
.loan-calc-panel { background: #fff; border-radius: 8px; padding: 32px; box-shadow: var(--shadow); }
.btn-outline-forest { background: transparent; border: 1px solid var(--forest); color: var(--forest); padding: 12px 28px; border-radius: var(--radius); font-weight: 600; cursor: pointer; }
.btn-outline-forest:hover { background: var(--sage); }

.schedule-modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(14,42,31,0.55);
    z-index: 1000; align-items: center; justify-content: center; padding: 20px;
}
.schedule-modal-overlay.active { display: flex; }
.schedule-modal {
    background: #fff; border-radius: 10px; width: 100%; max-width: 720px;
    max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.schedule-modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 24px; border-bottom: 1px solid #eee;
}
.schedule-modal-header h3 { margin: 0; color: var(--forest); }
.schedule-close-btn { background: none; border: none; font-size: 26px; cursor: pointer; color: #889; line-height: 1; }
.schedule-close-btn:hover { color: var(--forest); }
.schedule-modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.schedule-summary { background: var(--sage); padding: 12px 16px; border-radius: 6px; font-size: 13px; margin-bottom: 16px; }
.schedule-table-wrap { overflow-x: auto; }
.schedule-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.schedule-table th { background: var(--forest); color: #fff; padding: 10px 12px; text-align: left; position: sticky; top: 0; }
.schedule-table td { padding: 8px 12px; border-bottom: 1px solid #eee; }
.schedule-table tr:nth-child(even) { background: #fafafa; }
.schedule-modal-footer {
    display: flex; gap: 10px; justify-content: flex-end;
    padding: 16px 24px; border-top: 1px solid #eee;
}

@media (max-width: 600px) {
    .schedule-modal { max-height: 92vh; }
    .schedule-table { font-size: 11px; }
    .schedule-table th, .schedule-table td { padding: 6px 8px; }
}
