/* Mobile CSS - max-width: 767px */

/* Prevent horizontal scroll and ensure proper mobile behavior */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

* {
  box-sizing: border-box;
}

/* Mobile Navigation */
.nav {
  flex-direction: column;
  padding: 12px 16px;
}

.nav-links {
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
  width: 100%;
}

.nav-links a {
  padding: 12px 16px;
  text-align: center;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hero Section */
.hero-grid {
  grid-template-columns: 1fr;
  gap: 24px;
  text-align: center;
}

.hero-copy h1 {
  font-size: 28px;
  line-height: 1.2;
}

.hero-cta {
  flex-direction: column;
  gap: 12px;
}

.hero-cta .btn {
  min-height: 48px;
  font-size: 16px;
  padding: 14px 20px;
}

/* Cards and Grid Layouts */
.cards {
  grid-template-columns: 1fr;
  gap: 16px;
}

/* Grid layouts - Enhanced for mobile */
.grid-2 {
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: 100%;
  overflow: hidden;
}

.card {
  overflow: hidden;
  max-width: 100%;
}

.pill-grid {
  grid-template-columns: 1fr;
  gap: 12px;
}

/* Forms */
.form {
  flex-direction: column;
  gap: 12px;
}

.form input {
  min-height: 48px;
  padding: 14px 16px;
  font-size: 16px;
}

.form button {
  min-height: 48px;
  font-size: 16px;
  padding: 14px 20px;
}

/* Typography and Container */
.container {
  padding: 0 16px;
  max-width: 100%;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 18px;
}

/* Code Blocks - Fixed for mobile */
.code-block {
  font-size: 11px;
  overflow-x: auto;
  overflow-y: auto;
  padding: 12px;
  max-height: 300px;
  width: 100%;
  max-width: calc(100vw - 64px); /* Viewport width minus container padding */
  box-sizing: border-box;
  background: #0b0f19;
  color: #e5e7eb;
  border-radius: 8px;
  white-space: pre;
  line-height: 1.4;
}

.code-block code {
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
  display: block;
  width: 100%;
}

/* FAQ */
.faq-question {
  padding: 16px;
  font-size: 16px;
  min-height: 44px;
  cursor: pointer;
}

.faq-answer {
  padding: 0 16px 16px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.faq-item.active .faq-answer {
  padding: 0 16px 16px;
}

.faq-icon {
  font-size: 20px;
  transition: transform 0.3s ease-out;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

/* Buttons */
.btn {
  min-height: 44px;
  padding: 12px 20px;
  font-size: 16px;
  touch-action: manipulation;
}

/* Touch Targets */
a, button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  touch-action: manipulation;
}

/* Spacing */
.section {
  padding: 32px 0;
}

.strip {
  padding: 16px 0;
}

/* Hide decorative elements on mobile */
.hero-card .card {
  margin-top: 0;
}

/* Improve readability */
p, li {
  line-height: 1.6;
}

/* Contact links - make phone prominent */
a[href^="tel:"] {
  background: #2563eb;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
}

/* Mobile FAQ Fixes */
.faq-question {
  padding: 16px 8px;
  font-size: 16px;
  min-height: 48px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0,0,0,0.1);
  cursor: pointer;
}

.faq-question:active {
  background-color: #f8f9fa;
}

.faq-item {
  margin-bottom: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.faq-answer {
  padding: 0 16px;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.faq-item.active .faq-answer {
  padding: 8px 16px 16px;
}

.faq-icon {
  font-size: 20px;
  min-width: 24px;
  text-align: center;
  pointer-events: none;
}

/* Data section and grid fixes */
.grid-2 {
  grid-template-columns: 1fr;
  gap: 24px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Ensure list items don't overflow */
.list {
  padding-left: 16px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.list li {
  margin: 12px 0;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Cards containing code blocks */
.card {
  overflow: hidden;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Image frames in data sections */
.img-frame {
  max-width: 100%;
  overflow: hidden;
}

.img-frame img,
.img-frame svg {
  max-width: 100%;
  height: auto;
  display: block;
}