/*
Theme Name: Imai Diary
Description: bitfan風ヒーローヘッダー&タブナビ + シンプル日記本文のオリジナルテーマ
Version: 1.0.0
Author: BulmaLLC
Text Domain: imai-diary
*/

:root {
  --bg: #f4f3f1;
  --text: #333333;
  --muted: #8a8a8a;
  --accent: #e0762e;
  --accent-dark: #c96420;
  --line-green: #06c755;
  --border: #dddddd;
  --serif: 'Cormorant Garamond', 'Noto Serif JP', serif;
  --sans: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.8;
  letter-spacing: 0.02em;
}

img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { opacity: 0.75; }
ul { list-style: none; }

/* ---------------------------------- hero ---------------------------------- */

.site-hero {
  position: relative;
  height: clamp(240px, var(--hero-h, 36vh), 640px);
  background-color: #b9c3c0;
  background-image: linear-gradient(135deg, #c3cdc9 0%, #dcd4c6 55%, #e9dfd0 100%);
  background-size: cover;
  background-position: var(--hero-pos-x, 50%) var(--hero-pos-y, 28%);
  background-repeat: no-repeat;
}

.site-hero.has-image { background-image: var(--hero-image); }

.hero-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 20px;
}

.hero-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(18px, 2vw, 26px);
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  color: #ffffff;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
  text-transform: uppercase;
  text-align: center;
}

.menu-toggle {
  position: absolute;
  left: 18px;
  top: 16px;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  z-index: 30;
}

.menu-toggle span {
  display: block;
  height: 2px;
  background: #ffffff;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
  border-radius: 2px;
}
.menu-toggle span:nth-child(1) { width: 26px; }
.menu-toggle span:nth-child(2) { width: 18px; }

/* ---------------------------------- nav ---------------------------------- */

.global-nav { background: var(--bg); }

.global-nav .nav-list {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  padding: 26px 16px 22px;
  flex-wrap: wrap;
}

.global-nav .nav-item { position: relative; }

.global-nav .nav-item > a,
.global-nav .nav-item > .nav-label {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: #444;
  cursor: pointer;
  display: inline-block;
  padding: 2px 2px;
}

.global-nav .nav-item.is-active > a { color: var(--accent); }

.global-nav .nav-item > a:hover,
.global-nav .nav-item:hover > .nav-label { color: var(--accent); opacity: 1; }

/* SNS dropdown */
.nav-item.has-dropdown .dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  padding: 8px 0;
  min-width: 170px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease;
  z-index: 40;
}

.nav-item.has-dropdown:hover .dropdown,
.nav-item.has-dropdown:focus-within .dropdown,
.nav-item.has-dropdown.is-open .dropdown {
  opacity: 1;
  visibility: visible;
}

.dropdown li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  font-size: 13.5px;
  letter-spacing: 0.06em;
}
.dropdown li a:hover { background: #f7f5f2; opacity: 1; color: var(--accent); }

.sns-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-block;
  vertical-align: middle;
}

/* ------------------------------ profile strip ------------------------------ */

.profile-strip-wrap { padding: 6px 16px 0; }

.profile-strip {
  max-width: 760px;
  margin: 0 auto;
  background: #ebe9e6;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
}

.profile-strip .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: #cfd8d4;
  flex: 0 0 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  color: #ffffff;
  font-size: 18px;
}
.profile-strip .avatar img { width: 100%; height: 100%; object-fit: cover; }

.profile-strip .strip-name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.08em;
  flex: 1 1 auto;
}

.strip-button {
  background: var(--accent);
  color: #ffffff !important;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 9px 22px;
  white-space: nowrap;
}
.strip-button:hover { background: var(--accent-dark); opacity: 1; }

/* ------------------------------- diary list ------------------------------- */

.diary-section { padding: clamp(40px, 7vw, 90px) 20px 60px; }

.diary-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  align-items: start;
}

.section-heading {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(34px, 3.6vw, 44px);
  letter-spacing: 0.12em;
  color: #4a4a4a;
  line-height: 1.2;
}

.section-heading .heading-ja {
  display: block;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--muted);
  margin-top: 8px;
}

.entry-list { border-bottom: 1px solid var(--border); }

.entry-item {
  border-top: 1px solid var(--border);
  padding: 26px 6px;
}

.entry-item .entry-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.6;
  display: inline;
}

