/*
Theme Name:   Houzez Child
Theme URI:    https://homzorarealty.com
Description:  Child theme for Homzora customizations. Keeps custom page templates, hooks, and overrides survival-proof across Houzez parent updates.
Author:       Homzora
Author URI:   https://homzorarealty.com
Template:     houzez
Version: 20260604.1450
*/

/* ═══════════════════════════════════════════════════════════════════ */
/* Tool page chrome suppression (added 2026-06-04)                     */
/* Body gets .homzora-tool-page class added via child theme functions  */
/* ═══════════════════════════════════════════════════════════════════ */

.homzora-tool-page .sidebar,
.homzora-tool-page .widget-area,
.homzora-tool-page aside.sidebar,
.homzora-tool-page .col-md-4.sidebar,
.homzora-tool-page [class*="sidebar-right"],
.homzora-tool-page [class*="sidebar-left"],
.homzora-tool-page .houzez-content-wrap aside,
.homzora-tool-page #secondary,
.homzora-tool-page .col-md-8 + .col-md-4 {
  display: none !important;
}

.homzora-tool-page #desktop-header-search,
.homzora-tool-page #overlay-search-advanced-module,
.homzora-tool-page .advanced-search.advanced-search-nav,
.homzora-tool-page .mobile-search-trigger,
.homzora-tool-page section.advanced-search {
  display: none !important;
}

.homzora-tool-page .col-md-8,
.homzora-tool-page .content-area,
.homzora-tool-page .site-content .col-md-8,
.homzora-tool-page main.site-main,
.homzora-tool-page .content-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  flex: 0 0 100% !important;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* Tool grid (used on /boston-housing-data/ and similar tool index pages) */
/* ═══════════════════════════════════════════════════════════════════ */

