/* ==========================================================================
   COMPONENTS.CSS - Shared Buttons, Cards, Widgets, and Lightbox Dialogs
   ========================================================================== */

/* 1. BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
}

.btn-primary {
  background-color: var(--green);
  color: var(--white);
}

.btn-primary:hover {
  background-color: var(--green-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-lime {
  background-color: var(--lime);
  color: var(--green-dark);
}

.btn-lime:hover {
  background-color: var(--lime-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  border: 2px solid var(--green);
  color: var(--green);
  background-color: transparent;
}

.btn-outline:hover {
  background-color: var(--green);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* 2. STATISTIC COUNTER CARDS */
.stat-card {
  background-color: var(--white);
  padding: 2.25rem 1.5rem;
  border-radius: var(--radius-xl);
  text-align: center;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-300);
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--green), var(--lime));
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.stat-icon {
  width: 3.25rem;
  height: 3.25rem;
  background: var(--lime-light);
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
  font-size: 1.35rem;
  margin-bottom: 1.25rem;
}

.stat-number-wrapper {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--green-dark);
  line-height: 1.1;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

/* 3. PROGRAM SERVICE CARDS */
.program-card {
  background-color: var(--white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-300);
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.program-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.program-image {
  height: 13rem;
  overflow: hidden;
  position: relative;
}

.program-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-slow);
}

.program-card:hover .program-image img {
  transform: scale(1.08);
}

.program-icon-badge {
  position: absolute;
  bottom: -1.5rem;
  right: 1.5rem;
  width: 3.25rem;
  height: 3.25rem;
  background-color: var(--lime);
  color: var(--green-dark);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  font-size: 1.25rem;
  z-index: 2;
  border: 3px solid var(--white);
}

.program-body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.program-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--green-dark);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.program-desc {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
}

/* 4. NEWS SUMMARY CARDS */
.news-card {
  background-color: var(--white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-300);
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.news-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.news-img-wrapper {
  height: 12.5rem;
  overflow: hidden;
  position: relative;
}

.news-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-slow);
}

.news-card:hover .news-img-wrapper img {
  transform: scale(1.08);
}

.news-category-tag {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background-color: var(--green);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.news-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.news-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.news-meta i {
  color: var(--lime);
}

.news-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--green-dark);
  line-height: 1.4;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 3.22rem;
}

.news-card-excerpt {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 1.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.news-read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--green);
  font-size: 0.9rem;
}

.news-read-more i {
  transition: var(--transition-fast);
}

.news-card:hover .news-read-more {
  color: var(--lime-hover);
}

.news-card:hover .news-read-more i {
  transform: translateX(4px);
}

/* 5. LIGHTBOX MODAL DIALOG */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  background-color: rgba(31, 36, 33, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-normal);
}

.lightbox-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  max-width: 90%;
  max-height: 80%;
  position: relative;
  transform: scale(0.9);
  transition: var(--transition-normal);
}

.lightbox-modal.active .lightbox-content {
  transform: scale(1);
}

.lightbox-img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
  color: var(--white);
  text-align: center;
  margin-top: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.lightbox-close {
  position: absolute;
  top: -3rem;
  right: 0;
  color: var(--white);
  font-size: 2rem;
  cursor: pointer;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background-color: rgba(255, 255, 255, 0.1);
  transition: var(--transition-fast);
}

.lightbox-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* 6. BANKING INFO CARDS (DONATION) */
.bank-card {
  background: var(--white);
  border: 1px solid var(--gray-300);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  transition: var(--transition-normal);
}

.bank-card:hover {
  transform: translateX(4px);
  border-color: var(--lime);
  box-shadow: var(--shadow-lg);
}

.bank-info-flex {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.bank-logo {
  height: 2.25rem;
  width: auto;
  object-fit: contain;
}

.bank-details {
  display: flex;
  flex-direction: column;
}

.bank-name {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bank-number {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--green-dark);
  line-height: 1.2;
  margin: 0.1rem 0;
}

.bank-holder {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}

.btn-copy {
  background-color: var(--cream);
  color: var(--green);
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-copy:hover {
  background-color: var(--green);
  color: var(--white);
}

.qris-card {
  background-color: var(--cream);
  border-radius: var(--radius-2xl);
  padding: 2.25rem;
  text-align: center;
  border: 1px dashed var(--green);
  box-shadow: var(--shadow-md);
}

.qris-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--green-dark);
  margin-bottom: 0.5rem;
}

.qris-desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.qris-image {
  background-color: var(--white);
  padding: 1rem;
  border-radius: var(--radius-xl);
  display: inline-block;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
  width: 13rem;
  height: 13rem;
}

.qris-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qris-holder {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}

/* 7. FLOATING WHATSAPP WIDGET */
.wa-widget {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 999;
}

.wa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--radius-full);
  background-color: #25D366;
  color: var(--white);
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3), var(--shadow-xl);
  font-size: 1.75rem;
  transition: var(--transition-normal);
  animation: waPulse 2s infinite;
}

.wa-btn:hover {
  transform: scale(1.1) rotate(5deg);
  background-color: #128C7E;
}

@keyframes waPulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6); }
  70% { box-shadow: 0 0 0 12px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* RESPONSIVE SUB-GRID ADAPTERS */
@media (max-width: 768px) {
  .bank-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }
  .btn-copy {
    width: 100%;
    height: auto;
    padding: 0.65rem;
  }
  .wa-widget {
    bottom: 1.5rem;
    right: 1.5rem;
  }
  .wa-btn {
    width: 3rem;
    height: 3rem;
    font-size: 1.4rem;
  }
}

/* ==========================================================================
   SKELETON LOADING - Animasi placeholder saat data dari API sedang dimuat
   Dipakai oleh: berita.js, galeri.js, program.js
   ========================================================================== */

@keyframes skeleton-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton-card {
  background: var(--cream);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.skeleton-img,
.skeleton-line {
  background: linear-gradient(90deg,
    #e2e8e4 25%,
    #f0f4f1 50%,
    #e2e8e4 75%
  );
  background-size: 400px 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-img {
  width: 100%;
  height: 180px;
  border-radius: 0;
}

.skeleton-img.tall {
  height: 220px;
}

.skeleton-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.skeleton-line {
  height: 14px;
  width: 100%;
}

.skeleton-line.short {
  width: 40%;
  height: 12px;
}

.skeleton-line.medium {
  width: 70%;
}

.skeleton-gallery-item {
  border-radius: var(--radius-md);
  overflow: hidden;
}

