/*
 * GenreDB — Archive Styles
 * Shared by: archive-project.php, taxonomy-book_tag.php,
 *            genredb-author-directory.php, genredb-following-feed.php
 * Enqueued via child theme functions.php
 */

@import url('https://fonts.googleapis.com/css2?family=Exo+2&display=swap');

/* ── Global background ── */
body {
    background: radial-gradient(circle at top left, #111827 0, #020617 48%, #020617 100%) fixed;
    background-color: #020617;
}

/* ── Shared page-hero tokens (available outside .projects-archive) ── */
:root {
    --gdb-green:        #4ade80;
    --gdb-muted-global: #94a3b8;

    /* Updates palette — used by update-archive.php and single update templates */
    --updates-bg:                #0c0e10;
    --updates-surface:           #14171c;
    --updates-surface-2:         #1b2027;
    --updates-text:              #f4f4f5;
    --updates-muted:             #a1a1aa;
    --updates-border:            rgba(255,255,255,0.08);
    --updates-accent:            #22c55e;
    --updates-pill-bg:           #1e252d;
    --updates-pill-project-bg:   rgba(129,140,248,0.18);
    --updates-pill-project-text: #e0e7ff;
    --updates-shadow:            0 18px 40px rgba(0,0,0,0.32);
}

/* ── Outer wrappers — consistent page padding across all directory pages ── */
.gdb-feed-wrap,
.genredb-author-directory {
    padding: 3rem 1.25rem 4rem;
    min-height: 100vh;
    max-width: 1280px;
    margin: 0 auto;
}

/* Cancel the hero's own padding-top when it sits inside the outer wrapper
   (the wrapper's 3rem padding already provides the same top spacing as Books) */
.gdb-feed-wrap > .gdb-page-hero,
.genredb-author-directory > .gdb-page-hero {
    padding-top: 0;
}

@media (max-width: 780px) {
    .gdb-feed-wrap,
    .genredb-author-directory {
        padding-inline: 1rem;
    }
}

/* Hero block used on Books, Authors, My Feed, and any future directory page */
.gdb-page-hero {
    padding: 2.5rem 0 2rem;
}

.gdb-page-hero__eyebrow,
.projects-archive__eyebrow,
.updates-archive__eyebrow {
    margin: 0 0 0.5rem;
    color: #4ade80;
    font-size: 0.8rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.gdb-page-hero__title,
.projects-archive__title,
.updates-archive__title {
    margin: 0 0 0.65rem;
    font-family: "Exo 2", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 400;
    line-height: 0.96;
    color: #f3f4f6;
}

.gdb-page-hero__description,
.projects-archive__description,
.updates-archive__description {
    margin: 0;
    max-width: 60ch;
    color: #94a3b8;
    font-size: 1.05rem;
    line-height: 1.6;
}

@media (max-width: 560px) {
    .gdb-page-hero { padding: 1.5rem 0 1.25rem; }
    .gdb-page-hero__title { line-height: 1; }
}

.projects-archive {
    --bg: #111315;
    --surface: #181b1f;
    --surface-2: #20242a;
    --text: #f3f4f6;
    --muted: #a6adb8;
    --border: rgba(255,255,255,0.08);
    --accent: #8b5cf6;
    --accent-2: #22c55e;
    --pill-bg: #1d2127;
    --pill-active-bg: #f3f4f6;
    --pill-active-text: #111315;
    --shadow: 0 18px 40px rgba(0,0,0,0.28);
    /* background intentionally removed — inherits global body gradient */
    color: var(--text);
    min-height: 100vh;
    padding: 3rem 1.25rem 4rem;
}

.projects-archive__inner {
    max-width: 1280px;
    margin: 0 auto;
}

.projects-archive__header {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.projects-archive__eyebrow {
    margin: 0 0 0.4rem;
    color: var(--accent-2);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}


.projects-archive__description {
    margin: 0.75rem 0 0;
    max-width: 60ch;
    color: var(--muted);
    font-size: 1.05rem;
}

.projects-toolbar {
    display: grid;
    gap: 0.85rem;
    align-items: start;
}

.projects-toolbar__search input {
    width: 100%;
    max-width: 440px;
    padding: 0.95rem 1rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: 1rem;
}

.projects-toolbar__search input::placeholder {
    color: var(--muted);
}

.projects-toolbar__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
}

.projects-toolbar__sort,
.projects-filters__group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.projects-toolbar__label,
.projects-filters__label {
    color: var(--muted);
    font-size: 0.9rem;
    margin-right: 0.25rem;
}

.projects-toolbar__filters-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.72rem 1rem;
    border-radius: 999px !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    cursor: pointer;
    font-size: 0.95rem;
    transition: 180ms ease;
    box-shadow: none !important;
}

.projects-toolbar__filters-toggle:hover,
.projects-toolbar__filters-toggle:focus-visible {
    border-color: rgba(255,255,255,0.18) !important;
    color: var(--text) !important;
    background: var(--surface) !important;
    transform: translateY(-1px);
    outline: none;
}

.projects-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.projects-active-filter {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
}

.projects-active-filter--static {
    cursor: default;
}

.projects-active-filter--clear {
    color: var(--muted);
    border-style: dashed;
}

/* ── Filter side drawer ─────────────────────────────────── */
.projects-filters-overlay {
    display: none;
    position: fixed !important;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 99998 !important;
    backdrop-filter: blur(2px);
}
.projects-filters-overlay.is-open {
    display: block;
}

.projects-filters {
    position: fixed !important;
    top: 0 !important;
    right: -500px !important;
    bottom: 0 !important;
    left: auto !important;
    width: min(420px, 92vw) !important;
    z-index: 99999 !important;
    background: #0f1117 !important;
    border-left: 1px solid rgba(255,255,255,0.08);
    display: flex !important;
    flex-direction: column;
    transition: right 300ms cubic-bezier(0.4,0,0.2,1);
    overflow-y: auto;
    padding: 1.5rem 1.25rem 2rem;
    gap: 1.25rem;
    margin: 0 !important;
}

.projects-filters.is-open {
    right: 0 !important;
}

.projects-filters__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}

