@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

#floating-icons { 
    position: fixed; 
    right: 20px; 
    top: 165px; 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
    z-index: 9999; 
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out, transform 0.3s ease-in-out;
}
#floating-icons.show-icons {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.float-btn {
    background: #d32f2f;
    color:#fff;
    border:none;
    width:40px;
    height:40px;
    border-radius:50%;
    font-size:22px;
    cursor:pointer;
    box-shadow:0 4px 8px rgba(0,0,0,0.2);
    transition:0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.float-btn:hover { background:#b71c1c; }
.float-btn svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
}

/* Popup animation styles - FIXED */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgb(0 0 0 / 80%);
    z-index: 10000;
    overflow-y: auto; 
    opacity: 0;
    transition: opacity 0.2s ease-out;
    display: none;
    pointer-events: none;
}
.popup.show {
    opacity: 1; /* Fade in the background */
    display: block; /* Show when active */
    pointer-events: auto; /* Allow interaction when shown */
}
.popup-content {
    background: #fff;
    margin: 5% auto;
    padding: 20px;
    width: 85%;
    max-width: 95%;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    overflow-y: auto; 
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.popup.show .popup-content {
    opacity: 1;
    transform: translateY(0);
}

.closeBtn { float:right; font-size:24px; cursor:pointer; }
.popup-content h3 {
    margin-top: 0;
    font-size: 24px;
    padding-left: 8px;
    padding-top: 5px;
    color: #c4161c;
    font-weight: 700;
    font-family: 'Poppins';
    margin-bottom:0;
}
.popup-content a { text-decoration:none; color:#333; }
.popup-content a:hover { color:#d32f2f; }
#recent-posts-grid ul, #trending-posts-grid ul { list-style:none; padding-left:0; display:grid; grid-template-columns:1fr; gap:10px; }

#recent-posts-grid li {
    display:flex;
    align-items:center;
    gap:20px;
    padding:15px 10px;
    position:relative;
    margin-left:0px;
}

#trending-posts-grid li {
    display:flex;
    align-items:center;
    gap:20px;
    padding:20px 8px;
    position:relative;
    margin-left:0px;    
    
}

#recent-posts-grid li a {
    position: relative;
    display: block;
}
#recent-posts-grid li img {
    width: 140px;
    min-width: 140px;
    height: 95px;
    min-height: 95px;
    object-fit: cover;
    flex-shrink: 0;
    border-radius: 3px;
    border:1px solid red;
}

#recent-posts-grid li .post-timeago {
    position: absolute;
    top: 0;
    left: 0;
    background: rgb(211 47 47);
    color: #fff;
    padding: 1px 5px;
    font-weight: 500;
    font-size: 14px;
    font-family: 'Mukta';
}

#trending-posts-grid .nepali-number {
    background: rgba(211, 47, 47, 0.9);
    color: #fff;
    padding: 6px 15px 6px 15px;
    font-weight: bold;
    border-radius: 4px;
    font-size: 21px;
    font-family: 'Mukta';
}
#recent-posts-grid li a.title, #trending-posts-grid li a.title { 
    display:block; 
    color:#333; 
    font-weight:600; 
    line-height:1.4;
    font-size: 18px; 
    font-family: 'Mukta'; 
}
#recent-posts-grid li a.title:hover, #trending-posts-grid li a.title:hover { color:#d32f2f; }



@media (min-width: 769px) and (max-width: 1150px) {
  #recent-posts-grid ul,
  #trending-posts-grid ul {
    grid-template-columns: repeat(2, 1fr);
  }
}


@media (min-width: 1151px) {
  #recent-posts-grid ul,
  #trending-posts-grid ul {
    grid-template-columns: repeat(3, 1fr);
  }
}


@media (max-width: 768px) { 
    .popup-content {
        margin: 7% auto;
		width:90%;	
    }
	
    #recent-posts-grid ul, #trending-posts-grid ul { grid-template-columns:1fr; } 
	
	#recent-posts-grid li img {
    width: 100px !important;
    min-width: 100px !important;
    height: 80px !important;
    min-height: 80px !important;
}
	.popup-content{padding: 8px;}	
	#recent-posts-grid li .post-timeago {font-size:12px;padding: 0px 4px;}
	
	#recent-posts-grid li:nth-last-child(-n+3) {
    display: none;
}
	#trending-posts-grid li:nth-last-child(-n+2) {
    display: none;
}
	
	
	#trending-posts-grid li {
        padding: 10px 5px 22px 5px;
        border-bottom: 1px solid #d7d7d7;
    }

	#recent-posts-grid li {padding: 10px 5px;border-bottom: 1px solid #d7d7d7;}	
	.closeBtn {
    font-size: 32px;
    margin-right: 5px;
    margin-top: 5px;
}
	.float-btn {width:35px;height:35px;}	
	
}