/* The Feed — social media posts (used by /feed/ and the `social` layout) */

:root {
    --feed-purple: #b19cd9;
    --feed-blue: #8ac4ff;
    --feed-violet: #a8b5ff;
    --feed-text: #f0f0f0;
    --feed-text-soft: #d0d0d0;
    --feed-text-muted: #9a9ab5;
}

.feed-page {
    position: relative;
    background: linear-gradient(135deg, #0a0a14 0%, #1a1a2e 50%, #0f0f1e 100%);
    min-height: 100vh;
}

/* ---------- Header ---------- */
.feed-header {
    padding: 100px 0 40px;
    text-align: center;
    position: relative;
}

.feed-header-content {
    max-width: 820px;
    margin: 0 auto;
    animation: feed-fade-up 1s ease-out;
}

.feed-title {
    font-size: clamp(2.6rem, 5vw, 3.6rem);
    font-weight: 200;
    letter-spacing: 3px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--feed-purple), var(--feed-blue));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 200%;
    animation: feed-shimmer 4s ease-in-out infinite;
}

.feed-subtitle {
    color: var(--feed-text-soft);
    font-size: 1.15em;
    line-height: 1.8;
    font-style: italic;
    padding: 0 20px;
}

/* ---------- Follow bar ---------- */
.follow-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 14px 22px;
    margin: 36px auto 0;
    padding: 18px 26px;
    max-width: 760px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(177, 156, 217, 0.15);
    border-radius: 60px;
    backdrop-filter: blur(20px);
}

.follow-bar-label {
    color: var(--feed-purple);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.8em;
    font-weight: 600;
}

.follow-bar-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.follow-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 30px;
    color: var(--feed-text-soft);
    text-decoration: none;
    font-size: 0.95em;
    border: 1px solid rgba(138, 196, 255, 0.15);
    background: rgba(138, 196, 255, 0.04);
    transition: all 0.3s ease;
}

.follow-link svg {
    width: 18px;
    height: 18px;
    fill: var(--feed-purple);
    transition: fill 0.3s ease;
}

.follow-link:hover {
    color: #fff;
    border-color: rgba(177, 156, 217, 0.5);
    background: rgba(177, 156, 217, 0.12);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(177, 156, 217, 0.15);
}

.follow-link:hover svg { fill: #fff; }

/* ---------- Toolbar (search + count) ---------- */
.feed-toolbar {
    max-width: 760px;
    margin: 40px auto 10px;
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.feed-search {
    flex: 1 1 260px;
    position: relative;
}

.feed-search input {
    width: 100%;
    padding: 14px 20px 14px 46px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(177, 156, 217, 0.2);
    border-radius: 40px;
    color: var(--feed-text);
    font-family: inherit;
    font-size: 1em;
    outline: none;
    transition: all 0.3s ease;
}

.feed-search input::placeholder { color: var(--feed-text-muted); }

.feed-search input:focus {
    border-color: var(--feed-purple);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 25px rgba(177, 156, 217, 0.15);
}

.feed-search svg {
    position: absolute;
    left: 17px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    fill: var(--feed-purple);
    opacity: 0.8;
    pointer-events: none;
}

.feed-count {
    color: var(--feed-text-muted);
    font-size: 0.9em;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.feed-count strong {
    color: var(--feed-purple);
    font-weight: 600;
}

/* ---------- Timeline ---------- */
.feed-timeline {
    max-width: 760px;
    margin: 30px auto 0;
    padding: 0 20px 100px;
    position: relative;
}

.feed-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 20px;
    width: 1px;
    background: linear-gradient(to bottom, transparent, rgba(177, 156, 217, 0.35) 8%, rgba(177, 156, 217, 0.35) 92%, transparent);
    pointer-events: none;
}

.feed-post {
    position: relative;
    margin: 0 0 34px 34px;
    padding: 30px 34px 24px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(177, 156, 217, 0.12);
    border-radius: 22px;
    transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    animation: feed-fade-up 0.7s ease-out both;
}

.feed-post::before {
    content: '';
    position: absolute;
    left: -40px;
    top: 38px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--feed-purple), var(--feed-blue));
    box-shadow: 0 0 0 5px rgba(177, 156, 217, 0.12), 0 0 18px rgba(177, 156, 217, 0.5);
}

.feed-post:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(177, 156, 217, 0.3);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

.feed-post.is-hidden { display: none; }

.feed-post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 16px;
    margin-bottom: 18px;
}

