/* =========================================================
   LAYOUT.CSS
   ---------------------------------------------------------
   Header, navigation, mobile menu, inner-page banner, footer.
   Ye sab har public page pe same dikhta hai
   (JS se js/common.js me generate hota hai).
   ========================================================= */

/* ---------- TOP ANNOUNCEMENT BAR ---------- */

.topbar {
    background: var(--navy-900);
    color: #dbe7fa;
    font-size: 0.82rem;
}
.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 40px;
}
.topbar a { color: var(--gold-500); font-weight: 600; }
.topbar a:hover { color: #ffd45c; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 18px; min-width: 0; }
.topbar-left span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-item { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.topbar-item .icon { width: 15px; height: 15px; color: var(--gold-500); }
.topbar-tag {
    flex: none;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--gold-500);
    color: var(--navy-950);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ---------- HEADER ---------- */

/* #siteHeader is only a mount point. Without display:contents the sticky header is
   confined to this wrapper (same height as the header) and scrolls away with the page. */
#siteHeader { display: contents; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--line);
    transition: box-shadow var(--ease);
}
.site-header.scrolled { box-shadow: var(--shadow-sm); }

.header-inner {
    width: min(100% - 40px, 1320px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: var(--header-height);
}

.brand { display: flex; align-items: center; gap: 14px; flex: 0 1 auto; min-width: 0; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-logo { height: 50px; width: auto; flex: none; object-fit: contain; }
.brand-logo-imed { height: 44px; border-radius: 3px; }
.brand-logo-aacsb { height: 40px; }
.brand-divider { width: 1px; height: 34px; background: var(--line-strong); flex: none; }

.main-nav { display: flex; align-items: center; gap: 2px; }

.nav-link,
.nav-trigger {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 13px;
    background: none;
    border: 0;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: var(--ease);
}
.nav-link:hover,
.nav-trigger:hover,
.nav-item.open > .nav-trigger { color: var(--navy-900); background: var(--navy-50); }
.nav-link.active,
.nav-trigger.active { color: var(--navy-900); font-weight: 600; }
.nav-trigger .icon { width: 14px; height: 14px; transition: transform var(--ease); }
.nav-item.open > .nav-trigger .icon { transform: rotate(180deg); }

.nav-item { position: relative; }

.dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 250px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity var(--ease), transform var(--ease), visibility var(--ease);
}
.nav-item.open .dropdown,
.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown { opacity: 1; visibility: visible; transform: none; }

.dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}
.dropdown a .icon { width: 18px; height: 18px; color: var(--navy-600); }
.dropdown a:hover, .dropdown a.active { background: var(--navy-50); color: var(--navy-900); }

.header-actions { display: flex; align-items: center; gap: 12px; }

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1.5px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--navy-900);
}
.menu-toggle .icon { width: 22px; height: 22px; }

/* ---------- MOBILE NAVIGATION ---------- */

.mobile-nav {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: none;
    background: rgba(11, 27, 51, 0.45);
}
.mobile-nav.open { display: block; animation: fadeIn 0.2s ease; }

.mobile-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(88vw, 380px);
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.25s ease;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: none; } }

.mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}
.mobile-head img { height: 38px; width: auto; }
.mobile-body { flex: 1; overflow-y: auto; padding: 12px 12px 24px; }

.mobile-body > a,
.mobile-body summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    list-style: none;
}
.mobile-body summary::-webkit-details-marker { display: none; }
.mobile-body summary .icon { width: 16px; height: 16px; transition: transform var(--ease); }
.mobile-body details[open] summary .icon { transform: rotate(180deg); }
.mobile-body > a:hover, .mobile-body summary:hover { background: var(--navy-50); }
.mobile-body details a {
    display: block;
    padding: 11px 12px 11px 28px;
    font-size: 0.93rem;
    color: var(--text);
    border-left: 2px solid var(--line);
    margin-left: 18px;
}
.mobile-body details a:hover { color: var(--navy-900); border-left-color: var(--gold-500); }
.mobile-foot { padding: 16px 20px; border-top: 1px solid var(--line); }

/* ---------- INNER PAGE BANNER ---------- */

