/* Notification Card - for visual separation */
.notification-card {
    margin-bottom: 14px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s, transform 0.2s;
}

.notification-card.unread {
    background: #f0f8ed;
    border-left: 4px solid #5a9a3c;
}
.notification-card.read {
    border-left: 4px solid #e0e0e0;
}
/* ========================================
   Post Card CSS - Green Theme
   ======================================== */

/* Post Card Container (legacy simple style) */
.post-card {
    background: #fdfdfd;
    border: 1px solid #d9d9d9;
    border-radius: 2px;
    box-sizing: border-box;
    max-width: 100%;
    padding: 11px 12px;
    margin-bottom: 10px;
    box-shadow: none;
    transition: background 0.2s ease;
}

.post-card:hover {
    background: #fff;
}

/* Legacy post-card mode (forced internally) */

.post-card.post-card-legacy {
    background: transparent !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-bottom: 16px !important;
}

.post-card.post-card-legacy:hover {
    background: #fafafa !important;
}

/* Layout utilities for post-card template */
/* Header row: compact, flush */
.post-card-header {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 0;
    padding: 8px 0 0 0;
}
.post-card-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    margin: 0 12px;
}
.post-card-icon {
    width: 26px;
    height: 26px;
    background: #5a9a3c;
    color: #fff;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 11px;
    flex-shrink: 0;
    text-align: center;
    line-height: 1;
    margin-left: auto;
}
.post-card-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.post-card-meta-row {
    width: 100%;
    margin-left: 0;
}
.post-card-time {
    margin-left: 0;
    text-align: left;
}
.post-card-meta > div:first-child {
    margin-bottom: 2px; /* reduce gap between username row and timestamp */
}
.post-card-username {
    color: #5a9a3c;
    text-decoration: none;
    font-weight: 600;
    word-break: break-word;
    display: inline-block;
    font-size: 13px;
}
.post-card-time {
    color: #999;
    font-size: 11px;
}
/* Content: flush, no card effect */
.post-card-content {
    color: #333;
    font-size: 16px;
    line-height: 1.5;
    margin: 0 12px 8px 12px;
    word-break: break-word;
    overflow-wrap: break-word;
}
/* Tags: flush, compact */
.post-card-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 12px 8px 12px;
}
/* Actions: flush, clear line, compact */
.post-card-actions {
    margin: 0;
    padding: 8px 12px 0 12px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    background: none;
}

.post-card-actions .post-action,
.post-card-actions .action-form {
    margin: 0;
}

.post-card-actions .action-form {
    display: inline-block;
}

/* Comments: flush, clear line, compact */
.post-card-comments {
    margin: 0 12px 0 12px;
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
}
/* Comment form: flush, clear line, compact */
.post-card-comment-form {
    margin: 0 12px 12px 12px;
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
}

/* Comment input */
/* Comment input: flat, light background */
.post-card-comment-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 2px;
    font-size: 13px;
    background: #fafafa;
    box-sizing: border-box;
}
.post-card-comment-input:focus {
    outline: none;
    border-color: #5a9a3c;
    background: #fff;
}

/* Accessibility helper: visually hidden but available to screen readers */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.post-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Highlight style for newly-created replies (server-side, temporary) */
.newly-created {
    background: #fff8e1; /* soft yellow */
    border-radius: 4px;
    padding: 6px;
    box-shadow: 0 0 18px rgba(255, 203, 66, 0.45), inset 0 0 0 1px rgba(255,224,130,0.3);
    animation: highlight-fade 8s forwards;
}

.highlight-label {
    display: inline-block;
    background: #5a9a3c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
    margin-left: 10px;
}

@keyframes highlight-fade {
    0% { background-color: #fff8e1; }
    85% { background-color: #fff8e1; }
    100% { background-color: transparent; box-shadow: none; }
}

.post-card img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Minimalistic code block styling to fit inside post cards */
.code-block {
    background: #f6f7f8;
    border-left: 3px solid #e9e9e9;
    padding: 6px;
    border-radius: 3px;
    font-family: Menlo, Monaco, "Courier New", monospace;
    font-size: 12px;
    line-height: 1.4;
    overflow: auto;
    max-width: 100%;
    white-space: pre-wrap; /* allow soft wrap to fit narrow cards */
    word-break: break-word;
    margin: 6px 0;
    box-sizing: border-box;
}

.code-block code { display:block; }

/* Ensure code blocks don't push card wider on small screens */
.post-card .code-block { max-width: 100%; width:100%; overflow-x:auto; white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; box-sizing: border-box; }

.post-card-meta-row { display:flex; align-items:center; gap:6px; margin-bottom:4px; }
.post-card .code-block code { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; display:block; }

/* Post link styling */
.post-card .post-link { color: #1e88e5; text-decoration: underline; }


.post-card:last-child {
    margin-bottom: 0;
}

/* Action Buttons */
.action-btn {
    background: none;
    border: none;
    color: #5a9a3c;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin: 0;
    text-decoration: none;
    display: inline-block;
    transition: opacity 0.2s ease;
    font-family: Arial, sans-serif;
}

.action-btn:hover {
    opacity: 0.7;
    text-decoration: none;
}

.action-btn.liked {
    color: #5a9a3c;
}

/* Post-card style for post-action (old design) */
.post-card .post-action,
.post-card .post-action:link,
.post-card .post-action:visited {
    background: none;
    border: none;
    color: #999;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin: 0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.2s ease;
    font-family: Arial, sans-serif;
}

.post-card .post-action:hover,
.post-card .post-action:focus-visible {
    color: #5a9a3c;
    text-decoration: underline;
    opacity: 0.8;
}

.post-card .post-action.liked {
    color: #e74c3c;
}

/* Post-card special override: keep like button inline-styled, not btn-like block button from post.css */
.post-card .action-btn.like-btn {
    background: none !important;
    border: none !important;
    color: #5a9a3c !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}

.post-card .action-btn.like-btn:hover {
    opacity: 0.7;
    text-decoration: underline;
}

/* Action Form */
.action-form {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.action-form button {
    background: none;
    border: none;
    color: #5a9a3c;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin: 0;
    text-decoration: none;
    display: inline-block;
    transition: opacity 0.2s ease;
    font-family: Arial, sans-serif;
}

.action-form button:hover {
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 768px) {
    .post-card {
        padding: 12px;
        margin-bottom: 10px;
    }
    
    .action-btn,
    .action-form button {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .post-card {
        padding: 10px;
        margin-bottom: 6px;
        padding-bottom: 8px; /* reduced bottom padding on small screens */
    }

    .post-card-meta-row {
        flex-wrap: wrap;
        gap: 4px;
    }

    .action-btn,
    .action-form button {
        font-size: 10px;
    }

    /* On small screens keep the icon in-flow above content */
    .post-card-icon {
        position: static;
        margin-bottom: 8px;
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    /* Align username/timestamp and content with same left edge on small screens */
    .post-card-username,
    .post-card-time,
    .post-card-edited {
        margin-left: 0 !important;
        padding-left: 0 !important;
    }
    .post-card-edited {
        margin-left: -2px !important;
    }

    .post-card-content,
    .post-card-tags,
    .post-card-comments,
    .post-card-comment-form {
        margin-left: 12px !important;
        margin-right: 12px !important;
    }

    .post-card-comment-form {
        margin: 0 12px 12px 12px !important;
        width: calc(100% - 24px) !important;
        box-sizing: border-box;
    }

    .post-card-comment-input {
        width: 100% !important;
        box-sizing: border-box !important;
    }
}
