/* Shared mobile responsive overrides for the Palmer Realty site.
   Targets the site's inline styles via attribute selectors + !important.
   NOTE: the runtime re-serializes inline styles WITH a space after each colon,
   so every value-matching selector is listed in both forms.

   SOURCE: Paul's 2026-09-15 drop (MEDIA/DESIGN-UPDATE/palmer-responsive.css), shipped
   under ARN row 31. ONE DELIBERATE DEVIATION from the drop, marked [KEPT] below: the
   drop was authored against its own .html, while this site is PHP-rendered from the
   older build, so a selector the drop dropped still has live markup to match here.
   Measured 2026-09-15 before shipping -- do not "tidy" a [KEPT] rule away without
   re-measuring the live markup first. */

html,body{max-width:100%;overflow-x:hidden;}
img{max-width:100%;}

@media (max-width: 820px){
  /* Any multi-column grid collapses to a single stacked column */
  [style*="grid-template-columns"]{grid-template-columns:1fr !important;}
  [style*="grid-template-rows:1fr 1fr"],[style*="grid-template-rows: 1fr 1fr"]{grid-template-rows:auto !important;}
  [style*="height:440px"],[style*="height: 440px"]{height:auto !important;}
  [style*="grid-row"]{grid-row:auto !important;}
  /* Gallery tiles are empty background divs - give them explicit height once the tracks flatten */
  [style*="height:440px"] > *,[style*="height: 440px"] > *{height:220px !important;}

  /* Fixed-width media blocks (agent portraits, logo plates) go fluid */
  [style*="width:230px"],[style*="width: 230px"],
  [style*="width:210px"],[style*="width: 210px"],
  [style*="width:190px"],[style*="width: 190px"]{width:100% !important;max-width:260px !important;}
  [style*="width:240px;height:240px"],[style*="width: 240px; height: 240px"]{width:150px !important;height:150px !important;}
  [style*="width:110px;height:110px"],[style*="width: 110px; height: 110px"]{width:84px !important;height:84px !important;}

  /* Hero: stack logo + copy, release the fixed height */
  [style*="gap:64px"],[style*="gap: 64px"]{flex-direction:column !important;gap:24px !important;}
  [style*="height:560px"],[style*="height: 560px"]{height:auto !important;min-height:0 !important;padding-top:44px !important;padding-bottom:44px !important;}
  [style*="min-height:540px"],[style*="min-height: 540px"]{min-height:0 !important;}
  [style*="padding:64px 56px"],[style*="padding: 64px 56px"]{padding:40px 24px !important;}

  /* Horizontal bars that must not run off screen */
  [style*="white-space:nowrap;overflow:hidden"],[style*="white-space: nowrap; overflow: hidden"]{flex-wrap:wrap !important;white-space:normal !important;row-gap:4px !important;}
  [style*="max-width:720px"],[style*="max-width: 720px"]{flex-direction:column !important;}
  [style*="max-width:720px"] > *,[style*="max-width: 720px"] > *{border-right:none !important;border-bottom:1px solid #E3E7DC !important;}
  [style*="justify-content:space-between;gap:40px"],[style*="justify-content: space-between; gap: 40px"]{flex-direction:column !important;align-items:flex-start !important;gap:22px !important;}

  /* Sticky detail sidebar releases on mobile */
  [style*="position:sticky;top:96px"],[style*="position: sticky; top: 96px"]{position:static !important;}

  /* Shrink oversized section side padding */
  [style*="px 60px"],[style*="px 70px"],[style*="px 80px"],[style*="px 90px"],[style*="px 100px"],
  [style*="0 100px"],[style*="0 90px"],[style*="0 60px"],[style*="0 0 64px"],
  [style*="px 48px"],[style*="px 56px"],[style*="px 32px"]{
    padding-left:24px !important;padding-right:24px !important;
  }

  /* Display type scales down before the 560px breakpoint */
  h1[style]{font-size:36px !important;line-height:1.12 !important;}
  h2[style]{font-size:26px !important;}

  /* Comfortable tap targets */
  a[style*="padding:16px 28px"],a[style*="padding: 16px 28px"],
  a[style*="padding:10px 18px"],a[style*="padding: 10px 18px"],
  a[style*="padding:14px 26px"],a[style*="padding: 14px 26px"],button[style]{min-height:44px;}
}

@media (max-width: 560px){
  h1[style]{font-size:31px !important;}
  h2[style]{font-size:23px !important;}
  [style*="letter-spacing:.26em"],[style*="letter-spacing: 0.26em"],
  [style*="letter-spacing:.24em"],[style*="letter-spacing: 0.24em"]{letter-spacing:.16em !important;}
  /* Button rows stack */
  [style*="display:flex;gap:14px"],[style*="display: flex; gap: 14px"]{flex-wrap:wrap !important;}
}