/* ==========================================================================
   Gugudde TV — Components
   ========================================================================== */

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  padding: 0.9rem 1.75rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--fs-sm);
  letter-spacing: 0.02em;
  white-space: nowrap;
  min-height: 44px;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
.btn svg { width: 1.1em; height: 1.1em; flex-shrink: 0; }

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

.btn--accent {
  background: var(--color-accent);
  color: var(--color-on-accent);
  box-shadow: var(--shadow-gold);
}
.btn--accent:hover { background: var(--gold-300); color: var(--color-on-accent); transform: translateY(-2px); }

.btn--outline {
  background: transparent;
  color: var(--white);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
}
.btn--outline:hover { background: rgba(255, 255, 255, 0.12); color: var(--white); border-color: var(--white); }

.btn--outline-dark {
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
}
.btn--outline-dark:hover { background: var(--color-primary); color: var(--white); }

.btn--ghost {
  background: transparent;
  color: var(--color-primary);
  padding-inline: 0.25rem;
}
.btn--ghost:hover { color: var(--purple-500); gap: var(--space-xs); }

.btn--sm { padding: 0.6rem 1.25rem; font-size: var(--fs-xs); min-height: 38px; }
.btn--block { width: 100%; }

/* ---- Badges / pills ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.3em 0.85em;
  border-radius: var(--radius-pill);
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.badge--worship { background: var(--purple-100); color: var(--purple-700); }
.badge--teaching { background: var(--navy-500); color: var(--white); }
.badge--news { background: var(--gold-100); color: var(--gold-600); }
.badge--live {
  background: #fff0e8;
  color: #C63B1D;
}
.badge--general { background: var(--gray-200); color: var(--gray-600); }
.badge--dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge--live .badge--dot { animation: pulse-dot 1.6s ease-in-out infinite; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* ---- Cards ---- */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }

.card--pillar {
  padding: var(--space-lg) var(--space-md);
  text-align: left;
  border: 1px solid var(--color-border);
  box-shadow: none;
}
.card--pillar .card__icon {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: var(--radius-md);
  background: var(--gradient-brand);
  color: var(--white);
  margin-bottom: var(--space-md);
}
.card--pillar .card__icon svg { width: 28px; height: 28px; }

.card--value {
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  box-shadow: none;
  height: 100%;
}
.card--value:hover { border-color: var(--color-accent); }
.card--value .card__icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--purple-100);
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}
.card--value .card__icon svg { width: 24px; height: 24px; }

.card--program {
  position: relative;
  border-radius: var(--radius-lg);
  aspect-ratio: 4/5;
}
.card--program img {
  width: 100%; height: 100%;
  object-fit: cover;
  position: absolute; inset: 0;
  transition: transform var(--dur-slow) var(--ease-out);
}
.card--program:hover img { transform: scale(1.08); }
.card--program::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(16,27,61,0) 35%, rgba(16,27,61,0.92) 100%);
}
.card--program__body {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: var(--space-md);
  z-index: 2;
  color: var(--white);
}
.card--program__body h3 { font-size: var(--fs-h5); margin-bottom: 0.35rem; color: var(--white); }
.card--program__body p { color: var(--gray-300); font-size: var(--fs-sm); margin: 0; }
.card--program__play {
  position: absolute; top: var(--space-sm); right: var(--space-sm);
  z-index: 3;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.16);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.35);
  transition: background var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.card--program__play:hover { background: var(--color-accent); color: var(--color-on-accent); transform: scale(1.08); }
.card--program__play svg { width: 18px; height: 18px; margin-left: 2px; }

.card--news {
  border: 1px solid var(--color-border);
  box-shadow: none;
  display: flex;
  flex-direction: column;
}
.card--news__img { aspect-ratio: 16/10; overflow: hidden; }
.card--news__img img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-slow) var(--ease-out); }
.card--news:hover .card--news__img img { transform: scale(1.06); }
.card--news__body { padding: var(--space-md); flex: 1; display: flex; flex-direction: column; }
.card--news__meta {
  display: flex; align-items: center; gap: var(--space-sm);
  font-size: var(--fs-xs); color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
}
.card--news__meta span { display: inline-flex; align-items: center; gap: 0.35em; }
.card--news__meta svg { width: 14px; height: 14px; }
.card--news h3 { font-size: var(--fs-h5); margin-bottom: var(--space-2xs); }
.card--news h3 a { color: var(--color-text); }
.card--news h3 a:hover { color: var(--color-primary); }
.card--news p { font-size: var(--fs-sm); flex: 1; }
.card--news .btn--ghost { margin-top: var(--space-sm); }

