/* ==========================================================================
   Header: top bar + main bar
   ========================================================================== */
:root { --topbar-bg: #141b3d; --menu-bg: #141b3d; }
.dark-theme { --topbar-bg: #080c20; --menu-bg: #0e1330; }

/* theme button (light bar) */
.theme-btn {
    width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; cursor: pointer;
    border: 1px solid var(--border); background: var(--bg-soft); color: var(--text);
    transition: border-color .2s, color .2s, transform .2s;
}
.theme-btn:hover { border-color: var(--primary); color: var(--primary); transform: rotate(15deg); }

/* ---------- Main bar ---------- */
header {
    background: var(--nav);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-wrapper { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; height: 72px; }

.logo-container { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.logo-img { height: 48px; width: auto; border-radius: 10px; flex-shrink: 0; }
.logo-text {
    font-size: 1.25rem; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* Nav */
.nav-links { display: flex; align-items: center; gap: .15rem; margin-left: auto; }
.nav-links > li > a {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 25px 14px; /* fills the bar height so the dropdown meets it */
    font-size: .95rem; font-weight: 600; color: var(--text); white-space: nowrap;
    transition: color .2s;
}
.nav-links > li > a:hover, .nav-links > li > a.active { color: var(--primary); }
.dropdown-icon { font-size: .85rem; transition: transform .2s; }
.nav-item:hover .dropdown-icon { transform: rotate(180deg); }

.nav-cta {
    display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
    padding: .7rem 1.4rem; border-radius: 12px; font-size: .9rem; font-weight: 800; letter-spacing: .02em;
    color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--primary) 28%, transparent);
    transition: background .2s, color .2s, transform .2s;
}
.nav-cta:hover { background: var(--primary); color: #fff; transform: translateY(-1px); }
.nav-tools { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.nav-mobile-extra { display: none; }

/* ---------- Dropdown: solid panel attached under the item ---------- */
.nav-item { position: relative; }
.dropdown {
    position: absolute; top: 100%; left: 0; min-width: 270px; z-index: 1000;
    background: var(--menu-bg); border-radius: 0 0 14px 14px; overflow: hidden;
    box-shadow: 0 18px 40px rgba(10, 15, 40, .28);
    opacity: 0; visibility: hidden; transform: translateY(8px); pointer-events: none;
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.nav-item:hover .dropdown, .nav-item:focus-within .dropdown { opacity: 1; visibility: visible; transform: none; pointer-events: auto; }

.dropdown a {
    display: flex; align-items: baseline; justify-content: space-between; gap: 1.5rem;
    padding: 15px 24px; color: #fff; font-size: .95rem; font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    transition: background .2s, padding-left .2s;
}
.dropdown a small { font-size: .72rem; font-weight: 400; color: rgba(255, 255, 255, .55); }
.dropdown a:hover { background: rgba(255, 255, 255, .08); padding-left: 30px; }
.dropdown a.dd-all { justify-content: flex-start; gap: 10px; border-bottom: none; color: var(--secondary); font-size: .88rem; }

/* ---------- Mobile toggle ---------- */
.mobile-toggle {
    display: none; width: 42px; height: 42px; flex-shrink: 0; border-radius: 10px;
    border: 1px solid var(--border); background: var(--bg-soft); color: var(--text);
    font-size: 1.1rem; cursor: pointer; align-items: center; justify-content: center;
}

/* ==========================================================================
   Tablet / mobile (<= 992px)
   ========================================================================== */
@media (max-width: 992px) {
    .nav-wrapper { height: 66px; gap: 1rem; }
    .nav-tools .nav-social-desktop { gap: 8px; }
    .nav-tools .nav-social-desktop .social-link-item { width: 38px; height: 38px; border-radius: 50%; }
    .nav-tools { margin-left: auto; gap: 12px; }          /* theme button sits clear of the menu icon */
    .mobile-toggle { display: inline-flex; }
    body.menu-open { overflow: hidden; }

    /* panel hangs directly under the bar: no gap */
    .nav-links {
        position: absolute; top: 100%; left: 0; right: 0; margin: 0;
        max-height: calc(100vh - 66px); max-height: calc(100dvh - 66px);
        overflow-y: auto; flex-direction: column; align-items: stretch; gap: 2px;
        padding: 10px 16px 24px; background: var(--nav);
        border-bottom: 1px solid var(--border); box-shadow: 0 20px 30px rgba(15, 23, 42, .14);
        opacity: 0; visibility: hidden; transform: translateY(-8px);
        transition: opacity .25s ease, transform .25s ease, visibility .25s;
    }
    .nav-links.open { opacity: 1; visibility: visible; transform: none; }
    .nav-links > li > a { width: 100%; justify-content: space-between; padding: 14px 12px; font-size: 1.02rem; border-bottom: 1px solid var(--border); }

    /* submenu = accordion with the same dark panel look */
    .dropdown {
        position: static; min-width: 0; max-height: 0; border-radius: 12px; box-shadow: none;
        opacity: 1; visibility: visible; transform: none; pointer-events: auto;
        transition: max-height .3s ease, margin .3s ease;
    }
    .nav-item.active .dropdown { max-height: 420px; margin: 4px 0 8px; }
    .nav-item.active .dropdown-icon { transform: rotate(180deg); }
    .nav-item:hover .dropdown-icon { transform: none; }
    .nav-item.active:hover .dropdown-icon { transform: rotate(180deg); }
    .dropdown a { padding: 13px 18px; }
    .dropdown a:hover { padding-left: 18px; }

    /* extras at the bottom of the mobile menu */
    .nav-mobile-extra { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
    .nav-links > li.nav-mobile-extra > a.nav-cta { width: 100%; padding: 14px; justify-content: center; border: 1px solid color-mix(in srgb, var(--primary) 28%, transparent); }
    .nav-mobile-extra .social-links { justify-content: center; gap: 12px; }
}

@media (max-width: 480px) {
    .logo-img { height: 40px; }
    .logo-text { font-size: 1.1rem; }
}

section[id] { scroll-margin-top: 84px; }

/* ==========================================================================
   Social buttons (used in the footer)
   ========================================================================== */
.social-links { display: flex; align-items: center; gap: .5rem; }
.social-link-item {
    position: relative; display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 10px; background: var(--bg-soft);
    border: 1px solid var(--border); color: var(--primary); font-size: 1rem;
    transition: all .3s ease; overflow: hidden; z-index: 1;
}
.social-link-item:hover { color: #fff; transform: translateY(-2px); border-color: transparent; box-shadow: 0 6px 14px rgba(0, 0, 0, .1); }
.social-link-item::before { content: ''; position: absolute; top: 100%; left: 0; width: 100%; height: 100%; background: var(--primary); transition: all .3s ease; z-index: -1; }
.social-link-item:hover::before { top: 0; }
.social-link-item.fb:hover::before { background: #1877F2; }
.social-link-item.ig:hover::before { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }

/* small phones: slightly smaller buttons so logo + icons + theme + menu all fit */
@media (max-width: 400px) {
    .nav-wrapper { gap: .5rem; }
    .nav-tools { gap: 8px; }
    .nav-tools .nav-social-desktop { gap: 6px; }
    .nav-tools .nav-social-desktop .social-link-item { width: 34px; height: 34px; font-size: .9rem; }
    .theme-btn { width: 36px; height: 36px; }
    .mobile-toggle { width: 38px; height: 38px; }
    .logo-img { height: 34px; }
    .logo-text { font-size: .95rem; letter-spacing: .5px; }
    .logo-container { gap: 8px; min-width: 0; }
}
@media (max-width: 330px) {
    .logo-text { display: none; }
}

/* brand colours on the header icons so they read at a glance */
.nav-social-desktop .social-link-item.fb { color: #1877F2; }
.nav-social-desktop .social-link-item.ig { color: #dc2743; }
.nav-social-desktop .social-link-item:hover { color: #fff; }
