@import url('https://fonts.googleapis.com/css2?family=Lora:wght@400&family=Ubuntu:wght@400;500;700&display=swap');

body {
    margin: 0;
    padding: 0;
    background-color: #f0f0f0;
    font-family: 'Ubuntu', sans-serif;
    line-height: 1.6;
    color: #333;
}
/* Layout baseline */
*, *::before, *::after {
    box-sizing: border-box;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    text-align: center;
}

.site-header {
    display: flex;
    justify-content: center; /* Center the nav menu */
    align-items: center;
    padding: 20px 0;
    position: relative; /* Context for absolute positioning the logo */
    z-index: 3000; /* keep menus above page content */
}

/* Ensure nav is above the rest so the panel is fully interactive */
.main-nav {
    position: static; /* allow .mega-menu to anchor to .site-header */
}

.logo-container {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.logo-text {
    text-decoration: none;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Ubuntu', sans-serif;
    font-size: 0.91em;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    letter-spacing: 0.5px;
}

.logo-text div {
    white-space: nowrap;
}

.logo-image {
    height: 50px;
    width: auto;
}

.main-nav > ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.main-nav li {
    position: relative; /* For dropdown positioning */
    margin-left: 25px;
}

/* Increase the hover/click target area for top-level items */
.main-nav > ul > li > a {
    display: block;
    padding: 10px 12px;
}

/* Anchor the panel to the dropdown LI so the hover state doesn't drop */
.main-nav li.dropdown {
    position: relative; /* anchor to header instead of the li */
}

/* No hover gap bridge needed when panel is anchored to header */
/* (Removing pseudo-element to prevent blocking pointer over panel) */

/* Keep menu open when focusing with keyboard */
.dropdown:focus-within .mega-menu {
    display: block;
}

.mega-menu {
    display: none;
    position: absolute;
    top: 100%; /* sits directly under the header */
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    background-color: #f0f0f0;
    border-top: 1px solid #ddd;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.1);
    padding: 24px 0 40px;
    margin-top: -10px; /* Creates the hover bridge */
    padding-top: 34px; /* Accounts for the negative margin */
    z-index: 2000;
}

.dropdown:hover .mega-menu {
    display: block;
}

/* Extra safety: if pointer is already inside the panel, keep it open */
.mega-menu:hover {
    display: block;
}

.mega-menu-content {
    max-width: 800px; /* align with page content width */
    margin: 0 auto;
    padding: 0 20px; /* match .hero horizontal padding */
}

.mega-menu-header {
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid #ccc;
}

/* One-row layout for Acceleration Zones */
.mega-menu-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.mega-link {
    font-family: 'Ubuntu', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    text-decoration: none;
}

.mega-link:hover { text-decoration: underline; }

.mega-separator {
    color: #999;
}

.mega-menu-title {
    font-size: 1.1em;
    font-weight: 700;
    color: #333;
    text-decoration: none;
}

.mega-menu-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 40px;
}

.mega-menu-column h4 {
    font-family: 'Ubuntu', sans-serif;
    font-size: 0.9em;
    font-weight: 700;
    color: #333;
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mega-menu-column ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: block; /* stack items vertically */
}

.mega-menu-column li {
    margin: 0 0 12px 0;
}

.mega-menu-column a {
    text-decoration: none;
    color: #555;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.6;
    display: block;
    padding: 4px 0;
    white-space: normal; /* allow wrapping for long labels */
    word-break: normal; /* do not split words arbitrarily */
    overflow-wrap: break-word; /* wrap only if needed */
    hyphens: none; /* avoid auto-hyphenation visual noise */
}

.mega-menu-column a:hover {
    text-decoration: underline;
}

.main-nav a {
    text-decoration: none;
    color: #333;
    font-family: 'Ubuntu', sans-serif;
    font-weight: 500; /* Set to medium weight */
}

hr {
    border: 0;
    height: 1px;
    background-color: #ccc;
    margin: 0 0 40px 0;
}

.hero {
    max-width: 800px;
    margin: 0 auto;
    padding: 80px 20px;
    text-align: left;
}

.hero h1 {
    font-family: 'Lora', serif;
    font-size: 3.5em;
    font-weight: 400;
    line-height: 1.2;
    margin: 0 0 20px 0;
    max-width: 650px; /* To control line breaks */
}

.hero p {
    font-family: 'Ubuntu', sans-serif;
    font-size: 1.2em;
    max-width: 500px;
}

.partners-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 20px 60px;
    text-align: left;
}

