/* Portland Veteran Homes: phone and tablet layout fixes (mobile check, Nov 25, 2026).
   Loaded after pvh-site.css on every page. Same colors and look; only sizes, wrapping and rows change.
   Kept in its own file so the color work (pvh-site.css) and the menu redesign never collide with it. */

@media (max-width: 600px) {
  /* Footer "Watch, listen and follow": 8 round icons in two even rows of 4 (one row of 8 ran off the screen) */
  .pvh-footer .pf-socrow .pf-soc, .pvh-footer .pf-soc { display: grid; grid-template-columns: repeat(4, 44px); gap: 12px 18px; justify-content: center; }


  /* Market numbers widget (city pages, home page): two per row, the fifth number gets its own full row */
  .idxw-mk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .idxw-mk-stats > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  /* "Meet Troy" profile blocks: a few pages set two columns right on the block, which beat the phone rule and squeezed
     the heading into a 100px column. Stack them like every other page (photo, then words). */
  .pvh-rc .pvh-profile[style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
  /* City and guide photo banners: the words box could not shrink below its longest line, so text ran past the
     rounded edge and was cut off. Let it shrink and wrap. */
  .pvh-city .hero-in { min-width: 0; max-width: 100%; }
  .pvh-city .hero .badge { white-space: normal; max-width: 100%; }
}

@media (min-width: 601px) and (max-width: 991px) {
  /* Card grids on tablets (two across) ended with one card alone (2, 1 or 2, 2, 1). Three, six or nine cards now sit
     three across; any other odd count gives the last card the full row. */
  :is(.pvh-rc .pvh-grid, .pvh-proc, .pvh-adv .g3, .pvh-adv .steps):has(> :nth-child(3n):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  :is(.pvh-rc .pvh-grid, .pvh-proc, .pvh-adv .g3, .pvh-adv .steps):not(:has(> :nth-child(3n):last-child)) > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  /* Comparison tables (Certificate of Eligibility, ODVA vs Federal VA): 817px wide on a 768 to 820 tablet, so the
     last column was cut off. Slightly smaller text and padding; the dollar amounts may wrap. */
  .pvh-rc .pvh-table { font-size: 15px !important; }
  .pvh-rc .pvh-table th, .pvh-rc .pvh-table td { padding: 12px 10px !important; }
  .pvh-rc .pvh-table td.pvh-amt { white-space: normal !important; }
  /* Four county cards (market report hubs) and four number tiles (video pages): two by two instead of 3 + 1 */
  :is(#mr-co .grid, #hub-co .grid, #vb-read .stats):has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  /* Footer on tablets: five blocks in two columns ended 2, 2, 1. The office block now takes the top row: 1, 2, 2 */
  .pvh-footer .pf-grid > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 991px) {
  /* Breadcrumb links (Home > Veteran Resources > ...): 15px tall, hard to hit on phones and tablets. Bigger tap area, same spacing on screen */
  .pvh-crumbs a, nav.crumbs a { display: inline-block; padding: 12px 2px; margin: -12px 0; }
  /* Form checkboxes ("Yes, text me" and similar) were 13px boxes */
  label.chk input[type="checkbox"], .pvh-fields input[type="checkbox"], label.pvb-chk input[type="checkbox"] { width: 24px; height: 24px; flex: none; }
  /* Menu button: the three-line icon is 31x18px. An invisible frame makes it a 44px target on tablets too
     (the accessibility pass added the same frame for phones). Look unchanged. */
  .pvh-header .navbar-toggler { position: relative; }
  .pvh-header .navbar-toggler::before { content: ""; position: absolute; inset: -13px -7px; }

  /* Photo card blocks (Homes near VA care and others): two per row on phones and tablets, so an odd last card
     takes the full row instead of sitting alone on the left */
  .pvh-fw .g > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .pvh-fw .g > a.c:last-child:nth-child(odd) .ph { aspect-ratio: 3 / 1; }
}

@media (max-width: 900px) {
  /* Rent vs Sell calculator: the boxes could not shrink below their widest field and ran off the right edge */
  .kos-tool { grid-template-columns: minmax(0, 1fr) !important; }
  .kos-box { min-width: 0; }
  .kos-in input { min-width: 0; width: 100%; }
}

@media (min-width: 601px) {
  /* Five market numbers: one even row of five instead of four plus one on tablets */
  .idxw-mk-stats:has(> :nth-child(5):last-child) { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
}

@media (max-width: 600px) {
  /* Form fields at 16px on phones: iPhones zoom the whole page in when someone taps a field with smaller text,
     and the page stays zoomed after typing. 14 to 15px fields become 16px; nothing else changes. */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]), select, textarea { font-size: 16px !important; }
}
