@charset "UTF-8";
@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600&display=swap');

:root {
    --bg-color: #ffffff;
    --text-main: #2d3748;
    --text-muted: #718096;
    --primary-gradient: linear-gradient(135deg, #F06292 0%, #E91E63 100%);
    --primary-color: #E91E63;
    --radius-box: 24px;
    --radius-btn: 12px;
    --left-sidebar-bg: #ffffff; 
    --right-sidebar-bg: #ffffff;
}

body {
    font-family: 'Prompt', sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column; 
    overflow-x: hidden;
}

/* --- TOP BAR --- */
.top-bar { background-color: #ffffff; border-bottom: 1px solid #f1f1f1; padding: 10px 0; }
.top-bar-inner { max-width: 1600px; margin: 0 auto; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; }
.tb-left, .tb-right { flex: 1; display: flex; align-items: center; font-size: 1.1rem; color: var(--text-muted); }
.tb-center { flex: 0 0 auto; text-align: center; padding: 0 20px; }
.site-logo { width: 180px; height: 180px; object-fit: contain; display: block; }
.tb-right { justify-content: flex-end; gap: 15px; }
.social-link { color: var(--text-muted); font-size: 1.5rem; transition: color 0.2s; }
.social-link:hover { color: var(--primary-color); }

/* --- HEADER --- */
header { background: var(--primary-gradient); padding: 15px 0; position: sticky; top: 0; z-index: 1000; box-shadow: 0 4px 15px rgba(233, 30, 99, 0.2); }
.header-inner { max-width: 1600px; margin: 0 auto; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; }
.brand-text { color: #ffffff; font-size: 24px; font-weight: 700; letter-spacing: -0.5px; text-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.search-form { display: flex; gap: 10px; align-items: center; }
.form-control { padding: 8px 15px; border-radius: 50px; border: 2px solid transparent; background: #ffffff; font-family: 'Prompt', sans-serif; font-size: 0.9rem; color: var(--text-main); outline: none; transition: all 0.2s; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.form-control:focus { box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3); }
.search-btn { background: #ffffff; color: var(--primary-color); border: none; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform 0.2s; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.search-btn:hover { transform: scale(1.1); background: #fff; color: #C2185B; }

/* --- MAIN LAYOUT --- */
.main-wrapper {
    display: grid;
    grid-template-columns: 300px 1fr 300px; 
    width: 100%;
    min-height: calc(100vh - 300px);
    align-items: start;
}

/* 1. LEFT COLUMN: BLUESKY FEED */
.col-left {
    background-color: var(--left-sidebar-bg);
    padding: 30px 20px 30px 40px; 
    height: 20%;
    position: relative; 
}
.col-left::after {
    content: "";
    position: absolute;
    right: -8px;
    width: 2px;
    background-color: #D9D7D7;
    top: 50px;
    bottom: 50px;
}

.bsky-header {
    display: flex; align-items: center; gap: 10px; margin-bottom: 25px;
    font-weight: 700; color: var(--text-main); font-size: 1.2rem; letter-spacing: -0.5px;
}
.bsky-item {
    display: block; background-color: transparent; padding: 25px 0;
    border-bottom: 1px solid #e2e8f0; text-decoration: none; color: inherit; transition: opacity 0.2s;
}
.bsky-item:first-child { padding-top: 0; }
.bsky-item:last-child { border-bottom: none; }
.bsky-item:hover { opacity: 0.6; }
.bsky-time { font-size: 0.8rem; color: #E91E63; font-weight: 600; margin-bottom: 8px; display: block; }
.bsky-text { font-size: 0.95rem; color: #4a5568; line-height: 1.6; }
.bsky-image-container { margin-top: 12px; border-radius: 12px; overflow: hidden; border: 1px solid rgba(0,0,0,0.05); }
.bsky-img-thumb { width: 100%; height: auto; display: block; object-fit: cover; }
.bsky-stats { font-size: 0.8rem; color: #a0aec0; margin-top: 12px; display: flex; gap: 15px; }

/* 2. CENTER COLUMN: MAIN CONTENT */
.col-center {
    padding: 40px 20px; 
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.post-card { 
    background: transparent; padding: 0 0 40px 0; margin-bottom: 40px; 
    box-shadow: none; border: none; border-radius: 0; border-bottom: 1px solid #f1f1f1; 
}
.post-card:last-child { border-bottom: none; margin-bottom: 0; }

.post-content-wrapper { padding: 0; } 
.post-meta { display: flex; align-items: center; margin-bottom: 15px; }
.post-date-badge { background: #FCE4EC; color: #E91E63; padding: 5px 12px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.divider { display: none; }
.post-text { font-size: 1.1rem; color: #2d3748; line-height: 1.8; word-wrap: break-word; }

/* [แก้ไข] ส่วนแสดงรูปภาพ */
.post-image-container { 
    width: 100%; 
    overflow: hidden; 
    margin-top: 25px; 
    border-radius: 12px; 
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: center; /* จัดกึ่งกลาง */
    background-color: #fafafa;
}

.post-image { 
    /* แสดงขนาดตามจริง แต่ไม่เกินหน้าจอ */
    width: auto; 
    max-width: 100%; 
    display: block; 
    object-fit: contain; 
    transition: transform 0.5s ease; 
}
.post-card:hover .post-image { transform: scale(1.02); }

/* 3. RIGHT COLUMN: CATEGORIES */
.col-right {
    background-color: var(--right-sidebar-bg);
    padding: 40px 20px; height: 100%; text-align: right; border-left: none;
}
.cat-menu ul { list-style: none; padding: 0; margin: 0; position: sticky; top: 100px; }
.cat-menu li { margin-bottom: 8px; }
.cat-menu a {
    text-decoration: none; font-size: 1.8rem; font-weight: 600; color: #94a3b8; 
    text-transform: uppercase; transition: all 0.3s; display: block; padding: 5px 10px;
}
.cat-menu a:hover, .cat-menu a.active { color: var(--primary-color); transform: translateX(-5px); }

/* --- OTHER ELEMENTS --- */
.pagination { display: flex; justify-content: center; gap: 15px; margin-bottom: 60px; padding-top: 20px; }
.btn { padding: 10px 20px; background: #ffffff; color: var(--text-main); text-decoration: none; border-radius: 8px; font-weight: 600; border: 1px solid #eee; transition: all 0.3s; }
.btn:hover:not(.disabled) { background: var(--primary-color); color: white; border-color: var(--primary-color); }
.btn.disabled { background: #f9f9f9; color: #cbd5e0; cursor: default; border-color: transparent; }
.alert-box { background-color: #ffebee; color: #c62828; padding: 15px; border-radius: 8px; margin-bottom: 20px; border: 1px solid #ffcdd2; text-align: center; }

/* --- FOOTER ANIMATION & LAYOUT --- */
.animated-footer { 
    position: relative; width: 100%; height: 450px; background: #bfe3a8; 
    overflow: hidden; margin-top: auto; border-top: 1px solid #a5c990; 
}
.scene { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.grass { position: absolute; bottom: 0; left: -10%; width: 120%; height: 36%; background: #eefad8; border-radius: 60% 60% 0 0; }
.tree { position: absolute; bottom: 20%; transform: scale(0.8); transform-origin: bottom center; }
.tree.left { left: 10%; }
.tree.right { right: 10%; }
.trunk { width: 36px; height: 220px; background: #b97a56; margin: auto; border-radius: 20px; }
.leaf { position: absolute; background: #2fb44a; border-radius: 50%; }
.leaf.l1 { width: 220px; height: 160px; left: -90px; bottom: 160px; }
.leaf.l2 { width: 260px; height: 180px; left: -120px; bottom: 200px; }
.leaf.l3 { width: 200px; height: 150px; left: -40px; bottom: 230px; }
.slime-layer { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.slime { position: absolute; border-radius: 50%; opacity: 0.9; will-change: transform; top: 0; left: 0; }
.blue { background: #2f8cff; }
.pink { background: #e24b8d; }

/* --- FOOTER INFO BOX --- */
.footer-info-container {
    position: relative; z-index: 10; max-width: 1200px; margin: 0 auto; padding: 40px 20px 0 20px; 
}
.footer-glass-box {
    display: flex; flex-wrap: wrap; background: rgba(255, 255, 255, 0.4); 
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border-radius: 16px; padding: 20px; border: 1px solid rgba(255, 255, 255, 0.5); 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.footer-col { flex: 1; padding: 10px 20px; min-width: 200px; box-sizing: border-box; }
.footer-col:not(:last-child) { border-right: 1px solid rgba(0, 0, 0, 0.1); }
.footer-col h4 { margin: 0 0 15px 0; color: var(--primary-color); font-size: 1.1rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { text-decoration: none; color: var(--text-main); transition: color 0.2s; font-size: 0.95rem; }
.footer-links a:hover { color: var(--primary-color); text-decoration: underline; }
.author-bio { font-size: 0.9rem; color: #4a5568; line-height: 1.6; margin: 0; }
.center-flex { display: flex; justify-content: center; align-items: center; }
.author-avatar { width: 100px; height: 100px; border-radius: 50%; overflow: hidden; border: 4px solid rgba(255,255,255,0.8); box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.author-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* --- RESPONSIVE --- */
@media (max-width: 1200px) {
    .main-wrapper { grid-template-columns: 300px 1fr 300px; }
}
@media (max-width: 900px) {
    .top-bar-inner { flex-direction: column; gap: 15px; }
    .tb-left, .tb-right { justify-content: center; }
    .header-inner { flex-direction: column; }
    .search-form { width: 100%; flex-wrap: wrap; justify-content: center; }
    .form-control { flex-grow: 1; }
    .main-wrapper { display: flex; flex-direction: column; }
    .col-right {
        order: 1; width: 100%; height: auto; background: #ffffff; padding: 10px 15px;
        text-align: center; border-left: none; border-bottom: 1px solid #f1f1f1; 
    }
    .cat-menu ul { 
        position: static; display: flex; flex-wrap: nowrap; overflow-x: auto;
        justify-content: flex-start; gap: 8px; padding-bottom: 5px;
    }
    .cat-menu ul::-webkit-scrollbar { display: none; }
    .cat-menu li { margin-bottom: 0; flex-shrink: 0; }
    .cat-menu a { 
        font-size: 0.85rem; background: transparent; border: 1px solid #eee;  
        padding: 6px 14px; border-radius: 20px; color: var(--text-muted); 
    }
    .cat-menu a.active { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }
    .col-center { order: 2; padding: 20px; }
    .col-left { 
        order: 3; width: 100%; border-top: 10px solid #f5f5f5; border-right: none; padding: 30px 20px; 
    }
    .col-left::after { display: none; }
}
@media (max-width: 768px) {
    .footer-glass-box { flex-direction: column; }
    .footer-col { border-right: none !important; border-bottom: 1px solid rgba(0,0,0,0.05); padding: 20px 0; text-align: center; }
    .footer-col:last-child { border-bottom: none; }
}
/* --- Comment CSS --- */
.comment-item:last-child { border-bottom: none !important; }
.g-recaptcha { transform:scale(0.9); transform-origin:0 0; }
@media(max-width: 500px) {
    .comment-item { flex-direction: column; }
    .comment-item img { width: 40px; height: 40px; }
}