/* CGT Union Locale Épinal - Main Stylesheet */
/* Theme Colors: #f03e3e (red), #fab005 (yellow), #dcdad7 (light gray) */

:root {
    --primary-red: #f03e3e;
    --secondary-yellow: #fab005;
    --light-gray: #dcdad7;
    --dark-gray: #333;
    --white: #ffffff;
    --text-dark: #2c2c2c;
    --event-blue: #4a90e2;
    --event-purple: #9b59b6;
    --event-red: #f03e3e;
    --event-green: #27ae60;
    /* default header height — can be overridden on .navbar */
    --navbar-height: 90px;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}


/* Buttons */
.btn-primary {
    background-color: var(--primary-red);
    color: var(--white);
    padding: 1rem 2rem;
    border-radius: 30px;
    font-weight: bold;
    display: inline-block;
    transition: background-color 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary:hover {
    background-color: #d92a2a;
}

.btn-secondary {
    background-color: var(--secondary-yellow);
    color: var(--text-dark);
    padding: 1rem 2rem;
    border-radius: 30px;
    font-weight: bold;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.btn-secondary:hover {
    background-color: #e09f04;
}

.btn-large {
    padding: 1.2rem 2.5rem;
    font-size: 1.1rem;
}

/* Navigation Bar */
.navbar {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    /* expose a CSS variable so hero can size against the header */
    --navbar-height: 90px;
    height: var(--navbar-height);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.nav-site-title {
    display: inline-block;
    color: var(--primary-red);
    font-weight: 1000;
    margin-left: 12px;
    vertical-align: text-top;
    line-height: 1;
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-red);
}

.nav-search {
    display: flex;
    gap: 0.5rem;
}

.search-bar {
    padding: 0.5rem 1rem;
    border: 1px solid var(--light-gray);
    border-radius: 20px;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-bar:focus {
    border-color: var(--primary-red);
}

.search-button {
    background-color: var(--primary-red);
    color: var(--white);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-button:hover {
    background-color: #d92a2a;
}

.nav-social {
    display: flex;
    gap: 1rem;
}

.social-icon {
    font-size: 1.5rem;
    color: var(--text-dark);
    transition: color 0.3s ease;
}

.social-icon:hover {
    color: var(--primary-red);
}

.btn-syndicate {
    background-color: var(--primary-red);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.btn-syndicate:hover,
.btn-syndicate.active {
    background-color: #d92a2a;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger .bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    margin: 3px 0;
    transition: 0.3s;
}



/* Hero Section: fill remaining viewport height after header */
.hero-section {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    /* use a fallback in case --navbar-height isn't inherited or set on the header */
    height: calc(100vh - var(--navbar-height, 90px));
    overflow: hidden;
}

/* Make the video container fill the hero area and position content above it */
.video-container {
    position: absolute;
    inset: 0; /* top:0; right:0; bottom:0; left:0 */
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.video-container video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    object-fit: cover;
    filter: brightness(0.6);
    min-width: 100%;
    min-height: 100%;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    pointer-events: none;
    z-index: 5;
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    width: 90%;
    max-width: 800px;
}

.hero-content h1 {
    font-size: 2.5rem;
    color: var(--white);
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* News Section */
.news-section {
    padding: 4rem 0;
    background-color: var(--white);
}

.news-section h2 {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 2rem;
    text-align: center;
}

.instagram-feed {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.instagram-placeholder {
    text-align: center;
    padding: 3rem;
    background-color: var(--light-gray);
    border-radius: 10px;
    grid-column: 1 / -1;
}

/* Events Section */
.events-section {
    padding: 4rem 0;
    background-color: var(--light-gray);
}

.events-section h2 {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 2rem;
    text-align: center;
}

.events-list {
    margin-bottom: 2rem;
    min-height: 200px;
}

.event-item {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-left: 5px solid var(--primary-red);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.event-item.blue {
    border-left-color: var(--event-blue);
}

.event-item.purple {
    border-left-color: var(--event-purple);
}

.event-item.red {
    border-left-color: var(--event-red);
}

.event-item.green {
    border-left-color: var(--event-green);
}

.event-date {
    font-weight: bold;
    color: var(--text-dark);
    min-width: 100px;
}

.event-title {
    flex: 1;
    padding: 0 1rem;
    font-size: 1.1rem;
}

.event-time {
    color: #666;
    min-width: 80px;
    text-align: right;
}

.loading-message {
    text-align: center;
    color: #666;
    padding: 2rem;
}

/* Intro Page */
.intro-section {
    padding: 4rem 0;
}

.intro-section h1 {
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: 2rem;
    text-align: center;
}

.intro-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
}

.intro-text h2 {
    color: var(--primary-red);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.intro-text p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.8;
}

.values-list,
.benefits-list {
    margin: 1rem 0 2rem 2rem;
}

.values-list li,
.benefits-list li {
    margin-bottom: 1rem;
    list-style: disc;
    font-size: 1.1rem;
}

.cta-section {
    text-align: center;
    margin-top: 3rem;
}

.intro-sidebar .info-box {
    background-color: var(--light-gray);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.intro-sidebar .info-box h3 {
    color: var(--primary-red);
    margin-bottom: 1rem;
}

/* make entire info-box clickable when used as a link */
.info-box-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.info-box-link:focus {
    outline: 3px solid rgba(240,62,62,0.25);
    outline-offset: 2px;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.social-btn {
    background-color: var(--white);
    color: var(--text-dark);
    padding: 0.75rem 1rem;
    border-radius: 5px;
    display: block;
    text-align: center;
    transition: background-color 0.3s ease;
}

.social-btn:hover {
    background-color: var(--primary-red);
    color: var(--white);
}

/* Calendar Page */
.calendar-section {
    padding: 4rem 0;
}

.calendar-section h1 {
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: 2rem;
    text-align: center;
}

.calendar-legend {
    background-color: var(--light-gray);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
}

.calendar-legend h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.legend-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 3px;
}

.legend-color.blue {
    background-color: var(--event-blue);
}

.legend-color.purple {
    background-color: var(--event-purple);
}

.legend-color.red {
    background-color: var(--event-red);
}

.legend-color.green {
    background-color: var(--event-green);
}

.calendar-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    background-color: var(--white);
    color: var(--text-dark);
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--light-gray);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--primary-red);
    color: var(--white);
    border-color: var(--primary-red);
}

.events-container {
    min-height: 300px;
}

/* Contact Page */
.contact-section {
    padding: 4rem 0;
}

.contact-section h1 {
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: 2rem;
    text-align: center;
}

.contact-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
}

.contact-info h2 {
    color: var(--primary-red);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.contact-info p {
    font-size: 1.4rem;
}

.contact-details {
    margin: 2rem 0;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: var(--light-gray);
    border-radius: 10px;
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--primary-red);
    margin-top: 0.25rem;
}

.contact-text h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.contact-text p {
    color: #666;
}

.contact-text a {
    color: var(--primary-red);
    transition: color 0.3s ease;
}

.contact-text a:hover {
    color: #d92a2a;
}

.syndicate-section {
    margin-top: 3rem;
    padding: 2rem;
    background-color: var(--light-gray);
    border-radius: 10px;
    text-align: center;
}

.syndicate-section h2 {
    color: var(--primary-red);
    margin-bottom: 1rem;
}

.contact-sidebar .info-box {
    background-color: var(--light-gray);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.contact-sidebar .info-box h3 {
    color: var(--primary-red);
    margin-bottom: 1rem;
}

.contact-sidebar .info-box ul {
    margin-left: 1.5rem;
}

.contact-sidebar .info-box ul li {
    margin-bottom: 0.5rem;
    list-style: disc;
}

/* Search Page */
.search-section {
    padding: 4rem 0;
    min-height: 60vh;
}

.search-section h1 {
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: 2rem;
    text-align: center;
}

.search-form {
    margin-bottom: 3rem;
}

.search-box {
    display: flex;
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.search-input-large {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid var(--light-gray);
    border-radius: 30px;
    font-size: 1.1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-input-large:focus {
    border-color: var(--primary-red);
}

.search-results {
    max-width: 800px;
    margin: 0 auto;
}

.search-info {
    text-align: center;
    color: #666;
    padding: 2rem;
}

.search-result-item {
    background-color: var(--light-gray);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.search-result-item h3 {
    color: var(--primary-red);
    margin-bottom: 0.5rem;
}

.search-result-item a {
    color: var(--primary-red);
    font-weight: bold;
}

.search-result-item a:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    background-color: var(--text-dark);
    color: var(--white);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-sitemap h3 {
    color: var(--secondary-yellow);
    margin-bottom: 1rem;
}

.footer-sitemap ul li {
    margin-bottom: 0.5rem;
}

.footer-sitemap a {
    color: var(--white);
    transition: color 0.3s ease;
}

.footer-sitemap a:hover {
    color: var(--secondary-yellow);
}

.footer-copyright {
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Responsive Design */
@media screen and (max-width: 1024px) {
    .nav-menu {
        gap: 1rem;
    }

    .intro-content,
    .contact-content {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 90px;
        flex-direction: column;
        background-color: var(--white);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
        gap: 1.5rem;
    }

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

    .nav-search,
    .nav-social,
    .nav-cta {
        width: 100%;
        justify-content: center;
    }

    .hero-content h1 {
        font-size: 1.8rem;
    }

    .search-box {
        flex-direction: column;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

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

    .legend-items {
        grid-template-columns: 1fr;
    }

    .calendar-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .event-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .event-time {
        text-align: left;
    }
}

@media screen and (max-width: 480px) {
    .nav-container {
        padding: 1rem;
    }

    .hero-content h1 {
        font-size: 1.5rem;
    }

    .intro-section h1,
    .calendar-section h1,
    .contact-section h1,
    .search-section h1 {
        font-size: 2rem;
    }

    .btn-primary,
    .btn-secondary {
        padding: 0.8rem 1.5rem;
    }
}
