/*
Theme Name: NewtonJapan Classic
Theme URI: https://newtonjapan.com/
Author: OpenAI
Description: Newton Japan旧サイトの雰囲気に寄せた、クラシックな2カラム WordPress テーマ。
Version: 0.8.6
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: newtonjapan-classic
*/

:root {
  --site-width: 960px;
  --sidebar-width: 180px;
  --gap-width: 22px;
  --content-width: calc(var(--site-width) - var(--sidebar-width) - var(--gap-width) - 20px);
  --border: #cfcfcf;
  --soft-border: #ececec;
  --link: #c8752a;
  --link-hover: #9d5d22;
  --text: #222;
  --muted: #666;
  --bg: #fff;
  --title-gray: #575757;
  --title-red: #cc0000;
  --sidebar-title: #9a9a9a;
}


html {
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 12px;
  line-height: 1.65;
}

body.admin-bar {
  min-height: calc(100vh - 32px);
}

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

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

img {
  max-width: 100%;
  height: auto;
  border: 0;
}

.site-wrap {
  width: var(--site-width);
  margin: 0 auto;
  padding: 0 10px 18px;
}

.site-header {
  padding: 8px 0 0;
}

.site-branding {
  margin: 0 0 6px;
}

.site-title {
  margin: 0;
  font-size: 31px;
  line-height: 1.1;
  font-weight: 700;
}

.legacy-site-title {
  font-size: 31px;
  letter-spacing: 0.01em;
}

.site-title a {
  color: var(--title-gray);
  text-decoration: none;
}

.site-title-japan {
  color: var(--title-red);
}

.site-description {
  margin: 2px 0 8px;
  font-size: 13px;
  color: #5f5f5f;
}

.header-visual-shell {
  position: relative;
  width: calc(100% + 20px);
  margin-left: -10px;
  margin-right: -10px;
  border-top: 1px solid var(--border);
}

.legacy-header-banner {
  width: 100%;
}

.legacy-header-banner a,
.legacy-header-banner img {
  display: block;
  width: 100%;
  height: auto;
}

.legacy-header-banner img {
  object-fit: cover;
}

.overlay-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px 20px 9px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.78);
}

.header-visual-shell.no-image .overlay-nav {
  position: static;
  background: transparent;
}

.top-nav {
}

.top-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0;
  padding: 0;
}

.top-nav li {
  margin: 0;
  padding: 0;
}

.top-nav a {
  color: #444;
  text-decoration: none;
}

.top-nav a:hover,
.top-nav .current-menu-item > a,
.top-nav .current_page_item > a {
  color: var(--link);
  text-decoration: underline;
}

.content-area {
  display: flex;
  align-items: flex-start;
  gap: var(--gap-width);
  margin-top: 14px;
}

.main-content {
  width: var(--content-width);
  min-width: 0;
  flex: 1 1 auto;
}

.sidebar {
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
}

.front-legacy-intro {
  margin: 0 0 15px;
}

.front-site-name,
.front-tagline {
  display: none;
}

.front-notice,
.front-hero-subtitle {
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  background: #fafafa;
}

.front-posts-header h2 {
  margin: 0 0 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
  font-size: 24px;
  line-height: 1.2;
}

.legacy-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0 0 16px;
}

.legacy-feature-box {
  border: 1px solid var(--border);
  padding: 10px;
  background: #fff;
}

.legacy-feature-box h2 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.25;
}

.legacy-feature-box h2 a {
  text-decoration: none;
}

.legacy-feature-box p {
  margin: 0;
}

.post,
.page {
  margin: 0 0 24px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--soft-border);
}

.entry-title,
.archive-title,
.page-title {
  margin: 0 0 6px;
  font-size: 26px;
  line-height: 1.25;
  font-weight: 700;
}

.entry-title a {
  text-decoration: none;
}

.entry-meta {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.entry-meta .byline {
  margin-left: 4px;
}

.entry-content p,
.entry-summary p {
  margin: 0 0 10px;
}

.entry-content ul,
.entry-content ol {
  margin: 0 0 12px 18px;
}

.front-thumbnail,
.post-thumbnail {
  margin: 8px 0 10px;
}

.entry-footer-meta {
  margin-top: 8px;
  color: #555;
  font-size: 12px;
}

.entry-footer-meta span {
  display: block;
  margin-bottom: 3px;
}

.read-more {
  margin: 8px 0 0;
}

.widget {
  margin: 0 0 18px;
}

.widget-title {
  margin: 0 0 7px;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--sidebar-title);
}

.widget p {
  margin: 0 0 8px;
}

.widget ul {
  margin: 0;
  padding-left: 17px;
}

.widget li {
  margin: 0 0 3px;
}

.archive-list,
.manual-archive-list {
  max-height: none;
}

.widget_search .search-field,
.widget-search .search-field,
.search-form .search-field {
  width: 100%;
  max-width: 100%;
  border: 1px solid #bbb;
  padding: 5px 6px;
  font-size: 12px;
}

.search-form .search-submit {
  margin-top: 6px;
  padding: 4px 10px;
  border: 1px solid #bbb;
  background: #f3f3f3;
  cursor: pointer;
}

.pagination {
  margin-top: 16px;
}

.pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.legacy-pagination .page-numbers {
  display: inline-block;
}

.site-footer {
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  color: #666;
}

.footer-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 6px 0 0;
  padding: 0;
}

@media (max-width: 980px) {
  .site-wrap {
    width: auto;
    max-width: 960px;
  }

  .content-area {
    flex-direction: column;
  }

  .main-content,
  .sidebar {
    width: 100%;
  }

  .legacy-feature-grid {
    grid-template-columns: 1fr;
  }
}


