/* 1333 Feed - shared by feed/index.html and feed/portal.html */
:root {
    --purple-border: #9B6CD8;
    --purple-light: #c4a8e8;
    --purple-lighter: #e0ccf8;
    --text-dark: #322036;
    --mauve: #96799c;
    --teal: #84c4c4;
    --panel-bg: radial-gradient(circle, rgba(255,255,255,1) 58%, rgba(242,232,255,1) 85%, rgba(220,200,248,1) 100%);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'MS UI Gothic', Arial, sans-serif;
    font-size: 14px;
    color: var(--text-dark);
    background: #f8f4ff;
    min-height: 100vh;
    overflow-x: hidden;
}
a { color: var(--text-dark); font-weight: bold; }
img { max-width: 100%; }
button, input, textarea { font-family: inherit; color: var(--text-dark); }

/* ---------- site chrome (matches broadcasts.html) ---------- */
.topnav {
    background: linear-gradient(180deg, #ede0ff 0%, #dcc8f8 40%, #ede0ff 100%);
    border-radius: 0 0 16px 16px;
    border: 2px solid var(--purple-border);
    border-top: none;
    box-shadow: 0 4px 18px rgba(155,108,216,0.2), inset 0 1px 0 rgba(255,255,255,0.7);
    margin: 0 20px 14px;
    position: sticky; top: 0; z-index: 100;
}
.topnav ul {
    display: flex; justify-content: center; align-items: center;
    flex-wrap: wrap; gap: 2px; padding: 7px 15px; list-style: none;
}
.topnav a {
    color: var(--text-dark); padding: 6px 11px; display: inline-block;
    font-size: 11px; font-weight: normal; letter-spacing: 1px; text-transform: uppercase;
    border-radius: 3px; text-decoration: none;
}
.topnav a:hover, .topnav a.active { background: var(--purple-lighter); }

.main-container { max-width: 1200px; margin: 20px auto; padding: 0 20px; }
.page-layout { display: grid; grid-template-columns: 240px minmax(0, 640px); gap: 18px; justify-content: center; }
.header-title {
    background: linear-gradient(180deg, #ede0ff 0%, #dcc8f8 50%, #ede0ff 100%);
    padding: 14px 20px; text-align: center;
    border-radius: 0 0 0 40px;
    border: 2px solid var(--purple-border); border-top: none;
    margin-bottom: 15px;
}
.header-title h1 { font-family: 'basiic', 'MS UI Gothic', Arial, sans-serif; font-size: 24px; letter-spacing: 2px; font-weight: normal; }
.header-title p { font-size: 12px; margin-top: 4px; }

.sidebar-panel {
    background: var(--panel-bg);
    border: 2px solid var(--purple-border);
    padding: 12px; margin-bottom: 12px;
    border-radius: 0 0 0 30px;
}
.sidebar-panel h3 {
    background: linear-gradient(180deg, #e8d4ff 0%, #d8bef8 60%, #e8d4ff 100%);
    padding: 5px 10px; font-size: 10px;
    margin: -12px -12px 10px -12px; text-transform: uppercase; letter-spacing: 1.5px;
}
.sidebar-panel p { font-size: 12px; line-height: 1.5; }
.sidebar-link {
    display: block; padding: 6px 10px; margin-bottom: 4px;
    background: rgba(203,169,244,0.1);
    border-left: 3px solid var(--purple-light);
    color: var(--text-dark); font-size: 11px; text-decoration: none;
}
.sidebar-link:hover, .sidebar-link.active { background: var(--purple-lighter); }

/* ---------- buttons ---------- */
.f-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--purple-lighter); color: var(--text-dark);
    border: 1px solid var(--purple-border); border-radius: 999px;
    padding: 7px 16px; font-size: 13px; font-weight: bold; cursor: pointer;
    text-decoration: none;
}
.f-btn:hover { background: #ffffff; }
.f-btn.primary { background: var(--purple-light); }
.f-btn.primary:hover { background: var(--purple-lighter); }
.f-btn[disabled] { opacity: 0.6; cursor: default; }
.f-btn.danger { border-color: var(--text-dark); }

/* ---------- timeline ---------- */
.f-col { background: #ffffff; border: 2px solid var(--purple-border); border-radius: 0 0 0 30px; overflow: hidden; }
.f-col-head {
    position: sticky; top: 0; z-index: 2;
    background: linear-gradient(180deg, #e8d4ff 0%, #d8bef8 60%, #e8d4ff 100%);
    padding: 10px 16px; font-weight: bold; letter-spacing: 1px; text-transform: uppercase; font-size: 12px;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.f-col-head a { font-size: 11px; text-transform: none; letter-spacing: 0; }
.f-status { padding: 28px 16px; text-align: center; font-size: 13px; }

.f-post { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--purple-lighter); }
.f-post.clickable { cursor: pointer; }
.f-post.clickable:hover { background: #fbf8ff; }
.f-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--purple-lighter); border: 1px solid var(--purple-border);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; overflow: hidden; flex-shrink: 0;
}
.f-avatar img { width: 100%; height: 100%; object-fit: cover; }
.f-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 13px; }
.f-name { font-weight: bold; }
.f-time { font-size: 12px; }
.f-time a { font-weight: normal; text-decoration: none; }
.f-time a:hover { text-decoration: underline; }
.f-kind { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; background: var(--purple-lighter); border-radius: 999px; padding: 1px 8px; }

.f-body { margin-top: 4px; line-height: 1.55; word-wrap: break-word; overflow-wrap: anywhere; }
.f-body p + p { margin-top: 10px; }
.f-body h2 { font-size: 19px; margin: 16px 0 6px; }
.f-body h3 { font-size: 16px; margin: 14px 0 6px; }
.f-body blockquote { border-left: 3px solid var(--purple-light); padding-left: 10px; margin: 10px 0; }
.f-title { font-family: 'basiic', 'MS UI Gothic', Arial, sans-serif; font-size: 20px; font-weight: normal; margin: 4px 0 6px; line-height: 1.3; }
.f-article .f-title { font-size: 26px; }
.f-article .f-body { font-size: 15px; line-height: 1.7; }
.f-more { display: inline-block; margin-top: 6px; }

.f-imgs { display: grid; gap: 4px; margin-top: 10px; border-radius: 14px; overflow: hidden; border: 1px solid var(--purple-lighter); }
.f-imgs.n2, .f-imgs.n4 { grid-template-columns: 1fr 1fr; }
.f-imgs.n3 { grid-template-columns: 1fr 1fr; }
.f-imgs.n3 img:first-child { grid-row: span 2; }
.f-imgs img { width: 100%; height: 100%; max-height: 520px; object-fit: cover; display: block; background: var(--purple-lighter); }
.f-imgs.n2 img, .f-imgs.n3 img, .f-imgs.n4 img { aspect-ratio: 1 / 1; }

.f-actions { display: flex; gap: 22px; margin-top: 10px; }
.f-act {
    background: none; border: none; cursor: pointer;
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 13px; padding: 4px 8px; margin-left: -8px; border-radius: 999px;
}
.f-act:hover { background: var(--purple-lighter); }
.f-act .sym { font-size: 15px; }
.f-act.on { font-weight: bold; }

.f-sentinel { height: 1px; }
.f-toast {
    position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
    background: var(--text-dark); color: #ffffff; padding: 9px 18px; border-radius: 999px;
    font-size: 13px; z-index: 9700; opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
.f-toast.show { opacity: 1; }

/* ---------- replies ---------- */
.f-replies-head { padding: 10px 16px; font-weight: bold; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; background: #fbf8ff; border-bottom: 1px solid var(--purple-lighter); }
.f-reply-box { padding: 12px 16px; border-bottom: 1px solid var(--purple-lighter); }
.f-reply-box textarea, .f-input, .f-textarea {
    width: 100%; border: 1px solid var(--purple-border); border-radius: 10px;
    padding: 10px 12px; font-size: 14px; background: #ffffff; resize: vertical;
}
.f-reply-box textarea { min-height: 70px; }
.f-reply-box .row, .f-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.f-count { font-size: 12px; }
.f-post.reply .f-avatar { width: 36px; height: 36px; font-size: 16px; }
.f-post.reply { grid-template-columns: 36px minmax(0, 1fr); }
.f-del { background: none; border: none; cursor: pointer; font-size: 12px; text-decoration: underline; padding: 0; }

/* ---------- portal ---------- */
.f-composer { padding: 16px; border-bottom: 2px solid var(--purple-lighter); }
.f-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.f-tab { border: 1px solid var(--purple-border); background: #ffffff; border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 13px; }
.f-tab.on { background: var(--purple-lighter); font-weight: bold; }
.f-input { margin-bottom: 10px; font-size: 16px; }
.f-textarea { min-height: 130px; line-height: 1.5; }
.f-textarea.article { min-height: 360px; }
.f-hint { font-size: 12px; margin-top: 6px; line-height: 1.5; }
.f-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.f-thumb { position: relative; width: 88px; height: 88px; border-radius: 10px; overflow: hidden; border: 1px solid var(--purple-border); }
.f-thumb img { width: 100%; height: 100%; object-fit: cover; }
.f-thumb button {
    position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%;
    background: var(--text-dark); color: #ffffff; border: none; cursor: pointer; font-size: 13px; line-height: 24px;
}
.f-file { display: none; }
.f-preview { margin-top: 12px; border: 1px dashed var(--purple-border); border-radius: 12px; }
.f-msg { font-size: 13px; margin-top: 8px; min-height: 1em; }
.f-admin-row { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }

@media (max-width: 900px) {
    .page-layout { grid-template-columns: minmax(0, 1fr); }
    .sidebar-left { order: 2; }
}
@media (max-width: 480px) {
    .topnav { position: static; margin: 5px 8px; border-radius: 15px; }
    .topnav a { padding: 9px 8px; font-size: 10px; letter-spacing: 0.5px; }
    .main-container { padding: 0 10px; }
    .f-post { grid-template-columns: 36px minmax(0, 1fr); gap: 10px; padding: 12px; }
    .f-avatar { width: 36px; height: 36px; font-size: 16px; }
    .f-article .f-title { font-size: 22px; }
}
