/* General Styles & Reset */
:root {
    --primary-red: #CD0000; /* Simbu Red */
    --primary-black: #000000;
    --primary-gold: #FFD700; /* Gold */
    --secondary-brown: #8B4513;
    --secondary-cream: #F5F5DC;
    --secondary-grey: #808080;
    --text-color-dark: #333;
    --text-color-light: #f4f4f4;
    --header-height: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-color-dark);
    background-color: #f8f8f8;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-padding {
    padding: 80px 0;
}

.light-bg {
    background-color: var(--secondary-cream);
}

h1, h2, h3, h4 {
    font-family: 'Poppins', 'Montserrat', sans-serif;
    color: var(--primary-black);
    margin-bottom: 20px;
}

h2 {
    font-size: clamp(1.8em, 4vw, 2.5em); /* Responsive font size */
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

h2::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -10px;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--primary-red);
    border-radius: 2px;
}

p {
    margin-bottom: 15px;
}

a {
    text-decoration: none;
    color: var(--primary-red);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-black);
}

.button {
    display: inline-block;
    background-color: var(--primary-red);
    color: #fff;
    padding: 12px 25px;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: none;
    cursor: pointer;
    font-weight: bold;
    text-align: center;
}

.button:hover {
    background-color: var(--primary-black);
    transform: translateY(-2px);
}

.button.secondary-button {
    background-color: var(--secondary-grey);
    color: #fff;
}

.button.secondary-button:hover {
    background-color: var(--primary-black);
}

hr {
    border: 0;
    height: 1px;
    background-color: var(--secondary-grey);
    margin: 0 0 60px 0;
    width: 80%;
    margin-left: auto;
    margin-right: auto;
}

/* Header */
#main-header {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 15px 0;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: var(--header-height);
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

#main-header.sticky {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    background-color: #fff;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Styling for branding (logo + flag) */
.header-branding {
    display: flex;
    align-items: center;
    gap: 20px; /* Space between logo, flag, and new UPNG logo */
}

.logo img {
    height: 70px; /* Adjust as needed */
}

.simbu-flag img {
    height: 65px; /* Adjust flag size */
    width: auto;
    border-radius: 1px; /* Slightly rounded corners for flag */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); /* Subtle shadow for flag */
}

/* UPNG Logo Styling */
.UPNG-logo img {
    height: 65px; /* Match height of Simbu flag */
    width: auto;
    border-radius: 1px;
}


/* Default desktop navigation styles */
#main-nav ul {
    list-style: none;
    display: flex;
}

#main-nav ul li {
    margin-left: 20px;
}

#main-nav ul li a {
    color: var(--primary-black);
    font-weight: 600;
    transition: color 0.3s ease, transform 0.2s ease;
    position: relative;
    padding-bottom: 5px;
}

#main-nav ul li a:hover,
#main-nav ul li a.active {
    color: var(--primary-red);
}

#main-nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--primary-red);
    left: 0;
    bottom: 0;
    transition: width 0.3s ease;
}

#main-nav ul li a:hover::after,
#main-nav ul li a.active::after {
    width: 100%;
}

/* Styles for the Register Now Button */
.register-button {
    margin-left: 20px;
    background-color: var(--primary-red);
    color: #fff;
    padding: 10px 20px;
    border: 2px solid var(--primary-gold);
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    /* For the <a> tag inside the button */
    display: flex; /* Use flex to center the link content if needed */
    align-items: center;
    justify-content: center;
}

.register-button:hover {
    background-color: var(--primary-black);
    border-color: var(--primary-red);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.register-button a {
    color: #fff; /* Ensure the link text inside is white */
    text-decoration: none; /* Remove underline from the link */
    padding: 0; /* Remove any default padding from the <a> tag */
    display: contents; /* Make the anchor effectively 'disappear' in layout, passing text styles to parent */
}

.register-button a:hover {
    color: #fff; /* Keep text white on hover */
}

.menu-box {
    display: none; /* Hidden by default on desktop */
}

.menu-toggle {
    display: none; /* Hidden by default on desktop */
    font-size: 1.8em;
    cursor: pointer;
    color: var(--primary-black);
    transition: transform 0.3s ease; /* Smooth rotation for 'X' */
}


/* Hero Section (Leadership Page Specific) */
#leadership-hero {
    position: relative;
    padding-top: var(--header-height); /* Offset for fixed header */
    height: 40vh; /* Reduced height, consistent with activities.css */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-black) 100%);
    color: #fff;
    text-align: center;
    box-shadow: inset 0 -5px 15px rgba(0, 0, 0, 0.2);
}

/* Animation for hero overlay and cards */
@keyframes fadeInSlideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-overlay {
    position: relative;
    z-index: 10;
    background-color: transparent;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    color: #fff;
    max-width: 900px;
    transform: translateY(20px);
    opacity: 0;
    animation: fadeInSlideUp 1s forwards 0.5s;
}

