html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

/* ==========================================================================
   1. RESET & BASE STYLES
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

/* Global Paragraph Styling for Academic Justification */
p {
    text-align: justify;
    text-justify: inter-word;
    /* Distributes space evenly between words, not letters */

    /* CRITICAL: Allows the browser to hyphenate long words instead of creating massive white gaps */
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    -ms-hyphens: auto;
    hyphens: auto;
}

body {
    background-color: #f4f4f9;
    color: #333;
}

/* ==========================================================================
   2. TYPOGRAPHY & UTILITIES
   ========================================================================== */
/* Alternate background stripe utility — applied to every other .page-section */
.alt-bg {
    background-color: #f4f4f9;
}

/* --- MERLION HEADING DECORATION --- */
h2::before {
    content: "";
    display: inline-block;
    width: 40px;
    height: 40px;
    background-image: url("media/merlion-logo.svg");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-right: 15px;
    vertical-align: middle;
    position: relative;
    top: -3px;
}

/* Exclude the Merlion from the banner */
.banner-text h2::before {
    display: none;
}

/* --- L-BRACKET HEADING STYLE --- */
.bracket-heading {
    font-size: 2.2rem;
    font-weight: 800;
    color: #4a0b12;
    border-left: 5px solid #ed2939;
    border-bottom: 2px solid #ed2939;
    padding-left: 1.2rem;
    padding-bottom: 0.8rem;
    margin-bottom: 2rem;
    margin-top: 2rem;
    width: 100%;
}

/* Fallback placeholder text style */
.placeholder-text {
    color: #666666;
    font-style: italic;
    font-size: 1.05rem;
    grid-column: 1 / -1;
}

/* ==========================================================================
   3. LAYOUT CONTAINERS
   ========================================================================== */
/* --- UNIVERSAL CONTENT CONTAINER --- */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ==========================================================================
   4. NAVIGATION BAR
   ========================================================================== */
.navbar {
    background-color: #ed2939;
    /* Singapore Flag Red */
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    min-height: 70px;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: black;
    text-decoration: none;
    padding: 0 55px 0 75px;
    position: relative;
    z-index: 1;
}

.navbar-brand::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 60px;
    background:
        url('media/halftone.svg') left center / 80px 100% no-repeat,
        linear-gradient(to right, transparent 79px, white 79px);
    z-index: -1;
}

.navbar-brand::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 140px;
    transform: skewX(-20deg);
    transform-origin: bottom right;
    background: linear-gradient(to left,
            white 0, white 6px,
            transparent 6px, transparent 11px,
            white 11px, white 17px,
            transparent 17px, transparent 22px,
            white 22px, white 28px,
            transparent 28px, transparent 34px,
            white 34px, white 100%);
    z-index: -1;
}

.navbar-logo {
    height: 32px;
    width: auto;
}

.banner-logo {
    display: block;
    max-width: 120px;
    height: auto;
    margin: 0 auto 1.5rem auto;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #ffcccc;
}

/* --- HAMBURGER ICON BASE --- */
.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    z-index: 1001;
    align-self: center;
}

.hamburger .bar {
    width: 25px;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ==========================================================================
   5. LOADING SCREEN & VIDEO BANNER
   ========================================================================== */
/* Video Loading Screen Container */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background-color: #000;
    transition: opacity 1s ease-out;
}

.loading-content {
    position: relative;
    z-index: 3;
    text-align: center;
    color: white;
}

.loading-content h1 {
    font-size: 3rem;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.loading-content p {
    /* OVERRIDES THE GLOBAL PARAGRAPH RULES */
    text-align: center;
    -webkit-hyphens: none;
    -moz-hyphens: none;
    -ms-hyphens: none;
    hyphens: none;
}

#loading-percentage {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ed2939;
}

/* The Background Video */
#bg-video,
.bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    transition: opacity 2s ease-in-out;
    transform: translateZ(0);
    backface-visibility: hidden;
}

#bg-video {
    width: 100vw;
    height: 100vh;
}

/* The Dimming Overlay */
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2;
}

/* Isolated container for video banner background */
.hero-banner {
    height: 800px;
    width: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.banner-text {
    position: relative;
    z-index: 2;
    padding: 2rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    text-align: center;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
}

.banner-text h2 {
    font-size: 2.5rem;
}

.banner-text p {
    font-size: 2rem;

    /* OVERRIDES THE GLOBAL PARAGRAPH RULES */
    text-align: center;
    -webkit-hyphens: none;
    -moz-hyphens: none;
    -ms-hyphens: none;
    hyphens: none;
}

/* ==========================================================================
   6. MAIN SECTIONS
   ========================================================================== */
/* --- PAGE SECTION (general-purpose content stripe) --- */
.page-section {
    position: relative;
    width: 100%;
    padding: 5rem 0;
    background-color: #ffffff;
    color: #333333;
}

.section-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
}

