/* assets/css/calendar.css */

/* ==========================================================================
   UNIFIED CALENDAR & EVENTS COMPONENT STYLES -- app\components\calendar-embed.php
   ========================================================================== */

/* --- 1. CORE WRAPPERS & CONTAINERS --- */
.kgs-calendar-container-wrapper {
    font-family: system-ui, -apple-system, sans-serif;
    margin-bottom: 1.5rem;
	z-index: 99 !important; /* Lifts parent containers above background columns */
}
.kgs-calendar-container-wrapper .card {
    background-color: #ffffff;
    border-radius: 0.75rem;
    border: 1px solid #f3f4f6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.kgs-calendar-container-wrapper .sidebar-card-box {
    z-index: 99;
}
.kgs-calendar-container-wrapper .sidebar-tip-box {
    background-color: #f8f9fa;
    border-color: #e9ecef;
    line-height: 1.4;
}

/* --- 2. SWITCHER & TAB NAVIGATION --- */
.kgs-calendar-container-wrapper .cal-header-icon-box {
    background-color: color-mix(in srgb, var(--primary-color) 15%, transparent);
    color: var(--primary-color);
}
.kgs-calendar-container-wrapper .cal-title-header {
    font-size: 1.15rem !important;
}
.kgs-calendar-container-wrapper .kgs-cal-tab-btn {
    color: #6c757d;
    background: transparent;
    border: none;
    transition: all 0.2s ease-in-out;
}
.kgs-calendar-container-wrapper .kgs-cal-tab-btn:hover {
    color: #212529;
}
.kgs-calendar-container-wrapper .kgs-cal-tab-btn:active {
    color: #212529 !important;
    background-color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
    font-weight: 700 !important;
}

/* --- 3. FILTER SYSTEM --- */
.kgs-calendar-container-wrapper .kgs-cal-filter-btn {
    background-color: #FFFFFF !important;
    color: var(--primary) !important;
    border: 1px solid #FFFFFF !important;
    transition: all 0.2s ease-in-out;
	/*gap: 5px;*/
}
.kgs-calendar-container-wrapper .kgs-cal-filter-btn:hover {
    background-color: #FFFFFF !important;
    color: var(--primary) !important;
    border: 1px solid #FFFFFF !important;
}
.kgs-calendar-container-wrapper .kgs-cal-filter-btn:active {
    background-color: #FFFFFF !important;
    color: var(--primary) !important;
    border: 1px solid #FFFFFF !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.kgs-calendar-container-wrapper .kgs-cal-filter-btn input[type="checkbox"] {
    width: 14px;
    height: 14px;
}
.kgs-calendar-container-wrapper .sidebar-header {
}

/* --- 4. AGENDA EVENT ROWS & BADGES --- */
.kgs-calendar-container-wrapper .agenda-title {
    font-size: 15px;
}
.kgs-calendar-container-wrapper .agenda-title i {
    color: var(--primary-color);
}
.kgs-calendar-container-wrapper .kgs-cal-event-row {
    transition: background-color 0.15s ease-in-out;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 4px;
}
.kgs-calendar-container-wrapper .kgs-cal-date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    text-align: center;
    flex-shrink: 0;
    min-width: 60px;
    padding: 6px;
    gap: 2px;
}
.kgs-calendar-container-wrapper .date-badge-month {
    line-height: 1;
}
.kgs-calendar-container-wrapper .date-badge-day {
	font-size: 2rem;
    font-weight: 900;
    line-height: 1;
}
.kgs-calendar-container-wrapper .event-badge {
    font-size: 12px;
    font-weight: 800;
    padding: 3px 8px;
	width: 150px;
}
.kgs-calendar-container-wrapper .event-meta-row {
    font-size: 1.1rem !important;
}

/* Standardized, absolute-height location container forces identical desktop heights */
.kgs-calendar-container-wrapper .kgs-event-location-box {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    width: 100%;
}
.kgs-calendar-container-wrapper .kgs-event-location-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    hheight: 2.6em; /* Locks vertical scale perfectly */
    line-height: 1.3;
    word-break: break-word;
}

.kgs-calendar-container-wrapper .load-more-btn {
    border-color: var(--primary-color)
    color: var(--primary-color);
}

