:root {
    --branch-navy: #061a42;
    --branch-navy-deep: #03112d;
    --branch-blue: #0868e8;
    --branch-blue-bright: #1595ff;
    --branch-text: #101b38;
    --branch-muted: #5d667b;
    --branch-line: #dfe5ef;
    --branch-soft: #f4f7fb;
    --branch-white: #fff;
    --branch-shadow: 0 14px 38px rgba(8, 32, 73, 0.1);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.branches-page {
    margin: 0;
    color: var(--branch-text);
    background: #fff;
    font-family: "Poppins", "Open Sans", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.branches-page a {
    color: inherit;
    text-decoration: none;
}

.branches-page button,
.branches-page input,
.branches-page select {
    font: inherit;
}

.site-container {
    width: min(100% - 48px, 1368px);
    margin-inline: auto;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    z-index: 1000;
    top: 12px;
    left: 12px;
    padding: 10px 16px;
    color: #fff !important;
    background: var(--branch-blue);
    border-radius: 8px;
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.utility-bar {
    color: #fff;
    background: linear-gradient(90deg, #061c4a, #031432);
    font-size: 13px;
}

.utility-bar__inner {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.utility-bar__contacts,
.utility-bar__social {
    display: flex;
    align-items: center;
    gap: 28px;
}

.utility-bar i {
    margin-right: 8px;
}

.utility-bar__social {
    gap: 16px;
}

.utility-bar__social i {
    margin: 0;
}

.main-nav-wrap {
    position: relative;
    z-index: 20;
    background: #fff;
    box-shadow: 0 5px 18px rgba(8, 23, 52, 0.07);
}

.main-nav {
    min-height: 86px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 36px;
}

.brand {
    display: inline-flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-start;
}

.brand img {
    display: block;
    width: 228px;
    height: auto;
}

.desktop-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: clamp(18px, 2vw, 38px);
}

.desktop-nav a {
    position: relative;
    color: #0b1020;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
}

.desktop-nav a::after {
    position: absolute;
    right: 0;
    bottom: -12px;
    left: 0;
    height: 2px;
    background: var(--branch-blue-bright);
    content: "";
    opacity: 0;
    transform: scaleX(0.45);
    transition: 180ms ease;
}

.desktop-nav a:hover::after,
.desktop-nav a:focus-visible::after {
    opacity: 1;
    transform: scaleX(1);
}

.desktop-nav i {
    margin-left: 4px;
}

.main-nav__actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.donate-button {
    display: inline-flex;
    min-height: 48px;
    padding: 0 26px;
    align-items: center;
    justify-content: center;
    color: #fff !important;
    background: linear-gradient(135deg, #0b78e9, #0758c4);
    border-radius: 7px;
    box-shadow: 0 9px 20px rgba(8, 104, 232, 0.22);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.donate-button:hover,
.donate-button:focus-visible {
    box-shadow: 0 12px 25px rgba(8, 104, 232, 0.32);
    transform: translateY(-2px);
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    color: var(--branch-navy);
    background: transparent;
    border: 0;
    font-size: 26px;
    cursor: pointer;
}

.mobile-nav {
    padding: 4px 24px 20px;
    border-top: 1px solid var(--branch-line);
}

.mobile-nav a {
    display: block;
    padding: 12px 4px;
    color: var(--branch-navy);
    border-bottom: 1px solid #edf1f6;
    font-weight: 700;
}

.mobile-nav .mobile-nav__donate {
    margin-top: 14px;
    padding: 12px 18px;
    color: #fff;
    background: linear-gradient(135deg, #0b78e9, #0758c4);
    border: 0;
    border-radius: 7px;
    text-align: center;
    text-transform: uppercase;
}

.branches-hero {
    position: relative;
    min-height: 370px;
    overflow: hidden;
    color: #fff;
    background: #071c45;
    border-radius: 0 0 22px 22px;
    isolation: isolate;
}

.branches-hero__backdrop {
    position: absolute;
    z-index: -2;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(5, 27, 69, 0.98) 0%, rgba(5, 31, 77, 0.9) 48%, rgba(5, 28, 68, 0.76) 100%),
        url("../images/home/church-image.jpg") center 53% / cover no-repeat;
}

.branches-hero__backdrop::after {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 78% 50%, rgba(21, 149, 255, 0.18), transparent 34%),
        linear-gradient(0deg, rgba(2, 16, 43, 0.46), transparent 46%);
    content: "";
}

.branches-hero__inner {
    min-height: 370px;
    display: grid;
    grid-template-columns: minmax(560px, 1fr) 420px;
    align-items: center;
    gap: 42px;
}

.branches-hero__content {
    padding: 42px 0;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
    font-size: 17px;
}

.breadcrumbs a {
    color: var(--branch-blue-bright);
}

.branches-hero h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(40px, 4.2vw, 62px);
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.title-rule {
    display: block;
    width: 56px;
    height: 3px;
    margin: 18px 0 12px;
    background: var(--branch-blue-bright);
}

.branches-hero__content > p {
    margin: 0;
    font-size: clamp(17px, 1.6vw, 22px);
}

.branch-stats {
    margin-top: 26px;
    display: flex;
    align-items: center;
    gap: clamp(38px, 5vw, 80px);
}

.branch-stat {
    display: flex;
    align-items: center;
    gap: 16px;
}

.branch-stat__icon {
    width: 58px;
    height: 58px;
    display: grid;
    flex: 0 0 58px;
    place-items: center;
    color: #fff;
    background: linear-gradient(145deg, #1187ff, #0751c9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 64, 176, 0.28);
    font-size: 23px;
}

.branch-stat strong,
.branch-stat small {
    display: block;
}

.branch-stat strong {
    color: #fff;
    font-size: 25px;
    line-height: 1.2;
}

.branch-stat small {
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 17px;
}

.kenya-map {
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kenya-map img {
    width: auto;
    height: 390px;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 15px 26px rgba(0, 91, 230, 0.25));
}

.branches-directory {
    padding: 22px 0 84px;
    background:
        radial-gradient(circle at 50% 0%, rgba(27, 130, 255, 0.045), transparent 36%),
        #fff;
}

.branch-filters {
    position: relative;
    z-index: 5;
    margin-top: -4px;
    padding: 20px 22px;
    display: grid;
    grid-template-columns: minmax(300px, 1fr) 185px 185px 170px;
    gap: 18px;
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 16px;
    box-shadow: var(--branch-shadow);
}

.branch-search,
.select-control {
    position: relative;
    min-height: 50px;
}

.branch-search {
    display: flex;
    align-items: center;
}

.branch-search i {
    position: absolute;
    left: 20px;
    color: var(--branch-navy);
}

.branch-search input,
.select-control select {
    width: 100%;
    height: 50px;
    color: var(--branch-text);
    background: #fff;
    border: 1px solid #d4dce8;
    border-radius: 8px;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.branch-search input {
    padding: 0 18px 0 50px;
}

.select-control select {
    padding: 0 38px 0 16px;
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--branch-navy) 50%),
        linear-gradient(135deg, var(--branch-navy) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 22px,
        calc(100% - 13px) 22px;
    background-repeat: no-repeat;
    background-size: 5px 5px, 5px 5px;
}

.branch-search input:focus,
.select-control select:focus {
    border-color: var(--branch-blue);
    box-shadow: 0 0 0 3px rgba(8, 104, 232, 0.12);
}

.map-button {
    min-height: 50px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #fff !important;
    background: linear-gradient(135deg, #0a2d68, #052259);
    border-radius: 8px;
    font-weight: 700;
}

.filter-summary {
    margin: 14px 4px 12px;
    color: var(--branch-muted);
    font-size: 13px;
}

.branches-table-wrap {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--branch-line);
    border-radius: 12px;
    box-shadow: var(--branch-shadow);
}

.branches-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.branches-table th {
    padding: 17px 24px;
    color: #fff;
    background: linear-gradient(90deg, #083b83, #0758ba);
    font-size: 13px;
    letter-spacing: 0.02em;
    text-align: left;
    text-transform: uppercase;
}

.branches-table th:first-child {
    width: 88px;
    text-align: center;
}

.branches-table th:nth-child(2) {
    width: 280px;
}

.branches-table th:nth-child(4) {
    width: 330px;
}

.branches-table td {
    padding: 21px 24px;
    vertical-align: top;
    border-bottom: 1px solid var(--branch-line);
}

.branches-table tbody tr:last-child td {
    border-bottom: 0;
}

.branches-table tbody tr {
    transition: background-color 150ms ease;
}

.branches-table tbody tr:hover {
    background: #f8fbff;
}

.branches-table td:first-child {
    text-align: center;
}

.branch-number {
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    color: var(--branch-navy);
    background: #edf4ff;
    border-radius: 9px;
    font-weight: 700;
}

.branch-name {
    display: block;
    margin-top: 1px;
    color: #08152f;
    font-size: 15px;
}

.branch-county {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    color: #34415b;
    font-size: 13px;
}

.branch-county i {
    color: #0a428d;
}

.branches-table td > p {
    margin: 0;
    color: #344057;
    font-size: 14px;
    line-height: 1.8;
}

.pastor-name {
    color: var(--branch-text) !important;
}

.branch-phones {
    margin-top: 8px;
    color: #0853bf;
    font-size: 14px;
    font-weight: 700;
}

.branch-phones i {
    margin-right: 9px;
    color: #073b80;
}

.branch-phones a {
    color: #085ccd;
}

.branch-phones a:hover,
.branch-phones a:focus-visible {
    text-decoration: underline;
}

.branches-mobile-list {
    display: none;
}

.no-results {
    padding: 60px 20px;
    color: var(--branch-muted);
    text-align: center;
}

.no-results i {
    color: var(--branch-blue);
    font-size: 38px;
}

.no-results h3 {
    margin: 12px 0 4px;
    color: var(--branch-navy);
}

.no-results p {
    margin: 0 0 18px;
}

.no-results button {
    padding: 10px 18px;
    color: #fff;
    background: var(--branch-blue);
    border: 0;
    border-radius: 7px;
    cursor: pointer;
}

.site-footer {
    padding: 48px 0;
    color: rgba(255, 255, 255, 0.78);
    background: var(--branch-navy-deep);
    text-align: center;
}

.site-footer img {
    width: 180px;
    height: auto;
}

.site-footer p {
    margin: 12px 0 0;
}

@media (max-width: 1180px) {
    .desktop-nav {
        gap: 16px;
    }

    .desktop-nav a {
        font-size: 12px;
    }

    .brand img {
        width: 190px;
    }

    .branches-hero__inner {
        grid-template-columns: minmax(500px, 1fr) 330px;
    }

    .branch-stats {
        gap: 30px;
    }

    .branch-filters {
        grid-template-columns: minmax(260px, 1fr) 170px 170px 155px;
    }

    .branches-table th:nth-child(2) {
        width: 230px;
    }

    .branches-table th:nth-child(4) {
        width: 290px;
    }
}

@media (max-width: 940px) {
    .utility-bar,
    .desktop-nav {
        display: none;
    }

    .main-nav__actions .donate-button {
        display: none;
    }

    .main-nav {
        min-height: 86px;
    }

    .brand img {
        width: 210px;
    }

    .menu-toggle {
        display: inline-grid;
        place-items: center;
    }

    .branches-hero__inner {
        grid-template-columns: minmax(430px, 1fr) 300px;
    }

    .branch-stats {
        gap: 18px;
    }

    .branch-stat {
        gap: 10px;
    }

    .branch-stat__icon {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
    }

    .branch-stat strong {
        font-size: 21px;
    }

    .branch-stat small {
        font-size: 14px;
    }

    .branch-filters {
        grid-template-columns: 1fr 1fr;
    }

    .branch-search {
        grid-column: 1 / -1;
    }

    .map-button {
        grid-column: 2;
    }

    .branches-table th:nth-child(2) {
        width: 200px;
    }

    .branches-table th:nth-child(4) {
        width: 245px;
    }

    .branches-table th,
    .branches-table td {
        padding-right: 16px;
        padding-left: 16px;
    }
}

@media (max-width: 767px) {
    body.branches-page {
        background: var(--branch-soft);
        font-size: 15px;
    }

    .site-container {
        width: min(100% - 28px, 680px);
    }

    .main-nav {
        min-height: 82px;
        gap: 12px;
    }

    .brand img {
        width: 185px;
    }

    .main-nav__actions {
        gap: 6px;
    }

    .donate-button {
        min-height: 46px;
        padding: 0 20px;
        font-size: 13px;
    }

    .menu-toggle {
        width: 42px;
        font-size: 24px;
    }

    .branches-hero {
        min-height: 0;
        border-radius: 0;
    }

    .branches-hero__backdrop {
        background:
            linear-gradient(90deg, rgba(3, 23, 58, 0.96) 0%, rgba(3, 26, 65, 0.78) 66%, rgba(3, 23, 58, 0.64) 100%),
            url("../images/home/church-image.jpg") 48% center / cover no-repeat;
    }

    .branches-hero__inner {
        min-height: 0;
        display: block;
    }

    .branches-hero__content {
        position: relative;
        z-index: 2;
        padding: 42px 0 24px;
    }

    .breadcrumbs {
        margin-bottom: 20px;
        font-size: 16px;
    }

    .branches-hero h1 {
        max-width: 310px;
        font-size: clamp(42px, 12vw, 58px);
        line-height: 1.04;
    }

    .title-rule {
        margin: 14px 0;
    }

    .branches-hero__content > p {
        max-width: 310px;
        font-size: 17px;
        line-height: 1.65;
    }

    .kenya-map {
        position: absolute;
        z-index: 1;
        top: 66px;
        right: -26px;
        width: 50%;
        height: 300px;
        opacity: 0.78;
    }

    .kenya-map img {
        width: 100%;
        height: auto;
        max-height: 330px;
    }

    .branch-stats {
        position: relative;
        right: auto;
        bottom: auto;
        left: auto;
        width: 100%;
        margin: 24px 0 0;
        padding: 18px 10px;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0;
        background: rgba(6, 34, 80, 0.9);
        border: 1px solid rgba(91, 158, 255, 0.45);
        border-radius: 14px;
        box-shadow: 0 16px 38px rgba(0, 0, 0, 0.22);
        backdrop-filter: blur(8px);
    }

    .branch-stat {
        min-width: 0;
        padding: 0 10px;
        justify-content: center;
    }

    .branch-stat + .branch-stat {
        border-left: 1px solid rgba(255, 255, 255, 0.24);
    }

    .branch-stat__icon {
        width: 45px;
        height: 45px;
        flex-basis: 45px;
        border-radius: 50%;
        font-size: 18px;
    }

    .branch-stat strong {
        font-size: clamp(16px, 3.4vw, 20px);
        white-space: nowrap;
    }

    .branch-stat small {
        font-size: 12px;
    }

    .branches-directory {
        padding: 0 0 58px;
        background: var(--branch-soft);
    }

    .branch-filters {
        margin: 0 -4px 18px;
        padding: 22px 16px 18px;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        border: 0;
        border-radius: 0 0 18px 18px;
        box-shadow: 0 12px 28px rgba(8, 32, 73, 0.08);
    }

    .branch-search {
        grid-column: 1 / -1;
    }

    .map-button {
        grid-column: 1 / -1;
        color: #0752bd !important;
        background: #f1f5fb;
        border: 1px solid #e9eef7;
    }

    .filter-summary {
        margin: 12px 2px;
    }

    .branches-table-wrap {
        display: none;
    }

    .branches-mobile-list {
        display: grid;
        gap: 14px;
    }

    .branch-card {
        padding: 20px 16px 16px;
        background: #fff;
        border: 1px solid #e4e9f1;
        border-radius: 13px;
        box-shadow: 0 8px 22px rgba(13, 36, 74, 0.05);
    }

    .branch-card__top {
        display: grid;
        grid-template-columns: 44px 48px minmax(0, 1fr) 24px;
        align-items: center;
        gap: 10px;
    }

    .branch-card__location {
        width: 48px;
        height: 48px;
        display: grid;
        place-items: center;
        color: #fff;
        background: linear-gradient(145deg, #0b4698, #062967);
        border-radius: 50%;
        font-size: 20px;
    }

    .branch-card__heading h3 {
        margin: 0;
        color: #09152f;
        font-size: 16px;
        line-height: 1.25;
    }

    .branch-card__heading p {
        margin: 4px 0 0;
        color: #34415a;
        font-size: 13px;
    }

    .branch-card__heading i {
        margin-right: 7px;
        color: #0b478f;
    }

    .branch-card__toggle {
        width: 24px;
        height: 40px;
        padding: 0;
        color: var(--branch-navy);
        background: transparent;
        border: 0;
        font-size: 26px;
        cursor: pointer;
    }

    .branch-card__churches {
        margin: 16px 0 12px;
        color: #4b566c;
        font-size: 14px;
        line-height: 1.75;
    }

    .branch-card__bottom {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .branch-card .branch-phones {
        margin: 0;
        font-size: 13px;
    }

    .details-button {
        flex: 0 0 auto;
        padding: 8px 12px;
        color: #0754bf;
        background: #fff;
        border: 1px solid #176fee;
        border-radius: 7px;
        font-weight: 700;
        cursor: pointer;
    }

    .branch-card__details {
        margin-top: 14px;
        padding: 13px 14px;
        color: #3e4a62;
        background: #f5f8fd;
        border-radius: 9px;
        font-size: 13px;
    }

    .branch-card__details strong {
        color: var(--branch-navy);
    }

    .branch-card__details p {
        margin: 3px 0 0;
    }

    .branch-card.is-open .branch-card__toggle {
        transform: rotate(90deg);
    }

    .site-footer {
        padding: 38px 0;
    }
}

@media (max-width: 480px) {
    .site-container {
        width: min(100% - 24px, 440px);
    }

    .brand img {
        width: 155px;
    }

    .donate-button {
        padding: 0 15px;
    }

    .kenya-map {
        top: 72px;
        right: -34px;
        width: 55%;
    }

    .branch-stats {
        padding: 16px 5px;
    }

    .branch-stat {
        padding: 0 5px;
        gap: 7px;
    }

    .branch-stat__icon {
        width: 39px;
        height: 39px;
        flex-basis: 39px;
        font-size: 16px;
    }

    .branch-stat strong {
        font-size: clamp(14px, 4vw, 17px);
    }

    .branch-stat small {
        font-size: 11px;
    }

    .branch-card {
        padding-right: 13px;
        padding-left: 13px;
    }

    .branch-card__top {
        grid-template-columns: 40px 42px minmax(0, 1fr) 20px;
        gap: 8px;
    }

    .branch-number {
        width: 40px;
        height: 40px;
    }

    .branch-card__location {
        width: 42px;
        height: 42px;
    }

    .branch-card__bottom {
        align-items: flex-end;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }
}
