/*
  Special Events（/special-events）の共通スタイル。

  【ここが素の HTML / CSS である理由（消して Flutter に戻さないこと）】
  サイト本体は flutter build web（CanvasKit）なので、本文テキストは canvas に描かれ
  DOM に存在しない。検索エンジン・SNS のクローラからは空ページに見え、OGP も付けられない。
  Special Events は「写真と文章を読ませて、蓄積していく」ためのコンテンツなので、
  hanakoganei.html・レッスンノート（LessonNotesHtmlFunction）と同じく素の HTML で持つ。
  srcset / lazy loading / width-height による CLS 防止 / <video> も Flutter では書けない。

  【デザイントークンは front/lib/config/theme.dart と同じ値にすること】
  --fg/--muted/--primary は theme.dart の textPrimary/textSecondary/primaryColor、
  --sand は accentColor。ヘッダ・フッタは AppNavigationBar と見た目をそろえてある
  （数値を変えるときは lesson-notes 側の CSS も一緒に見ること）。
  Special Events のためだけに別のデザインシステムを作らない。
*/

:root {
  --fg: #2C3E40;
  --muted: #6B7C7E;
  --primary: #4A6B5C;
  --sand: #D4A574;
  --bg: #F8F9FA;
  --line: #E3E7E8;
  /* 写真の周りに置く紙の色。--bg より少し温かくして誌面らしくする */
  --paper: #FCFBF8;
}

* { box-sizing: border-box; }

html, body {
  /* 全幅の写真バンドがあるので、横スクロールは明示的に殺す */
  overflow-x: hidden;
  max-width: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--fg);
  line-height: 2;
  font-family: "M PLUS 2", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--primary); }

img, video { display: block; max-width: 100%; height: auto; }

/* ── ヘッダ / フッタ（Flutter 本体の AppNavigationBar に合わせる） ───────── */

header.site {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 32px; background: #fff;
}
header.site .brand {
  display: flex; align-items: center; gap: 6px; font-weight: 700;
  font-size: 24px; line-height: 1.3; color: var(--primary); text-decoration: none;
}
header.site .brand img { width: 40px; height: 40px; }
header.site nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
header.site nav a {
  padding: 8px 12px; border-radius: 6px; font-size: 16px; font-weight: 600;
  color: var(--fg); text-decoration: none; line-height: 1.5;
}
header.site nav a:hover { background: rgba(74, 107, 92, .07); }
header.site nav a[aria-current="page"] { color: var(--primary); }

footer.site {
  max-width: 760px; margin: 0 auto; padding: 40px 24px 64px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.9;
}
footer.site p { margin: 0 0 8px; }

@media (max-width: 700px) {
  header.site { padding: 10px 16px; gap: 8px; }
  header.site .brand { font-size: 20px; }
  header.site .brand img { width: 32px; height: 32px; }
  header.site nav { margin-left: 0; width: 100%; gap: 0; }
  header.site nav a { padding: 6px 10px; font-size: 14px; }
}

/* ── 版面 ────────────────────────────────────────────────────────────────
   本文は 1 行が長くなりすぎないよう 720px に絞り、写真だけを外へ出す。 */

main { display: block; }

