/* ==========================================================================
   BHUTAN CALENDAR SHOWCASE STYLES - MODERN LOOK
   Palette: Crisp White, Charcoal, Teal, Soft Mint
   ========================================================================== */

.calendar-page,
.calendar-page *,
.calendar-page *::before,
.calendar-page *::after {
    box-sizing: border-box;
}

.calendar-page {
    background: linear-gradient(180deg, #F8FAFC 0%, #F1F5F9 100%);
    color: #0F172A;
    padding: 10px 0 40px 0; 
    min-height: 80vh;
    width: 100%;
    overflow-x: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.calendar-showcase .container {
    max-width: 1380px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* 1. Header Section */
.btn-back,
.calendar-showcase .btn-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #ffffff;
    color: #0D9488;
    border: 1px solid #CCFBF1;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    margin-bottom: 20px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
}

.btn-back:focus-visible,
.calendar-showcase .btn-back:focus-visible {
    outline: 2px solid #0D9488;
    outline-offset: 2px;
}

@media (hover: hover) {
    .btn-back:hover,
    .calendar-showcase .btn-back:hover {
        color: #ffffff;
        background: #0D9488;
        border-color: #0D9488;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
    }
}

.calendar-showcase .section-header {
    width: 100%;
    padding-top: 0px;
    text-align: center;
    margin-bottom: 0.2px; 
}

.calendar-showcase .eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #0D9488;
    background: #CCFBF1;
    padding: 6px 16px;
    border-radius: 50px;
    font-weight: 800;
    margin-bottom: 0.3px; 
}

.calendar-showcase h1,
.calendar-showcase h2 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: clamp(2.2rem, 4.5vw, 3rem);
    color: #0F172A;
    margin: 0;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -1px;
}

/* 2. Counter Status & Divider */
.grid-status-bar {
    width: 100%;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    color: #64748B;
    margin-bottom: 0.2px; 
}

.wireframe-divider {
    border: none;
    border-top: 1px solid #E2E8F0;
    width: 100%;
    margin: 0 0 8px 0; 
}

/* 3. Two-Column Layout Grid */
.calendar-layout-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    width: 100%;
    align-items: start;
}

.calendar-left-col {
    width: 100%;
    min-width: 0;
}

.calendar-right-col {
    width: 100%;
}

/* 4. Event Cards Grid */
.calendar-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.calendar-page .event-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid #E2E8F0;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0 !important;
}

.event-card:focus-visible {
    outline: 2px solid #0D9488;
    outline-offset: 4px;
}

@media (hover: hover) {
    .event-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
        border-color: #0D9488;
    }
}

.event-card-media {
    width: 100%;
    height: 180px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    display: flex;
    align-items: flex-start;
    background-color: #CBD5E1;
    padding: 0 !important;
}

.event-date-badge {
    width: 100%;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.85) 0%, rgba(15, 23, 42, 0.4) 100%);
    color: #ffffff;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.event-date-badge .month {
    font-weight: 700;
    font-size: 0.95rem;
    color: #5EEAD4;
}

.event-date-badge .type {
    font-size: 0.72rem;
    letter-spacing: 1px;
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 10px;
    border-radius: 50px;
    font-weight: 700;
    backdrop-filter: blur(4px);
}

.event-card-body {
    padding: 20px !important;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-align: center;
    background: #ffffff;
}

.event-tag {
    font-size: 0.72rem !important;
    font-weight: 800;
    color: #0D9488;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px !important;
    display: block;
}

