/* =============================================================
   Condia Quiz UI — quiz-ui.css
   Mobile-first. Brand accent: #77F2A1
   Dark mode: html[data-theme="dark"], body.dark
   ============================================================= */

/* ---- CSS variables (light mode defaults) ------------------ */
:root {
    --cq-card-bg: #ffffff;
    --cq-card-border: #e5e7eb;
    --cq-card-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
    --cq-header-border: #f0f2f5;
    --cq-dot-idle: #e5e7eb;
    --cq-text-muted: #444;
    --cq-text-faint: #999;
    --cq-option-border: #d1d5db;
    --cq-option-pct: #555;
    --cq-letter-bg: #f3f4f6;
    --cq-letter-color: #555;
    --cq-explanation-bg: #f9fafb;
    --cq-ring-track: #e5e7eb;
    --cq-score-num: #111;
    --cq-source-color: #111;
    --cq-source-muted: #777;
    --cq-share-copy-bg: #f3f4f6;
    --cq-share-copy-color: #111;
    --cq-share-copy-border: #d1d5db;
    --cq-related-card-bg: #ffffff;
    --cq-related-card-border: #e5e7eb;
    --cq-related-meta: #888;
    --cq-archive-card-bg: #ffffff;
    --cq-archive-card-border: #e5e7eb;
    --cq-archive-footer-border: #f0f0f0;
    --cq-archive-meta: #999;
    --cq-archive-cta: #111;
    --cq-filter-border: #e5e7eb;
    --cq-filter-color: #444;
    --cq-pagination-border: #e5e7eb;
    --cq-pagination-color: #444;
    --cq-embed-bg: #ffffff;
    --cq-embed-border: #e5e7eb;
    --cq-embed-header-border: #f0f2f5;
    --cq-embed-footer-bg: #f9fafb;
    --cq-embed-footer-border: #f0f2f5;
    --cq-embed-meta: #888;
}

/* ---- Dark mode variable overrides ------------------------- */
html[data-theme="dark"],
body.dark {
    --cq-card-bg: #1e2b38;
    --cq-card-border: #334558;
    --cq-card-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
    --cq-header-border: #253040;
    --cq-dot-idle: #2d3f52;
    --cq-text-muted: #9aabb8;
    --cq-text-faint: #4e6070;
    --cq-option-border: #2d3f52;
    --cq-option-pct: #7a8b98;
    --cq-letter-bg: #253040;
    --cq-letter-color: #9aabb8;
    --cq-explanation-bg: #192430;
    --cq-ring-track: #253040;
    --cq-score-num: #e4ecf2;
    --cq-source-color: #c8d8e4;
    --cq-source-muted: #4e6070;
    --cq-share-copy-bg: #253040;
    --cq-share-copy-color: #c8d8e4;
    --cq-share-copy-border: #334558;
    --cq-related-card-bg: #1e2b38;
    --cq-related-card-border: #334558;
    --cq-related-meta: #4e6070;
    --cq-archive-card-bg: #1e2b38;
    --cq-archive-card-border: #334558;
    --cq-archive-footer-border: #253040;
    --cq-archive-meta: #4e6070;
    --cq-archive-cta: #c8d8e4;
    --cq-filter-border: #2d3f52;
    --cq-filter-color: #7a8b98;
    --cq-pagination-border: #2d3f52;
    --cq-pagination-color: #7a8b98;
    --cq-embed-bg: #1e2b38;
    --cq-embed-border: #334558;
    --cq-embed-header-border: #253040;
    --cq-embed-footer-bg: #192430;
    --cq-embed-footer-border: #253040;
    --cq-embed-meta: #4e6070;
}

/* ---- Standalone quiz header (logo only) ------------------- */
.cq-standalone-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--cq-card-border);
}

.cq-standalone-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.cq-standalone-logo img {
    display: block;
    height: 36px;
    width: auto;
    object-fit: contain;
}

body.cq-standalone .section-featured,
body.cq-standalone .section-main-content {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* ---- Reset / base ----------------------------------------- */
.cq-wrap *,
.cq-wrap *::before,
.cq-wrap *::after {
    box-sizing: border-box;
}

/* ---- Page layout ------------------------------------------ */
.cq-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

.cq-label-badge {
    display: inline-block;
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #111;
    background: #77F2A1;
    border-radius: 4px;
    padding: 3px 10px;
    margin-bottom: 14px;
}

.cq-title {
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 16px;
    color: inherit;
}

.cq-intro {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--cq-text-muted);
    margin-bottom: 28px;
}

