/* Public list pages (Clean and Editorial). The chrome is quieter than the app: no dot grid, no hard shadow on the page frame. See DESIGN.md. */

body.pub {
    background-image: none;
}

.pub-main {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 16px 24px;
}

.pub-header {
    margin-bottom: 32px;
}

.pub-header h1 {
    margin: 0 0 12px;
    font-size: clamp(2rem, 8vw, 3.25rem);
    overflow-wrap: anywhere;
}

.pub-description {
    margin: 0 0 12px;
    max-width: 56ch;
    font-size: 1.1rem;
    color: var(--muted);
}

.pub-count {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.eyebrow {
    margin: 0 0 12px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.pub-list-link {
    text-decoration: none;
    color: var(--ink);
}

.pub-list-link:hover {
    background: var(--surface);
    color: var(--ink);
}

.pub-list-link .item-main {
    display: block;
}

.pub-list-link .item-title,
.pub-list-link .item-note {
    display: block;
}

.pub-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 16px 40px;
    border-top: var(--line);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted);
}

.pub-footer .wordmark {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--ink);
    text-decoration: none;
}

.pub-footer .wordmark::after {
    content: ".";
    color: var(--pop);
}

/* Editorial: no cards, big type, rules between entries */

.pub-editorial .pub-main {
    max-width: 680px;
}

.pub-editorial .pub-header {
    padding-bottom: 24px;
    border-bottom: 1px solid var(--rule);
}

.ed-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ed-item {
    display: grid;
    grid-template-columns: 2.5rem 1fr;
    gap: 8px 16px;
    padding: 20px 0;
    border-bottom: 1px solid var(--rule);
}

.ed-number {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--muted);
    padding-top: 0.5rem;
}

.ed-body {
    min-width: 0;
}

.ed-body h2 {
    margin: 0 0 8px;
    font-size: clamp(1.4rem, 5vw, 1.9rem);
    overflow-wrap: anywhere;
}

.ed-body h2 a {
    text-decoration-color: var(--pop);
}

.ed-note {
    font-size: 1.05rem;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.ed-note p {
    margin: 0 0 8px;
}

.ed-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin: 8px 0 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.ed-body h2:last-child {
    margin-bottom: 0;
}


@media (max-width: 480px) {
    .ed-item {
        grid-template-columns: 1fr;
    }
}

/* Weekly and monthly issues */

.pub-count a {
    color: inherit;
}

.issue-index .ed-number {
    font-size: 1.1rem;
    color: var(--ink);
}

.issue-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 0 0;
    font-size: 0.9rem;
}

.profile-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: 0 0 24px;
    font-size: 0.9rem;
}

/* Who is behind the page, sharing, and the visitor footer */

.pub-author {
    margin: 0 0 16px;
}

.pub-author p {
    margin: 0 0 4px;
}

.author-name {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 800;
}

.author-handle {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--muted);
}

.author-bio {
    max-width: 56ch;
}

.author-site {
    font-size: 0.9rem;
}

.pub-actions {
    display: flex;
    gap: 20px;
    margin: 0 0 12px;
    font-size: 0.95rem;
    font-weight: 600;
}

.pub-actions a,
.pub-actions .link-button {
    padding: 0;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.pub-actions a:hover,
.pub-actions .link-button:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.pub-footer a[data-visitor-cta] {
    font-weight: 700;
}

.earlier h2 {
    margin: 32px 0 8px;
    font-size: 1.1rem;
}

.earlier ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

.earlier li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid var(--dot);
}

.earlier .earlier-count {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted);
}

