/**
 * APMFI Theme – Layout (Header, Navbar, Footer)
 *
 * @package APMFI_Theme
 */

/* ── Top Bar ── */
.site-topbar {
    background: var(--color-primary);
    color: rgba(255,255,255,.92);
    font-size: .82rem;
    padding: 0;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    border-bottom: none;
}
.site-topbar a { color: rgba(255,255,255,.9); }
.site-topbar a:hover { color: #fff; }
.topbar-contact i { color: rgba(255,255,255,.7); margin-right: 5px; }
.topbar-contact span { color: rgba(255,255,255,.9); margin-right: 18px; }
.topbar-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,.15);
    margin-left: 5px;
    transition: background var(--transition-fast);
    border: 1px solid rgba(255,255,255,.3);
    color: rgba(255,255,255,.8);
}
.topbar-social a:hover {
    background: rgba(255,255,255,.2);
    border-color: rgba(255,255,255,.6);
    color: #fff;
}
a { text-decoration: none !important;}
/* ── Header / Navbar ── */
.site-header {
    background: #fff;
    box-shadow: 0 2px 16px rgba(184,0,15,.08);
    position: sticky;
    top: 0;
    z-index: 1030;
    transition: box-shadow var(--transition-base);
    overflow: visible;
    border-bottom: 3px solid var(--color-primary);
}
.site-header.scrolled { box-shadow: 0 4px 28px rgba(184,0,15,.12); }

.navbar-brand img { height: 55px; width: auto; }
.navbar-brand .brand-text { font-family: var(--font-primary); }
.brand-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-primary);
    display: block;
    line-height: 1.2;
}
.brand-tagline {
    font-size: .70rem;
    color: #777;
    display: block;
}

.navbar-nav .nav-link {
    font-weight: 600;
    font-size: .90rem;
    color: #1a1a1a !important;
    padding: 8px 8px !important;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    position: relative;
}
.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0; left: 14px; right: 14px;
    height: 4px;
    background: var(--color-primary);
    transform: scaleX(0);
    transition: transform var(--transition-fast);
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active { color: var(--color-primary) !important; }
.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after { transform: scaleX(1); }


.navbar-nav .dropdown-menu {
    border: none;
    border-top: 3px solid var(--color-primary);
    box-shadow: 0 8px 32px rgba(184,0,15,.1);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    padding: 8px 0;
    min-width: 220px;
    margin-top: 8px;
}
.navbar-nav .dropdown-item {
    font-size: .88rem;
    font-weight: 500;
    padding: 9px 20px;
    color: var(--color-text);
    transition: all var(--transition-fast);
}
.navbar-nav .dropdown-item:hover {
    background: rgba(184,0,15,.05);
    color: var(--color-primary);
    padding-left: 26px;
}
.dropdown-item.active {
    color: var(--color-primary) !important;
    text-decoration: none !important;
    background-color: rgba(184, 0, 15, 0.07) !important;
}