.homzora-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin: 40px 0;
}
.homzora-tool-card {
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 32px 24px;
  transition: all 0.3s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 0 2px 8px rgba(0,49,83,0.06);
}
.homzora-tool-card:hover {
  border-color: #C9A84C;
  box-shadow: 0 12px 32px rgba(201,168,76,0.2);
  transform: translateY(-4px);
}
.homzora-tool-label {
  display: inline-block;
  background: #C9A84C;
  color: #003153;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 12px;
  align-self: flex-start;
  letter-spacing: 0.05em;
}
.homzora-tool-title {
  color: #003153;
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 12px 0;
  line-height: 1.3;
}
.homzora-tool-description {
  color: #666;
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 20px 0;
  flex-grow: 1;
}
.homzora-tool-button {
  background: #C9A84C;
  color: #003153;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  display: inline-block;
  align-self: flex-start;
}
.homzora-tool-button:hover {
  background: #D4B86A;
  transform: scale(1.05);
}
@media (max-width: 768px) {
  .homzora-tools-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════ */
/* homzora-mobile-fixes — responsive scaling for content pages         */
/* Forces tables to scroll horizontally instead of zooming the page,   */
/* reduces hero padding, scales typography for small screens.          */
/* ═══════════════════════════════════════════════════════════════════ */

/* Wrap any data table on a content page in a scrollable container */
.page-content-wrap table,
.article-page-wrap table,
article table {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
  border-collapse: collapse;
  margin: 24px 0;
}

.page-content-wrap table th,
.page-content-wrap table td,
.article-page-wrap table th,
.article-page-wrap table td,
article table th,
article table td {
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  font-size: 14px;
}

.page-content-wrap table th,
.article-page-wrap table th,
article table th {
  background: #f8fafc;
  font-weight: 700;
  color: #003153;
  position: sticky;
  top: 0;
}

/* On phones, scale down hero banners and reduce padding */
@media (max-width: 640px) {
  /* Big hero blocks that take 40-48px padding on desktop need to shrink */
  .page-content-wrap > div > div[style*="padding:40px"],
  .page-content-wrap > div > div[style*="padding: 40px"],
  .page-content-wrap > div > div[style*="padding:48px"] {
    padding: 24px 18px !important;
  }

  /* H1 in dark hero banners is often 28-32px; scale down */
  .page-content-wrap h1 {
    font-size: 22px !important;
    line-height: 1.25 !important;
  }

  /* Q3 in-progress banner heading */
  .page-content-wrap > div:first-child p[style*="font-size:15px"] {
    font-size: 14px !important;
  }

  /* Tool grid cards stack to 1 col with smaller padding */
  .homzora-tools-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .homzora-tool-card {
    padding: 24px 20px !important;
  }
  .homzora-tool-title {
    font-size: 18px !important;
  }

  /* Two-col grids (data sources, etc) stack on mobile */
  div[style*="grid-template-columns:repeat(2"],
  div[style*="grid-template-columns: repeat(2"],
  div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Three-col grids stack on mobile too */
  div[style*="grid-template-columns:repeat(3"],
  div[style*="grid-template-columns: repeat(3"] {
    grid-template-columns: 1fr !important;
  }

  /* Reduce container max-widths to use full mobile viewport */
  div[style*="max-width:860px"],
  div[style*="max-width: 860px"],
  div[style*="max-width:1080px"],
  div[style*="max-width: 1080px"],
  div[style*="max-width:760px"],
  div[style*="max-width: 760px"] {
    padding-left: 14px !important;
    padding-right: 14px !important;
    box-sizing: border-box !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════ */
/* homzora-mobile-strong-fixes — higher specificity for Houzez overrides */
/* ═══════════════════════════════════════════════════════════════════ */

@media only screen and (max-width: 768px) {

  /* Force body and main wrap to fit viewport */
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }

  /* Houzez main content area shouldn't have a fixed width */
  body .main-wrap,
  body #main-wrap,
  body .container,
  body .page-content-wrap {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  /* Force ALL inline-styled width:860px / max-width:860px containers to scale */
  body div[style*="max-width:860px"],
  body div[style*="max-width: 860px"],
  body div[style*="max-width:1080px"],
  body div[style*="max-width: 1080px"],
  body div[style*="max-width:760px"],
  body div[style*="max-width: 760px"] {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    box-sizing: border-box !important;
  }

  /* Tables MUST become scroll containers */
  body article table,
  body .page-content-wrap table,
  body .article-page-wrap table,
  body .post table,
  body table {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    white-space: nowrap !important;
  }

  /* Hero banner H1 must shrink */
  body article h1,
  body .page-content-wrap h1,
  body div[style*="background:#003153"] h1 {
    font-size: 22px !important;
    line-height: 1.25 !important;
  }

  /* Hero/header banners with big padding shrink down */
  body div[style*="padding:40px 36px"],
  body div[style*="padding: 40px 36px"],
  body div[style*="padding:48px 36px"],
  body div[style*="padding: 48px 36px"],
  body div[style*="padding:48px 40px"],
  body div[style*="padding: 48px 40px"] {
    padding: 24px 18px !important;
  }

  /* All multi-column grids stack to single column */
  body div[style*="grid-template-columns:repeat(2"],
  body div[style*="grid-template-columns: repeat(2"],
  body div[style*="grid-template-columns:repeat(3"],
  body div[style*="grid-template-columns: repeat(3"],
  body div[style*="grid-template-columns:1fr 1fr"],
  body div[style*="grid-template-columns: 1fr 1fr"],
  body div[style*="grid-template-columns:auto 1fr"],
  body div[style*="grid-template-columns: auto 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  /* Tool grid forced to single column */
  body .homzora-tools-grid {
    grid-template-columns: 1fr !important;
  }

  /* Reduce font sizes uniformly on phones */
  body p, body li {
    font-size: 15px !important;
    line-height: 1.65 !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════ */
/* homzora-mobile-readable — bump mobile sizing up for readability     */
/* Applied 2026-06-04 after user feedback that mobile was too small.   */
/* ═══════════════════════════════════════════════════════════════════ */

@media only screen and (max-width: 768px) {

  /* Body text larger and more readable */
  body p,
  body li,
  body .page-content-wrap p,
  body article p {
    font-size: 16px !important;
    line-height: 1.7 !important;
  }

  /* Headings larger */
  body article h1,
  body .page-content-wrap h1,
  body div[style*="background:#003153"] h1 {
    font-size: 26px !important;
    line-height: 1.25 !important;
  }
  body article h2,
  body .page-content-wrap h2 {
    font-size: 22px !important;
    line-height: 1.3 !important;
  }
  body article h3,
  body .page-content-wrap h3 {
    font-size: 19px !important;
    line-height: 1.35 !important;
  }

  /* Hero/banner block padding more generous */
  body div[style*="padding:40px 36px"],
  body div[style*="padding: 40px 36px"],
  body div[style*="padding:48px 36px"],
  body div[style*="padding: 48px 36px"],
  body div[style*="padding:48px 40px"],
  body div[style*="padding: 48px 40px"] {
    padding: 30px 22px !important;
  }

  /* Tool cards larger padding and bigger text */
  body .homzora-tool-card {
    padding: 28px 22px !important;
  }
  body .homzora-tool-title {
    font-size: 19px !important;
    line-height: 1.35 !important;
  }
  body .homzora-tool-description {
    font-size: 15px !important;
    line-height: 1.65 !important;
  }
  body .homzora-tool-label {
    font-size: 12px !important;
    padding: 7px 14px !important;
  }
  body .homzora-tool-button {
    font-size: 14px !important;
    padding: 13px 22px !important;
  }

  /* Survey, contact, calculator form inputs need to be tap-friendly + readable */
  body input[type="text"],
  body input[type="email"],
  body input[type="number"],
  body input[type="tel"],
  body select,
  body textarea {
    font-size: 16px !important;  /* prevents iOS auto-zoom on focus */
    padding: 14px 16px !important;
  }

  /* Buttons larger touch targets */
  body button,
  body .btn,
  body input[type="submit"] {
    font-size: 15px !important;
    padding: 14px 22px !important;
  }

  /* Q3 in-progress banner more breathing room */
  body div[style*="linear-gradient(135deg,#003153"] p {
    font-size: 15px !important;
    line-height: 1.6 !important;
  }
  body div[style*="linear-gradient(135deg,#003153"] {
    padding: 22px 20px !important;
  }

  /* Survey page form labels readable */
  body label {
    font-size: 16px !important;
  }

  /* Contact page intent cards */
  body .hzra-intent-card {
    padding: 24px 22px !important;
  }
  body .hzra-intent-card h3 {
    font-size: 21px !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════ */
/* homzora-dark-bg-text-rescue — prevent dark-on-dark text accidents   */
/* If a paragraph sits inside a #003153 or 001f3a container without    */
/* its own color set, it inherits a sensible light color.              */
/* ═══════════════════════════════════════════════════════════════════ */

div[style*="background:#003153"] p:not([style*="color:"]),
div[style*="background: #003153"] p:not([style*="color:"]),
div[style*="background:linear-gradient(135deg,#003153"] p:not([style*="color:"]),
div[style*="background:linear-gradient(135deg, #003153"] p:not([style*="color:"]),
div[style*="background:#001f3a"] p:not([style*="color:"]) {
  color: rgba(255,255,255,0.92) !important;
}

div[style*="background:#003153"] li:not([style*="color:"]),
div[style*="background:linear-gradient(135deg,#003153"] li:not([style*="color:"]) {
  color: rgba(255,255,255,0.88) !important;
}

/* Tool-page layout: hide sidebar, full-width content (moved from wp_head - LiteSpeed strips inline style) */
.homzora-tool-page .bt-sidebar-wrap { display: none !important; }
.homzora-tool-page .bt-content-wrap { width: 100% !important; max-width: 100% !important; flex: 0 0 100% !important; }

/* About page tool grid - kept here because WordPress strips display: from inline styles */
.hz-toolgrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px;margin-bottom:2rem}
.hz-toolgrid a{display:flex;flex-direction:column}

/* Contact page intent cards - kept here because WordPress strips <style> from post content */
.hzra-intent-card:hover{border-color:#003153 !important;transform:translateY(-2px);box-shadow:0 12px 28px rgba(0,49,83,0.08)}
.hzra-intent-card:hover h3{color:#C9A84C}
.hzra-intent-card.active{border-color:#003153 !important;background:#f8fafc !important}
#hzra-submit-btn:hover{transform:translateY(-1px);box-shadow:0 8px 20px rgba(0,49,83,0.2)}
#hzra-submit-btn:disabled{opacity:0.6;cursor:not-allowed;transform:none}
@media (max-width:640px){
  .hzra-intent-card{padding:24px 22px !important}
  #hzra-contact-form-wrap > div:first-child > div:first-child h2{font-size:24px !important}
  form#hzra-contact-form > div[style*="grid-template-columns:1fr 1fr"]{grid-template-columns:1fr !important}
}
