/* biz-ca 名刺ページ
   基準：iPhone 15〜18（標準 幅393前後／Pro Max 幅430前後）
   ポイント：各ブロックの下に「次のブロックの頭」が少しのぞく高さにする */

:root {
  --bg: #eef1ee;
  --surface: #ffffff;
  --ink: #16191a;
  --ink-2: #4a5052;
  --ink-3: #848b8d;
  --line: #e2e6e3;
  --green-1: #239a4a;
  --green-2: #8dc63f;
  --green-ink: #1e7f3d;
  --radius: 18px;
  --gutter: 16px;
  --peek: 72px; /* 名刺の下にのぞかせる高さ */
  --shadow: 0 1px 2px rgba(16, 24, 20, .06), 0 10px 30px rgba(16, 24, 20, .10);
  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: max(var(--gutter), env(safe-area-inset-top)) var(--gutter) calc(32px + env(safe-area-inset-bottom));
}

/* ---------- 名刺 ---------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: calc(100svh - var(--gutter) - var(--peek));
  height: calc(100dvh - var(--gutter) - var(--peek));
  min-height: 540px;
  max-height: 820px;
  padding: 36px 28px 28px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card__sample {
  position: absolute; top: 14px; right: 14px;
  padding: 2px 10px; border-radius: 999px;
  background: #fff4d6; color: #8a6100; font-size: 12px; font-weight: 600;
}
.card__logos { display: flex; gap: 16px; align-items: center; min-height: 72px; }
.card__logos img { max-height: 96px; max-width: 45%; object-fit: contain; }
.card__logos--empty { min-height: 24px; }

.card__identity { margin-top: auto; padding-top: 24px; }
.card__title { margin: 0 0 4px; font-size: 15px; color: var(--ink-2); }
.card__name {
  margin: 0;
  font-size: clamp(32px, 10.5vw, 44px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .02em;
  white-space: nowrap; /* 名前は改行しない。長い名前は card.js が文字を小さくして1行に収める */
}
.card__roman { margin: 6px 0 0; font-size: 15px; color: var(--ink-2); letter-spacing: .03em; }

.card__org { margin-top: auto; padding-top: 24px; }
.card__company { margin: 0; font-size: 19px; font-weight: 600; line-height: 1.4; }
.card__address { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); }
.card__contact { margin-top: 14px; display: grid; gap: 2px; }
.card__line { font-size: 16px; text-decoration: none; overflow-wrap: anywhere; }

/* SAVE（電話帳に保存） */
.card__actions {
  display: flex; justify-content: flex-end; align-items: center; gap: 12px;
  margin-top: 24px;
}
.qr-mini {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  width: 56px; height: 52px; padding: 0;
  border: 1.5px solid var(--green-1); border-radius: 16px;
  background: var(--surface); color: var(--green-ink);
  font: 700 11px/1 var(--font); letter-spacing: .08em; cursor: pointer;
}
.qr-mini svg { width: 22px; height: 22px; fill: currentColor; }
.qr-mini:active { transform: scale(.97); }

.save {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px;
  padding: 0 26px 0 20px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green-1), var(--green-2));
  color: #fff;
  font-size: 20px; font-weight: 800; letter-spacing: .06em;
  text-decoration: none;
  box-shadow: 0 6px 14px rgba(35, 154, 74, .35);
  transition: transform .12s ease, box-shadow .12s ease;
}
.save:active { transform: translateY(1px) scale(.98); box-shadow: 0 3px 8px rgba(35, 154, 74, .35); }
.save__icon svg { width: 26px; height: 26px; fill: currentColor; display: block; }

/* ---------- 画像（最大2枚） ---------- */
.photo {
  margin: var(--gutter) 0 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #dfe4e0;
  box-shadow: var(--shadow);
}
.photo img {
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: calc(100dvh - var(--peek) - var(--gutter));
  object-fit: cover;
}