.btn-header-apply {
    background: var(--color-primary) !important;
    color: #fff !important;
    border: 2px solid var(--color-primary) !important;
    border-radius: var(--radius-full);
    padding: 8px 22px !important;
    font-weight: 600;
    font-size: .88rem;
    transition: all var(--transition-fast);
}
.btn-header-apply:hover {
    background: var(--color-primary-dark) !important;
    border-color: var(--color-primary-dark) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(184,0,15,.4);
}
.btn-header-apply::after { display: none !important; }

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23b8000f' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ── Navbar Search ── */
.btn-nav-search {
    width: 36px; height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(184,0,15,.08);
    color: var(--color-primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: .95rem;
    transition: background .2s, transform .2s;
    flex-shrink: 0;
}
.btn-nav-search:hover,
.btn-nav-search.active {
    background: var(--color-primary);
    color: #fff;
    transform: scale(1.05);
}

.nav-search-bar {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: #fff;
    border-top: 3px solid var(--color-primary);
    box-shadow: 0 8px 32px rgba(0,0,0,.12);
    z-index: 1029;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height .3s ease, opacity .3s ease, padding .3s ease;
}
.nav-search-bar.is-open {
    max-height: 90px;
    opacity: 1;
    padding: 8px 24px;
}

.nav-search-form {
    display: flex;
    gap: 0;
    max-width: 600px;
    margin: 0 auto;
    border: 2px solid var(--color-primary);
    border-radius: 8px;
    overflow: hidden;
}
.nav-search-input {
    flex: 1;
    border: none;
    padding: 10px 16px;
    font-size: .92rem;
    outline: none;
    color: #1a1a1a;
}
.nav-search-submit,
.nav-search-close {
    background: none;
    border: none;
    padding: 10px 16px;
    cursor: pointer;
    font-size: .9rem;
    transition: background .15s;
}
.nav-search-submit { background: var(--color-primary); color: #fff; }
.nav-search-submit:hover { background: var(--color-primary-dark); }
.nav-search-close { color: #888; border-left: 1px solid #eee; }
.nav-search-close:hover { background: #f5f5f5; color: #333; }

/* ── Footer ── */
.site-footer {
    background: linear-gradient(160deg,
        var(--color-primary) 0%,
        #8c000b 40%,
        #5c0008 70%,
        #3a0005 100%);
    color: rgba(255,255,255,.8);
    padding: 60px 0 0;
    position: relative;
    overflow: hidden;
    border-top: none;
}
.site-footer::before {
    content: '';
    position: absolute; inset: 0;
    background-image: radial-gradient(circle at 80% 20%, rgba(255,255,255,.06) 0%, transparent 50%),
                      radial-gradient(circle at 10% 80%, rgba(255,255,255,.04) 0%, transparent 40%);
    pointer-events: none;
}
.site-footer .container { position: relative; z-index: 1; }

.footer-brand{
    display: flex;
    flex-direction: column;
    align-items: center;
}
.footer-regulators{
    align-self: start;
}
.footer-desc {
    color: rgba(255,255,255,.7);
    font-size: .85rem;
    line-height: 1.75;
    margin: 16px 0;
}
.footer-heading {
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #fff;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255,255,255,.25);
    display: inline-block;
}
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-links a {
    font-size: .85rem;
    color: rgba(255,255,255,.65);
    transition: color .2s, padding-left .2s;
    display: inline-block;
}
.footer-links a:hover { color: #fff; padding-left: 8px; }
.footer-links a::before { margin-right: 6px; opacity: .5; }

.footer-contact-item {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
}
.footer-contact-icon {
    width: 36px; height: 36px;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .85rem;
    flex-shrink: 0;
    backdrop-filter: blur(4px);
}
.footer-contact-icon:hover { background: rgba(255,255,255,.25); }
.footer-contact-label {
    font-size: .72rem;
    color: rgba(255,255,255,.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.footer-contact-text { font-size: .8rem; color: rgba(255,255,255,.8); }
.footer-contact-text a { color: #fff; text-decoration: underline; text-decoration-color: rgba(255,255,255,.3); }
.footer-contact-text a:hover { text-decoration-color: #fff; }

.footer-social a {
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,.7);
    margin: 2px;
    transition: all var(--transition-fast);
    font-size: 1.5rem;
    background: rgba(255,255,255,.08);
}
.footer-social a:hover {
    background: #fff;
    border-color: #fff;
    color: var(--color-primary);
    transform: translateY(-2px);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.12);
    background: rgba(0,0,0,.2);
    padding: 8px 0;
    font-size: .80rem;
    color: rgba(255,255,255,.5);
}
.footer-bottom a { color: rgba(255,255,255,.5); transition: color .2s; }
.footer-bottom a:hover { color: #fff; }
.footer-regulators .badge {
    background: rgba(255,255,255,.15) !important;
    color: #fff;
    border: 1px solid rgba(255,255,255,.25);
}

/* ── Page Hero (inner pages) ── */
.page-hero {
    background: var(--color-primary);
    padding: var(--section-pad);
    color: #fff;
    position: relative;
    overflow: hidden;
    border-bottom: none;
}
.page-hero::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(0,0,0,.2) 0%, transparent 60%);
    opacity: 1;
    pointer-events: none;
}
.page-hero::after {
    content: '';
    position: absolute;
    bottom: -50px; right: -50px;
    width: 260px; height: 260px;
    border-radius: 50%;
    border: 40px solid rgba(255,255,255,.07);
    pointer-events: none;
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero-title {
    font-size: clamp(1.6rem,4vw,2.6rem);
    color: #fff;
    font-weight: 800;
}
.breadcrumb { background: none; padding: 0; }
.breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,.5); }
.breadcrumb-item a { color: rgba(255,255,255,.7); }
.breadcrumb-item.active { color: rgba(255,255,255,.9); }

/* ── Section shared styles ── */
.section-pad { padding: var(--section-pad); }
.section-bg-light { background: var(--color-off-white); }
.section-bg-dark { background: #0a0a0a; color: #fff; }
.section-bg-primary { background: var(--color-primary); }

.section-heading { margin-bottom: 50px; }
.section-eyebrow {
    display: inline-block;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-primary);
    margin-bottom: 10px;
    position: relative;
    padding-left: 22px;
}
.section-eyebrow::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 14px; height: 2px;
    background: var(--color-primary);
}
.section-title {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 14px;
}
.section-title .text-primary-custom { color: var(--color-primary); }
.section-desc { color: var(--color-mid-gray); max-width: 580px; font-size: 1rem; }
.divider-bar {
    width: 48px; height: 3px;
    background: var(--color-primary);
    border-radius: var(--radius-full);
    margin: 14px 0 20px;
}

/* ── Back to top ── */
.back-to-top {
    right: 30px;
    width: 44px; height: 0;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .88rem;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity var(--transition-base), transform var(--transition-base), background var(--transition-fast);
    z-index: 999;
    box-shadow: 0 4px 16px rgba(184,0,15,.45);
}
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); height: 44px;margin: 5px;}
.back-to-top:hover { background: var(--color-primary-dark); transform: translateY(-3px); }

/* ── Page Sidebar ── */
.page-sidebar .widget {
    background: #fff;
    border: 1px solid #eaeaea;
    border-top: 3px solid var(--color-primary);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
}
.widget { margin-bottom: 30px; }
.widget-title {
    font-size: .88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-primary);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eaeaea;
}

ul.page-numbers {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ── <li> ── */
ul.page-numbers > li {
    display: inline-flex;
}

/* ── Page buttons: <a> and <span> inside <li> ── */
ul.page-numbers > li > a.page-numbers,
ul.page-numbers > li > span.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: .85rem;
    font-weight: 600;
    border: 1.5px solid #e0e0e0;
    color: #444;
    text-decoration: none;
    transition: background .2s, border-color .2s, color .2s;
    line-height: 1;
    white-space: nowrap;
}

/* Inner <span class="page-number"> — display:contents keeps layout clean */
ul.page-numbers > li > a.page-numbers > .page-number,
ul.page-numbers > li > span.page-numbers > .page-number {
    display: contents;
}

/* ── Hover ── */
ul.page-numbers > li > a.page-numbers:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

/* ── Current page ── */
ul.page-numbers > li > span.page-numbers.current {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    cursor: default;
}

/* ── Dots ( … ) ── */
ul.page-numbers > li > span.page-numbers.dots {
    background: none;
    border-color: transparent;
    color: #aaa;
    cursor: default;
}

/* ── Prev / Next ── */
ul.page-numbers > li > a.prev.page-numbers,
ul.page-numbers > li > a.next.page-numbers {
    padding: 0 12px;
    border-color: var(--color-primary);
    color: var(--color-primary);
    font-weight: 700;
}
ul.page-numbers > li > a.prev.page-numbers:hover,
ul.page-numbers > li > a.next.page-numbers:hover {
    background: var(--color-primary);
    color: #fff;
}

/* ── Fallback: .nav-links (paginate_links without <ul>) ── */
.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    align-items: center;
}
.form-check-input:checked {
    background-color: var(--color-primary) !important;
    border-color: var(--color-primary-dark) !important;
}
.form-check-input:focus{
    box-shadow: none !important;
}

