* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Colour Variables */
:root {
    --blue-darkest: #000C70;
    --blue-darker: #100484;
    --blue-dark: #3420E4;
    --blue-light: #27B7FE;
}

body {
    overflow-x: hidden;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.transparent-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.3) 100%);
    z-index: 99;
    overflow: hidden;
}

.bg-blue-darkest {
    background-color: var(--blue-darkest);
}

.bg-blue-darker {
    background-color: var(--blue-darker);
}

.bg-blue-dark {
    background-color: var(--blue-dark);
}

.bg-blue-light {
    background-color: var(--blue-light);
}

.color-blue-darkest {
    color: var(--blue-darkest);
}

.color-blue-darker {
    color: var(--blue-darker);
}

.color-blue-dark {
    color: var(--blue-dark);
}

.color-blue-light {
    color: var(--blue-light);
}

/* Header */
.header-divider {
    height: 2px;
    background: #2A7B9B;
    background: linear-gradient(90deg, rgba(42, 123, 155, 1) 0%, rgba(87, 199, 133, 1) 16%, rgba(237, 221, 83, 1) 100%);
}

/* News Item */
.news-item-lg {
    border-right: 2px solid var(--blue-dark);
}

.gradient-underline {
    height: 2px;
    background: #2A7B9B;
    background: linear-gradient(90deg, rgba(42, 123, 155, 1) 0%, rgba(87, 199, 133, 1) 16%, rgba(237, 221, 83, 1) 100%);
}

.important-websites-header h2:after {
    background-color: var(--blue-dark);
}

/* Right dot */

/* .right-triangle-dark {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgb(217, 214, 255);
    position: absolute;
    right: -1.2rem;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 2s ease, opacity 0.4s ease;

    display: none;
    z-index: 2000 !important;
} */

.right-triangle-dark {
    width: 0;
    height: 0;
    border-top: .35rem solid transparent;
    border-bottom: .35rem solid transparent;
    border-left: .35rem solid #ffffff;
    position: absolute;
    right: -1.2rem;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 1s ease;
    transition: transform 2s ease, opacity 0.4s ease;

    display: none;
    z-index: 2000 !important;
    /* hidden by default */
}

/* bottom triangle */
.bottom-triangle {
    width: 0;
    height: 0;
    border-left: .5rem solid transparent;
    border-right: .5rem solid transparent;
    border-top: .5rem solid white;
    position: absolute;
    bottom: -0.5rem;
    transition: transform 0.3s ease;
}

/* top triangle */
.top-triangle {
    width: 0;
    height: 0;
    border-left: .5rem solid transparent;
    border-right: .5rem solid transparent;
    border-bottom: .5rem solid white;
    position: absolute;
    top: -0.5rem;
    left: .75rem;
    /* left position will be set dynamically by JavaScript */
    transition: left 0.2s ease, transform 0.3s ease;
}

/* Navbar Dropdown */
nav .relative {
    position: static;
}

/* Show the right arrow only when the item is hovered AND it has a grand-child list */
nav .dropdown ul.child>li:has(> ul.grand-child):hover>.right-triangle-dark {
    display: block;
}

/* Ensure items without grandchildren never show the triangle */
nav .dropdown ul.child>li:not(:has(> ul.grand-child))>.right-triangle-dark {
    display: none !important;
}

nav div.dropdown {
    position: fixed;
    top: auto;
    left: 0;
    padding: 8px;
    background: #ffffff;
    /* gradient border visible by default */
    background: linear-gradient(179deg, rgba(255, 255, 255, 1) 0%, rgba(39, 183, 254, 1) 100%);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    transform-origin: top center;
    pointer-events: auto;
    display: flex;
    border-radius: 0.5rem;
}

/* When dean dropdown is active, extend the dropdown background */
nav div.dropdown.has-dean-dropdown {
    border-top-right-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

.child-dropdown {
    /* collapses by default; shown only when it has content */
    width: 0;
    min-width: 0;
    max-width: 300px;
    opacity: 0;
    visibility: hidden;
    transition: width 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.35s ease-out, visibility 0s linear 0.35s;
    overflow: hidden;
    /* space when visible */
}

/* Faculty dropdown needs wider child-dropdown for department names */
nav .dropdown:has(ul.faculty-child-dropdown) .child-dropdown {
    transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.35s ease-out, visibility 0s linear 0.35s;
}

/* Dean panel: hidden by default, shown when populated */
/* .dean-dropdown { display: none; }
.dean-dropdown.has-content { display: flex; } */

/* Show when JS marks it as having content */
.child-dropdown.has-content {
    width: 300px;
    opacity: 1;
    visibility: visible;
    transition: width 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.35s ease-out, visibility 0s linear 0s;
}

/* Faculty child-dropdown gets wider when visible - override immediately */
nav .dropdown:has(ul.faculty-child-dropdown) .child-dropdown.has-content {
    width: 340px !important;
    transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.35s ease-out, visibility 0s linear 0s;
}

/* Basic styling for the injected grand-child list shown in the right pane */
nav .child-dropdown ul {
    list-style: none;
    padding: 1rem;
    margin: 0;
    /* Show scrollbar when more than ~8 items (approx 20rem height) */
    max-height: 20rem;
    overflow-y: auto;
    scrollbar-width: none;
}

/* Show scrollbar on hover for Firefox */
nav .child-dropdown ul:hover {
    scrollbar-width: thin;
    scrollbar-color: var(--blue-light) transparent;
}

/* WebKit scrollbar styling for right pane - hidden by default */
nav .child-dropdown ul::-webkit-scrollbar {
    width: 8px;
    display: none;
}

nav .child-dropdown ul:hover::-webkit-scrollbar {
    display: block;
}

nav .child-dropdown ul:hover::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 8px;
}

