/* PoetMind — format-faithful poetry display */

/* Feed grid */
.poetmind-feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.poetmind-feed-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 24px 0;
}

/* Poem card */
.poetmind-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 20px;
    transition: border-color 0.15s;
}

.poetmind-card:hover {
    border-color: #bbb;
}

.poetmind-card-title {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 4px;
}

.poetmind-card-title a {
    text-decoration: none;
    color: inherit;
}

.poetmind-card-title a:hover {
    text-decoration: underline;
}

.poetmind-card-author {
    font-size: 13px;
    color: #888;
    display: block;
    margin-bottom: 14px;
}

.poetmind-card-preview pre {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 13px;
    line-height: 1.9;
    color: #555;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    padding: 0 0 0 12px;
    border-left: 2px solid #e0e0e0;
    overflow: hidden;
    max-height: 120px;
    background: transparent;
}

.poetmind-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.poetmind-themes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.poetmind-theme-tag {
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 20px;
    background: #f5f5f5;
    color: #666;
    text-decoration: none;
    border: 1px solid #e8e8e8;
}

.poetmind-theme-tag:hover {
    background: #efefef;
}

.poetmind-read-link {
    font-size: 12px;
    color: #888;
    text-decoration: none;
}

.poetmind-read-link:hover {
    color: #333;
}

/* Single poem */
.poetmind-single-wrap {
    max-width: 680px;
    margin: 40px auto;
    padding: 0 20px;
}

.poetmind-poem {
    margin: 0 0 40px;
}

.poetmind-poem-header {
    margin-bottom: 28px;
}

.poetmind-poem-title {
    font-size: 26px;
    font-weight: 600;
    margin: 0 0 6px;
}

.poetmind-poem-title a {
    text-decoration: none;
    color: inherit;
}

.poetmind-poem-byline {
    font-size: 14px;
    color: #888;
}

/* THE CORE — format faithful rendering */
.poetmind-poem-body {
    margin: 0;
}

.poetmind-poem-text {
    /* Reset all pre defaults that would alter formatting */
    font-size: 16px;
    line-height: 2;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    overflow: visible;
    word-break: break-word;

    /* Preserve every line break and space exactly as written */
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Font options */
.poetmind-font-serif     .poetmind-poem-text { font-family: Georgia, 'Times New Roman', serif; }
.poetmind-font-sans-serif .poetmind-poem-text { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.poetmind-font-monospace  .poetmind-poem-text { font-family: 'Courier New', Courier, monospace; font-size: 15px; }

/* Spacing options */
.poetmind-spacing-compact     .poetmind-poem-text { line-height: 1.7; }
.poetmind-spacing-comfortable .poetmind-poem-text { line-height: 2.1; }
.poetmind-spacing-airy        .poetmind-poem-text { line-height: 2.6; }

/* Alignment options */
.poetmind-align-left   .poetmind-poem-text { text-align: left; }
.poetmind-align-center .poetmind-poem-text { text-align: center; }
.poetmind-align-right  .poetmind-poem-text { text-align: right; }

/* Poem footer */
.poetmind-poem-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Portfolio */
.poetmind-portfolio {
    max-width: 680px;
    margin: 0 auto;
}

.poetmind-portfolio-hero {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 28px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    margin-bottom: 28px;
}

.poetmind-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #e8edf5;
    color: #3a5a9a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    flex-shrink: 0;
}

.poetmind-poet-name {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 6px;
}

.poetmind-poet-bio {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin: 0 0 10px;
}

.poetmind-poem-count {
    font-size: 13px;
    color: #aaa;
}

.poetmind-portfolio-poems {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.poetmind-portfolio-poems .poetmind-poem {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 28px 32px;
    margin: 0;
}

/* Back link */
.poetmind-back-link {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.poetmind-back-link a {
    font-size: 14px;
    color: #888;
    text-decoration: none;
}

.poetmind-back-link a:hover {
    color: #333;
}

/* Empty state */
.poetmind-empty {
    color: #aaa;
    font-style: italic;
    padding: 20px 0;
}

/* Accent color — overridden by settings */
:root {
    --poetmind-accent: #1a1a1a;
}

.poetmind-theme-tag:hover,
.poetmind-read-link:hover,
.poetmind-back-link a:hover {
    color: var(--poetmind-accent);
}

/* Responsive */
@media (max-width: 600px) {
    .poetmind-feed-grid {
        grid-template-columns: 1fr;
    }

    .poetmind-portfolio-hero {
        flex-direction: column;
        gap: 14px;
        padding: 20px;
    }

    .poetmind-portfolio-poems .poetmind-poem {
        padding: 20px;
    }

    .poetmind-poem-title {
        font-size: 22px;
    }
}

/* Byline branding */
.poetmind-poem-published { font-size: 0.9em; }
.poetmind-pm-link { color: inherit; opacity: 0.55; text-decoration: none; font-style: italic; }
.poetmind-pm-link:hover { opacity: 1; }
