/* 江戸歴史散歩 本文ページ用の共通スタイル
   古い書き方（表で配置・小さな文字指定）のページを、HTMLの本文はそのままに、
   スマホでも読めるようにするためのファイルです。
   文字の大きさ・幅を変えたいときは、ここだけ直せば、このファイルを読み込む全ページに反映されます。 */
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{max-width:920px;margin-left:auto;margin-right:auto;padding:8px 12px;font-size:17px;line-height:1.8;overflow-wrap:anywhere}

/* 幅を固定した要素（罫線・入力欄・埋め込み動画など）も、画面の幅に収める */
[width],p,div{max-width:100%}
input,select,textarea{max-width:100%}
iframe{max-width:100%}
iframe[src*="youtube.com/embed"]{width:100%;aspect-ratio:16/9;height:auto}

/* 画像は画面の幅に収める */
img{max-width:100%;height:auto}
img[hspace]{max-width:calc(100% - 20px)}   /* 元の左右余白(hspace)ぶんを引く */

/* 昔の書き方で指定された、小さな文字と専用書体を読みやすくする */
font[face]{font-family:inherit}
font[style]{font-size:1rem!important;line-height:1.8!important}
font[size="1"]{font-size:.85rem}
font[size="2"]{font-size:.92rem}
pre{white-space:pre-wrap;font-family:inherit;line-height:1.8}

/* 表: 幅いっぱいを超えない。狭い画面では、横並びのセルを縦に積む */
table{max-width:100%}
@media (max-width:700px){
  table,tbody,thead,tfoot,tr,td,th{display:block;width:auto!important;max-width:100%}
  td,th{padding:4px 2px}
  table{margin-bottom:10px}
}

/* 写真1枚ごとにキャプションを付けたもの（狭い画面で折り返しても、写真と名前が離れない） */
.photos{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;margin:12px 0}
.photos figure{margin:0;max-width:100%;text-align:center}
.photos figcaption{font-size:.85rem;line-height:1.5;margin-top:2px}
p.caps{display:flex;flex-wrap:wrap;gap:4px 18px;justify-content:center;font-size:.85rem}
