/**
 * Site-wide homepage-style buttons (pill CTAs)
 * Loaded on all pages — Bootstrap + Tailwind layouts
 */

/* ---- Shared base ---- */
.btn-home-primary,
.btn-home-outline,
.btn-home-gold,
.btn-home-light,
.btn-home-light-outline,
.btn-home-muted,
.btn-home-sm-outline,
.btn.btn-primary:not(.btn-close),
.btn.btn-success,
.btn.btn-warning,
.btn.btn-outline-primary,
.btn.btn-outline-light,
.btn.btn-outline-secondary,
.btn.btn-light,
.contact-btn-primary,
.about-btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 9999px;
  border-width: 2px;
  border-style: solid;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.btn-home-primary:focus-visible,
.btn-home-outline:focus-visible,
.btn-home-gold:focus-visible,
.btn-home-light:focus-visible,
.btn-home-light-outline:focus-visible,
.btn-home-muted:focus-visible,
.btn-home-sm-outline:focus-visible,
.btn.btn-primary:focus-visible,
.btn.btn-success:focus-visible,
.btn.btn-warning:focus-visible,
.btn.btn-outline-primary:focus-visible,
.btn.btn-outline-light:focus-visible,
.btn.btn-outline-secondary:focus-visible {
  outline: 2px solid #c9a96a;
  outline-offset: 2px;
}

/* Teal filled — primary CTA */
.btn-home-primary,
.btn.btn-primary:not(.btn-close),
.btn.btn-success,
.contact-btn-primary {
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  background-color: #0f766e;
  border-color: #0f766e;
  color: #fff;
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.28);
}

.btn-home-primary:hover,
.btn.btn-primary:not(.btn-close):hover,
.btn.btn-success:hover,
.contact-btn-primary:hover,
.btn-home-primary:focus,
.btn.btn-primary:not(.btn-close):focus,
.btn.btn-success:focus {
  background-color: #0d5f59;
  border-color: #0d5f59;
  color: #fff;
  box-shadow: 0 6px 20px rgba(15, 118, 110, 0.35);
}

/* Teal outline */
.btn-home-outline,
.btn.btn-outline-primary {
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  background-color: transparent;
  border-color: #0f766e;
  color: #0f766e;
}

.btn-home-outline:hover,
.btn.btn-outline-primary:hover,
.btn-home-outline:focus,
.btn.btn-outline-primary:focus {
  background-color: #0f766e;
  border-color: #0f766e;
  color: #fff;
}