/* --- 5. GOOGLE CALENDAR EMBED VIEW --- */
.kgs-calendar-container-wrapper .embed-header-text,
.kgs-calendar-container-wrapper .embed-timezone-badge {
}
.kgs-calendar-container-wrapper .google-cal-iframe-box iframe {
    border: 0;
}
.kgs-calendar-container-wrapper .ratio-4x3 iframe {
    border-radius: 8px;
}
.kgs-calendar-container-wrapper .add-to-gcal-btn {
}

/* --- 6. STATIC PDF CALENDARS --- */
.kgs-calendar-container-wrapper .kgs-pdf-select-btn {
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    background: #ffffff;
}
.kgs-calendar-container-wrapper .kgs-pdf-select-btn:hover {
    border-color: #ced4da;
    background-color: #f8f9fa;
}
.kgs-calendar-container-wrapper .kgs-pdf-select-btn.active {
    border-color: var(--primary-color) !important;
    background-color: color-mix(in srgb, var(--primary-color) 5%, transparent) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 15%, transparent) !important;
}
.kgs-calendar-container-wrapper .kgs-pdf-eye-icon {
}
.kgs-calendar-container-wrapper .pdf-card-desc {
    line-height: 1.4;
}
.kgs-calendar-container-wrapper .pdf-card-download-btn {
}
.kgs-calendar-container-wrapper .pdf-card-empty {
    font-style: italic;
}
.kgs-calendar-container-wrapper .pdf-viewer-header-title,
.kgs-calendar-container-wrapper .pdf-viewer-header-badge {
}
.kgs-calendar-container-wrapper .pdf-image-embed {
    max-height: 100%;
    object-fit: scale-down;
}
.kgs-calendar-container-wrapper .pdf-iframe-embed {
    border: none;
}

