/* =====================================================================
   calendar.css — Seasonal Release Calendar + Airing Today sidebar widget
   Site palette: bg #151412 · widget #1a1a1a · accent #e60000
   Text: primary #edeeef · secondary #b8babc · muted #8e9194
   ===================================================================== */

/* ── Page layout ────────────────────────────────────────────────────── */
.os-cal-page-wrap {
    align-items: flex-start;
    flex-wrap: wrap;       /* lets sidebar drop below on mobile */
}
.os-cal-main {
    min-width: 0;
    /* Bootstrap col-md-9 handles width; ensure it doesn't shrink weirdly */
}

/* Mobile: stack sidebar below content */
@media (max-width: 767px) {
    .os-cal-page-wrap { flex-direction: column; }
    .os-cal-main {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    .os-cal-page-wrap > .sidebar {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
}

/* ── Season banner ──────────────────────────────────────────────────── */
.os-cal-banner {
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    margin-bottom: 18px;
    overflow: hidden;
    position: relative;
}
.os-cal-banner::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #e60000 0%, #7b0000 100%);
}
.os-cal-banner-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 22px 20px 28px;
}
.os-cal-banner-label {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #e60000;
    margin-bottom: 6px;
}
.os-cal-banner-title {
    font-size: 26px;
    font-weight: 800;
    color: #edeeef;
    margin: 0 0 4px 0;
    letter-spacing: -0.5px;
    line-height: 1.1;
}
.os-cal-banner-sub {
    font-size: 11px;
    color: #8e9194;
    margin: 0;
}
.os-cal-banner-icon { flex-shrink: 0; }
.os-cal-banner-icon svg { display: block; }

/* ── Day-filter tabs ────────────────────────────────────────────────── */
.os-cal-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 16px;
}
.os-cal-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.08);
    color: #8e9194;
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    white-space: nowrap;
}
.os-cal-tab:hover {
    background: rgba(255,255,255,0.06);
    color: #b8babc;
    border-color: rgba(255,255,255,0.12);
}
.os-cal-tab.active,
.os-cal-tab.active:hover {
    background: #e60000;
    border-color: #e60000;
    color: #fff;
}
.os-cal-tab--today {
    border-color: rgba(230,0,0,0.35);
    color: #e66;
}
.os-cal-tab--empty {
    opacity: 0.35;
    pointer-events: none;
}
.os-cal-tab-dot {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    animation: os-cal-pulse 1.8s ease-in-out infinite;
    flex-shrink: 0;
}
.os-cal-tab.active .os-cal-tab-dot { background: #fff; animation: none; }
.os-cal-tab-count {
    font-size: 9px;
    font-weight: 700;
    background: rgba(255,255,255,0.12);
    border-radius: 5px;
    padding: 1px 5px;
    line-height: 1.6;
}
.os-cal-tab.active .os-cal-tab-count { background: rgba(255,255,255,0.25); }

@keyframes os-cal-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.7); }
}

/* ── Day grid ───────────────────────────────────────────────────────── */

/* Scroll wrapper: allows horizontal scroll on tablet before mobile stacks */
.os-cal-grid-scroll {
    /* no overflow on desktop — grid is wide enough */
}

/* Always 7 equal columns on desktop */
.os-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    align-items: start;
}

/* Tablet (768–991px): col-md-9 is narrower — allow horizontal scroll */
@media (max-width: 991px) and (min-width: 768px) {
    .os-cal-grid-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }
    .os-cal-grid {
        grid-template-columns: repeat(7, minmax(130px, 1fr));
        min-width: 910px;
    }
}

/* Mobile (<768px): sidebar already stacks below; grid becomes 1 column */
@media (max-width: 767px) {
    .os-cal-grid-scroll { overflow-x: visible; }
    .os-cal-grid { grid-template-columns: 1fr; gap: 8px; }
    /* On mobile, hide popup (hover doesn't exist) */
    .os-cal-popup { display: none !important; }
}

/* ── Day column ─────────────────────────────────────────────────────── */
.os-cal-day {
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    overflow: visible;
}
.os-cal-day[data-hidden] { display: none; }
.os-cal-day--today {
    border-color: rgba(230,0,0,0.3);
    box-shadow: 0 0 0 1px rgba(230,0,0,0.08);
}

