/*
Theme Name: Keitai
Theme URI: https://keitai.kbsr.co.jp/
Author: Kobayashi Sharyo Co., Ltd.
Author URI: https://kbsr.co.jp/
Description: A tribute to Japanese mobile phone websites of the early 2000s (NTT DoCoMo 502i era). A single 240px column, no JavaScript on the front end, scanline overlay, a bitmap-style web font, and 138 hand-made 12x12 pixel-art emoji available as shortcodes. Shows 3 posts per page, the way a tiny screen once demanded.
Version: 0.1.0
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: keitai
Tags: blog, one-column, custom-menu, translation-ready
*/

/* ==========================================================================
   フォント（PixelMplus12 — M+ FONT LICENSE、assets/fonts/LICENSE-mplus.txt）
   ========================================================================== */
@font-face {
	font-family: "PixelMplus12";
	src: url("assets/fonts/PixelMplus12-Regular-subset.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "PixelMplus12";
	src: url("assets/fonts/PixelMplus12-Bold-subset.woff2") format("woff2");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

/* ==========================================================================
   配色変数（デフォルト = A案。Customizer が :root を上書きする）
   ========================================================================== */
:root {
	--k-bg: #ffffcc;
	--k-fg: #000000;
	--k-band-bg: #3366cc;
	--k-band-fg: #ffffff;
	--k-marquee-bg: #000099;
	--k-marquee-fg: #ffff00;
	--k-link: #000099;
	--k-rule: #3366cc;
}

/* ==========================================================================
   ベース
   ========================================================================== */
* {
	box-sizing: border-box;
}

html {
	background: #333333;
}

body {
	margin: 0;
	padding: 8px 0;
	font-family: "PixelMplus12", "MS Gothic", "Osaka-Mono", monospace;
	font-size: 12px;
	/* スマホ帯（549px以下）では font-size 18px に切り替えて1.5倍相当にする */
	line-height: 1.5;
	-webkit-font-smoothing: none;
	color: var(--k-fg);
}

body.no-bitmap-font {
	font-family: "MS Gothic", "Osaka-Mono", monospace;
}

/* 画面 = 240px の1カラム。実表示は拡大する（既定2倍、Customizer で変更可）。
   ビューポートが狭い場合は横スクロールが出ない倍率まで自動で下げる */
.k-screen {
	position: relative;
	max-width: 240px;
	margin: 0 auto;
	background: var(--k-bg);
	border: 2px solid #666666;
	zoom: 2;
}

@media (max-width: 549px) {
	html {
		background: var(--k-bg);
	}

	body {
		padding: 0;
		font-size: 18px;
	}

	.k-screen {
		zoom: 1;
		max-width: none;
		border: 0;
		min-height: 100vh;
		min-height: 100dvh;
	}
}

/* スキャンライン */
.k-screen::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background-image: repeating-linear-gradient(rgba(0, 0, 0, 0.1) 0 1px, rgba(0, 0, 0, 0.03) 1px 2px, transparent 2px 3px);
}

.k-frame {
	padding: 2px 4px 8px;
	overflow-wrap: break-word;
}

/* ==========================================================================
   要素
   ========================================================================== */
a {
	color: var(--k-link);
}

a:visited {
	color: var(--k-link);
}

img {
	max-width: 100%;
	height: auto;
	image-rendering: pixelated;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-size: 1em;
	margin: 0;
}

p {
	margin: 0 0 1em;
}

hr,
.k-rule {
	border: 0;
	border-top: 1px dashed var(--k-rule);
	margin: 4px 0;
}

code,
pre {
	font-family: inherit;
	background: rgba(0, 0, 0, 0.08);
}

pre {
	overflow-x: auto;
	padding: 2px;
}

blockquote {
	margin: 0 0 1em;
	padding-left: 6px;
	border-left: 2px solid var(--k-rule);
}

table {
	border-collapse: collapse;
	table-layout: fixed;
	width: 100%;
}

td,
th {
	border: 1px solid var(--k-rule);
	padding: 1px 2px;
	overflow-wrap: break-word;
}

ul,
ol {
	margin: 0 0 1em;
	padding-left: 1.5em;
}

/* ==========================================================================
   ヘッダー帯・marquee
   ========================================================================== */
.k-band {
	background: var(--k-band-bg);
	color: var(--k-band-fg);
	text-align: center;
	font-weight: 700;
	padding: 1px 2px;
	margin: 0 -4px 2px;
}

.k-band a {
	color: var(--k-band-fg);
	text-decoration: none;
}

.k-description {
	text-align: center;
	margin: 0 0 2px;
}

.k-marquee {
	background: var(--k-marquee-bg);
	color: var(--k-marquee-fg);
	overflow: hidden;
	white-space: nowrap;
	margin: 0 -4px 4px;
}

.k-marquee span {
	display: inline-block;
	padding-left: 100%;
	animation: k-scroll 12s linear infinite;
}

@keyframes k-scroll {
	to {
		transform: translateX(-100%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.k-marquee span {
		animation: none;
		padding-left: 0;
	}
}

/* ==========================================================================
   一覧・ナビ
   ========================================================================== */
.k-list {
	list-style: none;
	margin: 0 0 4px;
	padding: 0;
}

.k-list li {
	margin: 0;
}

.k-date {
	white-space: nowrap;
}

.k-pagenav {
	text-align: center;
	margin: 4px 0;
}

.k-pagenav a {
	white-space: nowrap;
}

/* 本文内ページ分割（wp_link_pages） */
.k-pagelinks {
	text-align: center;
	margin: 4px 0;
}

/* ==========================================================================
   絵文字
   ========================================================================== */
svg.k-emoji {
	width: 1em;
	height: 1em;
	vertical-align: -0.08em;
}

/* ==========================================================================
   コメント（足あと帳）
   ========================================================================== */
.k-comment-list {
	list-style: none;
	margin: 0 0 4px;
	padding: 0;
}

.k-comment-list li {
	margin: 0 0 4px;
}

.k-comment-meta {
	font-weight: 700;
}

.comment-form label {
	display: block;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	font-family: inherit;
	font-size: 1em;
	border: 1px solid var(--k-rule);
	background: #ffffff;
	color: #000000;
}

.comment-form input[type="submit"] {
	font-family: inherit;
	font-size: 1em;
}

/* iOS Safari 等のネイティブ装飾を無効化して当時風のフォーム部品にする */
input:not([type="checkbox"]):not([type="radio"]),
textarea,
button {
	-webkit-appearance: none;
	appearance: none;
	border-radius: 0;
}

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
	display: none;
}

.search-form .search-field {
	border: 1px solid var(--k-rule);
	background: #ffffff;
	color: #000000;
	font-family: inherit;
	font-size: 1em;
	width: 60%;
}

.search-form .search-submit,
.comment-form input[type="submit"] {
	border: 1px solid var(--k-fg);
	background: var(--k-bg);
	color: var(--k-fg);
	padding: 0 4px;
	font-family: inherit;
	font-size: 1em;
}

/* ==========================================================================
   スキップリンク（clip-path 方式、Index Of 審査対応の踏襲）
   ========================================================================== */
.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal;
}

.screen-reader-text:focus {
	background-color: #fff;
	clip-path: none;
	color: #00e;
	display: block;
	font-size: 1em;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 8px 12px;
	text-decoration: underline;
	top: 5px;
	width: auto;
	z-index: 100000;
	outline: 2px solid #00e;
}

/* ==========================================================================
   WordPress 必須クラス
   ========================================================================== */
.alignleft {
	float: left;
	margin: 0 4px 4px 0;
}

.alignright {
	float: right;
	margin: 0 0 4px 4px;
}

.aligncenter {
	display: block;
	margin: 0 auto 4px;
}

.wp-caption {
	max-width: 100%;
}

.wp-caption-text {
	text-align: center;
}

.sticky,
.gallery-caption,
.bypostauthor {
	display: revert;
}
