/* Public Site — Article Page */

.piece {
    max-width: 750px;
    margin: 0 auto;
    padding: 3.5rem 1.25rem 5rem;
}
.piece__header {
    margin-bottom: 2.25rem;
}
.piece__section {
    display: block;
    font-family: sofia-pro, sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text);
    margin-bottom: 1.25rem;
}
.piece__headline {
    font-family: sofia-pro, sans-serif;
    font-size: 2.1rem;
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 0.75rem;
}
.piece__dek {
    font-family: sofia-pro, sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.45;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}
.piece__dateline {
    font-family: sofia-pro, sans-serif;
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* ── Share Bar ── */
.share-bar {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
}
.share-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 2;
    overflow: hidden;
}
.share-dot img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}
.share-dot:hover {
    opacity: 0.85;
}
.share-icons {
    display: flex;
    align-items: center;
    gap: 0;
    overflow: hidden;
    max-width: 0;
    opacity: 0;
    transition:
        max-width 0.3s ease,
        opacity 0.2s ease;
}
.share-bar--open .share-icons {
    max-width: 180px;
    opacity: 1;
}
.share-icon {
    width: 32px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.12s;
    flex-shrink: 0;
}
.share-icon:hover {
    color: var(--text);
}
.share-copied {
    display: block;
    text-align: right;
    font-family: sofia-pro, sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
    height: 0;
    overflow: visible;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}
.share-copied--visible {
    opacity: 1;
}
.share-email-row {
    display: none;
    align-items: center;
    gap: 6px;
    margin-top: 0.6rem;
}
.share-email-row--open {
    display: flex;
}
.share-email-row input {
    font-family: sofia-pro, sans-serif;
    font-size: 0.8rem;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    outline: none;
    padding: 7px 10px;
    flex: 1;
    color: var(--text);
    background: transparent;
}
.share-email-row input:focus {
    border-color: var(--text);
}
.share-email-row input::placeholder {
    color: var(--text-muted);
}
.share-email-send {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
}
.share-email-send:hover {
    opacity: 0.85;
}
.share-email-send:disabled {
    opacity: 0.4;
    cursor: default;
}

/* ── Article Body ── */
.piece__context {
    font-family: sofia-pro, sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
    padding-top: 1.75rem;
    margin-bottom: 2rem;
}
.piece__hero {
    width: 100%;
    display: block;
    border-radius: 4px;
    margin-bottom: 2rem;
    max-height: 420px;
    object-fit: cover;
}
.piece__body {
    font-family: sofia-pro, sans-serif;
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--text);
}
.piece__body p {
    margin-bottom: 1.15em;
}
.piece__body h2 {
    font-family: sofia-pro, sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text);
    margin: 2rem 0 0.75rem;
}
.piece__body h3 {
    font-family: sofia-pro, sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
    margin: 1.75rem 0 0.6rem;
}
.piece__body strong {
    font-weight: 600;
    color: var(--text);
}
.piece__body em {
    font-style: italic;
}
.piece__body a {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.piece__body a:has(.entity-hover) {
    text-decoration: none;
}
.piece__body blockquote {
    border-left: 2px solid var(--border-subtle);
    padding-left: 1.25rem;
    margin: 1.5em 0;
    color: var(--text-secondary);
    font-style: italic;
}
.piece__body ul,
.piece__body ol {
    padding-left: 1.5rem;
    margin-bottom: 1.15em;
}
.piece__body li {
    margin-bottom: 0.35em;
}

/* ── Aside / Takeaways ── */
.piece__aside {
    border-top: 1px solid var(--border);
    margin-top: 2.5rem;
    padding-top: 1.75rem;
    margin-bottom: 2rem;
}
.piece__aside-label {
    display: block;
    font-family: sofia-pro, sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text);
    margin-bottom: 1rem;
}
.piece__takeaways {
    list-style: none;
    padding: 0;
}
.piece__takeaways li {
    font-family: sofia-pro, sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
}
.piece__takeaways li:last-child {
    border-bottom: none;
}

/* ── Footer Tags ── */
.piece__footer {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.piece__tag {
    font-family: sofia-pro, sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    padding: 0.3rem 0.7rem;
}

/* ── Editor Byline ── */
.piece__byline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-top: 1px solid var(--border);
    margin-top: 2.5rem;
    padding-top: 1.5rem;
}
.piece__byline-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.piece__byline-text {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}
.piece__byline-role {
    font-family: sofia-pro, sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}
.piece__byline-name {
    font-family: sofia-pro, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}
.piece__byline-name:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}
.piece__byline-handle {
    font-family: sofia-pro, sans-serif;
    font-size: 0.9rem;
    color: var(--text-tertiary);
    text-decoration: none;
}
.piece__byline-handle:hover {
    color: var(--text);
}

/* ── Mentioned Profiles ── */
.piece__profiles {
    margin: 1rem 0;
}
.piece__profiles-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ── Inline profile pics (bare <img> in body paragraphs) ── */
.piece__body p > img[src*="/profiles/"],
.piece__body p > img[src*="/pic/"],
.piece__body p > img[src^="/p/"],
.piece__body p > a > img[src*="/profiles/"],
.piece__body p > a > img[src*="/pic/"],
.piece__body p > a > img[src^="/p/"],
.piece__body p > strong > a > img[src*="/profiles/"],
.piece__body p > strong > a > img[src*="/pic/"],
.piece__body p > strong > a > img[src^="/p/"] {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
    margin: 0 2px;
}

/* ── Inline Entities (woven handles) ── */
.entity-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    vertical-align: baseline;
}
.entity-inline__pic {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
    flex-shrink: 0;
}
.entity-inline__link {
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
}
.entity-inline__link:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}
.entity-inline__handle {
    font-size: 0.8em;
    color: var(--text-muted);
    font-weight: 400;
}

/* ── Entity Hover Popover ── */
.entity-hover {
    text-decoration: none;
    font-weight: 600;
    color: #0095f6;
    cursor: pointer;
    position: relative;
}
.entity-popover {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    background: var(--bg-raised);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    padding: 0.65rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
}
.entity-popover.visible {
    opacity: 1;
    pointer-events: auto;
}
.entity-popover__pic {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.entity-popover__info {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}
.entity-popover__name {
    font-size: 0.8rem;
    font-weight: 600;
}
.entity-popover__handle {
    font-size: 0.7rem;
    color: var(--text-muted);
}
.entity-popover__followers {
    font-size: 0.65rem;
    color: var(--text-secondary);
}

/* ── Responsive ── */
@media (min-width: 768px) {
    .piece {
        padding: 4.5rem 2.5rem 6rem;
    }
    .piece__headline {
        font-size: 2.6rem;
    }
}