/* ---------- 経歴・連絡先・リンク ---------- */
.block {
  margin-top: var(--gutter);
  padding: 22px 22px 18px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.block__title {
  margin: 0 0 10px;
  font-size: 12px; font-weight: 700; letter-spacing: .14em;
  color: var(--green-ink); text-transform: uppercase;
}
.bio { font-size: 16px; line-height: 1.85; overflow-wrap: anywhere; }

.rows { list-style: none; margin: 0; padding: 0; }
.rows li + li { border-top: 1px solid var(--line); }
.row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0; min-height: 56px;
  text-decoration: none;
}
.row__icon {
  flex: none; display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 12px;
  background: #e9f5ec; color: var(--green-ink);
}
.row__icon svg { width: 20px; height: 20px; fill: currentColor; }
.row__body { display: grid; min-width: 0; flex: 1; }
.row__label { font-size: 12px; color: var(--ink-3); }
.row__value { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.row__note { font-size: 14px; color: var(--ink-2); }
.row__host { font-size: 12px; color: var(--ink-3); }
.row__go { flex: none; color: var(--ink-3); }
.row__go svg { width: 18px; height: 18px; fill: currentColor; display: block; }

/* ---------- QR ---------- */
.qr {
  width: min(360px, calc(100vw - 32px));
  padding: 28px 24px 20px;
  border: 0; border-radius: 24px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
.qr::backdrop { background: rgba(10, 14, 12, .55); }
.qr__name { margin: 0 0 14px; font-weight: 700; font-size: 18px; }
.qr__img { width: 100%; height: auto; aspect-ratio: 1; margin: 0 auto; }
.qr__note { margin: 12px 0 16px; font-size: 13px; color: var(--ink-2); }
.qr__close {
  width: 100%; min-height: 48px; border: 0; border-radius: 999px;
  background: #f0f2f1; color: var(--ink); font: 600 15px/1 var(--font); cursor: pointer;
}

/* ---------- その他 ---------- */
.footer { margin: 28px 0 72px; text-align: center; font-size: 12px; color: var(--ink-3); }
.footer a { text-decoration: none; letter-spacing: .1em; }

/* 名刺が画面から外れたら、下に「QRコードを表示」と「先頭へ」を常に出す */
.fab {
  position: fixed; z-index: 10;
  left: 50%; bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex; gap: 10px; align-items: center;
  transform: translate(-50%, 16px);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.fab.is-visible { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.fab__qr {
  display: inline-flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 20px 0 16px; border: 0; border-radius: 999px;
  background: var(--ink); color: #fff;
  font: 700 15px/1 var(--font); white-space: nowrap; cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .25);
}
.fab__qr svg { width: 22px; height: 22px; fill: currentColor; }
.fab__top {
  width: 48px; height: 48px; border: 0; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .95); color: var(--ink-2);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .18); cursor: pointer;
}
.fab__top svg { width: 22px; height: 22px; fill: currentColor; }

.inapp {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: #fff8e1; color: #6b4e00; font-size: 13px;
}
.inapp span { flex: 1; }
.inapp__btn {
  flex: none; padding: 8px 12px; border-radius: 999px;
  background: #6b4e00; color: #fff; text-decoration: none; font-weight: 700;
}

/* 404・トップ */
.page--plain { display: grid; min-height: 100dvh; place-items: center; }
.plain { text-align: center; padding: 40px 24px; }
.plain__brand { margin: 0; color: var(--green-ink); font-weight: 800; letter-spacing: .2em; }
.plain__title { margin: 8px 0; font-size: 24px; }
.plain__body { margin: 0; color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
  .save, .fab { transition: none; }
}

/* ---------- SAVEの手順ガイド（下から出るシート） ---------- */
.sheet {
  width: 100%; max-width: 480px;
  margin: auto auto 0;
  padding: 24px 22px calc(18px + env(safe-area-inset-bottom));
  border: 0; border-radius: 24px 24px 0 0;
  background: var(--surface);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .2);
}
.sheet::backdrop { background: rgba(10, 14, 12, .55); }
.sheet__title { margin: 0 0 16px; font-size: 18px; font-weight: 700; text-align: center; }
.guide { list-style: none; margin: 0 0 20px; padding: 0; display: none; gap: 12px; }
.sheet[data-active="ios"] .guide[data-os="ios"],
.sheet[data-active="android"] .guide[data-os="android"],
.sheet[data-active="other"] .guide[data-os="other"] { display: grid; }
.guide li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.6; }
.guide__num {
  flex: none; display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: #e9f5ec; color: var(--green-ink); font-weight: 800; font-size: 14px;
}
.sheet__go {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; border-radius: 999px;
  background: linear-gradient(90deg, var(--green-1), var(--green-2));
  color: #fff; text-decoration: none; font-weight: 800; font-size: 17px;
  box-shadow: 0 6px 14px rgba(35, 154, 74, .35);
}
.sheet__go svg { width: 24px; height: 24px; fill: currentColor; }
.sheet__cancel {
  display: block; width: 100%; margin-top: 8px; min-height: 44px;
  border: 0; background: none; color: var(--ink-3); font: 600 15px/1 var(--font); cursor: pointer;
}

