/* ==============================================================================
   LAYOUT STYLES - Fosseway Training
   Header, Navbar, Navigation, Footer
   ============================================================================== */

/* Header */
.site-header {
    background-color: var(--bg-color);
    border-bottom: 2px solid var(--fosseway-navy);
    padding: var(--spacing-xs) 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

/* Navbar Layout */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    min-height: 70px;
}

/* Logo */
.site-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    z-index: 1001;
}

.site-logo:hover {
    opacity: 0.9;
}

.logo-img {
    height: 60px;
    width: auto;
}

/* Navigation Wrapper */
.nav-wrapper {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--spacing-xs);
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-color);
    font-weight: 500;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background-color: var(--bg-secondary);
}

.dropdown-arrow {
    transition: transform var(--transition-fast);
}

.nav-item.has-dropdown:hover .dropdown-arrow,
.nav-item.has-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

/* CTA Button in Nav */
.btn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: white;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
    height: auto;
}

.btn-cta:hover {
    background-color: var(--accent-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Mega Dropdown */
.mega-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: #fff;
    border: none;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    min-width: 560px;
    padding: 1.5rem;
    margin-top: 0.75rem;
    z-index: 1000;
}

.nav-item.has-dropdown:hover .mega-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.mega-dropdown-inner {
    display: grid;
    grid-template-columns: 140px 1fr 1fr;
    gap: 0;
}

.dropdown-column {
    padding: 0.5rem 1.5rem;
    border-right: 1px solid #e5e7eb;
}

.dropdown-column:last-child {
    border-right: none;
}

.dropdown-column.featured {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    padding: 1rem;
    margin-right: 0.5rem;
    border-right: none;
}

.dropdown-heading {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    margin-bottom: 0.75rem;
    padding: 0;
    border: none;
}

.dropdown-column.featured .dropdown-heading {
    color: var(--fosseway-navy);
}

.dropdown-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dropdown-list li {
    margin-bottom: 0.25rem;
}

.dropdown-list a {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    margin: 0 -0.75rem;
    color: var(--fosseway-navy);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.15s ease;
    text-decoration: none;
    border-radius: 8px;
}

.dropdown-list a:hover {
    background: rgba(105, 190, 40, 0.1);
    color: var(--fosseway-green);
    padding-left: 0.75rem;
}

.dropdown-column.featured .dropdown-list a {
    color: var(--fosseway-navy);
    font-weight: 600;
}

.dropdown-column.featured .dropdown-list a:hover {
    background: rgba(105, 190, 40, 0.15);
    color: var(--fosseway-green);
}

/* Mobile Menu Toggle (Hamburger) */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    gap: 5px;
    position: relative;
    z-index: 1002;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2.5px;
    background-color: var(--fosseway-navy);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Hamburger Animation - X shape when active */
.menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Overlay - sits behind mobile nav */
.nav-overlay {
    display: none;
}

/* ==============================================================================
   MOBILE NAVIGATION - Slide in from right, BELOW header
   ============================================================================== */
@media (max-width: 992px) {

    /* Show hamburger on mobile */
    .menu-toggle {
        display: flex;
    }

    /* Header stays on top */
    .site-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1001;
    }

    /* Add padding to body to account for fixed header */
    body {
        padding-top: 82px;
        /* Height of header */
    }

    /* Nav wrapper slides in from right, positioned BELOW header */
    .nav-wrapper {
        display: flex;
        position: fixed;
        top: 82px;
        /* Below the header */
        right: 0;
        width: 320px;
        max-width: 85vw;
        height: calc(100vh - 82px);
        background: var(--fosseway-navy);
        flex-direction: column;
        align-items: stretch;
        padding: 1.5rem 0;
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        overflow-y: auto;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.3);
    }

    /* Active state - slide in */
    .nav-wrapper.active {
        transform: translateX(0);
    }

    /* Overlay behind the menu */
    .nav-overlay {
        position: fixed;
        top: 82px;
        left: 0;
        width: 100%;
        height: calc(100vh - 82px);
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .nav-overlay.active {
        display: block;
        opacity: 1;
        visibility: visible;
    }

    /* Navigation menu list */
    .nav-menu {
        display: flex;
        flex-direction: column;
        gap: 0;
        width: 100%;
        padding: 0;
    }

    /* Navigation items */
    .nav-item {
        display: block;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-item:last-child {
        border-bottom: none;
    }

    /* Navigation links - right aligned like the screenshot */
    .nav-link {
        display: flex;
        padding: 1.1rem 1.5rem;
        width: 100%;
        justify-content: flex-end;
        text-align: right;
        font-size: 1.1rem;
        font-weight: 500;
        color: white;
        border-radius: 0;
        transition: background-color 0.2s ease;
    }

    .nav-link:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: white;
    }

    .nav-link.active {
        color: var(--fosseway-green);
        background-color: transparent;
    }

    /* Dropdown arrow */
    .dropdown-arrow {
        transition: transform 0.3s ease;
        order: -1;
        /* Put arrow before text */
        margin-right: 0.5rem;
        margin-left: 0;
    }

    .nav-item.has-dropdown.open .dropdown-arrow {
        transform: rotate(180deg);
    }

    /* Mobile Mega Dropdown - accordion style */
    .mega-dropdown {
        position: static !important;
        transform: none !important;
        min-width: 100%;
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        margin: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 1 !important;
        visibility: visible !important;
        background-color: rgba(0, 0, 0, 0.2);
        transition: max-height 0.35s ease;
    }

    .nav-item.has-dropdown.open .mega-dropdown {
        max-height: 500px;
    }

    .mega-dropdown-inner {
        display: block;
        padding: 0.5rem 0;
    }

    /* Dropdown columns */
    .dropdown-column {
        padding: 0.5rem 1.5rem;
        border-right: none;
        border-bottom: none;
        background: transparent !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    .dropdown-column:last-child {
        border-bottom: none;
    }

    .dropdown-column.featured {
        margin-right: 0;
        background-color: transparent !important;
    }

    /* Dropdown headings */
    .dropdown-heading {
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        color: rgba(255, 255, 255, 0.6) !important;
        margin-bottom: 0.5rem;
        padding-right: 0;
        text-align: right;
        font-weight: 600;
    }

    /* Dropdown list */
    .dropdown-list {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .dropdown-list li {
        margin-bottom: 0;
    }

    .dropdown-list a,
    .dropdown-list li a {
        display: block;
        padding: 0.7rem 0.75rem;
        margin: 0;
        font-size: 1rem;
        font-weight: 500;
        color: white !important;
        border-radius: 6px;
        transition: all 0.15s ease;
        text-align: right;
    }

    .dropdown-list a:hover,
    .dropdown-list li a:hover {
        background-color: rgba(105, 190, 40, 0.3);
        color: var(--fosseway-green) !important;
    }

    /* CTA Button in mobile nav */
    .btn-cta {
        display: block;
        width: calc(100% - 2rem);
        text-align: center;
        margin: 1.5rem 1rem 1rem;
        padding: 1rem 1.5rem;
        font-size: 1rem;
        font-weight: 600;
        border-radius: 10px;
        background: var(--fosseway-green) !important;
        color: white !important;
        border: none;
    }

    .btn-cta:hover {
        background: #7ed957 !important;
        color: white !important;
    }
}

/* Desktop reset - ensure no mobile styles bleed through */
@media (min-width: 993px) {
    body {
        padding-top: 0 !important;
    }

    .site-header {
        position: sticky;
    }
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
    background-color: var(--bg-secondary);
}

/* Main Content */
main {
    min-height: 60vh;
}

/* ==============================================================================
   FOOTER STYLES
   ============================================================================== */

/* Footer */
.site-footer {
    background: linear-gradient(180deg, var(--fosseway-navy) 0%, #001428 100%);
    color: white;
    margin-top: 0;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.75);
    transition: color var(--transition-fast);
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--fosseway-green);
}

/* Footer Top */
.footer-top {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 4rem;
    padding: 4rem 0 3rem;
}

/* Footer Brand Column */
.footer-brand-col {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.footer-brand-name {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.footer-brand-name .brand-fosseway {
    font-size: 1.75rem;
    font-weight: 700;
    color: #7ed957;
}

.footer-brand-name .brand-training {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
}

.footer-logo-box {
    display: inline-block;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    width: fit-content;
}

.footer-logo-box img {
    height: 45px;
    width: auto;
    display: block;
}

.footer-tagline {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    max-width: 280px;
}

.footer-socials {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.footer-socials a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.footer-socials a:hover {
    background: var(--fosseway-green);
    color: white;
    transform: translateY(-3px);
}

/* Footer Links */
.footer-links-wrap {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.footer-col h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1.25rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--fosseway-green);
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 0.7rem;
}

.footer-col ul li a {
    font-size: 0.9rem;
    display: inline-block;
    position: relative;
}

.footer-col ul li a::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--fosseway-green);
    transition: width 0.3s ease;
}

.footer-col ul li a:hover::before {
    width: 100%;
}

/* Contact List */
.footer-contact-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.footer-contact-list svg {
    color: var(--fosseway-green);
    flex-shrink: 0;
}

.footer-contact-list span {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
}

/* Sub-Footer */
.sub-footer {
    background: rgba(0, 0, 0, 0.25);
    padding: 1.25rem 0;
}

.sub-footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.sub-footer-content p {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.sub-footer-links {
    display: flex;
    gap: 1.5rem;
}

.sub-footer-links a {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.sub-footer-links a:hover {
    color: white;
}

.sub-footer a {
    color: var(--fosseway-green);
}

.sub-footer a:hover {
    color: white;
}

/* Footer Responsive */
@media (max-width: 1024px) {
    .footer-top {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .footer-brand-col {
        align-items: center;
        text-align: center;
    }

    .footer-tagline {
        max-width: 100%;
    }

    .footer-socials {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .footer-links-wrap {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .sub-footer-content {
        flex-direction: column;
        text-align: center;
    }

    .sub-footer-links {
        order: -1;
    }
}

@media (max-width: 480px) {
    .footer-links-wrap {
        grid-template-columns: 1fr;
    }

    .footer-col {
        text-align: center;
    }

    .footer-col h4::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .footer-contact-list li {
        justify-content: center;
    }
}

/* ==============================================================================
   TRUST STRIP - Accreditation Logos Carousel (Footer)
   ============================================================================== */

.trust-strip {
    background-color: var(--bg-secondary);
    padding: var(--spacing-lg) 0;
    border-top: 1px solid var(--fosseway-grey);
    margin-top: 0;
    overflow: hidden;
}

.trust-carousel {
    width: 100vw;
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

.trust-track {
    display: flex;
    align-items: center;
    gap: 3rem;
    animation: scroll-trust-logos 90s linear infinite;
    width: max-content;
}

@keyframes scroll-trust-logos {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.trust-carousel:hover .trust-track {
    animation-play-state: paused;
}

.trust-logo {
    height: 90px !important;
    width: auto !important;
    max-width: none;
    opacity: 0.85;
    transition: opacity var(--transition-fast);
    flex-shrink: 0;
    display: inline-block;
}

.trust-logo:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .trust-logo {
        height: 70px !important;
    }
}

/* ==============================================================================
   AUTHORITY BAR (Shared Component)
   ============================================================================== */

.authority-bar {
    background-color: white;
    padding: var(--spacing-md) 0 var(--spacing-lg) 0;
    border-bottom: 1px solid #e5e7eb;
    overflow: hidden;
}

.authority-bar .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    max-width: 100%;
    padding: 0;
}

.authority-label {
    font-weight: 700;
    color: var(--fosseway-navy);
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 var(--spacing-sm) 0;
    text-align: center;
}

.authority-carousel {
    width: 100vw;
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

.authority-track {
    display: flex;
    align-items: center;
    gap: 3rem;
    animation: scroll-logos 90s linear infinite;
    width: max-content;
}

@keyframes scroll-logos {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.authority-carousel:hover .authority-track {
    animation-play-state: paused;
}

.authority-logo {
    height: 90px !important;
    width: auto !important;
    max-width: none;
    opacity: 0.85;
    transition: opacity var(--transition-fast);
    flex-shrink: 0;
    display: inline-block;
}

.authority-logo:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .authority-logo {
        height: 70px !important;
    }
}