/* Read-only reading-log detail embedded on the public profile (SP-3b).
   Reuses the public_profile.css shelfmark palette and site theme tokens. */

[x-cloak] { display: none !important; }

.pp-reading-log {
    --rp-accent: var(--pp-accent, #27706d);
    --rp-warm-2: var(--pp-warm-2, #f3efe7);
    --rp-ink: var(--pp-ink, #1e2b2e);
    --rp-muted: var(--pp-muted, #65716e);
    --rp-rule: var(--pp-rule, #d7d2c7);
    --rp-radius: var(--pp-radius, 8px);
    --rp-mono: var(--pp-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
    /* meaningful event colours — preserved */
    --rp-reading: var(--reading, #2e7d9b);
    --rp-completed: var(--completed, #3d7c47);
    --rp-rated: var(--rated, #c08b24);
    --rp-want: var(--want-to-read, #7c5bad);
    --rp-dnf: var(--dnf, #b85450);
    --rp-reread: var(--reread, #2e7d9b);
    --rp-serif: var(--pp-editorial, Georgia, 'Times New Roman', serif);
    padding: 0;
    color: var(--rp-ink);
}

.rp-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rp-head__avatar {
    display: inline-flex;
    flex: 0 0 auto;
}

.rp-status {
    padding: 1.25rem 0;
    color: var(--rp-muted);
    font-size: 0.95rem;
}

.rp-status--error {
    color: var(--accent-interest, #c0392b);
}

.rp-empty {
    color: var(--rp-muted);
    padding: 1.25rem 0;
}

/* Spotlight ------------------------------------------------------------- */
.rp-spotlight {
    margin-bottom: 1.5rem;
}

.rp-spotlight__title {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    color: var(--rp-ink);
}

.rp-spotlight__books {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.rp-spotlight__book {
    display: flex;
    gap: 0.85rem;
    padding: 0.75rem;
    background: var(--rp-warm-2);
    border: 1px solid var(--rp-rule);
    border-radius: var(--rp-radius);
}

.rp-spotlight__cover-wrap {
    flex: 0 0 auto;
    display: block;
    text-decoration: none;
}

.rp-spotlight__cover {
    width: 56px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: var(--radius-sm, 4px);
    background: var(--rp-warm-2);
    border: 1px solid var(--rp-rule);
    display: block;
}

.rp-spotlight__cover--ph {
    display: grid;
    place-items: center;
    color: var(--rp-accent);
}

.rp-spotlight__info {
    min-width: 0;
}

.rp-spotlight__book-title {
    font-weight: 650;
    line-height: 1.2;
    color: var(--rp-ink);
    overflow-wrap: anywhere;
}

.rp-spotlight__book-authors {
    margin-top: 0.2rem;
    font-size: 0.82rem;
    color: var(--rp-muted);
    overflow-wrap: anywhere;
}

.rp-spotlight__book-date {
    margin-top: 0.28rem;
    font-size: 0.78rem;
    color: var(--rp-muted);
}

/* Progress bar ---------------------------------------------------------- */
.rp-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.rp-progress__bar {
    flex: 1;
    height: 6px;
    border-radius: var(--radius-pill, 999px);
    background: var(--rp-rule);
    overflow: hidden;
}

.rp-progress__fill {
    height: 100%;
    background: var(--rp-accent);
}

.rp-progress__label {
    font-family: var(--rp-mono);
    font-size: 0.72rem;
    color: var(--rp-muted);
}

/* Sub-tabs -------------------------------------------------------------- */
.rp-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.5rem 0 1.25rem;
    border-bottom: 1px solid var(--rp-rule);
    padding-bottom: 0.75rem;
}

.rp-tab {
    font: inherit;
    cursor: pointer;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-pill, 999px);
    border: 1px solid var(--rp-rule);
    background: var(--surface, #fff);
    color: var(--rp-muted);
}

.rp-tab:hover {
    color: var(--rp-ink);
}

.rp-tab--active {
    background: var(--rp-accent);
    border-color: var(--rp-accent);
    color: #fff;
}

.rp-tab__count {
    font-family: var(--rp-mono);
    font-size: 0.75rem;
    opacity: 0.85;
}

/* Same idiom as the stats page's `.rl-tile__cap` "+ N single issues" caption
   (reading_log/web/static/css/stats.css): the Completed tab count is
   book-only, so a logged issue run gets its own quiet line instead of
   inflating it. */
.rp-issue-cap {
    opacity: 0.7;
    font-size: 0.8rem;
    margin: -0.9rem 0 1rem;
}

/* Book grid + cards ----------------------------------------------------- */
.rp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
}

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

.rp-card__cover-wrap {
    display: block;
    text-decoration: none;
}

.rp-card__cover {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: var(--rp-radius);
    background: var(--rp-warm-2);
    border: 1px solid var(--rp-rule);
    display: block;
}

.rp-card__cover--ph {
    display: grid;
    place-items: center;
    font-size: 2rem;
    color: var(--rp-accent);
}

.rp-card__title {
    margin-top: 0.5rem;
    font-weight: 650;
    line-height: 1.2;
    color: var(--rp-ink);
    overflow-wrap: anywhere;
}

.rp-card__authors,
.rp-card__series,
.rp-card__rating,
.rp-card__date {
    margin-top: 0.2rem;
    font-size: 0.8rem;
    color: var(--rp-muted);
    overflow-wrap: anywhere;
}

.rp-card__rating {
    color: var(--accent-upcoming, var(--rp-accent));
    font-weight: 600;
}

/* Timeline — Almanac-style grouped spine (ported from /log, profile-themed) -- */
.rp-timeline {
    display: flex;
    flex-direction: column;
}

.rp-tl-group { margin-bottom: 0.25rem; }

.rp-tl-date {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin: 1.4rem 0 0.85rem;
}

.rp-tl-date__label {
    font-family: var(--rp-serif);
    font-style: italic;
    font-weight: 500;
    font-size: 1.12rem;
    color: var(--rp-ink);
}

.rp-tl-date__line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--rp-rule), transparent);
}

.rp-tl-spine { position: relative; padding-left: 30px; }

.rp-tl-spine::before {
    content: "";
    position: absolute;
    left: 11px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: linear-gradient(var(--rp-rule), var(--rp-rule) 72%, transparent);
}

.rp-ev { position: relative; padding: 0.15rem 0 1rem; }

.rp-ev__node {
    position: absolute;
    left: -30px;
    top: 1px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    font-weight: 700;
    background: var(--rp-warm-2);
    border: 2px solid var(--rp-rule);
    color: var(--rp-muted);
    z-index: 1;
}

.rp-ev--started .rp-ev__node {
    color: var(--rp-reading);
    border-color: color-mix(in srgb, var(--rp-reading) 60%, var(--rp-rule));
}

.rp-ev--progress_updated .rp-ev__node {
    color: var(--rp-reading);
    border-color: color-mix(in srgb, var(--rp-reading) 45%, var(--rp-rule));
}

.rp-ev--added_backlog .rp-ev__node {
    color: var(--rp-want);
    border-color: color-mix(in srgb, var(--rp-want) 40%, var(--rp-rule));
}

.rp-ev--dnf .rp-ev__node {
    color: var(--rp-dnf);
    border-color: color-mix(in srgb, var(--rp-dnf) 45%, var(--rp-rule));
}

.rp-ev--reread .rp-ev__node {
    color: var(--rp-reread);
    border-color: color-mix(in srgb, var(--rp-reread) 50%, var(--rp-rule));
}
.rp-ev--rated .rp-ev__node {
    color: var(--rp-rated);
    border-color: color-mix(in srgb, var(--rp-rated) 45%, var(--rp-rule));
}

/* Finishes are the heroes: bigger, glowing node */
.rp-ev--completed .rp-ev__node {
    width: 30px;
    height: 30px;
    left: -33px;
    top: 0;
    font-size: 0.78rem;
    color: #fff;
    background: var(--rp-completed);
    border-color: var(--rp-completed);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--rp-completed) 18%, transparent);
}

/* Compact one-line row */
.rp-ev__row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 30px;
    color: var(--rp-ink);
    text-decoration: none;
}

.rp-ev__row:hover .rp-ev__verb b { color: var(--rp-accent); }

.rp-ev__thumb {
    width: 26px;
    height: 39px;
    border-radius: 3px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--rp-rule);
    background: var(--rp-warm-2);
}

.rp-ev__thumb--ph { display: grid; place-items: center; color: var(--rp-accent); }

.rp-ev__verb {
    font-size: 0.84rem;
    color: var(--rp-muted);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rp-ev__verb b { font-family: var(--rp-serif); font-weight: 600; color: var(--rp-ink); }
.rp-ev__act { color: var(--rp-muted); }

.rp-ev__rstars {
    color: var(--rp-rated);
    font-size: 0.8rem;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.rp-ev__time {
    margin-left: auto;
    font-family: var(--rp-mono);
    font-size: 0.66rem;
    color: var(--rp-muted);
    flex-shrink: 0;
}

/* Finish hero card */
.rp-ev__card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    background: linear-gradient(120deg,
        color-mix(in srgb, var(--rp-completed) 8%, var(--surface, #fbfaf5)), var(--surface, #fbfaf5) 60%);
    border: 1px solid color-mix(in srgb, var(--rp-completed) 22%, var(--rp-rule));
    border-radius: var(--rp-radius);
    padding: 0.9rem 1rem;
}

.rp-ev__card-cover-wrap { display: block; flex-shrink: 0; text-decoration: none; }

.rp-ev__card-cover {
    width: 50px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--rp-rule);
    background: var(--rp-warm-2);
    display: block;
}

.rp-ev__card-cover--ph { display: grid; place-items: center; color: var(--rp-accent); }

.rp-ev__cardbody { min-width: 0; display: flex; flex-direction: column; }

.rp-ev__cardtop { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.15rem; }

.rp-ev__finlbl {
    font-family: var(--rp-mono);
    font-size: 0.6rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--rp-completed);
    font-weight: 600;
}

.rp-ev__cardtop .rp-ev__time { font-size: 0.64rem; margin-left: 0; }

.rp-ev__ftitle {
    font-family: var(--rp-serif);
    font-weight: 600;
    font-size: 1.06rem;
    line-height: 1.16;
    color: var(--rp-ink);
    display: block;
    margin-bottom: 0.1rem;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.rp-ev__ftitle:hover { color: var(--rp-accent); }

.rp-ev__fby { font-size: 0.8rem; color: var(--rp-muted); }

.rp-ev__stars {
    margin-top: 0.4rem;
    font-size: 0.95rem;
    letter-spacing: 1px;
    color: var(--rp-rule);
    line-height: 1;
}

.rp-ev__stars b { color: var(--rp-rated); font-weight: 400; }

.rp-ev__notes { margin-top: 0.55rem; }

.rp-ev__note-text {
    font-family: var(--rp-serif);
    font-style: italic;
    font-size: 0.92rem;
    color: var(--rp-ink);
    line-height: 1.5;
    margin: 0;
    padding-left: 0.85rem;
    border-left: 2px solid color-mix(in srgb, var(--rp-rated) 55%, transparent);
    overflow-wrap: anywhere;
}

/* Clustered backlog adds */
.rp-cluster {
    background: var(--surface, #fbfaf5);
    border: 1px dashed var(--rp-rule);
    border-radius: var(--rp-radius);
    padding: 0.55rem 0.8rem;
}

.rp-cluster__head { display: flex; align-items: center; gap: 0.75rem; }
.rp-cluster__stack { display: flex; flex-shrink: 0; }

.rp-cluster__stack img {
    width: 24px;
    height: 36px;
    border-radius: 3px;
    object-fit: cover;
    margin-left: -9px;
    box-shadow: 0 0 0 2px var(--surface, #fbfaf5);
    background: var(--rp-warm-2);
}

.rp-cluster__stack img:first-child { margin-left: 0; }

.rp-cluster__txt { font-size: 0.84rem; color: var(--rp-muted); min-width: 0; }
.rp-cluster__txt b { color: var(--rp-ink); font-family: var(--rp-serif); font-weight: 600; }

.rp-cluster__toggle {
    margin-left: auto;
    font: inherit;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--rp-accent);
    background: none;
    border: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.rp-cluster__items {
    margin: 0.55rem 0 0;
    padding: 0.55rem 0 0;
    border-top: 1px solid var(--rp-rule);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.rp-cluster__item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.82rem;
    color: var(--rp-muted);
    text-decoration: none;
}

.rp-cluster__item:hover { color: var(--rp-ink); }

.rp-cluster__items img {
    width: 18px;
    height: 27px;
    border-radius: 2px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--rp-warm-2);
}

@media (max-width: 575.98px) {
    .rp-ev__card { gap: 0.75rem; padding: 0.75rem 0.85rem; }
    .rp-ev__card-cover { width: 44px; }
}

/* Load more ------------------------------------------------------------- */
/* The section that follows the reading log draws its own border-top, which
   landed flush on the button without a bottom margin here. */
.rp-load-more {
    margin-top: 1rem;
    margin-bottom: 2rem;
    text-align: center;
}

.rp-load-more__btn {
    font: inherit;
    cursor: pointer;
    padding: 0.45rem 1.25rem;
    border-radius: var(--radius-pill, 999px);
    border: 1px solid var(--rp-rule);
    background: var(--surface, #fff);
    color: var(--rp-ink);
}

.rp-load-more__btn:hover:not(:disabled) {
    border-color: var(--rp-accent);
    color: var(--rp-accent);
}

.rp-load-more__btn:disabled {
    opacity: 0.6;
    cursor: default;
}

/* Series ---------------------------------------------------------------- */
.rp-series-group {
    margin-bottom: 1.5rem;
}

.rp-series-group__name {
    margin: 0 0 0.6rem;
    font-size: 0.95rem;
    color: var(--rp-ink);
}