/* --- 7. EVENT CAROUSEL (VIEW B) --- */
.kgs-calendar-container-wrapper .carousel-container-parent {
    z-index: 100;
}
.kgs-cal-carousel-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: transparent;
    margin: 2rem auto;
    width: 100%;
    padding: 15px 5px;
    border-radius: 0.75rem;
    box-sizing: border-box;
}
.kgs-cal-carousel-wrapper .carousel-main-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
.kgs-cal-carousel-wrapper .carousel-arrow {
    font-size: 40px;
    color: var(--accent);
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s ease;
}
.kgs-cal-carousel-wrapper .carousel-arrow:hover {
    opacity: 0.7;
}
.kgs-cal-carousel-wrapper .carousel-arrow.hidden {
    opacity: 0;
    pointer-events: none;
}
.kgs-cal-carousel-wrapper .carousel-container {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 10px;
    width: 90vw;
    max-width: 1800px;
    margin: 0 auto;
}
.kgs-cal-carousel-wrapper .carousel-container::-webkit-scrollbar {
    display: none;
}
.kgs-cal-carousel-wrapper .event-card {
    flex: 0 0 auto;
    width: 200px;
    height: 300px;
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.2s ease;
    position: relative;
    box-sizing: border-box;
}
.kgs-cal-carousel-wrapper .event-card:hover {
    transform: scale(1.06);
    box-shadow: 0 12px 30px rgba(0,0,0,0.35);
    border-color: #87d3f8;
    z-index: 10;
}
.kgs-cal-carousel-wrapper .event-card-date-section,
.kgs-cal-carousel-wrapper .event-card-title-section,
.kgs-cal-carousel-wrapper .event-card-placetime-section,
.kgs-cal-carousel-wrapper .event-card-link-section {
    padding: 6px;
    text-align: center;
    box-sizing: border-box;
}
.kgs-cal-carousel-wrapper .event-card-date-section {
    background: #f0f0f0;
    height: auto; /* 100px */
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}
.kgs-cal-carousel-wrapper .event-card-title-section {
    height: 120px;
    /*display: flex;*/
    /*flex-direction: column;*/
    /*align-items: center;*/
    justify-content: center;
}
.kgs-cal-carousel-wrapper .event-card-placetime-section {
    height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.kgs-cal-carousel-wrapper .event-card-link-section {
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.kgs-cal-carousel-wrapper .date-box {
    width: 80px;
    margin: 0 auto;
}
.kgs-cal-carousel-wrapper .date-dayofweek {
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary);
    font-weight: 700;
    line-height: 1;
    margin-bottom: 2px;
}
.kgs-cal-carousel-wrapper .date-month {
    font-size: 16px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #000;
    font-weight: 700;
    line-height: 1.1;
}
.kgs-cal-carousel-wrapper .date-day {
    font-size: 34px;
    font-weight: 800;
    color: #333;
    line-height: 1;
}
.kgs-cal-carousel-wrapper .category-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 6px;
    text-transform: uppercase;
}
.kgs-cal-carousel-wrapper .event-title {
    font-size: 15px;
    font-weight: 700;
    color: #222;
    line-height: 1.2;
    padding: 2px 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    max-height: 75px;
}
.kgs-cal-carousel-wrapper .info-row {
    color: #555;
    line-height: 1.2;
    margin: 2px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: wrap;
}
.kgs-cal-carousel-wrapper .event-card-link {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}
.kgs-cal-carousel-wrapper .event-card-link:hover {
    text-decoration: underline;
}
.kgs-cal-carousel-wrapper .carousel-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 10px;
}
.kgs-cal-carousel-wrapper .carousel-full-calendar-btn {
    background: #FFFFFF !important;
    color: var(--primary) !important;
    border: 1px solid #FFFFFF !important;

    height: 38px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.kgs-cal-carousel-wrapper .carousel-full-calendar-btn:hover {
    transform: scale(1.03);
    background-color: var(--accent) !important;
    color: var(--secondary) !important;
    border-color: var(--accent) !important;
}
.kgs-cal-carousel-wrapper .carousel-full-calendar-btn:active {
    background-color: var(--primary) !important;
    color: #FFFFFF !important;
    border-color: #FFFFFF !important;
}
.kgs-cal-carousel-wrapper .widget-filter-toggle-btn {
    border-radius: 30px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.kgs-cal-carousel-wrapper .widget-filter-toggle-btn .text-uppercase {
}
.kgs-cal-carousel-wrapper .widget-filter-toggle-btn .text-uppercase i {
    color: var(--primary-color);
}
.kgs-cal-carousel-wrapper .widget-filter-toggle-btn #kgs-widget-filter-badge {
    font-size: 12px;
    padding: 3px 8px;
}
.kgs-cal-carousel-wrapper .widget-filter-toggle-btn #kgs-widget-filter-chevron {
}
.kgs-cal-carousel-wrapper #kgs-widget-filters-collapse {
    z-index: 1100 !important;
    bottom: calc(100% + 8px);
    width: 260px;
}
.kgs-cal-carousel-wrapper #kgs-widget-filters-collapse .kgs-cal-filter-btn {
    font-size: 12px;
}
.kgs-cal-carousel-wrapper #kgs-widget-filters-collapse .kgs-cal-filter-btn .text-dark {
    font-size: 12px;
}
.kgs-cal-carousel-wrapper #kgs-widget-filters-collapse .form-check-input {
    width: 14px;
    height: 14px;
}

																										/* Header style modifications inside primary-colored wrappers */
																										.container:has(#calendar-carousel-module) { 
																										  /* background-color: var(--primary); */
																										}
																										#calendar-carousel-module .rich-text-title {
																										  /* color: #FFFFFF; */
																										}

/* Force icons inside primary-colored headers to render white */
#calendar-carousel-module .rich-text-title i.text-primary,
#calendar-widget-module .rich-text-title i.text-primary {
  color: #FFFFFF !important;
}

/* Standardized widget button structure inside the primary blue container */
#calendar-carousel-module .btn {
  background-color: #FFFFFF !important;
  color: var(--primary) !important;
  border: 1px solid #FFFFFF !important;
  transition: all 0.2s ease-in-out;
}
#calendar-carousel-module .btn:hover {
  background-color: var(--accent) !important; /* high visibility light blue */
  color: var(--secondary) !important; /* readable high contrast dark blue */
  border-color: var(--accent) !important;
}
#calendar-carousel-module .btn:active {
  background-color: var(--primary) !important;
  color: #FFFFFF !important;
  border-color: #FFFFFF !important;
}