.card--tier {
  padding: var(--space-lg) var(--space-md);
  border: 2px solid var(--color-border);
  box-shadow: none;
  text-align: center;
}
.card--tier--featured { border-color: var(--color-accent); position: relative; }
.card--tier--featured::before {
  content: 'Most Impact';
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 0.35em 1em;
  border-radius: var(--radius-pill);
}
.card--tier__icon {
  width: 60px; height: 60px; margin-inline: auto var(--space-sm);
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--purple-100);
  color: var(--color-primary);
}
.card--tier__icon svg { width: 28px; height: 28px; }

/* ---- Stat counters ---- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
}
.stat {
  text-align: center;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--color-border-dark);
}
.stat__num {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--fs-h2);
  color: var(--gold-300);
  display: block;
  line-height: 1;
  margin-bottom: 0.35rem;
}
.stat__label {
  font-size: var(--fs-sm);
  color: var(--gray-300);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---- Forms ---- */
.field { margin-bottom: var(--space-md); text-align: left; }
.field label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--fs-sm);
  margin-bottom: 0.4rem;
  color: var(--color-text);
}
.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border);
  background: var(--white);
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--purple-100);
  outline: none;
}
.field textarea { min-height: 140px; resize: vertical; }
.field__hint { font-size: var(--fs-xs); color: var(--color-text-muted); margin-top: 0.35rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }

.form-note {
  display: flex; gap: var(--space-2xs);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  background: var(--color-bg-alt);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
  margin-top: var(--space-sm);
}
.form-note svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--color-accent-dark); }

/* ---- Blog feed cards (WP REST) ---- */
.blog-feed__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
}
/* Deterministic 3-across grid for a full-width blog page (e.g. news.html),
   as opposed to the auto-fit teaser grid used on the homepage. Explicit
   column counts read more "organized" than auto-fit, which can vary
   between 3–4 columns depending on exact container width. */
.blog-feed__grid--wide {
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg) var(--space-md);
}
@media (max-width: 900px) {
  .blog-feed__grid--wide { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .blog-feed__grid--wide { grid-template-columns: 1fr; }
}
.blog-feed__state {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  color: var(--color-text-muted);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
}
.skeleton {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
}
.skeleton__img, .skeleton__line {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-300) 37%, var(--gray-200) 63%);
  background-size: 400% 100%;
  animation: skeleton-shine 1.4s ease infinite;
}
.skeleton__img { aspect-ratio: 16/10; }
.skeleton__line { height: 12px; margin: var(--space-md) var(--space-md) 0; border-radius: 6px; }
.skeleton__line + .skeleton__line { width: 60%; margin-top: 0.6rem; margin-bottom: var(--space-md); }
@keyframes skeleton-shine {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* ---- Silhouette avatar (Team page) ---- */
.avatar-slot {
  width: 96px; height: 96px;
  border-radius: 50%;
  margin-inline: auto;
  display: grid; place-items: center;
  background: var(--purple-100);
  border: 3px solid var(--color-accent);
  color: var(--purple-400);
  position: relative;
}
.avatar-slot svg { width: 46px; height: 46px; }

/* ---- Org chart ---- */
.org-node {
  background: var(--white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.org-node--root {
  background: var(--gradient-brand);
  color: var(--white);
  border: none;
  box-shadow: var(--shadow-md);
}
.org-node--root h3 { color: var(--white); margin-bottom: 0.2rem; }
.org-node--mgmt {
  background: var(--navy-700);
  color: var(--white);
  border: none;
}
.org-node--mgmt h3 { color: var(--white); }
.org-node h3 { font-size: var(--fs-h6); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.15rem; }
.org-node span { font-size: var(--fs-xs); color: var(--color-text-muted); }
.org-node--root span, .org-node--mgmt span { color: rgba(255,255,255,0.75); }

/* ---- Utility icon buttons ---- */
.icon-btn {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  transition: background var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.icon-btn svg { width: 20px; height: 20px; }
