/*
Theme Name: いのここだより
Theme URI: https://inococo.com/journal
Author: いのちと心の絆プロジェクト
Description: いのここプロジェクト専用テーマ。温かみのあるナチュラルなデザイン。
Version: 1.0
*/

/* ── VARIABLES ── */
:root {
  --pink-deep: #b5606a;
  --pink-mid: #c97f87;
  --pink-soft: #e8b4b8;
  --pink-pale: #f5dfe1;
  --pink-whisper: #fdf4f4;
  --green-sage: #7a9e8a;
  --green-light: #a8c5b0;
  --cream: #faf7f2;
  --warm-white: #fefcf9;
  --text-dark: #3a2f2f;
  --text-mid: #6b5555;
  --text-light: #9e8585;
  --gold: #c4a882;
  --gold-light: #e8d9c4;
}

/* ── RESET ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: 'Noto Serif JP', serif;
  background: var(--warm-white);
  color: var(--text-dark);
  line-height: 1.9;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

img { max-width: 100%; height: auto; display: block; }

/* ── 全要素の横はみ出し防止 ── */
* {
  min-width: 0;
}

table, pre, code, iframe, embed, object,
.wp-block-table, .wp-block-code,
.wp-block-cover, .wp-block-group {
  max-width: 100%;
  overflow-x: auto;
}

pre, code {
  white-space: pre-wrap;
  word-break: break-all;
}
a { color: var(--pink-deep); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--pink-mid); }

/* ── NAVIGATION ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(254,252,249,0.93);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gold-light);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

.site-branding a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.site-branding .brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.site-branding .brand-name {
  font-family: 'Zen Kurenaido', cursive;
  font-size: 1.1rem;
  color: var(--pink-deep);
  letter-spacing: 0.15em;
  line-height: 1;
}

.site-branding .brand-sub {
  font-family: 'Noto Serif JP', serif;
  font-size: 0.55rem;
  color: var(--text-light);
  letter-spacing: 0.18em;
}

.main-nav ul {
  display: flex;
  gap: 28px;
  list-style: none;
}

.main-nav a {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  color: var(--text-mid);
  text-decoration: none;
  transition: color 0.3s;
  position: relative;
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 1px;
  background: var(--pink-mid);
  transition: width 0.3s;
}

.main-nav a:hover,
.main-nav .current-menu-item a { color: var(--pink-deep); }
.main-nav a:hover::after,
.main-nav .current-menu-item a::after { width: 100%; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px; height: 36px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
  z-index: 200;
}

.hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: var(--pink-deep);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(254,252,249,0.97);
  backdrop-filter: blur(16px);
  z-index: 150;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
}

.mobile-menu.open { display: flex; }

.mobile-menu a {
  font-family: 'Shippori Mincho', serif;
  font-size: 1.2rem;
  color: var(--text-dark);
  text-decoration: none;
  letter-spacing: 0.2em;
}

.mobile-menu-close {
  position: absolute;
  top: 24px; right: 24px;
  font-size: 1.8rem;
  color: var(--text-light);
  background: none;
  border: none;
  cursor: pointer;
}

/* ── PAGE HERO ── */
.journal-hero {
  padding: 80px 0 56px;
  background: linear-gradient(160deg, var(--cream) 0%, var(--pink-whisper) 100%);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.journal-hero::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: var(--pink-pale);
  opacity: 0.35;
  top: -150px; right: -80px;
  pointer-events: none;
}

.journal-hero-inner { position: relative; z-index: 1; }

.journal-hero .section-label {
  font-size: 0.65rem;
  letter-spacing: 0.4em;
  color: var(--pink-mid);
  margin-bottom: 12px;
}

.journal-hero h1 {
  font-family: 'Shippori Mincho', serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 500;
  color: var(--text-dark);
  letter-spacing: 0.12em;
  margin-bottom: 12px;
}

.journal-hero p {
  font-size: 0.85rem;
  color: var(--text-light);
  letter-spacing: 0.1em;
}

/* ── LAYOUT ── */
.site-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 64px 48px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 64px;
  align-items: start;
}

/* ── POST LIST ── */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.post-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 32px rgba(0,0,0,0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 48px rgba(181,96,106,0.12);
}

.post-card-thumb {
  width: 100%;
  aspect-ratio: 16/7;
  overflow: hidden;
  background: var(--pink-pale);
}

.post-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.post-card:hover .post-card-thumb img { transform: scale(1.04); }

.post-card-body { padding: 32px 36px 36px; }

.post-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.post-date {
  font-size: 0.72rem;
  color: var(--text-light);
  letter-spacing: 0.12em;
}