.feed-post-date {
    color: var(--feed-purple);
    text-decoration: none;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.feed-post-date:hover { color: #fff; }

.feed-post-title {
    color: var(--feed-text-muted);
    font-size: 0.85em;
    font-style: italic;
    letter-spacing: 0.5px;
}

.feed-post-title a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.feed-post-title a:hover {
    color: var(--feed-violet);
    border-bottom-color: var(--feed-violet);
}

.feed-post-body {
    position: relative;
    color: var(--feed-text-soft);
    font-size: 1.08em;
    line-height: 1.8;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

.feed-post-body p { margin: 0 0 18px; }
.feed-post-body p:last-child { margin-bottom: 0; }

.feed-post-body ul,
.feed-post-body ol { margin: 0 0 18px 26px; }

.feed-post-body a {
    color: var(--feed-purple);
    text-decoration: none;
    border-bottom: 1px solid rgba(177, 156, 217, 0.4);
    word-break: break-word;
}

.feed-post-body a:hover {
    color: var(--feed-violet);
    border-bottom-color: var(--feed-violet);
}

.social-note {
    color: var(--feed-text-muted);
    font-size: 0.9em;
    font-style: italic;
    padding-left: 16px;
    border-left: 2px solid rgba(177, 156, 217, 0.3);
}

/* Long posts collapse with a soft fade until "Read more" is pressed */
.feed-post-body.is-collapsed {
    max-height: 560px;
}

.feed-post-body.is-collapsed::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 120px;
    background: linear-gradient(to bottom, rgba(18, 18, 34, 0), rgba(18, 18, 34, 0.96));
    pointer-events: none;
}

.feed-post-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(177, 156, 217, 0.1);
}

.feed-post-actions:empty { display: none; }

.feed-toggle,
.feed-permalink,
.feed-share {
    background: none;
    border: none;
    padding: 0;
    color: var(--feed-purple);
    font-family: inherit;
    font-size: 0.85em;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.3s ease;
}

.feed-toggle:hover,
.feed-permalink:hover,
.feed-share:hover { color: #fff; }

.feed-toggle:not(.is-visible) { display: none; }

.feed-post-links {
    display: flex;
    gap: 22px;
    margin-left: auto;
}

/* Undated section */
.feed-divider {
    position: relative;
    margin: 60px 0 34px 34px;
    text-align: center;
    color: var(--feed-text-muted);
    font-size: 0.85em;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.feed-divider::before,
.feed-divider::after {
    content: '';
    display: inline-block;
    width: 60px;
    height: 1px;
    vertical-align: middle;
    background: rgba(177, 156, 217, 0.3);
    margin: 0 16px;
}

.feed-post.is-undated::before {
    background: rgba(177, 156, 217, 0.25);
    box-shadow: 0 0 0 5px rgba(177, 156, 217, 0.06);
}

.feed-post.is-undated .feed-post-date { color: var(--feed-text-muted); }

/* Load more / empty */
.feed-more {
    text-align: center;
    margin: 10px 0 0 34px;
}

.feed-more button {
    padding: 16px 40px;
    background: linear-gradient(135deg, var(--feed-purple), var(--feed-blue));
    color: white;
    border: none;
    border-radius: 30px;
    font-family: inherit;
    font-weight: 500;
    font-size: 1em;
    cursor: pointer;
    box-shadow: 0 15px 35px rgba(177, 156, 217, 0.3);
    transition: all 0.4s ease;
}

.feed-more button:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 45px rgba(177, 156, 217, 0.4);
}

.feed-empty {
    display: none;
    margin-left: 34px;
    padding: 50px 30px;
    text-align: center;
    color: var(--feed-text-muted);
    font-style: italic;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(177, 156, 217, 0.2);
    border-radius: 22px;
}

.feed-empty.is-visible { display: block; }

/* ---------- Single post page (layout: social) ---------- */
.social-single {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 20px 80px;
}

.social-single .feed-post {
    margin-left: 0;
    padding: 40px 44px 30px;
}

.social-single .feed-post::before { display: none; }

.social-single .feed-post-body { font-size: 1.15em; }

.social-single-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-top: 40px;
}

.social-single-nav a {
    display: inline-block;
    padding: 16px 38px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.4s ease;
}

.social-single-nav .primary {
    background: linear-gradient(135deg, var(--feed-purple), var(--feed-blue));
    color: white;
    box-shadow: 0 15px 35px rgba(177, 156, 217, 0.3);
}

.social-single-nav .secondary {
    color: var(--feed-purple);
    border: 1px solid rgba(177, 156, 217, 0.4);
}

.social-single-nav a:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 45px rgba(177, 156, 217, 0.35);
}

.social-single-adjacent {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 30px;
    font-size: 0.9em;
}

.social-single-adjacent a {
    color: var(--feed-text-muted);
    text-decoration: none;
    max-width: 48%;
    transition: color 0.3s ease;
}

.social-single-adjacent a:hover { color: var(--feed-violet); }

.social-single-adjacent .next { margin-left: auto; text-align: right; }

/* ---------- Animations ---------- */
@keyframes feed-fade-up {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes feed-shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
    .feed-header { padding: 70px 0 30px; }
    .follow-bar { border-radius: 26px; padding: 16px 18px; }
    .follow-link span { display: none; }
    .follow-link { padding: 10px 12px; }
    .follow-link svg { width: 20px; height: 20px; }
    .feed-timeline::before { left: 12px; }
    .feed-post { margin-left: 24px; padding: 24px 22px 20px; border-radius: 18px; }
    .feed-post::before { left: -29px; width: 9px; height: 9px; top: 32px; }
    .feed-post-body { font-size: 1.02em; }
    .feed-divider, .feed-more, .feed-empty { margin-left: 24px; }
    .social-single .feed-post { padding: 30px 24px 24px; }
    .social-single .feed-post-body { font-size: 1.05em; }
}