.new-badge {
  display: inline-block;
  border: 1px solid #e0311f;
  color: #e0311f;
  background: #ffffff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 3px;
  margin-left: 10px;
  vertical-align: 2px;
}

.entry-cat {
  font-size: 12px;
  font-weight: 700;
  color: #555;
  margin-top: 10px;
}

.entry-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 6px;
}

.entry-meta .meta-icon {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-right: 4px;
  fill: var(--muted);
}

.entry-excerpt {
  font-size: 13.5px;
  color: #666;
  margin-top: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* pagination */
.pagination-nav { margin-top: 34px; text-align: center; }
.pagination-nav .nav-links {
  display: inline-flex;
  gap: 8px;
  font-family: var(--serif);
  font-size: 15px;
}
.pagination-nav .page-numbers {
  display: inline-block;
  min-width: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  border-radius: 4px;
  color: #555;
}
.pagination-nav .page-numbers.current {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

/* ------------------------------- LINE banner ------------------------------- */

.line-banner-section { padding: 30px 20px 70px; }

.line-banner {
  display: block;
  max-width: 760px;
  margin: 0 auto;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}
.line-banner:hover { opacity: 0.9; }

.line-banner img { display: block; width: 100%; }

.line-banner-default {
  background: linear-gradient(120deg, #06c755 0%, #05b34c 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 30px 24px;
}

.line-banner-default .line-mark {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
}

.line-banner-default .line-text .line-small {
  display: block;
  font-size: 12px;
  letter-spacing: 0.2em;
  opacity: 0.9;
}

.line-banner-default .line-text .line-big {
  display: block;
  font-size: clamp(17px, 2.4vw, 22px);
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-top: 4px;
}

/* --------------------------------- footer --------------------------------- */

.site-footer {
  background: #3a3a3a;
  color: #cccccc;
  text-align: center;
  padding: 30px 20px;
}

.site-footer .footer-title {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.25em;
  text-indent: 0.25em;
  color: #ffffff;
  text-transform: uppercase;
}

.site-footer .copyright {
  font-size: 11px;
  letter-spacing: 0.1em;
  margin-top: 10px;
  color: #999;
}

/* ------------------------------ single / page ------------------------------ */

.content-area { padding: clamp(30px, 5vw, 60px) 20px 60px; }

.breadcrumb {
  max-width: 780px;
  margin: 0 auto 16px;
  font-size: 12px;
  color: var(--muted);
}
.breadcrumb a { color: var(--muted); text-decoration: underline; }

.article-card {
  max-width: 780px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 8px;
  padding: clamp(28px, 5vw, 56px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.article-title {
  font-size: clamp(21px, 3vw, 27px);
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.03em;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
}

.article-meta .cat-chip {
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 12px;
}

.article-thumb { margin-top: 26px; }
.article-thumb img { border-radius: 6px; }

.article-body { margin-top: 30px; font-size: 15.5px; line-height: 2.05; }
.article-body p { margin-bottom: 1.9em; }
.article-body h2 {
  font-size: 19px;
  border-left: 4px solid var(--accent);
  padding-left: 12px;
  margin: 2.4em 0 1.2em;
  line-height: 1.5;
}
.article-body h3 { font-size: 17px; margin: 2em 0 1em; }
.article-body img { border-radius: 6px; margin: 0.5em 0; }
.article-body a { color: var(--accent); text-decoration: underline; }
.article-body blockquote {
  border-left: 3px solid var(--border);
  padding: 4px 0 4px 16px;
  color: #666;
  margin-bottom: 1.9em;
}

/* prev / next */
.post-nav {
  max-width: 780px;
  margin: 26px auto 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
}
.post-nav a {
  flex: 0 1 48%;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  color: #555;
  line-height: 1.5;
}
.post-nav .nav-next { text-align: right; }
.post-nav .nav-dir {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.15em;
  margin-bottom: 4px;
}

/* related */
.related-section { max-width: 780px; margin: 46px auto 0; }
.related-section .related-heading {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.15em;
  color: #4a4a4a;
  margin-bottom: 6px;
}
.related-section .entry-list { border-bottom: 1px solid var(--border); }
.related-section .entry-item { padding: 18px 4px; }
.related-section .entry-title { font-size: 15px; }

/* comments (WPデフォルト出力の軽い整形) */
.comments-wrap { max-width: 780px; margin: 46px auto 0; }
.comments-wrap .comments-title,
.comments-wrap .comment-reply-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
}
.comments-wrap ol.comment-list { list-style: none; }
.comments-wrap .comment-body {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 12px;
  font-size: 14px;
}
.comments-wrap .comment-meta { font-size: 12px; color: var(--muted); }
.comments-wrap .reply { font-size: 12px; margin-top: 6px; }
.comments-wrap .comment-form label { display: block; font-size: 13px; margin-bottom: 4px; }
.comments-wrap .comment-form input[type='text'],
.comments-wrap .comment-form input[type='email'],
.comments-wrap .comment-form input[type='url'],
.comments-wrap .comment-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 14px;
  font-family: var(--sans);
  font-size: 14px;
  background: #ffffff;
}
.comments-wrap .comment-form .submit {
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 10px 34px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.comments-wrap .comment-form .submit:hover { background: var(--accent-dark); }

/* ----------------------------- single sidebar ----------------------------- */

.single-layout {
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 44px;
  align-items: start;
}

.single-main { min-width: 0; }

.single-sidebar { position: sticky; top: 24px; }

.side-widget { margin-bottom: 34px; }

.side-heading {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 2px solid #444;
}

/* 検索 */
.side-search {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
}
.side-search input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  outline: none;
  padding: 10px 12px;
  font-family: var(--sans);
  font-size: 14px;
  background: transparent;
}
.side-search button {
  flex: 0 0 44px;
  border: none;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.side-search button svg { width: 20px; height: 20px; }
.side-search button:hover { background: var(--accent-dark); }

/* 最近の投稿（サムネ付き） */
.side-posts li { margin-bottom: 16px; }

.side-post {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.side-post:hover { opacity: 0.8; }

.side-thumb {
  flex: 0 0 86px;
  width: 86px;
  height: 86px;
  border-radius: 4px;
  overflow: hidden;
  background: #e4e0da;
  display: block;
}
.side-thumb img,
.side-thumb-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.side-thumb-placeholder {
  background: linear-gradient(135deg, #c3cdc9 0%, #e9dfd0 100%);
}

.side-post-body { min-width: 0; }

.side-post-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.55;
}

.side-post-meta {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 6px;
}

/* カテゴリ */
.side-cats li { border-bottom: 1px solid var(--border); }
.side-cats li a {
  display: block;
  padding: 10px 2px;
  font-size: 13.5px;
}
.side-cats li a:hover { color: var(--accent); opacity: 1; }

@media (max-width: 960px) {
  .single-layout { grid-template-columns: 1fr; gap: 10px; }
  .single-sidebar { position: static; margin-top: 40px; }
}

/* ---------------------------------- 404 ---------------------------------- */

.notfound {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
  padding: 60px 0;
}
.notfound .nf-code {
  font-family: var(--serif);
  font-size: 60px;
  color: #b9b3aa;
  letter-spacing: 0.1em;
}

/* -------------------------------- responsive ------------------------------- */

@media (max-width: 860px) {
  .diary-inner { grid-template-columns: 1fr; gap: 18px; }
  .section-heading { font-size: 30px; }
}

@media (max-width: 640px) {
  .site-hero { height: clamp(220px, 52vw, 340px); }

  .menu-toggle { display: flex; }

  .global-nav {
    position: fixed;
    inset: 0;
    background: rgba(244, 243, 241, 0.98);
    z-index: 20;
    display: none;
    padding-top: 80px;
    overflow-y: auto;
  }
  .global-nav.is-open { display: block; }

  .global-nav .nav-list {
    flex-direction: column;
    gap: 26px;
    padding-top: 10px;
  }

  body.nav-open .menu-toggle span { background: #555; box-shadow: none; }
  body.nav-open .menu-toggle span:nth-child(1) { transform: translateY(4.5px) rotate(45deg); width: 24px; }
  body.nav-open .menu-toggle span:nth-child(2) { transform: translateY(-4.5px) rotate(-45deg); width: 24px; }

  .nav-item.has-dropdown .dropdown {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    border: none;
    box-shadow: none;
    background: transparent;
    text-align: center;
    padding-top: 4px;
  }
  .dropdown li a { justify-content: center; }

  .profile-strip { flex-wrap: wrap; }
  .profile-strip .strip-name { font-size: 14px; }
  .strip-button { padding: 8px 18px; font-size: 12px; }

  .post-nav { flex-direction: column; }
  .post-nav a { flex-basis: auto; }
  .post-nav .nav-next { text-align: left; }
}
