/*
 * AirBinder 公開サイトの共通のスタイル（airbinder.jp）
 *
 * 色はアプリの配色（ios/SwimFlightPlanKit/Sources/SwimUI/Design/SwimPalette.swift、D 改「精密」）に合わせる。
 * 紺 #074180 と空色 #7AD0FE はアイコンの色。外部のフォント・画像・スクリプトは使わない（CSP は _headers）。
 * このファイルを変えたら、各ページの読み込み（site.css?v=…）の値を変える（/assets/* は長くキャッシュする）。
 */

/* ---------- 色と文字のトークン ---------- */

:root {
  color-scheme: light dark;

  --canvas: #F3F5F8;
  --surface: #FFFFFF;
  --border: #D5DBE3;
  --control-border: #7C8696;
  --text: #0E1726;
  --text-2: #364152;
  --accent: #0A3D7A;
  --on-accent: #FFFFFF;
  --accent-tint: #E6EDF6;
  --focus: #0A3D7A;

  --success: #1B5E3B;
  --success-bg: #F0F7F2;
  --info: #0F4C8A;
  --info-bg: #E4EDF8;
  --warning: #7A3E00;
  --warning-bg: #FDF0DE;
  --neutral: #364152;
  --neutral-bg: #EAEEF3;

  /* 冒頭の帯（アイコンの紺） */
  --hero-bg: #074180;
  --hero-text: #FFFFFF;
  --hero-text-2: #D6E4F5;
  --sky: #7AD0FE;

  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP",
    "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-code: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --radius: 8px;
  --gutter: 16px;
  --measure: 40em;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0B1017;
    --surface: #181E27;
    --border: #2E3846;
    --control-border: #6B7789;
    --text: #EDF1F6;
    --text-2: #B8C2CF;
    --accent: #8DBAF2;
    --on-accent: #08192F;
    --accent-tint: #1B2B42;
    --focus: #8DBAF2;

    --success: #7CD39E;
    --success-bg: #10281C;
    --info: #9CC6F7;
    --info-bg: #12253C;
    --warning: #F1BF7C;
    --warning-bg: #30230F;
    --neutral: #C8D0DB;
    --neutral-bg: #242C38;

    --hero-bg: #0D2847;
    --hero-text: #EDF1F6;
    --hero-text-2: #B8C8DC;
  }
}

/* ---------- 基本 ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 16px;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem; /* 17px */
  line-height: 1.8;
  line-break: strict;
  overflow-wrap: anywhere;
}

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

h1,
h2,
h3 {
  line-height: 1.4;
  font-weight: 700;
  word-break: auto-phrase;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.5rem, 1.25rem + 1vw, 1.875rem);
  margin: 0 0 20px;
}

h3 {
  font-size: 1.1875rem;
  margin: 0 0 8px;
}

p,
ul,
ol,
dl {
  margin: 0 0 16px;
}

ul,
ol {
  padding-left: 1.4em;
}

li + li {
  margin-top: 6px;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

strong {
  font-weight: 700;
}

code,
.code {
  font-family: var(--font-code);
}

.wrap {
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

@media (min-width: 48rem) {
  :root {
    --gutter: 32px;
  }
}

.prose {
  max-width: var(--measure);
}

.muted {
  color: var(--text-2);
}

.small {
  font-size: 0.9375rem;
}

/* ---------- 本文へ飛ぶリンク ---------- */

.skip-link {
  position: absolute;
  left: 16px;
  top: -200px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- ヘッダー ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  column-gap: 24px;
  row-gap: 4px;
  padding-block: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text);
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 7px;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav li + li {
  margin-top: 0;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover {
  background: var(--accent-tint);
}

.site-nav a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.45em;
}

@media (max-width: 30rem) {
  .site-nav {
    width: 100%;
    margin-left: -12px;
  }
}

/* ---------- 冒頭の帯 ---------- */

.hero {
  --focus: var(--sky);
  background: var(--hero-bg);
  color: var(--hero-text);
  padding-block: clamp(40px, 7vw, 88px) clamp(40px, 6vw, 72px);
}

.hero a {
  color: var(--hero-text);
}

.hero h1 {
  font-size: clamp(2rem, 1.3rem + 3.2vw, 3.25rem);
  line-height: 1.3;
  letter-spacing: 0.01em;
  margin: 0 0 20px;
  max-width: 18em;
}

.hero .lead {
  max-width: 38em;
  color: var(--hero-text-2);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  margin-bottom: 24px;
}

.release-note {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 6px 16px 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.6;
}

.release-note::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--sky);
}

