/* ============================================================
   CBQ Archive View Modes (v4.6.1)
   Applies to any grid with class .cbq-archive-container.
   Data-view attribute switches layout: grid / comfortable / magazine / list / dense
   Individual cards use class .cbq-arc-card with BEM-ish child classes.
   ============================================================ */

.cbq-archive-container {
    font-family: 'Inter','Baloo Tamma 2',sans-serif;
    margin: 0;
}

/* Default card palette — shared across all views */
.arc-corner-stack { display: none; }   /* Only shown in Grid view — overridden below */
.arc-title-wrap  { display: none; }    /* Only shown in Grid view — overridden below */
.arc-inline-meta { display: none; }    /* Only shown in Grid view — overridden below */

.cbq-arc-card {
    position: relative;
    background: var(--mcqp-surface, #fff);
    border: 1px solid var(--mcqp-border, #e5e7eb);
    border-radius: 14px;
    transition: all .22s cubic-bezier(.4,0,.2,1);
    text-decoration: none !important;
    color: inherit !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.cbq-arc-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg,#2563eb,#60a5fa);
    opacity: 0;
    transition: opacity .22s ease;
    z-index: 1;
}
.cbq-arc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -10px rgba(15,23,42,.14), 0 4px 10px -4px rgba(15,23,42,.06);
    border-color: #cbd5e1;
}
.cbq-arc-card:hover::before { opacity: 1; }

/* Date badge */
.arc-date-badge {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    border-radius: 10px;
    background: linear-gradient(135deg,#eff6ff,#dbeafe);
    border: 1px solid #bfdbfe;
    flex-shrink: 0; line-height: 1;
    transition: transform .25s cubic-bezier(.4, 0, .2, 1), box-shadow .25s ease;
}
.arc-date-day { font-weight: 800; color: #1d4ed8; letter-spacing: -.02em; }
.arc-date-month { font-weight: 700; color: #3b82f6; text-transform: uppercase; letter-spacing: .6px; }

/* Weekday pill */
.arc-weekday {
    display: inline-flex; align-items: center;
    padding: 3px 9px; border-radius: 99px;
    background: #f1f5f9; color: #64748b;
    font-weight: 600; letter-spacing: .3px; text-transform: uppercase;
}

/* Title */
.arc-title {
    font-weight: 700;
    color: var(--mcqp-text, #0f172a);
    line-height: 1.35;
    margin: 0;
    letter-spacing: -.005em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.arc-topic {
    color: var(--mcqp-text-muted, #64748b);
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Meta chips */
.arc-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.arc-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 8px;
    background: #f8fafc; border: 1px solid #e2e8f0;
    border-radius: 7px;
    color: #475569; font-weight: 500;
    white-space: nowrap;
}
.arc-chip svg { width: 11px; height: 11px; opacity: .75; }

/* CTA */
.arc-cta {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 14px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-weight: 600;
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
    white-space: nowrap;
    overflow: hidden;
    isolation: isolate;                 /* create a new stacking context so pseudo z-index is scoped */
    box-shadow: 0 2px 6px -2px rgba(37,99,235,.3);
}
.arc-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    opacity: 0;
    transition: opacity .25s ease;
    z-index: -1;                        /* BEHIND text/SVG (was 0, covering text node) */
}
.arc-cta::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,.25) 50%, transparent 100%);
    transition: left .6s ease;
    z-index: -1;                        /* shimmer also behind content */
    pointer-events: none;
}
.arc-cta svg {
    width: 12px; height: 12px;
    transition: transform .25s ease;
    flex-shrink: 0;
}
/* v4.12.390 — Dual CTA labels. Desktop shows "Attend Test" (full text);
   mobile shows the more compact "Attend >" so it fits next to two chips
   on a narrow 2-col phone card. Default is desktop visibility; the
   600px breakpoint flips it. */
.arc-cta-label-desktop { display: inline; }
.arc-cta-label-mobile  { display: none; align-items: center; gap: 3px; }
.arc-cta-label-mobile svg { width: 10px; height: 10px; flex-shrink: 0; }
.cbq-arc-card:hover .arc-cta {
    box-shadow: 0 8px 18px -4px rgba(37,99,235,.45), 0 3px 8px -2px rgba(37,99,235,.3);
    transform: translateY(-1px);
}
.cbq-arc-card:hover .arc-cta::before { opacity: 1; }
.cbq-arc-card:hover .arc-cta::after { left: 120%; }
.cbq-arc-card:hover .arc-cta svg { transform: translateX(3px); }

/* ============================================================
   Today Badge — animated (shared)
   ============================================================ */
.arc-today-pill {
    position: relative;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px 4px 8px;
    background: linear-gradient(135deg,#ef4444,#dc2626);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    border-radius: 99px;
    border: 1px solid rgba(255,255,255,.25);
    letter-spacing: .5px; text-transform: uppercase;
    box-shadow: 0 3px 10px -2px rgba(239,68,68,.45);
    overflow: hidden;
    animation: arc-today-bob 2.4s ease-in-out infinite;
    align-self: flex-start;
    flex-shrink: 0;
}
.arc-today-pill::before {
    content: ''; position: absolute;
    top: 0; left: -100%; width: 60%; height: 100%;
    background: linear-gradient(120deg,transparent 0%,rgba(255,255,255,.3) 50%,transparent 100%);
    animation: arc-today-shine 3s linear infinite;
}
.arc-live-dot {
    position: relative;
    width: 6px; height: 6px; border-radius: 50%;
    background: #fff; flex-shrink: 0;
}
.arc-live-dot::after {
    content: ''; position: absolute; inset: -3px;
    border-radius: 50%;
    background: rgba(255,255,255,.7);
    animation: arc-live-pulse 1.4s ease-out infinite;
}
.arc-today-pill span { position: relative; z-index: 1; }
@keyframes arc-today-bob  { 0%,100%{transform:translateY(0)}50%{transform:translateY(-2px)} }
@keyframes arc-today-shine{ 0%{left:-100%}100%{left:200%} }
@keyframes arc-live-pulse { 0%{transform:scale(.8);opacity:.9}100%{transform:scale(2.4);opacity:0} }

.cbq-arc-card.is-today {
    border-color: #fca5a5;
    animation: arc-card-glow 3s ease-in-out infinite;
}
.cbq-arc-card.is-today::before {
    opacity: 1;
    background: linear-gradient(90deg, #ef4444, #dc2626, #ef4444);
}

/* Today's DATE BADGE — red gradient + pulsing ring + shimmer sweep + breath scale */
.cbq-arc-card.is-today .arc-date-badge {
    position: relative;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 60%, #b91c1c 100%);
    border-color: #dc2626;
    overflow: hidden;
    animation: arc-today-date-breath 2.5s ease-in-out infinite;
    box-shadow: 0 4px 14px -2px rgba(239, 68, 68, .45), 0 0 0 0 rgba(239, 68, 68, .6);
    z-index: 1;
}
/* Pulsing outer ring */
.cbq-arc-card.is-today .arc-date-badge::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    border: 2px solid #ef4444;
    opacity: 0;
    animation: arc-today-date-ring 1.8s ease-out infinite;
    z-index: -1;
    pointer-events: none;
}
/* Shimmer sweep inside the badge */
.cbq-arc-card.is-today .arc-date-badge::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,.35) 50%, transparent 100%);
    animation: arc-today-date-shine 2.8s linear infinite;
    pointer-events: none;
    z-index: 1;
}
.cbq-arc-card.is-today .arc-date-day   { color: #fff; position: relative; z-index: 2; text-shadow: 0 1px 2px rgba(0,0,0,.2); }
.cbq-arc-card.is-today .arc-date-month { color: #fee2e2; position: relative; z-index: 2; }
.cbq-arc-card.is-today .arc-weekday    { background: #ef4444; color: #fff; }

/* Hover — badge reacts interactively: subtle lift + brighter glow + stop breath for that moment */
.cbq-arc-card.is-today:hover .arc-date-badge {
    transform: scale(1.06);
    box-shadow: 0 8px 22px -3px rgba(239, 68, 68, .6), 0 0 0 4px rgba(239, 68, 68, .15);
    animation-play-state: paused;
}

@keyframes arc-today-date-breath {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 14px -2px rgba(239, 68, 68, .45), 0 0 0 0 rgba(239, 68, 68, .6);
    }
    50% {
        transform: scale(1.035);
        box-shadow: 0 6px 18px -2px rgba(239, 68, 68, .6), 0 0 0 6px rgba(239, 68, 68, 0);
    }
}
@keyframes arc-today-date-ring {
    0%   { opacity: .9; transform: scale(1); }
    100% { opacity: 0;  transform: scale(1.45); }
}
@keyframes arc-today-date-shine {
    0%   { left: -100%; }
    100% { left: 200%; }
}

@keyframes arc-card-glow {
    0%,100% { box-shadow: 0 4px 16px -6px rgba(239, 68, 68, .18); }
    50%     { box-shadow: 0 8px 24px -6px rgba(239, 68, 68, .35); }
}

@media (prefers-reduced-motion: reduce) {
    .arc-today-pill, .arc-today-pill::before, .arc-live-dot::after,
    .cbq-arc-card.is-today,
    .cbq-arc-card.is-today .arc-date-badge,
    .cbq-arc-card.is-today .arc-date-badge::before,
    .cbq-arc-card.is-today .arc-date-badge::after { animation: none !important; }
}

/* ============================================================
   VIEW: GRID (4 per row) — DEFAULT  (v4.6.6)
   ─────────────────────────────────────────────────────────────
   Layout:
     Row 1: [Date badge (fixed)] [Title + subtle date-label]
     Row 2: [Attend Test button]            [⏱ 15m]  [❓ 10Q]
   The two rows are separated by auto-expanding space so all cards
   align their buttons vertically regardless of title length.
   ============================================================ */
.cbq-archive-container[data-view="grid"] {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    align-items: start;               /* v4.12.392 — don't stretch cards to row height */
}
[data-view="grid"] .cbq-arc-card {
    padding: 12px;                   /* v4.12.393 — was 14 (slightly tighter) */
    position: relative;
    gap: 8px;                         /* v4.12.393 — was 10 */
}

/* ROW 1 — Date + Title */
[data-view="grid"] .arc-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    min-width: 0;                     /* allow child truncation */
}
[data-view="grid"] .arc-date-block {
    flex: 0 0 auto;
    position: relative;
}
[data-view="grid"] .arc-date-badge {
    width: 52px; height: 52px;
    border-radius: 10px;
}
[data-view="grid"] .arc-date-day { font-size: 17px; font-weight: 800; }
[data-view="grid"] .arc-date-month { font-size: 9px; margin-top: 2px; }
[data-view="grid"] .arc-weekday { display: none; }
[data-view="grid"] .arc-bookmark-holder { display: none; }   /* bookmark hidden in compact grid */

[data-view="grid"] .arc-card-top .arc-title-wrap {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}
[data-view="grid"] .arc-card-top .arc-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
    color: var(--mcqp-text, #0f172a);
    letter-spacing: -.005em;

    /* Clamp to 2 lines with ellipsis */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;           /* wrap long Kannada words cleanly */
    overflow-wrap: anywhere;
}

/* ROW 2 — Button + Meta chips. v4.12.392 — Removed margin-top:auto.
   With grid align-items:start (cards no longer stretched to row height)
   AND no min-height on cards, the action row should sit naturally below
   the title with no auto-margin pushing it to the bottom (which was
   creating the huge empty gap on cards with short title content). */
[data-view="grid"] .arc-card-action {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 6px;
    flex-wrap: nowrap;
}
[data-view="grid"] .arc-card-action .arc-cta {
    flex: 1 1 auto;                    /* GROW to fill gap */
    width: auto;
    min-width: 0;
    padding: 7px 14px;
    font-size: 11.5px;
    border-radius: 7px;
    gap: 5px;
    height: auto;
}
[data-view="grid"] .arc-card-action .arc-cta svg { width: 11px; height: 11px; }

/* Meta chips — compact right anchor, no fixed width so they stay tight */
[data-view="grid"] .arc-card-action .arc-inline-meta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}
[data-view="grid"] .arc-card-action .arc-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 8px;                  /* matches button vertical feel */
    font-size: 10.5px;
    line-height: 1;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-weight: 600;
    white-space: nowrap;
}
[data-view="grid"] .arc-card-action .arc-chip svg {
    width: 11px; height: 11px; opacity: .85;
    flex-shrink: 0;
}