.projects-filters__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f3f4f6;
    margin: 0;
    letter-spacing: 0.02em;
}

.projects-filters__close {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.35rem;
    line-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 140ms, color 140ms;
}
.projects-filters__close:hover { background: rgba(255,255,255,0.12); color: #f3f4f6; }

.projects-filters__group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.projects-filters__label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6b7280;
}

.projects-filters__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.projects-filter-chip {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    color: #d1d5db;
    padding: 0.4rem 0.85rem;
    font-size: 0.83rem;
    cursor: pointer;
    transition: background 140ms, border-color 140ms, color 140ms;
    line-height: 1.4;
}
.projects-filter-chip:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.25);
    color: #f9fafb;
}
.projects-filter-chip.is-active {
    background: rgba(139,92,246,0.2);
    border-color: #8b5cf6;
    color: #c4b5fd;
}

.projects-filters__footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.07);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.projects-filters__apply {
    flex: 1;
    background: #7c3aed;
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.7rem 1rem;
    cursor: pointer;
    transition: background 140ms;
}
.projects-filters__apply:hover { background: #6d28d9; }

.projects-filters__clear {
    font-size: 0.82rem;
    color: #6b7280;
    text-decoration: none;
    white-space: nowrap;
    transition: color 140ms;
}
.projects-filters__clear:hover { color: #9ca3af; }

.projects-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.72rem 1rem;
    border-radius: 999px;
    background: var(--pill-bg);
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    line-height: 1;
    font-size: 0.9rem;
    transition: 180ms ease;
}

.projects-pill:hover,
.projects-pill:focus-visible {
    border-color: rgba(255,255,255,0.18);
    transform: translateY(-1px);
    outline: none;
}

.projects-pill.is-active {
    background: var(--pill-active-bg);
    color: var(--pill-active-text);
    border-color: transparent;
}

.projects-pill--clear {
    background: transparent;
    color: var(--muted);
    border-style: dashed;
}

.projects-results__topline {
    margin-bottom: 1rem;
}

.projects-results__count {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
}

.project-card {
    min-width: 0;
    position: relative;
}

/* ── Card shelf bookmark ── */
.project-card__shelf {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    z-index: 10;
}

/* Full reset + explicit styles — scoped to beat theme button overrides */
.project-card__shelf .project-card__shelf-btn {
    -webkit-appearance: none;
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50% !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
    background: rgba(10,12,18,0.75) !important;
    color: #94a3b8 !important;
    cursor: pointer;
    backdrop-filter: blur(8px);
    padding: 0;
    margin: 0;
    box-shadow: none !important;
    outline: none;
    transition: color 140ms ease, background 140ms ease, border-color 140ms ease, transform 140ms ease, opacity 140ms ease;
    opacity: 0;
    visibility: hidden;
    line-height: 1;
    text-transform: none;
    letter-spacing: normal;
}

.project-card:hover .project-card__shelf .project-card__shelf-btn,
.project-card__shelf.has-shelf .project-card__shelf-btn {
    opacity: 1;
    visibility: visible;
}

.project-card__shelf .project-card__shelf-btn:hover {
    transform: scale(1.1);
    background: rgba(10,12,18,0.92) !important;
    border-color: rgba(74,222,128,0.4) !important;
    color: #4ade80 !important;
}

.project-card__shelf.has-shelf .project-card__shelf-btn {
    color: #4ade80 !important;
    border-color: rgba(74,222,128,0.35) !important;
    background: rgba(10,12,18,0.85) !important;
}

.project-card__shelf-icon { width: 15px; height: 15px; display: block; flex-shrink: 0; }
.project-card__shelf-icon--filled { display: none; }
.project-card__shelf.has-shelf .project-card__shelf-icon--outline { display: none; }
.project-card__shelf.has-shelf .project-card__shelf-icon--filled  { display: block; }

/* ── Card shelf popover ── */
.project-card__shelf-popover {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    width: 130px;
    background: rgba(15,18,26,0.97) !important;
    border: 1px solid rgba(148,163,184,0.14) !important;
    border-radius: 12px;
    backdrop-filter: blur(16px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.5);
    padding: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.project-card__shelf-popover[hidden] { display: none !important; }

.project-card__shelf-popover .project-card__shelf-option {
    -webkit-appearance: none;
    appearance: none;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.4rem 0.6rem;
    border-radius: 8px !important;
    border: none !important;
    background: transparent !important;
    color: #94a3b8 !important;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    box-shadow: none !important;
    outline: none;
    margin: 0;
    line-height: 1.4;
    transition: background 120ms ease, color 120ms ease;
}

.project-card__shelf-popover .project-card__shelf-option:hover {
    background: rgba(148,163,184,0.1) !important;
    color: #e2e8f0 !important;
}

.project-card__shelf-popover .project-card__shelf-option.is-active {
    background: rgba(74,222,128,0.12) !important;
    color: #4ade80 !important;
}

.project-card__shelf-popover .project-card__shelf-option.is-active:hover {
    background: rgba(248,113,113,0.1) !important;
    color: #f87171 !important;
}

/* ── Card shelf logged-out prompt ── */
.project-card__shelf-prompt-text {
    margin: 0.3rem 0.6rem 0.4rem;
    font-size: 0.75rem;
    color: #94a3b8;
}

.project-card__shelf-prompt-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    margin: 0.15rem 0.35rem;
    transition: opacity 140ms ease;
}

.project-card__shelf-prompt-btn:hover { opacity: 0.85; }

.project-card__shelf-prompt-btn--primary {
    background: #4ade80;
    color: #052e16;
}

.project-card__shelf-prompt-btn--ghost {
    background: transparent;
    color: #94a3b8;
    border: 1px solid rgba(255,255,255,0.1);
}

.project-card__link {
    display: block;
    height: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow);
    transition: transform 180ms ease, border-color 180ms ease;
}

