/* Fix Astra Theme Sidebar & Container Constraints */
.site-content .ast-container { max-width: 100% !important; padding: 0 !important; display: block !important; }
#primary, .ast-primary-content-area { width: 100% !important; max-width: 100% !important; float: none !important; margin: 0 !important; }

/* Variables */
:root {
    --cn-red: #c1121f;
    --cn-red-light: #fbecec;
    --cn-text-main: #222;
    --cn-text-muted: #666;
    --cn-border: #eaeaea;
    --cn-bg-light: #f9f9f9;
}

.cn-events-page {
    width: 100%;
    overflow-x: hidden;
    font-family: inherit;
    background: #fdfdfd;
}

.cn-container {
    max-width: 1250px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Typography & General */
h1, h2, h3, h4, h5, h6 { margin: 0; color: var(--cn-text-main); font-family: inherit; }
a { text-decoration: none; color: inherit; }

/* Hero Section */
.cn-events-hero {
    background: url('../images/hero-banner.png') center/cover no-repeat;
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    border-bottom: 1px solid var(--cn-border);
}
.cn-events-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.75);
}
.cn-hero-content {
    position: relative;
    z-index: 1;
    max-width: 750px;
    padding: 0 20px;
}
.cn-hero-content h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 20px;
    color: #111;
}
.cn-hero-content p {
    font-size: 16px;
    color: #444;
    line-height: 1.8;
    margin: 0;
}

/* Sections */
.cn-events-section {
    margin: 60px 0;
}

.cn-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
    position: relative;
}

.cn-section-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    height: 2px;
    width: 150px;
    background: var(--cn-red);
}

.cn-section-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}
.cn-section-title-wrap i {
    font-size: 26px;
    color: var(--cn-red);
}
.cn-section-title-wrap h2 {
    font-size: 22px;
    font-weight: 800;
}

.cn-view-all {
    color: var(--cn-red);
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: 0.2s;
}
.cn-view-all:hover { opacity: 0.8; }

/* Cards Grid */
.cn-events-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.cn-event-card {
    background: #fff;
    border: 1px solid var(--cn-border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}
.cn-event-card:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
    transform: translateY(-3px);
}

.cn-event-card-img {
    height: 190px;
    position: relative;
    overflow: hidden;
}
.cn-event-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.cn-event-card:hover .cn-event-card-img img {
    transform: scale(1.05);
}
.cn-event-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    color: #fff;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.badge-red { background: #c1121f; }
.badge-orange { background: #e85d04; }
.badge-brown { background: #7f4f24; }
.badge-dark { background: #343a40; }

.cn-event-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.cn-event-card-body h3 {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
    font-weight: 800;
}
.cn-event-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--cn-text-muted);
    margin-bottom: 15px;
}
.cn-event-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}
.cn-event-location {
    font-size: 12px;
    color: var(--cn-text-main);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: auto;
    font-weight: 500;
}

.cn-btn-event {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--cn-red-light);
    color: var(--cn-red);
    padding: 14px;
    font-size: 14px;
    font-weight: 700;
    border-top: 1px solid var(--cn-border);
    transition: 0.3s;
}
.cn-btn-event:hover {
    background: var(--cn-red);
    color: #fff;
}

/* Past Events Dual Buttons */
.cn-event-card-actions {
    display: flex;
    gap: 10px;
    padding: 15px;
    border-top: 1px solid var(--cn-border);
    background: var(--cn-bg-light);
}
.cn-btn-outline {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--cn-red);
    color: var(--cn-red);
    border-radius: 6px;
    padding: 10px 5px;
    font-size: 12px;
    font-weight: 700;
    transition: 0.3s;
    background: #fff;
}
.cn-btn-outline:hover {
    background: var(--cn-red);
    color: #fff;
}


/* Middle Section: Calendar & Important */
.cn-middle-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 35px;
    margin: 80px 0;
}

.cn-widget-box {
    background: #fff;
    border: 1px solid var(--cn-border);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.02);
}

.cn-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--cn-border);
    padding-bottom: 20px;
}