#calendar-carousel-module .btn {
  background-color: #FFFFFF !important;
  color: var(--primary) !important;
  border: 1px solid #FFFFFF !important;
  transition: all 0.2s ease-in-out;
}
#calendar-carousel-module .btn:hover {
  background-color: #FFFFFF !important;
  color: var(--secondary) !important;
  border: 1px solid #FFFFFF !important;
} 
#calendar-carousel-module .kgs-cal-filter-btn:active {
  background-color: #FFFFFF !important;
  color: var(--primary) !important;
  border: 1px solid #FFFFFF !important;
}













																										/* --- 8. WIDGET PRESENTATION SLOTS (VIEW C) --- */
																										.container:has(#calendar-carousel-modulee) { 
																											/*background-color: var(--primary); */
																										}
#calendar-widget-module .rich-text-title {
    color: #FFFFFF;
}
#calendar-widget-module .btn {
    background-color: #FFFFFF;
}
#calendar-widget-module .btn:hover {
    background-color: var(--bs-btn-color);
}
.kgs-calendar-container-wrapper#calendar-widget-module .kgs-cal-filter-btn {
    font-size: 12px;
}
.kgs-calendar-container-wrapper#calendar-widget-module .kgs-cal-filter-btn .text-dark {
    font-size: 12px;
}
.kgs-calendar-container-wrapper#calendar-widget-module .form-check-input {
    width: 14px;
    height: 14px;
}
.kgs-calendar-container-wrapper#calendar-widget-module .date-badge-month {
    line-height: 1;
}
.kgs-calendar-container-wrapper#calendar-widget-module .date-badge-day {
    font-weight: 900;
    line-height: 1;
}
.kgs-calendar-container-wrapper#calendar-widget-module .event-badge {
    font-size: 12px;
    font-weight: 800;
    padding: 3px 8px;
}
.kgs-calendar-container-wrapper#calendar-widget-module .event-card-link-btn {
}
.kgs-calendar-container-wrapper#calendar-widget-module h6 {
}
.kgs-calendar-container-wrapper#calendar-widget-module .event-meta-row {
    font-size: 1.1rem;
}
.kgs-calendar-container-wrapper#calendar-widget-module #kgs-cal-no-events {
}

/* --- 9. SHARED MODAL STYLING --- */
#kgs-cal-details-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 1020;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
#kgs-cal-details-modal .modal-card {
    width: 90%;
    max-width: 500px;
    border-radius: 16px;
    background: #ffffff;
}
#kgs-cal-details-modal #kgs-modal-title {
    font-size: 15px;
}
#kgs-cal-details-modal #kgs-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 0.5;
}
#kgs-cal-details-modal #kgs-modal-category {
    font-size: 12px;
    padding: 3px 8px;
}
#kgs-cal-details-modal #kgs-modal-body {
    max-height: 200px;
    overflow-y: auto;
    line-height: 1.5;
    word-wrap: break-word;

}

/* ==========================================================================
   CALENDAR -- CONSOLIDATED RESPONSIVE BREAKPOINT QUERY SYSTEM
   ========================================================================== */

/* --- Tablet Breakpoints --- */
@media (max-width: 991.98px) {
    .kgs-filter-collapsible-body {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        margin-top: 8px;
        background: #ffffff;
        border: 1px solid #e9ecef;
        border-radius: 12px;
        padding: 16px;
        box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
        z-index: 1010;
    }
    .kgs-filter-collapsible-body.show {
        display: block !important;
    }
}
@media (min-width: 992px) {
    .kgs-filter-collapsible-body {
        display: block !important;
    }
}

/* --- Mobile Breakpoints (768px and below) --- */
@media (max-width: 768px) {
    .kgs-cal-carousel-wrapper .carousel-controls-row {
        flex-direction: column;
        gap: 15px;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
    .kgs-cal-carousel-wrapper .carousel-full-calendar-btn {
        width: auto;
        max-width: 100%;
    }
    /* Centers the absolute upward-pop dropdown menu on narrow mobile viewports */
    .kgs-cal-carousel-wrapper #kgs-widget-filters-collapse {
		z-index: 1100 !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        bottom: calc(100% + 8px) !important;

    }
    /* Mobile Calendar Typography Adaptations [5] */
    .kgs-cal-event-row .kgs-cal-event-title {
        font-size: 1.2rem !important;
		padding-top: 2px;
		padding-bottom: 2px;
    }
    .kgs-cal-event-row .fs-5 {
        font-size: 14px !important;
    }
    .kgs-cal-event-row .kgs-cal-date-badge {
        width: 80px !important;
        height: 80px !important;
        min-width: 80px !important;
    }
    .kgs-cal-event-row .kgs-cal-date-badge .mt-1 {
        margin-top: 0.125rem !important;
    }

    /* FIX: Explicitly enforce layered positioning on absolute mobile-view collapses to prevent clipping */
    .id-mobile-filters-collapse,
    .kgs-calendar-container-wrapper .id-mobile-filters-collapse {
        z-index: 1010 !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05) !important;
    }

    /* FIX: Force widget collapses (View C) to override upward carousel rules on narrow viewports */
    .kgs-calendar-container-wrapper#calendar-widget-module #kgs-widget-filters-collapse {
        z-index: 1100 !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        bottom: auto !important; /* Overrides absolute bottom upward-pop variables */
        width: auto !important;
        box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05) !important;
    }
}

