:root { 
    --primary: #e53935; 
    --primary-hover: #c62828;
    --dark: #222; 
    --bg: #f8f9fa; 
    --card-bg: #ffffff;
    --border: #e9ecef;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Mukta", sans-serif; background: var(--bg); color: var(--dark); line-height: 1.8; }
header { background: #fff; border-bottom: 2px solid var(--border); padding: 16px 20px; text-align: center; }
header a { font-size: 26px; font-weight: bold; color: var(--primary); text-decoration: none; }
.container { max-width: 820px; margin: 30px auto; padding: 0 16px; }

/* Category Grid on Home Page */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; margin-top: 25px; }
.category-card { 
    background: #e53935; 
    border-radius: 8px; 
    aspect-ratio: 1 / 1; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    text-align: center; 
    padding: 20px; 
    text-decoration: none; 
    color: #ffffff; 
    font-size: 22px; 
    font-weight: 700; 
    line-height: 1.4;
    box-shadow: 0 3px 8px rgba(229, 57, 53, 0.2); 
    transition: transform 0.15s ease, background-color 0.15s ease;
}
.category-card:hover { transform: translateY(-3px); background-color: var(--primary-hover); }

/* Story Grid on Category & Tag Pages */
.story-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; margin-top: 20px; }
.story-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: transform 0.15s; }
.story-card:hover { transform: translateY(-3px); }
.card-thumb { width: 100%; aspect-ratio: 1 / 1; background: #eee; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.no-thumb { font-size: 44px; }
.card-body { padding: 14px; flex-grow: 1; }
.card-body h3 { font-size: 17px; margin-bottom: 6px; color: #111; line-height: 1.35; }
.card-date { font-size: 12px; color: #777; margin-bottom: 8px; }
.card-desc { font-size: 13px; color: #555; line-height: 1.5; }

/* Story Single View */
.story-header h1 { font-size: 32px; line-height: 1.3; color: #111; margin-bottom: 10px; }
.meta-bar { font-size: 13px; color: #666; margin-bottom: 18px; }
.badge { background: #ffebee; color: var(--primary); padding: 4px 8px; border-radius: 4px; margin-right: 6px; font-size: 12px; text-decoration: none; display: inline-block; margin-bottom: 4px; }
.story-image-wrap { width: 100%; max-width: 480px; margin: 20px auto 25px auto; aspect-ratio: 1 / 1; background: #fafafa; border: 1px solid var(--border); border-radius: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.story-img { width: 100%; height: 100%; object-fit: contain; }
.story-body p { margin-bottom: 18px; font-size: 18px; line-height: 1.85; }

/* Author Box */
.author-box { display: flex; align-items: center; gap: 16px; background: #fff; border: 1px solid var(--border); padding: 18px; border-radius: 8px; margin-top: 35px; }
.author-box h4 { margin-bottom: 4px; font-size: 17px; color: #111; }
.author-box p { font-size: 14px; color: #555; line-height: 1.5; }

/* Comments Section */
.comments-section { margin-top: 40px; padding-top: 20px; border-top: 2px solid var(--border); }
.comment-card { background: #fff; padding: 14px 18px; border-radius: 6px; border-left: 3px solid var(--primary); margin-bottom: 12px; font-size: 14px; border-top: 1px solid var(--border); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.comment-date { font-size: 11px; color: #888; margin-left: 6px; }

/* Global Footer */
footer { text-align: center; padding: 30px 16px; font-size: 13px; color: #666; margin-top: 50px; border-top: 1px solid var(--border); background: #fff; }
.footer-links { margin-bottom: 12px; }
.footer-links a { margin: 0 10px; color: #555; text-decoration: none; font-weight: 500; }
.footer-links a:hover { color: var(--primary); }

/* Tag Cloud Section */
.tag-cloud-section {
    margin-top: 55px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}
.tag-cloud-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px 20px;
    margin-top: 18px;
}
.tag-cloud-item {
    color: #444;
    text-decoration: none;
    line-height: 1.3;
    font-weight: 500;
    transition: color 0.15s ease, transform 0.15s ease;
}
.tag-cloud-item:hover {
    color: var(--primary);
    transform: scale(1.08);
}
.tag-cloud-item .tag-count {
    font-size: 0.65em;
    color: #888;
    vertical-align: super;
    margin-left: 2px;
}