.event-card-body h3 {
    font-size: 1.1rem !important;
    margin: 0 0 8px 0 !important;
    color: #0F172A;
    line-height: 1.3 !important;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.event-location {
    font-size: 0.8rem !important;
    color: #64748B;
    margin-bottom: 10px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.calendar-page .event-card .event-desc {
    font-size: 0.82rem !important;
    color: #475569;
    line-height: 1.45 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ==========================================================================
   5. RIGHT COLUMN INTERACTIVE CALENDAR WIDGET
   ========================================================================== */
.calendar-widget-wrapper {
    width: 100%;
    background: transparent;
    border-radius: 0;
    padding: 0;
    border: none;
    box-shadow: none;
}

.calendar-widget-wrapper.sticky-widget {
    position: sticky;
    top: 100px;
}

.calendar-flex-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bhutan-calendar-embed {
    width: 100%;
    background: #ffffff;
    border: 1px solid #E2E8F0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.bhutan-calendar-embed .widget-header {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    color: #ffffff;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid #0D9488;
}

.bhutan-calendar-embed .widget-header h4 {
    color: #ffffff !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px;
    margin: 0;
}

#calPrevBtn,
#calNextBtn {
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: 10px !important;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease !important;
}

#calPrevBtn:hover,
#calNextBtn:hover {
    background: #0D9488 !important;
    border-color: #0D9488 !important;
    transform: scale(1.05);
}

.bhutan-calendar-embed > div:not(.widget-header) {
    padding: 20px;
    background: #F8FAFC;
}

.bhutan-calendar-embed div[style*="grid-template-columns"]:nth-child(1) div {
    color: #94A3B8 !important;
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    letter-spacing: 1px;
}

.cal-widget-day {
    transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease !important;
    border-radius: 8px !important;
}

.cal-widget-day:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
    z-index: 2;
}

.calendar-wireframe-instruction {
    width: 100%;
    font-size: 0.88rem;
    font-weight: 600;
    color: #64748B;
    line-height: 1.5;
    margin: 0;
    text-align: center;
}

.btn-clear-date {
    margin-top: 16px;
    width: 100%;
    padding: 12px 14px;
    font-size: 0.88rem;
    background: #0F172A;
    color: #ffffff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.btn-clear-date:hover {
    background: #0D9488;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(13, 148, 136, 0.3);
}

/* 6. Pagination & Empty Messages */
.no-data-msg {
    width: 100%;
    text-align: center;
    color: #64748B;
    font-size: 1rem;
    padding: 40px 0;
}

.load-more-wrapper {
    width: 100%;
    text-align: center;
    margin-top: 32px;
}

.btn-load-more {
    background: #0F172A;
    color: #ffffff;
    border: none;
    padding: 14px 32px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.1);
    transition: all 0.3s ease;
}

.btn-load-more:focus-visible {
    outline: 2px solid #0D9488;
    outline-offset: 3px;
}

@media (hover: hover) {
    .btn-load-more:hover {
        background: #0D9488;
        transform: translateY(-2px);
        box-shadow: 0 10px 15px -3px rgba(13, 148, 136, 0.3);
    }
}

/* ==========================================================================
   7. Modal Styles - CSS GRID LAYOUT (IMAGE LEFT, HEADER+BODY RIGHT)
   ========================================================================== */

.cal-modal {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9999999 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cal-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1;
}

/* ==========================================================================
   CSS GRID: 2 columns × 2 rows
   ┌──────────────┬──────────────┐
   │              │   Header     │  Row 1
   ├──────────────┼──────────────┤
   │    Image     │              │
   │ (spans 2     │    Body      │  Row 2
   │   rows)      │  (scrolls)   │
   └──────────────┴──────────────┘
   ========================================================================== */
.cal-modal-content {
    position: relative !important;
    background: #ffffff;
    width: 100%;
    max-width: 900px;
    height: 500px;              /* Fixed height */
    max-height: 85vh;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    z-index: 10 !important;
    display: grid;
    grid-template-columns: 50% 50%;      /* Image left, Text right */
    grid-template-rows: auto 1fr;         /* Header auto, Body fills rest */
    grid-template-areas: 
        "image header"
        "image body";
}

