/* ============================================
   CALENDAR SECTION STYLES — KENESFOOD
   Aligned with branches/blogs design system
   ============================================ */

.kf-calendar-section {
    background: linear-gradient(
        180deg,
        var(--white, #ffffff) 0%,
        rgba(255, 99, 71, 0.02) 100%
    );
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

@media (max-width: 991.98px) {
    .kf-calendar-section {
        padding: 60px 0;
    }
}

@media (max-width: 767.98px) {
    .kf-calendar-section {
        padding: 48px 0;
    }
}

/* ===== Section Header (matches branches/blogs pattern) ===== */
.kf-calendar-section .section-header {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    padding: 0 20px;
}

.kf-calendar-section .section-header .section-title {
    font-size: 36px;
    font-family: var(--font-heading, 'Barlow', sans-serif);
    font-weight: var(--font-bold, 700);
    color: var(--primary, #ff6347);
    margin: 0 auto 16px;
    letter-spacing: -0.5px;
    line-height: 1.3;
    position: relative;
    display: block;
    width: 100%;
    text-align: center;
    text-transform: uppercase;
}

.kf-calendar-section .section-header .section-title::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary, #ff6347), #ff8c69);
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(255, 99, 71, 0.3);
}

.kf-calendar-section .section-header .section-subtitle {
    font-size: 16px;
    color: var(--text-light, #666);
    max-width: 650px;
    margin: 32px auto 0;
    line-height: 1.6;
    font-weight: var(--font-regular, 400);
    font-family: var(--font-primary, 'Inter', sans-serif);
    opacity: 0.85;
}

@media (max-width: 991.98px) {
    .kf-calendar-section .section-header .section-title {
        font-size: 30px;
    }
}

@media (max-width: 767.98px) {
    .kf-calendar-section .section-header .section-title {
        font-size: 26px;
    }
    .kf-calendar-section .section-header .section-subtitle {
        font-size: 14px;
    }
    .kf-calendar-section .section-header {
        margin-bottom: 36px;
    }
}

/* ===== Grid Layout ===== */
.kf-cal-grid {
    display: grid;
    grid-template-columns: 7fr 5fr;
    gap: 32px;
}

@media (max-width: 991.98px) {
    .kf-cal-grid {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }
}

@media (max-width: 767.98px) {
    .kf-cal-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
}

/* ===== Calendar Widget Card ===== */
.kf-cal-widget-container {
    background: #ffffff;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.kf-cal-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #EFE8E1;
}

.kf-cal-month-year {
    font-size: 1.125rem;
    font-weight: 700;
    font-family: var(--font-heading, 'Barlow', sans-serif);
    color: #1A1A1A;
    margin: 0;
    letter-spacing: -0.3px;
}

.kf-cal-nav {
    display: flex;
    gap: 6px;
    align-items: center;
}

.kf-cal-btn {
    background: transparent;
    border: 1px solid #EFE8E1;
    color: #1A1A1A;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-primary, 'Inter', sans-serif);
}

.kf-cal-btn:hover {
    color: var(--primary, #ff6347);
    border-color: var(--primary, #ff6347);
    background-color: rgba(255, 99, 71, 0.04);
}

.kf-cal-btn-icon {
    width: 34px;
    height: 34px;
    font-size: 0.8rem;
}

.kf-cal-btn-today {
    padding: 0 14px;
    height: 34px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* ===== Calendar Grid ===== */
.kf-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    color: #8D857D;
    font-size: 0.8rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--font-primary, 'Inter', sans-serif);
}

.kf-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.kf-cal-day-cell {
    aspect-ratio: 1;
    min-height: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 6px;
    cursor: pointer;
    border-radius: 10px;
    position: relative;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    font-family: var(--font-primary, 'Inter', sans-serif);
}

@media (max-width: 479.98px) {
    .kf-cal-day-cell {
        min-height: 32px;
        padding-top: 4px;
        font-size: 0.85rem;
        border-radius: 8px;
    }
}

.kf-cal-day-cell:hover:not(.kf-cal-day-empty) {
    background-color: #FCFAF7;
    border-color: #EFE8E1;
}

.kf-cal-day-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    z-index: 2;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1A1A1A;
}

.kf-cal-day-empty {
    cursor: default;
    opacity: 0;
}

.kf-cal-day-other-month {
    color: #8D857D;
    opacity: 0.4;
}

/* ===== Day States ===== */
.kf-cal-today .kf-cal-day-num {
    border: 2px solid var(--primary, #ff6347);
    color: var(--primary, #ff6347);
    font-weight: 700;
}

.kf-cal-selected {
    background-color: rgba(255, 99, 71, 0.06) !important;
    border-color: var(--primary, #ff6347) !important;
}

.kf-cal-selected .kf-cal-day-num {
    background-color: var(--primary, #ff6347);
    color: #ffffff;
    border-color: var(--primary, #ff6347);
    font-weight: 700;
}

/* ===== Event Dots ===== */
.kf-cal-dots {
    display: flex;
    gap: 2px;
    margin-top: 3px;
    height: 5px;
    justify-content: center;
}

.kf-cal-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    display: inline-block;
}

.kf-cal-dot-acara { background-color: var(--primary, #ff6347); }
.kf-cal-dot-promo { background-color: #1A1A1A; }
.kf-cal-dot-info { background-color: #8D857D; }

.kf-cal-dot-more {
    font-size: 9px;
    line-height: 5px;
    color: #8D857D;
    font-weight: 700;
}

/* ===== Legend ===== */
.kf-cal-legend {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 0.75rem;
    color: #8D857D;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #EFE8E1;
    font-family: var(--font-primary, 'Inter', sans-serif);
}

.kf-cal-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

/* ===== Preview Panel ===== */
.kf-cal-preview-container {
    display: flex;
    flex-direction: column;
}

.kf-cal-preview-header {
    margin-bottom: 16px;
}

.kf-cal-selected-date {
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-heading, 'Barlow', sans-serif);
    color: var(--primary, #ff6347);
    margin: 0;
    letter-spacing: -0.2px;
}

.kf-cal-preview-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}

/* ===== Upcoming Header ===== */
.kf-cal-upcoming-header {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #EFE8E1;
}

.kf-cal-upcoming-header h4 {
    font-family: var(--font-heading, 'Barlow', sans-serif);
    font-size: 0.95rem;
    font-weight: 700;
    color: #1A1A1A;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.kf-cal-upcoming-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===== Event Preview Card ===== */
.kf-cal-event-card {
    display: flex;
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    color: inherit;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.kf-cal-event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    color: inherit;
}

.kf-cal-event-thumb {
    width: 90px;
    flex-shrink: 0;
    position: relative;
}

.kf-cal-event-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.kf-cal-event-body {
    padding: 14px 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.kf-cal-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.kf-cal-badge {
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-family: var(--font-primary, 'Inter', sans-serif);
}

.kf-cal-badge-cat-acara { background: rgba(255, 99, 71, 0.08); color: var(--primary, #ff6347); }
.kf-cal-badge-cat-promo { background: #f5f3f0; color: #1A1A1A; }
.kf-cal-badge-cat-info { background: #f0f0f0; color: #8D857D; }

.kf-cal-event-time {
    font-size: 0.75rem;
    color: #8D857D;
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-primary, 'Inter', sans-serif);
}

.kf-cal-event-title {
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font-heading, 'Barlow', sans-serif);
    color: #1A1A1A;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kf-cal-event-loc {
    font-size: 0.75rem;
    color: #8D857D;
    display: flex;
    align-items: flex-start;
    gap: 4px;
    margin-top: auto;
    font-family: var(--font-primary, 'Inter', sans-serif);
}

/* ===== Status Badge Variants ===== */
.kf-cal-badge-status-ongoing { background: rgba(30, 142, 62, 0.08); color: #1e8e3e; }
.kf-cal-badge-status-upcoming { background: rgba(26, 115, 232, 0.08); color: #1a73e8; }
.kf-cal-badge-status-today { background: rgba(255, 99, 71, 0.08); color: var(--primary, #ff6347); }
.kf-cal-badge-status-finished { background: #f5f3f0; color: #5f6368; }
.kf-cal-badge-status-cancelled { background: rgba(217, 48, 37, 0.08); color: #d93025; }

/* ===== Loading / Empty / Error States ===== */
.kf-cal-loading {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kf-cal-skeleton-card {
    height: 90px;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    animation: kf-pulse 1.5s infinite;
}

.kf-cal-skeleton-thumb {
    width: 90px;
    background: #f5f3f0;
    border-radius: 14px 0 0 14px;
}

.kf-cal-skeleton-body {
    padding: 14px 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kf-cal-skeleton-line {
    height: 10px;
    background: #f5f3f0;
    border-radius: 4px;
}

.kf-cal-skeleton-line.short { width: 35%; }
.kf-cal-skeleton-line.long { width: 85%; }

@keyframes kf-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.kf-cal-empty, .kf-cal-error {
    text-align: center;
    padding: 32px 16px;
    background: #FCFAF7;
    border-radius: 14px;
    border: 1px dashed #EFE8E1;
}

.kf-cal-empty i {
    font-size: 1.75rem;
    color: #8D857D;
    opacity: 0.4;
    margin-bottom: 10px;
}

.kf-cal-empty p {
    color: #8D857D;
    margin: 0;
    font-size: 0.85rem;
    font-family: var(--font-primary, 'Inter', sans-serif);
}

.kf-cal-error i {
    color: var(--primary, #ff6347);
}

/* ===== Event Date Highlight ===== */
.kf-cal-day-cell.kf-cal-has-event {
    background: rgba(255, 99, 71, 0.07);
    border: 1px solid rgba(255, 99, 71, 0.15);
}

.kf-cal-day-cell.kf-cal-has-event .kf-cal-day-num {
    font-weight: 600;
}

/* Today + Event: coral ring maintained, add soft fill */
.kf-cal-day-cell.kf-cal-today.kf-cal-has-event {
    background: rgba(255, 99, 71, 0.12);
    border-color: var(--primary, #ff6347);
}

/* Selected + Event: solid coral, add subtle outer ring */
.kf-cal-day-cell.kf-cal-selected.kf-cal-has-event {
    box-shadow: 0 0 0 3px rgba(255, 99, 71, 0.2);
}

/* Outside month cells with events: muted highlight */
.kf-cal-day-cell.kf-cal-outside.kf-cal-has-event {
    background: rgba(255, 99, 71, 0.03);
    border-color: rgba(255, 99, 71, 0.08);
}

/* ===== CTA Footer ===== */
.kf-cal-footer {
    text-align: center;
    margin-top: 44px;
}

/* ============================================
   RESPONSIVE — TABLET (max 991.98px)
   ============================================ */
@media (max-width: 991.98px) {
    .kf-cal-widget-container {
        padding: 24px;
    }

    .kf-cal-footer {
        margin-top: 36px;
    }
}

/* ============================================
   RESPONSIVE — SMALL TABLET (max 767.98px)
   ============================================ */
@media (max-width: 767.98px) {
    .kf-cal-widget-container {
        padding: 20px;
    }

    .kf-cal-widget-header {
        margin-bottom: 14px;
        padding-bottom: 12px;
    }

    .kf-cal-month-year {
        font-size: 1rem;
    }

    .kf-cal-btn-icon {
        width: 30px;
        height: 30px;
        font-size: 0.7rem;
    }

    .kf-cal-btn-today {
        height: 30px;
        font-size: 0.75rem;
        padding: 0 10px;
    }

    .kf-cal-weekdays {
        font-size: 0.7rem;
        margin-bottom: 6px;
    }

    .kf-cal-days {
        gap: 2px;
    }

    .kf-cal-day-num {
        width: 26px;
        height: 26px;
        font-size: 0.8rem;
    }

    .kf-cal-legend {
        margin-top: 14px;
        padding-top: 12px;
        gap: 14px;
        font-size: 0.7rem;
    }

    .kf-cal-footer {
        margin-top: 28px;
    }

    .kf-cal-preview-header {
        margin-bottom: 12px;
    }

    .kf-cal-selected-date {
        font-size: 0.9rem;
    }

    .kf-cal-preview-content {
        gap: 10px;
    }

    .kf-cal-event-body {
        padding: 10px 12px;
        gap: 4px;
    }

    .kf-cal-event-thumb {
        width: 75px;
    }

    .kf-cal-event-title {
        font-size: 0.85rem;
    }

    .kf-cal-event-time,
    .kf-cal-event-loc {
        font-size: 0.7rem;
    }

    .kf-cal-badge {
        font-size: 0.575rem;
        padding: 1px 6px;
    }

    .kf-cal-skeleton-card {
        height: 75px;
    }

    .kf-cal-skeleton-thumb {
        width: 75px;
    }
}

/* ============================================
   RESPONSIVE — MOBILE (max 575.98px)
   ============================================ */
@media (max-width: 575.98px) {
    .kf-calendar-section {
        padding: 36px 0;
    }

    .kf-calendar-section .section-header {
        margin-bottom: 28px;
        padding: 0 12px;
    }

    .kf-calendar-section .section-header .section-title {
        font-size: 24px;
        margin-bottom: 12px;
    }

    .kf-calendar-section .section-header .section-title::after {
        width: 40px;
        height: 3px;
        bottom: -10px;
    }

    .kf-calendar-section .section-header .section-subtitle {
        font-size: 13px;
        margin-top: 22px;
    }

    .kf-cal-grid {
        gap: 20px;
    }

    .kf-cal-widget-container {
        padding: 16px;
        border-radius: 16px;
    }

    .kf-cal-widget-header {
        margin-bottom: 10px;
        padding-bottom: 10px;
    }

    .kf-cal-month-year {
        font-size: 0.9rem;
    }

    .kf-cal-day-cell {
        min-height: 32px;
        padding-top: 4px;
        border-radius: 8px;
    }

    .kf-cal-day-num {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }

    .kf-cal-dots {
        margin-top: 2px;
        height: 4px;
    }

    .kf-cal-dot {
        width: 4px;
        height: 4px;
    }

    .kf-cal-footer {
        margin-top: 24px;
    }

    .kf-cal-footer .cta.cta_ani {
        padding: 10px 20px;
        font-size: 0.85rem;
    }

    .kf-cal-empty, .kf-cal-error {
        padding: 20px 12px;
    }

    .kf-cal-empty i {
        font-size: 1.25rem;
        margin-bottom: 6px;
    }

    .kf-cal-empty p {
        font-size: 0.78rem;
    }
}

/* ============================================
   RESPONSIVE — EXTRA SMALL (max 359.98px)
   Covers 320px viewport
   ============================================ */
@media (max-width: 359.98px) {
    .kf-calendar-section {
        padding: 28px 0;
    }

    .kf-calendar-section .section-header {
        margin-bottom: 20px;
    }

    .kf-calendar-section .section-header .section-title {
        font-size: 20px;
    }

    .kf-calendar-section .section-header .section-subtitle {
        font-size: 12px;
        margin-top: 18px;
    }

    .kf-cal-grid {
        gap: 16px;
    }

    .kf-cal-widget-container {
        padding: 12px;
        border-radius: 12px;
    }

    .kf-cal-btn-icon {
        width: 28px;
        height: 28px;
        font-size: 0.65rem;
    }

    .kf-cal-btn-today {
        height: 28px;
        font-size: 0.65rem;
        padding: 0 8px;
    }

    .kf-cal-weekdays {
        font-size: 0.6rem;
    }

    .kf-cal-day-cell {
        min-height: 28px;
        padding-top: 3px;
    }

    .kf-cal-day-num {
        width: 22px;
        height: 22px;
        font-size: 0.7rem;
    }

    .kf-cal-event-thumb {
        width: 60px;
    }

    .kf-cal-event-body {
        padding: 8px 10px;
    }

    .kf-cal-event-title {
        font-size: 0.8rem;
    }

    .kf-cal-footer {
        margin-top: 20px;
    }

    .kf-cal-footer .cta.cta_ani {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    .kf-cal-event-card,
    .kf-cal-btn,
    .kf-cal-day-cell {
        transition-duration: 0.01ms !important;
    }
    .kf-cal-skeleton-card {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

