/* マイページ（/app）と掲示板（/board）で共通のスタイル。
   添付ギャラリーと画像ビューアはどちらの画面でも同じ見た目にする。 */

/* ---------- 添付（画像ギャラリー・動画） ---------- */
.att-single { display: block; margin: 4px 0 12px; }
.att-single img { width: 100%; border-radius: 12px; display: block; }
.att-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin: 4px 0 12px; }
.att-grid.two { grid-template-columns: repeat(2, 1fr); }
.att-grid a { display: block; position: relative; padding-top: 100%; border-radius: 10px; overflow: hidden; }
.att-grid img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.att-grid a:hover img { filter: brightness(1.05); }
.att-video { width: 100%; border-radius: 12px; display: block; margin: 4px 0 12px; background: #000; }

/* 13枚目からは畳む。display:none にしておくと loading="lazy" が働いて読み込みも起きない。 */
.att-grid a.att-hidden { display: none; }
.att-more {
  display: block; width: 100%; margin: -6px 0 12px; padding: 11px 12px;
  border: 1px solid var(--line, #e5e7eb); border-radius: 10px; background: #fff;
  font-size: 13.5px; font-weight: 700; color: var(--brand-ink, #006BB0); cursor: pointer;
}
.att-more:active { background: var(--chip, #f1f5f9); }

/* 「保存」ボタン。動画・資料に添える（画像は長押しで保存できるので付けない）。 */
.att-dl-row { display: flex; justify-content: flex-end; margin: -6px 0 12px; }
/* ビューア内のダウンロード（.lb-dl）は暗い背景の上に置くので、この見た目は当てない。 */
.att-dl:not(.lb-dl) {
  display: inline-flex; align-items: center; gap: 5px; padding: 8px 14px;
  border: 1px solid var(--line, #e5e7eb); border-radius: 999px; background: #fff;
  font-size: 12.5px; font-weight: 700; color: var(--ink, #0f172a); cursor: pointer;
}
.att-dl:not(.lb-dl):active { background: var(--chip, #f1f5f9); }
.lb-dl { cursor: pointer; }

/* ---------- 本文中のリンク ----------
   コーチが本文にURLを書く運用が実際にある（地図・動画・掲示板への案内など）。
   文字のままだとタップできないので、リンクにして別タブで開く。
   長いURLで横スクロールが出ないよう、折り返しを許す。 */
.linkified {
  color: var(--brand-ink, #006BB0); font-weight: 700;
  text-decoration: underline; text-underline-offset: 2px;
  word-break: break-all; overflow-wrap: anywhere;
}
.linkified:active { opacity: .7; }

/* ---------- 添付（PDF等の資料） ----------
   練習予定表のような配布資料。画像として展開せず、開くためのリンクにする。
   LINEにはPDFを送る形式が無いので、生徒はここから開くことになる。 */
.att-file {
  display: flex; align-items: center; gap: 10px; margin: 4px 0 12px;
  padding: 12px 14px; border: 1px solid var(--line, #e5eaf1); border-radius: 12px;
  background: var(--surface, #fff); text-decoration: none; color: inherit;
}
.att-file:hover { border-color: var(--brand, #0092E5); }
.att-file-ic {
  flex: none; font-size: 10px; font-weight: 900; letter-spacing: .06em;
  color: #fff; background: #d0403a; border-radius: 5px; padding: 5px 7px; line-height: 1;
}
.att-file-name {
  flex: 1; min-width: 0; font-size: 14px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.att-file-go { flex: none; font-size: 12.5px; font-weight: 700; color: var(--brand-ink, #006BB0); }
/* ---------- 画像ビューア（ライトボックス） ---------- */
/* 別タブで開くと戻る操作が必要で、複数枚の見比べもできない。
   同じ画面上のモーダルで開き、左右送り・スワイプ・保存まで完結させる。 */
.lbox { position: fixed; inset: 0; z-index: 100; background: rgba(10,14,20,.94);
  display: flex; align-items: center; justify-content: center; touch-action: pan-y; }
.lbox.hidden { display: none; }
.lbox img { max-width: 94vw; max-height: 78vh; border-radius: 10px; display: block;
  user-select: none; -webkit-user-drag: none; }
.lbox button { position: absolute; background: rgba(255,255,255,.14); color: #fff;
  border: 0; border-radius: 999px; cursor: pointer; line-height: 1;
  display: grid; place-items: center; font-family: inherit; }
.lbox button:hover { background: rgba(255,255,255,.26); }
/* 3つとも同じ大きさの丸に揃える（閉じるだけ小さいと不揃いに見える） */
.lb-close { top: 14px; right: 14px; width: 44px; height: 44px; font-size: 19px; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); width: 44px; height: 44px; font-size: 26px; }
.lb-prev { left: 12px; } .lb-next { right: 12px; }
.lb-bar { position: absolute; left: 0; right: 0; bottom: 18px; display: flex;
  align-items: center; justify-content: center; gap: 14px; color: #fff; font-size: 13px; font-weight: 700; }
.lb-dl { color: #fff; background: rgba(255,255,255,.16); padding: 9px 16px; border-radius: 999px;
  text-decoration: none; font-size: 13px; font-weight: 800; }
.lb-dl:hover { background: rgba(255,255,255,.28); }
/* 説明（アルバムでは撮影日と投稿名）。長いときは切り詰める。 */
.lb-cap { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: rgba(255,255,255,.9); font-weight: 700; }
/* 1枚だけのときは送りボタンを出さない */
.lbox.single .lb-prev, .lbox.single .lb-next, .lbox.single .lb-count { display: none; }
