/* ===========================
   HEADER & DESKTOP NAVIGATION
   =========================== */

.site-header .container {
    max-width: 1440px;
}

.site-header,
.mobile-header {
    background-color: transparent !important; /* Default transparent */
    box-shadow: none;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Scrolled state - background appears */
.site-header.scrolled,
.mobile-header.scrolled {
    background-color: #2d2d2d !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Fixed positioning */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1020;
}

.admin-bar .site-header {
    top: 32px;
}

.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1020;
}

.mobile-header-inner {
    padding: 18px 20px;
}

.navbar-nav .nav-link {
    color: var(--rp-white);
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-desktop-container .navbar-nav .nav-item .nav-link:hover,
.nav-desktop-container .navbar-nav .nav-item .nav-link.active {
    color: var(--rp-headlines) !important;
}

/* Dropdown Menu Styling */
.navbar-nav .dropdown-menu {
    background-color: #2d2d2d;
    border: 1px solid rgba(255,255,255,0.1);
    margin-top: 0.5rem;
}

.navbar-nav .dropdown-item {
    color: var(--rp-white);
    padding: 0.75rem 1.5rem;
}

.navbar-nav .dropdown-item:hover {
    background-color: #dc3545;
    color: #ffffff;
}

/* Navbar Structure */
.nav-desktop-container {
    padding: 20px 30px;
}

.navbar .navbar-nav {
    padding: 8px;
    border-radius: 100px;
    background-color: var(--rp-darker-grey);
}

.navbar .navbar-nav .nav-item .nav-link {
    padding: 8px 20px;
    font-family: var(--font-body);
    font-weight: var(--weight-medium);
    font-size: var(--paragraph-md-size);
    line-height: 100%;
    color: var(--rp-white);
}

/* Logo */
.custom-logo {
    max-height: 62px;
    width: auto;
}

@media (max-width: 991.98px) {
    .custom-logo {
        max-height: 40px;
    }
}


/* ===========================
   MOBILE OFFCANVAS & MENU
   =========================== */

.offcanvas {
    width: 100% !important;
    max-width: 100vw;
    background-color: var(--rp-logo-black);
}

/* Offcanvas structure */
.offcanvas-body {
    padding: 0 !important;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

/* Menu wrapper */
.mobile-menu-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Mobile menu screens */
.mobile-menu-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    pointer-events: none;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    background: var(--rp-logo-black);
    z-index: 1;
    display: flex;
    flex-direction: column;
}

.mobile-menu-screen.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    z-index: 2;
}

/* Main menu */
.mobile-menu-main {
    z-index: 1;
}

/* Mobile menu title */
.mobile-menu-title {
    margin: 0;
    font-family: var(--font-body);
    font-weight: var(--weight-medium);
    font-size: var(--paragraph-lg-size);
    line-height: var(--paragraph-lg-line);
    color: var(--rp-white);
    flex: 1;
    text-align: right;
    word-break: break-word;
}

/* Menu content container */
.mobile-menu-screen > .container {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
}

/* Mobile menu list */
.mobile-menu-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.mobile-menu-list .nav-item {
    border-bottom: 1px solid var(--rp-white);
}

.mobile-menu-list .nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    color: var(--rp-white);
    font-family: var(--font-body);
    font-weight: var(--weight-regular);
    font-size: var(--paragraph-lg-size);
    line-height: var(--paragraph-lg-line);
    transition: color 0.2s ease;
    text-decoration: none;
}

.mobile-menu-list .nav-link:hover,
.mobile-menu-list .nav-link:focus {
    color: var(--rp-pale-cyan);
    text-decoration: none;
}

.mobile-menu-list .nav-item:hover {
    border-color: var(--rp-pale-cyan);
}

.mobile-menu-list .nav-link.has-submenu {
    cursor: pointer;
}

/* Submenu arrow */
.submenu-arrow {
    width: 16px;
    height: 16px;
    margin-left: 1rem;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.mobile-menu-list .nav-link.has-submenu:hover .submenu-arrow {
    transform: translateX(4px);
    color: var(--rp-pale-cyan);
}

/* Hide nested dropdowns from PHP */
.mobile-menu-list .dropdown-menu,
.mobile-menu-list ul {
    display: none !important;
}

/* Mobile menu CTA */
.mobile-menu-cta {
    flex-shrink: 0;
    padding: 2rem 0;
    background: var(--rp-logo-black);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
}

#mobileMenu .offcanvas-header {
	padding: 0;
}

