/* General styling */
:root {
    --primary-color: #192d96;
    --secondary-color: #0e2150;
    --accent-color: #f0f4ff;
    --text-color: #333;
    --background: #f9f9f9;
}

body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: var(--background);
    color: var(--text-color);
    scroll-behavior: smooth;
}

/* Hero header */
.hero {
    /* Combine a gradient backdrop with the professor's photo positioned so the face is visible (top right). The gradient covers the entire area while the photo scales to fit without cropping. */
    /* Lighten the overlay so the underlying photo remains visible. */
    background-image: linear-gradient(rgba(25, 45, 150, 0.4), rgba(14, 33, 80, 0.4)), url('images/HishamPhoto.png');
    background-size: cover, contain;
    background-repeat: no-repeat, no-repeat;
    background-position: center, top right;
    color: #fff;
    padding: 2rem 1rem;
    text-align: center;
}
.hero h1 {
    margin: 0;
    font-size: 2.8rem;
    line-height: 1.2;
}
.hero .subtitle {
    margin: 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 500;
}
.hero .tagline {
    margin: 0.5rem 0 1rem;
    font-size: 0.95rem;
    font-style: italic;
    color: #e0e8ff;
}
.hero .contact-links {
    font-size: 0.9rem;
}
.hero .contact-links a {
    color: #fffc;
    text-decoration: none;
}
.hero .contact-links a:hover {
    text-decoration: underline;
}
.hero .divider {
    margin: 0 0.5rem;
    color: #fffc;
}

/* Navigation bar */
.navbar {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.navbar ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}
.navbar li {
    margin: 0;
}
.navbar a {
    display: block;
    padding: 0.8rem 1rem;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.04rem;
}
.navbar a:hover, .navbar a:focus {
    background-color: var(--secondary-color);
}

/* Sections */
main {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 0;
}
section {
    margin-bottom: 2.5rem;
}
section h2 {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.3rem;
}
section h3 {
    font-size: 1.3rem;
    margin-top: 1.4rem;
    color: var(--primary-color);
}

section ul {
    margin: 0;
    padding-left: 1.2rem;
    list-style-type: disc;
}
section ul li {
    margin-bottom: 0.5rem;
}

.course-desc {
    margin-bottom: 0.4rem;
}

/* Demo grid */
.demo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.demo-card {
    position: relative;
    display: block;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-decoration: none;
}
.demo-card img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}
.demo-card:hover img {
    transform: scale(1.05);
}
.demo-card .demo-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 0.5rem;
    font-size: 0.85rem;
    text-align: center;
}
.demo-card::after {
    content: "\25B6";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.8);
    pointer-events: none;
    transition: color 0.3s ease;
}
.demo-card:hover::after {
    color: rgba(255, 255, 255, 1);
}

.media-coverage {
    margin: 1rem 0;
    text-align: center;
}
.media-coverage img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.media-coverage figcaption {
    font-size: 0.9rem;
    color: var(--text-color);
    margin-top: 0.5rem;
}

/* Hide any unexpected demo section inserted between our demo grid and the media collage. The page should only display our four curated demos. */
#demo-media .demo-grid + div {
    display: none;
}

/* Keep only our curated demos within the `demo-media` section. Hide any other elements inserted outside of the `.our-demos` wrapper (except the main heading). */
#demo-media > *:not(h2):not(.our-demos) {
    display: none;
}

/* Papers (research) styling */
.papers {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.paper {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    gap: 1rem;
}

.paper-thumb {
    position: relative;
    flex: 0 0 48%;
    max-width: 48%;
}
.paper-thumb img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
    object-fit: cover;
}
.venue-badge {
    position: absolute;
    left: 8px;
    top: 8px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 0.7rem;
    border-radius: 12px;
    line-height: 1;
}
.paper-meta {
    flex: 1 1 50%;
    max-width: 50%;
}
.paper-meta h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    color: var(--primary-color);
}
.paper-meta .summary {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-color);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.paper-meta .authors {
    /* Ensure the full author list is visible without truncation */
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-color);
    overflow: visible;
    display: block;
}
.paper-meta .links {
    font-size: 0.9rem;
    margin-top: 0.25rem;
}
.paper-meta .links a {
    color: var(--primary-color);
    text-decoration: none;
}
.paper-meta .links a:not(:last-child)::after {
    content: " | ";
    color: #666;
}

@media (max-width: 800px) {
    .paper {
        flex-direction: column;
    }
    .paper-thumb, .paper-meta {
        max-width: 100%;
    }
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: #fff;
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
}
