/* ============================================================
   MOBILE — LeaseBase Marketing Site
   Loaded only on screens <= 768px via media attribute.
   All rules here are mobile overrides — desktop styles untouched.
   ============================================================ */

/* ── 1. Header & Navigation ──────────────────────────────── */

/* Compact header on mobile */
.lb-header__inner {
  height: 56px;
  padding: 0 var(--lb-space-md);
}

body {
  padding-top: 56px;
}

/* Keep CTA visible in header on mobile (override mega-nav.css @640px hide) */
.lb-header__cta {
  display: inline-flex !important;
  padding: 6px 14px;
  font-size: 0.8125rem;
}

/* Mobile drawer — full screen overlay instead of slide-in */
.lb-mobile-drawer {
  top: 56px;
  padding: var(--lb-space-md) var(--lb-space-lg);
  background: var(--lb-white);
  -webkit-overflow-scrolling: touch;
}

/* Larger touch targets for drawer links */
.lb-mobile-drawer__toggle {
  padding: var(--lb-space-md) 0;
  min-height: 48px;
}

.lb-mobile-drawer__link {
  padding: 12px 0;
  font-size: var(--lb-text-base);
  min-height: 44px;
  display: flex;
  align-items: center;
}

.lb-mobile-drawer__direct-link {
  padding: var(--lb-space-md) 0;
  min-height: 48px;
  display: flex;
  align-items: center;
}

.lb-mobile-drawer__actions {
  padding: var(--lb-space-lg) 0;
  position: sticky;
  bottom: 0;
  background: var(--lb-white);
  border-top: 1px solid var(--lb-gray-100);
  margin: 0 calc(-1 * var(--lb-space-lg));
  padding-left: var(--lb-space-lg);
  padding-right: var(--lb-space-lg);
}

/* ── 2. Typography — Mobile Sizes ────────────────────────── */

h1 {
  font-size: clamp(1.75rem, 7vw, 2.25rem) !important;
  line-height: 1.15 !important;
}

h2 {
  font-size: clamp(1.5rem, 5.5vw, 1.875rem) !important;
  line-height: 1.2 !important;
}

h3 {
  font-size: clamp(1.125rem, 4vw, 1.375rem) !important;
}

/* Ensure body text is always readable */
body, p, li, td, th {
  font-size: 1rem;
  line-height: 1.6;
}

/* ── 3. Hero Section ─────────────────────────────────────── */

.lb-hero,
.lb-hero--calm {
  min-height: auto !important;
  padding-top: var(--lb-space-xl) !important;
  padding-bottom: var(--lb-space-2xl) !important;
}

/* Hero grid to single column */
.lb-hero .lb-container {
  grid-template-columns: 1fr !important;
  gap: var(--lb-space-xl) !important;
  min-height: auto !important;
  padding-top: var(--lb-space-lg) !important;
}

.lb-hero .lb-container > div:first-child {
  padding: 0 !important;
}

