/* Smooth scolling */ 
html {
    scroll-behavior: smooth;
}

/* Global Styles & Base Typography */
:root {
    /* Define color palette as CSS variables for easy updates */
    --primary-blue: #004080;
    --dark-blue: #003366;
    --darker-blue: #002244;
    --light-grey: #f0f0f0;
    --medium-grey: #e0e0e0; /* A slightly darker grey for subtle accents */
    --text-color: #333;
    --white: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--light-grey);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header Section */
header {
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 40px 20px;
    text-align: center;
    border-bottom: 5px solid var(--dark-blue);
    box-shadow: 0 4px 8px var(--shadow-color);
    position: relative; /* allows absolute positioning inside */
    overflow: hidden;    /* hide canvas overflow */
}

#parabolicCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

header h1 {
    font-size: 3em;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #fff;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.3);
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto;
}

header img {
    max-width: 200px;
    height: auto;
    margin-top: 20px;
    border-radius: 50%;
}

header h1,
header p,
header img {
    position: relative;
    z-index: 100;
}

/* Navigation Bar */
nav {
    text-align: center;
    padding: 15px 0;
    background-color: var(--dark-blue);
    border-bottom: 3px solid var(--darker-blue);
    box-shadow: 0 2px 5px var(--shadow-color);
}

nav a {
    color: var(--white);
    margin: 0 20px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    transition: color 0.3s ease, transform 0.2s ease;
    padding: 5px 0;
    position: relative;
}

nav a:hover {
    color: var(--medium-grey);
    transform: translateY(-2px);
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--white);
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

/* Main Content Layout */
.container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    padding: 0 20px;
    margin: 40px auto;
    gap: 30px;
    box-sizing: border-box;
}

.main-content {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
}

.sidebar {
    flex: 1;
    background-color: var(--white);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0px 4px 15px var(--shadow-color);
    max-width: 300px;
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    align-self: stretch;
    box-sizing: border-box;
}

/* Section Styling */
section {
    background-color: var(--white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0px 4px 15px var(--shadow-color);
    border-left: 5px solid var(--primary-blue);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

section:hover {
    transform: translateY(-5px);
    box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.15);
}

h2 {
    color: var(--primary-blue);
    margin-bottom: 20px;
    font-size: 2em;
    border-bottom: 2px solid var(--medium-grey);
    padding-bottom: 10px;
}

/* Research Area Specific Styles */
.research-area {
    margin-bottom: 20px;
    padding: 15px;
    background-color: var(--light-grey);
    border-radius: 8px;
    border-left: 3px solid var(--dark-blue);
}

.research-area h3 {
    color: var(--dark-blue);
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.3em;
}

/* Team Section */
.team {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.team div {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 0;
    padding: 10px;
    border-radius: 8px;
    background-color: var(--light-grey);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex-basis: calc(33% - 20px);
    min-width: 180px;
    max-width: 200px;
    box-sizing: border-box;
}

.team div:hover {
    transform: translateY(-5px);
    box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.1);
}

.team img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--primary-blue);
    margin-bottom: 10px;
    transition: transform 0.3s ease;
}

.team div:hover img {
    transform: scale(1.05);
}

.team p {
    margin: 5px 0 0 0;
    font-size: 0.95em;
    line-height: 1.3;
}

.team p i {
    font-size: 0.85em;
    color: #666;
}

/* Publications Section */
.publications a {
    color: var(--primary-blue);
    font-weight: bold;
    text-decoration: none;
    transition: color 0.3s ease, text-decoration 0.3s ease;
}

.publications a:hover {
    color: var(--dark-blue);
    text-decoration: underline;
}

/* Contact Section */
#contact p {
    margin-bottom: 10px;
}

#contact b {
    color: var(--dark-blue);
}

/* Footer Section */
footer {
    text-align: center;
    background-color: var(--dark-blue);
    color: var(--white);
    padding: 20px;
    margin-top: auto;
    border-top: 5px solid var(--darker-blue);
    font-size: 0.9em;
}