.hero-overlay h1 {
    font-size: clamp(2em, 4vw, 3.5em); /* Responsive font size */
    margin-bottom: 10px; /* Reduced margin */
    color: var(--primary-gold); /* Gold for contrast */
    line-height: 1.2;
}

.hero-overlay p {
    font-size: clamp(1em, 2vw, 1.4em); /* Responsive font size */
    margin-bottom: 0; /* No bottom margin for hero paragraph */
}

/* Patron Section */
.patron-section .section-description {
    text-align: center;
    margin-bottom: 40px;
    font-size: 1.1em;
    color: var(--text-color-dark);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.patron-profile {
    display: flex;
    /* Changed for desktop view: */
    flex-direction: row; /* Arrange image and details side-by-side */
    align-items: center; /* Vertically align items */
    text-align: left; /* Align text to the left within details */
    
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    padding: 50px; /* Increased padding to enlarge section */
    max-width: 1000px; /* Increased max-width */
    margin: 0 auto;
    gap: 40px; /* Increased space between image and details */
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInSlideUp 1s forwards 0.2s;
}

.patron-image {
    min-width: 250px; /* Larger fixed width for the container */
    height: 250px; /* Fixed height for the container to make it square */
    overflow: hidden;
    border: 5px solid var(--primary-red);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    flex-shrink: 0; /* Prevent shrinking on smaller screens */
}

.patron-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures the image covers the entire square frame without distortion */
}

.patron-details {
    flex-grow: 1; /* Allow details to take remaining space */
}

.patron-details h3 {
    font-size: 2.5em; /* Enlarged font size for name */
    color: var(--primary-black);
    margin-bottom: 5px;
}

.patron-title {
    font-size: 1.2em; /* Slightly larger */
    color: var(--secondary-grey);
    margin-bottom: 15px;
    font-style: italic;
}

.patron-bio {
    font-size: 1.05em; /* Slightly larger */
    line-height: 1.6;
    margin-bottom: 20px;
}

.patron-details .button {
    margin-top: 20px;
    margin-right: 15px; /* Space between buttons */
}

.patron-details .button i {
    margin-right: 8px;
}

.patron-details .highlight {
    font-weight: bold;
    color: var(--primary-red);
    margin-top: 20px;
    font-size: 1.1em;
}

/* Executives, District, and Faculty Representatives Grids */
.section-description {
    text-align: center;
    margin-bottom: 40px;
    font-size: 1.1em;
    color: var(--text-color-dark);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.executive-grid,
.leader-grid { /* Applies to district and faculty grids too */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    padding: 0 20px;
}

.executive-card,
.leader-card { /* Applies to district-card, faculty-rep-card */
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    padding-bottom: 25px; /* Added padding to ensure consistent spacing */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInSlideUp 0.8s forwards;
}

.executive-card:nth-of-type(1) { animation-delay: 0.2s; }
.executive-card:nth-of-type(2) { animation-delay: 0.4s; }
.executive-card:nth-of-type(3) { animation-delay: 0.6s; }
.executive-card:nth-of-type(4) { animation-delay: 0.8s; }
.executive-card:nth-of-type(5) { animation-delay: 1.0s; }

.leader-card:nth-of-type(1) { animation-delay: 0.2s; }
.leader-card:nth-of-type(2) { animation-delay: 0.4s; }
.leader-card:nth-of-type(3) { animation-delay: 0.6s; }
.leader-card:nth-of-type(4) { animation-delay: 0.8s; }
.leader-card:nth-of-type(5) { animation-delay: 1.0s; }
.leader-card:nth-of-type(6) { animation-delay: 1.2s; }


.executive-card:hover,
.leader-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.executive-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-bottom: 3px solid var(--primary-red);
    margin-bottom: 20px;
}

.executive-card h3,
.leader-card h3 {
    font-size: 1.6em;
    color: var(--primary-black);
    margin-bottom: 5px;
    padding: 0 15px;
}

.executive-card .role {
    font-size: 1.1em;
    color: var(--primary-red);
    font-weight: bold;
    margin-bottom: 10px;
    padding: 0 15px;
}

.executive-card .bio {
    font-size: 0.95em;
    color: var(--text-color-dark);
    margin-bottom: 15px;
    line-height: 1.5;
    padding: 0 15px;
}

.executive-card .responsibility {
    font-size: 0.9em;
    color: var(--secondary-grey);
    margin-bottom: 20px;
    padding: 0 15px;
}

/* Toggleable Message (for Patron and President) */
.message-toggle {
    display: inline-block;
    background-color: var(--secondary-grey);
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
    margin-top: 10px;
    margin-bottom: 15px; /* Space between button and toggled content */
}