nav .child-dropdown ul:hover::-webkit-scrollbar-thumb {
    background: var(--blue-light);
    border-radius: 8px;
}

nav .child-dropdown ul:hover::-webkit-scrollbar-thumb:hover {
    background: var(--blue-dark);
}

/* Hide start/end scrollbar buttons (triangles) */
nav .child-dropdown ul::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
    background: transparent;
}

nav .child-dropdown ul::-webkit-scrollbar-corner {
    background: transparent;
}

nav .child-dropdown ul li {
    margin-bottom: 1rem;
    /* match child spacing */
    display: flex;
    align-items: flex-start;
}

nav .child-dropdown ul li:last-child {
    margin-bottom: 0;
}

/* Ensure links in the right pane are black */
nav .child-dropdown a {
    color: #000 !important;
    /* font-weight: 600; */
    /* requested weight */
}

/* Ensure original floating grand-child links are black too */
nav .dropdown ul.grand-child a {
    color: #000 !important;
}

nav li:hover div.dropdown,
nav div.dropdown:hover {
    opacity: 1;
    visibility: visible;
}

nav .dropdown ul.child {
    background-color: var(--blue-darker);
    padding: 2rem 2rem 2rem 2rem;
    width: max-content;
    width: auto;
    max-width: 270px;
    min-width: 240px;
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

/* Faculty dropdown needs more width for department names */
nav .dropdown ul.faculty-child-dropdown {
    min-width: 270px;
}

/* Only show scrollbar when content actually overflows */
nav .dropdown ul.child::-webkit-scrollbar {
    width: 8px;
    display: none;
}

nav .dropdown ul.child:hover::-webkit-scrollbar {
    display: block;
}

/* Firefox scrollbar - only show when hovering */
nav .dropdown ul.child {
    scrollbar-width: none;
}

nav .dropdown ul.child:hover {
    scrollbar-width: thin;
    scrollbar-color: var(--blue-light) transparent;
}

/* Custom scrollbar styling for ul.child when hovering */
nav .dropdown ul.child:hover::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 8px;
}

nav .dropdown ul.child:hover::-webkit-scrollbar-thumb {
    background: var(--blue-light);
    border-radius: 8px;
}

nav .dropdown ul.child:hover::-webkit-scrollbar-thumb:hover {
    background: var(--blue-dark);
}

/* Hide start/end scrollbar buttons (triangles) */
nav .dropdown ul.child::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
    background: transparent;
}

nav .dropdown ul.child::-webkit-scrollbar-corner {
    background: transparent;
}

nav .dropdown ul.child li {
    margin-bottom: 1rem;
    position: relative;
    display: flex;
    align-items: flex-start;
}

nav .dropdown ul.child li:last-child {
    margin-bottom: 0;
}

nav .dropdown ul.grand-child {
    position: absolute;
    top: 0;
    left: 100%;
    /* background-color: var(--blue-darker); */
    padding: 2rem;
    margin-left: 0.5rem;
    width: max-content;
    color: black;
    /* font-weight: 600; */
    /* requested weight */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    border-radius: 0.5rem;
    /* Fallback: scroll if there are lots of grand-children */
    max-height: 20rem;
    overflow-y: auto;
    scrollbar-width: none;
}

/* Show scrollbar on hover for Firefox */
nav .dropdown ul.grand-child:hover {
    scrollbar-width: thin;
    scrollbar-color: var(--blue-light) transparent;
}

/* WebKit scrollbar styling for fallback floating grand-child list - hidden by default */
nav .dropdown ul.grand-child::-webkit-scrollbar {
    width: 8px;
    display: none;
}

nav .dropdown ul.grand-child:hover::-webkit-scrollbar {
    display: block;
}

nav .dropdown ul.grand-child:hover::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 8px;
}

nav .dropdown ul.grand-child:hover::-webkit-scrollbar-thumb {
    background: var(--blue-light);
    border-radius: 8px;
}

nav .dropdown ul.grand-child:hover::-webkit-scrollbar-thumb:hover {
    background: var(--blue-dark);
}

/* Hide start/end scrollbar buttons (triangles) */
nav .dropdown ul.grand-child::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
    background: transparent;
}

nav .dropdown ul.grand-child::-webkit-scrollbar-corner {
    background: transparent;
}

nav .dropdown ul.grand-child:hover {
    /* font-weight: 700; */
    /* slightly bolder on hover */
    /* text-decoration: underline; */
}

nav .dropdown ul.child li:hover ul.grand-child {
    opacity: 1;
    visibility: visible;
}

nav .dropdown ul.grand-child li {
    margin-bottom: 0.5rem;
}

#parliamentary-questions-tablist button[role="tab"][aria-selected="true"] {
    background-color: var(--blue-darkest);
}

#accordion-statutory button[data-accordion-target][aria-expanded="true"] {
    background-color: var(--blue-dark);
    color: #ffffff;
}

nav .dropdown ul.grand-child li {
    margin-bottom: 0.5rem;
}

/* When the right-side gradient panel is showing cloned grand-children,
   hide the original floating grand-child list to prevent overlap/duplication */
nav .dropdown.panel-active ul.grand-child {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Dean Dropdown Styling */
.dean-dropdown-container {
    width: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

nav .dropdown.has-dean-dropdown .dean-dropdown-container {
    display: flex !important;
}

/* Hero Grid */
a.hero-grid-card-link {
    border-color: var(--blue-darker);
}

nav .dropdown .nav-dept-list {
    padding-left: 1.5rem !important;
    padding-right: 2rem !important;
}

.modal {
    z-index: 2100 !important;
}

/* Ensure hover still makes dropdown visible; the slide will run when it becomes visible */