/* ==================================================
   Single Poem Page — Verse & Veil design
   Cormorant Garamond + Jost, cream/gold palette
   ================================================== */

/* Override poem page root vars (when not in global) */
.poem-page {
    --cream: #f0ebe0;
    --parchment: #e8e0ce;
    --ink: #2c1f0e;
    --ink-light: #4a3520;
    --gold: #8a6a2a;
    --gold-light: #b8922e;
    --gold-pale: #d4a853;
    --muted: #7a6a52;
    --border: rgba(138, 106, 42, 0.2);
    --shadow: rgba(44, 31, 14, 0.12);
}

.poem-page body,
.poem-page .page-bg {
    background: var(--cream) !important;
}

/* ── HERO IMAGE (full bleed, before page-wrap) ── */
.poem-hero-wrap {
    position: relative;
    width: 100%;
    height: 520px;
    overflow: hidden;
}

.poem-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.75) saturate(0.8);
    transition: transform 8s ease;
}

.poem-hero-wrap:hover .poem-hero-img {
    transform: scale(1.04);
}

.poem-hero-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
            rgba(26, 18, 8, 0.1) 0%,
            rgba(26, 18, 8, 0) 40%,
            rgba(240, 235, 224, 0.6) 80%,
            rgba(240, 235, 224, 1) 100%);
}

.hero-category {
    position: absolute;
    top: 32px;
    left: 48px;
    z-index: 2;
    background: var(--gold);
    color: #1a1208;
    font-family: 'Jost', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 6px 16px;
    border-radius: 3px;
}

.hero-title-wrap {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 40px 48px 30px;
    background: linear-gradient(to top, rgba(240, 235, 224, 1) 0%, rgba(240, 235, 224, 0.7) 60%, transparent 100%);
}

.hero-poem-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(44px, 6vw, 76px);
    font-weight: 700;
    color: var(--ink);
    line-height: 1.05;
    letter-spacing: -1px;
    text-shadow: 0 2px 20px rgba(240, 235, 224, 0.5);
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 10px;
    font-size: 13px;
    color: #4a3520;
    font-weight: 400;
    font-family: 'Jost', sans-serif;
}

.hero-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.hero-meta .sep {
    opacity: 0.6;
}

/* Fallback when no hero image */
.poem-hero-placeholder {
    position: relative;
    height: 280px;
    background: linear-gradient(135deg, var(--parchment) 0%, #ddd5c4 100%);
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
}

.poem-hero-placeholder::after {
    display: none;
}

.poem-hero-placeholder .hero-poem-title {
    position: static;
    text-shadow: none;
}

/* ── LAYOUT ── */
.poem-wrap {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 32px 80px;
    position: relative;
    z-index: 2;
}

/* ── TOOLBAR ── */
.poem-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0 28px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 48px;
}

.poem-back-link {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--gold);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;
    font-family: 'Jost', sans-serif;
    transition: gap 0.2s;
}

.poem-back-link:hover {
    gap: 3px;
    color: var(--gold-light);
}

.poem-share-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.poem-share-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #4a3520;
    font-family: 'Jost', sans-serif;
}

.poem-share-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-light);
    text-decoration: none;
    transition: all 0.2s;
}

.poem-share-icon svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.poem-share-icon:hover {
    background: var(--ink);
    color: var(--cream);
    border-color: var(--ink);
}

/* ── POEM BODY ── */
.poem-body {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    font-weight: 400;
    line-height: 2;
    color: var(--ink-light);
    letter-spacing: 0.2px;
    padding: 0 0 48px;
    border-bottom: 1px solid var(--border);
}

.poem-body p {
    margin-bottom: 28px;
    position: relative;
    padding-left: 0;
    transition: color 0.2s;
}

.poem-body p:hover {
    color: var(--ink);
}

.poem-body p:first-child::first-letter {
    font-size: 68px;
    font-weight: 700;
    line-height: 0.75;
    float: left;
    margin-right: 8px;
    margin-top: 12px;
    color: var(--gold);
    font-family: 'Cormorant Garamond', serif;
}

/* ── ORNAMENT ── */
.poem-ornament {
    text-align: center;
    color: var(--gold-pale);
    font-size: 20px;
    letter-spacing: 12px;
    margin: 40px 0;
    opacity: 0.75;
}

/* ── REACTIONS ── */
.reactions-section {
    padding: 36px 0;
    border-bottom: 1px solid var(--border);
}

.reactions-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #4a3520;
    margin-bottom: 18px;
    font-family: 'Jost', sans-serif;
}

.reactions-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.reaction-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 50px;
    border: 1.5px solid var(--border);
    background: transparent;
    cursor: pointer;
    font-family: 'Jost', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-light);
    transition: all 0.25s;
    user-select: none;
}

.reaction-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
    transform: translateY(-2px);
}

.reaction-btn.reacted {
    background: var(--gold);
    border-color: var(--gold);
    color: #1a1208;
    font-weight: 700;
}

.reaction-count {
    font-weight: 700;
}

.reaction-emoji {
    font-size: 17px;
}

/* ── COMMENTS ── */
.comments-section {
    padding: 48px 0 0;
    background: transparent;
    border: none;
}

.comments-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 36px;
}

.comments-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 30px;
    font-weight: 600;
    color: var(--ink);
}