.project-card__link:hover,
.project-card__link:focus-visible {
    transform: translateY(-4px);
    border-color: rgba(255,255,255,0.18);
    outline: none;
}

.project-card__media {
    aspect-ratio: 2 / 3;
    background: var(--surface-2);
    overflow: hidden;
}

.project-card__image,
.project-card__placeholder {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.project-card__placeholder {
    background:
        linear-gradient(135deg, rgba(139,92,246,0.18), rgba(34,197,94,0.12)),
        var(--surface-2);
}

.project-card__body {
    padding: 1rem;
}

.project-card__title {
    margin: 0 0 0.75rem;
    font-size: 1.15rem;
    line-height: 1.15;
}

.project-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}

.project-card__tag {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    color: var(--muted);
    font-size: 0.8rem;
}

.project-card__tag--accent {
    background: rgba(139,92,246,0.16);
    color: #ddd6fe;
}

.project-card__tag--intensity {
    background: rgba(34,197,94,0.15);
    color: #bbf7d0;
}

.project-card__tag--booktag {
    background: rgba(20,184,166,0.12);
    color: #5eead4;
}

.project-card__author {
    margin: 0 0 0.5rem;
    font-size: 0.82rem;
    color: var(--muted);
}

.project-card__excerpt {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.55;
}

