/*
Theme Name: Jewish Charity Guide
Template: Divi
Author: Speak Digital
Version: 1.0
*/

/* === Page Styles === */

body #jcg-header {
  background-color: var(--jcg-primary-color) !important;
}

body #jcg-footer {
  background-color: var(--jcg-primary-color) !important;
}


/* style.css in your child theme */
#jcg-header  {
    font-family: 'Domine', serif;
}

#jcg-header h1 {
  text-transform: uppercase;
  font-weight: 700;
}
/* === Charity Grid Styles === */

.filter {
  text-align: center;
  margin: 1rem 0 1rem;
  display: flex;
  flex-wrap: wrap; /* allow wrapping on desktop */
  gap: 8px;
  padding: 10px 0;
  justify-content:  center;
}
.charity-featured-filter span.active {
  background: #3fa34d;
  color: white;
}
.charity-alpha-filter span.active {
  background: #d4af37;
  color: white;
}
.charity-category-filter span.active {
  background: #0073aa;
  color: #fff;
}

.filter span {
  display: inline-block;
  background: #eee;
  padding: 6px 12px;
  margin: 4px;
  border-radius: 4px;
  cursor: pointer;
}



/* MOBILE: force horizontal scroll */
@media (max-width: 768px) {
  .filter {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    justify-content:left ;
  }

  .filter::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
  }

  .filter span {
    flex: 0 0 auto; /* don’t shrink, stay inline */
    white-space: nowrap;
  }
}

.charity-grid {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
}

.charity-grid.hidden {
  visibility: hidden;
}

.charity-grid {
  transition: opacity 0.3s ease;
  opacity: 1;
}

.charity-grid.hidden {
  opacity: 0;
  visibility: hidden;
}

.grid-sizer {
  width: 30%;
}

.charity-card {
  width: calc(30% - 3%); /* accounts for left + right margin */

  margin: 0 1.5% 2rem; /* symmetric horizontal spacing */
  border: 1px solid #ddd;
  background: #fff;
  padding: 1rem;
  border-radius: 6px;
  box-shadow: 0 0 8px rgba(0,0,0,0.05);
}

/*
.charity-card.featured {
  width: calc(60% - 3%); 
}
*/

@media (max-width: 900px) {
  .grid-sizer,
  .charity-card {
    width: 47%;
  } 
}
@media (max-width: 600px) {
  .grid-sizer,
  .charity-card {
    width: 95%;
  }
}

.card-content {
  flex-grow: 1;
}



.charity-card.featured {
  border-color: var(--jcg-primary-color);
  border-width: 3px;
  cursor: pointer;
  height: 400px;
}

.charity-card.featured .card-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%; /* assumes parent has fixed height */
}

.charity-card.featured .card-content .charity-logo {
  flex-grow: 1;
  display: flex;
  align-items: center;  /* vertical center */
  justify-content: center;  /* horizontal center */
  overflow: hidden;
}

.charity-card.featured .card-content .charity-logo img {
  max-width: 100%;
  max-height: 100%;
  height: auto;
  width: auto;
  object-fit: contain;
}

.charity-card.featured .card-content .more-info-btn {
  align-self: flex-start; /* left aligned */
  margin-top: auto;       /* pushes to bottom */
}

.charity-card.featured .card-content .more-info-btn  i {
  color: #fff;
}

.charity-card h3 {
  margin-top: 0; font-size: 18px;
}
.charity-card h4 {
   font-size: 16px; color: #333;
}


.charity-card.featured h3 {
 font-weight: bold;
}

.charity-logo {
  margin: 10px 0;
}

.charity-logo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  object-fit: contain;
  max-height: 200px;
}

.placeholder-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 40px 0;
  background: #e0e0e0;
  color: #555;
  font-size: 28px;
  font-weight: bold;
  text-transform: uppercase;
  border-radius: 4px;
}


.charity-card i {
  margin-right: 0.4em;
  color: #444;
}

.donate-link {
  font-weight: bold;
  color: #b30000;
  text-decoration: none;
}

.donate-link:hover {
  text-decoration: underline;
}

.more-info-btn {
  display: inline-block;
  background-color: #0073aa;
  color: #fff;
  padding: 6px 12px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 14px;
  transition: background-color 0.2s ease-in-out;
  margin-top: 8px;
}

.more-info-btn i {
  margin-right: 6px;
}

.more-info-btn:hover {
  background-color: #005d8f;
}

.charity-modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  overflow-y: auto; /* ✅ allow scrolling when content is long */
  -webkit-overflow-scrolling: touch; /* ✅ smooth iOS scrolling */
  padding: 20px;
  box-sizing: border-box;
}

.modal-content {
  background: #fff;
  max-width: 600px;
  margin: 40px auto; /* adds spacing from top/bottom */
  padding: 20px;
  border-radius: 8px;
  position: relative;
}

.charity-modal .close-btn {
  position: absolute;
  top: 10px; right: 15px;
  font-size: 24px;
  cursor: pointer;
}

.contact-columns {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.contact-item {
  flex: 1 1 45%;
}

.contact-item p {
  margin: 0;
}


#back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #333;
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 4px;
  font-size: 18px;
  cursor: pointer;
  z-index: 999;
}