/* 共有リンクのページ（投稿ページ・ランディングページ）の見た目。
   アプリのフォトフィールドの投稿の画面（io-app の UI/ProductUI/UIAssets/ProductUI/HudPhotoField.uss、板 M-PostDetail）の
   色・余白・角の丸み・字の大きさをそのまま写した。USS の基準の画面は 390x844 で、px は Figma の値そのまま。
   USS の letter-spacing は「px の値 / 100 em」なので、ここでは em に直して書く（0.5px → 0.005em、4px → 0.04em）。

   字体: UI の決まった文言（.pf-ui / .pf-ui-bold）は源柔ゴシック（SIL Open Font License 1.1。ライセンスの記載はフォントの
   name テーブルに残してある）を、このページで使う文字だけに絞った woff2 で出す。利用者が書いた文（表示名・本文・頭文字）は
   字が決まらないので、端末の丸ゴシック系の字体にする。外部の CDN からは読まない。 */

@font-face {
  font-family: "GenJyuu UI";
  src: url("fonts/genjyuu-ui-medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "GenJyuu UI";
  src: url("fonts/genjyuu-ui-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #E9DFCC;      /* .pf-paper */
  --sunken: #E3DAC6;     /* .pf-sunken・頭文字の丸・公開範囲の札 */
  --cheki: #FFFDF8;      /* .pf-cheki・シート */
  --photo: #DCE6F3;      /* .pf-post-photo の下地 */
  --ink: #4A3F35;        /* 文字（主） */
  --ink-sub: #75685A;    /* 補助の文字 */
  --ink-letter: #6E5A45; /* 頭文字の丸の文字 */
  --blue: #7B9ECB;       /* .pf-pill--primary */
  --blue-ink: #4F6F99;   /* .pf-link__label */
  --scrim: rgba(78, 60, 44, 0.60);
  --font-user: "Hiragino Maru Gothic ProN", "Zen Maru Gothic", "Kosugi Maru", "M PLUS Rounded 1c",
    "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  --font-ui: "GenJyuu UI", var(--font-user);
  --column: 430px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-user);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; }
[hidden] { display: none !important; }

.pf-ui { font-family: var(--font-ui); font-weight: 500; }
/* 決まった文言は文節で折り返す（対応していないブラウザは普通に折り返す） */
.pf-ui, .pf-ui-bold { word-break: auto-phrase; }
.pf-ui-bold { font-family: var(--font-ui); font-weight: 700; }

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

/* ── 上の帯（アプリのロゴと名前・「アプリで開く」） ── */
.pf-topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(233, 223, 204, 0.94);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  padding-top: env(safe-area-inset-top);
}
.pf-topbar__inner {
  max-width: var(--column); height: 56px; margin: 0 auto; padding: 0 16px 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.pf-brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; }