/* ---- Card -------------------------------------------------- */
.cq-card {
    background: var(--cq-card-bg);
    border: 1px solid var(--cq-card-border);
    border-radius: 16px;
    box-shadow: var(--cq-card-shadow);
    overflow: hidden;
    position: relative;
}

/* ---- Card header with step dots --------------------------- */
.cq-card-header {
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--cq-header-border);
}

@media (min-width: 480px) {
    .cq-card-header {
        padding: 12px 32px;
    }
}

.cq-step-dots {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.cq-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--cq-dot-idle);
    transition: background 0.25s, transform 0.25s, width 0.25s;
    flex-shrink: 0;
}

.cq-dot.cq-dot-done {
    background: #77F2A1;
}

.cq-dot.cq-dot-active {
    background: #77F2A1;
    width: 20px;
    border-radius: 4px;
    transform: scaleY(1.1);
}

/* ---- Question panel --------------------------------------- */
.cq-panel {
    padding: 20px 20px 28px;
}

@media (min-width: 480px) {
    .cq-panel {
        padding: 28px 32px 36px;
    }
}

.cq-question-wrap {
    position: relative;
}

.cq-q-counter {
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--cq-text-faint);
    margin: 0 0 12px;
}

/* ---- Question slide-in animation -------------------------- */
.cq-question-slide {
    animation: cqSlideIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes cqSlideIn {
    from {
        opacity: 0;
        transform: translateX(32px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cq-question-text {
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: clamp(1rem, 2.5vw, 1.18rem);
    font-weight: 700;
    line-height: 1.45;
    margin: 0 0 22px;
    color: inherit;
}

/* ---- Options ---------------------------------------------- */
.cq-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.cq-option {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 13px 16px;
    background: transparent;
    border: 2px solid var(--cq-option-border);
    border-radius: 10px;
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    color: inherit;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
    overflow: hidden;
    z-index: 0;
    min-height: 52px;
    -webkit-tap-highlight-color: transparent;
}

.cq-option:hover:not(:disabled) {
    border-color: #77F2A1;
    background: rgba(119, 242, 161, 0.06);
}

.cq-option:active:not(:disabled) {
    transform: scale(0.98);
}

.cq-option:disabled {
    cursor: default;
}

/* Distribution bar (fills behind option text) */
.cq-option-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    z-index: -1;
    border-radius: 8px;
    transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.cq-option-bar.cq-bar-correct { background: #22c55e; opacity: 0.18; }
.cq-option-bar.cq-bar-wrong   { background: #ef4444; opacity: 0.15; }
.cq-option-bar.cq-bar-neutral { background: #9ca3af; opacity: 0.12; }

/* State: correct */
.cq-option.cq-opt-correct {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.07);
}

/* State: wrong */
.cq-option.cq-opt-wrong {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.06);
}

/* State: other (not chosen, not correct) */
.cq-option.cq-opt-other {
    border-color: var(--cq-option-border);
    opacity: 0.7;
}

/* Option letter badge */
.cq-option-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: var(--cq-letter-bg);
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--cq-letter-color);
    flex-shrink: 0;
    margin-right: 12px;
    transition: background 0.15s, color 0.15s;
}

.cq-opt-correct .cq-option-letter {
    background: #22c55e;
    color: #fff;
}

.cq-opt-wrong .cq-option-letter {
    background: #ef4444;
    color: #fff;
}

.cq-option-text {
    flex: 1;
    line-height: 1.4;
}

.cq-option-pct {
    margin-left: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--cq-option-pct);
    flex-shrink: 0;
    min-width: 34px;
    text-align: right;
    opacity: 0;
    transition: opacity 0.4s ease 0.3s;
}

.cq-option-pct.cq-pct-visible {
    opacity: 1;
}

/* ---- Ripple ----------------------------------------------- */
.cq-ripple {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(119, 242, 161, 0.45);
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
    animation: cqRipple 0.6s ease forwards;
}

@keyframes cqRipple {
    to {
        transform: translate(-50%, -50%) scale(18);
        opacity: 0;
    }
}

/* ---- Wrong answer shake ----------------------------------- */
.cq-anim-shake {
    animation: cqShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes cqShake {
    10%, 90%  { transform: translateX(-2px); }
    20%, 80%  { transform: translateX(4px); }
    30%, 50%, 70% { transform: translateX(-5px); }
    40%, 60%  { transform: translateX(5px); }
    100%      { transform: translateX(0); }
}

/* ---- Correct answer bounce -------------------------------- */
.cq-anim-bounce {
    animation: cqBounce 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes cqBounce {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.04); }
    55%  { transform: scale(0.97); }
    75%  { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* ---- Explanation ------------------------------------------ */
.cq-explanation {
    display: none;
    margin-top: 8px;
    padding: 13px 16px;
    background: var(--cq-explanation-bg);
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--cq-text-muted);
    animation: cqFadeUp 0.3s ease forwards;
}

.cq-explanation.cq-exp-visible {
    display: block;
}

@keyframes cqFadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- Next / Results button --------------------------------- */
.cq-next-btn {
    display: none;
    margin-top: 22px;
    padding: 13px 28px;
    background: #77F2A1;
    color: #111;
    border: none;
    border-radius: 10px;
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.12s;
    letter-spacing: 0.01em;
    -webkit-tap-highlight-color: transparent;
}

.cq-next-btn.cq-btn-visible {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    animation: cqFadeUp 0.3s ease forwards;
}

.cq-next-btn:hover {
    background: #5de08a;
    transform: translateY(-1px);
}

.cq-next-btn:active {
    transform: translateY(0) scale(0.97);
}

/* ---- Streak toast ----------------------------------------- */
.cq-streak-toast {
    position: absolute;
    top: 14px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    background: #111;
    color: #77F2A1;
    border-radius: 999px;
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 50;
    white-space: nowrap;
}

.cq-streak-toast.cq-toast-show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ---- Results screen --------------------------------------- */
.cq-results {
    display: none;
    padding: 32px 20px 28px;
    text-align: center;
    animation: cqFadeUp 0.4s ease;
}

@media (min-width: 480px) {
    .cq-results {
        padding: 40px 40px 36px;
    }
}

.cq-results.cq-results-visible {
    display: block;
}

/* ---- Score ring ------------------------------------------- */
.cq-score-circle-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.cq-score-ring {
    transform: rotate(-90deg);
    display: block;
}

.cq-ring-track {
    stroke: var(--cq-ring-track);
}

.cq-ring-fill {
    stroke: #77F2A1;
    stroke-linecap: round;
}

.cq-score-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.cq-score-num {
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: clamp(1.4rem, 5vw, 1.9rem);
    font-weight: 900;
    color: var(--cq-score-num);
    line-height: 1;
}

.cq-score-sub {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--cq-text-faint);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ---- Grade label ------------------------------------------ */
.cq-grade-label {
    display: inline-block;
    padding: 5px 18px;
    border-radius: 999px;
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.cq-grade-perfect   { background: #fef08a; color: #713f12; }
.cq-grade-excellent { background: #bbf7d0; color: #14532d; }
.cq-grade-good      { background: #d1fae5; color: #065f46; }
.cq-grade-fair      { background: #fef3c7; color: #92400e; }
.cq-grade-tricky    { background: #fee2e2; color: #991b1b; }

.cq-score-message {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 26px;
    color: inherit;
    line-height: 1.5;
}

/* ---- Share row -------------------------------------------- */
.cq-share-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.cq-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px 22px;
    border-radius: 10px;
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: transform 0.12s, opacity 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.cq-share-btn:hover  { transform: translateY(-1px); opacity: 0.9; }
.cq-share-btn:active { transform: scale(0.97); }

.cq-share-whatsapp {
    background: #25D366;
    color: #fff;
}

.cq-share-twitter {
    background: #000;
    color: #fff;
}

.cq-share-facebook {
    background: #1877F2;
    color: #fff;
}

.cq-share-copy {
    background: var(--cq-share-copy-bg);
    color: var(--cq-share-copy-color);
    border: 1px solid var(--cq-share-copy-border);
}

/* ---- Subtle page-level share bar --------------------------------- */

.cq-page-share-wrap {
    margin-top: 2rem;
    text-align: center;
}

@media (min-width: 640px) {
    .cq-page-share-wrap {
        margin-top: 3.5rem;
    }
}

.cq-page-share-cta {
    font-size: 0.85rem;
    color: #9ca3af;
    margin-bottom: 0.6rem;
}

.cq-page-share-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 1.25rem;
}

.cq-page-share-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
    font-weight: 600;
}

.cq-page-share-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f3f4f6;
    color: #6b7280;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.cq-page-share-icon:hover {
    background: #1F2B37;
    color: #77F2A1;
}

@media (max-width: 479px) {
    .cq-share-row {
        flex-direction: column;
        gap: 8px;
    }
    .cq-share-btn {
        width: 100%;
    }
}

.cq-copy-feedback {
    font-size: 0.8rem;
    color: #22c55e;
    height: 1.2em;
    margin-top: -6px;
    margin-bottom: 8px;
    transition: opacity 0.3s;
}

/* ---- Source links ----------------------------------------- */
.cq-source-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cq-source-color);
    text-decoration: none;
    border-bottom: 2px solid #77F2A1;
    padding-bottom: 1px;
    transition: color 0.15s;
}

.cq-source-link:hover { color: #16a34a; }

.cq-source-before {
    font-size: 0.875rem;
    color: var(--cq-source-muted);
    margin-bottom: 20px;
}

.cq-source-article-link {
    font-weight: 600;
    color: var(--cq-source-color);
    text-decoration: none;
    border-bottom: 1px solid #77F2A1;
    transition: color 0.15s;
}

.cq-source-article-link:hover { color: #16a34a; }

.cq-source-article {
    margin-top: 24px;
    text-align: center;
}

.cq-source-article a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--cq-source-color);
    text-decoration: none;
    border-bottom: 2px solid #77F2A1;
    padding-bottom: 1px;
}

.cq-source-article a:hover { color: #16a34a; }

/* =============================================================
   Answer review summary (end of quiz)
   ============================================================= */
.cq-summary {
    margin-top: 28px;
    text-align: left;
    border-top: 1px solid var(--cq-card-border);
    padding-top: 24px;
}

.cq-summary-title {
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--cq-text-faint);
    margin: 0 0 16px;
}

.cq-summary-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 10px;
    animation: cqFadeUp 0.3s ease forwards;
}

.cq-sum-pass {
    background: rgba(34, 197, 94, 0.06);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.cq-sum-fail {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.18);
}

.cq-summary-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.cq-summary-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 900;
    flex-shrink: 0;
    margin-top: 1px;
}

.cq-sum-badge-pass {
    background: #22c55e;
    color: #fff;
}

.cq-sum-badge-fail {
    background: #ef4444;
    color: #fff;
}

.cq-summary-q {
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
    color: inherit;
    flex: 1;
}

.cq-summary-answers {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 30px;
    font-size: 0.82rem;
    line-height: 1.4;
}

.cq-sum-chosen-pass {
    color: #16a34a;
}

.cq-sum-chosen-fail {
    color: #dc2626;
    text-decoration: line-through;
    opacity: 0.75;
}

.cq-summary-correct {
    color: #16a34a;
    font-weight: 600;
}

.cq-summary-exp {
    padding-left: 30px;
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--cq-text-muted);
    margin: 0;
    font-style: italic;
}

/* ---- Review Answers toggle --------------------------------- */
.cq-review-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0 0 18px;
    padding: 12px 20px;
    background: transparent;
    border: 2px solid var(--cq-card-border);
    border-radius: 10px;
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.cq-review-toggle:hover,
.cq-review-toggle.cq-review-open {
    border-color: #77F2A1;
    background: rgba(119, 242, 161, 0.06);
}

/* ---- Retake Quiz button ------------------------------------ */
.cq-retake-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 10px;
    padding: 12px 20px;
    background: transparent;
    border: 2px solid var(--cq-card-border);
    border-radius: 10px;
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.cq-retake-btn:hover {
    border-color: #77F2A1;
    background: rgba(119, 242, 161, 0.06);
}

/* "Read the full article" button — always green */
.cq-source-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 10px;
    padding: 13px 20px;
    background: #77F2A1;
    color: #111;
    border: 1px solid #77F2A1;
    border-radius: 10px;
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.cq-source-btn:hover {
    background: #5de08a;
    border-color: #5de08a;
    color: #111;
}

/* Dark mode adjustments for summary */
html[data-theme="dark"],
body.dark {
    /* Extends existing dark variable block — no extra selectors needed */
}

html[data-theme="dark"] .cq-sum-pass,
body.dark .cq-sum-pass {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.25);
}

