/*
Theme Name: dani-soft
Theme URI: https://sarabadani.net
Author: sarabadani.net
Description: ダニ対策の情報サイト「さらば、ダニ。」のための軽量オリジナルテーマ。1カラム構成、行間を広く取り読みやすさを最優先にした落ち着いた誌面デザイン。
Version: 1.2.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: dani-soft
*/

/* ==========================================================================
   カラーパレット（この10色以外は使用しない）
   ========================================================================== */
:root {
  --bg:        #FCFAF6;  /* 背景。わずかに温かみのある白 */
  --surface:   #FFFFFF;  /* カード、記事本文の下地 */
  --text:      #3D3A36;  /* 本文。純黒を避け、目の負担を減らす */
  --text-sub:  #7A736B;  /* 補足、日付、キャプション */
  --primary:   #6FA8A0;  /* 見出し、リンク。くすんだミント */
  --primary-d: #52867F;  /* ホバー時 */
  --accent:    #E8A87C;  /* 差し色。やわらかいオレンジ */
  --accent-bg: #FDF3EA;  /* 注意書きの背景 */
  --line:      #EDE7DC;  /* 罫線、枠 */
  --shadow:    0 2px 12px rgba(61, 58, 54, 0.06);
  /* 表のヘッダー行の背景は THEME.md の指定色 */
  --table-head-bg: #F6F2EA;
  /* フッターの背景は THEME.md の指定色 */
  --footer-bg: #F6F2EA;
}

/* ==========================================================================
   リセットと基本設定
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
  font-size: 17px;
  line-height: 1.95;
  overflow-x: hidden;
  word-break: break-word;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

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

a:hover,
a:focus {
  color: var(--primary-d);
  text-decoration: none;
}

ul, ol {
  padding-left: 1.4em;
}

/* ==========================================================================
   レイアウト
   ========================================================================== */
.dani-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

.dani-wide-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

@media (min-width: 782px) {
  .dani-container,
  .dani-wide-container {
    padding: 0 32px;
  }
}

.dani-main {
  padding-top: 32px;
  padding-bottom: 48px;
}

/* ==========================================================================
   ヘッダー
   ========================================================================== */
.dani-header {
  height: 64px;
  background-color: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  position: static; /* 追従固定はしない */
  width: 100%;
}

.dani-header-inner {
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

@media (min-width: 782px) {
  .dani-header-inner {
    padding: 0 32px;
  }
}

.dani-site-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.dani-site-name:hover {
  color: var(--primary-d);
  text-decoration: none;
}

.dani-category-bar {
  background-color: var(--table-head-bg);
  border-bottom: 1px solid var(--line);
  width: 100%;
  position: relative; /* スマホ用トグルの絶対配置の基準にする */
}

/* --------------------------------------------------------------------
   スマホ・タブレット縦（782px未満）
   ヘッダーは64pxのまま固定。アイコンはヘッダーの右端に重ねて表示し、
   開いたときだけ、その下に一覧が縦に開く。
   .dani-cat-mobile と .dani-cat-desktop は同じ配列から出力した別要素。
   このメディアクエリの外では、どちらの表示指定も一切書かない。
   -------------------------------------------------------------------- */
@media (max-width: 781.98px) {
  .dani-category-bar .dani-header-inner {
    padding-top: 0;
    padding-bottom: 0;
    display: block;
  }

  .dani-cat-desktop {
    display: none;
  }

  .dani-cat-mobile {
    display: block;
  }

  .dani-cat-mobile summary {
    list-style: none;
    cursor: pointer;
    color: var(--text-sub);
    position: absolute;
    top: -64px; /* ヘッダーの高さ分だけ引き上げ、ヘッダーの右端に重ねる */
    right: 20px;
    height: 64px;
    display: flex;
    align-items: center;
    z-index: 5;
  }

  .dani-cat-mobile summary::-webkit-details-marker {
    display: none;
  }

  .dani-cat-mobile summary:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
  }

  .dani-cat-mobile ul {
    list-style: none;
    margin: 0;
    padding: 8px 0 16px;
    width: 100%;
  }

  /* details[open] のときだけ、縦並びに余白を付ける。
     閉じている間は UA 既定の display:none をそのまま使う（display は上書きしない） */
  .dani-cat-mobile[open] ul {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .dani-cat-mobile li {
    white-space: nowrap;
  }

  .dani-cat-mobile a {
    display: block;
    padding: 10px 4px;
    color: var(--text-sub);
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
  }

  .dani-cat-mobile a:hover {
    color: var(--primary-d);
    text-decoration: underline;
  }
}

.dani-hamburger-icon svg {
  display: block;
}

/* --------------------------------------------------------------------
   パソコン・タブレット横（782px以上）
   アイコンは使わず、一覧を常に横1行で表示する。要素ごと切り替えるだけなので
   !important は使わない。
   -------------------------------------------------------------------- */
@media (min-width: 782px) {
  .dani-category-bar .dani-header-inner {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .dani-cat-mobile {
    display: none;
  }

  .dani-cat-desktop {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
  }

  .dani-cat-desktop li {
    white-space: nowrap;
  }

  .dani-cat-desktop a {
    display: inline-block;
    line-height: 28px;
    color: var(--text-sub);
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
  }

  .dani-cat-desktop a:hover {
    color: var(--primary-d);
    text-decoration: underline;
  }
}

/* ==========================================================================
   フッター
   ========================================================================== */
.dani-footer {
  background-color: var(--footer-bg);
  border-top: 1px solid var(--line);
  padding: 40px 0 24px;
  margin-top: 48px;
}

.dani-footer-section {
  margin-bottom: 24px;
}

.dani-footer-intro p {
  color: var(--text-sub);
  font-size: 14px;
  line-height: 1.95;
  margin: 0;
}

.dani-footer-heading {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-sub);
  margin: 0 0 12px;
}

.dani-footer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.dani-footer-list a {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}

.dani-footer-list a:hover {
  color: var(--primary-d);
  text-decoration: underline;
}

.dani-footer-bottom {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 16px;
  font-size: 13px;
  color: var(--text-sub);
}

/* ==========================================================================
   タイポグラフィ（見出し）
   ========================================================================== */
.dani-content h1,
.dani-entry-title {
  font-size: 27px;
  line-height: 1.5;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 20px;
}

.dani-content h2 {
  font-size: 22px;
  line-height: 1.5;
  font-weight: 700;
  color: var(--text);
  margin: 48px 0 20px;
  padding-left: 14px;
  border-left: 4px solid var(--primary);
}

.dani-content h3 {
  font-size: 19px;
  line-height: 1.6;
  font-weight: 600;
  color: var(--text);
  margin: 36px 0 16px;
}

.dani-content h4 {
  font-size: 17px;
  line-height: 1.6;
  font-weight: 600;
  color: var(--text-sub);
  margin: 28px 0 12px;
}

.dani-content p {
  margin: 0 0 1.6em;
}

figcaption,
.dani-caption {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-sub);
}