/* Gold filled / gradient — donate & highlights */
.btn-home-gold,
.btn.btn-warning,
.about-btn-gold {
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(105deg, #c9a96a 0%, #d4af77 50%, #e8d5a8 100%);
  border-color: #c9a96a;
  color: #1c2220;
  box-shadow: 0 4px 14px rgba(201, 169, 106, 0.35);
}

.btn-home-gold:hover,
.btn.btn-warning:hover,
.about-btn-gold:hover,
.btn-home-gold:focus,
.btn.btn-warning:focus {
  filter: brightness(1.06);
  border-color: #d4af77;
  color: #1c2220;
  box-shadow: 0 6px 22px rgba(201, 169, 106, 0.45);
}

/* On dark heroes */
.btn-home-light-outline,
.btn.btn-outline-light {
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  background-color: transparent;
  border-color: rgba(255, 255, 255, 0.85);
  color: #fff;
}

.btn-home-light-outline:hover,
.btn.btn-outline-light:hover,
.btn-home-light-outline:focus,
.btn.btn-outline-light:focus {
  background-color: #fff;
  border-color: #fff;
  color: #0f766e;
}

.btn-home-light,
.btn.btn-light {
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  background-color: #fff;
  border-color: #fff;
  color: #0f766e;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.btn-home-light:hover,
.btn.btn-light:hover {
  background-color: #f9f4eb;
  border-color: #f9f4eb;
  color: #0d5f59;
}

/* Neutral — reset, secondary */
.btn-home-muted,
.btn.btn-outline-secondary {
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  background-color: #fff;
  border-color: #d6d3d1;
  color: #57534e;
}

.btn-home-muted:hover,
.btn.btn-outline-secondary:hover {
  background-color: #f5f5f4;
  border-color: #a8a29e;
  color: #1c1917;
}

/* Small outline */
.btn-home-sm-outline,
.btn.btn-sm.btn-outline-primary {
  min-height: auto;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  background-color: transparent;
  border-color: #0f766e;
  color: #0f766e;
}

.btn-home-sm-outline:hover,
.btn.btn-sm.btn-outline-primary:hover {
  background-color: #0f766e;
  color: #fff;
}

/* Compact (header, tight layouts) */
.btn-home-sm {
  min-height: 2.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Large / full width */
.btn-home-lg,
.btn.btn-lg.btn-primary,
.btn.btn-lg.btn-success,
.btn.btn-lg.btn-warning,
.btn.btn-lg.btn-outline-primary,
.btn.btn-lg.btn-outline-light,
.btn.btn-lg.btn-outline-secondary {
  min-height: 3.25rem;
  padding: 1rem 2rem;
  font-size: 1.05rem;
}

.btn-home-hero {
  min-height: 3.25rem;
  padding: 0.875rem 2rem;
  font-size: 1rem;
}

.btn-home-block,
.btn.w-100.btn-primary,
.btn.w-100.btn-success,
.btn.w-100.btn-warning {
  width: 100%;
}

/* Header: Upcoming Events glow */
.btn-events-glow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 9999px;
  border-width: 2px;
  border-style: solid;
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  background-color: #fff;
  border-color: #0f766e;
  color: #0f766e;
  box-shadow:
    0 0 10px rgba(15, 118, 110, 0.45),
    0 0 22px rgba(201, 169, 106, 0.35);
  animation: events-glow-pulse 2.4s ease-in-out infinite;
}

.btn-events-glow:hover,
.btn-events-glow:focus {
  background-color: rgba(15, 118, 110, 0.08);
  color: #0f766e;
  box-shadow:
    0 0 14px rgba(15, 118, 110, 0.55),
    0 0 28px rgba(201, 169, 106, 0.45);
}

.btn-events-glow.active {
  background-color: rgba(15, 118, 110, 0.1);
  border-color: #c9a96a;
}

@keyframes events-glow-pulse {
  0%,
  100% {
    box-shadow:
      0 0 8px rgba(15, 118, 110, 0.4),
      0 0 18px rgba(201, 169, 106, 0.28);
    border-color: #0f766e;
  }
  50% {
    box-shadow:
      0 0 16px rgba(15, 118, 110, 0.65),
      0 0 30px rgba(201, 169, 106, 0.5),
      0 0 44px rgba(15, 118, 110, 0.22);
    border-color: #c9a96a;
  }
}

/* Footer newsletter */
footer .btn.btn-primary {
  border-radius: 9999px;
  background-color: #0f766e;
  border-color: #0f766e;
}

footer .btn.btn-primary:hover {
  background-color: #0d5f59;
  border-color: #0d5f59;
}

/* Admin / destructive (view-emails) */
.btn.btn-danger,
.btn.btn-sm.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border-radius: 9999px;
  border-width: 2px;
  border-style: solid;
}

.btn.btn-sm.btn-danger {
  padding: 0.35rem 0.85rem;
  font-size: 0.8125rem;
}

/* Handheld: comfortable tap targets (min 44–48px) */
@media (max-width: 639px) {
  .btn-home-primary,
  .btn-home-outline,
  .btn-home-gold,
  .btn-home-muted,
  .btn-home-light-outline,
  .btn-events-glow {
    min-height: 3rem;
    padding-top: 0.875rem;
    padding-bottom: 0.875rem;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .btn-home-block {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn-events-glow {
    animation: none;
    box-shadow:
      0 0 12px rgba(15, 118, 110, 0.5),
      0 0 20px rgba(201, 169, 106, 0.35);
  }
}

/*
 * Tailwind header bar — keep Upcoming Events + Donate visible.
 * (Global .btn-home-gold { display:inline-flex } must not hide these.)
 */
header .header-bar-actions {
  flex-shrink: 0;
}

header .header-bar-events,
header .header-bar-donate {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem !important;
  padding: 0.5rem 0.875rem !important;
  font-size: 0.8125rem !important;
  border-width: 2px !important;
  border-style: solid !important;
  white-space: nowrap;
}

@media (min-width: 640px) {
  header .header-bar-events,
  header .header-bar-donate {
    min-height: 2.5rem !important;
    padding: 0.5rem 1rem !important;
    font-size: 0.875rem !important;
  }
}

/* Handheld / tablet below desktop: Events only in hamburger menu */
@media (max-width: 1023px) {
  header .header-bar-events {
    display: none !important;
  }
}

/* Narrow phones: compact Donate in bar */
@media (max-width: 639px) {
  header .header-bar-donate {
    min-height: 2.25rem !important;
    padding: 0.4rem 0.55rem !important;
    font-size: 0.6875rem !important;
  }
}

@media (max-width: 389px) {
  header .header-bar-donate {
    padding: 0.4rem 0.5rem !important;
  }
}

#tw-mobile-panel .btn-events-glow,
#tw-mobile-panel .btn-home-gold {
  display: inline-flex !important;
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  border-width: 2px;
}