html[data-theme="dark"] .cq-sum-fail,
body.dark .cq-sum-fail {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.22);
}

/* =============================================================
   Embed widget (shortcode in articles)
   ============================================================= */
.cq-embed-wrap {
    margin: 28px 0;
    background: var(--cq-embed-bg);
    border: 1px solid var(--cq-embed-border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.cq-embed-header {
    padding: 12px 20px;
    border-bottom: 1px solid var(--cq-embed-header-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cq-embed-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #111;
    background: #77F2A1;
    border-radius: 4px;
    padding: 4px 12px;
}

/* Quiz card inside embed: flush, no double border, no progress strip */
.cq-embed-wrap .cq-card {
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.cq-embed-wrap .cq-card-header {
    display: none;
}

.cq-embed-wrap .cq-panel {
    padding: 20px 20px 24px;
}

@media (min-width: 480px) {
    .cq-embed-wrap .cq-panel {
        padding: 22px 28px 28px;
    }
}

.cq-embed-wrap .cq-q-counter {
    display: none;
}

/* Slightly larger tap targets inside embeds for mobile */
.cq-embed-wrap .cq-option {
    min-height: 56px;
    padding: 14px 16px;
    font-size: 1rem;
}

.cq-embed-wrap .cq-question-text {
    font-size: clamp(1rem, 2.8vw, 1.15rem);
}

/* =============================================================
   Related quizzes
   ============================================================= */
.cq-related {
    padding: 40px 0 8px;
}

.cq-related-title {
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    margin: 0 0 18px;
}

.cq-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.cq-related-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--cq-related-card-bg);
    border: 1px solid var(--cq-related-card-border);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.cq-related-card:hover {
    border-color: #77F2A1;
    box-shadow: 0 4px 16px rgba(119, 242, 161, 0.15);
    transform: translateY(-2px);
}

.cq-related-card-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

.cq-related-card-thumb-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #0a0a0a 60%, #1a2a1a);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cq-related-card-thumb-placeholder span {
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    color: #77F2A1;
    text-transform: uppercase;
}

.cq-related-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #111;
    background: #77F2A1;
    border-radius: 3px;
    padding: 2px 7px;
    align-self: flex-start;
    margin: 14px 14px 6px;
}

.cq-related-card-title {
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 14px 6px;
}

.cq-related-meta {
    font-size: 0.8rem;
    color: var(--cq-related-meta);
    margin: auto 14px 14px;
}

/* =============================================================
   Quiz Archive
   ============================================================= */
.cq-archive-header {
    padding: 40px 0 0;
    text-align: center;
}

body.no-site-header .cq-archive-header {
    padding-top: 48px;
}

/* Strip any theme-level top margin/padding when there is no site header */
body.no-site-header .section-category {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.cq-archive-header h1 {
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 900;
    margin: 0 0 10px;
    line-height: 1.1;
}

.cq-archive-header p {
    font-size: 1rem;
    color: var(--cq-text-muted);
    margin: 0 0 28px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.cq-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--cq-filter-border);
    margin-bottom: 36px;
}

.cq-filter-tab {
    display: inline-block;
    padding: 7px 18px;
    border-radius: 999px;
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
    border: 2px solid var(--cq-filter-border);
    color: var(--cq-filter-color);
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.cq-filter-tab:hover {
    border-color: #77F2A1;
    color: inherit;
}

.cq-filter-tab.cq-tab-active {
    background: #77F2A1;
    border-color: #77F2A1;
    color: #111;
}

.cq-archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.cq-archive-card {
    display: flex;
    flex-direction: column;
    background: var(--cq-archive-card-bg);
    border: 1px solid var(--cq-archive-card-border);
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.cq-archive-card:hover {
    border-color: #77F2A1;
    box-shadow: 0 4px 20px rgba(119, 242, 161, 0.15);
    transform: translateY(-2px);
}

.cq-archive-card-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
    background: var(--cq-letter-bg);
}

.cq-archive-card-thumb-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #0a0a0a 60%, #1a2a1a);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cq-archive-card-thumb-placeholder span {
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    color: #77F2A1;
    text-transform: uppercase;
}

.cq-archive-card-body {
    padding: 16px 18px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
}

.cq-archive-card-type {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #111;
    background: #77F2A1;
    border-radius: 3px;
    padding: 2px 8px;
    align-self: flex-start;
}

.cq-archive-card-title {
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.3;
    color: inherit;
    margin: 0;
}


.cq-archive-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--cq-archive-footer-border);
}