.pf-brand__icon { width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; }
.pf-brand__name {
  font-size: 15px; letter-spacing: 0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pf-topbar__open {
  flex-shrink: 0; height: 36px; padding: 0 16px; border-radius: 18px;
  display: inline-flex; align-items: center;
  background: var(--blue); color: #FFFFFF; text-decoration: none; font-size: 13px; letter-spacing: 0.02em;
}
.pf-topbar__open:active { opacity: 0.7; }

/* ── 1 列（アプリの .pf-content は 390 の列。Web は 430 まで広げて中央に置く） ── */
.pf-column { max-width: var(--column); margin: 0 auto; padding: 8px 0 calc(32px + env(safe-area-inset-bottom)); }

/* ── 投稿（.pf-post--detail） ── */
.pf-post { padding-bottom: 8px; }

/* チェキ: 白い紙の余白で写真を囲む（.pf-cheki--post: margin 0 20px、padding 8px 8px 0 8px） */
.pf-cheki { margin: 0 20px; padding: 8px 8px 0 8px; background: var(--cheki); }

/* 写真: Figma の 350x467 の比で切り抜く（.pf-post-photo、scale-and-crop） */
.pf-post-photo { position: relative; aspect-ratio: 350 / 467; background: var(--photo); overflow: hidden; }
.post-media { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--photo); }
video.post-media { background: #000000; }

/* 動画の再生が終わったときの案内（post.js が出す）。写真の上に紙の地を薄く重ね、真ん中に置く */
.pf-ended {
  position: absolute; inset: 0; padding: 0 28px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  background: rgba(233, 223, 204, 0.92);
}
.pf-ended__title { margin: 0; font-size: 18px; line-height: 27px; letter-spacing: 0.01em; }
.pf-ended .pf-pill--primary { margin-top: 20px; }
.pf-ended__replay { margin-top: 8px; }

/* 動画の下の案内（JavaScript が無くても見える）。チェキの外の紙の地に 1 行で置く */
.pf-notice {
  margin: 12px 20px 0; padding: 10px 10px 10px 16px; border-radius: 22px; background: var(--cheki);
  display: flex; align-items: center; gap: 12px;
}
.pf-notice__text { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 13px; line-height: 19px; }
.pf-notice__open {
  flex-shrink: 0; height: 36px; padding: 0 16px; border-radius: 18px;
  display: inline-flex; align-items: center;
  background: var(--blue); color: #FFFFFF; text-decoration: none; font-size: 13px; letter-spacing: 0.02em;
}
.pf-notice__open:active { opacity: 0.7; }

/* チェキの下の帯（.pf-cheki__caption--detail: 高さ 46・左右 2）。左に投稿者、右に PHOTO BY と投稿の日時 */
.pf-caption { height: 46px; padding: 0 2px; display: flex; align-items: center; min-width: 0; }
.post-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; margin-right: 8px;
  background: var(--sunken); object-fit: cover;
}
.post-avatar--initial {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1; color: var(--ink-letter); font-weight: 500;
}
.pf-caption__name {
  flex: 1 1 auto; min-width: 0; font-size: 15px; font-weight: 700; line-height: 19px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pf-caption__by { flex-shrink: 0; max-width: 58%; margin-left: 8px; display: flex; flex-direction: column; align-items: flex-end; }
.pf-caption__label { font-size: 11px; line-height: 16px; color: var(--ink-sub); }
.pf-caption__date { margin-top: 1px; font-size: 11px; line-height: 15px; color: var(--ink-sub); white-space: nowrap; }

/* 操作の列（.pf-post-actions: padding 12px 24px 0 24px、操作どうし 24、アイコン 22、数 13px） */
.pf-actions { height: 36px; padding: 12px 24px 0 24px; display: flex; align-items: center; }
.pf-action {
  height: 24px; display: inline-flex; align-items: center; flex-shrink: 0;
  text-decoration: none; color: var(--ink-sub); -webkit-tap-highlight-color: transparent;
}
.pf-action:active { opacity: 0.6; }
.pf-action--second { margin-left: 24px; }
.pf-action__icon { width: 22px; height: 22px; }
.pf-action__count, .pf-action__label { margin-left: 8px; font-size: 13px; line-height: 17px; }
.pf-actions__spacer { flex-grow: 1; }
/* 公開の範囲（.pf-visibility: 高さ 24・角 12）。Web に出るのは全体公開の投稿だけ */
.pf-visibility {
  height: 24px; padding: 0 12px; border-radius: 12px; background: var(--sunken);
  display: inline-flex; align-items: center; font-size: 11px; color: var(--ink-sub); flex-shrink: 0;
}

/* 本文（.pf-post-caption: margin 12px 32px 0 20px、15px、行の高さ 27） */
.pf-post-caption {
  margin: 12px 32px 0 20px; font-size: 15px; line-height: 27px;
  overflow-wrap: anywhere; word-break: normal;
}
.pf-post-caption:empty { display: none; }

/* ── アプリでもっと見る（.pf-profile・.pf-comment-preview と同じ白い紙・角 22） ── */
.pf-more {
  margin: 32px 20px 0; padding: 20px 20px 16px; border-radius: 22px; background: var(--cheki);
}
.pf-more__head { display: flex; align-items: center; gap: 14px; }
.pf-more__icon { width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0; }
.pf-more__title { margin: 0; font-size: 15px; line-height: 20px; letter-spacing: 0.01em; }
.pf-more__lead { margin: 4px 0 0; font-size: 13px; line-height: 20px; color: var(--ink-sub); }
.pf-more__note { margin: 12px 0 0; font-size: 11px; line-height: 16px; color: var(--ink-sub); text-align: center; }

/* 丸い大きなボタン（.pf-pill: 高さ 50・角 25。主は青に白・字間 4/100em） */
.pf-pill {
  height: 50px; padding: 0 20px; border: 0; border-radius: 25px;
  display: flex; align-items: center; justify-content: center; width: 100%;
  font-size: 15px; text-decoration: none; cursor: pointer;
}
.pf-pill:active { opacity: 0.7; }
.pf-pill--primary { margin-top: 16px; background: var(--blue); color: #FFFFFF; letter-spacing: 0.04em; }
.pf-pill--ghost { margin-top: 4px; background: transparent; color: var(--ink-sub); }

/* ストアのボタン（いまは「近日公開」。押せない見た目） */
.pf-stores { display: flex; gap: 12px; margin-top: 12px; }
.pf-store {
  flex: 1 1 0; min-width: 0; height: 50px; border-radius: 25px; background: var(--sunken);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--ink-sub); cursor: not-allowed; user-select: none;
}
.pf-store__name { font-size: 13px; line-height: 17px; }
.pf-store__soon { font-size: 11px; line-height: 15px; }

/* ── いちばん下（通報の連絡先） ── */
.pf-footer { margin: 24px 20px 0; text-align: center; font-size: 11px; line-height: 18px; color: var(--ink-sub); }
.pf-footer p { margin: 0; }
.pf-footer p + p { margin-top: 4px; }
.pf-footer a { color: var(--blue-ink); }

/* ── 下からのシート（.pf-sheet: 白・上の角 28、.pf-handle 44x5、.pf-scrim 0.60） ── */
.pf-sheet-layer { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.pf-scrim { position: absolute; inset: 0; margin: 0; padding: 0; border: 0; background: var(--scrim); cursor: pointer; }
.pf-sheet {
  position: relative; width: 100%; max-width: var(--column);
  background: var(--cheki); border-radius: 28px 28px 0 0;
  max-height: 90vh; overflow-y: auto; outline: none;
  animation: pf-sheet-in 220ms ease-out;
}
.pf-sheet__inner {
  padding: 16px 20px calc(32px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.pf-handle { width: 44px; height: 5px; border-radius: 2.5px; background: var(--sunken); }
.pf-sheet__icon { width: 64px; height: 64px; border-radius: 16px; margin-top: 20px; }
.pf-sheet__title { margin: 16px 0 0; font-size: 18px; line-height: 27px; letter-spacing: 0.01em; }
.pf-sheet__lead { margin: 8px 0 0; font-size: 13px; line-height: 21px; color: var(--ink-sub); }
.pf-sheet .pf-stores { width: 100%; }
.pf-scrim { animation: pf-fade-in 220ms ease-out; }

/* ── 開いた直後のアプリの案内（投稿ページだけ。post.js が作る。JavaScript が無ければ出ない） ──
   シートと同じ白い紙・角・丸いボタンで、画面の真ん中に重ねる。閉じるボタンは押しやすい 44px 角 */
.pf-promo-layer {
  position: fixed; inset: 0; z-index: 110; padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: center;
}
.pf-promo {
  position: relative; width: 100%; max-width: 360px; max-height: 100%; overflow-y: auto; outline: none;
  padding: 36px 20px 16px; border-radius: 28px; background: var(--cheki);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  box-shadow: 0 12px 40px rgba(78, 60, 44, 0.25);
  animation: pf-promo-in 240ms ease-out;
}
.pf-promo__close {
  position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 22px;
  background: var(--sunken); color: var(--ink-sub); font-size: 22px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.pf-promo__close:active { opacity: 0.7; }
.pf-promo__badge {
  padding: 2px 10px; border-radius: 10px; background: var(--sunken); color: var(--ink-sub);
  font-size: 11px; line-height: 16px; letter-spacing: 0.04em;
}
.pf-promo__icon { width: 88px; height: 88px; border-radius: 22px; margin-top: 12px; }
.pf-promo__name { margin: 12px 0 0; font-size: 20px; line-height: 28px; letter-spacing: 0.04em; }
.pf-promo__lead { margin: 8px 0 0; font-size: 14px; line-height: 23px; color: var(--ink); }
.pf-promo .pf-stores { width: 100%; }
.pf-promo .pf-pill--ghost { margin-top: 8px; }
.pf-promo-layer .pf-scrim { animation: pf-fade-in 240ms ease-out; }

@keyframes pf-promo-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }

@keyframes pf-sheet-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes pf-fade-in { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .pf-sheet, .pf-scrim, .pf-promo { animation: none; }
}

/* 幅の広い画面: 紙の地の真ん中に 1 列で置く（上の帯も同じ幅にそろえる） */
@media (min-width: 600px) {
  .pf-column { padding-top: 24px; }
}

/* ── ランディングページ ── */
.pf-landing { max-width: var(--column); margin: 0 auto; padding: 24px 0 calc(32px + env(safe-area-inset-bottom)); }
.pf-landing__card {
  margin: 0 20px; padding: 32px 20px 20px; border-radius: 22px; background: var(--cheki);
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.pf-landing__icon { width: 96px; height: 96px; border-radius: 22px; }
.pf-landing__title { margin: 16px 0 0; font-size: 22px; line-height: 30px; letter-spacing: 0.04em; }
.pf-landing__lead { margin: 8px 0 0; font-size: 15px; line-height: 27px; }
.pf-landing__card .pf-stores { width: 100%; }
.pf-landing__note { margin: 16px 0 0; font-size: 13px; line-height: 21px; color: var(--ink-sub); }
