/*
Theme Name: MatomePress
Theme URI: https://example.com/matomepress/
Author: MatomePress
Author URI: https://example.com/
Description: A lightweight classic WordPress theme for 2ch/5ch style matome blogs with responsive layouts, res-style posts, AA support, ad areas, related posts, and popular post widgets.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: matomepress
Tags: blog, news, two-columns, right-sidebar, custom-logo, featured-images, threaded-comments
*/

:root {
  --mp-text: #222;
  --mp-muted: #666;
  --mp-border: #e6e6e6;
  --mp-bg: #fff;
  --mp-soft: #f7f7f7;
  --mp-link: #0759b8;
  --mp-red: #d60000;
  --mp-blue: #004ed6;
  --mp-accent: #111;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--mp-bg);
  color: var(--mp-text);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", sans-serif;
  line-height: 1.85;
}

a {
  color: var(--mp-link);
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

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

th,
td {
  border: 1px solid var(--mp-border);
  padding: 0.5rem;
}

pre,
code,
kbd,
samp {
  font-family: "MS Gothic", "Osaka-Mono", "Courier New", monospace;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  border-bottom: 1px solid var(--mp-border);
  background: #fff;
}

.site-header__inner,
.site-footer__inner,
.site-layout {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.site-branding {
  min-width: 0;
}

.site-title {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  font-weight: 800;
  line-height: 1.25;
}

.site-title a {
  color: var(--mp-accent);
}

.site-description {
  margin: 0.2rem 0 0;
  color: var(--mp-muted);
  font-size: 0.875rem;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  color: var(--mp-text);
  font-weight: 700;
}

.site-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 2rem;
  padding: 1.5rem 0 2.5rem;
}

.content-area {
  min-width: 0;
}

.post-card,
.site-main > article {
  border-bottom: 1px solid var(--mp-border);
  padding: 0 0 1.5rem;
  margin: 0 0 1.5rem;
}

.entry-title {
  margin: 0 0 0.4rem;
  font-size: clamp(1.35rem, 4vw, 2rem);
  line-height: 1.35;
}

.entry-title a {
  color: var(--mp-text);
}

.entry-meta,
.entry-footer {
  color: var(--mp-muted);
  font-size: 0.875rem;
}

.entry-meta span,
.entry-footer span {
  margin-right: 0.75rem;
}

.entry-content {
  margin-top: 1rem;
  overflow-wrap: anywhere;
  word-break: normal;
}

.entry-content p {
  margin: 0 0 1.2em;
}

.entry-content blockquote {
  margin: 1.25rem 0;
  padding: 0.8rem 1rem;
  border-left: 4px solid #ccc;
  background: var(--mp-soft);
}

.entry-content ul,
.entry-content ol {
  padding-left: 1.5rem;
}

.more-link,
.page-numbers,
.post-page-numbers {
  display: inline-flex;
  align-items: center;
  min-height: 2.4rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--mp-border);
  color: var(--mp-text);
  background: #fff;
}

.pagination,
.post-navigation,
.comments-pagination {
  margin: 1.5rem 0;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.page-numbers.current,
.post-page-numbers.current {
  background: var(--mp-accent);
  color: #fff;
  border-color: var(--mp-accent);
}

.mp-res {
  margin: 1.2rem 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--mp-border);
  border-left: 4px solid #9b9b9b;
  background: #fafafa;
  border-radius: 4px;
}

.mp-red {
  color: var(--mp-red);
  font-weight: 700;
}

.mp-blue {
  color: var(--mp-blue);
  font-weight: 700;
}

.mp-bold {
  font-weight: 800;
}

.mp-aa {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
  tab-size: 4;
  margin: 1.2rem 0;
  padding: 1rem;
  border: 1px solid var(--mp-border);
  background: #fff;
  color: #111;
  font-family: "MS PGothic", "MS Gothic", "Mona", "IPAMonaPGothic", monospace;
  font-size: 0.875rem;
  line-height: 1.2;
}

.ad-area {
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px dashed #cfcfcf;
  background: #fbfbfb;
  color: var(--mp-muted);
  text-align: center;
  font-size: 0.875rem;
}

.related-posts {
  margin: 2rem 0;
  padding-top: 1.5rem;
  border-top: 2px solid var(--mp-accent);
}

.related-posts h2,
.widget-title {
  margin: 0 0 0.8rem;
  font-size: 1.1rem;
  line-height: 1.4;
}

.related-posts ul,
.widget ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.related-posts li,
.widget li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--mp-border);
}

.sidebar {
  min-width: 0;
}

.widget {
  margin: 0 0 1.5rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--mp-border);
}

.widget select,
.widget input[type="search"],
.widget input[type="text"],
.widget input[type="email"],
.widget input[type="url"],
.widget input[type="password"] {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--mp-border);
  border-radius: 2px;
}

.widget button,
.widget input[type="submit"],
.search-submit,
.submit {
  min-height: 2.5rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--mp-accent);
  background: var(--mp-accent);
  color: #fff;
  cursor: pointer;
}

.site-footer {
  border-top: 1px solid var(--mp-border);
  color: var(--mp-muted);
  font-size: 0.875rem;
}

.site-footer__inner {
  padding: 1.5rem 0;
}

.comments-area {
  margin-top: 2rem;
}

.comment-list {
  padding: 0;
  list-style: none;
}

.comment-body {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--mp-border);
}

@media (max-width: 840px) {
  .site-header__inner {
    display: block;
  }

  .site-nav {
    margin-top: 0.75rem;
  }

  .site-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    width: min(100% - 24px, 720px);
    padding-top: 1rem;
  }

  .sidebar {
    border-top: 1px solid var(--mp-border);
    padding-top: 1.5rem;
  }
}

@media (max-width: 480px) {
  body {
    line-height: 1.8;
  }

  .site-header__inner,
  .site-footer__inner {
    width: calc(100% - 24px);
  }

  .site-nav ul {
    gap: 0.5rem 0.85rem;
  }

  .entry-meta span,
  .entry-footer span {
    display: block;
    margin-right: 0;
  }

  .mp-res {
    padding: 0.75rem;
  }
}
