/* ============================================================
   畑ニュース — トップページ専用スタイル
   ============================================================ */

:root {
  --ink:       #2a2822;
  --ink-2:     #5a544a;
  --ink-3:     #8a8478;
  --paper:     #faf6ec;
  --paper-2:   #f2ecdb;
  --paper-3:   #e8e0c8;
  --line:      #dcd2b8;
  --line-soft: #ebe3cc;
  --green:     #5a7a3e;
  --green-2:   #6e8f4c;
  --green-soft:#9ab27a;
  --clay:      #c26a40;
  --clay-soft: #d88858;
  --wheat:     #d4a850;
  --sky:       #6b94a2;
}

/* リセット */
.hn-wrap * { box-sizing: border-box; }
.hn-wrap a { color: inherit; text-decoration: none; }
.hn-wrap button { font: inherit; color: inherit; cursor: pointer; }

/* 全体背景 */
body.home {
  background: var(--paper) !important;
  color: var(--ink);
}

/* フォントユーティリティ */
.hn-serif { font-family: 'Zen Maru Gothic', 'M PLUS Rounded 1c', sans-serif; font-weight: 900; font-feature-settings: 'palt'; }
.hn-round { font-family: 'Zen Maru Gothic', 'M PLUS Rounded 1c', sans-serif; }
.hn-mono  { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* ============================================================
   ヘッダー
   ============================================================ */
.hn-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}
.hn-header__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.hn-logo {
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
}
.hn-logo__name {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-weight: 900;
  font-size: 30px;
  color: var(--green);
  letter-spacing: 0.02em;
  line-height: 1;
}
.hn-logo__sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.hn-search {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  padding: 9px 14px;
  background: #fff;
  min-width: 320px;
  border-radius: 999px;
  margin-left: auto;
}
.hn-search input {
  border: none;
  outline: none;
  background: transparent;
  flex: 1;
  font-size: 13px;
  font-family: inherit;
}

/* ============================================================
   カテゴリタブ
   ============================================================ */
.hn-cattabs {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 70px;
  z-index: 90;
}
.hn-cattabs__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: stretch;
  gap: 4px;
  overflow-x: auto;
}
.hn-cattab {
  font-family: 'Zen Maru Gothic', sans-serif;
  background: transparent;
  border: none;
  padding: 10px 18px;
  color: var(--ink-2);
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  border-radius: 999px;
  margin: 10px 0;
  transition: background 0.15s, color 0.15s;
}
.hn-cattab.is-active,
.hn-cattab:hover {
  background: var(--green);
  color: #fff;
  font-weight: 700;
}

/* ============================================================
   メインレイアウト
   ============================================================ */
.hn-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px;
}
.hn-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
}
@media (max-width: 900px) {
  .hn-layout { grid-template-columns: 1fr; }
  .hn-main { padding: 16px; }
  .hn-header__inner { padding: 14px 16px; }
  .hn-search { min-width: 0; }
  .hn-cattabs__inner { padding: 0 16px; }
}

/* ============================================================
   セクション共通見出し
   ============================================================ */
.hn-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--green);
}
.hn-section-head h2 {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-weight: 900;
  font-size: 24px;
  margin: 0;
  line-height: 1.3;
}
.hn-section-sub {
  font-size: 12px;
  color: var(--ink-3);
  font-family: 'Zen Maru Gothic', sans-serif;
}

/* ============================================================
   ランキング
   ============================================================ */
