/*
 * Khidmah Foundation Bangladesh Custom Styles
 * Note: Base utility styles are injected dynamically via Tailwind CDN script in the HTML files.
 */

/* Custom Animations */
@keyframes blob {
  0% { transform: translate(0px, 0px) scale(1); }
  33% { transform: translate(30px, -50px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
  100% { transform: translate(0px, 0px) scale(1); }
}

.animate-blob {
  animation: blob 7s infinite;
}

.animation-delay-2000 {
  animation-delay: 2s;
}

.animation-delay-4000 {
  animation-delay: 4s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* Base Styles */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
}

/* Nav Link Hover Effects */
.nav-link {
    color: #374151; /* text-gray-700 */
    padding: 0.5rem 0.75rem; /* py-2 px-3 */
    border-radius: 0.375rem; /* rounded-md */
    font-size: 1rem; /* text-base */
    line-height: 1.5rem;
    font-weight: 600; /* font-semibold */
    transition: color 200ms cubic-bezier(0.4, 0, 0.2, 1), background-color 200ms; /* transition-colors duration-200 */
}

.nav-link:hover {
    color: #5DB846; /* hover:text-kf-green */
}

.nav-link.active {
    color: #5DB846; /* text-kf-green */
    font-weight: 700; /* font-bold */
}

/* Custom logo color filter for placeholder (approximation of the green/blue from logo) */
.kf-logo-filter {
    filter: invert(47%) sepia(87%) saturate(362%) hue-rotate(85deg) brightness(89%) contrast(89%);
}

/* Facebook style grid layout for blog */
.fb-grid {
    display: grid;
    gap: 2px;
}

.fb-grid-1 {
    grid-template-columns: 1fr;
}

.fb-grid-2 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 200px;
}

.fb-grid-3 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 150px 150px;
}
.fb-grid-3 .fb-item:first-child {
    grid-row: span 2;
}

.fb-grid-4 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 120px 120px;
}

.fb-item {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.2s;
}

.fb-item:hover {
    opacity: 0.9;
}

.more-images-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
}

/* Scrollbar customization */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1; 
}
::-webkit-scrollbar-thumb {
    background: #5DB846; 
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #4a9c36; 
}

/* Hide scrollbar for gallery thumbnails */
#thumbnailContainer::-webkit-scrollbar {
    height: 6px;
}

.bg-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Slideshow Animation */
.slideshow {
    position: absolute;
    width: 100%;
    height: 100%;
}
.slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    animation: fadeSlide 24s infinite;
}
.slide-1 {
    background-image: url('img/slider1.jpg');
    animation-delay: 0s;
}
.slide-2 {
    background-image: url('img/slider2.jpg');
    animation-delay: 6s;
}
.slide-3 {
    background-image: url('img/slider3.jpg');
    animation-delay: 12s;
}
.slide-4 {
    background-image: url('img/slider4.jpg');
    animation-delay: 18s;
}

@keyframes fadeSlide {
    0% { opacity: 0; transform: scale(1.05); }
    10% { opacity: 1; transform: scale(1); }
    25% { opacity: 1; transform: scale(1); }
    35% { opacity: 0; transform: scale(1.05); }
    100% { opacity: 0; }
}