.message-toggle:hover {
    background-color: var(--primary-black);
}

.toggleable-message {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out, opacity 0.5s ease-out;
    opacity: 0;
    padding: 0 15px; /* Padding for content inside */
}

.toggleable-message.active {
    max-height: 500px; /* Arbitrary large value to allow content to expand */
    opacity: 1;
    padding: 15px; /* Show actual padding when active */
    margin-top: 15px; /* Space between button and content */
    background-color: var(--secondary-cream);
    border-radius: 8px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}

.toggleable-message h4 {
    color: var(--primary-red);
    margin-bottom: 10px;
    font-size: 1.1em;
    text-align: center; /* Center the message heading */
}

.toggleable-message p {
    font-style: italic;
    color: var(--text-color-dark);
    line-height: 1.6;
}


/* District and Faculty Rep Cards */
.district-card,
.faculty-rep-card {
    padding: 25px; /* Consistent padding for these cards */
}

.district-name,
.faculty-name {
    font-size: 1.5em;
    color: var(--primary-red);
    margin-bottom: 10px;
}

.rep-name {
    font-size: 1.1em;
    color: var(--primary-black);
    margin-bottom: 5px;
}

.rep-details {
    font-size: 0.95em;
    color: var(--secondary-grey);
    margin-bottom: 10px;
}

.contact-info {
    font-size: 0.9em;
}

.contact-info a {
    color: var(--primary-red);
    word-break: break-all; /* Ensures long emails don't overflow */
}


/* Footer */
footer {
    background-color: var(--primary-black);
    color: var(--text-color-light);
    padding: 40px 0; /* Adjusted from 50px */
    text-align: center;
    font-size: 0.85em; /* Adjusted from 0.9em */
    border-top: 5px solid var(--primary-red);
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 30px;
    text-align: left;
}

.footer-links,
.footer-socials,
.footer-contact,
.footer-copyright {
    flex: 1;
    min-width: 200px;
    padding: 0 10px;
}

.footer-links h3,
.footer-socials h3,
.footer-contact h3,
.footer-copyright p:first-child {
    color: var(--primary-gold);
    margin-bottom: 20px;
    font-size: 1.1em; /* Adjusted from 1.2em */
    font-family: 'Poppins', sans-serif;
    position: relative;
    padding-bottom: 5px;
}

.footer-links h3::after,
.footer-socials h3::after,
.footer-contact h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background-color: var(--primary-red);
}

.footer-links ul {
    list-style: none;
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links ul li a {
    color: var(--text-color-light);
    transition: color 0.3s ease;
}

.footer-links ul li a:hover {
    color: var(--primary-red);
    text-decoration: underline;
}

.footer-socials a {
    color: var(--text-color-light);
    font-size: 1.6em; /* Adjusted from 1.8em */
    margin-right: 15px;
    transition: color 0.3s ease, transform 0.2s ease;
}

.footer-socials a:hover {
    color: var(--primary-gold);
    transform: translateY(-3px);
}

.footer-contact p {
    margin-bottom: 10px;
    color: var(--text-color-light);
}

.footer-contact i {
    margin-right: 10px;
    color: var(--primary-red);
}

.footer-copyright {
    text-align: center;
    flex-basis: 100%; /* Takes full width on smaller screens */
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 20px;
}

.footer-copyright p {
    display: block; /* Ensure paragraphs break onto new lines */
    color: var(--text-color-light);
    margin-bottom: 5px; /* Adjusted from 8px */
}

.footer-copyright p:last-child {
    margin-bottom: 0; /* No bottom margin for the last paragraph */
}

.footer-copyright .developer-credit a {
    color: var(--primary-gold);
    font-weight: bold;
    white-space: nowrap; /* Prevent developer credit link from wrapping */
}


/* Mobile Responsiveness */
@media (max-width: 1024px) {
    #main-nav {
        display: flex; /* Always display as flex on mobile, control visibility with max-height */
        flex-direction: column;
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background-color: rgba(255, 255, 255, 0.98);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        z-index: 999;
        overflow: hidden;
        max-height: 0; /* Collapsed state */
        transition: max-height 0.4s ease-in-out;
    }

    #main-nav.active {
        max-height: 300px; /* Expanded state - adjust if more links are added */
        border-top: 1px solid var(--primary-red);
    }

    #main-nav ul {
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
    }

    #main-nav ul li {
        margin: 10px 0;
    }

    #main-nav ul li a {
        font-size: 1.1em;
        padding: 10px 20px;
        display: block;
        width: 100%;
        text-align: center;
    }

    .register-button {
        display: none; /* Hide register button on mobile */
    }

    .menu-box {
        display: block; /* Show menu toggle container */
    }

    .menu-toggle {
        display: block; /* Show hamburger icon */
    }

    .header-content {
        padding: 0 15px;
    }

    .header-branding {
        flex-grow: 1; /* Allow branding to take available space */
        justify-content: flex-start; /* Push logos to the left */
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-links,
    .footer-socials,
    .footer-contact,
    .footer-copyright {
        width: 100%;
        max-width: 300px; /* Constrain width for better mobile layout */
        margin-bottom: 20px;
    }

    .footer-socials a {
        margin: 0 10px;
    }

    .footer-links h3::after,
    .footer-socials h3::after,
    .footer-contact h3::after {
        left: 50%;
        transform: translateX(-50%);
    }

    /* Hero section adjustments for tablets */
    #leadership-hero {
        height: 45vh; /* Slightly reduced height for tablets */
    }
    .hero-overlay h1 {
        font-size: 2.5em; /* Adjusted for tablets */
    }
    .hero-overlay p {
        font-size: 1.2em; /* Adjusted for tablets */
    }

    /* Patron section mobile adjustments */
    .patron-profile {
        flex-direction: column; /* Stack image and details vertically on mobile */
        text-align: center;
        padding: 30px; /* Adjusted padding */
        gap: 20px; /* Adjusted gap */
        min-height: 500px; /* Ensure consistent height for patron card on mobile, adjust as needed */
    }

    .patron-image {
        margin-bottom: 0; /* No bottom margin when stacked */
        width: 180px; /* Slightly smaller image on mobile */
        height: 180px; /* Maintain square aspect ratio */
    }

    .patron-details .button {
        margin: 10px auto; /* Center buttons and give space */
        display: block;
    }

    .executive-grid,
    .leader-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        padding: 0 10px;
    }
}