.comments-count {
    font-size: 13px;
    color: #4a3520;
    font-weight: 400;
    font-family: 'Jost', sans-serif;
}

.comment-form-wrap {
    margin-bottom: 40px;
}

.comment-form {
    background: var(--parchment);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border);
}

.comment-form-row {
    display: flex;
    gap: 14px;
    margin-bottom: 14px;
}

.comment-form-fields {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comment-form .user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--gold);
    color: #1a1208;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    font-family: 'Cormorant Garamond', serif;
}

.comment-form-inputs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.comment-form-inputs input {
    flex: 1;
    min-width: 120px;
}

.comment-form input,
.comment-form textarea {
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    font-family: 'Jost', sans-serif;
    font-size: 14px;
    background: var(--cream);
    color: var(--ink);
    outline: none;
    transition: border 0.2s;
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--gold);
}

.comment-textarea {
    flex: 1;
    resize: none;
    min-height: 90px;
    line-height: 1.6;
}

.comment-form-bottom {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.btn-cancel {
    padding: 9px 22px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    font-family: 'Jost', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    border-color: var(--ink-light);
    color: var(--ink);
}

.btn-post {
    padding: 9px 24px;
    border-radius: 8px;
    background: var(--ink);
    border: none;
    color: var(--cream);
    font-family: 'Jost', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.3px;
}

.btn-post:hover {
    background: var(--gold);
    color: #1a1208;
}

/* Comment list */
.comment-list {
    display: flex;
    flex-direction: column;
    gap: 28px;
    margin-bottom: 0;
}

.comment-item {
    display: flex;
    gap: 16px;
    animation: fadeUp 0.4s ease both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comment-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    font-family: 'Cormorant Garamond', serif;
    background: var(--gold);
    color: #1a1208;
}

.comment-body {
    flex: 1;
}

.comment-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.comment-author {
    font-weight: 600;
    font-size: 14px;
    color: var(--ink);
    font-family: 'Jost', sans-serif;
}

.comment-time {
    font-size: 12px;
    color: #5a4530;
    font-family: 'Jost', sans-serif;
}

.comment-text {
    font-size: 15px;
    color: var(--ink);
    line-height: 1.7;
    font-family: 'Jost', sans-serif;
}

.comment-text p {
    margin: 0 0 8px;
}

.comment-text p:last-child {
    margin-bottom: 0;
}

.no-comments {
    color: #5a4530;
    font-style: italic;
    padding: 24px 0;
    font-family: 'Jost', sans-serif;
}

.comment-alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.comment-alert-success {
    background: rgba(76, 153, 76, 0.15);
    color: #2d5a2d;
    border: 1px solid rgba(76, 153, 76, 0.3);
}

.comment-alert-error {
    background: rgba(204, 51, 51, 0.1);
    color: #8b2222;
    border: 1px solid rgba(204, 51, 51, 0.3);
}

/* Remove Featured/More - design doesn't include, or add subtle */
.poem-extras {
    display: none;
}

/* ── NOT FOUND ── */
.not-found {
    max-width: 780px;
    margin: 0 auto;
    padding: 80px 32px;
    text-align: center;
    background: var(--parchment);
    border-radius: 16px;
    border: 1px solid var(--border);
}

.not-found h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 32px;
    margin-bottom: 12px;
    color: var(--ink);
}

.not-found p {
    margin-bottom: 8px;
    font-family: 'Jost', sans-serif;
}

.not-found a {
    color: var(--gold);
    font-weight: 600;
}

@media (max-width: 640px) {
    .poem-hero-wrap {
        height: 360px;
    }

    .hero-category {
        top: 16px;
        left: 16px;
        font-size: 9px;
        padding: 5px 12px;
    }

    .hero-title-wrap {
        padding: 20px 16px 20px;
    }

    .hero-poem-title {
        font-size: clamp(28px, 8vw, 40px);
    }

    .hero-meta {
        font-size: 12px;
        gap: 12px;
        flex-wrap: wrap;
    }

    .poem-wrap {
        padding: 0 16px 48px;
    }

    .poem-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 16px 0 20px;
    }

    .poem-share-row {
        flex-wrap: wrap;
    }

    .poem-share-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }

    .poem-body {
        font-size: 18px;
        line-height: 1.9;
        padding-bottom: 32px;
    }

    .poem-body p:first-child::first-letter {
        font-size: 52px;
    }

    .reactions-row {
        gap: 8px;
    }

    .reaction-btn {
        padding: 10px 14px;
        font-size: 12px;
    }

    .comments-title {
        font-size: 24px;
    }

    .comment-form-row {
        flex-direction: column;
    }

    .comment-form .user-avatar {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .comment-form-inputs {
        flex-direction: column;
    }

    .comment-form-inputs input {
        min-width: 100%;
    }

    .comment-form-bottom {
        flex-direction: column-reverse;
    }

    .btn-cancel,
    .btn-post {
        width: 100%;
        min-height: 44px;
    }

    .comment-item {
        gap: 12px;
    }

    .comment-avatar {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .not-found {
        padding: 48px 20px;
        margin: 0 16px;
    }

    .not-found h1 {
        font-size: 24px;
    }
}

@media (max-width: 400px) {
    .poem-hero-wrap {
        height: 300px;
    }

    .poem-wrap {
        padding: 0 12px 40px;
    }

    .poem-body {
        font-size: 17px;
    }
}