/* Hide CTA when submenu is active */
.offcanvas-body .mobile-menu-screen.active ~ .mobile-menu-cta {
    display: none;
}

/* Back button */
.mobile-menu-back {
    padding: 0 33px 40px;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
}

.mobile-menu-back button {
    padding: 0;
    background: var(--rp-logo-black);
    color: var(--rp-white);
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
	display: flex;
	align-items: center;
	gap: 3px;

	font-family: var(--font-body);
	font-weight: var(--weight-regular);
	font-size: var(--paragraph-lg-size);
	line-height: var(--paragraph-lg-line);
	color: var(--rp-medium-grey);
	text-transform: initial;
}

.mobile-menu-back button svg {
	width: 24px;
	height: 24px;
}

.mobile-menu-back button:hover svg path {
	fill: var(--rp-white);
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .offcanvas-body {
        height: calc(100vh - 100px);
    }
}

.nav-item .mobile-nav-link:not(.has-submenu):after {
	transition: all 0.3s ease;
	display: inline;
    content: "";
    width: 22px;
    height: 22px;
    margin-left: 1rem;
	opacity: 0;
    flex-shrink: 0;
	background-image: url('/wp-content/themes/redpandas-digital-revamp/assets/icons/arrow_circle_right.svg');
	background-size: contain;
	background-repeat: no-repeat;
}

.nav-item:hover .mobile-nav-link:not(.has-submenu):after {
	opacity: 1;
}

/* ====== MEGAMENU WIDGET ====== */

.megamenu {
    background-color: var(--rp-white);
    position: fixed;
    top: 102px;
    left: 0;
    width: 100%;
    z-index: 1019;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease, visibility 0.4s;
    box-shadow: 0px 10px 10px 0px #00000040;
    opacity: 0;
    visibility: hidden;
}

.admin-bar .megamenu {
    top: calc(32px + 102px);
}

.megamenu-head {
    max-width: 300px;
    padding: 0;
    margin-top: 23px;
}

.megamenu .container .row {
    gap: 80px;
}

.megamenu-head h4 {
    margin-bottom: 8px;
}

.megamenu-head h4 span {
    margin-left: 12px;
}

.megamenu-head p {
    font-family: var(--font-body);
    font-weight: var(--weight-regular);
    font-size: var(--paragraph-sm-size);
    line-height: var(--paragraph-sm-line);
    color: var(--rp-headlines);
    margin: 0;
}

.megamenu.show {
    max-height: 1000px;
    opacity: 1;
    visibility: visible;
}

.megamenu .container {
    padding: 44px 20px 122px 20px;
    max-width: 1230px;
}

.megamenu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px 0;
}

.megamenu-item-widget {
    display: flex;
    flex-direction: column;
}

.animated-icon svg > path, .animated-icon svg > g {
  transition: transform 0.3s ease;
  transform-origin: center;
}

.animated-icon:hover svg > path:first-of-type {
  transform: rotate(10deg);
}

.animated-icon:hover svg > path:nth-of-type(2) {
  transform: rotate(-10deg);
}

.animated-icon:hover svg > g {
  transform: rotate(-10deg);
  transition: transform 0.3s ease;
  transform-origin: center;
}


.megamenu-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.megamenu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.megamenu-icon-wrapper {
    flex-shrink: 0;
    width: 75px;
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.megamenu-icon-wrapper img {
    max-width: 100%;
    height: 100%;
	width: 100%;
}

.megamenu-title {
    margin: 0 0 8px 0;
    font-family: var(--font-heading);
    font-weight: var(--weight-bold);
    font-size: 20px;
    line-height: 26px;
    color: var(--rp-headlines);
}

.megamenu-description {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--paragraph-xs-size);
    line-height: var(--paragraph-xs-line);
    font-weight: var(--weight-regular);
    color: var(--rp-headlines);
}

/* Highlight trigger link */
.nav-item.megamenu-trigger .nav-link.active {
    color: var(--rp-pale-cyan);
}

/*  */

.blog-header.blogheader-sticky {
    position: relative;
    z-index: 10;
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 8px 12px 28px 12px;
    max-width: 1180px;
    margin: auto;
}

.blog-header h1 {
    color: var(--rp-white);
}


.scrolled .blog-header.blogheader-sticky h1 {
    display: none;
}


/* Blog Header */
.blog-menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--rp-white);
    gap: 20px;
}

.blog-menu .categories-widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.blog-menu .categories-widget ul li {
    display: flex;
}