.cn-widget-title {
    display: flex;
    align-items: center;
    gap: 12px;
}
.cn-widget-title i {
    font-size: 24px;
    color: var(--cn-red);
}
.cn-widget-title h3 {
    font-size: 18px;
    font-weight: 800;
}

/* Calendar */
.cn-calendar-nav {
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 700;
    font-size: 16px;
}
.cn-calendar-nav i {
    cursor: pointer;
    background: var(--cn-bg-light);
    width: 32px; height: 32px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    transition: 0.2s;
}
.cn-calendar-nav i:hover { background: #eee; }

.cn-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 20px;
    color: var(--cn-text-muted);
}
.text-red { color: var(--cn-red); }

.cn-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    gap: 12px;
}
.cn-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
    color: var(--cn-text-main);
}
.cn-day:hover:not(.disabled) {
    background: var(--cn-red-light);
    color: var(--cn-red);
}
.cn-day.disabled {
    color: #ccc;
    cursor: default;
}

.cn-day-selected {
    background: transparent !important;
    border: 2px solid var(--cn-red);
    color: var(--cn-red);
}

.cn-day-event::after {
    content: '';
    position: absolute;
    bottom: 6px;
    width: 6px; height: 6px;
    border-radius: 50%;
}
.cn-day-red::after { background: var(--cn-red); }
.cn-day-blue::after { background: #3b82f6; }
.cn-day-yellow::after { background: #eab308; }

.cn-calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 35px;
    font-size: 12px;
    color: var(--cn-text-muted);
    justify-content: center;
    padding-top: 25px;
    border-top: 1px dashed var(--cn-border);
}
.cn-calendar-legend span {
    display: flex;
    align-items: center;
    gap: 6px;
}
.cn-legend-dot {
    width: 10px; height: 10px; border-radius: 50%; display: inline-block;
}
.cn-legend-dot.red { background: var(--cn-red); }
.cn-legend-dot.blue { background: #3b82f6; }
.cn-legend-dot.yellow { background: #eab308; }


/* Cats Pills */
.cn-cats-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.cn-cats-pills a {
    padding: 10px 18px;
    border: 1px solid var(--cn-border);
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    color: var(--cn-text-muted);
    transition: all 0.3s ease;
}
.cn-cats-pills a:hover, .cn-cats-pills a.active {
    background: var(--cn-red);
    color: #fff;
    border-color: var(--cn-red);
}

/* Important Events */
.cn-view-all-small {
    font-size: 13px;
    color: var(--cn-red);
    font-weight: 700;
}
.cn-important-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.cn-important-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    border: 1px solid var(--cn-border);
    border-radius: 10px;
    background: var(--cn-bg-light);
    transition: all 0.3s ease;
}
.cn-important-item:hover {
    background: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border-color: #ddd;
}
.cn-important-item img {
    width: 85px; height: 65px;
    object-fit: cover;
    border-radius: 6px;
}
.cn-important-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cn-important-info strong {
    font-size: 14px;
    color: var(--cn-text-main);
    line-height: 1.4;
}
.cn-important-date, .cn-important-loc {
    font-size: 12px;
    color: var(--cn-text-muted);
}
.cn-important-footer {
    text-align: center;
    margin-top: 25px;
}
.cn-important-footer a {
    font-size: 14px;
    font-weight: 700;
    color: var(--cn-text-main);
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 1200px) {
    .cn-events-grid { grid-template-columns: repeat(3, 1fr); }
    .cn-event-card:nth-child(4) { display: none; } /* Hide 4th card to maintain grid balance on tablet landscape */
}
@media (max-width: 992px) {
    .cn-events-grid { grid-template-columns: repeat(2, 1fr); }
    .cn-event-card:nth-child(4) { display: flex; } /* Show it back */
    .cn-middle-section { grid-template-columns: 1fr; }
}
@media (max-width: 576px) {
    .cn-events-grid { grid-template-columns: 1fr; }
    .cn-cal-days { gap: 6px; }
    .cn-day { font-size: 14px; }
    .cn-hero-content h1 { font-size: 26px; }
    .cn-widget-box { padding: 20px; }
}