/* ---------- 運航票（冒頭の図） ---------- */

.strip-figure {
  margin: clamp(32px, 5vw, 56px) 0 0;
}

.strip {
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  border-left: 10px solid var(--sky);
  overflow: hidden;
}

.strip-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  gap: 1px;
  margin: 0;
  background: var(--border);
  border-bottom: 1px solid var(--border);
}

.strip-fields > div {
  padding: 12px 16px;
  background: var(--surface);
}

.strip-fields dt {
  color: var(--text-2);
  font-size: 0.875rem;
  line-height: 1.5;
}

.strip-fields dd {
  margin: 2px 0 0;
  font-family: var(--font-code);
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

@media (max-width: 34rem) {
  .strip-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-flow: row dense;
  }

  .strip-fields > div {
    padding: 10px 12px;
  }

  .strip-fields > .wide {
    grid-column: 1 / -1;
  }

  .strip-fields dd {
    font-size: 1.1875rem;
  }
}

.strip-fields dd small {
  display: block;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0;
}

.rail {
  --dot: 16px;
  display: grid;
  margin: 0;
  padding: 20px 16px 4px;
  list-style: none;
}

.rail li {
  position: relative;
  margin: 0;
  padding: 0 0 20px calc(var(--dot) + 14px);
  color: var(--neutral);
}

/* 点 */
.rail li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: var(--dot);
  height: var(--dot);
  border: 2px solid currentColor;
  border-radius: 50%;
  background: var(--surface);
  z-index: 1;
}

