/* ============================================
   Default Theme — Full-Width Feed Layout + Sidebar Footer
   Works with existing Bootstrap grid structure
   No template changes needed!
   ============================================ */

/* ============================
   1. FEED AREA
   Sidebar stays as-is, posts use masonry grid inside the main content area
   ============================ */

/* ============================
   2. MASONRY GRID FOR POSTS
   Targets .js_posts_stream which exists in _posts.tpl
   ============================ */

/* Posts list → masonry columns */
.js_posts_stream > ul {
  column-count: 3;
  column-gap: 16px;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Each post item */
.js_posts_stream > ul > li {
  break-inside: avoid;
  margin-bottom: 16px;
  display: inline-block;
  width: 100%;
}

/* Post card styling */
.js_posts_stream .post {
  margin-bottom: 0;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.js_posts_stream .post:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

/* Post images full width */
.js_posts_stream .post .post-image img,
.js_posts_stream .post .post-gallery img {
  width: 100%;
  display: block;
}

/* Post body */
.js_posts_stream .post .post-body {
  padding: 12px;
}

/* Post text - max 4 lines */
.js_posts_stream .post .post-text {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
}

/* Compact avatar */
.js_posts_stream .post .post-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

/* Compact post actions */
.js_posts_stream .post .post-actions {
  padding: 8px 12px;
  border-top: 1px solid #f0f0f0;
}

.js_posts_stream .post .post-actions .action-btn {
  font-size: 13px;
  padding: 6px 8px;
}

/* Post footer (comments) - hidden by default, show on click */
.js_posts_stream .post .post-footer {
  display: none;
}

/* Compact post stats */
.js_posts_stream .post .post-stats {
  padding: 8px 12px 0;
  font-size: 12px;
}

/* See-more pagination - full width */
.js_posts_stream > .see-more,
.js_posts_stream > .js_see-more {
  column-span: all;
  break-inside: avoid;
  margin-top: 16px;
}

/* ============================
   3. RESPONSIVE MASONRY
   ============================ */

/* Large desktop: 4 columns */
@media (min-width: 1400px) {
  .js_posts_stream > ul {
    column-count: 4;
  }
}

/* Standard desktop: 3 columns (default) */

/* Small desktop: 3 columns */
@media (max-width: 1199.98px) and (min-width: 992px) {
  .js_posts_stream > ul {
    column-count: 3;
  }
}

/* Tablet: 2 columns */
@media (max-width: 991.98px) and (min-width: 576px) {
  .js_posts_stream > ul {
    column-count: 2;
    column-gap: 12px;
  }
}

/* Mobile: 1 column */
@media (max-width: 575.98px) {
  .js_posts_stream > ul {
    column-count: 1;
    column-gap: 0;
  }
}

/* Fluid design: extra columns */
.container-fluid .js_posts_stream > ul {
  column-count: 4;
  column-gap: 20px;
}

@media (min-width: 1600px) {
  .container-fluid .js_posts_stream > ul {
    column-count: 5;
  }
}

@media (max-width: 1199.98px) and (min-width: 992px) {
  .container-fluid .js_posts_stream > ul {
    column-count: 3;
  }
}

@media (max-width: 991.98px) and (min-width: 576px) {
  .container-fluid .js_posts_stream > ul {
    column-count: 2;
  }
}

@media (max-width: 575.98px) {
  .container-fluid .js_posts_stream > ul {
    column-count: 1;
  }
}

/* ============================
   4. SIDEBAR FOOTER LINKS
   (These classes exist in _sidebar.tpl)
   ============================ */
.sidebar-footer-links {
  padding: 0 15px;
}

.sidebar-footer-divider {
  height: 1px;
  background: var(--body-bg-color, #f0f2f5);
  margin: 10px 0;
}

body.night-mode .sidebar-footer-divider {
  background: var(--card-dark-divider, #2e3f4d);
}

.sidebar-footer-copyright {
  font-size: 11px;
  color: #999;
  padding: 6px 0 2px;
  font-weight: 500;
}

body.night-mode .sidebar-footer-copyright {
  color: #666;
}

.sidebar-footer-language {
  padding: 0;
}

.sidebar-footer-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #666 !important;
  text-decoration: none !important;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.sidebar-footer-lang-btn:hover {
  background: var(--body-bg-color, #f0f2f5);
  color: var(--link-color, #5e72e4) !important;
}

body.night-mode .sidebar-footer-lang-btn {
  color: #999 !important;
}

body.night-mode .sidebar-footer-lang-btn:hover {
  background: var(--card-dark-hover, #2b3843);
  color: #fff !important;
}

.sidebar-footer-lang-btn img {
  border-radius: 2px;
  flex-shrink: 0;
}

.sidebar-footer-nav {
  list-style: none;
  padding: 2px 0 0;
  margin: 0;
}

.sidebar-footer-nav li {
  padding: 1px 0;
}

.sidebar-footer-nav li a {
  font-size: 11px;
  color: #999 !important;
  text-decoration: none !important;
  line-height: 1.8;
  transition: color 0.2s ease;
}

.sidebar-footer-nav li a:hover {
  color: var(--link-color, #5e72e4) !important;
}

body.night-mode .sidebar-footer-nav li a {
  color: #666 !important;
}

/* ============================
   5. HIDE OLD FOOTER (bottom bar)
   ============================ */
.footer {
  display: none !important;
}

.mini-footer {
  display: none !important;
}

/* ============================
   6. NIGHT MODE - Posts
   ============================ */
body.night-mode .js_posts_stream .post {
  background: #1e2733;
}

body.night-mode .js_posts_stream .post:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

body.night-mode .js_posts_stream .post .post-actions {
  border-top-color: #2d3748;
}

body.night-mode .js_posts_stream .post .post-stats {
  color: #a0aec0;
}

/* ============================
   7. RTL SUPPORT
   ============================ */
[dir="RTL"] .js_posts_stream > ul {
  direction: rtl;
}