/* Hide stuff that belongs to other views */
[data-view="grid"] .arc-main { display: none; }
[data-view="grid"] .arc-topic { display: none; }
[data-view="grid"] .arc-chip-marks { display: none; }

/* Today badge — tiny floating marker anchored to date-block */
[data-view="grid"] .arc-today-pill {
    position: absolute;
    top: -6px; left: -6px;
    z-index: 2;
    font-size: 7.5px;
    padding: 2px 6px 2px 5px;
    letter-spacing: .4px;
    gap: 3px;
    margin: 0;
    border-radius: 99px;
}
[data-view="grid"] .arc-today-pill .arc-live-dot { width: 4px; height: 4px; }
[data-view="grid"] .arc-today-pill .arc-live-dot::after { inset: -2px; }
/* Hide the wordy "Today's Test" span inside the tiny pill in grid — dot alone conveys it */
[data-view="grid"] .arc-today-pill span:last-child {
    display: inline-block;
    font-size: 7.5px;
    letter-spacing: .3px;
}

/* ============================================================
   VIEW: COMFORTABLE (3 per row, spacious)
   ============================================================ */
.cbq-archive-container[data-view="comfortable"] {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
[data-view="comfortable"] .cbq-arc-card { padding: 18px 20px; border-radius: 16px; }
[data-view="comfortable"] .arc-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
[data-view="comfortable"] .arc-date-block { display: inline-flex; align-items: center; gap: 10px; }
[data-view="comfortable"] .arc-date-badge { width: 52px; height: 52px; border-radius: 12px; }
[data-view="comfortable"] .arc-date-day { font-size: 19px; }
[data-view="comfortable"] .arc-date-month { font-size: 9.5px; margin-top: 2px; }
[data-view="comfortable"] .arc-weekday { font-size: 11px; }
[data-view="comfortable"] .arc-title { font-size: 15px; margin: 0 0 6px; }
[data-view="comfortable"] .arc-topic { font-size: 12.5px; margin: 0 0 14px; }
[data-view="comfortable"] .arc-meta { margin-bottom: 14px; font-size: 12px; gap: 6px; }
[data-view="comfortable"] .arc-chip { padding: 4px 9px; font-size: 11.5px; }
[data-view="comfortable"] .arc-card-action { margin-top: auto; }
[data-view="comfortable"] .arc-cta { width: 100%; padding: 10px 14px; font-size: 13px; border-radius: 10px; }

/* ============================================================
   VIEW: MAGAZINE (first card featured, rest grid)
   ============================================================ */
.cbq-archive-container[data-view="magazine"] {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-auto-rows: minmax(140px, auto);
    gap: 14px;
}
[data-view="magazine"] .cbq-arc-card { padding: 16px; }
[data-view="magazine"] .cbq-arc-card:first-child {
    grid-row: span 2;
    padding: 24px;
    background: linear-gradient(135deg,#eff6ff 0%,#ffffff 60%);
    border-color: #bfdbfe;
}
[data-view="magazine"] .cbq-arc-card:first-child .arc-date-badge { width: 64px; height: 64px; border-radius: 14px; }
[data-view="magazine"] .cbq-arc-card:first-child .arc-date-day { font-size: 26px; }
[data-view="magazine"] .cbq-arc-card:first-child .arc-date-month { font-size: 10.5px; }
[data-view="magazine"] .cbq-arc-card:first-child .arc-title { font-size: 22px; margin-bottom: 8px; -webkit-line-clamp: 3; letter-spacing: -.015em; }
[data-view="magazine"] .cbq-arc-card:first-child .arc-topic { font-size: 14px; -webkit-line-clamp: 2; margin-bottom: 18px; }
[data-view="magazine"] .cbq-arc-card:first-child .arc-meta { font-size: 12px; }
[data-view="magazine"] .cbq-arc-card:first-child .arc-cta { font-size: 13.5px; padding: 11px 18px; }

[data-view="magazine"] .arc-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
[data-view="magazine"] .arc-date-block { display: inline-flex; align-items: center; gap: 8px; }
[data-view="magazine"] .arc-date-badge { width: 44px; height: 44px; }
[data-view="magazine"] .arc-date-day { font-size: 16px; }
[data-view="magazine"] .arc-date-month { font-size: 9px; margin-top: 1px; }
[data-view="magazine"] .arc-weekday { font-size: 10.5px; }
[data-view="magazine"] .arc-title { font-size: 13.5px; margin: 0 0 6px; }
[data-view="magazine"] .arc-topic { display: none; }
[data-view="magazine"] .arc-meta { margin-bottom: 10px; font-size: 11px; }
[data-view="magazine"] .arc-chip { padding: 3px 7px; font-size: 10.5px; }
[data-view="magazine"] .arc-chip-marks { display: none; }
[data-view="magazine"] .arc-card-action { margin-top: auto; }
[data-view="magazine"] .arc-cta { width: 100%; padding: 7px 10px; font-size: 11.5px; }

/* ============================================================
   VIEW: LIST (1 per row, horizontal strip)
   ============================================================ */
.cbq-archive-container[data-view="list"] {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
[data-view="list"] .cbq-arc-card {
    flex-direction: row;
    align-items: center;
    padding: 12px 16px;
    gap: 16px;
    border-radius: 12px;
}
[data-view="list"] .arc-card-top { display: contents; }
[data-view="list"] .arc-date-block { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
[data-view="list"] .arc-date-badge { width: 46px; height: 46px; }
[data-view="list"] .arc-date-day { font-size: 17px; }
[data-view="list"] .arc-date-month { font-size: 9px; margin-top: 1px; }
[data-view="list"] .arc-weekday { font-size: 10.5px; }
[data-view="list"] .arc-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
[data-view="list"] .arc-title { font-size: 14px; margin: 0; -webkit-line-clamp: 1; }
[data-view="list"] .arc-topic { display: none; }
[data-view="list"] .arc-meta { font-size: 11px; gap: 6px; margin: 0; }
[data-view="list"] .arc-chip { padding: 2px 7px; font-size: 10.5px; }
[data-view="list"] .arc-card-action { margin: 0; flex-shrink: 0; }
[data-view="list"] .arc-cta { padding: 7px 14px; font-size: 12px; }
[data-view="list"] .arc-today-pill { font-size: 9px; padding: 3px 7px; }
[data-view="list"] .arc-bookmark-holder { display: none; }

/* ============================================================
   VIEW: DENSE (table-like)
   ============================================================ */
.cbq-archive-container[data-view="dense"] {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--mcqp-border, #e5e7eb);
    border-radius: 12px;
    overflow: hidden;
}
[data-view="dense"] .cbq-arc-card {
    flex-direction: row;
    align-items: center;
    padding: 10px 16px;
    gap: 14px;
    border: none;
    border-bottom: 1px solid var(--mcqp-border-2, #f1f5f9);
    border-radius: 0;
}
[data-view="dense"] .cbq-arc-card:last-child { border-bottom: none; }
[data-view="dense"] .cbq-arc-card::before { display: none; }
[data-view="dense"] .cbq-arc-card:hover { transform: none; background: var(--mcqp-surface-2, #f8fafc); box-shadow: none; border-color: var(--mcqp-border-2, #f1f5f9); }
[data-view="dense"] .arc-card-top { display: contents; }
[data-view="dense"] .arc-date-block { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; min-width: 120px; }
[data-view="dense"] .arc-date-badge { width: 36px; height: 36px; border-radius: 8px; }
[data-view="dense"] .arc-date-day { font-size: 13px; }
[data-view="dense"] .arc-date-month { font-size: 8px; margin-top: 1px; }
[data-view="dense"] .arc-weekday { font-size: 9.5px; padding: 2px 7px; }
[data-view="dense"] .arc-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
[data-view="dense"] .arc-title { font-size: 13px; margin: 0; -webkit-line-clamp: 1; font-weight: 600; }
[data-view="dense"] .arc-topic { display: none; }
[data-view="dense"] .arc-meta { font-size: 10.5px; gap: 8px; margin: 0; }
[data-view="dense"] .arc-chip { background: transparent; border: none; padding: 0; font-size: 10.5px; color: #64748b; }
[data-view="dense"] .arc-card-action { margin: 0; flex-shrink: 0; }
[data-view="dense"] .arc-cta { padding: 5px 10px; font-size: 11px; border-radius: 6px; background: #2563eb; }
[data-view="dense"] .arc-today-pill { font-size: 8.5px; padding: 2px 6px; }
[data-view="dense"] .arc-bookmark-holder { display: none; }
[data-view="dense"] .cbq-arc-card.is-today { animation: none; background: rgba(37,99,235,.04); }
[data-view="dense"] .cbq-arc-card.is-today .arc-date-badge { background: linear-gradient(135deg,#eff6ff,#dbeafe); border-color: #bfdbfe; }
[data-view="dense"] .cbq-arc-card.is-today .arc-date-day { color: #1d4ed8; }
[data-view="dense"] .cbq-arc-card.is-today .arc-date-month { color: #3b82f6; }
[data-view="dense"] .cbq-arc-card.is-today .arc-weekday { background: #f1f5f9; color: #64748b; }

/* ============================================================
   RESPONSIVE BREAKPOINTS (v4.6.6)
   Carefully tuned for real device widths:
     - Desktop:  >1200px  → 4 per row
     - Laptop:   900-1200 → 3 per row
     - Tablet:   600-900  → 2 per row
     - Mobile:   <600     → 2 per row, compact internals
     - Tiny:     <380     → 1 per row (tests on iPhone SE / older Android)
   ============================================================ */

/* Laptop — 3 cards per row */
@media (max-width: 1200px) {
    .cbq-archive-container[data-view="grid"] { grid-template-columns: repeat(3, 1fr); }
}

/* Tablet */
@media (max-width: 900px) {
    .cbq-archive-container[data-view="grid"] { grid-template-columns: repeat(2, 1fr); }
    .cbq-archive-container[data-view="comfortable"] { grid-template-columns: repeat(2, 1fr); }
    .cbq-archive-container[data-view="magazine"] { grid-template-columns: 1fr 1fr; }
    [data-view="magazine"] .cbq-arc-card:first-child { grid-column: span 2; grid-row: span 1; }
}

/* Mobile — 2 per row grid, tighter internals to prevent overflow */
@media (max-width: 600px) {
    .cbq-archive-container[data-view="grid"] {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .cbq-archive-container[data-view="comfortable"] { grid-template-columns: 1fr; gap: 12px; }
    .cbq-archive-container[data-view="magazine"] { grid-template-columns: 1fr; }
    [data-view="magazine"] .cbq-arc-card:first-child { grid-column: auto; }

    /* Grid card — tighter spacing on phones */
    [data-view="grid"] .cbq-arc-card {
        padding: 10px;       /* v4.12.393 — was 12 */
        gap: 6px;            /* v4.12.393 — was 8 (tighter title→action spacing) */
    }
    [data-view="grid"] .arc-card-top { gap: 10px; }
    [data-view="grid"] .arc-date-badge { width: 44px; height: 44px; }
    [data-view="grid"] .arc-date-day { font-size: 15px; }
    [data-view="grid"] .arc-date-month { font-size: 8.5px; }
    [data-view="grid"] .arc-card-top .arc-title { font-size: 12.5px; line-height: 1.25; }

    /* v4.12.388 — User wants Attend Test + duration chip + Q chip ALL on
       ONE line on every device. The v4.6 mobile pattern (column-reverse,
       full-width CTA, chips below) is reverted. Instead we keep the
       desktop row layout and shrink the elements until all three fit.
       v4.12.389 — CTA is flex-shrink:0 so its text never gets clipped by
       the card's overflow:hidden. Chips absorb width pressure instead.
       v4.12.390 — Mobile uses the shorter "Attend >" label (toggled via
       .arc-cta-label-* visibility below) so chip icons can stay visible
       and the row still fits on narrow 2-col phones. */
    [data-view="grid"] .arc-card-action {
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
        gap: 6px;
        padding-top: 6px;     /* v4.12.388 — reduced from default 10px */
        min-width: 0;
    }
    [data-view="grid"] .arc-card-action .arc-cta {
        width: auto;
        flex: 0 0 auto;       /* v4.12.389 — never shrink (fixes clipped text) */
        padding: 5px 7px;     /* v4.12.393 — L/R tightened from 8 to 7; T/B 4 → 5 for proportion */
        font-size: 10px;
        white-space: nowrap;
        gap: 3px;
    }
    /* v4.12.392 — chevron icon inside the mobile label sized down to match
       the smaller font. */
    [data-view="grid"] .arc-card-action .arc-cta .arc-cta-label-mobile svg {
        width: 9px;
        height: 9px;
    }
    /* v4.12.390 — Show "Attend >" instead of "Attend Test" on mobile. */
    [data-view="grid"] .arc-card-action .arc-cta .arc-cta-label-desktop { display: none; }
    [data-view="grid"] .arc-card-action .arc-cta .arc-cta-label-mobile  { display: inline-flex; }
    [data-view="grid"] .arc-card-action .arc-inline-meta {
        justify-content: flex-end;
        gap: 4px;
        flex: 0 1 auto;       /* v4.12.391 — natural width; can shrink ONLY if needed */
        min-width: 0;
    }
    [data-view="grid"] .arc-card-action .arc-chip {
        font-size: 10px;
        padding: 4px 5px;     /* v4.12.393 — T/B 3 → 4 to match CTA height; L/R kept at 5 */
        gap: 3px;
    }
    /* v4.12.390 — Chip icons RESTORED on mobile (user explicitly asked
       for "[icon + time] [icon + Questions]"). Keep them small but
       visible. */
    [data-view="grid"] .arc-card-action .arc-chip svg {
        display: inline-block;
        width: 9px;
        height: 9px;
        opacity: .85;
        flex-shrink: 0;
    }

    /* Dense view on mobile */
    [data-view="dense"] .cbq-arc-card { padding: 10px 12px; gap: 10px; }
    [data-view="dense"] .arc-date-block { min-width: 0; }
    [data-view="dense"] .arc-weekday { display: none; }

    /* List view on mobile */
    [data-view="list"] .cbq-arc-card { padding: 10px 12px; gap: 10px; }
    [data-view="list"] .arc-date-badge { width: 40px; height: 40px; }
    [data-view="list"] .arc-weekday { display: none; }
}

/* Tiny phones (iPhone SE, older Android) — single column grid */
/* v4.12.394 — User wants the compact mobile design (Attend › + chips with
   icons, all on one line) to render IDENTICALLY at every phone width —
   from iPhone 5/SE (320px) up through 600px. Previously this breakpoint
   switched to single-column layout with the full "Attend Test" label,
   breaking design consistency. Now we keep 2-col grid all the way down
   and just shave a few more pixels off chip/CTA padding at very narrow
   widths to guarantee everything fits without clipping or overlap.
   The structural layout (2-col grid, Attend ›, chip-with-icon, chip-with-
   icon) is invariant from 320px → 600px. */
@media (max-width: 380px) {
    /* 2-col grid stays locked — no single-column switch. */
    .cbq-archive-container[data-view="grid"] {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;             /* slightly tighter inter-card gap to reclaim space */
    }
    /* Card padding shaved to free another 4px per card horizontally. */
    [data-view="grid"] .cbq-arc-card {
        padding: 8px;
        gap: 5px;
    }
    /* CTA stays "Attend ›" with even tighter L/R padding. */
    [data-view="grid"] .arc-card-action {
        gap: 4px;             /* was 6 */
    }
    [data-view="grid"] .arc-card-action .arc-cta {
        padding: 5px 6px;     /* was 5×7 */
        gap: 2px;             /* tighter inner gap between text + chevron */
    }
    /* Chips lose their inner gap but keep the icon (user explicitly
       wanted [icon + time] [icon + Questions] on mobile). Text + icon
       sit right next to each other. */
    [data-view="grid"] .arc-card-action .arc-chip {
        padding: 4px 4px;
        gap: 2px;
    }
    [data-view="grid"] .arc-card-action .arc-chip svg {
        width: 8px;
        height: 8px;
    }
    /* Inline meta gap between the two chips also tightens. */
    [data-view="grid"] .arc-card-action .arc-inline-meta {
        gap: 3px;
    }
    /* Date badge + title proportions also adjust at this width so the
       top row still reads clearly. */
    [data-view="grid"] .arc-date-badge { width: 38px; height: 38px; }
    [data-view="grid"] .arc-date-day { font-size: 13px; }
    [data-view="grid"] .arc-date-month { font-size: 8px; }
    [data-view="grid"] .arc-card-top .arc-title { font-size: 11.5px; }
    /* Mobile CTA label stays — desktop label stays hidden (was overridden
       in earlier versions; we explicitly RE-hide it here). */
    [data-view="grid"] .arc-card-action .arc-cta .arc-cta-label-desktop { display: none; }
    [data-view="grid"] .arc-card-action .arc-cta .arc-cta-label-mobile  { display: inline-flex; }
}

/* v4.12.394 — Even tighter for very narrow phones (≤340px, e.g. older
   Android). The same 2-col compact design still applies; this just dials
   the spacing down one more notch to make sure nothing overflows. */
@media (max-width: 340px) {
    .cbq-archive-container[data-view="grid"] { gap: 6px; }
    [data-view="grid"] .cbq-arc-card { padding: 6px; }
    [data-view="grid"] .arc-card-action { gap: 3px; padding-top: 4px; }
    [data-view="grid"] .arc-card-action .arc-cta { padding: 4px 5px; font-size: 9.5px; }
    [data-view="grid"] .arc-card-action .arc-chip { padding: 3px 3px; font-size: 9.5px; }
    [data-view="grid"] .arc-card-action .arc-chip svg { width: 7px; height: 7px; }
    [data-view="grid"] .arc-card-action .arc-cta .arc-cta-label-mobile svg { width: 7px; height: 7px; }
}

/* ============================================================
   DARK MODE (all views)
   ============================================================ */
html[data-mcqp-theme="dark"] .cbq-arc-card {
    background: #1e293b;
    border-color: rgba(148,163,184,.12);
}
html[data-mcqp-theme="dark"] .cbq-arc-card:hover {
    background: #233247;
    border-color: rgba(37,99,235,.4);
    box-shadow: 0 10px 24px -10px rgba(0,0,0,.5);
}
html[data-mcqp-theme="dark"] .arc-date-badge {
    background: rgba(37,99,235,.12);
    border-color: rgba(37,99,235,.25);
}
html[data-mcqp-theme="dark"] .arc-date-day  { color: #93c5fd; }
html[data-mcqp-theme="dark"] .arc-date-month{ color: #60a5fa; }
html[data-mcqp-theme="dark"] .arc-weekday {
    background: #182240; color: #94a3b8;
}
html[data-mcqp-theme="dark"] .arc-title { color: #f8fafc; }
html[data-mcqp-theme="dark"] .arc-topic { color: #94a3b8; }
html[data-mcqp-theme="dark"] .arc-chip {
    background: #182240;
    border-color: #233056;
    color: #cbd5e1;
}
html[data-mcqp-theme="dark"] .arc-cta {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 2px 6px -2px rgba(37,99,235,.5);
}
html[data-mcqp-theme="dark"] [data-view="magazine"] .cbq-arc-card:first-child {
    background: linear-gradient(135deg, rgba(37,99,235,.15) 0%, #1e293b 60%);
    border-color: rgba(37,99,235,.3);
}
html[data-mcqp-theme="dark"] .cbq-archive-container[data-view="dense"] {
    border-color: rgba(148,163,184,.12);
}
html[data-mcqp-theme="dark"] [data-view="dense"] .cbq-arc-card { border-bottom-color: rgba(148,163,184,.08); }
html[data-mcqp-theme="dark"] [data-view="dense"] .cbq-arc-card:hover { background: #233247; }
html[data-mcqp-theme="dark"] [data-view="dense"] .arc-chip { background: transparent; border: none; color: #94a3b8; }
html[data-mcqp-theme="dark"] [data-view="dense"] .arc-cta { background: #2563eb; }
html[data-mcqp-theme="dark"] [data-view="dense"] .cbq-arc-card.is-today { background: rgba(37,99,235,.08); }

/* Empty state */
.cbq-archive-empty {
    text-align: center;
    padding: 80px 20px;
    background: var(--mcqp-surface, #fff);
    border: 1px dashed var(--mcqp-border, #e2e8f0);
    border-radius: 16px;
    color: var(--mcqp-text-muted, #64748b);
}
.cbq-archive-empty .icon { font-size: 56px; opacity: .35; margin-bottom: 12px; }
.cbq-archive-empty h3 {
    color: var(--mcqp-text, #0f172a);
    margin: 12px 0 6px; font-size: 18px; font-weight: 700;
}
html[data-mcqp-theme="dark"] .cbq-archive-empty {
    background: #121a32; border-color: #233056;
}
html[data-mcqp-theme="dark"] .cbq-archive-empty h3 { color: #f1f5f9; }