.cq-archive-card-meta {
    font-size: 0.8rem;
    color: var(--cq-archive-meta);
}

.cq-archive-card-cta {
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--cq-archive-cta);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.cq-archive-empty {
    text-align: center;
    padding: 64px 24px;
    color: var(--cq-text-faint);
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 1rem;
}

.cq-archive-pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    padding-bottom: 48px;
    flex-wrap: wrap;
}

.cq-archive-pagination a,
.cq-archive-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 8px;
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid var(--cq-pagination-border);
    color: var(--cq-pagination-color);
    transition: border-color 0.15s, background 0.15s;
}

.cq-archive-pagination a:hover {
    border-color: #77F2A1;
    color: inherit;
}

.cq-archive-pagination .current {
    background: #77F2A1;
    border-color: #77F2A1;
    color: #111;
}

/* =============================================================
   Poll format — question screen
   ============================================================= */

/* Chosen option in poll: green border, no right/wrong colouring */
.cq-opt-poll-chosen {
    border-color: #77F2A1;
    background: rgba(119, 242, 161, 0.08);
}

.cq-opt-poll-chosen .cq-option-letter {
    background: #77F2A1;
    color: #111;
}

/* Distribution bar — chosen option */
.cq-option-bar.cq-bar-poll-chosen {
    background: #77F2A1;
    opacity: 0.32;
}