/* Day header */
.os-cal-day-hd {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 9px 11px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.025);
}
.os-cal-day--today .os-cal-day-hd {
    background: rgba(230,0,0,0.07);
}
.os-cal-day-name {
    flex: 1;
    font-size: 11px;
    font-weight: 700;
    color: #edeeef;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.os-cal-day--today .os-cal-day-name { color: #ff4444; }
.os-cal-today-chip {
    font-size: 8.5px;
    font-weight: 700;
    background: #e60000;
    color: #fff;
    border-radius: 4px;
    padding: 1px 5px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.os-cal-day-n {
    font-size: 9px;
    color: #8e9194;
    background: rgba(255,255,255,0.07);
    border-radius: 4px;
    padding: 1px 5px;
    font-weight: 600;
}

/* Day body */
.os-cal-day-body {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Empty day placeholder */
.os-cal-day-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 20px 8px;
    color: #3a3a3a;
    text-align: center;
}
.os-cal-day-empty i { font-size: 18px; }
.os-cal-day-empty span { font-size: 9px; font-weight: 600; letter-spacing: 0.3px; text-transform: uppercase; }

/* ── Card wrapper (holds card + popup) ──────────────────────────────── */
.os-cal-card-wrap {
    position: relative;
}

/* ── Show card — small horizontal row ───────────────────────────────── */
.os-cal-card {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    border-radius: 6px;
    padding: 5px;
    transition: background 0.12s;
}
.os-cal-card-wrap:hover .os-cal-card,
.os-cal-card:hover {
    background: rgba(255,255,255,0.05);
    text-decoration: none;
    color: inherit;
}

/* Small thumbnail */
.os-cal-card-thumb {
    width: 36px;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    background: #111;
}
.os-cal-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}
.os-cal-card-wrap:hover .os-cal-card-thumb img { transform: scale(1.06); }

/* Info */
.os-cal-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.os-cal-card-title {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #b8babc;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    transition: color 0.12s;
}
.os-cal-card-wrap:hover .os-cal-card-title { color: #edeeef; }
.os-cal-card-time {
    font-size: 9.5px;
    color: #e66;
    font-weight: 600;
}
.os-cal-card-time i { font-size: 8px; margin-right: 2px; }
.os-cal-card-studio {
    display: block;
    font-size: 9px;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Hover popup ────────────────────────────────────────────────────── */
.os-cal-popup {
    display: none;
    position: absolute;
    left: calc(100% + 8px);
    top: 0;
    width: 240px;
    background: #222;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
    z-index: 100;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}
.os-cal-card-wrap:hover .os-cal-popup {
    display: block;
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    animation: os-popup-in 0.18s ease forwards;
}
/* Flip to left when near right edge (class added by JS) */
.os-cal-popup--left {
    left: auto;
    right: calc(100% + 8px);
}

@keyframes os-popup-in {
    from { opacity: 0; transform: translateX(-6px); }
    to   { opacity: 1; transform: translateX(0); }
}

.os-cal-popup-img {
    width: 100%;
    height: 130px;
    overflow: hidden;
    flex-shrink: 0;
}
.os-cal-popup-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.os-cal-popup-body {
    padding: 12px;
}
.os-cal-popup-title {
    font-size: 13px;
    font-weight: 700;
    color: #edeeef;
    line-height: 1.3;
    margin-bottom: 5px;
}
.os-cal-popup-genre {
    font-size: 9.5px;
    color: #e66;
    font-weight: 500;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.os-cal-popup-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 10px;
    margin-bottom: 8px;
}
.os-cal-popup-meta span {
    font-size: 10px;
    color: #8e9194;
    display: flex;
    align-items: center;
    gap: 3px;
}
.os-cal-popup-meta span i { font-size: 9px; color: #555; }
.os-cal-popup-synopsis {
    font-size: 10.5px;
    color: #8e9194;
    line-height: 1.55;
    margin: 0 0 10px 0;
}
.os-cal-popup-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 7px;
    background: #e60000;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 7px;
    text-decoration: none;
    transition: background 0.15s;
    letter-spacing: 0.3px;
}
.os-cal-popup-btn:hover {
    background: #cc0000;
    color: #fff;
    text-decoration: none;
}
.os-cal-popup-btn i { font-size: 9px; }

/* ── Empty state ────────────────────────────────────────────────────── */
.os-cal-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 60px 20px;
    color: #8e9194;
    text-align: center;
}
.os-cal-empty i { font-size: 36px; color: #2a2a2a; }
.os-cal-empty strong { font-size: 14px; color: #b8babc; }
.os-cal-empty span { font-size: 12px; }

/* Airing Today styles are in os-dark.css (loaded globally) */
