/* ===========================================
   Base Styles & Typography
   AirElixir LP
   =========================================== */

html {
  font-size: 100%; /* 16px base */
  -webkit-text-size-adjust: 100%;
  /* モバイルでの横スクロールを抑制（mobile-menu の translateX が露見しないように） */
  overflow-x: hidden; /* fallback */
  overflow-x: clip;   /* modern: scroll context を作らずに完全クリップ */
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-base);
  color: var(--color-text);
  background-color: var(--color-base);
  overflow-x: hidden; /* fallback */
  overflow-x: clip;
  position: relative;
  width: 100%;
  /* iOS Safari の慣性スクロール */
  -webkit-overflow-scrolling: touch;
  /* iOS のタップハイライトを抑制 */
  -webkit-tap-highlight-color: rgba(34, 190, 240, 0.15);
}

/* iOS Safari の青色タップハイライトを完全に消す要素 */
a, button, [role="button"], input, label, select, textarea {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; /* ダブルタップズーム抑制 */
}

/* iOS で input フォーカス時の自動ズーム防止 */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="date"],
select,
textarea {
  font-size: 16px; /* これ未満だと iOS Safari がズームする */
}

@media (min-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  input[type="number"],
  input[type="search"],
  input[type="url"],
  input[type="date"],
  select,
  textarea {
    font-size: var(--fs-body);
  }
}

/* ---------- Headings (明朝体で和の上質感) ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--color-text);
}

h1 {
  font-size: var(--fs-h1);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.005em;
}

h3 {
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.4;
}

h4 {
  font-size: var(--fs-h4);
  font-weight: 600;
}

/* ---------- Paragraphs & Lists ---------- */
p {
  font-size: var(--fs-body);
  line-height: var(--lh-relaxed);
  color: var(--color-text-sub);
  max-width: 65ch;
}

p + p {
  margin-top: var(--space-2);
}

strong, b {
  font-weight: var(--fw-semibold);
  color: var(--color-text);
}

em, i {
  font-style: italic;
}

small {
  font-size: var(--fs-small);
}

/* ---------- Links ---------- */
a {
  color: var(--color-accent-sky);
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--color-text);
}

/* ---------- Code ---------- */
code, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* ---------- Blockquote ---------- */
blockquote {
  border-left: 3px solid var(--color-accent-sky);
  padding-left: var(--space-3);
  font-style: italic;
  color: var(--color-text-sub);
}

/* ---------- HR ---------- */
hr {
  border: none;
  height: 1px;
  background-color: var(--color-border);
  margin: var(--space-6) 0;
}

/* ---------- Skip Link (Accessibility) ---------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background-color: var(--color-text);
  color: var(--color-base);
  padding: var(--space-2) var(--space-3);
  z-index: var(--z-toast);
  border-radius: 0 0 var(--radius-sm) 0;
  transition: top var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
  top: 0;
}

/* ---------- Visually Hidden (Screen Reader Only) ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Print Styles ---------- */
@media print {
  body {
    color: #000;
    background: #fff;
  }
  a {
    text-decoration: underline;
  }
}
