/* =====================================================================
   Content Gating — unified "locked / date-gated" visual treatment
   Used with shared/js/gating.js (window.ContentGate).

   Apply `.content-gated` to ANY course card (tool, lesson/page, quiz,
   sim) that is not yet available to the current viewer. One consistent
   dim + grayscale + non-interactive treatment across every content type.

   Companion pieces:
     .gate-banner       — "Available {date}" / "Locked" / "Closed" pill
     .gate-due-tag      — "Due {date}" / "Due: TBA" pill
     .gate-preview-badge — instructor-only "preview" marker (top-right)
   ===================================================================== */

/* ---- The dim itself (student view) ---- */
.content-gated {
    opacity: 0.55;
    filter: grayscale(35%);
    pointer-events: none;
    position: relative;
}

/* Suppress hover lift/animation while gated */
.content-gated:hover {
    transform: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

/* Instructors/managers see a lighter dim and can still click through
   to preview the gated item. */
.content-gated.instructor-view {
    opacity: 0.8;
    filter: grayscale(15%);
    pointer-events: auto;
}

/* ---- Availability banner (e.g. "🗓️ Available Jul 19") ---- */
.gate-banner {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #7c3aed;
    background: #f3f0ff;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    margin-bottom: 0.4rem;
}

/* Closed / expired window */
.gate-banner.gate-banner-closed {
    color: #991b1b;
    background: #fef2f2;
}

/* Locked by prerequisites (not a date) */
.gate-banner.gate-banner-locked {
    color: #6b7280;
    background: #f3f4f6;
}

/* ---- Due-date tag (e.g. "📅 Due Jul 19, 11:59 PM" / "Due: TBA") ---- */
.gate-due-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fde68a;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    white-space: nowrap;
}

/* Neutral styling when no deadline is set ("Due: TBA") */
.gate-due-tag.gate-due-tba {
    color: #6b7280;
    background: #f9fafb;
    border-color: #e5e7eb;
}

/* ---- Instructor preview badge (top-right corner) ---- */
.gate-preview-badge {
    font-size: 0.65rem;
    font-weight: 600;
    color: #d97706;
    background: #fffbeb;
    border: 1px solid #fde68a;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    z-index: 2;
}

@media (prefers-reduced-motion: reduce) {
    .content-gated:hover {
        transition: none;
    }
}