/* 点をつなぐ線 */
.rail li::after {
  content: "";
  position: absolute;
  left: calc(var(--dot) / 2 - 1px);
  top: 0.45em;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.rail li:last-child::after {
  display: none;
}

.rail-status {
  display: block;
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.6;
}

.rail-detail {
  display: block;
  color: var(--text-2);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.rail .is-info {
  color: var(--info);
}

.rail .is-ack {
  color: var(--success);
}

.rail .is-ack::before {
  background: currentColor;
}

@media (min-width: 46rem) {
  .rail {
    grid-template-columns: repeat(4, 1fr);
    padding: 24px 20px 20px;
  }

  .rail li {
    padding: calc(var(--dot) + 12px) 16px 0 0;
  }

  .rail li::before {
    top: 0;
  }

  .rail li::after {
    left: var(--dot);
    right: 0;
    top: calc(var(--dot) / 2 - 1px);
    bottom: auto;
    width: auto;
    height: 2px;
  }
}

.strip-figure figcaption {
  margin-top: 12px;
  color: var(--hero-text-2);
  font-size: 0.9375rem;
}

/* ---------- 区分 ---------- */

.section {
  padding-block: clamp(48px, 7vw, 80px);
}

.section + .section {
  padding-top: 0;
}

.band {
  background: var(--surface);
  border-block: 1px solid var(--border);
}

.band + .section {
  padding-top: clamp(48px, 7vw, 80px);
}

.section-intro {
  max-width: var(--measure);
  color: var(--text-2);
  margin-bottom: 28px;
}

/* 受付と受理の対比 */
.compare {
  display: grid;
  gap: 16px;
  margin: 28px 0 0;
}

@media (min-width: 46rem) {
  .compare {
    grid-template-columns: 1fr 1fr;
  }
}

.compare > div {
  padding: 20px 24px;
  border-radius: var(--radius);
  border-left: 4px solid currentColor;
}

.compare dt {
  font-size: 1.1875rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.compare dd {
  margin: 0;
  color: var(--text);
}

.compare .is-received {
  background: var(--neutral-bg);
  color: var(--neutral);
}

.compare .is-accepted {
  background: var(--success-bg);
  color: var(--success);
}

/* 機能の一覧（広い画面では上に 2 つ、下に 3 つ） */
.cards {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 40rem) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cards > :last-child {
    grid-column: 1 / -1;
  }
}

@media (min-width: 60rem) {
  .cards {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .cards > * {
    grid-column: span 2;
  }

  .cards > :nth-child(-n + 2) {
    grid-column: span 3;
  }

  .cards > :last-child {
    grid-column: span 2;
  }
}

.cards li + li {
  margin-top: 0;
}

.card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card p:last-child {
  margin-bottom: 0;
}

.card .note {
  color: var(--text-2);
  font-size: 0.9375rem;
}

/* 2 列 */
.split {
  display: grid;
  gap: 32px;
}

@media (min-width: 52rem) {
  .split {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }
}

.split > * > :last-child {
  margin-bottom: 0;
}

/* 注意・案内の枠 */
.callout {
  padding: 20px 24px;
  border-radius: var(--radius);
  border-left: 4px solid var(--control-border);
  background: var(--neutral-bg);
}

.callout > :last-child {
  margin-bottom: 0;
}

.callout h2,
.callout h3 {
  margin-bottom: 12px;
}

.callout--warning {
  background: var(--warning-bg);
  border-left-color: var(--warning);
}

.callout--info {
  background: var(--info-bg);
  border-left-color: var(--info);
}

/* ---------- サポートなどの文書のページ ---------- */

.page-head {
  padding-block: clamp(40px, 6vw, 64px) 8px;
}

.page-head h1 {
  font-size: clamp(1.875rem, 1.4rem + 2vw, 2.5rem);
  margin: 0 0 12px;
}

.page-head p {
  max-width: var(--measure);
  color: var(--text-2);
}

.doc {
  display: grid;
  gap: 32px;
  padding-block: 24px clamp(48px, 7vw, 80px);
}

@media (min-width: 60rem) {
  .doc {
    grid-template-columns: 16rem minmax(0, 1fr);
    gap: 56px;
  }
}

.toc {
  align-self: start;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

@media (min-width: 60rem) {
  .toc {
    position: sticky;
    top: 24px;
  }
}

.toc h2 {
  font-size: 1rem;
  margin: 0 0 8px;
  color: var(--text-2);
}

.toc ol {
  margin: 0;
  padding-left: 1.4em;
  font-size: 0.9375rem;
}

.toc li + li {
  margin-top: 2px;
}

.toc a {
  display: block;
  padding-block: 4px;
  line-height: 1.6;
}

.doc-body {
  min-width: 0;
}

.doc-section {
  max-width: 44em;
  padding-bottom: 40px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.doc-section:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}

.doc-section > :last-child {
  margin-bottom: 0;
}

.doc-section h2 {
  font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.625rem);
}

.doc-section .callout {
  margin-bottom: 16px;
}

.doc-section.callout {
  padding: 24px;
  border-bottom: 0;
}

.doc-section.callout + .doc-section {
  padding-top: 0;
}

.updated {
  color: var(--text-2);
  font-size: 0.9375rem;
}

.mail {
  font-size: 1.1875rem;
  font-weight: 700;
}

.facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 20px;
  row-gap: 8px;
  align-items: baseline;
  margin: 0 0 24px;
}

.doc-section > :last-child.facts {
  margin-bottom: 0;
}

.doc-section h3 {
  margin-top: 28px;
}

.facts dt {
  color: var(--text-2);
}

.facts dd {
  margin: 0;
}

@media (max-width: 26rem) {
  .facts {
    grid-template-columns: 1fr;
    row-gap: 0;
  }

  .facts dd {
    margin-bottom: 10px;
  }
}

/* よくある質問 */
.faq {
  border-top: 1px solid var(--border);
}

.faq details {
  border-bottom: 1px solid var(--border);
}

.faq summary {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 4px;
  min-height: 44px;
  font-weight: 700;
  line-height: 1.6;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

/* 開閉の印（右向き → 下向き） */
.faq summary::before {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin-top: 0.55em;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}

.faq details[open] > summary::before {
  transform: rotate(45deg);
}

.faq summary:hover {
  color: var(--accent);
}

.faq .answer {
  padding: 0 4px 16px 25px;
}

.faq .answer > :last-child {
  margin-bottom: 0;
}

/* ---------- 準備中のページ・404 ---------- */

.notice-page {
  padding-block: clamp(48px, 8vw, 96px);
}

.notice-page h1 {
  font-size: clamp(1.75rem, 1.35rem + 1.8vw, 2.25rem);
  margin: 0 0 16px;
}

.notice-page .prose > :last-child {
  margin-bottom: 0;
}

/* ---------- フッター ---------- */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.9375rem;
  padding-block: 40px 48px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.footer-links li + li {
  margin-top: 0;
}

.footer-links a {
  display: inline-block;
  padding-block: 8px;
  font-weight: 600;
}

.site-footer p {
  margin-bottom: 8px;
  max-width: 48em;
}

.site-footer p:last-child {
  margin-bottom: 0;
}

/* ---------- 動きを減らす・印刷 ---------- */

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}

@media print {
  .skip-link,
  .site-nav,
  .toc {
    display: none;
  }

  body,
  .hero,
  .band,
  .site-footer {
    background: #FFFFFF;
    color: #000000;
  }

  .faq details > .answer {
    display: block;
  }
}