/* ==========================================================================
   引用・補足ボックス
   ========================================================================== */
.dani-note {
  background-color: var(--accent-bg);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 20px;
  margin: 28px 0;
}

.dani-note p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   表
   ========================================================================== */
.dani-content .table-scroll {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  margin: 28px 0;
}

.dani-content table {
  border-collapse: collapse;
  width: 100%;
  min-width: 480px;
}

.dani-content th,
.dani-content td {
  border: 1px solid var(--line);
  padding: 10px 14px;
  text-align: left;
  font-size: 15px;
}

.dani-content thead th {
  background-color: var(--table-head-bg);
  font-weight: 700;
}

/* ==========================================================================
   図解（SVG）
   ========================================================================== */
figure.dani-figure {
  margin: 32px 0;
  background-color: var(--surface);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
}

figure.dani-figure svg {
  display: block;
  width: 100%;
  height: auto;
}

figure.dani-figure figcaption {
  margin-top: 12px;
  text-align: center;
}

/* ==========================================================================
   ボタン
   ========================================================================== */
.dani-button {
  display: inline-block;
  border-radius: 999px;
  background-color: var(--primary);
  color: var(--surface);
  text-decoration: none;
  padding: 12px 28px;
  font-weight: 700;
  font-size: 15px;
  box-shadow: none;
  border: none;
}

.dani-button:hover {
  background-color: var(--primary-d);
  color: var(--surface);
  text-decoration: none;
}

/* ==========================================================================
   記事カード（関連記事、一覧）
   ========================================================================== */
.dani-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin: 24px 0;
}

@media (min-width: 620px) {
  .dani-card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.dani-card {
  background-color: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 20px;
  display: block;
  text-decoration: none;
  color: var(--text);
}

.dani-card:hover {
  text-decoration: none;
  color: var(--text);
}

.dani-card-category {
  font-size: 13px;
  color: var(--primary);
  margin-bottom: 8px;
  display: block;
}

.dani-card-title {
  font-size: 16px;
  line-height: 1.6;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
}

.dani-card-excerpt {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-sub);
  margin: 0;
}

/* ==========================================================================
   メタ情報
   ========================================================================== */
.dani-meta {
  font-size: 14px;
  color: var(--text-sub);
  margin-bottom: 24px;
}

.dani-related-heading {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 48px 0 20px;
  padding-left: 14px;
  border-left: 4px solid var(--primary);
}

/* ==========================================================================
   アーカイブ / 一覧
   ========================================================================== */
.dani-archive-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
}

.dani-archive-desc {
  color: var(--text-sub);
  margin: 0 0 24px;
}

.dani-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dani-list li + li {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.dani-list-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 6px;
}

.dani-list-title a {
  color: var(--text);
  text-decoration: none;
}

.dani-list-title a:hover {
  color: var(--primary-d);
  text-decoration: underline;
}

.dani-pagination {
  margin: 32px 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.dani-pagination a,
.dani-pagination span {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}

.dani-pagination a:hover {
  border-color: var(--primary);
  color: var(--primary-d);
}

.dani-pagination .current {
  background-color: var(--primary);
  color: var(--surface);
  border-color: var(--primary);
}

/* ==========================================================================
   記事本体の器
   ========================================================================== */
.dani-article {
  background-color: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 28px 20px;
}

@media (min-width: 782px) {
  .dani-article {
    padding: 40px;
  }
}

.dani-404 {
  text-align: center;
  padding: 64px 0;
}

.dani-404 h1 {
  font-size: 27px;
  margin-bottom: 16px;
}

/* ==========================================================================
   スマートフォン対応（375px幅で横スクロールが発生しないこと）
   本文サイズのみ変更。行間 1.95 は変更しない。
   ========================================================================== */
@media (max-width: 600px) {
  body {
    font-size: 16px;
    line-height: 1.95;
  }

  .dani-content h2 {
    font-size: 20px;
    line-height: 1.5;
  }
}

/* ==========================================================================
   LPテンプレート（page-lp.php）
   ヘッダー・カテゴリの帯・フッターを出力しないページ用。
   本文の幅は制限しない（記事用の最大幅・余白をかけない）。
   ========================================================================== */
body.dani-lp {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
}

.dani-lp-content {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}