.post-cat {
  font-size: 0.65rem;
  padding: 4px 12px;
  background: var(--pink-whisper);
  border: 1px solid var(--pink-pale);
  border-radius: 20px;
  color: var(--pink-mid);
  letter-spacing: 0.1em;
  text-decoration: none;
  transition: background 0.3s;
}

.post-cat:hover { background: var(--pink-pale); }

.post-card-body h2 {
  font-family: 'Shippori Mincho', serif;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-dark);
  line-height: 1.8;
  margin-bottom: 14px;
  letter-spacing: 0.06em;
}

.post-card-body h2 a {
  color: var(--text-dark);
  text-decoration: none;
}

.post-card-body h2 a:hover { color: var(--pink-deep); }

.post-excerpt {
  font-size: 0.85rem;
  color: var(--text-mid);
  line-height: 2.2;
  letter-spacing: 0.04em;
  margin-bottom: 24px;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--pink-deep);
  letter-spacing: 0.15em;
  border-bottom: 1px solid var(--pink-soft);
  padding-bottom: 3px;
  text-decoration: none;
  transition: gap 0.3s, color 0.3s;
}

.read-more:hover { gap: 12px; color: var(--pink-mid); }

/* ── SINGLE POST ── */
.single-post-hero {
  width: 100%;
  aspect-ratio: 16/6;
  overflow: hidden;
  background: var(--pink-pale);
}

.single-post-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.single-post-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 64px 48px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 64px;
  align-items: start;
}

.single-post-header {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--gold-light);
}

.single-post-header .post-meta { margin-bottom: 20px; }

.single-post-header h1 {
  font-family: 'Shippori Mincho', serif;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 500;
  color: var(--text-dark);
  line-height: 1.8;
  letter-spacing: 0.06em;
}

/* ── POST CONTENT ── */
.post-content {
  font-size: 0.95rem;
  color: var(--text-mid);
  line-height: 2.6;
  letter-spacing: 0.04em;
}

.post-content h2 {
  font-family: 'Shippori Mincho', serif;
  font-size: 1.3rem;
  color: var(--text-dark);
  margin: 48px 0 20px;
  padding-left: 16px;
  border-left: 3px solid var(--pink-soft);
  letter-spacing: 0.06em;
}

.post-content h3 {
  font-family: 'Shippori Mincho', serif;
  font-size: 1.1rem;
  color: var(--text-dark);
  margin: 36px 0 16px;
  letter-spacing: 0.06em;
}

.post-content p { margin-bottom: 24px; }

.post-content img {
  border-radius: 12px;
  margin: 32px 0;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

.post-content .wp-block-image figcaption {
  font-size: 0.78rem;
  color: var(--text-light);
  text-align: center;
  margin-top: 8px;
  letter-spacing: 0.08em;
}

/* YouTube embed */
.post-content .wp-block-embed,
.post-content .wp-video,
.post-content iframe {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  margin: 32px 0;
}

.post-content .wp-block-embed__wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
}

.post-content .wp-block-embed__wrapper iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border-radius: 12px;
  margin: 0;
}

/* ── PAGINATION ── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 56px;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  font-size: 0.82rem;
  color: var(--text-mid);
  border: 1px solid var(--gold-light);
  text-decoration: none;
  transition: all 0.3s;
}

.pagination a:hover { background: var(--pink-pale); border-color: var(--pink-soft); color: var(--pink-deep); }
.pagination .current { background: var(--pink-deep); border-color: var(--pink-deep); color: white; }

/* Post navigation */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--gold-light);
}

.post-nav a {
  font-size: 0.82rem;
  color: var(--text-mid);
  text-decoration: none;
  letter-spacing: 0.06em;
  line-height: 1.7;
  transition: color 0.3s;
}

.post-nav a:hover { color: var(--pink-deep); }
.post-nav .nav-next { text-align: right; }
.post-nav .nav-label {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  color: var(--pink-mid);
  margin-bottom: 6px;
}

/* ── SIDEBAR ── */
.sidebar { position: sticky; top: 88px; }

.widget {
  background: white;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.05);
  margin-bottom: 28px;
}

.widget-title {
  font-family: 'Shippori Mincho', serif;
  font-size: 0.85rem;
  color: var(--pink-deep);
  letter-spacing: 0.15em;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--pink-pale);
}

/* Search */
.search-form {
  display: flex;
  gap: 8px;
}

.search-form input[type="search"] {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--gold-light);
  border-radius: 8px;
  font-family: 'Noto Serif JP', serif;
  font-size: 0.82rem;
  color: var(--text-dark);
  background: var(--warm-white);
  outline: none;
  transition: border-color 0.3s;
}

.search-form input[type="search"]:focus { border-color: var(--pink-soft); }

