/*
Theme Name: 八ノ屋 日記
Description: hachinoya.co/diary 専用テーマ。サイト本体（静的HTML）と同じヘッダー・書体・コピーライトで、日記の一覧と記事を表示する。
Version: 1.0
Author: 八ノ屋株式会社
Text Domain: hachinoya-diary
*/

.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
/* 現行サイトと共通の色・書体の設定 */
:root {
  --white:  #ffffff;
  --black:  #000000;
  --muted:  #8a8f96;
  --accent: #1A5C3A;
  --line:   rgba(0,0,0,.09);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: hidden; max-width: 100%; }
body { font-family: 'Noto Sans JP', sans-serif; color: var(--black); background: var(--white); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: hidden; max-width: 100%; }
a { color: inherit; text-decoration: none; }

    /* ── 新ヘッダー（A：小さいロゴを中央上、その下に横書きメニュー） ── */
    .site-header {
      display: flex; flex-direction: column; align-items: center; gap: 28px;
      padding: 48px 16px 0;
      color: var(--accent);
    }
    .site-header .logo { display: block; line-height: 0; }
    .site-header .logo svg { display: block; width: auto; height: 56px; overflow: visible; }
    .site-header .menu ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 32px; }
    .site-header .menu a { font-family: 'Noto Sans JP', sans-serif; font-size: 14px; letter-spacing: .2em; transition: opacity .2s ease; }
    .lbl-short { display: none; }
    .site-header .menu a:hover, .site-header .menu a:focus-visible { opacity: .5; }
    .site-header .menu a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
    @media (max-width: 600px) {
    .site-header { padding: 32px 16px 0; gap: 20px; }
    .site-header .logo svg { height: 44px; }
    /* スマホは5項目を1行に収める：代表プロフィール→代表、お問い合わせ→問い合わせ。字間はPCと同じ0.2em */
    .site-header .menu ul { gap: 8px 12px; gap: 8px min(32px, calc((100vw - 278px) / 4)); }  /* 項目の間は1行に収まる範囲で最大32px（画面幅に合わせて自動） */
    .site-header .menu a { font-size: 13px; letter-spacing: .2em; }
    .lbl-full { display: none; }
    .lbl-short { display: inline; }
    }
    /* 全ページ共通：コピーライトは画面の下から32px（トップと同じ位置）。中身が長いときは本文の下 */
    body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; }
    .copy {
      margin-top: auto;
      text-align: center; color: var(--accent);
      font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 300; letter-spacing: .08em;
      padding: 32px 16px;
    }
    @media (max-height: 480px) {
    .copy { padding-bottom: 16px; }
    }

/* ===== 日記の一覧（会社概要の表と同じ線・書体・色）。一覧＋ページ送りのかたまりを、メニューとコピーライトの間の真ん中に置く ===== */
.diary-index {
  width: 100%; max-width: calc(640px + 3rem); margin: 0 auto;
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: 40px 1.5rem 8px;
}
.diary-list { list-style: none; border-top: 1px solid var(--line); }
.diary-list li { border-bottom: 1px solid var(--line); }
.diary-item {
  display: grid; grid-template-columns: 140px 1fr; gap: 1.5rem; align-items: baseline;
  padding: 1.4rem 0; transition: opacity .2s ease;
}
.diary-item:hover, .diary-item:focus-visible { opacity: .5; }
.diary-date { font-family: 'Inter', sans-serif; font-size: .8125rem; font-weight: 400; color: var(--accent); letter-spacing: .06em; }
.diary-title { font-size: .9375rem; color: var(--black); line-height: 1.8; }
.diary-empty { text-align: center; font-size: 1rem; letter-spacing: .1em; }

/* ページ送り */
.pager { display: flex; justify-content: center; align-items: center; gap: 1.5rem; margin-top: 2.5rem; font-family: 'Inter', sans-serif; font-size: .8125rem; color: var(--accent); letter-spacing: .06em; }
.pager a { transition: opacity .2s ease; }
.pager a:hover, .pager a:focus-visible { opacity: .5; }
.pager .current { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.pager .prev, .pager .next { font-family: 'Noto Sans JP', sans-serif; }

@media (max-width: 36em) {
  .diary-index { padding-top: 32px; padding-bottom: 0; }
  .diary-item { grid-template-columns: 1fr; gap: .25rem; padding: 1.1rem 0; }
}

/* ===== 日記の記事。スクロールOK。メニューの下の空きは他の下層ページと同じ（PC 72px／スマホ 40px） ===== */
.diary-post { width: 100%; max-width: calc(640px + 3rem); margin: 0 auto; padding: 72px 1.5rem 0; }
.post-head { margin-bottom: 3rem; }
.post-date { display: block; font-family: 'Inter', sans-serif; font-size: .75rem; color: var(--muted); letter-spacing: .06em; margin-bottom: .9rem; }
.post-title { font-weight: 600; font-size: 1.625rem; line-height: 1.6; color: var(--black); letter-spacing: .02em; }

/* 本文 */
.post-body { font-size: 1rem; line-height: 2.1; color: #222; letter-spacing: .02em; }
.post-body > * + * { margin-top: 1.6em; }
.post-body h2 { font-weight: 600; font-size: 1.25rem; line-height: 1.6; color: var(--black); margin-top: 3em; padding-top: 1.2em; border-top: 1px solid var(--line); }
.post-body h3 { font-weight: 600; font-size: 1.0625rem; line-height: 1.7; color: var(--black); margin-top: 2.4em; }
.post-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.post-body a:hover { text-decoration-thickness: 2px; }
.post-body strong { font-weight: 600; }
.post-body ul, .post-body ol { padding-left: 1.4em; }
.post-body li + li { margin-top: .4em; }
.post-body blockquote { border-left: 2px solid rgba(26,92,58,.4); padding: .2em 0 .2em 1.3em; color: #555; }
.post-body figure img, .post-body img { display: block; max-width: 100%; height: auto; }
.post-body figure img { width: 100%; }
.post-body figcaption { font-size: .75rem; color: var(--muted); margin-top: .6em; line-height: 1.7; }

/* 記事の下：前後の日記と一覧へ */
.post-nav { margin-top: 4.5rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; }
.post-nav.single { grid-template-columns: 1fr; }
.post-nav a { display: flex; flex-direction: column; gap: .35rem; padding: 1.3rem 0; transition: opacity .2s ease; }
.post-nav a:hover, .post-nav a:focus-visible { opacity: .5; }
.post-nav:not(.single) .next { text-align: right; border-left: 1px solid var(--line); padding-left: 1.5rem; }
.post-nav:not(.single) .prev { padding-right: 1.5rem; }
.post-nav.single .next { text-align: right; }
.post-nav .lbl { font-size: .7rem; color: var(--accent); }
.post-nav .ttl { font-size: .875rem; line-height: 1.7; color: var(--black); }
.to-list { display: block; width: max-content; margin: 2.5rem auto 0; font-size: .8125rem; color: var(--accent); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.to-list:hover { opacity: .5; }

@media (max-width: 600px) {
  .diary-post { padding-top: 40px; }
}
@media (max-width: 36em) {
  .post-title { font-size: 1.3125rem; }
  .post-body { font-size: .9375rem; line-height: 2; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav:not(.single) .next { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; }
  .post-nav:not(.single) .prev { padding-right: 0; }
}

/* 見つからないページ（日記の中） */
.diary-404 { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 1.5rem; padding: 40px 1.5rem 8px; text-align: center; }
.diary-404 p { font-size: .9375rem; line-height: 2; }