.lb-hero .lb-container > div:first-child h1,
.lb-hero .lb-container > div:first-child p {
  text-align: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Hero CTA buttons — full width stacked */
.lb-hero .lb-container > div:first-child > div[style*="display:flex"][style*="gap"] {
  flex-direction: column !important;
  align-items: stretch !important;
}

.lb-hero .lb-container > div:first-child > div[style*="display:flex"][style*="gap"] .lb-btn {
  width: 100%;
  text-align: center;
  justify-content: center;
}

/* Social proof badge — center */
.lb-hero .lb-container > div:first-child > div[style*="display:flex"][style*="align-items:center"][style*="gap:10px"] {
  justify-content: center !important;
}

/* Hero screenshot — remove perspective, scale down */
.lb-hero .lb-container > div:last-child > div {
  transform: none !important;
}

/* ── 4. Trust Strip — Horizontal Scroll ──────────────────── */

.lb-trust-strip {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  gap: var(--lb-space-lg);
  padding: var(--lb-space-md) var(--lb-space-md);
  justify-content: flex-start;
  /* Hide scrollbar */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.lb-trust-strip::-webkit-scrollbar {
  display: none;
}

.lb-trust-strip__item {
  flex-shrink: 0;
  scroll-snap-align: start;
  white-space: nowrap;
}

/* ── 5. Stats Strip — 2x2 Grid ──────────────────────────── */

[data-track-section="stats-strip"] .lb-container > div {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: var(--lb-space-lg) !important;
  justify-content: center;
}

/* ── 6. Sections — Tighter Spacing ───────────────────────── */

.lb-section {
  padding: var(--lb-space-2xl) 0;
}

.lb-section__header {
  margin-bottom: var(--lb-space-xl);
}

.lb-container {
  padding: 0 var(--lb-space-md);
}

/* ── 7. Buttons — Full Width on Mobile ───────────────────── */

.lb-btn {
  width: 100%;
  text-align: center;
  justify-content: center;
  padding: 14px var(--lb-space-lg);
  font-size: var(--lb-text-base);
  min-height: 48px;
}

.lb-btn--lg {
  padding: 16px var(--lb-space-lg);
}

/* Inline button pairs — stack vertically */
div[style*="display:flex"][style*="gap"] > .lb-btn:not(:only-child) {
  flex: 1 1 100%;
}

/* ── 8. Split Layouts — Stack on Mobile ──────────────────── */

.lb-split,
.lb-calm-split {
  grid-template-columns: 1fr !important;
  gap: var(--lb-space-xl);
}

/* ── 9. Card Grids — Single Column ───────────────────────── */

.lb-grid--2,
.lb-grid--3,
.lb-grid--4 {
  grid-template-columns: 1fr;
  gap: var(--lb-space-md);
}

/* ── 10. Pricing Cards — Stack Full Width ────────────────── */

.lb-pricing-card {
  max-width: 100%;
}

.lb-pricing-card--featured {
  transform: none;
  order: -1;
}

/* Pricing toggle row */
.lb-tabs__nav {
  flex-wrap: wrap;
  gap: var(--lb-space-xs);
}

.lb-tabs__btn {
  flex: 1 1 auto;
  text-align: center;
  min-width: 0;
}

/* ── 11. Comparison Tables — Horizontal Scroll ───────────── */

table,
.lb-comparison-table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

/* Add scroll hint shadow */
.lb-comparison-table {
  position: relative;
}

table th,
table td {
  white-space: nowrap;
  padding: 10px 12px;
  font-size: var(--lb-text-sm);
  min-width: 120px;
}

/* First column sticky in tables */
table th:first-child,
table td:first-child {
  position: sticky;
  left: 0;
  background: inherit;
  z-index: 1;
  min-width: 140px;
  white-space: normal;
}

/* ── 12. FAQ Accordion — Better Touch Targets ────────────── */

.lb-faq-question {
  padding: var(--lb-space-md) 0;
  min-height: 48px;
  font-size: var(--lb-text-base);
}

.lb-faq-answer {
  font-size: var(--lb-text-base);
  line-height: 1.6;
}

/* ── 13. Footer — Compact ────────────────────────────────── */

.lb-footer__top {
  grid-template-columns: 1fr !important;
  gap: var(--lb-space-xl);
}

.lb-footer__nav-columns {
  grid-template-columns: 1fr 1fr !important;
  gap: var(--lb-space-lg);
}

.lb-footer__social {
  justify-content: center;
}

.lb-footer__social a {
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── 14. Cookie Banner — Compact ─────────────────────────── */

.lb-cookie-banner {
  padding: var(--lb-space-md);
}

.lb-cookie-banner-text p {
  font-size: var(--lb-text-xs);
  margin-bottom: var(--lb-space-sm);
}

.lb-cookie-banner-actions {
  flex-direction: row;
  gap: var(--lb-space-sm);
}

.lb-cookie-btn {
  font-size: var(--lb-text-sm);
  padding: 8px 16px;
}

/* ── 15. Images — Constrain to Viewport ──────────────────── */

img {
  max-width: 100%;
  height: auto;
}

/* Browser frame screenshots — smaller */
.lb-browser-frame {
  border-radius: 8px;
}

/* ── 16. Inline Style Overrides (grid-template-columns) ──── */

/* Many templates use inline grid styles. Override the common ones.
   Must match both with and without space after the colon. */
[style*="grid-template-columns: 1fr 1fr"],
[style*="grid-template-columns:1fr 1fr"],
[style*="grid-template-columns: repeat(2"],
[style*="grid-template-columns:repeat(2"],
[style*="grid-template-columns: repeat(3"],
[style*="grid-template-columns:repeat(3"],
[style*="grid-template-columns: repeat(4"],
[style*="grid-template-columns:repeat(4"] {
  grid-template-columns: 1fr !important;
}

/* Exception: stats strip keeps 2x2 grid */
[data-track-section="stats-strip"] [style*="grid-template-columns"],
[data-track-section="stats-strip"] .lb-container > div {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: var(--lb-space-lg) !important;
}

/* ── 17. Forms — Full Width Inputs ───────────────────────── */

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="url"],
input[type="password"],
select,
textarea {
  width: 100%;
  font-size: 16px; /* Prevents iOS zoom on focus */
  min-height: 48px;
  padding: 12px;
}

/* ── 18. Comparison Pages — Card Layout ──────────────────── */

.lb-vs-table,
[class*="comparison"] table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── 19. Blog & Guide Pages ──────────────────────────────── */

.lb-blog-grid {
  grid-template-columns: 1fr !important;
}

.lb-blog-card img {
  aspect-ratio: 16/9;
  object-fit: cover;
}

/* Table of contents — horizontal pills */
.lb-toc {
  position: static !important;
  width: 100% !important;
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  gap: var(--lb-space-sm);
  padding: var(--lb-space-sm) 0;
  scrollbar-width: none;
}
.lb-toc::-webkit-scrollbar {
  display: none;
}

.lb-toc a {
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── 20. Calculator Pages ────────────────────────────────── */

.lb-calc-input,
.lb-rc-input {
  width: 100%;
}

.lb-calc-result,
.lb-rc-result {
  font-size: var(--lb-text-base);
}

/* ── 21. City/State Pages ────────────────────────────────── */

/* Stats grid — 2 columns */
.lb-city-stats {
  grid-template-columns: 1fr 1fr !important;
}

/* Law sections — accordion-friendly spacing */
.lb-law-section {
  padding: var(--lb-space-md) 0;
}

/* ── 22. Touch Target Enforcement ────────────────────────── */

a, button {
  min-height: 44px;
  /* Only add padding to elements that don't already have sufficient size */
}

/* Small inline links exemption — don't bloat paragraph links */
p a, li a, td a, .lb-footer__link {
  min-height: auto;
}

/* ── 23. No Horizontal Scroll — Global Guard ─────────────── */

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

/* ── 24. Metrics Row — Stack or 2x2 ─────────────────────── */

.lb-metrics-row {
  flex-direction: column;
}

.lb-metrics-row > * {
  flex: 1 1 100%;
}

/* ── 25. Key Points — Single Column ──────────────────────── */

.lb-key-points {
  grid-template-columns: 1fr;
  gap: var(--lb-space-lg);
}

/* ── 26. Testimonial Cards ───────────────────────────────── */

.lb-grid--testimonials {
  grid-template-columns: 1fr;
}

/* ── 27. CTA Sections — Streamlined ──────────────────────── */

.lb-cta-section__actions {
  flex-direction: column;
  align-items: stretch;
}

.lb-cta-section__actions .lb-btn {
  width: 100%;
}

/* ── 28. Feature Comparison Cards (vs pages) ─────────────── */

/* Side-by-side feature blocks → stack */
[data-track-section] .lb-container > div[style*="display:grid"][style*="1fr 1fr"] {
  grid-template-columns: 1fr !important;
}

/* ── 29. Prevent Layout Shifts — Kill All Animations ────── */

/* Disable ALL scroll-reveal and hero animations on mobile.
   Content should be immediately visible, not hidden behind
   opacity:0 waiting for IntersectionObserver to fire. */
.lb-hero-enter,
.lb-hero-enter--delayed,
.lb-reveal,
.lb-reveal-stagger > .lb-reveal,
.lb-fade-in {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
  transition: none !important;
}

/* Reduce animation on mobile to prevent jank */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── 30. Dark Section Text Sizing ────────────────────────── */

.lb-section--dark p {
  font-size: var(--lb-text-base);
  line-height: 1.6;
}

/* ── 31. Persona Pages (for-owners, for-tenants) ─────────── */

/* These use similar hero + feature grid patterns */
[data-track-section="hero-owners"] .lb-container,
[data-track-section="hero-tenants"] .lb-container {
  grid-template-columns: 1fr !important;
}

/* ── 32. Contact Form ────────────────────────────────────── */

.lb-contact-form {
  max-width: 100%;
}

.lb-contact-form .lb-btn {
  width: 100%;
}