/* ---------- Wix時代の名刺画像をそのまま表示するモード ---------- */
/* 画像に描かれているSAVEの位置（右から約8%・下から約6%）に、本物のボタンを重ねる */
.card--image {
  height: auto; min-height: 0; max-height: none;
  padding: 0;
  background: #fff;
}
.card__img {
  width: 100%; height: auto;
  max-height: calc(100dvh - var(--gutter) - var(--peek));
  object-fit: contain;
}
.card--image .card__actions {
  position: absolute; right: 7%; bottom: 5.2%;
  margin: 0;
}
.card--image .save { min-height: 46px; font-size: 18px; padding: 0 22px 0 16px; }
.card--image .qr-mini { height: 46px; width: 50px; background: rgba(255, 255, 255, .95); }
.legacy-links a { color: var(--green-ink); overflow-wrap: anywhere; }

/* WhatsApp：緑のアイコン付きで、タップするとWhatsAppが開く */
.card__line--wa { display: inline-flex; align-items: center; gap: 6px; color: #128c4b; font-weight: 600; }
.card__line--wa svg { width: 18px; height: 18px; fill: #25d366; flex: none; }

/* 画像の名刺：画像全体をタップすると「連絡する」シートが開く（SAVE・QRボタンは手前に出す） */
.card__tap { position: absolute; inset: 0; z-index: 1; border: 0; padding: 0; background: transparent; cursor: pointer; }
.card--image .card__actions { z-index: 2; }
.contact-list { display: grid; gap: 10px; margin-bottom: 8px; }
.contact-item {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 0 18px; border-radius: 16px;
  background: #f1f5f2; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 16px;
  overflow-wrap: anywhere;
}
.contact-item svg { width: 22px; height: 22px; fill: var(--green-ink); flex: none; }
.contact-item--wa svg { fill: #25d366; }

/* ---------- Canvaと同じ見た目のHTML名刺（card_layout） ---------- */
/* 1080×1600の座標を％で配置。文字の大きさは名刺の幅に対する割合（cqw）なので、画面幅が変わっても比率は同じ */
.lc {
  display: block;
  height: auto; min-height: 0; max-height: none;
  width: 100%;
  max-width: calc((100dvh - var(--gutter) - var(--peek)) * 1080 / 1600);
  margin: 0 auto;
  padding: 0;
  container-type: inline-size;
  background: #fff;
  font-family: 'Noto Sans JP', system-ui, sans-serif;
  color: #000;
}
.lc__t {
  position: absolute; margin: 0;
  white-space: pre-wrap; overflow-wrap: break-word;
  line-height: 1.4;
  font-feature-settings: "palt" 0;
  text-decoration: none; color: inherit;
}
.lc__t--link { cursor: pointer; -webkit-tap-highlight-color: rgba(35, 154, 74, .15); }
.lc__i { position: absolute; overflow: hidden; }
.lc__i img { position: absolute; max-width: none; height: auto; }
.lc__actions { position: absolute; transform: translateY(-50%); z-index: 2; }
.lc .card__actions { margin: 0; }
.lc .save { min-height: 46px; font-size: 18px; padding: 0 22px 0 16px; }
.lc .qr-mini { height: 46px; width: 50px; }
@container (max-width: 340px) {
  .lc .save { min-height: 40px; font-size: 16px; padding: 0 16px 0 12px; }
  .lc .qr-mini { height: 40px; width: 44px; }
}
