/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Merriweather', serif;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}


/* Hero Section */
.events-hero {
    height: 70vh;
    background: url("/media/Tempo\ Kitani.jpg") center/cover no-repeat;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-overlay {
    background: rgba(0, 0, 0, 0.4);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.events-hero h1 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 3rem;
    text-align: center;
    color: white;
    letter-spacing: 4px;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeIn 2.5s ease forwards;
}

.hero-subtitle {
    font-family: 'Merriweather', serif;
    font-size: 1.2rem;
    color: white;
    margin-top: 20px;
    text-align: center;
    max-width: 600px;
    opacity: 0;
    animation: fadeIn 2.5s ease forwards 0.5s;
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Responsive */
@media (max-width: 768px) {
    .events-hero h1 {
        font-size: 2rem;
        letter-spacing: 2px;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        padding: 0 20px;
    }
    
}

/* ===============================
   EVENTS CALENDAR SECTION - Fixed Layout
   =============================== */
.events-calendar-section {
    padding: 80px 20px;
    background-color: #fff;
    text-align: center;
    color: #4b2e12;
}

.events-calendar-section h2 {
    font-size: 1.6rem;
    letter-spacing: 1px;
    margin-bottom: 10px;
    font-family: 'Montserrat', sans-serif;
    text-align: center;
    width: 100%;
}

.section-divider {
    height: 2px;
    background: #bfa98a;
    border: none;
    width: 100px;
    margin: 0 auto;
}

.calendar-container {
    max-width: 900px;
    margin: 0 auto;
    background-color: #f9f5eb;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden; /* Changed from overflow-x: auto */
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    width: 100%;
}

.calendar-header h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.4rem;
    color: #4b2e12;
    text-align: center;
    margin: 0;
    flex-grow: 1;
}

.calendar-nav-btn {
    background: #4b2e12;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    flex-shrink: 0;
}

.calendar-nav-btn:hover {
    background: #5a3a1d;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 30px;
    width: 100%;
}

.calendar-weekday {
    font-weight: bold;
    padding: 10px;
    background-color: #e8d9c5;
    border-radius: 4px;
    font-family: 'Montserrat', sans-serif;
    text-align: center;
    font-size: 0.9rem;
}

.calendar-day {
    padding: 15px 5px;
    background-color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    text-align: center;
}

.calendar-day:hover {
    background-color: #f0e6d6;
}

.calendar-day.active {
    background-color: #4b2e12;
    color: white;
}

.calendar-day.has-event::after {
    content: "";
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background-color: #d9534f;
    border-radius: 50%;
}

.calendar-day.empty {
    background-color: transparent;
    cursor: default;
}

.calendar-day.empty:hover {
    background-color: transparent;
}

.calendar-day.today {
    border: 2px solid #d6b78a;
    border-radius: 50%;
    font-weight: bold;
}

/* Event Details */
.event-details {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: left;
    width: 100%;
}

.event-details-content h3 {
    font-family: 'Montserrat', sans-serif;
    color: #4b2e12;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.event-details-content p {
    margin-bottom: 8px;
    line-height: 1.5;
}

.event-date, .event-time, .event-location {
    display: flex;
    align-items: center;
    gap: 8px;
}

.event-date {
    font-weight: bold;
    color: #5a3a1d;
}

.event-time, .event-location {
    color: #704f28;
}

.event-description {
    margin: 15px 0;
    line-height: 1.6;
}

/* ===============================
   PAST EVENTS SECTION - Fixed Layout
   =============================== */
.past-events-section {
    padding: 80px 20px;
    background-color: #f3e5c6;
    color: #4b2e12;
}

.past-events-section h2 {
    font-size: 1.6rem;
    letter-spacing: 1px;
    margin-bottom: 10px;
    font-family: 'Montserrat', sans-serif;
    text-align: center;
}

.past-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.past-event-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.past-event-card:hover {
    transform: translateY(-5px);
}

.event-image {
    height: 200px;
    overflow: hidden;
    flex-shrink: 0;
}

.event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.past-event-card:hover .event-image img {
    transform: scale(1.05);
}

.event-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.event-info h3 {
    font-family: 'Montserrat', sans-serif;
    color: #4b2e12;
    margin-bottom: 10px;
    font-size: 1.2rem;
    line-height: 1.3;
}

.event-info .event-date {
    color: #704f28;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.event-info .event-description {
    color: #5a3a1d;
    line-height: 1.6;
    flex-grow: 1;
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* ===============================
   MOBILE RESPONSIVE FIXES
   =============================== */
@media (max-width: 768px) {
    /* Hero Section - Keep your original styles */
    .events-hero h1 {
        font-size: 2rem;
        letter-spacing: 2px;
        padding: 0 15px;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        padding: 0 20px;
    }
    
    /* Calendar Section - Mobile */
    .events-calendar-section,
    .past-events-section {
        padding: 50px 15px;
    }
    
    .calendar-container {
        padding: 20px;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .calendar-grid {
        grid-template-columns: repeat(7, minmax(40px, 1fr));
        gap: 5px;
        min-width: 300px;
    }
    
    .calendar-weekday {
        padding: 8px 2px;
        font-size: 0.8rem;
        min-height: 35px;
    }
    
    .calendar-day {
        padding: 10px 2px;
        min-height: 45px;
        font-size: 0.9rem;
    }
    
    .calendar-header {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .calendar-header h3 {
        font-size: 1.2rem;
        order: 1;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .calendar-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    #prev-month {
        order: 2;
    }
    
    #next-month {
        order: 3;
    }
    
    .calendar-day.has-event::after {
        width: 4px;
        height: 4px;
        bottom: 3px;
    }
    
    /* Event Details - Mobile */
    .event-details {
        padding: 15px;
        font-size: 0.9rem;
    }
    
    .event-details-content h3 {
        font-size: 1.1rem;
    }
    
    /* Past Events - Mobile */
    .past-events-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .event-image {
        height: 180px;
    }
    
    .event-info {
        padding: 15px;
    }
    
    .event-info h3 {
        font-size: 1.1rem;
    }
    
    .event-info .event-date,
    .event-info .event-description {
        font-size: 0.9rem;
    }
}

/* ===============================
   TABLET RESPONSIVE (768px and up)
   =============================== */
@media (min-width: 768px) {
    .calendar-container {
        overflow-x: visible;
    }
    
    .calendar-grid {
        gap: 8px;
    }
    
    .calendar-header {
        flex-wrap: nowrap;
    }
    
    .calendar-header h3 {
        order: 2;
        width: auto;
        margin-bottom: 0;
    }
    
    #prev-month {
        order: 1;
    }
    
    #next-month {
        order: 3;
    }
    
    .past-events-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===============================
   DESKTOP RESPONSIVE (1024px and up)
   =============================== */
@media (min-width: 1024px) {
    .calendar-container {
        max-width: 900px;
        padding: 30px;
    }
    
    .calendar-grid {
        gap: 10px;
    }
    
    .past-events-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

/* ===============================
   VERY SMALL PHONES (below 360px)
   =============================== */
@media (max-width: 360px) {
    .calendar-grid {
        min-width: 280px;
        gap: 3px;
    }
    
    .calendar-weekday {
        font-size: 0.75rem;
        padding: 6px 1px;
    }
    
    .calendar-day {
        font-size: 0.85rem;
        padding: 8px 1px;
        min-height: 40px;
    }
    
    .calendar-header h3 {
        font-size: 1.1rem;
    }
    
    .calendar-nav-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
}

/* ===============================
   FIX FOR CONTAINER ALIGNMENT
   =============================== */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.events-calendar-section .container,
.past-events-section .container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ===============================
   CLEARFIX FOR FLOATING ELEMENTS
   =============================== */
.events-calendar-section::after,
.past-events-section::after {
    content: "";
    display: table;
    clear: both;
}