/* =============================================================
   Poll format — results screen header
   ============================================================= */
.cq-poll-results-head {
    text-align: center;
    padding-bottom: 24px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--cq-card-border);
}

.cq-poll-results-icon {
    font-size: 2.6rem;
    line-height: 1;
    margin-bottom: 12px;
}

.cq-poll-results-title {
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: clamp(1.15rem, 3vw, 1.45rem);
    font-weight: 800;
    line-height: 1.25;
    margin: 0 0 8px;
    color: inherit;
}

.cq-poll-results-sub {
    font-size: 0.9rem;
    color: var(--cq-text-muted);
    line-height: 1.5;
    margin: 0;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

/* =============================================================
   Poll format — answer summary
   ============================================================= */
.cq-poll-summary {
    margin-top: 24px;
    text-align: left;
}

.cq-poll-summary-item {
    padding: 20px 0;
    border-bottom: 1px solid var(--cq-card-border);
    animation: cqFadeUp 0.3s ease forwards;
}

.cq-poll-summary-item:last-child {
    border-bottom: none;
    padding-bottom: 4px;
}

.cq-poll-summary-q {
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 14px;
    color: inherit;
}

/* Each option row */
.cq-poll-sum-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    border-radius: 8px;
    padding: 6px 8px;
    margin-left: -8px;
    margin-right: -8px;
    transition: background 0.15s;
}