header:not(.scrolled) .blog-menu .categories-widget ul li a {
    color: var(--rp-headlines);
    border-color: var(--rp-headlines);
}

.page-template-template-learning-centre header:not(.scrolled) .blog-menu .categories-widget ul li a,
.archive header:not(.scrolled) .blog-menu .categories-widget ul li a,
.blog header:not(.scrolled) .blog-menu .categories-widget ul li a {
    color: var(--rp-white);
    border-color: var(--rp-white);
}

header:not(.scrolled) .blog-menu .search-widget input[type="search"],
header:not(.scrolled) .blog-menu .search-widget input[type="search"]::placeholder {
    color: var(--rp-headlines);
}

.page-template-template-learning-centre header:not(.scrolled) .blog-menu .search-widget input[type="search"],
.page-template-template-learning-centre header:not(.scrolled) .blog-menu .search-widget input[type="search"]::placeholder,
.archive header:not(.scrolled) .blog-menu .search-widget input[type="search"],
.archive header:not(.scrolled) .blog-menu .search-widget input[type="search"]::placeholder,
.blog header:not(.scrolled) .blog-menu .search-widget input[type="search"],
.blog header:not(.scrolled) .blog-menu .search-widget input[type="search"]::placeholder {
    color: var(--rp-white);
}

header:not(.scrolled) .blog-menu .search-widget form {
    border-color: var(--rp-headlines);
}

.page-template-template-learning-centre header:not(.scrolled) .blog-menu .search-widget form,
.archive header:not(.scrolled) .blog-menu .search-widget form,
.blog header:not(.scrolled) .blog-menu .search-widget form {
    border-color: var(--rp-white);
}

.archive .blog-header h1,
.blog .blog-header h1 {
    display: none;
}

.blog-menu .categories-widget ul li a {
    color: var(--rp-white);
    border-radius: 100px;
    padding: 8px 14px;
    border: 1px solid #FFFFFF;
    text-decoration: none;
}


/* Search Widget */
.blog-menu .search-widget {
    display: flex;
    align-items: center;
}

.blog-menu .search-widget form {
    display: flex;
    align-items: center;
    background-color: transparent;
    border: 1px solid var(--rp-dark-grey);
    border-radius: 100px;
    padding: 8px 24px;
}

.blog-menu .search-widget input[type="search"] {
    border: 0;
    background-color: transparent !important;
    outline: none;
    padding: 0 !important;
    color: var(--rp-white) !important;
    font-family: var(--font-body) !important;
    font-weight: var(--weight-medium) !important;
    font-size: var(--paragraph-sm-size) !important;
    line-height: var(--paragraph-sm-line) !important;
}

.blog-menu .search-widget input[type="search"]::placeholder {
    color: var(--rp-dark-grey);
}

.blog-menu .search-widget input[type="submit"] {
    border: 0;
    background-color: transparent !important;
    outline: none;
    color: var(--rp-white);
    background-image: url('../icons/search.svg');
    background-repeat: no-repeat;
    background-position: center;
    text-indent: -9999px;
    width: 24px;
    height: 24px;
    padding: 0;
}

.blog-menu .search-widget input[type="submit"]::placeholder {
    font-family: var(--font-body);
    font-weight: var(--weight-medium);
    font-size: var(--paragraph-sm-size);
    line-height: var(--paragraph-sm-line);
    color: var(--rp-dark-grey);
}

/* media mobile */
@media (max-width: 768px) {

    .blog-menu {
        flex-direction: column;
        align-items: flex-start;
    }

    .blog-menu .search-widget,
    .blog-menu .search-widget form {
        width: 100%;
    }

    .blog-menu .search-widget form label {
        display: flex;
        flex-grow: 1;
    }

    .blog-menu .categories-widget  {
        width: 100%;
        overflow: auto;
    }

    .blog-menu .categories-widget ul {
        flex-wrap: nowrap;
    }

    .blog-menu .categories-widget ul li {
        white-space: nowrap;
    }
}

.single .site-header,
.single .mobile-header {
    background: var(--rp-headlines) !important;
}



.single .site-header .container-fluid {
    background: var(--rp-background) !important;
    transition: background 0.2s ease;
}

.single .site-header.scrolled .container-fluid {
    background: var(--rp-headlines) !important;
}

.single .blog-header.blogheader-sticky {
    padding: 28px 0;
    padding-top: calc(19px + 28px);
    border-bottom: 1px solid var(--rp-medium-grey);
}

.single header.scrolled .blog-header.blogheader-sticky {
    border-bottom: 0;
    padding-top: 28px;
}

