/* Longform Nostr — Default Styles */

/* Card Grid — same structure and rhythm as the AMB material cards */

.longform-nostr-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
    align-items: stretch;
}

.longform-nostr-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.longform-nostr-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.longform-nostr-card__image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.longform-nostr-card__body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 1.25rem;
}

.longform-nostr-card__title {
    font-size: 1.1rem;
    margin: 0 0 0.5rem;
    line-height: 1.3;
}

.longform-nostr-card__title a {
    text-decoration: none;
    color: inherit;
}

.longform-nostr-card__title a:hover {
    text-decoration: underline;
}

.longform-nostr-card__summary {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #444;
}

.longform-nostr-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.longform-nostr-card .longform-nostr-tag {
    text-decoration: none;
    box-shadow: none;
    padding: 0.15rem 0.5rem;
}

.longform-nostr-tag--more {
    opacity: .7;
}

.longform-nostr-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: #777;
    border-top: 1px solid #f0f0f0;
    padding-top: 0.75rem;
    margin-top: auto;
}

.longform-nostr-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-width: 0;
}

.longform-nostr-card__author {
    color: #666;
}

.longform-nostr-card__date {
    color: #777;
}

.longform-nostr-card__link,
.longform-nostr-card .longform-nostr-card__link {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    font-size: 0.85rem;
    background: #2a5d5d;
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: none;
}

.longform-nostr-card__link:hover {
    background: #1f4747;
    color: #fff;
    text-decoration: none;
}

.longform-nostr-article__header {
    margin-bottom: 2rem;
}

.longform-nostr-article__title {
    font-size: 2rem;
    margin: 0 0 0.75rem;
    line-height: 1.2;
}

.longform-nostr-article__meta {
    display: flex;
    gap: 1rem;
    color: #666;
    font-size: 0.9rem;
}

.longform-nostr-article__image {
    margin: 0 0 2rem;
}

.longform-nostr-article__image img {
    width: 100%;
    height: auto;
    border-radius: 6px;
}

.longform-nostr-article__content {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #333;
}

.longform-nostr-article__content h1,
.longform-nostr-article__content h2,
.longform-nostr-article__content h3,
.longform-nostr-article__content h4 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.longform-nostr-article__content p {
    margin-bottom: 1em;
}

.longform-nostr-article__content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.longform-nostr-article__content blockquote {
    border-left: 3px solid #ddd;
    padding-left: 1rem;
    margin-left: 0;
    color: #555;
    font-style: italic;
}

.longform-nostr-article__content pre {
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
}

.longform-nostr-article__content code {
    background: #f5f5f5;
    padding: 0.15rem 0.3rem;
    border-radius: 3px;
    font-size: 0.9em;
}

.longform-nostr-article__content pre code {
    background: none;
    padding: 0;
}

/* Footnotes (CommonMark footnote extension output) */

.longform-nostr-article__content sup[id^="fnref-"] {
    line-height: 0;
    font-size: 0.75em;
    vertical-align: super;
}

.longform-nostr-article__content .footnote-ref {
    text-decoration: none;
    padding: 0 0.15em;
    color: #2271b1;
    border-radius: 3px;
}

.longform-nostr-article__content .footnote-ref:hover,
.longform-nostr-article__content .footnote-ref:focus,
.longform-nostr-article__content .footnote-ref[aria-expanded="true"] {
    background: #e8f0fa;
}

.longform-nostr-article__content .footnotes {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
    font-size: 0.9rem;
    color: #555;
}

.longform-nostr-article__content .footnotes ol {
    padding-left: 1.5rem;
}

.longform-nostr-article__content .footnote {
    margin-bottom: 0.5em;
    scroll-margin-top: 4rem;
}

.longform-nostr-article__content .footnote p {
    margin-bottom: 0.25em;
}

/* Keep the number and the first line together (themes make p a block). */
.longform-nostr-article__content .footnote > p:first-child {
    display: inline;
}

.longform-nostr-article__content .footnote:target {
    background: #fff8dc;
}

.longform-nostr-article__content .footnote-backref {
    text-decoration: none;
    margin-left: 0.25em;
}

.longform-nostr-footnote-popover {
    position: absolute;
    z-index: 1000;
    max-width: min(28rem, calc(100vw - 2rem));
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    font-size: 0.9rem;
    line-height: 1.5;
    color: #333;
}

.longform-nostr-footnote-popover p {
    margin: 0 0 0.5em;
}

.longform-nostr-footnote-popover p:last-child {
    margin-bottom: 0;
}

.longform-nostr-footnote-popover .footnote-backref {
    display: none;
}

.longform-nostr-article__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 2rem 0;
}

.longform-nostr-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    font-size: 0.8rem;
    background: #f0f0f0;
    color: #444;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.longform-nostr-tag:hover {
    background: #e0e0e0;
    color: #222;
}

.longform-nostr-article__author {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1.5rem;
    margin-top: 2rem;
    background: #f9f9f9;
    border-radius: 6px;
}

.longform-nostr-article__avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.longform-nostr-article__author-info strong {
    display: block;
    margin-bottom: 0.25rem;
}

.longform-nostr-article__author-info p {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
}

.longform-nostr-tag-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.longform-nostr-tag-page__title {
    font-size: 1.5rem;
    margin: 0 0 1.5rem;
    color: #333;
}

.longform-nostr-empty {
    color: #888;
    font-style: italic;
    margin: 1.5rem 0;
}

.longform-nostr-error {
    max-width: 800px;
    margin: 2rem auto;
    padding: 1rem;
    color: #721c24;
    background: #f8d7da;
    border-radius: 4px;
}

/* Responsive */

@media (max-width: 600px) {
    .longform-nostr-cards {
        grid-template-columns: 1fr;
    }

    .longform-nostr-article__title {
        font-size: 1.5rem;
    }

    .longform-nostr-article__author {
        flex-direction: column;
        text-align: center;
    }
}

/* ---- source hint ---- */
.wp-nostr-hint { position: relative; font-size: .8rem; margin: .5rem 0; }
.wp-nostr-hint summary { cursor: pointer; display: inline-block; padding: .15rem .6rem; border: 1px solid #ccc; border-radius: 999px; }
.wp-nostr-hint[open] dl { position: absolute; z-index: 20; background: #fff; border: 1px solid #ddd; border-radius: 6px; padding: .75rem 1rem; min-width: 18rem; box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.wp-nostr-hint dt { font-weight: 600; margin-top: .4rem }
.wp-nostr-hint dd { margin: 0; word-break: break-all }
.wp-nostr-hint[open] dl { max-width: calc(100vw - 2rem); }
.wp-nostr-hint dt, .wp-nostr-hint dd { border: 0; background: none; padding: 0; text-transform: none; }
.wp-nostr-hint dt::before, .wp-nostr-hint dt::after { content: none; }
