/* BeeCMO marketing site: phone and tablet layer, loaded after site.css.
   - Tablet nav: the Menu button runs up to 960px (the full nav wraps onto two lines below that).
   - 44px tap targets and 16px fields on touch.
   - Pricing: plan table becomes stacked plan cards on phones; two-column tables fit without scrolling.
   - Wide comparison tables scroll inside their box, with edge shadows and a sticky first column as the hint.
   - Reading width and type for blog/learn posts on tablets.
   - Hero CTAs stay above the fold on phones. */

/* ---------- Header / nav ---------- */
@media (min-width: 761px) and (max-width: 960px) {
  .menu-btn { display: inline-block; order: 2; margin-left: auto; }
  .bar-actions { order: 3; margin-left: 0; }
  .nav { order: 4; flex-basis: 100%; flex-direction: column; display: none; padding-bottom: 8px; }
  .nav.open { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 24px; }
}
@media (max-width: 960px) {
  .bar { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .menu-btn, .theme-btn { min-height: 44px; min-width: 44px; padding: 8px 12px; }
  .menu-btn { font-weight: 650; }
  .nav.open a { display: flex; align-items: center; min-height: 48px; padding: 0; border-bottom: 1px solid var(--rule); font-size: 1.05rem; }
  .nav.open a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--marigold); padding-left: 12px; }
}
@media (max-width: 760px) {
  .logo { min-height: 44px; }
}

/* ---------- Touch targets ---------- */
@media (pointer: coarse), (max-width: 760px) {
  .logo { min-height: 44px; }
  .menu-btn, .theme-btn { min-height: 44px; min-width: 44px; }
  .nav a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
  .col h3 a { display: inline-flex; align-items: center; min-height: 44px; padding: 0; margin: -6px 0; }
  .btn, .btn-ghost { min-height: 48px; }
  .btn-sm { min-height: 44px; }
  .site-footer li a, .wa-link, .site-footer .logo { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
  .wall + p > a { display: inline-flex; align-items: center; min-height: 44px; }
  /* Link lists ("Guides for HVAC owners"): each link is its own row-sized target. */
  .wrap > ul > li > a:first-child:only-child { display: inline-block; padding: 12px 0; }
  .site-footer li { margin: 0; }
  .post-list h2 a, .post-list h3 a, .related li a, .toc a, .chips-nav .chip { display: inline-flex; align-items: center; min-height: 44px; }
  .chips-nav .chip { padding: 6px 14px; }
  .faq summary { min-height: 48px; display: flex; align-items: center; }
  .lead-form .check { min-height: 44px; align-items: center; }
  table a { display: inline-block; padding: 10px 0; margin: -10px 0; }
}

/* ---------- Fields: 16px stops iOS zoom ---------- */
input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: max(16px, 1em); }
.lead-form input, .lead-form textarea, .tool-form input, .tool-form select, .tool-form textarea { min-height: 48px; font-size: max(16px, 1em); }

/* ---------- Footer: two tidy columns on phones ---------- */
@media (max-width: 560px) {
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
  .fine { font-size: 0.9rem; }
}