/* Bluesky Embed Specific Styles */
#embedbsky-com-timeline-embed {
    max-width: 100%;
    overflow-x: hidden;
    border-radius: 8px;
    height: auto;
    flex-grow: 1;
    overflow-y: auto;
    box-sizing: border-box;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .container {
        flex-direction: column;
        padding: 20px;
        align-items: center;
    }

    .main-content, .sidebar {
        max-width: 100%;
        width: 100%;
    }

    .sidebar {
        margin-top: 30px;
        height: auto;
        min-height: unset;
    }

    #embedbsky-com-timeline-embed {
        height: 600px;
        max-height: 80vh;
    }

    header h1 {
        font-size: 2em;
    }

    nav a {
        margin: 0 10px;
        font-size: 1em;
    }

    .team div {
        flex-basis: calc(50% - 20px);
    }
}

@media (max-width: 768px) {
    header {
        padding: 30px 15px;
    }

    nav {
        padding: 10px 0;
    }

    nav a {
        margin: 0 8px;
        font-size: 0.9em;
    }

    .container {
        padding: 15px;
        gap: 20px;
    }

    section {
        padding: 20px;
    }

    h2 {
        font-size: 1.8em;
    }

    .team div {
        flex-basis: 100%;
        max-width: 250px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8em;
    }

    nav a {
        display: block;
        margin: 8px 0;
        padding: 5px 0;
    }

    .team img {
        width: 100px;
        height: 100px;
    }
}

.sub-footer {
    background-color: #f1f3f5;
    padding: 50px 20px; /* keep horizontal padding */
    border-top: 1px solid #ccc;
    font-family: 'Segoe UI', sans-serif;
    color: #444;
    box-sizing: border-box;
}

.sub-footer-container {
    max-width: 1200px; /* match main container width */
    margin: 0 auto;
    padding: 0 30px; /* your original padding */
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: space-between;
    box-sizing: border-box;
}

/* Left: Logos */
.footer-logo {
    flex: 1 1 300px;
    display: flex;
    align-items: center;
}

.logo-stack-horizontal {
    display: flex;
    flex-wrap: wrap; /* allows wrapping on smaller screens */
    justify-content: center;
    align-items: center;
    gap: 40px;
    width: 100%; /* ensure it uses full available width */
    max-width: 100%; /* remove any implicit restriction */
}

.logo-ubics {
    width: 450px; /* increased from 340px */
    height: auto;
    object-fit: contain;
    max-width: 100%;
}

.logo-ub {
    width: 220px; /* increased from 160px */
    height: auto;
    object-fit: contain;
    max-width: 100%;
}

/* Middle: Menu */
.footer-menu {
    flex: 1 1 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
}

.footer-menu li {
    margin-bottom: 10px;
}

.footer-menu a {
    color: #444;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.3s ease;
}

.footer-menu a:hover {
    color: #007bff;
}

/* Right: Contact + Map */
.footer-contact {
    flex: 1 1 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
    text-align: center;
}

.footer-contact h4 {
    margin-bottom: 10px;
    font-size: 24px;
}

.contact-icons {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.contact-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    opacity: 0.8;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.contact-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

.map-embed iframe {
    border-radius: 8px;
    width: 100%;
    height: 120px;
}

/* Responsive Design */
@media (max-width: 992px) {
    .sub-footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0 20px;
        max-width: 100%;
    }

    .footer-logo,
    .footer-menu,
    .footer-contact {
        flex: none;
        width: 100%;
        max-width: 600px; /* keeps width consistent and no overflow */
        margin-bottom: 30px;
        justify-content: center;
    }

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

    .logo-stack-horizontal {
        justify-content: center;
        flex-wrap: wrap;
    }

    .logo-ubics,
    .logo-ub {
        max-width: 100%;
        width: auto;
        height: auto;
    }
}