/* LEFT: Image spans both rows */
.cal-modal-media-wrapper {
    grid-area: image;                     /* Occupies left column, both rows */
    width: 100%;
    height: 100%;
    background-color: #0F172A;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cal-modal-media-wrapper img,
#calModalImage {
    width: 100%;
    height: 100%;
    object-fit: contain;                  /* No crop */
    object-position: center;
    display: block;
}

/* Hide the image wrapper if it's empty (falls back to body only) */
.cal-modal-media-wrapper[style*="display: none"] + .cal-modal-header,
.cal-modal-media-wrapper[style*="display: none"] ~ .cal-modal-body {
    grid-column: 1 / -1;                  /* Fallback: full-width text if no image */
}

/* TOP-RIGHT: Header (date + tag) */
.cal-modal-header {
    grid-area: header;                    /* Top-right cell */
    background: #ffffff;
    color: #0F172A;
    padding: 24px 28px 8px 28px;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
    border-bottom: none;
    height: auto;
    min-height: 0;
}

.cal-modal-date {
    background: #0D9488;
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
}

.cal-modal-tag {
    font-size: 0.85rem;
    color: #64748B;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* BOTTOM-RIGHT: Body (title, location, description, highlights) */
.cal-modal-body {
    grid-area: body;                      /* Bottom-right cell */
    padding: 8px 28px 28px 28px;
    overflow-y: auto;                     /* Only this cell scrolls */
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    text-align: left;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    min-height: 0;                        /* Required for grid scroll to work */
}

.cal-modal-body h3 {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    color: #0F172A;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-align: left;
    flex-shrink: 0;
}

.cal-modal-location {
    color: #64748B;
    font-size: 0.95rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    text-align: left;
}

.cal-modal-desc {
    color: #475569;
    line-height: 1.7;
    margin-bottom: 24px;
    text-align: left;
}

.cal-modal-desc p {
    margin-top: 0;
    margin-bottom: 12px;
    text-align: left;
}

.cal-modal-desc p:last-child {
    margin-bottom: 0;
}

.cal-modal-highlights h4 {
    font-size: 1rem;
    color: #0F172A;
    margin-bottom: 10px;
    font-weight: 700;
    text-align: left;
}

.cal-modal-highlights ul {
    padding-left: 18px;
    list-style-position: outside;
    margin: 0;
    text-align: left;
}

.cal-modal-highlights li {
    color: #475569;
    font-size: 0.9rem;
    margin-bottom: 8px;
    text-align: left;
}

/* Close button - top-right */
.cal-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 1.4rem;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 30;
    line-height: 1;
    transition: all 0.2s ease;
}

.cal-modal-close:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

@media (hover: hover) {
    .cal-modal-close:hover {
        background: #0D9488;
        transform: scale(1.08);
    }
}

/* 8. Responsive Mobile Rules */
@media (max-width: 1024px) {
    .calendar-layout-grid {
        grid-template-columns: 1fr;
    }

    .calendar-right-col {
        order: -1;
    }

    .calendar-widget-wrapper.sticky-widget {
        position: static;
    }
}

@media (max-width: 768px) {
    .calendar-page {
        padding-top: 10px; 
    }

    .calendar-showcase .container {
        padding: 0 16px;
    }

    /* Modal stacks vertically on mobile */
    .cal-modal-content {
        display: flex;
        flex-direction: column;
        max-width: 100%;
        height: auto;
        max-height: 90vh;
        overflow: hidden;
    }

    .cal-modal-media-wrapper {
        width: 100%;
        height: 35vh;
        flex-shrink: 0;
    }

    .cal-modal-header {
        width: 100%;
        padding: 16px 20px 0 20px;
        flex-shrink: 0;
    }

    .cal-modal-body {
        width: 100%;
        flex: 1;
        min-height: 0;
        max-height: calc(90vh - 35vh - 80px);
        padding: 12px 20px 20px 20px;
        overflow-y: auto;
    }

    .cal-modal-body h3 {
        font-size: 1.3rem;
    }
}