/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── ROOT ── */
:root {
    --bg: #f0e8e0;
    --surface: #ffffff;
    --border: #e8ddd4;
    --text: #1a1a1a;
    --muted: #7a7063;
    --orange: #e85d04;
    --orange-hover: #d04e00;
    --orange-light: #fff3eb;
    --radius: 6px;
}

/* ── BODY ── */
body {
    font-family: 'IBM Plex Sans', 'Segoe UI', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ═══════════════════════════════
   POST LIST
═══════════════════════════════ */
.post-list {
    max-width: 740px;
    margin: 12px auto 24px;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ═══════════════════════════════
   POST CARD
═══════════════════════════════ */
.post-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.15s;
    position: relative;
    overflow: visible;
}

.post-card:hover {
    border-color: #c8b8a8;
}

.post-body {
    padding: 14px 16px;
    position: relative;
}

/* ═══════════════════════════════
   POST META
═══════════════════════════════ */
.post-meta {
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-meta span {
    margin-right: 2px;
}

.post-meta a {
    color: var(--orange);
    text-decoration: none;
    font-weight: 600;
}

.post-meta a:hover {
    text-decoration: underline;
}

.post-author {
    font-weight: 600;
    color: var(--text) !important;
}

/* ═══════════════════════════════
   POST TITLE
═══════════════════════════════ */
.post-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 10px;
}

.post-title a {
    color: var(--text);
    text-decoration: none;
}

.post-title a:hover {
    color: var(--orange);
}

/* ═══════════════════════════════
   POST CONTENT
═══════════════════════════════ */
.post-preview {
    font-size: 13px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-link-url {
    font-size: 12px;
    margin-bottom: 10px;
    word-break: break-all;
}

.post-link-url a {
    color: var(--orange);
    text-decoration: none;
}

.post-link-url a:hover {
    text-decoration: underline;
}

/* ═══════════════════════════════
   MEDIA CAROUSEL
═══════════════════════════════ */
.media-carousel {
    position: relative;
    margin-top: 10px;
    margin-bottom: 10px;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    max-height: 480px;
}

.carousel-track {
    display: flex;
    transition: transform 0.3s ease;
}

.carousel-slide {
    min-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    max-height: 480px;
}

.carousel-slide img,
.carousel-slide video {
    width: 100%;
    max-height: 480px;
    object-fit: contain;
    display: block;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 22px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.carousel-btn:hover { background: rgba(0, 0, 0, 0.85); }
.carousel-btn-prev { left: 10px; }
.carousel-btn-next { right: 10px; }

.carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: background 0.15s;
}

.dot.active { background: #fff; }

/* ═══════════════════════════════
   POST ACTIONS (bottom bar)
═══════════════════════════════ */
.post-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-top: 10px;
    margin-top: 8px;
    border-top: 1px solid var(--border);
}

/* VOTE GROUP */
.action-vote-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg);
    border-radius: 20px;
    padding: 4px 10px;
}

.vote-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 13px;
    padding: 2px 3px;
    line-height: 1;
    transition: color 0.1s;
}

.vote-btn:hover { color: var(--orange); }
.vote-btn.active { color: var(--orange); }

.vote-count {
    font-size: 12px;
    font-weight: 700;
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    color: var(--text);
    min-width: 14px;
    text-align: center;
}

/* ACTION BUTTONS (comments, share) */
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, color 0.15s;
}

.action-btn:hover {
    background: var(--bg);
    color: var(--text);
}

.action-btn svg {
    flex-shrink: 0;
}

.comments-count {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 11px;
}

.share-btn {
    margin-left: auto;
}

/* ═══════════════════════════════
   THREE-DOT DROPDOWN MENU
═══════════════════════════════ */
.post-options {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 20;
}

.menu-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--muted);
    padding: 2px 8px;
    border-radius: 4px;
    line-height: 1;
}

.menu-btn:hover {
    background: var(--bg);
    color: var(--text);
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    min-width: 148px;
    z-index: 50;
    overflow: hidden;
}

.dropdown-menu a {
    display: block;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text);
    text-decoration: none;
    transition: background 0.1s;
}

.dropdown-menu a:hover { background: var(--bg); }
.dropdown-menu a.danger { color: #d9220f; }

/* ═══════════════════════════════
   EMPTY STATE
═══════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 64px 20px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.35;
}

.empty-state h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 20px;
    color: var(--muted);
}

.empty-state a {
    display: inline-block;
    padding: 9px 24px;
    border-radius: 20px;
    background: var(--orange);
    color: white;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.15s;
}

.empty-state a:hover { background: var(--orange-hover); }

/* ═══════════════════════════════
   TOAST NOTIFICATION
═══════════════════════════════ */
.share-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: #1a1a1a;
    color: white;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 22px;
    border-radius: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 999;
}

.share-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.post-community-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #ff4500;
    color: white;
    font-size: 11px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    vertical-align: middle;
    margin-right: 4px;
}