.page-hero {
    position: relative;
    padding: 56px 0 60px;
    background:
        radial-gradient(600px 240px at 90% 0%, rgba(246, 185, 0, 0.14), transparent 70%),
        radial-gradient(700px 300px at 0% 100%, rgba(31, 99, 191, 0.10), transparent 70%),
        var(--bg-soft);
    border-bottom: 1px solid var(--line);
    overflow: hidden;
}
.page-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(1, 47, 107, 0.09) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: linear-gradient(to left, #000, transparent 55%);
    -webkit-mask-image: linear-gradient(to left, #000, transparent 55%);
    pointer-events: none;
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero h1 { font-size: clamp(2rem, 4vw, 3rem); margin: 14px 0 14px; max-width: 820px; }
.page-hero p.lead { max-width: none; color: var(--muted); }

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
    font-size: 0.85rem;
    color: var(--muted);
}
.breadcrumb a { color: var(--navy-700); font-weight: 500; }
.breadcrumb .sep { opacity: 0.5; }
.breadcrumb .current { color: var(--ink); font-weight: 600; }

/* ---------- FOOTER ---------- */

.site-footer { background: var(--bg-soft); border-top: 1px solid var(--line); }
.footer-main {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.3fr;
    gap: 48px;
    padding: 64px 0 48px;
}
.footer-brand img { height: 52px; width: auto; margin-bottom: 18px; }
.footer-brand p { font-size: 0.92rem; color: var(--muted); max-width: 340px; }
.footer-logos { display: flex; align-items: center; gap: 14px; margin-top: 22px; flex-wrap: wrap; }
.footer-logos img {
    height: 40px;
    width: auto;
    padding: 6px 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.footer-col h4 {
    font-family: var(--font-body);
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink);
    margin-bottom: 18px;
}
.footer-col li + li { margin-top: 10px; }
.footer-col a { font-size: 0.92rem; color: var(--text); }
.footer-col a:hover { color: var(--navy-900); padding-left: 3px; }

.footer-contact li { display: flex; gap: 12px; font-size: 0.92rem; color: var(--text); }
.footer-contact .icon { margin-top: 3px; color: var(--navy-600); width: 18px; height: 18px; }

.footer-bottom { border-top: 1px solid var(--line); background: #fff; }
.footer-bottom-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 18px 0;
    font-size: 0.85rem;
    color: var(--muted);
}
.footer-bottom a { color: var(--navy-700); font-weight: 500; }

.back-to-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 900;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: var(--navy-900);
    color: #fff;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--ease);
}
.back-to-top.show { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { background: var(--navy-800); }

/* ---------- RESPONSIVE ---------- */

@media (max-width: 1100px) {
    .main-nav, .header-actions .btn { display: none; }
    .menu-toggle { display: grid; }
    .footer-main { grid-template-columns: 1fr 1fr; gap: 40px; }
}

@media (max-width: 768px) {
    :root { --header-height: 68px; }
    .topbar-right { display: none; }
    .brand { gap: 10px; }
    .brand-divider { height: 28px; }
    .brand-logo { height: 38px; }
    .brand-logo-imed { height: 34px; }
    .brand-logo-aacsb { height: 30px; }
    .page-hero { padding: 40px 0 44px; }
    .footer-main { grid-template-columns: 1fr; gap: 32px; padding: 48px 0 32px; }
    .footer-bottom-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
    .header-inner { gap: 10px; width: min(100% - 24px, 1320px); }
    .brand { gap: 7px; }
    .brand-divider { height: 24px; }
    .brand-logo { height: 30px; }
    .brand-logo-imed { height: 28px; }
    .brand-logo-aacsb { height: 24px; }
}

/* very narrow phones: keep all three logos on one line */
@media (max-width: 360px) {
    .brand { gap: 5px; }
    .brand-logo { height: 26px; }
    .brand-logo-imed { height: 24px; }
    .brand-logo-aacsb { height: 20px; }
}

/* Footer logos: AACSB beside BVDU, then IMED and Salford below, larger */
.footer-top-logos { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.footer-top-logos img { height: 64px; width: auto; margin-bottom: 0; }
.footer-logos img { height: 60px; padding: 8px 14px; }

/* Footer: 2x2 grid of identical logos */
.footer-brand .footer-logo-grid { display: grid; grid-template-columns: repeat(2, 160px); gap: 14px; margin: 22px 0 18px; }
.footer-brand .footer-logo-grid img { width: 160px; height: 76px; object-fit: contain; padding: 10px; margin: 0; box-sizing: border-box; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); }

/* Nav labels stay on one line (longer labels such as "Panel Discussions") */
.nav-link, .nav-trigger { white-space: nowrap; }

/* Phone list (contact page + footer) */
.phone-group + .phone-group { margin-top: 12px; }
.phone-group-title { display: block; margin-bottom: 4px; }
.phone-group > div { line-height: 1.6; }
.phone-group .muted { margin-right: 6px; }

/* Amount to pay under the registration type */
.fee-inline { display: flex; gap: 8px; align-items: baseline; margin-top: 10px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--navy-50); color: var(--navy-900); }
.fee-inline[hidden] { display: none; }
.fee-inline strong { font-size: 1.05rem; }

/* ---- Footer: Follow Us ---- */
.footer-social { margin-top: 26px; }
.footer-social h4 { font-size: 1.05rem; color: var(--navy-900); margin: 0 0 14px; }
.footer-social-links { display: flex; flex-wrap: wrap; gap: 12px; }
.footer-social-links a { width: 44px; height: 44px; border-radius: 50%; background: #fff; border: 1px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-xs); transition: transform .2s ease, box-shadow .2s ease; }
.footer-social-links a:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(15, 30, 70, .15); padding-left: 0; }
.footer-social-links a:focus-visible { outline: 2px solid var(--navy-600); outline-offset: 2px; }
.footer-social-links svg { width: 22px; height: 22px; display: block; }