@media (max-width: 768px) {
    h2 {
        font-size: 2em;
    }

    .section-padding {
        padding: 60px 0;
    }

    /* Hero section adjustments for mobile phones */
    #leadership-hero {
        height: 35vh; /* Significantly reduced height for mobile */
        padding-top: calc(var(--header-height) + 20px); /* Add some top padding */
    }
    .hero-overlay {
        padding: 20px;
    }
    .hero-overlay h1 {
        font-size: 2em; /* Reduced font size for mobile */
        margin-bottom: 5px;
    }
    .hero-overlay p {
        font-size: 1em; /* Reduced font size for mobile */
    }

    .header-branding {
        gap: 8px;
    }
    .logo img {
        height: 50px;
    }
    .simbu-flag img, .UPNG-logo img {
        height: 45px;
    }

    /* Single column and equal dimensions for leader cards on mobile */
    .executive-grid,
    .leader-grid {
        grid-template-columns: 1fr; /* Single column on very small screens */
        padding: 0 10px;
    }

    .executive-card,
    .leader-card {
        margin: 0 auto; /* Center cards */
        max-width: 400px; /* Max width for single column cards */
        min-height: 250px; /* Ensure equal dimensions for leader cards on mobile */
        display: flex; /* Use flexbox to organize content vertically within the card */
        flex-direction: column;
        justify-content: space-between; /* Distribute space */
        align-items: center; /* Center content horizontally */
        padding-top: 25px; /* Keep consistent padding */
    }

    .executive-card img {
        width: 100%;
        height: auto; /* Allow height to adjust based on aspect-ratio */
        aspect-ratio: 1/1; /* Maintain a square aspect ratio for the photo frame */
        margin-bottom: 15px;
    }

    /* Specific adjustments for leader card content to fit min-height */
    .leader-card h3,
    .leader-card p {
        margin-bottom: 10px; /* Adjust margins for tighter fit */
    }

    .patron-profile {
        padding: 20px;
        min-height: 450px; /* Adjust min-height for patron card if needed to fit content */
    }
}

/* Print Styles */
@media print {
    header, footer, .register-button, .menu-box, .message-toggle {
        display: none !important;
    }
    body {
        background-color: #fff;
        color: #000;
        font-size: 12pt;
    }
    .container {
        max-width: none;
        padding: 0;
    }
    .section-padding {
        padding: 20px 0;
    }
    .hero-section {
        background: none;
        color: #000;
        height: auto;
        padding-top: 0;
    }
    .hero-overlay {
        padding: 0;
        animation: none;
        opacity: 1;
        transform: none;
    }
    .patron-profile, .executive-card, .leader-card {
        box-shadow: none;
        border: 1px solid #eee;
        page-break-inside: avoid;
        animation: none;
        opacity: 1;
        transform: none;
    }
    .patron-image {
        border: 1px solid #eee; /* Ensure a visible border in print */
    }
    .executive-card img {
        height: 150px;
    }
    .toggleable-message {
        max-height: fit-content !important;
        opacity: 1 !important;
        padding: 15px !important;
        background-color: #f0f0f0;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    h1, h2, h3, h4 {
        color: #000;
    }
    h2::after {
        background-color: #000;
    }
}