/*
Template: cocoon-master
Theme Name: Cocoon Child
Theme URI: https://wp-cocoon.com/
Description: Cocoonの子テーマです。
Author: yhira
Author URI: https://nelog.jp/
Version: 1.0.7
*/

/* 本文フォント */
body {
  font-family: "Noto Sans JP", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

/* 見出しフォント */
h1, h2, h3, h4, h5, h6 {
  font-family: "Noto Serif JP", "Yu Mincho", serif;
  font-weight: bold;
  margin-top: 1.2em;
  margin-bottom: 0.6em;
}

/* 見出しサイズ調整 */
h1 { font-size: 1.8em; }
h2 { font-size: 1.4em; }
h3 { font-size: 1.2em; }
h4, h5, h6 { font-size: 1em; }

/* 関連記事カード */
.entry-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
  transition: box-shadow 0.3s;
}
.entry-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

.entry-card-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

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

.entry-card-content {
  padding: 15px;
}

.entry-card-title {
  font-size: 1.1em;
  font-weight: bold;
  margin-bottom: 10px;
  color: #000;
}

.entry-card-title:hover { text-decoration: underline; }

.entry-card-description {
  font-size: 0.95em;
  color: #444;
  line-height: 1.5;
}

/* 三行まとめ */
.summary-box {
  background: #f2f2f2;
  border: 2px solid #000;
  border-radius: 6px;
  padding: 1.2em;
  margin: 1.5em 0;
  font-size: 1em;
  line-height: 1.6;
}
.summary-box p { margin: 0.5em 0; }

/* 基本情報ブロック */
.basic-info-section {
  margin: 2em 0;
}
.basic-info-blocks {
  margin-top: 1em;
}
.basic-info-item {
  margin-bottom: 1em;
}
.basic-info-label {
  font-weight: bold;
  padding: 0.2em 0;
  color: #000;
}
.basic-info-value {
  padding: 0.4em 0.8em;
  border-left: 3px solid #666; /* グレーラインで見出しと差別化 */
  background-color: #f9f9f9;
  color: #444;
}

/* 関連情報ブロック */
.related-info-blocks {
  margin-top: 1em;
}
.related-info-item {
  margin-bottom: 1em;
}
.related-info-label {
  font-weight: bold;
  padding: 0.2em 0;
  color: #000;
}
.related-info-value {
  padding: 0.4em 0.8em;
  border-left: 3px solid #333; /* 濃いグレーラインで差別化 */
  background-color: #f9f9f9;
  color: #444;
}

/* セクション見出し（h2） */
article h2 {
  background-color: #e0e0e0;
  color: #000;
  padding: 0.6em 1em;
  margin-top: 1.5em;
  margin-bottom: 1em;
  border-left: 4px solid #000;
  font-size: 1.2em;
}

/* 詳細ページリンクボタン */
.detail-button-wrapper {
  text-align: center;
  margin: 1.5em 0;
}
.detail-button {
  display: inline-block;
  padding: 0.8em 1.5em;
  font-size: 1.1em;
  font-weight: bold;
  text-decoration: none;
  background-color: #000;
  color: #fff;
  border: 2px solid #000;
  border-radius: 6px;
  transition: all 0.3s ease;
}
.detail-button:hover {
  background-color: #444;
  color: #fff;
  text-decoration: none;
}

/* 記事下部のカテゴリ表示（バッジ風） */
.entry-footer {
  margin-top: 2em;
  padding-top: 1em;
  border-top: 1px solid #ddd;
}
.post-categories {
  font-size: 0.95em;
  color: #444;
}
.cat-link {
  color: var(--cocoon-white-color);
  text-decoration: none;
  display: inline-block;
  margin-right: 5px;
  padding: 2px 6px;
  font-size: 12px;
  background-color: var(--cocoon-text-color);
  border-radius: var(--cocoon-badge-border-radius);
  word-break: break-all;
}
.cat-link:hover {
  opacity: 0.8;
}
.cat-icon {
  margin-right: 4px;
}

/* 印刷用スタイル */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 12pt;
    line-height: 1.5;
    margin: 20mm;
    max-width: 180mm;
  }
  * {
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
  }
  h1 { font-size: 16pt; }
  h2 { font-size: 14pt; }
  h3 { font-size: 12pt; }
  h4, h5, h6 { font-size: 11pt; }
  a {
    color: #000;
    text-decoration: none;
  }
  a::after {
    content: " (" attr(href) ")";
    font-size: 10pt;
    word-break: break-all;
  }
  .dictionary-card,
  .entry-card {
    box-shadow: none !important;
    border: 1px solid #000;
    page-break-inside: avoid;
  }
  img,
  .card-thumbnail img,
  .entry-card-thumb img {
    display: none !important;
  }
  nav, .sidebar, .footer, .detail-button, .no-print {
    display: none !important;
  }
  .summary-box {
    border: 2px solid #000;
    background: #fff;
    padding: 10pt;
  }
  .basic-info-value {
    background: #fff;
    border-left: 2px solid #000;
    color: #000;
  }
  .related-info-value {
    background: #fff;
    border-left: 2px solid #000;
    color: #000;
  }
  .entry-footer {
    display: block !important;
    margin-top: 1em;
    border-top: 1px solid #000;
    padding-top: 0.5em;
  }
  .post-categories {
    font-size: 11pt;
    color: #000;
  }
  .cat-link {
    background: #000;
    color: #fff;
    border-radius: 4px;
    padding: 2px 6px;
    margin-right: 4px;
  }
  .cat-link::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
  }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #121212;
    color: #e0e0e0;
  }
  a {
    color: #e0e0e0;
  }
  a:hover {
    color: #fff;
    text-decoration: underline;
  }
  .dictionary-card,
  .entry-card {
    background-color: #1e1e1e;
    border-color: #444;
  }
  .card-title,
  .entry-card-title {
    color: #fff;
  }
  .card-description,
  .entry-card-description {
    color: #ccc;
  }
  .summary-box {
    background: #2a2a2a;
    border: 2px solid #fff;
    color: #e0e0e0;
  }
  article h2 {
    background-color: #2a2a2a;
    color: #fff;
    border-left: 4px solid #fff;
  }
  .basic-info-label {
    color: #fff;
  }
  .basic-info-value {
    background-color: #1e1e1e;
    color: #e0e0e0;
    border-left: 3px solid #aaa;
  }
  .related-info-label {
    color: #fff;
  }
  .related-info-value {
    background-color: #1e1e1e;
    color: #e0e0e0;
    border-left: 3px solid #ccc;
  }
  .detail-button {
    background-color: #fff;
    color: #000;
    border: 2px solid #fff;
  }
  .detail-button:hover {
    background-color: #ccc;
    color: #000;
  }
  .cat-link {
    background-color: #333;
    color: #fff;
  }
  .cat-link:hover {
    opacity: 0.8;
  }
}