/*   
Theme Name: accordion grid w-photo
Theme URI: 
Description: Custom grid
Author Name: Susan Belanger
Author URI: https://creativelyewe.com
Version: 2
 */

/* Container grid setup */
.two-column-accordion-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  width: 100%;
  max-width: 1200px;
  margin: 40px auto;
  align-items: start;
}

/* Individual grid cell wrapper */
.grid-item {
  position: relative; 
  transition: all 0.3s ease;
}

/* Force open grid row layout to full width */
.grid-item.is-open {
  grid-column: 1 / -1; 
}

.accordion-element {
  display: block;
  width: 100%;
}

/* Summary Box Transformed into a Photo Card Wrapper */
.summary-card {
  cursor: pointer;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  list-style: none;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
  overflow: hidden; /* Clips photo corners to card borders */
  display: block;
}

.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

.summary-card::-webkit-details-marker {
  display: none; 
}

/* Style the top photo box */
.summary-card .photo {
  width: 100%;
  height: 200px; /* Adjust height based on your design aesthetic */
  overflow: hidden;
  background-color: #f1f5f9;
}

.summary-card .photo img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Keeps image looking perfectly proportioned */
}

/* Style the card title underneath the photo */
.summary-card .title {
  display: block;
  padding: 20px;
  font-weight: 600;
  font-size: 1.25rem;
  color: #2b3f5f;
  background: #b8cbe9;
  height: 20px;
}

/* Keep the summary card width confined to half width when grid spans full layout */
.grid-item.is-open .summary-card {
  width: calc(50% - 12px); 
}

/* Full Width Body details container */
.full-width-content {
  display: none;
  width: 100%;
  background-color: #ffffff;
  padding: 30px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
  margin-top: 15px; 
  box-sizing: border-box;
}

.accordion-element[open] .full-width-content {
  display: block;
}

/* Responsive mobile wrap */
@media (max-width: 768px) {
  .two-column-accordion-grid {
    grid-template-columns: 1fr;
  }
  .grid-item.is-open .summary-card {
    width: 100%;
  }
}