/* ---------- Hero: CTAs above the fold on phones ---------- */
@media (max-width: 760px) {
  .hero { padding-top: 28px; padding-bottom: 20px; }
  .hero h1 { font-size: clamp(1.9rem, 1.1rem + 4.2vw, 2.6rem); }
  .page-home .hero h1 { font-size: clamp(2.1rem, 1.2rem + 5vw, 2.9rem); }
  .hero p { font-size: 1.05rem; }
  .hero p:has(.btn) { margin-top: 1.1em; display: flex; flex-wrap: wrap; gap: 10px; }
  .hero p:has(.btn) .btn, .hero p:has(.btn) .btn-ghost { margin: 0 !important; justify-content: center; flex: 1 1 100%; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .hero h1 { max-width: 20ch; }
}

/* ---------- Tables ---------- */
/* Every table scrolls inside its own box; shadows at the edges say "there is more". */
.table-wrap {
  position: relative;
  background:
    linear-gradient(to right, var(--paper) 30%, transparent) left / 28px 100% no-repeat local,
    linear-gradient(to left, var(--paper) 30%, transparent) right / 28px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgb(0 0 0 / 18%), transparent) left / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgb(0 0 0 / 18%), transparent) right / 12px 100% no-repeat scroll;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
}
.table-wrap:focus-visible { outline-offset: 4px; }
/* Two-column tables never need to scroll. */
table:not(:has(th:nth-child(3))) { min-width: 0; }
@media (max-width: 760px) {
  table { font-size: 0.95rem; }
  th, td { padding: 10px 14px 10px 0; }
  /* Wide (3+ column) tables: the row label stays put while the rest scrolls. */
  table:has(th:nth-child(3)) { min-width: 600px; }
  table:has(th:nth-child(3)) td:first-child,
  table:has(th:nth-child(3)) th:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--paper);
    width: 30%;
    min-width: 120px;
    box-shadow: 1px 0 0 var(--rule);
    padding-right: 12px;
  }
  /* Hint line under wide tables (CSS cannot tell if a table overflows, so it reads as a tip). */
  .table-wrap:has(th:nth-child(3))::after {
    content: "Swipe sideways to see every column →";
    position: sticky;
    left: 0;
    display: block;
    padding: 8px 0 2px;
    font-size: 0.85rem;
    color: var(--ink-2);
  }

  /* Pricing: the plan table (Plan / Price / What's in it / Good for) becomes stacked plan cards. */
  .page-pricing .table-wrap:has(th:nth-child(4)) { overflow: visible; border-top: 0; background: none; }
  .page-pricing .table-wrap:has(th:nth-child(4))::after { content: none; }
  .page-pricing table:has(th:nth-child(4)) { min-width: 0; display: block; }
  .page-pricing table:has(th:nth-child(4)) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .page-pricing table:has(th:nth-child(4)) tbody { display: grid; gap: 14px; }
  .page-pricing table:has(th:nth-child(4)) tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
    padding: 16px 18px;
    border: 1.5px solid var(--rule);
    border-top: 4px solid var(--ink);
    border-radius: var(--r);
    background: var(--paper);
  }
  .page-pricing table:has(th:nth-child(4)) tr:nth-child(3) { border-top-color: var(--marigold); box-shadow: 0 0 0 1.5px var(--marigold); }
  .page-pricing table:has(th:nth-child(4)) td {
    display: block;
    padding: 0;
    border: 0;
    position: static;
    width: auto;
    min-width: 0;
    background: none;
    box-shadow: none;
  }
  .page-pricing table:has(th:nth-child(4)) td:nth-child(1) { font: 750 1.3rem/1.2 var(--display); align-self: center; }
  .page-pricing table:has(th:nth-child(4)) td:nth-child(2) { font: 750 1.3rem/1.2 var(--display); text-align: right; align-self: center; }
  .page-pricing table:has(th:nth-child(4)) td:nth-child(3) { grid-column: 1 / -1; font-weight: 400; }
  .page-pricing table:has(th:nth-child(4)) td:nth-child(4) { grid-column: 1 / -1; color: var(--ink-2); font-size: 0.95rem; font-weight: 400; }
  .page-pricing table:has(th:nth-child(4)) td:nth-child(4)::before { content: "Good for: "; font-weight: 650; color: var(--ink); }
}

/* ---------- Reading: blog, learn and legal pages ---------- */
@media (min-width: 700px) and (max-width: 1100px) {
  .page-blog, .page-legal, .page-learn { max-width: 720px; margin-left: auto; margin-right: auto; }
  .page-blog article, .page-learn article { font-size: 1.125rem; line-height: 1.7; }
  .page-blog article p, .page-blog article li, .page-learn article p, .page-learn article li { max-width: 66ch; }
  .page-blog h1, .page-learn h1 { font-size: clamp(2.1rem, 1.2rem + 2.6vw, 2.8rem); }
}
@media (max-width: 699px) {
  .page-blog article, .page-learn article { font-size: 1.0625rem; line-height: 1.65; }
  .page-blog h1, .page-learn h1 { font-size: clamp(1.8rem, 1.1rem + 3.6vw, 2.3rem); }
}

/* ---------- Columns and tools on tablets ---------- */
@media (min-width: 700px) and (max-width: 1100px) {
  .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-home .phone { float: right; margin: 0 0 1em 32px; width: 300px; }
}
@media (max-width: 480px) {
  .tool-row { grid-template-columns: 1fr; }
  .tool-form { padding: 16px; }
  .cta { padding: 28px 18px; }
  .cta .btn, .cta .btn-ghost { width: 100%; justify-content: center; margin: 8px 0 0 !important; }
}

/* ---------- Phones: no body text under 14px ---------- */
@media (max-width: 760px) {
  .week .ch, .phone figcaption, .bubble p:last-child, .tool-form .hint, .fine, .post-meta { font-size: 0.875rem; }
}