.profile-lists {
    margin: 24px 0 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.profile-links {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
}

/* Calmer issue pages: one byline, one row of actions, "Save to my shelf" only when asked for */

.pub-byline {
    margin: 0 0 4px;
    color: var(--muted);
}

.pub-byline .byline-name {
    font-weight: 700;
    color: var(--ink);
}

.pub-header .author-bio {
    margin: 0 0 12px;
    font-size: 0.95rem;
    color: var(--muted);
}

.pub-actions a,
.pub-actions .link-button {
    color: var(--muted);
}

.pub-actions a:first-child {
    color: var(--ink);
}

.earlier-other {
    margin: 12px 0 0;
    font-size: 0.9rem;
}



/* One row style on every public page. Editorial and issues number their rows; Clean leaves them out and sets titles smaller. */

:root {
    --rule: rgba(23, 20, 15, 0.22);
}

@media (prefers-color-scheme: dark) {
    :root {
        --rule: rgba(244, 238, 225, 0.22);
    }
}

.ed-item {
    position: relative;
}

.ed-plain {
    grid-template-columns: 1fr;
}

.pub-clean .ed-body h2 {
    font-size: clamp(1.15rem, 4vw, 1.4rem);
}

.pub-clean .ed-note {
    font-size: 1rem;
}

.ed-list:last-child .ed-item:last-child {
    border-bottom: none;
}

/* "Save to my shelf" sits at the bottom-right of each entry, on the same line as the stars and tags (below them on narrow screens),
   so it can never cover a title. With a mouse it appears when you point at the entry; on touch screens it is always there. */

.ed-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 16px;
    margin: 8px 0 0;
}

.ed-foot .ed-meta {
    margin: 0;
}

.ed-body .save-to-shelf {
    margin: 0 0 0 auto;
    font-size: 0.85rem;
    font-weight: 600;
}

.ed-body .item-domain {
    margin: -4px 0 8px;
}

@media (hover: hover) {
    .ed-body .save-to-shelf {
        opacity: 0;
        transition: opacity 0.15s;
    }

    .ed-item:hover .save-to-shelf,
    .ed-item:focus-within .save-to-shelf {
        opacity: 1;
    }
}

/* Earlier issues: the latest few, then the rest folded away */

.earlier-more {
    margin: 0;
}

.earlier-more summary {
    padding: 10px 0;
    border-top: 1px solid var(--dot);
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.earlier-more[open] summary {
    margin-bottom: 0;
}

/* Editorial pages (weekly and monthly issues, and lists using the Editorial template) */

/* A marker highlight behind the title, like the landing page's "sharing" */
.pub-editorial .pub-header h1 {
    display: inline-block;
    padding: 0 0.2em;
    background: var(--sun);
    color: var(--on-color);
}

/* Entry numbers as little coloured spines, cycling through the four loud colours. They are decoration, not status. */
.pub-editorial .ed-number {
    justify-self: start;
    align-self: start;
    margin-top: 0.45rem;
    padding: 1px 7px;
    border-radius: 4px;
    background: var(--sun);
    color: var(--on-color);
    font-weight: 700;
}

.pub-editorial .ed-item:nth-child(4n + 2) .ed-number { background: var(--sky); }
.pub-editorial .ed-item:nth-child(4n + 3) .ed-number { background: var(--mint); }
.pub-editorial .ed-item:nth-child(4n + 4) .ed-number { background: var(--pop); }

/* Calmer links on public pages: underlines follow the text colour instead of shouting orange on every title and
   link. Orange stays for the entry number chips and appears on hover. */
.pub a {
    text-decoration-color: var(--rule);
    text-decoration-thickness: 1px;
}

.pub a:hover,
.pub a:focus-visible {
    text-decoration-color: var(--pop);
}

.pub .ed-body h2 a {
    text-decoration-color: var(--rule);
    text-decoration-thickness: 2px;
}

.pub .ed-body h2 a:hover,
.pub .ed-body h2 a:focus-visible {
    text-decoration-color: var(--pop);
}

/* The yellow hover/tap highlight needs dark text; the muted colour on action links was winning and read as grey on yellow. */
.pub-actions a:hover,
.pub-actions a:focus-visible,
.pub-actions .link-button:hover {
    color: var(--on-color);
}

/* Desktop share menu (phones use the system share sheet) */
.share-menu {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    padding: 6px 12px;
    background: var(--surface);
    border: var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