.hn-ranking { margin-bottom: 40px; }
.hn-ranking__tabs {
  display: flex;
  gap: 4px;
  background: var(--paper-2);
  padding: 4px;
  border-radius: 999px;
}
.hn-ranking__tab {
  background: transparent;
  color: var(--ink-2);
  border: none;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  font-family: 'Zen Maru Gothic', sans-serif;
  transition: background 0.15s, color 0.15s;
}
.hn-ranking__tab.is-active {
  background: var(--green);
  color: #fff;
}
.hn-ranking__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  gap: 20px;
}
@media (max-width: 900px) {
  .hn-ranking__list { grid-template-columns: 1fr 1fr; }
}
.hn-ranking__item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
}
.hn-ranking__thumb {
  position: relative;
  overflow: hidden;
  background: var(--paper-2);
  border-radius: 14px;
}
.hn-ranking__thumb--large { aspect-ratio: 4/3; }
.hn-ranking__thumb--small { aspect-ratio: 1/1; }
.hn-ranking__thumb img,
.hn-ranking__thumb .hn-thumb-svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hn-rank-num {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #fff;
  color: var(--clay);
  font-family: 'Zen Maru Gothic', sans-serif;
  font-weight: 900;
  line-height: 1;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.hn-rank-num--large { font-size: 22px; padding: 8px 12px; }
.hn-rank-num--small { font-size: 16px; padding: 5px 9px; }
.hn-ranking__info { display: flex; flex-direction: column; gap: 6px; }
.hn-ranking__title {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-weight: 700;
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hn-ranking__title--large { font-size: 16px; }
.hn-ranking__title--small { font-size: 13px; }
.hn-ranking__meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.08em;
}

/* ============================================================
   記事カード（フィード）
   ============================================================ */
.hn-feed { margin-bottom: 40px; }
.hn-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 22px;
  padding: 22px 18px;
  margin-bottom: 12px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(40,38,30,0.04);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s;
}
.hn-card:hover { box-shadow: 0 4px 16px rgba(40,38,30,0.10); }
@media (max-width: 600px) {
  .hn-card { grid-template-columns: 1fr; }
}
.hn-card__thumb {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--paper-2);
  border-radius: 12px;
}
.hn-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hn-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.hn-card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.hn-card__date,
.hn-card__read {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--ink-3);
}
.hn-card__title {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-weight: 700;
  font-size: 19px;
  line-height: 1.55;
  margin: 0;
}
.hn-card__excerpt {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.8;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hn-card__tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 6px;
}

/* ============================================================
   カテゴリバッジ・タグチップ
   ============================================================ */
.hn-cat-badge {
  display: inline-flex;
  align-items: center;
  font-family: 'Zen Maru Gothic', sans-serif;
  font-weight: 700;
  color: #fff;
  border-radius: 999px;
}
.hn-cat-badge--normal { font-size: 11px; padding: 3px 10px; }
.hn-cat-badge--small  { font-size: 10px; padding: 2px 8px; }

.hn-tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-size: 11px;
  color: var(--ink-2);
  background: var(--paper-2);
  border-radius: 999px;
  font-weight: 500;
}

/* ============================================================
   サイドバー
   ============================================================ */
.hn-sidebar { font-size: 13px; }
.hn-sidebar-block { margin-bottom: 28px; }
.hn-sidebar-block__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--green);
}
.hn-sidebar-block__head h3 {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-weight: 900;
  font-size: 16px;
  margin: 0;
}

/* メルマガ登録 */
.hn-mailform { display: flex; flex-direction: column; gap: 8px; }
.hn-mailform input {
  border: 1px solid var(--line);
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 12px;
  background: #fff;
  font-family: inherit;
  outline: none;
}
.hn-mailform button {
  background: var(--green);
  color: #fff;
  border: none;
  padding: 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 10px;
  font-family: 'Zen Maru Gothic', sans-serif;
}

/* タグクラウド */
.hn-tagcloud { display: flex; flex-wrap: wrap; gap: 6px; }
.hn-tagcloud a {
  padding: 4px 10px;
  background: var(--paper-2);
  border-radius: 999px;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.1s;
}
.hn-tagcloud a:hover { opacity: 0.7; }