/* --- Compact Mobile Breakpoints (576px and below) --- */
@media (max-width: 576px) {
    .kgs-cal-carousel-wrapper .carousel-arrow {
        font-size: 28px;
    }
    .kgs-cal-carousel-wrapper .carousel-container {
        padding: 5px;
        gap: 8px;
    }
    .kgs-cal-carousel-wrapper .event-card {
        width: 145px;
        height: 235px;
        border-radius: 12px;
    }
    .kgs-cal-carousel-wrapper .event-card-date-section {
        height: 100px; /* Increased from 90px to accommodate three rows of text */
        padding: 4px;
        border-top-left-radius: 11px;
        border-top-right-radius: 11px;
    }
    .kgs-cal-carousel-wrapper .date-box {
        width: 60px;
    }
    .kgs-cal-carousel-wrapper .date-month {
    
    }
    .kgs-cal-carousel-wrapper .date-day {
        font-size: 34px;
    }
    .kgs-cal-carousel-wrapper .event-card-title-section {
        height: 95px;
        padding: 4px;
    }
    .kgs-cal-carousel-wrapper .category-pill {
        font-size: 9px;
        padding: 1px 6px;
        margin-bottom: 4px;
    }
    .kgs-cal-carousel-wrapper .event-title {
        font-size: /*14px*/;
        max-height: 40px;
        -webkit-line-clamp: 3;
    }
    .kgs-cal-carousel-wrapper .event-card-placetime-section {
        height: 60px;
        padding: 4px;
    }
    .kgs-cal-carousel-wrapper .info-row {
        font-size: 9px;
        margin: 1px 0;
    }
    .kgs-cal-carousel-wrapper .event-card-link-section {
        height: 20px;
        padding: 2px;
    }
    .kgs-cal-carousel-wrapper .event-card-link {
        font-size: 9.5px;
    }
}

/* --- SCOPED ONLY TO FULL PAGE WIDE ROWS FOR HORIZONTAL ALIGNMENT ON DESKTOP --- */
@media (min-width: 992px) {
	.kgs-cal-event-row-horizontal .kgs-cal-date-badge {
		flex-direction: row !important;
		min-width: 155px !important; /* Safe, wrap-free text boundary on desktop */
		padding: 8px 12px !important; /* Safe, elegant vertical spacing centering */
		gap: 6px !important;
	}
	.kgs-cal-event-row-horizontal .kgs-cal-date-badge .date-badge-dayofweek { order: 1 !important; font-size: 1.25rem !important; min-width: 42px; font-weight: 700; text-transform: uppercase; line-height: 1; }
	.kgs-cal-event-row-horizontal .kgs-cal-date-badge .date-badge-month { order: 2 !important; font-size: 1.25rem !important; font-weight: 700; text-transform: uppercase; line-height: 1;}
	.kgs-cal-event-row-horizontal .kgs-cal-date-badge .date-badge-day { order: 3 !important; font-size: 1.25rem !important; font-weight: 900; line-height: 1; }
    
    /* Lock desktop event location box layout on wide screens */
    .kgs-calendar-container-wrapper .kgs-event-location-box {
        width: 180px;
        max-width: 180px;
    }
}


/* Scoped concise layouts support single-row alignments [Section 5] */
.kgs-cal-concise-row {
    transition: background-color 0.15s ease-in-out;
}
.kgs-cal-concise-row:hover {
    background-color: rgba(0,0,0,0.02) !important;
}