/* v5 image button / book card enhancements */
.legacy-book-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.legacy-book-card,
.legacy-image-card {
  display: block;
  border: 1px solid var(--border);
  padding: 6px;
  background: #fff;
  text-decoration: none;
  color: #111;
}

.legacy-book-card:hover,
.legacy-image-card:hover {
  background: #fafafa;
}

.legacy-book-card img {
  display: block;
  width: 100%;
  margin-bottom: 6px;
}

.legacy-book-card span {
  display: block;
  font-size: 12px;
  line-height: 1.45;
}

.legacy-image-card-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.legacy-image-card-thumb {
  display: block;
  margin-bottom: 5px;
}

.legacy-image-card-thumb img {
  display: block;
  width: 100%;
  height: auto;
}

.legacy-image-card-label {
  display: block;
  font-size: 12px;
  line-height: 1.45;
}

.legacy-image-card-book .legacy-image-card-thumb img {
  aspect-ratio: 2 / 1;
  object-fit: cover;
}

.legacy-image-card-app .legacy-image-card-thumb img {
  aspect-ratio: 240 / 78;
  object-fit: cover;
}


/* v6 layout / utility refinements */
.legacy-feature-grid {
  grid-template-columns: repeat(2, 1fr);
}

.quick-links-list {
  margin: 0;
  padding-left: 17px;
}

.site-footer-main {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.site-footer-copy {
  flex: 1 1 auto;
}

.site-footer-note {
  margin: 6px 0 0;
  color: #666;
}

.site-footer-widget-area {
  width: 250px;
  flex: 0 0 250px;
}

.content-area-wide {
  display: block;
}

.main-content-wide {
  width: 100%;
}

.legacy-wide-page {
  border-bottom: 0;
}

.legacy-feature-box {
  min-height: 92px;
}

.widget-recent-legacy-posts ul,
.widget-quick-links ul {
  margin: 0;
  padding-left: 17px;
}

@media (max-width: 980px) {
  .site-footer-main {
    display: block;
  }

  .site-footer-widget-area {
    width: auto;
    margin-top: 12px;
  }

  .legacy-feature-grid {
    grid-template-columns: 1fr;
  }
}


.front-category-note {
  margin: -4px 0 12px;
  color: var(--muted);
}

.widget-contact-box p {
  margin: 0;
}

.legacy-links-directory-page .entry-content {
  margin-bottom: 18px;
}

.legacy-directory-section {
  margin: 0 0 24px;
}

.page-subtitle {
  margin: 0 0 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  font-size: 24px;
  line-height: 1.2;
}

.legacy-directory-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}

.legacy-directory-block {
  border: 1px solid var(--soft-border);
  padding: 10px 12px;
  background: #fff;
}

.legacy-directory-block h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.2;
}

.legacy-directory-block p,
.legacy-directory-block ul {
  margin-top: 0;
}

.legacy-directory-cards {
  margin-bottom: 12px;
}

@media (max-width: 780px) {
  .legacy-directory-columns {
    grid-template-columns: 1fr;
  }
}


.sidebar-link-item.has-image {
    margin-bottom: 12px;
}

.sidebar-link-thumb {
    display: block;
    margin: 0 0 4px;
}

.sidebar-link-thumb img {
    display: block;
    width: 100%;
    max-width: 200px;
    height: auto;
    border: 1px solid #cfcfcf;
    background: #fff;
}

.sidebar-link-label {
    font-weight: bold;
    font-size: 10px;
}

.sidebar-link-description {
    margin: 3px 0 0;
    font-size: 12px;
    line-height: 1.5;
}

.newtonjapan-admin-wrap textarea.large-text.code {
    min-height: 560px;
    font-family: Consolas, Monaco, monospace;
}

.newtonjapan-admin-help {
    background: #fff;
    border: 1px solid #ccd0d4;
    padding: 14px 16px;
    margin: 18px 0;
}

.newtonjapan-admin-help pre {
    overflow: auto;
    background: #f6f7f7;
    padding: 12px;
}


.legacy-header-banner {
  margin: 0 0 8px;
}

.legacy-header-banner a {
  display: block;
}

.legacy-header-banner img {
  display: block;
  width: 100%;
  height: auto;
}

.sidebar-link-item.has-image {
  margin-bottom: 12px;
}

.sidebar-link-thumb {
  display: block;
  margin: 0 0 4px;
}

.sidebar-link-thumb img {
  display: block;
  max-width: 100%;
  height: auto;
}

.sidebar-link-description {
  margin: 4px 0 0;
  color: var(--muted);
}


.sidebar .widget ul {
  margin: 0;
  padding-left: 16px;
}

.sidebar-link-item.has-image {
  margin-bottom: 12px;
}

.sidebar-link-thumb {
  display: block;
  max-width: 100%;
  margin-bottom: 4px;
}

.sidebar-link-thumb img {
  display: block;
  width: 100%;
  max-width: 118px;
  height: auto;
}

.sidebar-link-label {
  display: inline-block;
}

.legacy-image-card-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.legacy-image-card {
  display: block;
}

.legacy-image-card-thumb img,
.legacy-book-card img {
  display: block;
  width: 100%;
  max-width: 118px;
  height: auto;
}

.legacy-book-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.legacy-book-card {
  display: block;
}

@media (max-width: 880px) {
  .site-wrap {
    width: 100%;
  }

  .content-area {
    display: block;
  }

  .main-content,
  .sidebar {
    width: 100%;
    flex: none;
  }

  .overlay-nav {
    position: static;
    background: transparent;
    padding-left: 0;
    padding-right: 0;
  }

  .sidebar-link-thumb img,
  .legacy-image-card-thumb img,
  .legacy-book-card img {
    max-width: 180px;
  }
}