/* おすすめ記事リスト */
.hn-sidebar-list { list-style: none; padding: 0; margin: 0; }
.hn-sidebar-list__item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dotted var(--line);
  cursor: pointer;
}
.hn-sidebar-list__item:last-child { border-bottom: none; }
.hn-sidebar-list__thumb {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--paper-2);
  border-radius: 10px;
}
.hn-sidebar-list__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hn-sidebar-list__title {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 月別アーカイブ */
.hn-archive { list-style: none; padding: 0; margin: 0; }
.hn-archive li {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px dotted var(--line);
  font-size: 12.5px;
  color: var(--ink-2);
}
.hn-archive li:last-child { border-bottom: none; }
.hn-archive__count {
  font-family: 'JetBrains Mono', monospace;
  color: var(--ink-3);
}

/* ============================================================
   フッター
   ============================================================ */
.hn-footer {
  background: #2f2c25;
  color: #e8e0c8;
  margin-top: 60px;
}
.hn-footer__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 56px 32px 32px;
}
.hn-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
}
@media (max-width: 800px) {
  .hn-footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .hn-footer__grid { grid-template-columns: 1fr; }
}
.hn-footer__logo {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-weight: 900;
  font-size: 26px;
  color: #faf6ec;
  margin: 0 0 12px;
}
.hn-footer__desc {
  font-size: 13px;
  line-height: 1.9;
  color: #a69e86;
  max-width: 300px;
  margin: 0;
}
.hn-footer__col-title {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 12px;
  color: #c8bfa0;
  margin-bottom: 14px;
  font-weight: 700;
}
.hn-footer__links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.hn-footer__links a { font-size: 13px; color: #e8e0c8; text-decoration: none; }
.hn-footer__links a:hover { color: #fff; }
.hn-footer__bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #423e34;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #8a8470;
  flex-wrap: wrap;
  gap: 8px;
}
.hn-footer__copy { font-family: 'JetBrains Mono', monospace; }
.hn-footer__tagline { font-family: 'Zen Maru Gothic', sans-serif; font-size: 12px; }

/* ============================================================
   サムネイルプレースホルダー（アイキャッチ未設定時）
   ============================================================ */
.hn-thumb-placeholder {
  width: 100%;
  height: 100%;
  background: var(--paper-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
}

/* ============================================================
   Cocoon の幅制限をトップページで上書き
   Cocoon は #container, #main, .entry などに max-width を設定するため
   front-page.php を使うトップページではこれらをすべてリセットする
   ============================================================ */
body.home #container,
body.home #main,
body.home #contents,
body.home #contents-inner,
body.home .entry,
body.home .article,
body.home .main-wrap,
body.home .wrap,
body.home #wrap {
  max-width: none !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  float: none !important;
}

/* Cocoon のサイドバーをトップページで非表示 */
body.home #sidebar,
body.home .sidebar,
body.home #sub,
body.home .navi,
body.home .breadcrumb,
body.home .sns-follow,
body.home .pager-post-navi {
  display: none !important;
}

/* Cocoon のヘッダー・フッターを非表示
   （front-page.php が独自のヘッダー・フッターを持つため） */
body.home #header,
body.home #footer-widget-area,
body.home #footer {
  display: none !important;
}

/* body 自体の余白もリセット */
body.home {
  padding: 0 !important;
  margin: 0 !important;
}

/* ============================================================
   プロフィールブロック（サイドバー）
   ============================================================ */
.hn-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}
.hn-profile__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--paper-3);
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  flex-shrink: 0;
}
.hn-profile__avatar-img,
.hn-profile__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
.hn-profile__avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-3);
}
.hn-profile__name {
  font-size: 16px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1.3;
}
.hn-profile__bio {
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--ink-2);
  margin: 0;
  text-align: left;
}
.hn-profile__link {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  font-family: 'Zen Maru Gothic', sans-serif;
  padding: 6px 16px;
  border: 1.5px solid var(--green);
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.hn-profile__link:hover {
  background: var(--green);
  color: #fff;
}

/* ============================================================
   シンプルフッター（横並びリンク）
   ============================================================ */
.hn-footer__simple {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
  padding-bottom: 8px;
}
.hn-footer__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.hn-footer__brand .hn-footer__desc {
  max-width: 480px;
  text-align: center;
}
.hn-footer__links--row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 28px;
}
.hn-footer__links--row li { font-size: 13px; }
.hn-footer__links--row a {
  color: #e8e0c8;
  text-decoration: none;
  transition: color 0.15s;
}
.hn-footer__links--row a:hover { color: #fff; }
