/*
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, an LCD-style texture overlay, a bitmap-style web font, and optional 12x12 pixel-art emoji through its companion plugin.
Version: 0.1.1
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
Domain Path: /languages
Tags: blog, one-column, custom-menu, translation-ready
*/

/* ==========================================================================
   Font (PixelMplus12 - M+ FONT LICENSE, see 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;
}

/* ==========================================================================
   Color variables (defaults = scheme A; the Customizer overrides :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;
}

/* ==========================================================================
   Base
   ========================================================================== */
* {
	box-sizing: border-box;
}

html {
	background: #333333;
}

body {
	margin: 0;
	padding: 8px 0;
	font-family: "PixelMplus12", "MS Gothic", "Osaka-Mono", monospace;
	font-size: 12px;
	/* Below 550px the font size becomes 18px, equivalent to a 1.5x scale */
	line-height: 1.5;
	-webkit-font-smoothing: none;
	color: var(--k-fg);
}

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

/* The screen: a single 240px column, enlarged for display (2x by default,
   adjustable in the Customizer). On narrow viewports the scale steps down
   automatically so that no horizontal scrolling appears. */
.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;
	}
}

/* LCD texture: film grain + RGB sub-pixel stripes + a faint pixel grid */
.k-screen::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background-image:
		url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="2"/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0"/></filter><rect width="120" height="120" filter="url(%23n)"/></svg>'),
		repeating-linear-gradient(90deg, rgba(255, 0, 0, 0.04) 0 1px, rgba(0, 255, 0, 0.04) 1px 2px, rgba(0, 0, 255, 0.04) 2px 3px),
		repeating-linear-gradient(rgba(0, 0, 0, 0.055) 0 1px, transparent 1px 3px),
		repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.035) 0 1px, transparent 1px 3px);
}

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

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

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

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

/* Center images in content (except those with an align* class) */
.k-content img:not([class*="align"]),
.k-header-page img:not([class*="align"]),
.k-readme-page img:not([class*="align"]) {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

/* Paragraphs and figures containing only an image span the full width.
   Inline icons are left alone (detected with :only-child). */
.k-content p > img:only-child:not([class*="align"]),
.k-content figure > img:not([class*="align"]),
.k-header-page p > img:only-child:not([class*="align"]),
.k-readme-page p > img:only-child:not([class*="align"]) {
	width: 100%;
	height: auto;
}

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;
}

/* ==========================================================================
   Header band and 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;
	}
}

/* ==========================================================================
   Post list and navigation
   ========================================================================== */
.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;
}

/* In-post pagination (wp_link_pages) */
.k-pagelinks {
	text-align: center;
	margin: 4px 0;
}

/* ==========================================================================
   Title bands for h2 in content, and the notice box
   ========================================================================== */
.k-content h2 {
	background: var(--k-band-bg);
	color: var(--k-band-fg);
	text-align: center;
	font-weight: 700;
	padding: 1px 2px;
	margin: 8px 0 4px;
}

.k-content h2 a {
	color: var(--k-band-fg);
}

.k-notice {
	display: flex;
	align-items: center;
	gap: 6px;
	border: 2px solid var(--k-fg);
	padding: 4px;
	margin: 2px 0 4px;
}

.k-notice-mail {
	position: relative;
	flex: none;
}

.k-notice-mail svg.k-emoji {
	width: 2em;
	height: 2em;
	vertical-align: middle;
}

.k-notice-badge {
	position: absolute;
	top: -0.4em;
	right: -0.4em;
	background: #cc0000;
	color: #ffffff;
	border-radius: 50%;
	width: 1em;
	height: 1em;
	line-height: 1em;
	font-size: 0.85em;
	text-align: center;
}

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

/* ==========================================================================
   Comments
   ========================================================================== */
.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;
}

/* Strip native form styling (iOS Safari and others) for period-correct controls */
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;
}

/* ==========================================================================
   Skip link (clip-path approach)
   ========================================================================== */
.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;
}

/* ==========================================================================
   Required WordPress classes
   ========================================================================== */
.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;
}