.cq-poll-sum-row:last-child {
    margin-bottom: 0;
}

/* Chosen row highlight */
.cq-poll-sum-chosen {
    background: rgba(119, 242, 161, 0.08);
}

/* Letter badge */
.cq-poll-sum-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--cq-letter-bg);
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--cq-letter-color);
    flex-shrink: 0;
    margin-top: 1px;
}

.cq-poll-sum-chosen .cq-poll-sum-letter {
    background: #77F2A1;
    color: #111;
}

/* Content column */
.cq-poll-sum-content {
    flex: 1;
    min-width: 0;
}

/* Top line: text + pct + "You" badge */
.cq-poll-sum-top {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.cq-poll-sum-text {
    flex: 1;
    font-size: 0.875rem;
    line-height: 1.4;
    color: inherit;
}

.cq-poll-sum-pct {
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 0.85rem;
    font-weight: 800;
    flex-shrink: 0;
    color: inherit;
}

.cq-poll-sum-you {
    display: inline-block;
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: #77F2A1;
    color: #111;
    border-radius: 999px;
    padding: 1px 7px;
    flex-shrink: 0;
    vertical-align: middle;
}

/* Progress bar */
.cq-poll-sum-bar-wrap {
    height: 6px;
    background: var(--cq-ring-track);
    border-radius: 999px;
    overflow: hidden;
}

.cq-poll-sum-bar {
    height: 100%;
    background: #9ca3af;
    border-radius: 999px;
    transition: width 0.75s cubic-bezier(0.4, 0, 0.2, 1);
}

.cq-poll-sum-bar.cq-poll-sum-bar-chosen {
    background: #77F2A1;
}

/* Dark mode adjustments */
html[data-theme="dark"] .cq-poll-sum-bar,
body.dark .cq-poll-sum-bar {
    background: #334558;
}

html[data-theme="dark"] .cq-poll-sum-bar.cq-poll-sum-bar-chosen,
body.dark .cq-poll-sum-bar.cq-poll-sum-bar-chosen {
    background: #77F2A1;
}
