/*
Theme Name:  Astra Child - Brentwood Inspect
Theme URI:   https://brentwoodinspect.com/
Description: Child theme for Brentwood Inspect. Adds a custom footer (menu, contact, branding) and site-wide gallery styling without requiring Astra Pro.
Author:      Brentwood Inspect
Template:    astra
Version:     1.1.1
Text Domain: astra-child-bwi
*/

/* =========================================================
   1. SITE-WIDE GALLERY STYLING (bwi-uniform-gallery)
   v1.1: hardened with !important — WP core's gallery flex
   rules were overpowering the grid, shrinking the tiles.
   ========================================================= */
.bwi-uniform-gallery.wp-block-gallery.has-nested-images{
  display:grid !important;
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  gap:18px !important;
  width:100% !important;
  max-width:var(--wp--style--global--wide-size,1200px) !important;
  margin-left:auto !important;
  margin-right:auto !important;
}
.bwi-uniform-gallery.wp-block-gallery.has-nested-images figure.wp-block-image{
  display:block !important;
  margin:0 !important;
  width:100% !important;
  max-width:100% !important;
  flex:none !important;
}
.bwi-uniform-gallery.wp-block-gallery.has-nested-images figure.wp-block-image img,
.bwi-uniform-gallery.wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image img{
  display:block !important;
  width:100% !important;
  height:auto !important;
  aspect-ratio:4 / 3 !important;
  object-fit:cover !important;
  border-radius:2px;
}
.bwi-uniform-gallery.wp-block-gallery.has-nested-images figure.wp-block-image figcaption,
.bwi-uniform-gallery.wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image figcaption{
  position:static !important;
  background:none !important;
  padding:8px 2px 0 !important;
  margin:0 !important;
  max-height:none !important;
  overflow:visible !important;
  color:#4a5350;
  font-size:0.82em;
  line-height:1.4;
  text-align:left;
  text-shadow:none !important;
}
@media (max-width:900px){
  .bwi-uniform-gallery.wp-block-gallery.has-nested-images{grid-template-columns:repeat(2,minmax(0,1fr)) !important;}
}
@media (max-width:600px){
  .bwi-uniform-gallery.wp-block-gallery.has-nested-images{grid-template-columns:minmax(0,1fr) !important;}
}

/* =========================================================
   2. DARK SECTIONS: readable link color
   Applies to any group with the brand dark-green background.
   (Buttons keep their own inline colors.)
   ========================================================= */
.wp-block-group[style*="background-color:#2f3634"] a:not(.wp-block-button__link):not(.bwi-footer__cta){
  color:#9caf6e;
}
.wp-block-group[style*="background-color:#2f3634"] a:not(.wp-block-button__link):hover{
  color:#c4d69a;
}

/* =========================================================
   3. FAQ ACCORDION (wp:details blocks)
   ========================================================= */
.wp-block-details{
  border:1px solid #e2e2e2;
  border-radius:2px;
  padding:16px 20px;
  margin-bottom:12px;
  background:#ffffff;
}
.wp-block-details summary{
  font-weight:600;
  color:#2f3634;
  cursor:pointer;
}
.wp-block-details summary:hover{
  color:#6e7949;
}
.wp-block-details[open]{
  border-color:#6e7949;
}
.wp-block-details[open] summary{
  margin-bottom:8px;
}

/* =========================================================
   4. CUSTOM FOOTER
   ========================================================= */
.bwi-footer{
  background:#2f3634;
  color:#c9cfc9;
  padding:56px 20px 0;
  font-size:0.95em;
  line-height:1.6;
}
.bwi-footer a{
  color:#c9cfc9;
  text-decoration:none;
}
.bwi-footer a:hover{
  color:#ffffff;
  text-decoration:underline;
}
.bwi-footer__inner{
  max-width:1200px;
  margin:0 auto;
  display:grid;
  grid-template-columns:2fr 1fr 1.4fr;
  gap:40px;
  padding-bottom:44px;
}
.bwi-footer__heading{
  color:#9caf6e;
  font-size:1.05em;
  font-weight:700;
  margin:0 0 14px;
}
.bwi-footer__brand p{
  margin:0 0 14px;
}
.bwi-footer__cta{
  display:inline-block;
  background:#6e7949;
  color:#ffffff !important;
  padding:10px 22px;
  border-radius:2px;
  font-weight:600;
  text-decoration:none !important;
}
.bwi-footer__cta:hover{
  background:#5d6740;
  text-decoration:none !important;
}
.bwi-footer__menu ul{
  list-style:none;
  margin:0;
  padding:0;
}
.bwi-footer__menu li{
  margin:0 0 9px;
}
.bwi-footer__contact p{
  margin:0 0 10px;
}
.bwi-footer__bottom{
  border-top:1px solid rgba(255,255,255,0.12);
}
.bwi-footer__bottom-inner{
  max-width:1200px;
  margin:0 auto;
  padding:18px 0;
  display:flex;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:8px;
  font-size:0.85em;
  color:#8d9791;
}
@media (max-width:900px){
  .bwi-footer__inner{grid-template-columns:1fr 1fr;}
}
@media (max-width:600px){
  .bwi-footer__inner{grid-template-columns:1fr;gap:30px;}
  .bwi-footer__bottom-inner{flex-direction:column;text-align:center;}
}

/* =========================================================
   5. Hide Astra's own footer bar (replaced by .bwi-footer)
   ========================================================= */
footer#colophon.site-footer{display:none !important;}