.projects-pagination {
    margin-top: 2.5rem;
}

.projects-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
    margin: 0 0.3rem 0.3rem 0;
    padding: 0.7rem 0.9rem;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
}

.projects-pagination .page-numbers.current {
    background: var(--pill-active-bg);
    color: var(--pill-active-text);
    border-color: transparent;
}

.projects-empty {
    padding: 3rem 1rem;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--surface);
}

.projects-empty h2 {
    margin: 0 0 0.5rem;
}

.projects-empty p {
    margin: 0;
    color: var(--muted);
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 1100px) {
    .projects-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 780px) {
    .projects-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .projects-archive {
        padding-inline: 1rem;
    }
    .projects-toolbar__row {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 560px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
    .projects-archive__title {
        line-height: 1;
    }
    .projects-toolbar__search input {
        max-width: none;
    }
}

/* ═══════════════════════════════════════════════
   Updates Archive  (archive-update.php)
   ═══════════════════════════════════════════════ */

.updates-archive {
    color: var(--updates-text);
    min-height: 100vh;
    padding: 3rem 1.25rem 4rem;
}

.updates-archive__inner {
    max-width: 1280px;
    margin: 0 auto;
}

.updates-archive__hero {
    margin-bottom: 2.5rem;
    /* no extra padding — outer .updates-archive already handles horizontal spacing */
}

.updates-archive__body {
    margin-top: 1rem;
}

.updates-archive__topline {
    margin-bottom: 1rem;
}

.updates-archive__count {
    margin: 0;
    color: var(--updates-muted);
    font-size: 0.95rem;
}

.updates-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.35rem;
}

.update-card {
    min-width: 0;
}

.update-card__link {
    display: block;
    height: 100%;
    padding: 1.1rem 1.05rem 1.2rem;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(24,27,31,0.96), rgba(15,23,42,0.94));
    border: 1px solid var(--updates-border);
    text-decoration: none;
    color: inherit;
    box-shadow: var(--updates-shadow);
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.update-card__link:hover,
.update-card__link:focus-visible {
    transform: translateY(-3px);
    border-color: rgba(255,255,255,0.16);
    box-shadow: 0 24px 60px rgba(0,0,0,0.45);
    outline: none;
}

.update-card__meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.7rem;
}

.update-card__pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: var(--updates-pill-bg);
    color: var(--updates-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.update-card__date {
    color: var(--updates-muted);
    font-size: 0.85rem;
}

.update-card__title {
    margin: 0 0 0.7rem;
    font-size: 1.15rem;
    line-height: 1.2;
}

.update-card__project {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.update-card__project-label {
    color: var(--updates-muted);
    font-size: 0.85rem;
}

.update-card__project-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: var(--updates-pill-project-bg);
    color: var(--updates-pill-project-text);
    font-size: 0.82rem;
    text-decoration: none;
}

.update-card__excerpt {
    color: var(--updates-muted);
    font-size: 0.96rem;
    line-height: 1.6;
}

.updates-pagination {
    margin-top: 2.5rem;
}

.updates-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
    margin: 0 0.3rem 0.3rem 0;
    padding: 0.68rem 0.9rem;
    border-radius: 999px;
    background: var(--updates-surface);
    border: 1px solid var(--updates-border);
    color: var(--updates-text);
    text-decoration: none;
    font-size: 0.95rem;
}