.section-body {
    flex: 1;
}

.section-body h2 {
    font-size: 2.2rem;
    color: #4a0b12;
    margin-bottom: 1.5rem;
}

.section-body p {
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

.section-body p:last-child {
    margin-bottom: 0;
}

.section-image {
    flex: 0 0 250px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.section-image img {
    width: 100%;
    max-width: 220px;
    height: auto;
    margin-bottom: 1rem;
}

.section-image p {
    font-weight: 700;
    color: #555555;
    font-size: 0.95rem;
}

/* --- INTRO LOOP VIDEO PANEL --- */
.section-video {
    flex: 0 0 420px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    background-color: #fff;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.section-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.8s ease-in-out;
}

/* --- LATEST NEWS SECTION --- */
.news-section {
    padding: 5rem 0;
    background-color: #f4f4f9;
    width: 100%;
}

.section-title {
    font-size: 2.2rem;
    color: #333;
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 290px;
    height: 4px;
    background-color: #ed2939;
    border-radius: 2px;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.news-item {
    display: flex;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.news-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.news-date {
    background-color: #ed2939;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-width: 100px;
    padding: 1rem;
    text-align: center;
}

.news-date .day {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
}

.news-date .month {
    font-size: 1rem;
    text-transform: uppercase;
    font-weight: 600;
    margin: 0.2rem 0;
}

.news-date .year {
    font-size: 0.8rem;
    opacity: 0.8;
}

.news-content {
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.news-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.news-content h3 a {
    color: #222222;
    text-decoration: none;
    transition: color 0.2s ease;
}

.news-content h3 a:hover {
    color: #ed2939;
}

.news-content p {
    color: #666666;
    line-height: 1.5;
    font-size: 0.95rem;
}

/* --- COMMITTEE MEMBER GRID SYSTEM --- */
.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
    width: 100%;
}

.member-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
    border-top: 3px solid #ed2939;
}

.member-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.member-avatar img {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1.2rem;
    background-color: #eee;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.member-info h3 {
    font-size: 1.2rem;
    color: #222222;
    margin-bottom: 0.4rem;
    font-weight: 700;
}

.member-info p {
    text-align: center;

    /* CRITICAL: Allows the browser to hyphenate long words instead of creating massive white gaps */
    -webkit-hyphens: none;
    -moz-hyphens: none;
    -ms-hyphens: none;
    hyphens: none;
}

.member-info .affiliation {
    font-size: 0.95rem;
    color: #555555;
    line-height: 1.4;
    margin-bottom: 0.2rem;
}

.member-info .country {
    font-size: 0.85rem;
    color: #888888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- IMPORTANT DATES TABLE --- */
.dates-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 1.05rem;
}

.dates-table th,
.dates-table td {
    padding: 1.2rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.dates-table th {
    color: #4a0b12;
    font-weight: 600;
    width: 60%;
}

.dates-table td {
    color: #333333;
    font-weight: 500;
}

.dates-table tr:hover {
    background-color: #fafafa;
}

/* --- CALL FOR CONTRIBUTIONS --- */
.cfc-content-block {
    margin-top: 1.5rem;
    margin-bottom: 3rem;
}

.cfc-content-block p {
    margin-bottom: 1.2rem;
    line-height: 1.7;
    color: #444444;
    font-size: 1.05rem;
}

/* Custom h3 Sub-headings */
.cfc-content-block h3 {
    font-size: 1.4rem;
    color: #4a0b12;
    /* Matches the dark burgundy of your h2 */
    font-weight: 700;
    letter-spacing: 0.5px;

    /* The subtle red accent line */
    border-left: 3px solid #ed2939;
    padding-left: 0.8rem;

    /* Breathing room */
    margin-top: 2.5rem;
    /* Pushes the heading away from the previous paragraph */
    margin-bottom: 1rem;
}

/* Prevents the very first h3 from having a massive gap at the top of the section */
.cfc-content-block h3:first-of-type {
    margin-top: 0.5rem;
}

.cfc-list {
    list-style: none;
    padding-left: 0;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.cfc-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.6;
    color: #444444;
    font-size: 1.05rem;
}

.cfc-list li::before {
    content: "■";
    color: #ed2939;
    position: absolute;
    left: 0;
    top: -1px;
    font-size: 0.9rem;
}

.two-column-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 3rem;
}

/* --- PARTNERS & ORGANIZERS --- */
.partners-section {
    width: 100%;
    padding: 5rem 0;
    background-color: #ffffff;
    text-align: center;
}

.partners-title {
    font-size: 2rem;
    color: #333333;
    margin-bottom: 3rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.partners-flex {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5rem;
    flex-wrap: wrap;
}

.partner-logo img {
    max-width: 250px;
    height: auto;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.3s ease;
    mix-blend-mode: multiply;
}

.partner-logo img:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.05);
}

/* ==========================================================================
   7. FOOTER
   ========================================================================== */
.footer {
    background-color: #111111;
    color: #ffffff;
    border-top: 4px solid #ed2939;
    padding: 4rem 0 2rem 0;
    font-size: 0.9rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
}

.footer-col h4 {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.footer-col p {
    margin-bottom: 0.5rem;
    color: #cccccc;
}

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

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

.footer-col a {
    color: #cccccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-col a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.footer-logo {
    max-width: 180px;
    margin-top: 1.5rem;
    filter: brightness(0.9);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid #333333;
    padding-top: 2rem;
    color: #888888;
    font-size: 0.8rem;
}

.footer-bottom p {
    margin-bottom: 0.5rem;
}

.footer-bottom a {
    color: #888888;
    text-decoration: none;
}

.footer-bottom a:hover {
    color: #ffffff;
}

/* ==========================================================================
   8. MOBILE RESPONSIVENESS (MEDIA QUERIES)
   ========================================================================== */
@media (max-width: 950px) {

    /* Navbar & Hamburger Drawer */
    .hamburger {
        display: flex;
        order: -1;
        margin-left: 0;
        margin-right: 1.5rem;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: -100%;
        right: auto;
        width: 250px;
        height: 100vh;
        background-color: #111111;
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 80px;
        transition: left 0.4s ease;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.5);
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links li {
        text-align: center;
        margin: 1.5rem 0;
    }

    .nav-links a {
        font-size: 1.2rem;
    }

    /* Hamburger Animation */
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Loading Screen & Hero Banner */
    .loading-content h1 {
        font-size: 2rem;
    }

    .loading-content p {
        /* OVERRIDES THE GLOBAL PARAGRAPH RULES */
        text-align: center;
        -webkit-hyphens: none;
        -moz-hyphens: none;
        -ms-hyphens: none;
        hyphens: none;
    }

    #loading-percentage {
        font-size: 1.2rem;
    }

    .banner-text h2 {
        font-size: 1.8rem;
    }

    .banner-text p {
        font-size: 1.2rem;

        /* OVERRIDES THE GLOBAL PARAGRAPH RULES */
        text-align: center;
        -webkit-hyphens: none;
        -moz-hyphens: none;
        -ms-hyphens: none;
        hyphens: none;
    }

    /* Introduction Section */
    .section-layout {
        flex-direction: column;
        align-items: stretch;
        gap: 3rem;
    }

    .section-image {
        flex: auto;
        align-self: center;
    }

    .section-video {
        flex: auto;
        width: 100%;
    }

    /* Dates Table */
    .dates-table th,
    .dates-table td {
        display: block;
        width: 100%;
        padding: 0.5rem 0;
    }

    .dates-table th {
        border-bottom: none;
        padding-top: 1.2rem;
    }

    .dates-table td {
        padding-bottom: 1.2rem;
        font-weight: 700;
        color: #ed2939;
    }

    /* Call for Contributions */
    .two-column-list {
        grid-template-columns: 1fr;
        gap: 0;
    }

    /* Partners Section (formerly Sponsors) */
    .partners-flex {
        gap: 3rem;
        flex-direction: column;
    }

    .partners-title {
        font-size: 1.5rem;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-col h4 {
        margin-bottom: 1rem;
    }
}

/* Smaller Breakpoint for News Articles */
@media (max-width: 600px) {
    .news-item {
        flex-direction: column;
    }

    .news-date {
        flex-direction: row;
        min-width: 100%;
        gap: 0.5rem;
        padding: 0.6rem;
    }

    .news-date .day {
        font-size: 1.3rem;
    }

    .news-content {
        padding: 1.2rem;
    }
}