.wrap { max-width: 720px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.wrap-wide { max-width: 1080px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

.eyebrow {
  margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: var(--sand);
}
.place {
  margin: 0 0 4px; font-size: 14px; font-weight: 600; letter-spacing: .1em; color: var(--muted);
}

h1 {
  font-size: 34px; line-height: 1.5; font-weight: 700; margin: 0 0 20px;
  letter-spacing: .02em;
}
h2 {
  font-size: 20px; line-height: 1.7; font-weight: 600; margin: 0 0 16px;
}
.lead { color: var(--muted); font-size: 15px; margin: 0; }
p { margin: 0 0 22px; }

/* 章番号つきの見出し（01 奈摩漁港から海へ） */
.chapter { margin: 0 0 18px; }
.chapter .no {
  display: block; font-size: 12px; font-weight: 700; letter-spacing: .2em;
  color: var(--sand); margin-bottom: 2px;
}
.chapter h2 { margin: 0; }

/* 節の間の余白。写真の直後は広く取る */
.section { padding-top: 72px; padding-bottom: 72px; }
.section-tight { padding-top: 48px; padding-bottom: 48px; }

hr.rule {
  border: 0; border-top: 1px solid var(--line);
  max-width: 720px; margin: 0 auto;
}

/* ── 写真 ────────────────────────────────────────────────────────────────
   単純な等サイズグリッドにはしない。全幅バンド・2 枚並び・縦写真＋文章の
   3 パターンを写真の内容で使い分ける。 */

figure { margin: 0; }

figcaption {
  margin-top: 10px; font-size: 12px; line-height: 1.9; color: var(--muted);
}
.wrap figcaption, .wrap-wide figcaption { padding: 0; }
.bleed figcaption { max-width: 720px; margin: 10px auto 0; padding: 0 24px; }

/* 画面いっぱいの横長写真 */
.bleed img { width: 100%; }

/* 縦写真を高さ基準で中央に置くとき。キャプションも写真に合わせて中央へ寄せる
   （左寄せのままだと版面の左端に取り残され、写真と繋がって見えない）。 */
.figure-center { text-align: center; }
.figure-center img { margin-left: auto; margin-right: auto; }

/* 2 枚を左右に */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.duo img { width: 100%; }

/* 縦写真と文章を組み合わせる */
.side {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 44px; align-items: center;
}
.side.flip > figure { order: 2; }
.side img { width: 100%; }
.side .text p:last-child { margin-bottom: 0; }

@media (max-width: 760px) {
  .section { padding-top: 48px; padding-bottom: 48px; }
  .section-tight { padding-top: 32px; padding-bottom: 32px; }
  h1 { font-size: 26px; }
  h2 { font-size: 18px; }
  .side { grid-template-columns: 1fr; gap: 24px; }
  .side.flip > figure { order: 0; }
  /* 縦写真を 2 枚並べると主役が小さくなりすぎるのでスマホでは 1 列 */
  .duo { grid-template-columns: 1fr; gap: 16px; }
}

/* ── ヒーロー ────────────────────────────────────────────────────────────
   写真の上に文字を重ねず、直後に置く。黒いオーバーレイやグラデーションで
   写真を曇らせないため。スマホでは object-position で人物側に寄せて切る。 */

.hero img {
  width: 100%; height: auto;
  /* LCP になる画像。lazy にしない・fetchpriority=high を付けること */
}
.hero-title { padding-top: 44px; }
.hero-title h1 { margin: 0 0 18px; }
.hero-title .sub { color: var(--muted); font-size: 15px; margin: 0; }

@media (max-width: 760px) {
  /* 横長のまま出すと人物が小さくなりすぎる。3:4 に切って被写体側へ寄せる。
     元画像（1706x960）を拡大しないよう、切り出しは object-fit で行う。
     位置は上五島ヒーローの構図（SUP 3 艇が中央やや右・下寄り）に合わせてある。 */
  .hero img {
    aspect-ratio: 3 / 4; object-fit: cover; object-position: 55% 62%;
  }
  .hero-title { padding-top: 28px; }

  /* 縦写真から 3:2 の帯に切り出したヒーロー（福江島）。既定の 3:4 だと
     帯の左右しか出ないので、こちらは 4:5 で中央を見せる。 */
  .hero.hero-tall img { aspect-ratio: 4 / 5; object-position: center; }
}

/* ── 場所の地図（ロケーターマップ） ──────────────────────────────────────
   「長崎県・新上五島町」と書かれても、読む人にはそれがどこか分からない。
   書き出しの直後に、島の位置が九州との関係で分かる小さな地図を置く。

   ・API キーの要らない ?q=...&output=embed を使う。front/lib/screens/home/
     sections/google_map_embed_web.dart のスタジオ地図と同じ方式で、サイト内で
     地図の出し方を 2 つに分けないため。Maps Embed API（/maps/embed/v1/place）は
     API キーが要るので使わない。
   ・記事の主役は写真なので、地図は本文幅の中の小さな帯に留める。
     全幅バンドや大きな正方形にしないこと。
   ・iframe は必ず loading="lazy"。ファーストビューより下にあるので、
     そこまでスクロールされるまで Google を読み込ませない。
   ・&z= は「島だけが映る」倍率にしないこと。島に寄せると結局どこにある島なのか
     分からず、地図を置いた意味が無くなる（九州が入る z=8 前後にしてある）。
   ・iframe だけでは地図アプリで開けないので、下に Google マップへのリンクを
     必ず併記する。 */

.locator { margin: 0 0 26px; max-width: 440px; }

.locator .frame {
  position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden;
  background: var(--line); border: 1px solid var(--line); border-radius: 4px;
}
/* iframe は inset:0 で敷き詰める（.film と同じ形）。高さ 100% だけだと、
   aspect-ratio の効かないブラウザで既定の 150px に潰れる。 */
.locator iframe { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; }

/* 地名とリンクは横に並べず縦に積む。440px だと日本語の地名とリンクが
   1 行に収まらず、環境によって折り返し位置が変わるため。 */
.locator figcaption {
  display: flex; flex-direction: column; align-items: flex-start;
}

/* リンクは枠線なしの軽い見た目にする（.outlink のピルは節の締めで使うもので、
   本文の途中に置くと強すぎる）。ただしタップ領域は 44px を確保する。 */
.locator .maplink {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  color: var(--primary); text-decoration: none; font-weight: 600; font-size: 13px;
}
.locator .maplink:hover { text-decoration: underline; }
.locator .maplink .ext { font-size: 11px; }

@media (max-width: 760px) {
  /* スマホでは本文幅いっぱいに使う（440px だと逆に小さすぎる）。 */
  .locator { max-width: none; }
}

/* ── 動画 ────────────────────────────────────────────────────────────────
   16:9・ページ幅いっぱい。自動再生はしない（映像そのものを見てもらう）。
   ファイルがまだ無いあいだはブロックごと非表示にする（下部のスクリプト参照）。 */

.film { max-width: 1080px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.film .frame {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background: #0d1b1f; overflow: hidden;
}
.film video { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 760px) { .film { padding-left: 16px; padding-right: 16px; } }

/* ── 人の紹介（YOSHI さん） ─────────────────────────────────────────────── */

.person { background: #fff; }
.person .name { margin: 0 0 2px; font-size: 22px; font-weight: 700; }
.person .role { margin: 0 0 24px; font-size: 13px; color: var(--sand); font-weight: 600; letter-spacing: .08em; }

/* 名前＋紹介写真。写真は名前の右、版面の右端に寄せる。
   画像側で「白地に円形マスク」を焼き込んであるので、border-radius が
   効かない場面でも .person の白背景に溶けて丸く見える（二重の保険）。 */
.person-head {
  display: flex; align-items: center; gap: 20px; margin-bottom: 32px;
}
.person-head .avatar {
  width: 80px; height: 80px; flex: 0 0 auto;
  margin-left: auto; /* 右寄せ */
  border-radius: 50%; object-fit: cover;
}
.person-head-text { min-width: 0; }
.person-head-text .eyebrow { margin-bottom: 6px; }
.person-head-text .role { margin-bottom: 0; }

@media (max-width: 760px) {
  .person-head { gap: 14px; margin-bottom: 24px; }
  .person-head .avatar { width: 64px; height: 64px; }
}
.person .profile {
  margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line);
  font-size: 14px; color: var(--muted);
}
.person .profile p { margin: 0 0 12px; }

/* 外部リンク（Instagram・申込先など）。複数並ぶことがあるので .links で包む。 */
.outlink { margin-top: 28px; }
.outlink .links { display: flex; flex-wrap: wrap; gap: 12px; }
.outlink a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border: 1px solid var(--primary); border-radius: 999px;
  color: var(--primary); text-decoration: none; font-size: 14px; font-weight: 600;
  line-height: 1.6; min-height: 44px; /* タップ領域 */
  position: relative;
}
.outlink a:hover { background: rgba(74, 107, 92, .07); }
.outlink .ext { font-size: 12px; }

/* 読み上げにだけ届く注記（「別のサイトが開きます」）。見た目には出さない。 */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ── 締め ────────────────────────────────────────────────────────────────── */

.closing { text-align: center; }
.closing h2 { font-size: 22px; margin-bottom: 20px; }
.closing p { color: var(--muted); }
.back { margin: 28px 0 0; font-size: 14px; }
.back a { font-weight: 600; }

/* ── 一覧ページのカード ──────────────────────────────────────────────────
   「お知らせカード」にはしない。写真を大きく取り、枠線や影を使わない。 */

.entries { display: block; }

.entry { display: block; text-decoration: none; color: inherit; }
.entry + .entry { margin-top: 72px; }
.entry figure { overflow: hidden; background: var(--line); }
.entry img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  transition: transform .6s ease;
}
.entry:hover img { transform: scale(1.02); }
.entry .body { max-width: 720px; margin: 0 auto; padding: 24px 24px 0; }
.entry h2 { margin: 0 0 12px; font-size: 24px; line-height: 1.6; }
.entry .place { margin-bottom: 6px; }
.entry .excerpt { color: var(--muted); margin: 0 0 14px; }
.entry .more { font-size: 14px; font-weight: 600; color: var(--primary); }

@media (max-width: 760px) {
  .entry + .entry { margin-top: 48px; }
  .entry h2 { font-size: 20px; }
  /* 16:9 のままだと被写体が小さいので、スマホでは少し縦に */
  .entry img { aspect-ratio: 4 / 3; }
  .entry .body { padding: 20px 20px 0; }
}

/* 写真がまだ無いイベント用のプレースホルダ。
   写真が届いたら <img> に差し替えるだけで済むよう、比率は .entry img と同じにする。 */
.entry .placeholder {
  width: 100%; aspect-ratio: 16 / 9;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, #E8EDE9 0%, #F3EFE6 100%);
  color: var(--primary); font-size: 40px;
}
@media (max-width: 760px) { .entry .placeholder { aspect-ratio: 4 / 3; } }