.updates-pagination .page-numbers.current {
    background: #f4f4f5;
    color: #020617;
    border-color: transparent;
}

.updates-empty {
    margin-top: 2.5rem;
    padding: 2rem 1.25rem;
    border-radius: 20px;
    background: var(--updates-surface);
    border: 1px solid var(--updates-border);
}

.updates-empty h2 {
    margin: 0 0 0.5rem;
}

.updates-empty p {
    margin: 0;
    color: var(--updates-muted);
}

@media (max-width: 1100px) {
    .updates-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .updates-archive {
        padding-inline: 1rem;
        padding-top: 3rem;
    }
    .updates-grid {
        grid-template-columns: 1fr;
    }
    .updates-archive__hero {
        padding-inline: 0.25rem;
    }
    .update-card__link {
        padding-inline: 1rem;
    }
}


/* ── First Edition badge + halo ─────────────────────────────────── */

/* Wrapper: fixed square matching avatar size so halo centers perfectly */
.genredb-author-card__avatar--first-ed {
    position: relative;
    display: inline-block;
    width: 88px;
    height: 88px;
    flex-shrink: 0;
}

.genredb-author-avatar-wrap {
    position: relative;
    display: inline-block;
    width: 112px;
    height: 112px;
    flex-shrink: 0;
}

/* Animated aurora halo ring */
.genredb-first-ed-halo {
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        #f59e0b,
        #fbbf24,
        #a78bfa,
        #818cf8,
        #34d399,
        #fbbf24,
        #f59e0b
    );
    animation: genredb-halo-spin 4s linear infinite;
    z-index: 0;
    filter: blur(1.5px);
    opacity: 0.9;
}

/* Mask the inside so only the ring shows */
.genredb-first-ed-halo::after {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: #0f1624;
}

@keyframes genredb-halo-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Keep avatar image above the halo layer */
.genredb-author-card__avatar-image,
.genredb-author-avatar {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    border-radius: 999px !important;
    object-fit: cover;
    display: block;
}

/* Star badge */
.genredb-first-ed-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    z-index: 2;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px #0f1624, 0 0 8px rgba(245,158,11,0.6);
    color: #fff;
    cursor: default;
}

.genredb-first-ed-badge svg {
    width: 11px;
    height: 11px;
    display: block;
    flex-shrink: 0;
}

/* Tooltip on hover */
.genredb-first-ed-badge::after {
    content: 'First Edition';
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15,18,26,0.97);
    color: #fbbf24;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    border: 1px solid rgba(245,158,11,0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 150ms ease;
}

.genredb-first-ed-badge:hover::after {
    opacity: 1;
}

/* Profile page badge sizing */
.genredb-author-avatar-wrap--first-ed .genredb-first-ed-halo {
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
}

.genredb-author-avatar-wrap--first-ed .genredb-first-ed-badge {
    width: 28px;
    height: 28px;
    bottom: 2px;
    right: 2px;
    box-shadow: 0 0 0 3px #0f1624, 0 0 12px rgba(245,158,11,0.7);
}

.genredb-author-avatar-wrap--first-ed .genredb-first-ed-badge svg {
    width: 14px;
    height: 14px;
}

/* Mobile: shrink wrapper to match 72px avatar size */
@media (max-width: 767px) {
    .genredb-author-card__avatar--first-ed {
        width: 72px;
        height: 72px;
    }

    /* Profile page: shrink avatar-wrap to match 84px mobile avatar */
    .genredb-author-avatar-wrap {
        width: 84px;
        height: 84px;
    }
}