.partners-section h3 {
    font-family: 'Ubuntu', sans-serif;
    font-size: 0.9em;
    font-weight: 500;
    color: #666;
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.partners-list {
    display: flex;
    flex-wrap: wrap;
    gap: 50px;
    align-items: flex-start;
}

.partner-category {
    width: 100%;
}

.partner-country {
    font-family: 'Ubuntu', sans-serif;
    font-size: 1.2em;
    font-weight: 700;
    color: #333;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.partner-category h4 {
    font-family: 'Ubuntu', sans-serif;
    font-size: 0.85em;
    font-weight: 500;
    color: #999;
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.partner-items-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {
    .partner-items-grid {
        grid-template-columns: 1fr;
    }
}

.partner-item {
    font-family: 'Ubuntu', sans-serif;
    font-size: 1em;
    font-weight: 500;
    color: #333;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 100%;
    min-height: 70px;
}

.partner-item:hover {
    border-color: #999;
}

.partner-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.partner-name {
    color: #333;
}

.about-aai {
    max-width: 800px;
    margin: 0 auto;
    padding: 80px 20px;
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 40px;
    align-items: start;
}

.about-aai-left {
    position: sticky;
    top: 100px; /* Adjust this value to control the distance from the top */
}

.about-aai-left h3 {
    font-family: 'Ubuntu', sans-serif;
    font-size: 1em;
    font-weight: 500;
    color: #555;
    margin: 0;
}

.about-aai-right p {
    font-family: 'Lora', serif;
    font-size: 18px;
    line-height: 1.6;
    margin: 0 0 30px 0;
}

.about-link {
    font-family: 'Ubuntu', sans-serif;
    font-weight: 500;
    text-decoration: none;
    color: #333;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 2px;
}

.about-link-icon svg {
    width: 20px;
    height: 20px;
}

.main-content-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 80px 20px;
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 40px;
    align-items: start;
}

.main-content-left {
    position: sticky;
    top: 100px; /* Adjust this value to control the distance from the top */
}

.main-content-left h3 {
    font-family: 'Ubuntu', sans-serif;
    font-size: 1em;
    font-weight: 500;
    color: #555;
    margin: 0;
}

.main-content-right p {
    font-family: 'Ubuntu', sans-serif;
    font-size: 16px;
    line-height: 1.8;
    margin: 0 0 25px 0;
}

.site-footer-main {
    text-align: center;
    padding: 40px 20px;
    font-size: 14px;
    color: #999;
}

.site-footer-main p {
    margin: 5px 0;
}

.site-footer-main p:first-child {
    font-weight: bold;
    color: #666;
}

/* Team Page Styles */
.team-hero {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 20px;
    text-align: center;
}

.team-subtitle {
    font-family: 'Ubuntu', sans-serif;
    font-size: 0.9em;
    font-weight: 500;
    color: #666;
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.team-hero h1 {
    font-family: 'Lora', serif;
    font-size: 2.8em;
    font-weight: 400;
    line-height: 1.2;
    margin: 0 0 20px 0;
    color: #333;
}

.team-description {
    font-family: 'Ubuntu', sans-serif;
    font-size: 1.1em;
    color: #666;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
}

.team-grid {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px 80px;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 40px 30px;
    align-items: start;
}

.team-member {
    text-align: center;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
    max-width: 260px;
    margin: 0 auto;
    text-decoration: none; /* if used on anchors */
    color: inherit; /* if used on anchors */
}

.team-member:hover {
    transform: translateY(-2px);
}

.member-photo {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    background: #f5f5f5;
}

.member-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-name {
    font-family: 'Ubuntu', sans-serif;
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
}

.member-title {
    font-family: 'Ubuntu', sans-serif;
    font-size: 0.9em;
    font-weight: 500;
    color: #0066cc;
    margin: 0 0 15px 0;
}

.member-bio {
    font-family: 'Ubuntu', sans-serif;
    font-size: 0.85em;
    line-height: 1.5;
    color: #666;
    margin: 0 0 20px 0;
}

.member-socials {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.social-link {
    display: inline-block;
    width: 24px;
    height: 24px;
    text-decoration: none;
    font-size: 14px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.social-link:hover {
    opacity: 1;
}

/* Link to profile on team card */
.view-profile {
    display: inline-block;
    margin-top: 8px;
    font-family: 'Ubuntu', sans-serif;
    font-weight: 500;
    color: #0066cc;
    text-decoration: none;
}

.view-profile:hover { text-decoration: underline; }

/* Profile Page Styles */
.profile-hero {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 20px 20px;
    text-align: center;
}

.profile-avatar {
    width: 128px;
    height: 128px;
    margin: 0 auto 16px;
    border-radius: 50%;
    overflow: hidden;
    background: #f5f5f5;
}

.profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.profile-name { font-family: 'Ubuntu', sans-serif; font-size: 1.6em; margin: 6px 0 4px; }
.profile-title { font-family: 'Ubuntu', sans-serif; color: #0066cc; margin: 0 0 10px; }

.profile-socials { display: flex; gap: 12px; justify-content: center; margin-top: 8px; }
.profile-socials .social-link { opacity: .85; }

.profile-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px 20px 80px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
}

.profile-sidebar { position: sticky; top: 90px; align-self: start; }
.profile-card { background: #fff; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); padding: 16px; margin-bottom: 16px; }
.profile-card h4 { margin: 0 0 10px; font-size: 0.95em; color: #555; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background: #eef5ff; color: #0a58ca; padding: 4px 10px; border-radius: 999px; font-size: 12px; }

.profile-main { background: #fff; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); padding: 24px; }
.profile-section { margin-bottom: 24px; }
.profile-section h3 { margin: 0 0 10px; font-size: 1.05em; color: #333; }
.profile-section p, .profile-section li { font-size: 15px; line-height: 1.7; }
.profile-section ul { margin: 6px 0 0 18px; }

@media (max-width: 900px) {
    .profile-content { grid-template-columns: 1fr; }
    .profile-sidebar { position: static; }
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 3001;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: #333;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
    }

    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: #fff;
        box-shadow: -2px 0 10px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
        z-index: 3000;
        overflow-y: auto;
        padding-top: 80px;
    }

    .main-nav.active {
        right: 0;
    }

    .main-nav ul {
        flex-direction: column;
        width: 100%;
        padding: 0;
    }

    .main-nav li {
        margin: 0;
        width: 100%;
        border-bottom: 1px solid #eee;
    }

    .main-nav > ul > li > a {
        padding: 15px 20px;
        display: block;
    }

    .mega-menu {
        position: static;
        width: 100%;
        transform: none;
        box-shadow: none;
        border-top: none;
        padding: 0;
        margin: 0;
        background: #f9f9f9;
    }

    .mega-menu-columns {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 15px 20px;
    }

    .dropdown:hover .mega-menu {
        display: none;
    }

    .dropdown.active .mega-menu {
        display: block;
    }

    .about-aai, .main-content-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .about-aai-left, .main-content-left {
        position: static;
    }

    .site-header {
        padding: 30px 20px;
    }

    .logo-container {
        position: absolute;
        left: 20px;
        top: 50%;
        transform: translateY(-50%);
    }

    .logo-text {
        font-size: 0.65em;
    }

    .hero h1 {
        font-size: 2.2em;
    }

    .team-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
        padding: 30px 20px 60px;
    }

    .team-hero h1 {
        font-size: 2.2em;
    }

    .image-hero-section {
        min-height: 400px;
        padding: 60px 20px;
    }
    
    .image-hero-text-box {
        padding: 30px;
        max-width: 100%;
    }
    
    .image-hero-text-box h2 {
        font-size: 1.8em;
    }
}

.pillars-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 0 0 80px 0;
}

.pillar-item {
    background: #fff;
}

.pillar-icon {
    display: inline-flex;
    color: #333;
}

.pillar-name {
    font-weight: 500;
}

@media (max-width: 768px) {
    .pillars-grid { grid-template-columns: 1fr; }
}

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

/* Flexbox fallback if CSS Grid is unavailable */
@supports not (display: grid) {
    .team-grid {
        display: flex !important;
        flex-wrap: wrap;
        gap: 30px;
        justify-content: center;
    }
    .team-grid .team-member {
        flex: 0 1 220px;
        max-width: 240px;
    }
}

/* Large Image Section with Text Overlay */
.image-hero-section {
    position: relative;
    max-width: 800px;
    margin: 40px auto;
    min-height: 500px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    padding: 80px 20px;
    border-radius: 8px;
}

.image-hero-content {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.image-hero-text-box {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    max-width: 450px;
    border-radius: 8px;
}

.image-hero-text-box h2 {
    font-family: 'Lora', serif;
    font-size: 2.2em;
    font-weight: 400;
    margin: 0 0 20px 0;
    color: #1a1a1a;
    line-height: 1.3;
}

.image-hero-text-box p {
    font-family: 'Ubuntu', sans-serif;
    font-size: 1em;
    line-height: 1.7;
    color: #333;
    margin: 0 0 20px 0;
}

.image-hero-button {
    display: inline-block;
    font-family: 'Ubuntu', sans-serif;
    font-weight: 500;
    font-size: 0.95em;
    color: #fff;
    background-color: #1a1a1a;
    padding: 12px 28px;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.image-hero-button:hover {
    background-color: #333;
}

@media (max-width: 768px) {
    .image-hero-section {
        min-height: 400px;
        padding: 60px 20px;
    }
    
    .image-hero-text-box {
        padding: 30px;
        max-width: 100%;
    }
    
    .image-hero-text-box h2 {
        font-size: 1.8em;
    }
}
