@charset "UTF-8";
/*
 * Phone and tablet layout. tools/build_static.py copies this file to public/mobile.css
 * and links it with media="screen and (max-width: 920px)", so the PC layout never sees it.
 * Do not put overflow-x:hidden on html or body: it hides content instead of fitting it.
 * Check with tools/check_mobile.mjs.
 */

html, body {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ---- One column ---- */
#wapper, #wapper * {
  box-sizing: border-box;
}
.layout-two-column-left #wapper {
  width: auto;
}
.layout-two-column-left #content {
  float: none;
  width: auto;
  margin: 0 8px;
}
.newside {
  float: none;
  width: auto;
  margin: 24px 8px 0;
  font-size: 14px;
}
#content, .newside, div[style*="width: 730px"] {
  word-wrap: break-word;
  overflow-wrap: anywhere;
  /* Full-width spaces at a line end hang past the box and add page width. They are
     invisible. check_mobile.mjs reports any box or visible text this clips. */
  overflow-x: clip;
}

/* ---- Header: the top link is hidden inline, so only this file can show it ---- */
#header {
  height: auto;
  min-height: 40px;
}
#header > div {
  width: auto !important;
  height: auto !important;
}
#header img {
  max-width: 100%;
  height: auto;
}
#header .headgoogle {
  padding: 4px 8px;
}
#header ul {
  position: static;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 3px 8px !important;
  line-height: normal !important;
}
#header ul li {
  padding-left: 12px;
  line-height: normal;
}
#header .to-side {
  display: inline-block !important;
  box-sizing: border-box;
  min-height: 44px;
  padding: 11px 12px;
  line-height: 20px;
  border: 1px solid #a96666;
  border-radius: 4px;
  background: #f9b0d4;
  color: #221111;
  font-size: 14px;
  text-decoration: none;
}

/* ---- Banner: the whole image fits the width and the description sits under it ---- */
#banner {
  position: relative;
  width: auto;
  height: auto;
  padding-top: 55.56%; /* 900x500 */
  background-position: center top;
  background-size: contain;
}
#banner:has(> div + div) {
  padding-top: 46.67%; /* top02.jpg, 900x420 */
}
#banner h1 {
  padding: 4px 8px;
  line-height: 1.5;
}
#banner h1 span {
  font-size: 11px;
}
#banner > div:first-of-type {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: auto !important;
  height: auto !important;
}
#banner > div:first-of-type a,
#banner > div:first-of-type img {
  display: block;
  width: 100%;
  height: 100%;
}
#banner > div + div {
  position: relative;
  z-index: 1;
  width: auto !important;
  height: auto !important;
}

/* ---- Amazon 728x90 cannot be scaled down ---- */
iframe[width="728"],
#content > br:has(~ iframe[width="728"]),
iframe[width="728"] + br,
iframe[width="728"] + br + br {
  display: none;
}

/* ---- Fixed sizes from the old HTML ---- */
img, iframe, embed, object, video, textarea, input {
  max-width: 100%;
}
img {
  height: auto;
}
.entry img {
  max-width: calc(100% - 5px);
}
#content [style*="width"], .newside [style*="width"] {
  max-width: 100% !important;
}
hr {
  max-width: 100%;
}
.entry_notice_base {
  width: auto;
  height: auto;
}

/* ---- Video: 16:9 at full width ---- */
iframe[src*="youtube.com/embed"],
embed[src*="youtube.com"],
object:has(embed[src*="youtube.com"]) {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

/* ---- Tables scroll inside themselves ---- */
table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table, table * {
  word-wrap: normal;
  overflow-wrap: normal;
}
/* A percentage max-width inside an auto-layout table squeezes media down to a few
   pixels. The table scrolls instead when its media is wider than the screen. */
table img, table iframe, table embed, table object,
#content table [style*="width"], .newside table [style*="width"] {
  max-width: none !important;
}

/* ---- Ascii art keeps its line breaks and scrolls ---- */
.aa, .aa_min, div[style*="Mona"] {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
}
.aa, .aa *, .aa_min, .aa_min *, div[style*="Mona"], div[style*="Mona"] * {
  word-wrap: normal;
  overflow-wrap: normal;
  word-break: normal;
  white-space: nowrap;
}

/* ---- Reading size ---- */
.entry {
  margin-bottom: 24px;
  border: 1px solid #e9a063;
  border-bottom-width: 3px;
  border-radius: 8px;
  font-size: 16px;
  line-height: 1.7;
}
/* kadomaru.png is a 580px frame that cannot scale, so .entry draws the frame above. */
.kadomaru, .entry-header, .entry-header-entry, .entry-content, .entry-content-entry {
  background-image: none;
}
.entry-header, .entry-header-entry {
  padding-right: 8px;
  font-size: 16px;
  line-height: 1.4;
}
.entry-content, .entry-content-entry {
  padding-right: 8px;
  padding-left: 8px;
}
.date {
  margin-top: 16px;
  font-size: 13px;
}
.entry-footer {
  height: auto;
  background-position: left bottom;
  margin: 0;
  padding: 0 8px 6px;
  font-size: 12px;
}
blockquote {
  margin: 12px 0 0;
  padding: 8px;
  font-size: 15px;
}
.sidetitle, .side {
  font-size: 14px;
  line-height: 1.9;
}
.comments, .trackbacks {
  margin: 10px 0;
}
.comment-content, .trackback-content, .comment-footer, .trackback-footer {
  font-size: 14px;
}
.comments-header, .trackbacks-header {
  font-size: 13px;
}
.paged-archives, .content-nav {
  font-size: 14px;
  line-height: 2.8;
}
.paged-archives a, .paged-archives b, .content-nav a {
  display: inline-block;
  line-height: 1.8;
  padding: 3px 10px;
}

/* ---- Sidebar moves under the article and keeps everything, including the credit ---- */
.newside-contents-box-title {
  width: auto;
  margin-left: 0;
  padding: 8px;
  text-align: left;
}
.newside-contents-box {
  margin-bottom: 24px;
  padding: 10px 8px;
}
.newside-contents-box:has(> .headgoogle) > br + br {
  display: none;
}
.newside-contents-box_ {
  width: auto;
  margin-bottom: 16px;
  margin-left: 0;
  padding: 4px 8px;
}
.newside-contents-box_ span {
  font-size: 12px !important;
}
.powered {
  font-size: 12px;
}

/* ---- Links large enough for a finger ---- */
.newside-contents-box > a, .newside-contents-box > div > a {
  display: inline-block;
  padding: 12px 4px;
}
.links li {
  line-height: 1.4;
}
.links a {
  display: block;
  box-sizing: border-box;
  min-height: 44px;
  padding: 12px 0;
}
.searcharea {
  width: 60%;
  height: 40px;
  font-size: 16px;
}
.searchsubmit {
  width: auto;
  height: 40px;
  padding: 0 10px;
  font-size: 14px;
}

/* ---- Link columns after #wapper: 20% of a phone screen cannot hold their links ---- */
body > div[style*="width:96%"] {
  width: auto !important;
  padding: 0 8px !important;
  font-size: 14px;
}
body > div[style*="width:96%"] > div[style*="float:left"] {
  float: none !important;
  width: auto !important;
  margin-bottom: 16px;
}

/* ---- archives/2007/12/kunisaki_saikou.html closes #wapper early and sizes its long
   ascii art column inline. littlebusters_18.html uses the same font block. ---- */
div[style*="width: 950px"] {
  width: auto !important;
}
div[style*="width: 730px"] {
  float: none !important;
  width: auto !important;
  margin: 0 8px !important;
}