.search-form button {
  padding: 10px 16px;
  background: var(--pink-deep);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  letter-spacing: 0.1em;
  transition: background 0.3s;
}

.search-form button:hover { background: var(--pink-mid); }

/* Categories */
.cat-list { list-style: none; }

.cat-list li {
  padding: 8px 0;
  border-bottom: 1px dotted var(--gold-light);
}

.cat-list li:last-child { border-bottom: none; }

.cat-list a {
  font-size: 0.82rem;
  color: var(--text-mid);
  text-decoration: none;
  letter-spacing: 0.06em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color 0.3s;
}

.cat-list a:hover { color: var(--pink-deep); }

.cat-list .count {
  font-size: 0.7rem;
  color: var(--text-light);
  background: var(--cream);
  padding: 2px 8px;
  border-radius: 10px;
}

/* Recent posts */
.recent-posts { list-style: none; }

.recent-posts li {
  padding: 12px 0;
  border-bottom: 1px dotted var(--gold-light);
}

.recent-posts li:last-child { border-bottom: none; }

.recent-posts a {
  font-size: 0.82rem;
  color: var(--text-mid);
  text-decoration: none;
  line-height: 1.7;
  letter-spacing: 0.04em;
  display: block;
  transition: color 0.3s;
}

.recent-posts a:hover { color: var(--pink-deep); }

.recent-posts .recent-date {
  font-size: 0.68rem;
  color: var(--text-light);
  letter-spacing: 0.1em;
  margin-top: 4px;
  display: block;
}

/* Back to top link */
.back-to-site {
  display: block;
  text-align: center;
  padding: 14px;
  background: var(--pink-whisper);
  border: 1px solid var(--pink-pale);
  border-radius: 12px;
  font-size: 0.75rem;
  color: var(--pink-mid);
  letter-spacing: 0.15em;
  text-decoration: none;
  transition: background 0.3s;
}

.back-to-site:hover { background: var(--pink-pale); color: var(--pink-deep); }

/* ── FOOTER ── */
.site-footer {
  background: var(--text-dark);
  padding: 56px 0 28px;
  margin-top: 80px;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 48px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand {
  font-family: 'Zen Kurenaido', cursive;
  font-size: 1.2rem;
  color: var(--pink-soft);
  letter-spacing: 0.15em;
}

.footer-brand p {
  font-family: 'Noto Serif JP', serif;
  font-size: 0.65rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.2em;
  margin-top: 8px;
}

.footer-nav ul { list-style: none; display: flex; gap: 32px; }

.footer-nav a {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  letter-spacing: 0.08em;
  transition: color 0.3s;
}

.footer-nav a:hover { color: var(--pink-soft); }

.footer-bottom {
  text-align: center;
  font-size: 0.68rem;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.15em;
}

/* ── NO RESULTS ── */
.no-results {
  text-align: center;
  padding: 80px 0;
  color: var(--text-light);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .header-inner { padding: 14px 20px; }
  .site-main,
  .single-post-wrap { grid-template-columns: 1fr; padding: 40px 20px; }
  .sidebar { position: static; }
  .footer-top { flex-direction: column; gap: 24px; }
  .footer-inner { padding: 0 20px; }
  .footer-nav ul { flex-wrap: wrap; gap: 16px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-card-body { padding: 24px 20px 28px; }
  .journal-hero { padding: 60px 20px 40px; }
}

@media (max-width: 600px) {
  .main-nav { display: none; }
  .hamburger { display: flex; }
  .single-post-hero { aspect-ratio: 16/9; }
  .header-inner { padding: 12px 16px; }
  .site-main,
  .single-post-wrap { padding: 32px 16px; }
  .footer-inner { padding: 0 16px; }
  .post-card-body { padding: 20px 16px 24px; }
  .journal-hero { padding: 48px 16px 32px; }
  .single-post-header h1 { font-size: 1.2rem; }
  .widget { padding: 20px 16px; }
  .post-content h2 { font-size: 1.1rem; }
  .post-content { font-size: 0.9rem; }
  .footer-nav ul { flex-direction: column; gap: 12px; }
}

/* 全デバイス共通：横スクロール防止 */
html, body { max-width: 100%; overflow-x: hidden; }

.site-header, .site-main, .single-post-wrap,
.journal-hero, .site-footer { max-width: 100%; overflow-x: hidden; }

.post-content img,
.post-content iframe,
.post-content .wp-block-embed__wrapper { max-width: 100%; }

/* ── AUTHOR BOX ── */
.author-box {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--gold-light);
  text-align: right !important;
}

.author-box .author-line {
  font-size: 0.75rem;
  color: var(--text-light);
  letter-spacing: 0.2em;
}

.author-box .author-line span {
  color: var(--text-mid);
  font-style: italic;
}
